Skip to content
Open
Show file tree
Hide file tree
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
24 changes: 20 additions & 4 deletions challenge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,33 @@ When solved correctly, the console should print out the following:
"Payment of 1000000 microAlgos was sent to RRYKB23LFR62G3P4SFINZDQ4FVDUNWWQ4NOF7K6TP5GO65BQCHYMNTR3CU at confirmed round 59"
*/
const suggestedParams = await algodClient.getTransactionParams().do();
const txn = algosdk.makePaymentTxnWithSuggestedParamsFromObject({
// const txn = algosdk.makePaymentTxnWithSuggestedParamsFromObject({
// from: sender.addr,
// suggestedParams,
// to: receiver.addr,
// amount: 1000000,
// });

// await algodClient.sendRawTransaction(txn).do();
// const result = await algosdk.waitForConfirmation(
// algodClient,
// txn.txID().toString(),
// 3
// );
const unsignedTxn = algosdk.makePaymentTxnWithSuggestedParamsFromObject({
from: sender.addr,
suggestedParams,
suggestedParams: suggestedParams,
to: receiver.addr,
amount: 1000000,
});

await algodClient.sendRawTransaction(txn).do();
const txgroup = algosdk.assignGroupID([unsignedTxn]);
const signedTxn1 = txgroup[0].signTxn(sender.sk);

await algodClient.sendRawTransaction(signedTxn1).do();
const result = await algosdk.waitForConfirmation(
algodClient,
txn.txID().toString(),
unsignedTxn.txID().toString(),
3
);

Expand Down
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"@types/node": "^20.12.2"
}
}