TriggerSmartContract

Returns TransactionExtention, which contains the unsigned Transaction.

This method will use 30 Compute Units.


Note: ABI rules Example: Parameter and return value encoding and decoding

Parameters

  • owner_address - String - Required - Address that triggers the contract, converted to a hex string

  • contract_address - String - Required - Contract address, converted to a hex string

  • function_selector - String - Function call, must not be left blank

  • parameter - String - Parameter encoding needs to be in accordance with the ABI rules, the rules are more complicated, users can use the ethers library to encode,For details, please refer to the document-Guide-Smart Contract-Best Practice-Parameter Encoding and Decoding.

  • data - String - The data for interacting with smart contracts, including the contract function and parameters. You can choose to use this field, or you can choose to use function_selector and parameter for contract interaction. When both of data and function_selector exist, function_selector is preferred

  • fee_limit - int32 - Required - Maximum TRX consumption, measured in SUN (1 TRX = 1,000,000 SUN).

  • call_value - int64 - Amount of TRX transferred with this transaction, measured in SUN (1 TRX = 1,000,000 SUN).

  • call_token_value - int64 - Amount of TRC10 token transferred with this transaction

  • token_id - int64 - TRC10 token id

  • permission_id - int32 - Optional, for multi-signature

  • visible - boolean - Optional. Specifies whether the address is in Base58 format (default: false)

Returns

Transaction object - JSON object: Unsigned transaction, please refer to the Transaction chapter for the fields contained in it. Since the transaction type is TriggerSmartContract, the fields contained in raw_data.contract[0].parameter.value in the transaction are as follows:

Field
Type
Description

owner_address

string

Account address

contract_address

string

Contract address

call_value

int64

The amount of TRX passed into the contract

data

string

Operating parameters

call_token_value

int64

The amount of TRC-10 transferred into the contract

token_id

int64

TRC-10 token id

Last updated

Was this helpful?