Skip to content

Commit

Permalink
Update chain-abstraction.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
ganchoradkov authored Dec 20, 2024
1 parent 995f5b2 commit 02400fa
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions docs/walletkit/react-native/chain-abstraction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,19 @@ walletkit.on("session_request", async (event) => {
const signedTransaction = await wallet.signTransaction(transaction);
await wallet.sendTransaction(signedTransaction);
}
// await for the completed fulfilment status
await statusResult = await wallet.status({
fulfilmentId
});

// Monitor bridging status
const statusInterval = setInterval(async () => {
const statusReponse = await wallet.status({ fulfilmentId });

if (statusResponse.status === "completed") {
clearInterval(statusInterval);
// Proceed with original transaction
const signedTransaction = await wallet.signTransaction(originalTransaction);
const result = await wallet.sendTransaction(signedTransaction);

await wallet.respondSessionRequest({
topic,
response: formatJsonRpcResult(id, result)
});
}
}, checkIn);
// Proceed with original transaction
const signedTransaction = await wallet.signTransaction(originalTransaction);
const result = await wallet.sendTransaction(signedTransaction);

await wallet.respondSessionRequest({
topic,
response: formatJsonRpcResult(id, result)
});
} else {
// No bridging required, process transaction normally
const signedTransaction = await wallet.signTransaction(originalTransaction);
Expand Down Expand Up @@ -188,4 +184,4 @@ For example, check out implementation of chain abstraction in [sample wallet](ht
To test Chain Abstraction, you can use the [AppKit laboratory](https://appkit-lab.reown.com/library/wagmi/) and try sending USDC with any chain abstraction supported wallet.
You can also use this [sample wallet](https://appdistribution.firebase.google.com/testerapps/1:222905275039:android:799d1c9291d92ebe8c88aa/releases/7tkfoelis7n08) for testing.

{/* TODO: Add a demo video here */}
{/* TODO: Add a demo video here */}

0 comments on commit 02400fa

Please sign in to comment.