Skip to content

callback is not defined #429

@vanodevium

Description

@vanodevium

Hi!

I have a function:

const fee = process.env.FEE_LIMIT || 30000000;

async function payTRC20(toAddress, amount, fromAddress, tronWeb, contract) {
  const options = {
    feeLimit: fee,
    callValue: 0,
  };
  const tx = await tronWeb.transactionBuilder.triggerSmartContract(
    contract,
    "transfer(address,uint256)",
    options,
    [
      {
        type: "address",
        value: toAddress,
      },
      {
        type: "uint256",
        value: amount * 1000000,
      },
    ],
    tronWeb.address.toHex(fromAddress),
  );
  const signedTx = await tronWeb.trx.sign(tx.transaction);
  return tronWeb.trx.sendRawTransaction(signedTx);
}

module.exports = payTRC20;

This function works fine, but for some wallets it throws an error with the text:

callback is not defined

Version:
"tronweb": "5.3.0"


Please tell me what the problem might be and how to fix it.

An important clarification: if you repeat on such an "incorrect" wallet, the error will be the same. If you transfer money to such a wallet through a mobile application, everything goes without errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions