@ledgerhq/coin-tron
Version:
Ledger Tron Coin integration
9 lines • 517 B
JavaScript
// see: https://solidity.readthedocs.io/en/v0.6.1/abi-spec.html#function-selector-and-argument-encoding
export const abiEncodeTrc20Transfer = (address, amount) => {
const encodedAddress = address.padStart(64, "0");
const hexAmount = amount.toNumber().toString(16); // convert to hexadecimal
const encodedAmount = hexAmount.padStart(64, "0");
return encodedAddress.concat(encodedAmount);
};
export const hexToAscii = (hex) => Buffer.from(hex, "hex").toString("ascii");
//# sourceMappingURL=utils.js.map