TronGrid v3 (TG3) uses a set of NodeJS apps to talk with Redis and PostgreSQL to provide a simple, fast and reliable query interface for the Tron API.
TronGrid v3 (TG3) will use api versioning moving forward. As this is the first iteration of the improved TronGrid, we will start with v1. ex: https://api.trongrid.io/v1
/wallet/getaccount
only_confirmed
Shows only the situation at latest confirmed block.
true
| false
default false
{
"success": true,
"meta": {
"at": 1558109062846,
"page_size": 1
},
"data": [
{
"account_resource": {
"energy_usage": 6027620,
"frozen_balance_for_energy": {
"expire_time": 1558164300000,
"frozen_balance": 2116000000000
},
"latest_consume_time_for_energy": 1558108998000
},
"address": "41704833c02883b3261f7baf62f8cb19b4b0c2e64e",
"allowance": 704953,
"asset": [...],
"assetV2": [...],
"asset_issued_ID": "31303031343736",
"asset_issued_name": "47616d65546f6b656e",
"balance": 4196409173,
"create_time": 1529897991000,
"free_asset_net_usageV2": [...],
"is_witness": true,
"latest_consume_free_time": 1557905064000,
"latest_opration_time": 1558108998000,
"latest_withdraw_time": 1557905064000
}
]
}
/walletextension/gettransactionfromthis
/walletextension/gettransactiontothis
address
The account’s addressonly_confirmed
Shows only confirmed.
true
| false
default false
only_unconfirmed
Shows only unconfirmed.
true
| false
default false
only_to
Only transaction to address.
true
| false
default false
only_from
Only transaction from address.
true
| false
default false
limit
The requested number of transaction per page. Default 20
. Max 200
.fingerprint
The fingerprint of the last transaction returned by the previous pageorder_by
Pre sorts the results during the query.
Example:
order_by=block_number,asc
order_by=block_timestamp,desc
min_block_timestamp
The minimum transaction timestamp default 0
Alias: min_timestamp
max_block_timestamp
The maximum transaction timestamp default now
Alias: max_timestamp
/wallet/getaccountresource
address
The account’s address {
"free_net_used": 4740,
"free_net_limit": 5000,
"asset_net_used": [...],
"asset_net_limit": [...],
"total_net_limit": 43200000000,
"total_net_weight": 7001650727,
"energy_used": 366327641,
"energy_limit": 402999576,
"total_energy_limit": 100000000000,
"total_energy_weight": 496278437
}
order_by
Sorts the results.
Accepted fields:
total_supply,asc
| total_supply,desc
start_time,asc
| start_time,desc
end_time,asc
| end_time,desc
id,asc
| id,desc
order_by=total_supply,asc
/wallet/getassetissuebyaccount
/wallet/getassetissuebyid
identifier
The identifier to be used to retrieve the asset
It can be the ID of the asset, or the issuer addressonly_confirmed
Shows only the situation at latest confirmed block.
true
| false
default false
/wallet/getassetissuelistbyname
/wallet/getassetissuelist
name
The name of the asset(s)limit
The requested number of assets per page. Default 20
. Max 200
.
When there is a pagination, the minimum limit is set to 20
.fingerprint
The fingerprint of the last asset returned by the previous page.order_by
Pre sorts the results during the query.order_by=total_supply,asc
(starts from the rarest token)
order_by=start_time,desc
(starts from the most recent ICO)only_confirmed
Shows only the situation at latest confirmed block.
true
| false
default false
identifier
It can be either latest, a block number or a block id.address
The address of the deployed contract.only_confirmed
Shows only confirmed.
true
| false
default false
only_unconfirmed
Shows only unconfirmed.
true
| false
default false
event_name
The name of the eventblock_number
The block number for which the events are requiredmin_block_timestamp
The minimum block timestamp default 0
Alias: min_timestamp
max_block_timestamp
The maximum block timestamp default now
Alias: max_timestamp
limit
For pagination. Limit 20fingerprint
The fingerprint of last event retrieved in the pageorder_by
Sort the events.block_timestamp,asc
(alias: timestamp,asc
)
block_timestamp,desc
(default)address
The address of the deployed contract.only_confirmed
Shows only confirmed.
true
| false
default false
only_unconfirmed
Shows only unconfirmed.
true
| false
default false
min_block_timestamp
The minimum block timestamp default 0
Alias: min_timestamp
max_block_timestamp
The maximum block timestamp default now
Alias: max_timestamp
limit
For pagination. Limit 20
fingerprint
The fingerprint of last event retrieved in the pageorder_by
Sort the events.block_timestamp,asc
(alias: timestamp,asc
)
block_timestamp,desc
(default)id
The id of the transactionTo keep compatibility with TronWeb, TronGrid supports also the legacy format.
The Following are Four Methods for Polling:
https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3
curl https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/DiceResult
https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/DiceResult/7273383
fromTimestamp
sets a time stamp, default 0, returning all events after or before that timestamp. For example:
For retro-compatibility you can pass since
instead of fromTimestamp
.
size
indicates the number of results returned. Default is 20, maximum is 200. Example:
https://api.trongrid.io/event/contract/TMJnJcHfdP5rhmXVkwRYb1a9A6gS46PUm6/Notify?size=10
page
is no more supported.
sort
indicates the order. By default the order is descending. To explicitly indicate it, use
sort=block_timestamp
for ascending order and
sort=-block_timestamp
for descending order. For example:
fingerprint
is necessary for pagination. Any time you require an API that could return more data that the indicate size, you will see that the latest element has the property _fingerprint
. To get the next page, you can just call again the same API adding the parameter fingerprint=[previous _fingerint parameter]
. For example:
onlyConfirmed
returns only the confirmed events.
onlyUnconfirmed
returns only unconfirmed events.
If you pass both it returns an error.