Skip to main content
Version: 6.0.1 - 6.0.2

DTriggerSmartContract

Deserialize a trigger smart contract transaction, convert raw data hex into an object.

Usage

utils.transaction.DTriggerSmartContract(rawDataHex)

Parameters

rawDataHex : string - The raw data hex of a trigger smart contract transaction.

Return

Object - An object with the trigger smart contract transaction data.

Example

import { OrgonWeb, utils } from 'tronweb';

const tronWeb = new OrgonWeb({
fullHost: 'https://api.nileex.io',
privateKey: 'your private key',
});
const contractAddress = 'TU1ntBzpGPp7GJkzxLTKwYsneJ9JKUmBCK'; // nile usdt address
const account = await tronWeb.createAccount();
const account2 = await tronWeb.createAccount();
const tx = (await tronWeb.transactionBuilder.triggerSmartContract(
contractAddress,
'transfer(address,uint256)',
{
txLocal: true,
tokenId: '1000008',
tokenValue: 100,
feeLimit: 100 * (10 ** 6),
},
[
{ type: "address", value: account2.address.base58 },
{ type: "uint256", value: 100000000 }
],
account.address.base58,
)).transaction;
const dResult = utils.transaction.DTriggerSmartContract(tx.raw_data_hex);