Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRON USDT tranfer doesn't work #3576

Open
Timileyin105 opened this issue May 20, 2023 · 1 comment
Open

TRON USDT tranfer doesn't work #3576

Timileyin105 opened this issue May 20, 2023 · 1 comment
Labels

Comments

@Timileyin105
Copy link

Timileyin105 commented May 20, 2023

@spoonincode

i try to send transactions on the tron network using sendMany it works fine for me but issue right now is that i tried sending usdt token in the tron wallet, i always get response that it was signed but the transaction is not publish on the blockhain

`
async function withdrawToAddress() {
try {
const bitgo = new BitGoJS.BitGo({ env: 'prod', accessToken: ACCESS_TOKEN });;
const wallet = await bitgo.coin('trx').wallets().get({ id: WALLET_ID });
wallet.sendMany({
recipients: [
{
amount: '5000000',
address: 'RECEIVE_ADDR',
}
],
walletPassphrase: PASS_PHRASE,
type: 'TokenTransfer',
}).then(response => console.log(response));

} catch (error) {
    console.error('Error sending:', error);
}

}

//this code above works and send tron but below returns response but transaction isnt published

async function withdrawToAddress() {
try {

    const bitgo = new BitGoJS.BitGo({ env: 'prod', accessToken: ACCESS_TOKEN });;
    const wallet = await bitgo.coin('trx:usdt').wallets().get({ id: WALLET_ID });
    wallet.sendMany({
        recipients: [
            {
                amount: '5000000',
                address: 'RECEIVE_ADDR',
            }
        ],
        walletPassphrase: PASS_PHRASE,
        type: 'TokenTransfer',
    }).then(response =>  console.log(response));

} catch (error) {
    console.error('Error sending:', error);
}

}
`

Upon completing your report, copy the link to this issue, and submit the information to: https://bitgo.freshdesk.com/.

This will help us review, prioritize, and assign the issue to internal teams. Doing this helps us stay accountable to your submission in a timely manner. Thank you!
-->

Environment Details

  • OS:
  • Node Version:
  • Yarn Version:
  • BitGoJS Version:
  • BitGo Environment:

Expected Behavior

transaction is supposed to the published and sent on network

Current Behavior

ransaction is not to published and sent on network

@margueriteblair
Copy link
Contributor

margueriteblair commented May 24, 2023

I just tried this in testnet and had no issues. Could you please try with this script? Also, are you able to provide the transaction ID of what was generated the first time and did not get on-chain?

const BitGoJS = require('bitgo');
const bitgo = new BitGoJS.BitGo({ env: 'prod' });

const coin = 'trx:usdt';
const basecoin = bitgo.coin(coin);
// TODO: set your access token here
const accessToken = ACCESS_TOKEN;
const walletId = WALLET_ID;
// TODO: set your passphrase here
const walletPassphrase = WALLET_PASS;

async function withdrawToAddress() {
  bitgo.authenticateWithAccessToken({ accessToken: accessToken });
  await bitgo.unlock({ otp: '000000', duration: 3600 });
  const walletInstance = await basecoin.wallets().get({ id: walletId });

  const transaction = await walletInstance.sendMany({
    recipients: [
      {
        amount: AMOUNT,
        address: RECEIPIENT_ADDRESS',
      },
    ],
    walletPassphrase: walletPassphrase,
  });

  console.log('Wallet ID:', walletInstance.id());
  console.log('New Transaction:', JSON.stringify(transaction, null, 4));
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants