Skip to content

Made the fix to create the atomic transaction. #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions challenge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ const ptxn2 = algosdk.makePaymentTxnWithSuggestedParamsFromObject({
amount: 2000000, // 2 ALGOs
});

const atc = new algosdk.AtomicTransactionComposer()
atc.addTransaction({txn: ptxn1, signer: sender})
atc.addTransaction({txn: ptxn2, signer: sender})
const atc = new algosdk.AtomicTransactionComposer();
//atc.addTransaction({txn: ptxn1, signer: sender})
//atc.addTransaction({txn: ptxn2, signer: sender})
//const signer1 = algokit.signTransaction(ptxn1, sender); //({sender.sk})
const signer1 = await algokit.getTransactionWithSigner(ptxn1, sender);
const signer2 = await algokit.getTransactionWithSigner(ptxn2, sender);
atc.addTransaction(signer1);
atc.addTransaction(signer2);

const result = await algokit.sendAtomicTransactionComposer({atc:atc, sendParams: {suppressLog:true}}, algodClient)
console.log(`The first payment transaction sent ${result.transactions[0].amount} microAlgos and the second payment transaction sent ${result.transactions[1].amount} microAlgos`)
Expand Down