transferTRC20 method

Future<JSON> transferTRC20({
  1. required String address,
  2. required String contractAddress,
  3. required Amount amount,
})

Implementation

Future<JSON> transferTRC20({
  required String address,
  required String contractAddress,
  required Amount amount,
}) {
  const functionSelector = "transfer(address,uint256)";
  final addressParameter = base58ToEVM(address, false).padLeft(64, '0');
  final amountParameter = amount.value.toHex.padLeft(64, '0');
  final parmeter = "$addressParameter$amountParameter";

  return triggerSmartContract(
    address: address,
    contractAddress: contractAddress,
    functionSelector: functionSelector,
    parameter: parmeter,
  );
}