TriggerSmartContract

Returns TransactionExtention, which contains the unsigned Transaction

Body params:

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

  • contract_address - Contract address, converted to a hex string

  • function_selector - Function call, must not be left blank

  • parameter - 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.

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

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

  • permission_id - Optional, for multi-signature

  • visible - Optional. Whehter the address is in base58check format.

Request

curl --request POST \
     --url https://tron.api.watchdata.io/wallet/triggersmartcontract \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '
{
     "owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292",
     "contract_address": "41a7837ce56da0cbb28f30bcd5bff01d4fe7e4c6e3",
     "function_selector": "transfer(address,uint256)",
     "parameter": "string",
     "fee_limit": 0,
     "call_value": 0,
     "permission_id": 0,
     "visible": true
}
'

Response

{
  "result": {
    "code": "OTHER_ERROR",
    "message": "class java.lang.IllegalArgumentException : Illegal character 0 at 14"
  }
}

Last updated