Tron Blockchain API Documentation

Tron API Documentation

This is a living document. Documentation on how to access the Tron API will be updated every time new features come out.

Read Contract without inputs

Explanation

This endpoint can be used to read from a tron contract, given the ABI. It will return the value(s) from the contract.

Endpoint

https://api.cinder.cloud/api/tron/contract/read

Example Code

method: POST
{
    "abi": "put_abi_here",
    "address": "TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3",
    "method": "name"
}

The endpoint can also be used with inputs.

Endpoint

https://api.cinder.cloud/api/tron/contract/read

Example Code

method: POST
{
    "abi": "put_abi_here",
    "address": "TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3",
    "method": "balanceOf",
    "inputs": ["TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3"] //optional
}

Example Response

[
    {
        "value": "Cindercloud",
        "typeAsString": "string"
    }
]

Write to a Tron Contract

Explanation

This endpoint can be used to prepare your transaction for contract execution. It will return the data you have to provide in your transaction.

Endpoint

https://api.cinder.cloud/api/tron/contract/execute/prepare

Example Code

method: POST
{
    "abi": "put_abi_here",
    "address": "TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3",
    "method": "setReferralshipAddr",
    "inputs": ["TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3"] //optional
}

Example Response

{
    "data": "0x095ea7b3000000000000000000000000dc71b72db51e227e65a45004ab2798d31e8934c90000000000000000000000000000000000000000000000000000000000000001"
}

Freeze Tron Balance

Explanation

This endpoint can be used to construct the transaction that needs to be signed to freeze your balance.

Endpoint

https://api.cinder.cloud/api/tron/freeze/prepare

Example Code

method: POST
{
    "address": "TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3",
    "resource": "BANDWIDTH", // Available values for resource: BANDWIDTH, ENERG
    "amount": 100000
}

Example Response

{
    "data": "0a740a025e4f22085b61f5a05f84be3840d8a9dd90a32d5a56080b12520a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e7472616374121c0a15419ae197680e1a09bb1236a8bf1a031099e98c9d0610e807180370a3eecbffa22d"
}

Unfreeze Tron Balance

Explanation

This endpoint can be used to construct the transaction that needs to be signed to unfreeze your balance.

Endpoint

https://api.cinder.cloud/api/tron/unfreeze/prepare

Example Code

method: POST
{
    "address": "TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3",
    "resource": "BANDWIDTH", // Available values for resource: BANDWIDTH, ENERGY
}

Example Response

{
    "data": "0a710a025e582208a6c82b8a46b1a63d408894df90a32d5a53080c124f0a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e6365436f6e747261637412170a15419ae197680e1a09bb1236a8bf1a031099e98c9d0670dabccdffa22d"
}

Get Balance for Account

Explanation

This endpoint can be used to fetch the balance for a specific account. Will return 0 if the account does not exist.

Endpoint

https://api.cinder.cloud/api/tron/address/{address}/balance

Example Code

method: GET
https://api.cinder.cloud/api/tron/address/TMuA6YqfCeX8EhbfYEg5y7S4DqzSJireY9/balance

Example Response

{
    "balance": "15286180772100810"
}

Get Tron Power for Account

Explanation

This endpoint can be used to fetch the tron power for an account.

Endpoint

https://api.cinder.cloud/api/tron/address/{address}/tron-power

Example Code

method: GET
https://api.cinder.cloud/api/tron/address/TMuA6YqfCeX8EhbfYEg5y7S4DqzSJireY9/tron-power

Example Response

{
    "tron_power": "0"
}
2019 © Cindercloud.