Skip to content

Instantly share code, notes, and snippets.

@kctam
Last active December 18, 2020 05:47
Show Gist options
  • Save kctam/d85e1275b51abd1d67efe1677690cbb8 to your computer and use it in GitHub Desktop.
Save kctam/d85e1275b51abd1d67efe1677690cbb8 to your computer and use it in GitHub Desktop.

Revisions

  1. kctam revised this gist Dec 18, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion asa_aliceDestroy.js
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ var aliceAccount = algosdk.mnemonicToSecretKey(alice_mnemonic);
    let client = new algosdk.Algodv2(token, server, port);

    (async () => {
    let assetID = 13300122; // change to the assetID you wish to destroy
    let assetID = 13300122; // change to your own asset
    let params = await client.getTransactionParams().do();
    let addr = aliceAccount.addr;
    let note = undefined;
  2. kctam created this gist Dec 18, 2020.
    26 changes: 26 additions & 0 deletions asa_aliceDestroy.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    const algosdk = require('algosdk');

    const server="https://testnet-algorand.api.purestake.io/ps2";
    const port="";
    const token={
    "x-api-key": "mV *** BY" // fill in yours
    };

    var alice_mnemonic = "cash riot *** able can"; // fill in yours
    var aliceAccount = algosdk.mnemonicToSecretKey(alice_mnemonic);

    let client = new algosdk.Algodv2(token, server, port);

    (async () => {
    let assetID = 13300122; // change to the assetID you wish to destroy
    let params = await client.getTransactionParams().do();
    let addr = aliceAccount.addr;
    let note = undefined;
    let txn = algosdk.makeAssetDestroyTxnWithSuggestedParams(addr, note, assetID, params);
    let rawSignedTxn = txn.signTxn(aliceAccount.sk);
    let tx = (await client.sendRawTransaction(rawSignedTxn).do());
    console.log("Transaction : " + tx.txId);
    })().catch(e => {
    console.log(e);
    });