简体   繁体   中英

I am unable to send custom token to other wallet on XRP Ledger

I have manually added trust line to account which I have to receive the token. I have token SOX token in issuer wallet. I want to send to receiver wallet mentioned below. I am trying on testnet.

var xrpl = require('xrpl');

// Issuer wallet
// Address = rnA9soPJPtfuTaEhGR7C6VKWei2CtzmLxJ
// Secret = sn2tgPrdCr72jvMxjKskGmPH2a1VH

// receiver Account
// Address = rbBuZYumQhogsq6FFP6nkvm1GEiyLvNTz;
// Secret = sndPAYk5CcqwRpm4oTcofvjx7jAXX;

// Connect ---------------------------------------------------------------------
async function main() {
  const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233');

  await client.connect();

  const hot_wallet = xrpl.Wallet.fromSeed('sn2tgPrdCr72jvMxjKskGmPH2a1VH');

  // Send token ----------------------------------------------------------------
  const currency_code = 'SOX';
  const issue_quantity = '100';

  const send_token_tx = {
    TransactionType: 'Payment',
    Account: hot_wallet.address,
    Amount: {
      currency: currency_code,
      value: issue_quantity,
      issuer: hot_wallet.address,
    },
    Destination: 'rbBuZYumQhogsq6FFP6nkvm1GEiyLvNTz',
    DestinationTag: 1, // Needed since we enabled Require Destination Tags
    // on the hot account earlier.
  };

  const pay_prepared = await client.autofill(send_token_tx);
  const pay_signed = hot_wallet.sign(pay_prepared);
  const pay_result = await client.submitAndWait(pay_signed.tx_blob);

  console.log(pay_result);

  client.disconnect();
}

main();

You have put the wrong address on the issuer the correct way should be

issuer: 'rn2sbUWaB2iDPjuDncEUXePRwtVdafTBk3',

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM