Skip to content
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
8 changes: 6 additions & 2 deletions challenge/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import algosdk from "algosdk";
import * as algokit from '@algorandfoundation/algokit-utils';
import { consoleLogger } from "@algorandfoundation/algokit-utils/types/logging";

const algodClient = algokit.getAlgoClient()

Expand Down Expand Up @@ -29,11 +30,14 @@ const txn = algosdk.makePaymentTxnWithSuggestedParamsFromObject({
amount: 1000000,
});

await algodClient.sendRawTransaction(txn).do();
const signedTxn = txn.signTxn(sender.sk);

//await algodClient.sendRawTransaction(txn.to.publicKey).do();
await algodClient.sendRawTransaction(signedTxn).do();
const result = await algosdk.waitForConfirmation(
algodClient,
txn.txID().toString(),
3
);

console.log(`Payment of ${result.txn.txn.amt} microAlgos was sent to ${receiver.addr} at confirmed round ${result['confirmed-round']}`);
consoleLogger.debug(`Payment of ${result.txn.txn.amt} microAlgos was sent to ${receiver.addr} at confirmed round ${result['confirmed-round']}`);