Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit 40057e3

Browse files
committed
Use full algokit functionality
1 parent aaa07a5 commit 40057e3

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

src/App.tsx

+7-16
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,19 @@ const App: Component = () => {
2727

2828
onMount(() => reconnectWallet())
2929

30-
const transactionSignerAccount = createMemo<TransactionSignerAccount>(() => ({
31-
addr: address(),
32-
signer: transactionSigner,
33-
}))
30+
const transactionSignerAccount = algokit.transactionSignerAccount(transactionSigner, address())
3431

3532
async function sendTxn() {
3633
setConfirmedTxn("")
37-
const suggestedParams = await algodClient().getTransactionParams().do()
3834

39-
const payTxn = makePaymentTxnWithSuggestedParamsFromObject({
40-
from: address(),
41-
to: address(),
42-
amount: 0,
43-
suggestedParams,
44-
})
45-
const txn = await algokit.getTransactionWithSigner(payTxn, transactionSignerAccount())
35+
const result = await algokit.transferAlgos({
36+
amount: (0).algos(),
37+
from: transactionSignerAccount,
38+
to: transactionSignerAccount
39+
}, algodClient())
4640

47-
const atc = new AtomicTransactionComposer()
48-
atc.addTransaction(txn)
49-
const result = await atc.execute(algodClient(), 4)
5041
console.log("Txn confirmed: ", result)
51-
setConfirmedTxn(result.txIDs[0])
42+
setConfirmedTxn(result.transaction.txID())
5243
}
5344

5445
return (

0 commit comments

Comments
 (0)