From 71e7afbe101603b1139145b7bcb8d2bbe6f5060e Mon Sep 17 00:00:00 2001 From: "Rob Moore (MakerX)" Date: Mon, 22 Jan 2024 11:28:01 +0800 Subject: [PATCH] Use full algokit functionality --- src/App.tsx | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 153c285..74fda77 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -27,28 +27,19 @@ const App: Component = () => { onMount(() => reconnectWallet()) - const transactionSignerAccount = createMemo(() => ({ - addr: address(), - signer: transactionSigner, - })) + const transactionSignerAccount = createMemo(() => algokit.transactionSignerAccount(transactionSigner, address())) async function sendTxn() { setConfirmedTxn("") - const suggestedParams = await algodClient().getTransactionParams().do() - const payTxn = makePaymentTxnWithSuggestedParamsFromObject({ - from: address(), - to: address(), - amount: 0, - suggestedParams, - }) - const txn = await algokit.getTransactionWithSigner(payTxn, transactionSignerAccount()) + const result = await algokit.transferAlgos({ + amount: (0).algos(), + from: transactionSignerAccount(), + to: transactionSignerAccount() + }, algodClient()) - const atc = new AtomicTransactionComposer() - atc.addTransaction(txn) - const result = await atc.execute(algodClient(), 4) console.log("Txn confirmed: ", result) - setConfirmedTxn(result.txIDs[0]) + setConfirmedTxn(result.transaction.txID()) } return (