From 35e5ac14785e3ca121abcaf8ff0baab9a47fed52 Mon Sep 17 00:00:00 2001 From: Aaron Choo Date: Wed, 25 Oct 2023 15:46:45 +0800 Subject: [PATCH] fix: broadcast example --- examples/solid-vite/src/App.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/solid-vite/src/App.tsx b/examples/solid-vite/src/App.tsx index e344a281..67a3e19f 100644 --- a/examples/solid-vite/src/App.tsx +++ b/examples/solid-vite/src/App.tsx @@ -196,12 +196,15 @@ const App: Component = () => { const fee = await wallet.estimateFee(tx); console.log("Tx fee:", fee); - const { txResponse } = await wallet.broadcastTx(tx, fee); - console.log("Tx result:", txResponse); + const txHash = await wallet.broadcastTx(tx, fee); + console.log("Tx hash:", txHash); + + const { txResponse } = await wallet.pollTx(txHash); + console.log("Tx response:", txResponse); alert( "Broadcast success!\n\nTx hash: " + - txResponse.txhash + + txHash + "\n\nCheck console logs for details." ); } catch (err) {