Skip to main content

GetContract

POST

Queries a contract's information from the blockchain, including the bytecode of the contract, ABI, configuration parameters, etc.
Path Parameters
chainstringrequired
Parameter specifying the target chain to query.
networkstringrequired
Parameter specifying the network of the target chain.
Request Body
valuestringrequired
The contract address. (Format: Base58 or hex).Example: TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs
visibleboolean
Optional. Set to true to format addresses in Base58; set to false for hex format. (Default: false)
Responses
origin_addressstring
Address of the contract creator.
contract_addressstring
Contract address. (Format: Base58 or Hex)
abiobject
Smart contract ABI.
bytecodestring
Bytecode of the smart contract.
call_valueinteger
Amount of TRX transferred into the contract at deployment. (Unit: sun)
consume_user_resource_percentint64
Percentage of user Energy consumption for a smart contract. (Range: [0-100])
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "400"
}
cURL
curl -X POST 'https://tron-mainnet.nodit.io/wallet/getcontract' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{}'