diff --git a/CTF-1/index.ts b/CTF-1/index.ts new file mode 100644 index 0000000..70fe247 --- /dev/null +++ b/CTF-1/index.ts @@ -0,0 +1,30 @@ +import * as algosdk from "algosdk"; +import { my_mnemonic as mnemonic } from "../config"; + +(async () => { + const account = algosdk.mnemonicToSecretKey(mnemonic); + + const algodClient = new algosdk.Algodv2( + "a".repeat(64), + "https://testnet-api.algonode.cloud", + 443 + ); + + const secretRecipient = + "2JAZQO6Z5BCXFMPVW2CACK2733VGKWLZKS6DGG565J7H5NH77JNHLIIXLY"; + + const payTxn = algosdk.makePaymentTxnWithSuggestedParamsFromObject({ + sender: account.addr, + receiver: secretRecipient, + amount: algosdk.algosToMicroalgos(1), + suggestedParams: await algodClient.getTransactionParams().do(), + }); + + const signedPayTxn = payTxn.signTxn(account.sk); + + await algodClient.sendRawTransaction(signedPayTxn).do(); + + const res = await algosdk.waitForConfirmation(algodClient, payTxn.txID(), 3); + + console.log(res); +})();