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

Commit

Permalink
Use full algokit functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
robdmoore committed Jan 22, 2024
1 parent aaa07a5 commit 40057e3
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,19 @@ const App: Component = () => {

onMount(() => reconnectWallet())

const transactionSignerAccount = createMemo<TransactionSignerAccount>(() => ({
addr: address(),
signer: transactionSigner,
}))
const transactionSignerAccount = 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 (
Expand Down

0 comments on commit 40057e3

Please sign in to comment.