Skip to content

Commit

Permalink
Created index.ts CTF2
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisathvik authored Oct 4, 2024
1 parent 3bc8a77 commit 458902f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions CTF-2/index.ts
Original file line number Diff line number Diff line change
@@ -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 assetId = 720485937;

const payTxn = algosdk.makeAssetTransferTxnWithSuggestedParamsFromObject({
sender: account.addr,
receiver: account.addr,
assetIndex: assetId,
amount: 0,
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);
})();

0 comments on commit 458902f

Please sign in to comment.