### Transaction Signing Example (JSON) Source: https://github.com/tronscan/tronscan-api/blob/develop/README.md Example JSON snippet demonstrating how to sign a transaction using a private key. This is typically used for testing purposes or within self-hosted Tronscan API instances. ```json { "key": "FFA5EA61073FB13E1559F182F91E25C3E51C03906428C7BC8C865A335AED7617" } ``` -------------------------------- ### Broadcast Transaction Example (JSON) Source: https://github.com/tronscan/tronscan-api/blob/develop/README.md Example JSON payload for broadcasting a signed transfer contract to the Tron network. It includes contract details, the private key for signing, and a broadcast flag. This functionality is intended for testing or self-hosted instances. ```json { "contract": { "ownerAddress": "TPwJS5eC5BPGyMGtYTHNhPTB89sUWjDSSu", "toAddress": "TWxKPGEyGWEP87Z4GrBccQiWQCf5iUHx9E", "amount": 100000 }, "key": "FFA5EA61073FB13E1559F182F91E25C3E51C03906428C7BC8C865A335AED7617", "broadcast": true } ``` -------------------------------- ### GET /api/grpc/full/{method} Source: https://context7.com/tronscan/tronscan-api/llms.txt Direct access to TRON full node gRPC methods via REST endpoints. Supports custom node connections via IP/port parameters. ```APIDOC ## GET /api/grpc/full/{method} ### Description Direct access to TRON full node gRPC methods via REST endpoints. Supports custom node connections via IP/port parameters. ### Method GET ### Endpoint https://api.tronscan.org/api/grpc/full/{method} ### Parameters #### Query Parameters - **ip** (string) - Optional - Custom node IP - **port** (integer) - Optional - Custom node port ### Response #### Success Response (200) - **data** (object) - Response data from the full node ``` -------------------------------- ### GET /api/account/{address} Source: https://context7.com/tronscan/tronscan-api/llms.txt Retrieve detailed information about a specific TRON account, including balances, bandwidth, and frozen assets. ```APIDOC ## GET /api/account/{address} ### Description Get detailed account information by address including balances, bandwidth, and representative status. ### Method GET ### Endpoint /api/account/{address} ### Parameters #### Path Parameters - **address** (string) - Required - The TRON account address ### Response #### Success Response (200) - **address** (string) - Account address - **balance** (long) - Current balance in SUN - **bandwidth** (object) - Bandwidth usage statistics #### Response Example { "address": "TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH", "balance": 1000000000, "bandwidth": { "freeNetUsed": 100, "freeNetLimit": 5000 } } ``` -------------------------------- ### GET /api/witness Source: https://context7.com/tronscan/tronscan-api/llms.txt Query super representative (witness) information including production statistics, vote counts, and geographic node distribution. ```APIDOC ## GET /api/witness ### Description Query super representative (witness) information including production statistics, vote counts, and geographic node distribution. ### Method GET ### Endpoint https://api.tronscan.org/api/witness ### Response #### Success Response (200) - **address** (string) - Witness address - **name** (string) - Witness name - **producedTotal** (integer) - Total blocks produced - **missedTotal** (integer) - Total blocks missed #### Response Example [ { "address": "TSRAddress...", "name": "SR Name", "producedTotal": 100000, "missedTotal": 50 } ] ``` -------------------------------- ### GET /api/block Source: https://context7.com/tronscan/tronscan-api/llms.txt Retrieve blockchain block information including details, transaction counts, and producer information. ```APIDOC ## GET /api/block ### Description Retrieve blockchain block information. Supports filtering by hash, number, parent hash, and producer address. ### Method GET ### Endpoint /api/block ### Parameters #### Query Parameters - **limit** (integer) - Optional - Number of blocks to return - **start** (integer) - Optional - Offset for pagination - **sort** (string) - Optional - Sorting order (e.g., -number) - **producer** (string) - Optional - Filter by witness address ### Response #### Success Response (200) - **total** (integer) - Total number of blocks - **data** (array) - List of block objects #### Response Example { "total": 12345678, "data": [ { "number": 12345678, "hash": "0000000000bc614e...", "timestamp": "2023-01-15T10:30:00Z", "nrOfTrx": 150 } ] } ``` -------------------------------- ### GET /api/vote Source: https://context7.com/tronscan/tronscan-api/llms.txt Query voting data for super representative elections, including current cycle votes, candidate totals, and historical voting statistics. ```APIDOC ## GET /api/vote ### Description Query voting data for super representative elections including current cycle votes, candidate totals, and historical voting statistics. ### Method GET ### Endpoint https://api.tronscan.org/api/vote ### Parameters #### Query Parameters - **limit** (integer) - Optional - Number of records to return - **sort** (string) - Optional - Sorting criteria (e.g., -votes) - **voter** (string) - Optional - Filter by voter address - **candidate** (string) - Optional - Filter by candidate address - **block** (integer) - Optional - Filter by block number - **transaction** (string) - Optional - Filter by transaction ID ### Response #### Success Response (200) - **total** (integer) - Total number of records - **totalVotes** (integer) - Total votes cast - **data** (array) - List of voting records #### Response Example { "total": 5000, "totalVotes": 15000000000, "data": [ { "voterAddress": "TVoterAddress...", "candidateAddress": "TCandidateAddress...", "votes": 1000000, "candidateUrl": "https://example.com", "candidateName": "SR Name", "voterAvailableVotes": 5000000 } ] } ``` -------------------------------- ### Manage and Query TRON Accounts Source: https://context7.com/tronscan/tronscan-api/llms.txt Tools for retrieving account balances, bandwidth, frozen assets, and voting statistics, as well as generating new account keypairs. ```bash curl "https://api.tronscan.org/api/account?sort=-balance&limit=50" curl "https://api.tronscan.org/api/account/TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" curl "https://api.tronscan.org/api/account/TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH/balance" curl "https://api.tronscan.org/api/account/TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH/stats" curl "https://api.tronscan.org/api/account/TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH/votes" curl "https://api.tronscan.org/api/account/richlist" curl -X POST "https://api.tronscan.org/api/account" ``` -------------------------------- ### System API Source: https://context7.com/tronscan/tronscan-api/llms.txt Monitor API system status including sync state and load balancer information. ```APIDOC ## GET /api/system/status ### Description Monitor API system status including sync state. ### Method GET ### Endpoint /api/system/status ### Response #### Success Response (200) - **syncState** (object) - Information about the blockchain sync state. - **loadBalancer** (object) - Information about the load balancer. ## GET /api/system/balancer ### Description Get load balancer status information. ### Method GET ### Endpoint /api/system/balancer ## GET /api/system/sync-account/{address} ### Description Initiate a sync for a specific TRON account. ### Method GET ### Endpoint /api/system/sync-account/{address} ### Parameters #### Path Parameters - **address** (string) - Required - The TRON account address to sync. ``` -------------------------------- ### Query TRC10 Tokens (Bash) Source: https://context7.com/tronscan/tronscan-api/llms.txt Query TRC10 tokens (asset issues) including ICO status, supply distribution, and token holder information. Supports filtering by name, owner address, ICO status, and date ranges. Also allows fetching detailed token information and holder lists. ```bash # List all tokens with pagination curl "https://api.tronscan.org/api/token?limit=50&sort=-supply" # Search tokens by name (supports wildcards) curl "https://api.tronscan.org/api/token?name=BTT" curl "https://api.tronscan.org/api/token?name=BIT%25" # wildcard search # Filter by owner address curl "https://api.tronscan.org/api/token?owner=TTokenOwnerAddress..." # Filter active ICOs curl "https://api.tronscan.org/api/token?status=ico" # Filter by date range curl "https://api.tronscan.org/api/token?date_start=2023-01-01&date_end=2023-12-31" # Get detailed token information curl "https://api.tronscan.org/api/token/BTT" # Get token holders list curl "https://api.tronscan.org/api/token/BTT/address?limit=100&sort=-balance" ``` -------------------------------- ### Request TestNet TRX Tokens Source: https://context7.com/tronscan/tronscan-api/llms.txt Shows how to request test TRX tokens for development purposes. Requires a valid address and a captcha verification code. ```bash curl -X POST "https://api.tronscan.org/api/testnet/request-coins" \ -H "Content-Type: application/json" \ -d '{ "address": "TTestAddress...", "captchaCode": "captcha-response-code" }' ``` -------------------------------- ### Monitor System and Account Status Source: https://context7.com/tronscan/tronscan-api/llms.txt Provides endpoints to check the health of the API system, load balancer status, and to trigger a sync for a specific account address. ```bash curl "https://api.tronscan.org/api/system/status" curl "https://api.tronscan.org/api/system/balancer" curl "https://api.tronscan.org/api/system/sync-account/TAccountAddress..." ``` -------------------------------- ### Authenticate with Tronscan API Source: https://context7.com/tronscan/tronscan-api/llms.txt Demonstrates how to obtain a JWT authentication token by signing a transaction and subsequently using that token in the header of protected API requests. ```bash curl -X POST "https://api.tronscan.org/api/auth" \ -H "Content-Type: application/json" \ -d '{"transaction": "signedWitnessUpdateTransactionHex..."}' curl -X POST "https://api.tronscan.org/api/account/TSRAddress.../sr" \ -H "Content-Type: application/json" \ -H "X-Key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -d '{"githubLink": "https://github.com/mysr/pages"}' ``` -------------------------------- ### Build TRON Transactions (Bash) Source: https://context7.com/tronscan/tronscan-api/llms.txt Builds various TRON transaction types programmatically using the Tronscan API. Supports TRX transfers, token transfers, account creation/update, and reward withdrawal. Transactions can be built for broadcasting or signed and broadcasted directly. ```bash # Build TRX transfer transaction curl -X POST "https://api.tronscan.org/api/transaction-builder/contract/transfer" \ -H "Content-Type: application/json" \ -d '{ "contract": { "ownerAddress": "TFromAddress...", "toAddress": "TToAddress...", "amount": 1000000 }, "broadcast": false }' # Build and broadcast with private key signing curl -X POST "https://api.tronscan.org/api/transaction-builder/contract/transfer" \ -H "Content-Type: application/json" \ -d '{ "contract": { "ownerAddress": "TFromAddress...", "toAddress": "TToAddress...", "amount": 1000000 }, "key": "privateKeyHex...", "broadcast": true, "data": "Optional memo" }' # Build TRC10 token transfer curl -X POST "https://api.tronscan.org/api/transaction-builder/contract/transferasset" \ -H "Content-Type: application/json" \ -d '{ "contract": { "ownerAddress": "TFromAddress...", "toAddress": "TToAddress...", "assetName": "TokenName", "amount": 100 }, "broadcast": false }' # Create new account curl -X POST "https://api.tronscan.org/api/transaction-builder/contract/accountcreate" \ -H "Content-Type: application/json" \ -d '{ "contract": { "ownerAddress": "TOwnerAddress...", "accountAddress": "TNewAccountAddress..." } }' # Update account name curl -X POST "https://api.tronscan.org/api/transaction-builder/contract/accountupdate" \ -H "Content-Type: application/json" \ -d '{ "contract": { "ownerAddress": "TOwnerAddress...", "accountName": "NewAccountName" } }' # Withdraw SR rewards curl -X POST "https://api.tronscan.org/api/transaction-builder/contract/withdrawbalance" \ -H "Content-Type: application/json" \ -d '{ "contract": { "ownerAddress": "TSRAddress..." }, "key": "privateKeyHex...", "broadcast": true }' ``` -------------------------------- ### Query TRON Transfers (Bash) Source: https://context7.com/tronscan/tronscan-api/llms.txt Query TRX and TRC10 token transfers with comprehensive filtering options. Supports filtering by address, token type, block number, date ranges, and transaction hash. Also provides transfer statistics. ```bash # List recent transfers curl "https://api.tronscan.org/api/transfer?limit=50&sort=-timestamp" # Filter transfers by address (sender or receiver) curl "https://api.tronscan.org/api/transfer?address=TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" # Filter by sender curl "https://api.tronscan.org/api/transfer?from=TFromAddress..." # Filter by receiver curl "https://api.tronscan.org/api/transfer?to=TToAddress..." # Filter by token name curl "https://api.tronscan.org/api/transfer?token=TRX" curl "https://api.tronscan.org/api/transfer?token=BTT" # Filter by block number curl "https://api.tronscan.org/api/transfer?block=12345678" # Filter by date range (ISO format or timestamp) curl "https://api.tronscan.org/api/transfer?date_start=2023-01-01&date_to=2023-01-31" curl "https://api.tronscan.org/api/transfer?date_start=1672531200000&date_to=1675209600000" # Get transfer by transaction hash curl "https://api.tronscan.org/api/transfer/abc123def456..." # Get transfer statistics (last hour, per minute) curl "https://api.tronscan.org/api/transfer/stats" ``` -------------------------------- ### Retrieve Blockchain Block Information Source: https://context7.com/tronscan/tronscan-api/llms.txt Endpoints for fetching block data, including pagination, filtering by producer, and retrieving statistics like average block size. ```bash curl "https://api.tronscan.org/api/block?limit=10&start=0&sort=-number" curl "https://api.tronscan.org/api/block/12345678" curl "https://api.tronscan.org/api/block/latest" curl "https://api.tronscan.org/api/block?producer=TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH&limit=20" curl "https://api.tronscan.org/api/block/stats?info=avg-block-size" ``` -------------------------------- ### Authentication API Source: https://context7.com/tronscan/tronscan-api/llms.txt Request JWT authentication tokens for protected API operations by signing a transaction with your private key. ```APIDOC ## POST /api/auth ### Description Request JWT authentication tokens for protected API operations by signing a transaction with your private key. ### Method POST ### Endpoint /api/auth ### Parameters #### Request Body - **transaction** (string) - Required - Signed witness update transaction in hex format. ### Request Example ```json { "transaction": "signedWitnessUpdateTransactionHex..." } ``` ### Response #### Success Response (200) - **key** (string) - JWT authentication token. #### Response Example ```json { "key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } ``` ``` -------------------------------- ### Create Account Contract Payload (JSON) Source: https://github.com/tronscan/tronscan-api/blob/develop/README.md JSON payload structure for creating a new Tron account. Requires the owner address and the desired new account address. ```json { "contract": { "ownerAddress": "TPwJS5eC5BPGyMGtYTHNhPTB89sUWjDSSu", "accountAddress": "TWxKPGEyGWEP87Z4GrBccQiWQCf5iUHx9E" }, ... } ``` -------------------------------- ### Query and Broadcast Transactions Source: https://context7.com/tronscan/tronscan-api/llms.txt Endpoints to filter transaction history by address, date, or contract type, and methods for broadcasting or dry-running signed transactions. ```bash curl "https://api.tronscan.org/api/transaction?limit=20&sort=-timestamp" curl "https://api.tronscan.org/api/transaction?address=TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" curl "https://api.tronscan.org/api/transaction?address_from=TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" curl "https://api.tronscan.org/api/transaction?date_start=2023-01-01&date_to=2023-01-31" curl "https://api.tronscan.org/api/transaction?contract_type=1" curl "https://api.tronscan.org/api/transaction/abc123def456..." curl -X POST "https://api.tronscan.org/api/transaction" -H "Content-Type: application/json" -d '{"transaction": "0a85010a02..."}' curl -X POST "https://api.tronscan.org/api/transaction?dry-run=true" -H "Content-Type: application/json" -d '{"transaction": "0a85010a02..."}' ``` -------------------------------- ### TestNet API Source: https://context7.com/tronscan/tronscan-api/llms.txt Request test TRX tokens for development on the TRON testnet (requires captcha verification). ```APIDOC ## POST /api/testnet/request-coins ### Description Request test TRX tokens for development on the TRON testnet. Requires captcha verification. ### Method POST ### Endpoint /api/testnet/request-coins ### Parameters #### Request Body - **address** (string) - Required - The TRON address to receive test TRX. - **captchaCode** (string) - Required - The response code from the captcha verification. ### Request Example ```json { "address": "TTestAddress...", "captchaCode": "captcha-response-code" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **amount** (integer) - The amount of test TRX granted. - **code** (string) - Status code (e.g., "SUCCESS"). - **message** (string) - Any additional message. #### Response Example (Success) ```json { "success": true, "amount": 10000000000, "code": "SUCCESS", "message": "" } ``` #### Response Example (Already Requested) ```json { "success": false, "code": "ALREADY_REQUESTED_ADDRESS", "message": "Already requested for address TTestAddress..." } ``` ``` -------------------------------- ### Handle OAuth2 Redirect Callback Source: https://github.com/tronscan/tronscan-api/blob/develop/public/swagger/oauth2-redirect.html This function parses the authorization response from the URL, validates the state parameter to prevent CSRF, and updates the Swagger UI authentication state. It supports both access code and implicit flow patterns. ```javascript 'use strict'; function run () { var oauth2 = window.opener.swaggerUIRedirectOauth2; var sentState = oauth2.state; var redirectUrl = oauth2.redirectUrl; var isValid, qp, arr; if (/code|token|error/.test(window.location.hash)) { qp = window.location.hash.substring(1); } else { qp = location.search.substring(1); } arr = qp.split("&"); arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';}); qp = qp ? JSON.parse('{' + arr.join() + '}', function (key, value) { return key === "" ? value : decodeURIComponent(value); } ) : {}; isValid = qp.state === sentState; if (( oauth2.auth.schema.get("flow") === "accessCode"|| oauth2.auth.schema.get("flow") === "authorizationCode" ) && !oauth2.auth.code) { if (!isValid) { oauth2.errCb({ authId: oauth2.auth.name, source: "auth", level: "warning", message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server" }); } if (qp.code) { delete oauth2.state; oauth2.auth.code = qp.code; oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl}); } else { let oauthErrorMsg; if (qp.error) { oauthErrorMsg = "["+qp.error+"]: " + (qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") + (qp.error_uri ? "More info: "+qp.error_uri : ""); } oauth2.errCb({ authId: oauth2.auth.name, source: "auth", level: "error", message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server" }); } } else { oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl}); } window.close(); } ``` -------------------------------- ### Query Witness Information using TRONScan API Source: https://context7.com/tronscan/tronscan-api/llms.txt Fetch super representative (witness) details, including production statistics, vote counts, and network node geolocation. Supports querying maintenance statistics and network node maps. ```bash curl "https://api.tronscan.org/api/witness" curl "https://api.tronscan.org/api/witness/maintenance-statistic" curl "https://api.tronscan.org/api/nodemap" ``` -------------------------------- ### Token API Source: https://context7.com/tronscan/tronscan-api/llms.txt Query TRC10 tokens (asset issues) including ICO status, supply distribution, and token holder information. ```APIDOC ## GET /api/token ### Description Queries TRC10 tokens with filtering and sorting options. ### Method GET ### Endpoint /api/token ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return. - **sort** (string) - Optional - Field to sort by (e.g., `-supply` for descending). - **name** (string) - Optional - Token name, supports wildcards (e.g., 'BTT', 'BIT%'). - **owner** (string) - Optional - Filter by the token owner's address. - **status** (string) - Optional - Filter by token status (e.g., 'ico'). - **date_start** (string) - Optional - Start date for filtering. - **date_end** (string) - Optional - End date for filtering. ### Request Example ```bash # List all tokens with pagination curl "https://api.tronscan.org/api/token?limit=50&sort=-supply" # Search tokens by name curl "https://api.tronscan.org/api/token?name=BTT" # Filter by owner address curl "https://api.tronscan.org/api/token?owner=TTokenOwnerAddress..." # Filter active ICOs curl "https://api.tronscan.org/api/token?status=ico" ``` ## GET /api/token/{token_name} ### Description Retrieves detailed information for a specific TRC10 token. ### Method GET ### Endpoint /api/token/{token_name} ### Parameters #### Path Parameters - **token_name** (string) - Required - The name of the token (e.g., 'BTT'). ### Response #### Success Response (200) - **name** (string) - Token name. - **ownerAddress** (string) - Token owner's address. - **totalSupply** (integer) - Total supply of the token. - **startTime** (string) - ICO start time. - **endTime** (string) - ICO end time. - **price** (number) - Current token price. - **issued** (integer) - Amount of tokens issued. - **issuedPercentage** (number) - Percentage of tokens issued. - **remaining** (integer) - Remaining tokens. - **remainingPercentage** (number) - Percentage of tokens remaining. - **frozenTotal** (integer) - Total frozen tokens. - **totalTransactions** (integer) - Total number of transactions for the token. - **nrOfTokenHolders** (integer) - Number of token holders. #### Response Example ```json { "name": "BTT", "ownerAddress": "TOwnerAddress...", "totalSupply": 990000000000, "startTime": "2019-01-28T00:00:00Z", "endTime": "2019-02-03T00:00:00Z", "price": 0.00015, "issued": 59400000000, "issuedPercentage": 6.0, "remaining": 930600000000, "remainingPercentage": 94.0, "frozenTotal": 0, "totalTransactions": 1500000, "nrOfTokenHolders": 250000 } ``` ## GET /api/token/{token_name}/address ### Description Retrieves a list of addresses holding a specific TRC10 token, sorted by balance. ### Method GET ### Endpoint /api/token/{token_name}/address ### Parameters #### Path Parameters - **token_name** (string) - Required - The name of the token (e.g., 'BTT'). #### Query Parameters - **limit** (integer) - Optional - Maximum number of results to return. - **sort** (string) - Optional - Field to sort by (e.g., `-balance` for descending). ### Request Example ```bash curl "https://api.tronscan.org/api/token/BTT/address?limit=100&sort=-balance" ``` ### Response #### Success Response (200) - **total** (integer) - Total number of token holders. - **data** (array) - Array of objects, each containing address and balance information. #### Response Example ```json { "total": 250000, "data": [ // ... address and balance objects ] } ``` ``` -------------------------------- ### Transaction Builder API Source: https://context7.com/tronscan/tronscan-api/llms.txt Build various TRON transaction types programmatically, including TRX transfers, token transfers, account creation/update, and reward withdrawal. ```APIDOC ## POST /api/transaction-builder/contract/transfer ### Description Builds a TRON transaction for transferring TRX. ### Method POST ### Endpoint /api/transaction-builder/contract/transfer ### Parameters #### Request Body - **contract** (object) - Required - Contract details for the transfer. - **ownerAddress** (string) - Required - The address initiating the transfer. - **toAddress** (string) - Required - The recipient address. - **amount** (integer) - Required - The amount of TRX to transfer (in sun). - **broadcast** (boolean) - Optional - Whether to broadcast the transaction immediately. - **key** (string) - Optional - The private key (hex format) to sign and broadcast the transaction. - **data** (string) - Optional - An optional memo for the transaction. ### Request Example ```json { "contract": { "ownerAddress": "TFromAddress...", "toAddress": "TToAddress...", "amount": 1000000 }, "broadcast": false } ``` ### Response #### Success Response (200) - **transaction** (object) - The constructed transaction details. - **success** (boolean) - Indicates if the operation was successful. - **result** (object) - Result code and message. #### Response Example ```json { "transaction": { "hash": "abc123...", "contracts": [...], "timestamp": 1673789400000 }, "success": true, "result": {"code": "SUCCESS", "message": ""} } ``` ## POST /api/transaction-builder/contract/transferasset ### Description Builds a TRON transaction for transferring TRC10 tokens. ### Method POST ### Endpoint /api/transaction-builder/contract/transferasset ### Parameters #### Request Body - **contract** (object) - Required - Contract details for the token transfer. - **ownerAddress** (string) - Required - The address initiating the transfer. - **toAddress** (string) - Required - The recipient address. - **assetName** (string) - Required - The name of the TRC10 token. - **amount** (integer) - Required - The amount of tokens to transfer. - **broadcast** (boolean) - Optional - Whether to broadcast the transaction immediately. - **key** (string) - Optional - The private key (hex format) to sign and broadcast the transaction. ### Request Example ```json { "contract": { "ownerAddress": "TFromAddress...", "toAddress": "TToAddress...", "assetName": "TokenName", "amount": 100 }, "broadcast": false } ``` ## POST /api/transaction-builder/contract/accountcreate ### Description Builds a TRON transaction to create a new account. ### Method POST ### Endpoint /api/transaction-builder/contract/accountcreate ### Parameters #### Request Body - **contract** (object) - Required - Contract details for account creation. - **ownerAddress** (string) - Required - The address creating the new account. - **accountAddress** (string) - Required - The address of the new account to be created. ### Request Example ```json { "contract": { "ownerAddress": "TOwnerAddress...", "accountAddress": "TNewAccountAddress..." } } ``` ## POST /api/transaction-builder/contract/accountupdate ### Description Builds a TRON transaction to update an account name. ### Method POST ### Endpoint /api/transaction-builder/contract/accountupdate ### Parameters #### Request Body - **contract** (object) - Required - Contract details for account name update. - **ownerAddress** (string) - Required - The address of the account to update. - **accountName** (string) - Required - The new name for the account. ### Request Example ```json { "contract": { "ownerAddress": "TOwnerAddress...", "accountName": "NewAccountName" } } ``` ## POST /api/transaction-builder/contract/withdrawbalance ### Description Builds a TRON transaction to withdraw SR rewards. ### Method POST ### Endpoint /api/transaction-builder/contract/withdrawbalance ### Parameters #### Request Body - **contract** (object) - Required - Contract details for withdrawing rewards. - **ownerAddress** (string) - Required - The SR address from which to withdraw rewards. - **key** (string) - Required - The private key (hex format) to sign and broadcast the transaction. - **broadcast** (boolean) - Required - Whether to broadcast the transaction immediately. ### Request Example ```json { "contract": { "ownerAddress": "TSRAddress..." }, "key": "privateKeyHex...", "broadcast": true } ``` ``` -------------------------------- ### Interact with TRON Full Node GRPC via REST API Source: https://context7.com/tronscan/tronscan-api/llms.txt Access TRON full node gRPC methods through RESTful endpoints. Supports custom node connections and retrieving various blockchain data like blocks, accounts, and transactions. ```bash curl "https://api.tronscan.org/api/grpc/full/getnowblock" curl "https://api.tronscan.org/api/grpc/full/getnowblock?ip=52.53.189.99&port=50051" curl "https://api.tronscan.org/api/grpc/full/getblockbynum/12345678" curl "https://api.tronscan.org/api/grpc/full/totaltransaction" curl "https://api.tronscan.org/api/grpc/full/getaccount/TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" curl "https://api.tronscan.org/api/grpc/full/getaccountnet/TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" curl "https://api.tronscan.org/api/grpc/full/gettransactionbyid/abc123..." curl "https://api.tronscan.org/api/grpc/full/listnodes" curl "https://api.tronscan.org/api/grpc/full/listwitnesses" ``` -------------------------------- ### Transaction Building API Source: https://github.com/tronscan/tronscan-api/blob/develop/README.md Endpoints for building, signing, and broadcasting transactions on the Tron network. Note: Use for testing or self-hosted instances only. Never send private keys to api.tronscan.org. ```APIDOC ## POST /api/transaction-builder/contract/transfer ### Description Broadcasts a signed transfer contract to the network. ### Method POST ### Endpoint /api/transaction-builder/contract/transfer ### Parameters #### Request Body - **contract** (object) - Required - The contract details. - **ownerAddress** (string) - Required - From Account - **toAddress** (string) - Required - To Account - **amount** (number) - Required - Amount of coins to send in sun - **key** (string) - Optional - Private key for signing the transaction. - **broadcast** (boolean) - Optional - Set to true to broadcast the transaction to the network. ### Request Example ```json { "contract": { "ownerAddress": "TPwJS5eC5BPGyMGtYTHNhPTB89sUWjDSSu", "toAddress": "TWxKPGEyGWEP87Z4GrBccQiWQCf5iUHx9E", "amount": 100000 }, "key": "FFA5EA61073FB13E1559F182F91E25C3E51C03906428C7BC8C865A335AED7617", "broadcast": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **result** (object) - The result of the operation. - **code** (string) - Status code (e.g., "SUCCESS"). - **message** (string) - Status message. #### Response Example ```json { "success": true, "result": { "code": "SUCCESS", "message": "" } } ``` ``` ```APIDOC ## POST /api/transaction-builder/contract/transferasset ### Description Broadcasts a signed asset transfer contract to the network. ### Method POST ### Endpoint /api/transaction-builder/contract/transferasset ### Parameters #### Request Body - **contract** (object) - Required - The contract details. - **ownerAddress** (string) - Required - From Account - **toAddress** (string) - Required - To Account - **assetName** (string) - Required - Token Name - **amount** (number) - Required - Amount of coins to send in sun - **key** (string) - Optional - Private key for signing the transaction. - **broadcast** (boolean) - Optional - Set to true to broadcast the transaction to the network. ### Request Example ```json { "contract": { "ownerAddress": "TPwJS5eC5BPGyMGtYTHNhPTB89sUWjDSSu", "toAddress": "TWxKPGEyGWEP87Z4GrBccQiWQCf5iUHx9E", "assetName": "ExampleToken", "amount": 100000 }, "key": "FFA5EA61073FB13E1559F182F91E25C3E51C03906428C7BC8C865A335AED7617", "broadcast": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **result** (object) - The result of the operation. - **code** (string) - Status code (e.g., "SUCCESS"). - **message** (string) - Status message. #### Response Example ```json { "success": true, "result": { "code": "SUCCESS", "message": "" } } ``` ``` ```APIDOC ## POST /api/transaction-builder/contract/accountcreate ### Description Creates a new account on the Tron network. ### Method POST ### Endpoint /api/transaction-builder/contract/accountcreate ### Parameters #### Request Body - **contract** (object) - Required - The contract details. - **ownerAddress** (string) - Required - Owner Account - **accountAddress** (string) - Required - Account Address to create - **key** (string) - Optional - Private key for signing the transaction. - **broadcast** (boolean) - Optional - Set to true to broadcast the transaction to the network. ### Request Example ```json { "contract": { "ownerAddress": "TPwJS5eC5BPGyMGtYTHNhPTB89sUWjDSSu", "accountAddress": "TWxKPGEyGWEP87Z4GrBccQiWQCf5iUHx9E" }, "key": "FFA5EA61073FB13E1559F182F91E25C3E51C03906428C7BC8C865A335AED7617", "broadcast": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **result** (object) - The result of the operation. - **code** (string) - Status code (e.g., "SUCCESS"). - **message** (string) - Status message. #### Response Example ```json { "success": true, "result": { "code": "SUCCESS", "message": "" } } ``` ``` ```APIDOC ## POST /api/transaction-builder/contract/accountupdate ### Description Updates an existing account on the Tron network. ### Method POST ### Endpoint /api/transaction-builder/contract/accountupdate ### Parameters #### Request Body - **contract** (object) - Required - The contract details. - **ownerAddress** (string) - Required - Owner Account - **accountName** (string) - Required - Account Name to update - **key** (string) - Optional - Private key for signing the transaction. - **broadcast** (boolean) - Optional - Set to true to broadcast the transaction to the network. ### Request Example ```json { "contract": { "ownerAddress": "TPwJS5eC5BPGyMGtYTHNhPTB89sUWjDSSu", "accountName": "NewName" }, "key": "FFA5EA61073FB13E1559F182F91E25C3E51C03906428C7BC8C865A335AED7617", "broadcast": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **result** (object) - The result of the operation. - **code** (string) - Status code (e.g., "SUCCESS"). - **message** (string) - Status message. #### Response Example ```json { "success": true, "result": { "code": "SUCCESS", "message": "" } } ``` ``` ```APIDOC ## POST /api/transaction-builder/contract/withdrawbalance ### Description Claims rewards for an owner account. ### Method POST ### Endpoint /api/transaction-builder/contract/withdrawbalance ### Parameters #### Request Body - **contract** (object) - Required - The contract details. - **ownerAddress** (string) - Required - Owner Account for withdrawing rewards. - **key** (string) - Optional - Private key for signing the transaction. - **broadcast** (boolean) - Optional - Set to true to broadcast the transaction to the network. ### Request Example ```json { "contract": { "ownerAddress": "TPwJS5eC5BPGyMGtYTHNhPTB89sUWjDSSu" }, "key": "FFA5EA61073FB13E1559F182F91E25C3E51C03906428C7BC8C865A335AED7617", "broadcast": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **result** (object) - The result of the operation. - **code** (string) - Status code (e.g., "SUCCESS"). - **message** (string) - Status message. #### Response Example ```json { "success": true, "result": { "code": "SUCCESS", "message": "" } } ``` ``` -------------------------------- ### Retrieve TRON Blockchain Statistics using Stats API Source: https://context7.com/tronscan/tronscan-api/llms.txt Fetch aggregated TRON blockchain statistics, including transaction counts, block sizes, and address growth metrics. Provides an overview of the network's current state. ```bash curl "https://api.tronscan.org/api/stats/overview" ``` -------------------------------- ### Transfer Contract Payload (JSON) Source: https://github.com/tronscan/tronscan-api/blob/develop/README.md JSON payload structure for initiating a token transfer between accounts. Requires owner address, recipient address, and the amount of coins (in sun). ```json { "contract": { "ownerAddress": "TPwJS5eC5BPGyMGtYTHNhPTB89sUWjDSSu", "toAddress": "TWxKPGEyGWEP87Z4GrBccQiWQCf5iUHx9E", "amount": 100000 }, ... } ``` -------------------------------- ### Query Vote Data using TRONScan API Source: https://context7.com/tronscan/tronscan-api/llms.txt Retrieve voting data for super representative elections. Supports filtering by voter, candidate, block, or transaction. Includes live vote counts, candidate totals, and time until the next cycle. ```bash curl "https://api.tronscan.org/api/vote?limit=100&sort=-votes" curl "https://api.tronscan.org/api/vote?voter=TVoterAddress..." curl "https://api.tronscan.org/api/vote?candidate=TCandidateAddress..." curl "https://api.tronscan.org/api/vote?block=12345678" curl "https://api.tronscan.org/api/vote?transaction=abc123..." curl "https://api.tronscan.org/api/vote/live" curl "https://api.tronscan.org/api/vote/current-cycle" curl "https://api.tronscan.org/api/vote/next-cycle" curl "https://api.tronscan.org/api/vote/stats" ``` -------------------------------- ### POST /api/transaction Source: https://context7.com/tronscan/tronscan-api/llms.txt Broadcast a signed transaction to the TRON network or perform a dry-run validation. ```APIDOC ## POST /api/transaction ### Description Broadcast a signed transaction to the network or validate it using the dry-run parameter. ### Method POST ### Endpoint /api/transaction ### Parameters #### Query Parameters - **dry-run** (boolean) - Optional - If true, validates without broadcasting #### Request Body - **transaction** (string) - Required - Hex-encoded signed transaction ### Response #### Success Response (200) - **success** (boolean) - Status of the operation - **code** (string) - Result code #### Response Example { "success": true, "code": "SUCCESS" } ``` -------------------------------- ### Interact with TRON Solidity Node GRPC via REST API Source: https://context7.com/tronscan/tronscan-api/llms.txt Access TRON solidity node gRPC methods for confirmed blockchain data via REST endpoints. Supports connecting to specific nodes and retrieving confirmed block and account information. ```bash curl "https://api.tronscan.org/api/grpc/solidity/getnowblock" curl "https://api.tronscan.org/api/grpc/solidity/getnowblock?ip=52.53.189.99&port=50061" curl "https://api.tronscan.org/api/grpc/solidity/getblockbynum/12345678" curl "https://api.tronscan.org/api/grpc/solidity/getaccount/TLyqzVGLV1srkB7dToTAEqgDSfPtXRJZYH" curl "https://api.tronscan.org/api/grpc/solidity/listwitnesses" ```