/wallet/getcontract - Tron
Example code for the getcontract REST method. Complete guide on how to use getcontract REST method in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/wallet/getcontract' \
--header 'Content-Type: application/json' \
--data-raw '{
"value": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"visible": true
}'const response = await fetch(
'https://go.getblock.io/<ACCESS-TOKEN>/wallet/getcontract',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"value": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "visible": true})
}
);
console.log(await response.json());import requests
response = requests.post(
'https://go.getblock.io/<ACCESS-TOKEN>/wallet/getcontract',
headers={'Content-Type': 'application/json'},
json={"value": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "visible": true}
)
print(response.json())Response
{
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"origin_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
"abi": {
"entrys": [
{
"name": "transfer",
"type": "Function"
}
]
},
"name": "TetherToken",
"consume_user_resource_percent": 100,
"origin_energy_limit": 10000000
}Response Parameters
Field
Type
Description
Use Cases
Error Handling
HTTP Status
Message
Description
Was this helpful?