Take the USDT contract as an example,Use tronweb and wallet-cli to call the TRC20 interface of the contract, respectively.
# name
Call the name function to get the name of the token.
**HTTP API : **
**Tronweb Example:**
**Wallet-cli Example:**
**Usage : **TriggerConstantContract [ownerAddress] [contractAddress] [method] [args] [isHex] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format
# symbol
Call the symbol function to get the symbol of the token.
**HTTP API : **
**Tronweb Example:**
**Wallet-cli Example:**
**Usage : **TriggerConstantContract [ownerAddress] [contractAddress] [method] [args] [isHex] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format
# decimals
Call the decimals function to get the precision of the token.
**HTTP API : **
**Tronweb Example:**
**Wallet-cli Example:**
**Usage : **TriggerConstantContract [ownerAddress] [contractAddress] [method] [args] [isHex] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format
# totalSupply
Call the totalSupply function to get the total supply of the token.
**HTTP API : **
**Tronweb Example:**
**Wallet-cli:**
**Usage : **TriggerConstantContract [ownerAddress] [contractAddress] [method] [args] [isHex] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format
# balanceOf
Call the balanceOf function to get the token balance of the specified account.
**HTTP API : **
**Tronweb Example:**
**Wallet-cli Example:**
**Usage : **TriggerConstantContract [ownerAddress] [contractAddress] [method] [args] [isHex] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format
# transfer
Call transfer function for token transfer
**HTTP API : **
Note: After calling this HTTP API, you also need to call the signature and broadcast APIs.
**Tronweb Example:**
**Wallet-cli Example:**
**Usage :** TriggerContract [ownerAddress] [contractAddress] [method] [args] [isHex] [fee_limit] [value] [token_value] [token_id] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format fee_limit: the maximum trx consumption of this calling, the unit is sun value: the amount of TRX that transfered to the contract while calling the contract, the unit is sun token_value: the amount of TRC10 asset that transfered to the contract while calling the contract token_id:the TRC10 asset ID that transfered to the contract while calling the contract
Transaction confirmation: Check whether the transfer of TRC20 was successful according to result of getTransactionInfoById.
# approve
Call the approve function to authorize token use rights to other addresses
**HTTP API : **
Note: After calling this HTTP API, you also need to call the signature and broadcast APIs.
**Tronweb Example:**
**Wallet-cli Example:**
**Usage :** TriggerContract [ownerAddress] [contractAddress] [method] [args] [isHex] [fee_limit] [value] [token_value] [token_id] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format fee_limit: the maximum trx consumption of this calling, the unit is sun value: the amount of TRX that transfered to the contract while calling the contract, the unit is sun token_value: the amount of TRC10 asset that transfered to the contract while calling the contract token_id:the TRC10 asset ID that transfered to the contract while calling the contract
Transaction confirmation: Check whether the transfer of TRC20 was successful according to result of getTransactionInfoById.
# transferFrom
Calling the transferFrom function to transfer tokens from other people's accounts, needs to be used in conjunction with the approve method.
**HTTP API : **
Note: After calling this HTTP API, you also need to call the signature and broadcast APIs.
**Tronweb Example:**
**Wallet-cli Example:**
**Usage :** TriggerContract [ownerAddress] [contractAddress] [method] [args] [isHex] [fee_limit] [value] [token_value] [token_id] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format fee_limit: the maximum trx consumption of this calling, the unit is sun value: the amount of TRX that transfered to the contract while calling the contract, the unit is sun token_value: the amount of TRC10 asset that transfered to the contract while calling the contract token_id:the TRC10 asset ID that transfered to the contract while calling the contract
Transaction confirmation: Check whether the transfer of TRC20 was successful according to result of getTransactionInfoById.
# allowance
Call the allowance function to query the token balance of the query account available for third-party transfers.
**HTTP API : **
**Tronweb Example:**
**Wallet-cli Example:**
**Usage : **TriggerConstantContract [ownerAddress] [contractAddress] [method] [args] [isHex] **Parameter Description:** ownerAddress: calller address contractAdress:TRC20 contract address method: contract function args:function parameters,If there is no parameter,use # placeholder isHex: whether the address of the command parameter is in hex format