From ad9110f3a5794a293dbc8826dddd32f702f34d1d Mon Sep 17 00:00:00 2001 From: "Rob Moore (MakerX)" Date: Mon, 22 Jan 2024 11:28:01 +0800 Subject: [PATCH] Hybrid algosdk / algokit --- src/App.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 153c285..a2b19a6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -27,10 +27,7 @@ const App: Component = () => { onMount(() => reconnectWallet()) - const transactionSignerAccount = createMemo(() => ({ - addr: address(), - signer: transactionSigner, - })) + const transactionSignerAccount = createMemo(() => algokit.transactionSignerAccount(transactionSigner, address())) async function sendTxn() { setConfirmedTxn("") @@ -42,13 +39,14 @@ const App: Component = () => { amount: 0, suggestedParams, }) - const txn = await algokit.getTransactionWithSigner(payTxn, transactionSignerAccount()) - const atc = new AtomicTransactionComposer() - atc.addTransaction(txn) - const result = await atc.execute(algodClient(), 4) + const result = await algokit.sendTransaction({ + from: transactionSignerAccount(), + transaction: payTxn, + }, algodClient()) + console.log("Txn confirmed: ", result) - setConfirmedTxn(result.txIDs[0]) + setConfirmedTxn(result.transaction.txID()) } return (