# yaml-language-server: $schema=https://spec.openapis.org/oas/3.1/schema/2022-10-07 openapi: 3.1.0 info: title: "Tron Solidity HTTP API" version: "1.0" servers: - url: https://tron-mainnet.g.alchemy.com/v2/{apiKey} variables: apiKey: default: docs-demo security: - apiKey: [] paths: /walletsolidity/gettransactionbyid: post: summary: Get transaction by ID (Solidity) description: Retrieves a transaction's full raw data and metadata by its txID. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: string example: value: "b61fc25144514889c725452e557e78f773672aac2e89da3f14704b8129a63e49" responses: "200": description: Successful response with transaction details content: application/json: schema: type: object properties: ret: type: array items: type: object properties: contractRet: type: string signature: type: array items: type: string txID: type: string raw_data: type: object raw_data_hex: type: string example: ret: - contractRet: "SUCCESS" signature: - "b8e16a05d6d0299425c00a5e336eeb975999c2b5f83860f58b957ce737465f0e47442f19de5bd381b3d265dbeae577ad9208ff540d53f1adcd8e4c587ae88a2000" txID: "b61fc25144514889c725452e557e78f773672aac2e89da3f14704b8129a63e49" raw_data: contract: - parameter: value: data: "a9059cbb0000000000000000000000001500f43493489e872ec5d8817813944dfce319d500000000000000000000000000000000000000000000000000000000813871c0" owner_address: "412c14dd4db74751e2d39a81ae3decb7b5eb88e6c6" contract_address: "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" type_url: "type.googleapis.com/protocol.TriggerSmartContract" type: "TriggerSmartContract" ref_block_bytes: "ba0a" ref_block_hash: "b147c98bf55c8608" expiration: 1761832694605 fee_limit: 30000000 timestamp: 1761818298000 raw_data_hex: "0a02ba0a2208b147c98bf55c860840cde6a5aba3335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a15412c14dd4db74751e2d39a81ae3decb7b5eb88e6c6121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb0000000000000000000000001500f43493489e872ec5d8817813944dfce319d500000000000000000000000000000000000000000000000000000000813871c070908db7a4a33390018087a70e" /walletsolidity/gettransactioninfobyid: post: summary: Get transaction info by ID description: Retrieves transaction information by its txID. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: string example: value: "b61fc25144514889c725452e557e78f773672aac2e89da3f14704b8129a63e49" responses: "200": description: Successful response with transaction info content: application/json: schema: type: object example: id: "b61fc25144514889c725452e557e78f773672aac2e89da3f14704b8129a63e49" fee: 6773400 blockNumber: 77052449 blockTimeStamp: 1761818367000 contractResult: - "0000000000000000000000000000000000000000000000000000000000000000" contract_address: "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" receipt: energy_fee: 6428400 origin_energy_usage: 1 energy_usage_total: 64285 net_fee: 345000 result: "SUCCESS" energy_penalty_total: 49635 log: - address: "a614f803b6fd780986a42c78ec9c7f77e6ded13c" topics: - "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" - "0000000000000000000000002c14dd4db74751e2d39a81ae3decb7b5eb88e6c6" - "0000000000000000000000001500f43493489e872ec5d8817813944dfce319d5" data: "00000000000000000000000000000000000000000000000000000000813871c0" /walletsolidity/gettransactioninfobyblocknum: post: summary: Get transaction info by block number description: Retrieves all transaction information for a specific block number. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: num: type: integer responses: "200": description: Successful response with transaction info array content: application/json: schema: type: array items: type: object example: - result: "FAILED" fee: 12330 blockNumber: 20000000 contractResult: - "08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a57524f4e475f47414d4500000000000000000000000000000000000000000000" blockTimeStamp: 1590264912000 resMessage: "524556455254206f70636f6465206578656375746564" receipt: result: "REVERT" net_fee: 4120 energy_usage: 431 energy_fee: 8210 energy_usage_total: 1252 id: "2afd59bf52dbd112f17d1b65b043032ecf361baa2fdc4c77b3ff520b40d8a9ee" contract_address: "41c19f1e73bc675033daba1e92734487c8129e81c8" /walletsolidity/gettransactioncountbyblocknum: post: summary: Get transaction count by block number description: Retrieves the number of transactions in a specific block by block number. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: num: type: integer responses: "200": description: Successful response with transaction count content: application/json: schema: type: object properties: count: type: integer example: count: 138 /walletsolidity/getnowblock: post: summary: Get latest block description: Retrieves the latest block on Tron. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object example: {} responses: "200": description: Successful response with latest block details content: application/json: schema: type: object example: blockID: "00000000049acfe33d6c710b9c7688de34ab37b49aa560fd265c537d75f855e4" block_header: raw_data: number: 77254627 txTrieRoot: "358d7f8203464fff14aba32116a601e9e242c0460e5e03b7f0ffd37ddac9a383" witness_address: "415a27141dbd202aa1344c042b51ae541262eebfb7" parentHash: "00000000049acfe28603ca0b0e97a305c21ce51b2a1090cc1f6d93d13c7c1463" version: 32 timestamp: 1762425075000 witness_signature: "3cfe1e1cb9f6ac54f76ecbcc77758e599e3debb556e04df44207c249ee6898216c82aeb5cccc6a1eaae11cc36d73fd5e29adf1cdc87b0c102dd1e94f46b42bd901" transactions: - ret: - contractRet: "SUCCESS" signature: - "70ef6d6daff8a9f2c42329dc128445cbde5d5ebd212bd91d13188c7be7db5071279c9785124b0547b81e554dedf82e700fc28916c92dd8cbb986ae205342864c01" txID: "ca80ccc01c2268b72f54b1237285fe4183ae47e86fb1a2800f484f76c1dc71e2" raw_data: contract: - parameter: value: data: "23b872dd0000000000000000000000000e2c8f706153047cd21c221195bb38fe17cedeb9000000000000000000000000165af3d5652beaed9cd6022d5e6c49b7284d80090000000000000000000000000000000000000000000000000000000001312cff" owner_address: "41365f2167d40678aac0e1fc6cc73a9b1fde8d1f0b" contract_address: "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" type_url: "type.googleapis.com/protocol.TriggerSmartContract" type: "TriggerSmartContract" ref_block_bytes: "cfcf" ref_block_hash: "66e60bb35dff5e13" expiration: 1762504329000 fee_limit: 100000000 timestamp: 1762425072038 raw_data_hex: "0a02cfcf220866e60bb35dff5e1340a88ec7eba5335acf01081f12ca010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e74726163741294010a1541365f2167d40678aac0e1fc6cc73a9b1fde8d1f0b121541a614f803b6fd780986a42c78ec9c7f77e6ded13c226423b872dd0000000000000000000000000e2c8f706153047cd21c221195bb38fe17cedeb9000000000000000000000000165af3d5652beaed9cd6022d5e6c49b7284d80090000000000000000000000000000000000000000000000000000000001312cff70a6d3e1c5a533900180c2d72f" /walletsolidity/getblock: post: summary: Get block by number (Solidity) description: Retrieves a block's details by its block number. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: string example: value: "123456" responses: "200": description: Successful response with block details content: application/json: schema: type: object example: blockID: "00000000049ad00135b3f7a2ee800a65d2d8b5e5021954b1d5ba7a4f8bc4e933" block_header: raw_data: number: 77254657 txTrieRoot: "be79139b717a83048c55447543e9e2233d3625b11ac84b5ce29a833888b8bd6e" witness_address: "419a96c8003a1e3a6866c08acff9f629e2a6ef062b" parentHash: "00000000049ad000069ae868d35fb6a1c68b7b0d2d7818c844855a3298899c41" version: 32 timestamp: 1762425165000 witness_signature: "82ffeab01f34ed9d0fdec5df737c4c93c1f8769d4242fba9081fed2b64c13d0453c360d498957420ab2963d84cd9ae0056e8cd8e86d48d45f788dd435130833200" /walletsolidity/getblockbynum: post: summary: Get block by number (alias) description: Retrieves block details by block number using the `getblockbynum` endpoint. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: num: type: integer responses: "200": description: Successful response with block details content: application/json: schema: type: object example: blockID: "0000000000004e2014d43993f9403af438f8a2ab2470b2f10369b51eec6c64c4" block_header: raw_data: number: 20000 txTrieRoot: "0000000000000000000000000000000000000000000000000000000000000000" witness_address: "410694981b116304ed21e05896fb16a6bc2e91c92c" parentHash: "0000000000004e1fb1f8ccf17f8cd6f7df753a9d007db21b6f64df474c483f27" timestamp: 1529951556000 witness_signature: "afe73dbfaa13e635ba3d5dd50f19bc4f77e7c537a780214e695ee87f4d6d84f96615c26627bcfae1a004c852c4b91bd1234046cbdfd6bea0b13f60a4dfd64f8100" /walletsolidity/getblockbyid: post: summary: Get block by ID (Solidity) description: Retrieves block details using a block ID. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: string example: value: "00000000000000c82a54a3bbdc956e1ddebc903f29b8daf28505b56f55a3f87d" responses: "200": description: Successful response with block details content: application/json: schema: type: object example: blockID: "00000000000000c82a54a3bbdc956e1ddebc903f29b8daf28505b56f55a3f87d" block_header: raw_data: number: 200 txTrieRoot: "0000000000000000000000000000000000000000000000000000000000000000" witness_address: "411661f25387370c9cd3a9a5d97e60ca90f4844e7e" parentHash: "00000000000000c7c8f27726916dfddca3c1c3481eb01da8a08938263674cea4" timestamp: 1529892138000 witness_signature: "691e9116963b54ef7eb07692266319b029217e4d4ae8e8cb97e341617460f3822eff149c690aac6f2e0ad27d0af4fa8824d113d7a71c091245f778438ca4bde801" /walletsolidity/getblockbylatestnum: post: summary: Get latest N blocks description: Retrieves the latest `num` blocks from the blockchain, starting from the current block and going backward. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: num: type: integer responses: "200": description: Successful response with latest N blocks content: application/json: schema: type: object properties: block: type: array items: type: object example: block: - blockID: "00000000049ad04f4c3d6c9a7546b01a6cae0af50bd63fa37e0761a59c40c20a" block_header: raw_data: number: 77254735 txTrieRoot: "9a614736f79ecc802ffabb3f8bb60c7e05506896e5529b9e578874abda073410" witness_address: "415a27141dbd202aa1344c042b51ae541262eebfb7" parentHash: "00000000049ad04ece107f96e916de3b3612b144cbe599a28b5aa1080631cfdb" version: 32 timestamp: 1762425399000 witness_signature: "d16417d22ef01e82a036897727d69028df187e6ac1b023ab457b691b78869bc97fb9f2d032d3030a364e9fa22203a2850b3cedfb13e08fbd7b45cba187caeba101" transactions: - ret: - contractRet: "SUCCESS" signature: - "1bd850159d96babf13ade0e7895cc9a3225750a73eba7a930e2bb19b06b6ccef9ea76f3373d3101224f16b363bab3a5e0f28be553453720878078eccf4e9b3fc00" txID: "4b38100d854bcccbb4386c19fa2d03bca5668350515abeced92e3a2204de7a35" raw_data: contract: - parameter: value: data: "a9059cbb0000000000000000000000416da92d329cec6d7401b3fd8ad96ab27bfadf34190000000000000000000000000000000000000000000000000000000000c28cb0" owner_address: "41bbd91fd0f2cd056bfa748d25286f9f548e5e8bf5" contract_address: "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" type_url: "type.googleapis.com/protocol.TriggerSmartContract" type: "TriggerSmartContract" ref_block_bytes: "d03b" ref_block_hash: "20d3bb4a88e55a0a" expiration: 1762425453000 fee_limit: 30000000 timestamp: 1762425395510 raw_data_hex: "0a02d03b220820d3bb4a88e55a0a40c8f3f8c5a5335aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541bbd91fd0f2cd056bfa748d25286f9f548e5e8bf5121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb0000000000000000000000416da92d329cec6d7401b3fd8ad96ab27bfadf34190000000000000000000000000000000000000000000000000000000000c28cb070b6b2f5c5a53390018087a70e" /walletsolidity/getblockbylimitnext: post: summary: Get blocks by range (Solidity) description: Retrieves blocks between startNum and endNum (inclusive). tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: startNum: type: integer endNum: type: integer responses: "200": description: Successful response with block array content: application/json: schema: type: object properties: block: type: array items: type: object example: block: - blockID: "00000000000000010ff5414c5cfbe9eae982e8cef7eb2399a39118e1206c8247" block_header: raw_data: number: 1 txTrieRoot: "0000000000000000000000000000000000000000000000000000000000000000" witness_address: "415095d4f4d26ebc672ca12fc0e3a48d6ce3b169d2" parentHash: "00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dc" timestamp: 1529891469000 witness_signature: "4544a6004c76286a1d6248f451bf148345a51e21881e84899758468da7b1c7e85b809735a1b2be29f166cfba8c5e69543f4f24294fbfa0498a39002166a397ba00" /walletsolidity/getaccount: post: summary: Get account information description: Retrieves account details for a given address. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: address: type: string visible: type: boolean responses: "200": description: Successful response with account information content: application/json: schema: type: object example: address: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" balance: 100001 create_time: 1675582485000 latest_opration_time: 1750688181000 latest_consume_time: 1712481906000 latest_consume_free_time: 1750688112000 net_window_size: 28800000 net_window_optimized: true account_resource: latest_consume_time_for_energy: 1761509451000 energy_window_size: 28800000 acquired_delegated_frozenV2_balance_for_energy: 1000000 energy_window_optimized: true owner_permission: permission_name: "owner" threshold: 1 keys: - address: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" weight: 1 active_permission: - type: "Active" id: 2 permission_name: "active" threshold: 1 operations: "7fff1fc0033e0300000000000000000000000000000000000000000000000000" keys: - address: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" weight: 1 frozenV2: - {} - type: "ENERGY" - type: "TRON_POWER" assetV2: - key: "1004977" value: 8888880000 - key: "1005026" value: 8888880000 free_asset_net_usageV2: - key: "1004977" value: 0 - key: "1005026" value: 0 asset_optimized: true /walletsolidity/getdelegatedresource: post: summary: Get delegated resource description: Retrieves information about resources delegated from one address to another. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: fromAddress: type: string toAddress: type: string visible: type: boolean example: fromAddress: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" toAddress: "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1" visible: true responses: "200": description: Successful response with delegated resource info content: application/json: schema: type: object /walletsolidity/getdelegatedresourceaccountindex: post: summary: Get delegated resource account index (Solidity) description: Retrieves the delegated resource account index for a given address. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: string visible: type: boolean example: value: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" visible: true responses: "200": description: Successful response with account index content: application/json: schema: type: object example: account: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" /walletsolidity/getcandelegatedmaxsize: post: summary: Get max delegatable resource size description: Retrieves the maximum resource size that can be delegated for a specific address and type. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: owner_address: type: string type: type: integer description: "Resource type (0 for BANDWIDTH, 1 for ENERGY)" visible: type: boolean responses: "200": description: Successful response with delegatable resource size content: application/json: schema: type: object /walletsolidity/getavailableunfreezecount: post: summary: Get available unfreeze count (Solidity) description: Retrieves the number of available unfreezes for a given account. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: owner_address: type: string visible: type: boolean responses: "200": description: Successful response with available unfreeze count content: application/json: schema: type: object properties: count: type: integer example: count: 32 /walletsolidity/getcanwithdrawunfreezeamount: post: summary: Get withdrawable unfreeze amount (Solidity) description: Retrieves the amount that can be withdrawn from unfreezing at a given timestamp. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: owner_address: type: string timestamp: type: integer visible: type: boolean responses: "200": description: Successful response with withdrawable amount content: application/json: schema: type: object /walletsolidity/getdelegatedresourceaccountindexv2: post: summary: Get delegated resource account index V2 description: Retrieves the delegated resource account index (v2) for a given address. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: string visible: type: boolean example: value: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" visible: true responses: "200": description: Successful response with account index and fromAccounts content: application/json: schema: type: object properties: account: type: string fromAccounts: type: array items: type: string example: account: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" fromAccounts: - "TVMBFcg1ug2wH2ArCR4GoTJCpag4ZrRr6y" /walletsolidity/getburntrx: post: summary: Get burned TRX amount description: Retrieves the total amount of burned TRX. tags: - Tron Solidity HTTP API Endpoints responses: "200": description: Successful response with burn TRX amount content: application/json: schema: type: object properties: burnTrxAmount: type: integer example: burnTrxAmount: 15444782802476450 /walletsolidity/triggerconstantcontract: post: summary: Trigger constant contract description: Executes a read-only smart contract function locally without broadcasting a transaction. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: owner_address: type: string contract_address: type: string function_selector: type: string parameter: type: string visible: type: boolean responses: "200": description: Successful response with contract execution result content: application/json: schema: type: object /walletsolidity/estimateenergy: post: summary: Estimate energy usage description: Estimates the energy consumption for executing a smart contract method locally without broadcasting it. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: owner_address: type: string contract_address: type: string function_selector: type: string parameter: type: string visible: type: boolean responses: "200": description: Successful response with energy estimate content: application/json: schema: type: object properties: result: type: object properties: result: type: boolean example: true energy_required: type: integer example: 900000 /walletsolidity/getassetissuebyname: post: summary: Get asset issue by name (Solidity) description: Retrieves asset issuance details based on the asset's name (in hex format). tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: string description: Asset name in hex (e.g., "62747474657374") example: value: "62747474657374" responses: "200": description: Successful response with asset details content: application/json: schema: type: object /walletsolidity/getassetissuebyid: post: summary: Get asset issue by ID description: Retrieves asset issuance details based on asset ID. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: integer visible: type: boolean responses: "200": description: Successful response with asset info content: application/json: schema: type: object example: owner_address: "TGzz8gjYiYRqpfmDwnLxfgPuLVNmpCswVp" name: "SEED" abbr: "SEED" total_supply: 100000000000 trx_num: 1000000 num: 1 start_time: 1529987043000 end_time: 1530342060000 description: "Sesameseed tokens for community rewards and SEEDgerminator investment of community-voted projects." url: "http://www.sesameseed.org" id: "1000001" /walletsolidity/getassetissuelist: post: summary: Get all asset issues description: Retrieves a list of all assets issued on the blockchain. tags: - Tron Solidity HTTP API Endpoints responses: "200": description: Successful response with list of asset issues content: application/json: schema: type: object properties: assetIssue: type: array items: type: object /walletsolidity/getassetissuelistbyname: post: summary: Get asset issue list by name description: Retrieves a list of assets matching the provided name in hex format. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: value: type: string description: Asset name in hex example: value: "62747474657374" responses: "200": description: Successful response with matching asset issues content: application/json: schema: type: object /walletsolidity/getpaginatedassetissuelist: post: summary: Get paginated asset issue list description: Retrieves a paginated list of all asset issues. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: offset: type: integer limit: type: integer responses: "200": description: Successful response with paginated asset issues content: application/json: schema: type: object properties: assetIssue: type: array items: type: object properties: owner_address: type: string name: type: string abbr: type: string total_supply: type: integer trx_num: type: integer num: type: integer start_time: type: integer end_time: type: integer description: type: string url: type: string id: type: string /walletsolidity/listexchanges: post: summary: List all exchanges description: Retrieves all active token exchanges. tags: - Tron Solidity HTTP API Endpoints responses: "200": description: Successful response with list of exchanges content: application/json: schema: type: object properties: exchanges: type: array items: type: object properties: exchange_id: type: integer creator_address: type: string create_time: type: integer first_token_id: type: string first_token_balance: type: integer second_token_id: type: string second_token_balance: type: integer example: exchanges: - exchange_id: 186 creator_address: "411aa7ca8c558e44c34b05d49121b5256ef7f86f52" create_time: 1713505692000 first_token_id: "31303035303338" first_token_balance: 198100000 second_token_id: "5f" second_token_balance: 49974761 /walletsolidity/getexchangebyid: post: summary: Get exchange by ID description: Retrieves exchange details by its unique ID. tags: - Tron Solidity HTTP API Endpoints requestBody: required: true content: application/json: schema: type: object properties: id: type: string example: id: "1" responses: "200": description: Successful response with exchange details content: application/json: schema: type: object properties: exchange_id: type: integer creator_address: type: string create_time: type: integer first_token_id: type: string first_token_balance: type: integer second_token_id: type: string second_token_balance: type: integer example: exchange_id: 1 creator_address: "41f596e85bfd042744f76880979a133da0728679d9" create_time: 1539673398000 first_token_id: "31303030353634" first_token_balance: 5 second_token_id: "5f" second_token_balance: 4326459