### GET /v1/assets/:name/list Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves a list of assets by name. ```APIDOC ## GET /v1/assets/:name/list ### Description Returns all the assets with the specified name. ### Method GET ### Endpoint https://api.trongrid.io/v1/assets/:name/list ### Parameters #### Path Parameters - **name** (string) - Required - The name of the asset(s). #### Query Parameters - **limit** (integer) - Optional - The requested number of assets per page. Default 20, Max 200. - **fingerprint** (string) - Optional - The fingerprint of the last asset returned by the previous page. - **order_by** (string) - Optional - Pre sorts the results during the query. - **only_confirmed** (boolean) - Optional - Shows only the situation at latest confirmed block. Default: false ``` -------------------------------- ### Assets API - Get All Assets Source: https://context7.com/tron-us/trongrid/llms.txt Returns a paginated list of all TRC10 assets on the Tron network with sorting options by total supply, start time, end time, or asset ID. ```APIDOC ## GET /v1/assets ### Description Returns a paginated list of all TRC10 assets on the Tron network with sorting options by total supply, start time, end time, or asset ID. ### Method GET ### Endpoint /v1/assets #### Query Parameters - **order_by** (string) - Optional - Specifies the sorting order. Format: `field,direction` (e.g., `total_supply,asc`). Supported fields: `total_supply`, `start_time`, `end_time`, `id`. ### Request Example ```bash # Get all assets with default pagination curl "https://api.trongrid.io/v1/assets" # Sort assets by total supply (ascending - rarest first) curl "https://api.trongrid.io/v1/assets?order_by=total_supply,asc" # Sort assets by start time (descending - most recent ICO first) curl "https://api.trongrid.io/v1/assets?order_by=start_time,desc" # Sort by asset ID curl "https://api.trongrid.io/v1/assets?order_by=id,asc" ``` ### Response #### Success Response (200) - **data** (array) - Array of asset objects. - **meta** (object) - Metadata about the response, including timestamp and page size. - **at** (integer) - Timestamp of the data. - **page_size** (integer) - Number of items per page. #### Response Example (Response structure for assets is complex. Refer to TronGrid documentation for detailed asset object structure.) ``` -------------------------------- ### GET /v1/assets Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves a list of all assets on the Tron network. ```APIDOC ## GET /v1/assets ### Description Returns all the assets. ### Method GET ### Endpoint https://api.trongrid.io/v1/assets ### Parameters #### Query Parameters - **order_by** (string) - Optional - 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 ``` -------------------------------- ### Get Assets by Name Source: https://context7.com/tron-us/trongrid/llms.txt Retrieve assets by their name. Supports pagination and sorting. Use to find specific tokens or assets on the network. ```bash curl "https://api.trongrid.io/v1/assets/GameToken/list" ``` ```bash curl "https://api.trongrid.io/v1/assets/GameToken/list?limit=50&order_by=total_supply,asc" ``` ```bash curl "https://api.trongrid.io/v1/assets/GameToken/list?only_confirmed=true&fingerprint=xyz789" ``` -------------------------------- ### Assets API - Get Assets By Name Source: https://context7.com/tron-us/trongrid/llms.txt Retrieves assets by their name, supporting pagination and sorting. Multiple assets can have the same name. ```APIDOC ## GET /v1/assets/{asset_name}/list ### Description Returns all assets matching a specified name with pagination and sorting support. Multiple assets can share the same name on the Tron network. ### Method GET ### Endpoint /v1/assets/{asset_name}/list ### Query Parameters - **limit** (integer) - Optional - Maximum number of assets to return. - **order_by** (string) - Optional - Field to sort by and direction (e.g., `total_supply,asc`). - **only_confirmed** (boolean) - Optional - Whether to return only confirmed assets. - **fingerprint** (string) - Optional - Used for pagination or filtering. ``` -------------------------------- ### GET /v1/assets/:identifier Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves assets by a specific identifier (ID or issuer address). ```APIDOC ## GET /v1/assets/:identifier ### Description Returns all the assets with the specified id or owner. ### Method GET ### Endpoint https://api.trongrid.io/v1/assets/:identifier ### Parameters #### Path Parameters - **identifier** (string) - Required - The identifier to be used to retrieve the asset (ID of the asset or issuer address). #### Query Parameters - **only_confirmed** (boolean) - Optional - Shows only the situation at latest confirmed block. Default: false ``` -------------------------------- ### Get Account Resources By Address Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves the resources associated with a specific Tron account. ```APIDOC ## GET /v1/accounts/:address/resources ### Description Returns the resources associated to a specific account. ### Method GET ### Endpoint https://api.trongrid.io/v1/accounts/:address/resources ### Parameters #### Path Parameters - **address** (string) - Required - The account’s address. ### Request Example ```json { "example": "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/resources" } ``` ### Response #### Success Response (200) - **free_net_used** (integer) - **free_net_limit** (integer) - **asset_net_used** (array) - **asset_net_limit** (array) - **total_net_limit** (integer) - **total_net_weight** (integer) - **energy_used** (integer) - **energy_limit** (integer) - **total_energy_limit** (integer) - **total_energy_weight** (integer) #### Response Example ```json { "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 } ``` ``` -------------------------------- ### GET /v1/contracts/:address/events Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves events emitted by a specific smart contract. ```APIDOC ## GET /v1/contracts/:address/events ### Description Returns the events emitted by a smart contract. ### Method GET ### Endpoint https://api.trongrid.io/v1/contracts/:address/events ### Parameters #### Path Parameters - **address** (string) - Required - The address of the deployed contract. #### Query Parameters - **only_confirmed** (boolean) - Optional - Shows only confirmed. - **only_unconfirmed** (boolean) - Optional - Shows only unconfirmed. - **event_name** (string) - Optional - The name of the event. - **block_number** (integer) - Optional - The block number for which the events are required. - **min_block_timestamp** (integer) - Optional - The minimum block timestamp. Alias: min_timestamp. - **max_block_timestamp** (integer) - Optional - The maximum block timestamp. Alias: max_timestamp. - **limit** (integer) - Optional - For pagination. Limit 20. - **fingerprint** (string) - Optional - The fingerprint of last event retrieved in the page. - **order_by** (string) - Optional - Sort the events. Accepted values: block_timestamp,asc (alias: timestamp,asc), block_timestamp,desc (default). ``` -------------------------------- ### Accounts API - Get Account Resources By Address Source: https://context7.com/tron-us/trongrid/llms.txt Returns the bandwidth and energy resources associated with a specific account, including free net limits, frozen balances, and current usage statistics. ```APIDOC ## GET /v1/accounts/{address}/resources ### Description Returns the bandwidth and energy resources associated with a specific account, including free net limits, frozen balances, and current usage statistics. ### Method GET ### Endpoint /v1/accounts/{address}/resources ### Request Example ```bash # Get account resources curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/resources" ``` ### Response #### Success Response (200) - **free_net_used** (integer) - Amount of free bandwidth used. - **free_net_limit** (integer) - Limit of free bandwidth. - **asset_net_used** (array) - Bandwidth usage for specific assets. - **asset_net_limit** (array) - Bandwidth limits for specific assets. - **total_net_limit** (integer) - Total bandwidth limit. - **total_net_weight** (integer) - Total bandwidth weight. - **energy_used** (integer) - Current energy usage. - **energy_limit** (integer) - Current energy limit. - **total_energy_limit** (integer) - Total energy limit. - **total_energy_weight** (integer) - Total energy weight. #### Response Example ```json { "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 } ``` ``` -------------------------------- ### Get Account Resources By Address Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieve the resources associated with a specific account using its address. This includes details on free and asset-based net usage and limits, as well as energy usage and limits. ```json { "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 } ``` -------------------------------- ### Legacy Compatibility API - Get Events By Contract Address, Event Name, and Block Height Source: https://context7.com/tron-us/trongrid/llms.txt Filters contract events by event name at a specific block height. ```APIDOC ## GET /event/contract/{contract_address}/{event_name}/{block_height} ### Description Filters contract events by event name at a specific block height. ### Method GET ### Endpoint /event/contract/{contract_address}/{event_name}/{block_height} ### Path Parameters - **contract_address** (string) - Required - The address of the smart contract. - **event_name** (string) - Required - The name of the event to filter by. - **block_height** (integer) - Required - The block height to filter events at. ``` -------------------------------- ### GET /v1/blocks/:identifier/events Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves events associated with a specific block. ```APIDOC ## GET /v1/blocks/:identifier/events ### Description Returns all the events in the specified block. ### Method GET ### Endpoint https://api.trongrid.io/v1/blocks/:identifier/events ### Parameters #### Path Parameters - **identifier** (string) - Required - It can be either latest, a block number or a block id. ``` -------------------------------- ### Get Events from a Specific Block Source: https://context7.com/tron-us/trongrid/llms.txt Retrieve events associated with a specific block. This endpoint requires the contract address and event name. ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/DiceResult/7273383" ``` -------------------------------- ### GET /v1/transactions/:id/events Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves events emitted by a specific transaction. ```APIDOC ## GET /v1/transactions/:id/events ### Description Returns the events emitted by a transaction. ### Method GET ### Endpoint https://api.trongrid.io/v1/transactions/:id/events ### Parameters #### Path Parameters - **id** (string) - Required - The id of the transaction. ``` -------------------------------- ### Legacy Compatibility API - Get Events By Contract Address and Event Name Source: https://context7.com/tron-us/trongrid/llms.txt Filters contract events by a specific event name using the legacy URL path format. ```APIDOC ## GET /event/contract/{contract_address}/{event_name} ### Description Filters contract events by a specific event name using the legacy URL path format. ### Method GET ### Endpoint /event/contract/{contract_address}/{event_name} ### Path Parameters - **contract_address** (string) - Required - The address of the smart contract. - **event_name** (string) - Required - The name of the event to filter by. ### Query Parameters - **size** (integer) - Optional - Number of events to return per page. - **onlyConfirmed** (boolean) - Optional - Whether to return only confirmed events. ``` -------------------------------- ### GET /event/contract/:contractAddress Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves events associated with a specific smart contract address with support for filtering and pagination. ```APIDOC ## GET /event/contract/:contractAddress ### Description Retrieves events for a specific contract. Supports filtering by timestamp, sorting, and pagination using fingerprints. ### Method GET ### Endpoint /event/contract/:contractAddress ### Parameters #### Path Parameters - **contractAddress** (string) - Required - The address of the contract to query. #### Query Parameters - **fromTimestamp** (long) - Optional - Returns events after or before this timestamp (default 0). - **since** (long) - Optional - Alias for fromTimestamp for retro-compatibility. - **size** (integer) - Optional - Number of results returned (default 20, max 200). - **sort** (string) - Optional - Sort order. Use 'block_timestamp' for ascending or '-block_timestamp' for descending. - **fingerprint** (string) - Optional - Used for pagination. Provide the value from the '_fingerprint' property of the previous response. - **onlyConfirmed** (boolean) - Optional - Returns only confirmed events. - **onlyUnconfirmed** (boolean) - Optional - Returns only unconfirmed events. ### Response #### Success Response (200) - **_fingerprint** (string) - The identifier used for fetching the next page of results. ``` -------------------------------- ### Get Contract Events by Event Name (Legacy) Source: https://context7.com/tron-us/trongrid/llms.txt Legacy endpoint to filter contract events by a specific event name. Can be combined with other query parameters for more precise filtering. ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/DiceResult" ``` ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/Transfer?size=50&onlyConfirmed=true" ``` -------------------------------- ### Get Events by Transaction ID (Legacy) Source: https://context7.com/tron-us/trongrid/llms.txt Use this legacy endpoint to retrieve events filtered by a specific transaction hash. Ensure the transaction ID is correct. ```bash curl "https://api.trongrid.io/event/transaction/d74ba9c3947b509db385fe2df5fb1dc49f10fb33da93e1e5903d897714ef0f5c" ``` -------------------------------- ### GET /v1/contracts/:address/transactions Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves transactions related to a specific smart contract. ```APIDOC ## GET /v1/contracts/:address/transactions ### Description Returns the transactions related a smart contract. ### Method GET ### Endpoint https://api.trongrid.io/v1/contracts/:address/transactions ### Parameters #### Path Parameters - **address** (string) - Required - The address of the deployed contract. #### Query Parameters - **only_confirmed** (boolean) - Optional - Shows only confirmed. - **only_unconfirmed** (boolean) - Optional - Shows only unconfirmed. - **min_block_timestamp** (integer) - Optional - The minimum block timestamp. Alias: min_timestamp. - **max_block_timestamp** (integer) - Optional - The maximum block timestamp. Alias: max_timestamp. - **limit** (integer) - Optional - For pagination. Limit 20. - **fingerprint** (string) - Optional - The fingerprint of last event retrieved in the page. - **order_by** (string) - Optional - Sort the events. Accepted values: block_timestamp,asc (alias: timestamp,asc), block_timestamp,desc (default). ``` -------------------------------- ### Get Account Info By Address Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves information about a specific Tron account using its address. ```APIDOC ## GET /v1/accounts/:address ### Description Returns information about a specific account. ### Method GET ### Endpoint https://api.trongrid.io/v1/accounts/:address ### Parameters #### Path Parameters - **address** (string) - Required - The account’s address in base58 or hex format (0x... and 41...) #### Query Parameters - **only_confirmed** (boolean) - Optional - Shows only the situation at latest confirmed block. Default `false`. ### Request Example ```json { "example": "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq7?only_confirmed=false" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **meta** (object) - Metadata about the response. - **at** (integer) - Timestamp of the request. - **page_size** (integer) - Number of items per page. - **data** (array) - Array of account objects. - **account_resource** (object) - Resource information for the account. - **energy_usage** (integer) - **frozen_balance_for_energy** (object) - **expire_time** (integer) - **frozen_balance** (integer) - **latest_consume_time_for_energy** (integer) - **address** (string) - **allowance** (integer) - **asset** (array) - **assetV2** (array) - **asset_issued_ID** (string) - **asset_issued_name** (string) - **balance** (integer) - **create_time** (integer) - **free_asset_net_usageV2** (array) - **is_witness** (boolean) - **latest_consume_free_time** (integer) - **latest_opration_time** (integer) - **latest_withdraw_time** (integer) #### Response Example ```json { "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 } ] } ``` ``` -------------------------------- ### Get Transactions by Contract Address Source: https://context7.com/tron-us/trongrid/llms.txt Fetch all transactions that interacted with a specific smart contract. Supports filtering by confirmation status and timestamp ranges. Use to track contract interactions. ```bash curl "https://api.trongrid.io/v1/contracts/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/transactions" ``` ```bash curl "https://api.trongrid.io/v1/contracts/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/transactions?only_confirmed=true" ``` ```bash curl "https://api.trongrid.io/v1/contracts/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/transactions?min_block_timestamp=1541547888000&limit=50&order_by=block_timestamp,desc" ``` -------------------------------- ### Get Transactions By Account Address Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieves all transactions related to a specified account address. ```APIDOC ## GET /v1/accounts/:address/transactions ### Description Returns all the transactions related to a specified account. ### Method GET ### Endpoint https://api.trongrid.io/v1/accounts/:address/transactions ### Parameters #### Path Parameters - **address** (string) - Required - The account’s address. #### Query Parameters - **only_confirmed** (boolean) - Optional - Shows only confirmed transactions. Default `false`. - **only_unconfirmed** (boolean) - Optional - Shows only unconfirmed transactions. Default `false`. - **only_to** (boolean) - Optional - Filters for transactions where the address is the recipient. Default `false`. - **only_from** (boolean) - Optional - Filters for transactions where the address is the sender. Default `false`. - **limit** (integer) - Optional - The requested number of transactions per page. Default `20`. Max `200`. - **fingerprint** (string) - Optional - The fingerprint of the last transaction returned by the previous page. - **order_by** (string) - Optional - Pre-sorts the results during the query. Example: `order_by=block_number,asc` or `order_by=block_timestamp,desc`. - **min_block_timestamp** (integer) - Optional - The minimum transaction timestamp. Alias: `min_timestamp`. Default `0`. - **max_block_timestamp** (integer) - Optional - The maximum transaction timestamp. Alias: `max_timestamp`. Default `now`. ### Request Example ```json { "example": "GET https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions?only_to=true&only_from=true" } ``` ### Response #### Success Response (200) - **data** (array) - Array of transaction objects. - **meta** (object) - Metadata about the response. - **fingerprint** (string) #### Response Example (Response structure for transactions is not provided in the source text, but typically includes transaction details like hash, block number, timestamp, sender, receiver, amount, etc.) ``` -------------------------------- ### Legacy Compatibility API - Get Events By Contract Address Source: https://context7.com/tron-us/trongrid/llms.txt Legacy endpoint for polling contract events, maintained for backwards compatibility with TronWeb applications. ```APIDOC ## GET /event/contract/{contract_address} ### Description Legacy endpoint for polling contract events, maintained for backwards compatibility with TronWeb applications. ### Method GET ### Endpoint /event/contract/{contract_address} ### Path Parameters - **contract_address** (string) - Required - The address of the smart contract. ### Query Parameters - **fromTimestamp** (integer) - Optional - Filter events from this timestamp. - **size** (integer) - Optional - Number of events to return per page. - **sort** (string) - Optional - Field to sort by and direction (e.g., `block_timestamp` for ascending, `-block_timestamp` for descending). - **fingerprint** (string) - Optional - Used for pagination. - **onlyConfirmed** (boolean) - Optional - Whether to return only confirmed events. - **onlyUnconfirmed** (boolean) - Optional - Whether to return only unconfirmed events. ``` -------------------------------- ### Get Account Info By Address Source: https://github.com/tron-us/trongrid/blob/master/README.md Retrieve information for a specific account using its base58 or hex address. The `only_confirmed` option filters results to the latest confirmed block. ```json { "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 } ] } ``` -------------------------------- ### Get Events by Transaction ID Source: https://context7.com/tron-us/trongrid/llms.txt Retrieve all smart contract events emitted by a specific transaction using its hash. Use to trace events originating from a particular transaction. ```bash curl "https://api.trongrid.io/v1/transactions/d74ba9c3947b509db385fe2df5fb1dc49f10fb33da93e1e5903d897714ef0f5c/events" ``` -------------------------------- ### Assets API - Get Assets By Identifier Source: https://context7.com/tron-us/trongrid/llms.txt Retrieves asset information using either the asset ID or the issuer's address. Returns detailed information about the token including supply, precision, and ICO details. ```APIDOC ## GET /v1/assets/{identifier} ### Description Retrieves asset information using either the asset ID or the issuer's address. Returns detailed information about the token including supply, precision, and ICO details. ### Method GET ### Endpoint /v1/assets/{identifier} #### Path Parameters - **identifier** (string) - Required - The asset ID or the issuer's address. #### Query Parameters - **only_confirmed** (boolean) - Optional - If true, returns only the confirmed asset state. ### Request Example ```bash # Get asset by asset ID curl "https://api.trongrid.io/v1/assets/1001476" # Get assets by issuer address curl "https://api.trongrid.io/v1/assets/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq" # Get only confirmed asset state curl "https://api.trongrid.io/v1/assets/1001476?only_confirmed=true" ``` ### Response #### Success Response (200) - **data** (array) - Array of asset objects. - **meta** (object) - Metadata about the response, including timestamp and page size. - **at** (integer) - Timestamp of the data. - **page_size** (integer) - Number of items per page. #### Response Example (Response structure for assets is complex. Refer to TronGrid documentation for detailed asset object structure.) ``` -------------------------------- ### Get Events by Contract Address Source: https://context7.com/tron-us/trongrid/llms.txt Retrieve all events emitted by a smart contract. Supports filtering by event name, block number, timestamp range, and confirmation status. Use for detailed contract activity analysis. ```bash curl "https://api.trongrid.io/v1/contracts/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/events" ``` ```bash curl "https://api.trongrid.io/v1/contracts/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/events?event_name=Transfer" ``` ```bash curl "https://api.trongrid.io/v1/contracts/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/events?block_number=7273383" ``` ```bash curl "https://api.trongrid.io/v1/contracts/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/events?min_block_timestamp=1541547888000&max_block_timestamp=1558000000000&order_by=block_timestamp,asc" ``` ```bash curl "https://api.trongrid.io/v1/contracts/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3/events?only_confirmed=true&limit=100&fingerprint=abc123" ``` -------------------------------- ### Blocks API - Get Events By Block Identifier Source: https://context7.com/tron-us/trongrid/llms.txt Fetches smart contract events emitted within a specific block, identified by number, hash, or 'latest'. ```APIDOC ## GET /v1/blocks/{block_identifier}/events ### Description Returns all smart contract events emitted within a specified block. The block can be identified by block number, block ID, or using "latest" for the most recent block. ### Method GET ### Endpoint /v1/blocks/{block_identifier}/events ### Path Parameters - **block_identifier** (string) - Required - Block number, block ID (hash), or 'latest'. ``` -------------------------------- ### Contracts API - Get Transactions By Contract Address Source: https://context7.com/tron-us/trongrid/llms.txt Fetches transactions that interacted with a specific smart contract, with filtering for confirmation status and timestamp. ```APIDOC ## GET /v1/contracts/{contract_address}/transactions ### Description Returns all transactions that interacted with a specific smart contract, with filtering options for confirmation status and timestamp ranges. ### Method GET ### Endpoint /v1/contracts/{contract_address}/transactions ### Path Parameters - **contract_address** (string) - Required - The address of the smart contract. ### Query Parameters - **only_confirmed** (boolean) - Optional - Whether to return only confirmed transactions. - **min_block_timestamp** (integer) - Optional - Minimum block timestamp for filtering. - **limit** (integer) - Optional - Maximum number of transactions to return. - **order_by** (string) - Optional - Field to sort by and direction (e.g., `block_timestamp,desc`). ``` -------------------------------- ### Get Contract Events by Event Name and Block Height (Legacy) Source: https://context7.com/tron-us/trongrid/llms.txt Legacy endpoint to filter contract events by event name at a specific block height. This allows for historical event retrieval at a precise block. -------------------------------- ### Transactions API - Get Events By Transaction ID Source: https://context7.com/tron-us/trongrid/llms.txt Retrieves all smart contract events emitted by a specific transaction using its transaction hash. ```APIDOC ## GET /v1/transactions/{transaction_id}/events ### Description Returns all smart contract events emitted by a specific transaction, identified by its transaction hash. ### Method GET ### Endpoint /v1/transactions/{transaction_id}/events ### Path Parameters - **transaction_id** (string) - Required - The hash of the transaction. ``` -------------------------------- ### Get Contract Events (Legacy) Source: https://context7.com/tron-us/trongrid/llms.txt Legacy endpoint for polling contract events, compatible with TronWeb. Supports various filters including timestamp, confirmation status, and pagination using fingerprint. ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3" ``` ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3?fromTimestamp=1541547888000&size=100" ``` ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3?sort=block_timestamp" ``` ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3?sort=-block_timestamp" ``` ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3?fingerprint=e1E1OqO3vrhmwE23" ``` ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3?onlyConfirmed=true" ``` ```bash curl "https://api.trongrid.io/event/contract/TEEXEWrkMFKapSMJ6mErg39ELFKDqEs6w3?onlyUnconfirmed=true" ``` -------------------------------- ### Contracts API - Get Events By Contract Address Source: https://context7.com/tron-us/trongrid/llms.txt Retrieves events emitted by a smart contract, with options to filter by event name, block, timestamp, and confirmation status. ```APIDOC ## GET /v1/contracts/{contract_address}/events ### Description Returns all events emitted by a smart contract with filtering options for event name, block number, timestamp range, and confirmation status. ### Method GET ### Endpoint /v1/contracts/{contract_address}/events ### Path Parameters - **contract_address** (string) - Required - The address of the smart contract. ### Query Parameters - **event_name** (string) - Optional - Filters events by a specific name. - **block_number** (integer) - Optional - Filters events to a specific block number. - **min_block_timestamp** (integer) - Optional - Minimum block timestamp for filtering. - **max_block_timestamp** (integer) - Optional - Maximum block timestamp for filtering. - **order_by** (string) - Optional - Field to sort by and direction (e.g., `block_timestamp,asc`). - **only_confirmed** (boolean) - Optional - Whether to return only confirmed events. - **limit** (integer) - Optional - Maximum number of events to return. - **fingerprint** (string) - Optional - Used for pagination or filtering. ``` -------------------------------- ### Get Events by Block Identifier Source: https://context7.com/tron-us/trongrid/llms.txt Fetch smart contract events within a specific block. Can identify blocks by number, ID, or 'latest'. Use to inspect events at a particular point in the blockchain. ```bash curl "https://api.trongrid.io/v1/blocks/latest/events" ``` ```bash curl "https://api.trongrid.io/v1/blocks/7273383/events" ``` ```bash curl "https://api.trongrid.io/v1/blocks/00000000006ef8b7a9c7dd8e2e7f8d9c6b5a4e3d2c1b0a/events" ``` -------------------------------- ### Accounts API - Get Transactions By Account Address Source: https://context7.com/tron-us/trongrid/llms.txt Returns all transactions related to a specified account with extensive filtering options including direction (incoming/outgoing), confirmation status, timestamp ranges, and sorting capabilities. ```APIDOC ## GET /v1/accounts/{address}/transactions ### Description Returns all transactions related to a specified account with extensive filtering options including direction (incoming/outgoing), confirmation status, timestamp ranges, and sorting capabilities. ### Method GET ### Endpoint /v1/accounts/{address}/transactions #### Query Parameters - **only_to** (boolean) - Optional - If true, returns only incoming transactions to this address. - **only_from** (boolean) - Optional - If true, returns only outgoing transactions from this address. - **only_confirmed** (boolean) - Optional - If true, returns only confirmed transactions. - **limit** (integer) - Optional - The maximum number of transactions to return (default: 20). - **order_by** (string) - Optional - Specifies the sorting order. Format: `field,direction` (e.g., `block_timestamp,desc`). - **min_block_timestamp** (integer) - Optional - Minimum block timestamp for filtering. - **max_block_timestamp** (integer) - Optional - Maximum block timestamp for filtering. - **fingerprint** (string) - Optional - Cursor for paginating through results. ### Request Example ```bash # Get all transactions for an account curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions" # Get only incoming transactions (to this address) curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions?only_to=true" # Get only outgoing transactions (from this address) curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions?only_from=true" # Get confirmed transactions with pagination and sorting curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions?only_confirmed=true&limit=50&order_by=block_timestamp,desc" # Filter transactions by timestamp range curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions?min_block_timestamp=1557000000000&max_block_timestamp=1558000000000" # Paginate through results using fingerprint curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions?fingerprint=abc123xyz" ``` ### Response #### Success Response (200) - **data** (array) - Array of transaction objects. - **meta** (object) - Metadata about the response, including timestamp and fingerprint. - **at** (integer) - Timestamp of the data. - **fingerprint** (string) - Fingerprint for pagination. #### Response Example (Response structure for transactions is complex and depends on transaction type. Refer to TronGrid documentation for detailed transaction object structure.) ``` -------------------------------- ### Accounts API - Get Account Info By Address Source: https://context7.com/tron-us/trongrid/llms.txt Retrieves detailed information about a specific Tron account, including balance, frozen balances, energy usage, bandwidth resources, and issued assets. The account address can be provided in either base58 or hex format. ```APIDOC ## GET /v1/accounts/{address} ### Description Retrieves detailed information about a specific Tron account including balance, frozen balances, energy usage, bandwidth resources, and issued assets. The account address can be provided in either base58 or hex format. ### Method GET ### Endpoint /v1/accounts/{address} #### Query Parameters - **only_confirmed** (boolean) - Optional - If true, returns only the confirmed account state. ### Request Example ```bash # Get account information in base58 format curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq7" # Get only confirmed account state curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq7?only_confirmed=true" # Using hex address format curl "https://api.trongrid.io/v1/accounts/41704833c02883b3261f7baf62f8cb19b4b0c2e64e" ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **meta** (object) - Metadata about the response, including timestamp and page size. - **at** (integer) - Timestamp of the data. - **page_size** (integer) - Number of items per page. - **data** (array) - Array of account objects. - **account_resource** (object) - Resource usage details. - **energy_usage** (integer) - Current energy usage. - **frozen_balance_for_energy** (object) - Details of frozen balance for energy. - **expire_time** (integer) - Expiration time of the frozen balance. - **frozen_balance** (integer) - Amount of frozen balance. - **address** (string) - The account address. - **balance** (integer) - The account balance. - **is_witness** (boolean) - Whether the account is a witness. - **create_time** (integer) - The account creation time. #### Response Example ```json { "success": true, "meta": { "at": 1558109062846, "page_size": 1 }, "data": [{ "account_resource": { "energy_usage": 6027620, "frozen_balance_for_energy": { "expire_time": 1558164300000, "frozen_balance": 2116000000000 } }, "address": "41704833c02883b3261f7baf62f8cb19b4b0c2e64e", "balance": 4196409173, "is_witness": true, "create_time": 1529897991000 }] } ``` ``` -------------------------------- ### Retrieve Account Resources Source: https://context7.com/tron-us/trongrid/llms.txt Fetches bandwidth and energy resource statistics for a specific account. ```bash # Get account resources curl "https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/resources" # Response: # { # "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 # } ``` -------------------------------- ### Retrieve Asset Details Source: https://context7.com/tron-us/trongrid/llms.txt Fetches information about a specific asset using its ID or the issuer's address. ```bash # Get asset by asset ID curl "https://api.trongrid.io/v1/assets/1001476" # Get assets by issuer address curl "https://api.trongrid.io/v1/assets/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq" # Get only confirmed asset state curl "https://api.trongrid.io/v1/assets/1001476?only_confirmed=true" ```