diff --git a/v1.0/RPC Nodes/others/rpc-tron/accountpermissionupdate.md b/v1.0/RPC Nodes/others/rpc-tron/accountpermissionupdate.md deleted file mode 100644 index 176fee4f..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/accountpermissionupdate.md +++ /dev/null @@ -1,197 +0,0 @@ ---- -title: "accountpermissionupdate" -slug: "rpc-tron-accountpermissionupdate" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, TronPermission, AccountPermissionUpdateOptions } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const owner: TronPermission = { - type: 0, - permissionName: "owner", - threshold: 1, - operations: "", - keys: [ - { - address: "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - weight: 1 - } - ] -} - -const active: TronPermission = { - "type": 2, - "permission_name": "active0", - "threshold": 2, - "operations": "7fff1fc0037e0000000000000000000000000000000000000000000000000000", - "keys": [ - { - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "weight": 1 - }, - { - "address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "weight": 1 - } - ] -} - -const res = await tatum.rpc.accountPermissionUpdate('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', [active], owner, { - visible: true -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `accountPermissionUpdate` method is used to update an account's permissions on the TRON network. These permissions include the owner permission, account witness permissions, and a list of active permissions. The response is an unsigned transaction, with the transaction type being `AccountPermissionUpdateContract`. - -### Parameters - -* `ownerAddress` (string): The address of the owner. -* `actives` (TronPermission\[]): An array of active permissions for the account. -* `owner` (TronPermission): The owner permission for the account. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Optional parameter to specify whether the address is in base58 format. - -Each `TronPermission` object has the following properties: - -* `type` (number): The permission type. -* `permissionName` (string): The permission name. -* `threshold` (number): The threshold. -* `operations` (string): The operations the permission has. -* `keys` (Array<{ address: string, weight: number }>): An array of objects that represent the addresses and their respective weights that jointly own the permission. Up to 5 keys are allowed. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `AccountPermissionUpdateContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): The owner's account address. -* `owner` (Permission): The owner permission of the account. -* `witness` (Permission): Account witness permissions. -* `actives` (Permission\[]): List of active permissions for the account. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "actives": [ - { - "type": 2, - "permission_name": "active0", - "threshold": 2, - "operations": "7fff1fc0037e0000000000000000000000000000000000000000000000000000", - "keys": [ - { - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "weight": 1 - }, - { - "address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "weight": 1 - } - ] - } - ], - "owner": { - "type": 0, - "permission_name": "owner", - "threshold": 1, - "operations": "", - "keys": [ - { - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "weight": 1 - } - ] - }, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "f0fcda10229a8e289666c4d4c8756ad86e6df84966226bd9bc98e1607a4826b0", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner": { - "keys": [ - { - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "weight": 1 - } - ], - "threshold": 1, - "permission_name": "owner" - }, - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "actives": [ - { - "operations": "7fff1fc0037e0000000000000000000000000000000000000000000000000000", - "keys": [ - { - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "weight": 1 - }, - { - "address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "weight": 1 - } - ], - "threshold": 2, - "type": "Active", - "permission_name": "active0" - } - ] - }, - "type_url": "type.googleapis.com/protocol.AccountPermissionUpdateContract" - }, - "type": "AccountPermissionUpdateContract" - } - ], - "ref_block_bytes": "aeab", - "ref_block_hash": "90861e40e6675e8e", - "expiration": 1684491273000, - "timestamp": 1684491216214 - }, - "raw_data_hex": "0a02aeab220890861e40e6675e8e40a886849c83315aea01082e12e5010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a4010a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e12241a056f776e657220013a190a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e1001226508021a0761637469766530200232207fff1fc0037e00000000000000000000000000000000000000000000000000003a190a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e10013a190a154198927ffb9f554dc4a453c64b2e553a02d6df514b100170d6ca809c8331" -} -``` - diff --git a/v1.0/RPC Nodes/others/rpc-tron/broadcasthex.md b/v1.0/RPC Nodes/others/rpc-tron/broadcasthex.md deleted file mode 100644 index fcf7b2dc..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/broadcasthex.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: "broadcasthex" -slug: "rpc-tron-broadcasthex" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumcom/js - -import { TatumSDK, Tron, Network } from '@tatumcom/js' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.broadcastHex('transactionHex') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `broadcastHex` method is used to broadcast a signed transaction to the TRON network. This is a crucial step in performing operations on the blockchain, such as transferring TRX tokens or interacting with smart contracts. - -The method requires the signed transaction in hexadecimal format. - -### Parameters - -`transaction` (string): The signed transaction in hexadecimal format. This is a required parameter. - -### Return Object - -The response object contains the following fields: - -`result` (boolean): Whether the broadcast was successful. true - successful; false - failed, and this field will not be displayed in the returned result. - -`txid` (string): The Transaction ID of the broadcasted transaction. - -`code` (string): The error code in case the broadcast fails. - -`message` (string): Detailed error information in case the broadcast fails. - -`transaction` (Transaction): - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -### HTTP Request Example - -```json -{ - "transaction": "0A8A010A0202DB2208C89D4811359A28004098A4E0A6B52D5A730802126F0A32747970652E676F6F676C65617069732E636F6D2F70726F746F636F6C2E5472616E736665724173736574436F6E747261637412390A07313030303030311215415A523B449890854C8FC460AB602DF9F31FE4293F1A15416B0580DA195542DDABE288FEC436C7D5AF769D24206412418BF3F2E492ED443607910EA9EF0A7EF79728DAAAAC0EE2BA6CB87DA38366DF9AC4ADE54B2912C1DEB0EE6666B86A07A6C7DF68F1F9DA171EEE6A370B3CA9CBBB00" -} -``` - -### HTTP Response Example - -```json -{ - "result": false, - "code": "TAPOS_ERROR", - "txid": "38a0482d6d5a7d1439a50b848d68cafa7d904db48b82344f28765067a5773e1d", - "message": "Tapos check error.", - "transaction": "{\"raw_data\": {\"ref_block_bytes\": \"02db\",\"ref_block_hash\": \"c89d4811359a2800\",\"expiration\": 1560496575000,\"contract\": [{\"type\": \"TransferAssetContract\",\"parameter\": {\"type_url\": \"type.googleapis.com/protocol.TransferAssetContract\",\"value\": \"0a07313030303030311215415a523b449890854c8fc460ab602df9f31fe4293f1a15416b0580da195542ddabe288fec436c7d5af769d242064\"}}]},\"signature\": [\"8bf3f2e492ed443607910ea9ef0a7ef79728daaaac0ee2ba6cb87da38366df9ac4ade54b2912c1deb0ee6666b86a07a6c7df68f1f9da171eee6a370b3ca9cbbb00\"]}" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/broadcasttransaction.md b/v1.0/RPC Nodes/others/rpc-tron/broadcasttransaction.md deleted file mode 100644 index 2374e064..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/broadcasttransaction.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: "broadcasttransaction" -slug: "rpc-tron-broadcasttransaction" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -Below is an example of how to use the `broadcastTransaction` method with the Tatum SDK: - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// Install Tatum SDK -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -// Define a transaction raw body -const rawBody = { - // fill out appropriate data -} - -// Call broadcastTransaction RPC method -const res = await tatum.rpc.broadcastTransaction(rawBody); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `broadcastTransaction` method is used to broadcast a raw transaction to the TRON blockchain network. It submits the transaction for inclusion in the blockchain and returns the result of the broadcast attempt, including the transaction id and any error information. - -### Parameters - -This method accepts a single parameter, `rawBody`, which is a `TronTxRawBody` object with the following properties: - -* `txID` (string): Transaction identifier. -* `visible` (boolean): Specifies the visibility of the transaction. It can be set to either true or false. -* `raw_data` (json): Raw data of the transaction. -* `raw_data_hex` (string): Raw data of the transaction in hexadecimal format. -* `signature` (array of strings): Array of signatures for the transaction. - -### Return Object - -This method returns a Promise resolving to an object with the following parameters: - -* `result` (boolean): Indicates whether the broadcast was successful. If the broadcast failed, this field will not be displayed in the returned result. -* `txid` (string): Transaction id. -* `code` (string): Error code, present if the broadcast failed. -* `message` (string): Detailed error information, present if the broadcast failed. - -### HTTP Request Example - -JSON request body example: - -```json -{ - "raw_data": "{\"contract\":[{\"parameter\":{\"value\":{\"amount\":1000,\"owner_address\":\"41608f8da72479edc7dd921e4c30bb7e7cddbe722e\",\"to_address\":\"41e9d79cc47518930bc322d9bf7cddd260a0260a8d\"},\"type_url\":\"type.googleapis.com/protocol.TransferContract\"},\"type\":\"TransferContract\"}],\"ref_block_bytes\":\"5e4b\",\"ref_block_hash\":\"47c9dc89341b300d\",\"expiration\":1591089627000,\"timestamp\":1591089567635}", - "raw_data_hex": "<0a025e4b220847c9dc89341b300d40f8fed3a2a72e5a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541608f8da72479edc7dd921e4c30bb7e7cddbe722e121541e9d79cc47518930bc322d9bf7cddd260a0260a8d18e8077093afd0a2a72e>" -} -``` - -### HTTP Response Example - -A successful HTTP response returns a JSON body similar to the following example: - -```json -{ - "result": true, - "txid": "77ddfa7093cc5f745c0d3a54abb89ef070f983343c05e0f89e5a52f3e5401299" -} -``` - -In case of an error, the HTTP response returns a JSON body with an error message: - -```json -{ - "code": "SIGERROR", - "txid": "77ddfa7093cc5f745c0d3a54abb89ef070f983343c05e0f89e5a52f3e5401299", - "message": "56616c6964617465207369676e6174757265206572726f723a206d69737320736967206f7220636f6e7472616374" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/clearabi.md b/v1.0/RPC Nodes/others/rpc-tron/clearabi.md deleted file mode 100644 index 3263c698..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/clearabi.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: "clearabi" -slug: "rpc-tron-clearabi" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, VisibleOption } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.clearAbi('TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW', 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs', { -visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `clearAbi` method allows clearing the ABI (Application Binary Interface) information of a smart contract on the TRON blockchain. This operation is often used when there is a need to remove outdated or incorrect ABI information from a smart contract. - -### Parameters - -* `ownerAddress` (string): The account address that owns the smart contract. It can be in base58check format if visible is true; otherwise, it should be in hex format. -* `contractAddress` (string): The address of the smart contract. It can be in base58check format if visible is true; otherwise, it should be in hex format. -* `options` (object, optional): This is an optional parameter that can include: - * `visible` (boolean, optional): Specifies whether the address is in base58 format. - -### Return Object - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `ClearABIContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` - Account address. -* `contract_address` - Contract address. - -### HTTP Request Example - -```json -{ - "owner_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "0841733f1141ecd4f932551a26db7b7a4c8077e95bfa78d28ab806d85a3114b1", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs" - }, - "type_url": "type.googleapis.com/protocol.ClearABIContract" - }, - "type": "ClearABIContract" - } - ], - "ref_block_bytes": "ee6c", - "ref_block_hash": "1819e770abbc2e4c", - "expiration": 1684770510000, - "timestamp": 1684770452476 - }, - "raw_data_hex": "0a02ee6c22081819e770abbc2e4c40b0a997a184315a630830125f0a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e436c656172414249436f6e7472616374122e0a1541b3dcf27c251da9363f1a4888257c16676cf54edf12154142a1e39aefa49290f2b3f9ed688d7cecf86cd6e070fce793a18431" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/createaccount.md b/v1.0/RPC Nodes/others/rpc-tron/createaccount.md deleted file mode 100644 index 44f6e287..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/createaccount.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: "createaccount" -slug: "rpc-tron-createaccount" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -The `createAccount` method allows you to create a new TRON account by using an already activated account. Here's an example of how to use this method with the Tatum SDK: - -{% code overflow="wrap" lineNumbers="true" %} -```typescript// yarn add @tatumcom/js - -import { TatumSDK, Tron, Network } from '@tatumcom/js' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.createAccount('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', 'TFgY1uN8buRxAtV2r6Zy5sG3ACko6pJT1y', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs - - -### Overview - -The `createAccount` method allows the creation of new accounts on the TRON blockchain network. This method utilizes an already activated account to create a new account. It is essential to note that the expiration time of the HTTP API creation transaction is one minute. This means you need to complete the signing and broadcast of the transaction within one minute after the creation. - -Use cases for this method include creating new users or creating a new account for different operations within your application. - -### Parameters - -The `createAccount` method takes the following parameters: - -* `owner_address` (string): The address of the activated account used to create the new account. It should be converted to a hex string. -* `account_address` (string): The address of the new account to be created. This should also be converted to a hex string and should be calculated in advance. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): This field indicates whether the address is in base58 format or not. - * `permission_id` (integer, optional): This field is used for multi-signature operations. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `TransferContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): The address of the transaction initiator. -* `account_address` (string): The address of the activated account. -* `type` (integer): The account type. External account type is 0 and this field will not be displayed in the return value. - -### HTTP Request Example - -Below is an example of an HTTP request for the `createAccount` method: - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "account_address": "TFgY1uN8buRxAtV2r6Zy5sG3ACko6pJT1y", - "visible": true -} -``` - -### HTTP Response Example - -The response from the `createAccount` method will return the transaction details for creating a new account. Below is an example of a successful response: - -```json -{ - "result": true, - "txid": "08a8c7d7a67f6a8a60c2020c9f22033877fa5b8877662d16f5f2c368465046fb", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "account_address": "TFgY1uN8buRxAtV2r6Zy5sG3ACko6pJT1y" - }, - "type_url": "type.googleapis.com/protocol.AccountCreateContract" - }, - "type": "AccountCreateContract" - } - ], - "ref_block_bytes": "4df2", - "ref_block_hash": "6eb26e5ebc0a6922", - "expiration": 1623332388000, - "timestamp": 1623332327858 - }, - "signature": [ - "da2d3cff56f3b43c430fe5a3e8a67a8e1e5c3402a5a64a6e1e19e45a223bd50a1a4e8c6275db608dfc6c60bc86b4b69053c5e1af37e2714d1bea716d2a66c04a00" - ], - "raw_data_hex": "0a024df2220c6eb26e5ebc0a69228c928afbef8c2d5a65080112640a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74437265617465436f6e747261637412330a1541ef67873a4a8a6154c92020ef5a102a202e6a567bd121541b9a9c9c081a8f4e2926ac24d30070f8bf8c2d" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/createassetissue.md b/v1.0/RPC Nodes/others/rpc-tron/createassetissue.md deleted file mode 100644 index c57db9d3..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/createassetissue.md +++ /dev/null @@ -1,174 +0,0 @@ ---- -title: "createassetissue" -slug: "rpc-tron-createassetissue" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const options = { - freeAssetNetLimit: 10, - publicFreeAssetNetLimit: 10, - frozenSupply: { - frozen_amount: 1, - frozen_days: 2 - }, - precision: 2, - description: "A new token", -} - -const res = await tatum.rpc.createAssetIssue( - 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', - 'MyToken', - 'MTK', - 1000000, - 1, - 1, - 1621629260000, - 1621629860000, - 'https://www.mytoken.com', - options -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `createAssetIssue` RPC method allows you to create a new token on the TRON network. You need to specify various parameters like the name, abbreviation, total supply, and more. - -Use cases for this method include creating new tokens for ICOs or for a DeFi project. - -### Parameters - -* `ownerAddress` (string): The address of the issuer. -* `name` (string): The name of the token. -* `abbr` (string): The abbreviation of the token. -* `totalSupply` (integer): The total supply of the token. -* `trxNum` (integer): Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN). -* `num` (integer): Define the price by the ratio of trx\_num/num. -* `startTime` (integer): The ICO start time. -* `endTime` (integer): The ICO end time. -* `url` (string): The official website URL of the token. -* `options` (optional): Additional options for the transaction. - * `freeAssetNetLimit` (integer, optional): Token free asset net limit. - * `publicFreeAssetNetLimit` (integer, optional): Token public free asset net limit. - * `frozenSupply` (object, optional): Object with parameters: - * `frozen_amount` (integer): The number of tokens to be frozen. - * `frozen_days` (integer): The number of days to freeze. - * `precision` (integer, optional): The precision of the token. - * `description` (string, optional): The description of the token. - -### Return Object - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `AssetIssueContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address`: Issuer address. -* `name`: Token name. -* `abbr`: Token abbreviation. -* `total_supply`: Total supply of the token. -* `frozen_supply`: The number of tokens to be frozen as specified by the issuer when the token is issued. -* `trx_num`: Defines the price by the ratio of trx\_num/num (The unit of 'trx\_num' is SUN). -* `precision`: Precision of the token value. -* `num`: Defines the price by the ratio of trx\_num/num (The unit of 'trx\_num' is SUN). -* `start_time`: ICO start time. -* `end_time`: ICO end time. -* `description`: Description of the token. -* `url`: Official website URL of the token, default is hexString. -* `free_asset_net_limit`: Token free asset net limit. -* `public_free_asset_net_limit`: Token public free asset net limit for an account. -* `public_free_asset_net_usage`: The total number of token free bandwidth used by all token owners. -* `public_latest_free_net_time`: The timestamp of the last consumption of this token's free bandwidth. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "name": "MyToken", - "abbr": "MTK", - "description": "A new token", - "url": "https://www.mytoken.com", - "frozen_supply": { - "frozen_amount": 1, - "frozen_days": 2 - }, - "visible": true, - "total_supply": 1000000, - "trx_num": 1, - "num": 1, - "start_time": 1621629260000, - "end_time": 1621629860000 -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "1789f68952b601243e09fc851eeed547cc1c9e16b0fc2cb6bf219aa07a1a8a9c", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "start_time": 2684752341111, - "trx_num": 1, - "frozen_supply": [ - { - "frozen_amount": 1, - "frozen_days": 2 - } - ], - "total_supply": 100, - "num": 1, - "name": "asdfasdfadsf", - "end_time": 2684752345111, - "description": "0x4578616d706c654465736372697074696f6e", - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "abbr": "asdfsdf", - "url": "0x7777772e6578616d706c652e636f6d" - }, - "type_url": "type.googleapis.com/protocol.AssetIssueContract" - }, - "type": "AssetIssueContract" - } - ], - "ref_block_bytes": "e206", - "ref_block_hash": "034cf77f0ad4956a", - "expiration": 1684759677000, - "timestamp": 1684759617932 - }, - "raw_data_hex": "0a02e2062208034cf77f0ad4956a40c890829c84315acd01080612c8010a2f747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e41737365744973737565436f6e74726163741294010a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e120c6173646661736466616473661a076173646673646620642a04080110023001400148f7d0d6bd914e5097f0d6bd914ea201263078343537383631366437303663363534343635373336333732363937303734363936663665aa01203078373737373737326536353738363136643730366336353265363336663664708cc3fe9b8431" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/createtransaction.md b/v1.0/RPC Nodes/others/rpc-tron/createtransaction.md deleted file mode 100644 index 56dd4fe1..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/createtransaction.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: "createtransaction" -slug: "rpc-tron-createtransaction" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to Use - -Example SDK code: - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumcom/js - -import { TatumSDK, Tron, Network } from '@tatumcom/js' - -const tatum = await TatumSDK.init({ network: Network.TRON }) - -const res = await tatum.rpc.createTransaction('ra5nK24KXen9AHvsdFTKHSANinZseWnPcX', 'rz6oqD16GHJmfRwK2viGm6jEM2r7QqzVvP', 1000, { visible: true }) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `createTransaction` method is used to create a TRON transaction. It allows you to transfer TRX (TRON native cryptocurrency) from one address to another. - -Use cases: - -* Transfer TRX from one TRON address to another. - -### Parameters - -* `ownerAddress` (string): The initiator's address for the transaction. -* `toAddress` (string): The destination address for the transaction. -* `amount` (BigNumber): The amount of TRX to transfer, in sun (the smallest unit of TRX, where 1 TRX = 1,000,000 sun). -* `options` (optional): Additional options for the transaction. - * `visible` (boolean, optional): Specifies whether the address is in base58 format. Default: false. - * `permission_id` (number, optional): The permission ID for multi-signature use. - * `extra_data` (string, optional): Additional data for the transaction in HEX format. - -### Return Object - -`transaction` (`TransferContract`): - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `TransferContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): Transaction initiator's address. -* `to_address` (string): Destination address. -* `amount` (int64): Transfer amount in sun. - -### HTTP Request Example - -Example of the JSON request body for the HTTP request: - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "to_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "amount": 1000, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "094d59ae6c22cb6f206f4b263eec54a1dbfc1d1704d0c43a31d90b8b66ee4fbb", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "amount": 1000, - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "to_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1" - }, - "type_url": "type.googleapis.com/protocol.TransferContract" - }, - "type": "TransferContract" - } - ], - "ref_block_bytes": "ab93", - "ref_block_hash": "88c6e64972349f0f", - "expiration": 1684488576000, - "timestamp": 1684488517323 - }, - "raw_data_hex": "0a02ab93220888c6e64972349f0f4080b8df9a83315a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e12154198927ffb9f554dc4a453c64b2e553a02d6df514b18e80770cbeddb9a8331" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/debug_traceblockbyhash.md b/v1.0/RPC Nodes/others/rpc-tron/debug_traceblockbyhash.md deleted file mode 100644 index 6f58ff7b..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/debug_traceblockbyhash.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: "debug_traceblockbyhash" -slug: "rpc-tron-debug_traceblockbyhash" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const result = await tatum.rpc.debugTraceBlockByHash( -'0x48dfcf43404dffdb3b93a0b0d9982b642b221187bc3ed5c023bdab6c0e863e3d', -{ - tracer: 'callTracer', - tracerConfig: { - onlyTopCall: true, - timeout: '5s', - } -} -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`debug_traceBlockByHash` is an RPC method that allows developers to trace all transactions within a block using a given tracer. This is particularly useful for analyzing the behavior of all transactions in a block, investigating potential issues, and understanding the flow of execution within smart contracts. - -By using the `callTracer` tracer, developers can obtain more detailed information about the calls made during each transaction, including the input, output, and depth of the calls. - -### Parameters - -* `block_hash` (required): The hash of the block to be traced. - * Example: `"0x1dcf337a03e08a8c00e31de6f5b6d9a6e1c6f1d5e5e6c89fc5f5b5a30e6d5d0c"` -* `options` (optional): An object containing configuration options for the tracer. - * `tracer` (required, string): The tracer to use, in this case, `'callTracer'`. - * `tracerConfig` (required, string): object containing `'timeout'` and `'onlyTopCall'` paramter - * `timeout` (required, string): The maximum amount of time the tracer is allowed to run in seconds (e.g. "10s"). Default is "5s". - * `onlyTopCall` (required, boolean): Setting this to true will only trace the main (top-level) call and none of the sub-calls. This avoids extra processing for each call frame if only the top-level call info is required (useful for getting revertReason). - * Example: `{ tracer: 'callTracer', tracerConfig: { onlyTopCall: true, timeout: '5s', }}` - -### Return Object - -The return object is an array of objects, each representing the trace result of a transaction within the block. Each object contains the following fields: - -* `from`: The address the transaction was sent from. -* `gas`: The gas provided for the transaction. -* `gasUsed`: The total gas used by the transaction. -* `to`: The address the transaction was sent to. -* `input`: The input data for the transaction. -* `output`: The output data from the transaction. -* `calls`: An array of objects, each representing a call made during the transaction. Each object contains: - * `from`: The address the call was made from. - * `gas`: The gas provided for the call. - * `gasUsed`: The gas used by the call. - * `to`: The address the call was made to. - * `input`: The input data for the call. - * `output`: The output data from the call. - * `type`: The type of the call (e.g., "STATICCALL"). - -{% hint style="info" %} -This method is available only on the full archive node. -{% endhint %} - -### JSON-RPC Request and Response Examples - -#### Request - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "debug_traceBlockByHash", - "params": [ - "0x1dcf337a03e08a8c00e31de6f5b6d9a6e1c6f1d5e5e6c89fc5f5b5a30e6d5d0c", - { - "tracer": "callTracer", - "timeout": "10s" - } - ] -} - -``` - -#### Response - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": [ - { - "result": { - "from": "0x8894e0a0c962cb723c1976a4421c95949be2d4e3", - "gas": "0x2d48c", - "gasUsed": "0xc7ab", - "to": "0x55d398326f99059ff775485246999027b3197955", - "input": "0xa9059cbb0000000000000000000000003b9f33b3a9d382fa60283c555bde8f78855957be00000000000000000000000000000000000000000000000d4e7f4f79da7c0000", - "output": "0x0000000000000000000000000000000000000000000000000000000000000001", - "value": "0x0", - "type": "CALL" - } - } - ] -} - -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/debug_traceblockbynumber.md b/v1.0/RPC Nodes/others/rpc-tron/debug_traceblockbynumber.md deleted file mode 100644 index 059c9f41..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/debug_traceblockbynumber.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: "debug_traceblockbynumber" -slug: "rpc-tron-debug_traceblockbynumber" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const result = await tatum.rpc.debugTraceBlockByNumber('0xAD7C5E' ,{ - tracer: 'callTracer', - tracerConfig: { - onlyTopCall: true, - timeout: '5s', - } -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`debug_traceBlockByNumber` is an RPC method that allows developers to trace all transactions within a block using a given tracer. This is particularly useful for analyzing the behavior of all transactions in a block, investigating potential issues, and understanding the flow of execution within smart contracts. - -By using the `callTracer` tracer, developers can obtain more detailed information about the calls made during each transaction, including the input, output, and depth of the calls. - -### Parameters - -* `blockNumber` - `Quantity` or `String` - * The block number of the block to trace. - * Example: `"0x1"` or `"latest"` -* `options` (optional): An object containing configuration options for the tracer. - * `tracer` (required, string): The tracer to use, in this case, `'callTracer'`. - * `tracerConfig` (required, string): object containing `'timeout'` and `'onlyTopCall'` paramter - * `timeout` (required, string): The maximum amount of time the tracer is allowed to run in seconds (e.g. "10s"). Default is "5s". - * `onlyTopCall` (required, boolean): Setting this to true will only trace the main (top-level) call and none of the sub-calls. This avoids extra processing for each call frame if only the top-level call info is required (useful for getting revertReason). - * Example: `{ tracer: 'callTracer', tracerConfig: { onlyTopCall: true, timeout: '5s', }}` - -### Return Object - -The return object is an array of objects, each representing the trace result of a transaction within the block. Each object contains the following fields: - -* `from`: The address the transaction was sent from. -* `gas`: The gas provided for the transaction. -* `gasUsed`: The total gas used by the transaction. -* `to`: The address the transaction was sent to. -* `input`: The input data for the transaction. -* `output`: The output data from the transaction. -* `calls`: An array of objects, each representing a call made during the transaction. Each object contains: - * `from`: The address the call was made from. - * `gas`: The gas provided for the call. - * `gasUsed`: The gas used by the call. - * `to`: The address the call was made to. - * `input`: The input data for the call. - * `output`: The output data from the call. - * `type`: The type of the call (e.g., "STATICCALL"). - -{% hint style="info" %} -This method is available only on the full archive node. -{% endhint %} - -### JSON-RPC Request and Response Examples - -#### Request - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "debug_traceBlockByNumber", - "params": [ - "latest", - { - "tracer": "callTracer", - "timeout": "10s" - } - ] -} - -``` - -#### Response - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": [ - { - "result": { - "from": "0x8894e0a0c962cb723c1976a4421c95949be2d4e3", - "gas": "0x2d48c", - "gasUsed": "0xc7ab", - "to": "0x55d398326f99059ff775485246999027b3197955", - "input": "0xa9059cbb0000000000000000000000003b9f33b3a9d382fa60283c555bde8f78855957be00000000000000000000000000000000000000000000000d4e7f4f79da7c0000", - "output": "0x0000000000000000000000000000000000000000000000000000000000000001", - "value": "0x0", - "type": "CALL" - } - } - ] -} - -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/debug_tracecall.md b/v1.0/RPC Nodes/others/rpc-tron/debug_tracecall.md deleted file mode 100644 index cfd5b34a..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/debug_tracecall.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -title: "debug_tracecall" -slug: "rpc-tron-debug_tracecall" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const tatum = await TatumSDK.init({network: Network.EON}) - -const result = await tatum.rpc.debugTraceCall({ - "from": "0xa41d19F4258a388c639B7CcD938FCE3fb7D05e86", - "to": "0xa41d19F4258a388c639B7CcD938FCE3fb7D05e87", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "value": "0x9184e72a", - "data": "0x606060..." - }, - "0xAD7C5E", - { - tracer: 'callTracer', - tracerConfig: { - onlyTopCall: true, - timeout: '5s', - } -} -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`debug_traceCall` is an RPC method that allows you to execute a given call (message), tracing the steps of its execution. This can be helpful for developers and auditors who want to inspect and analyze the internal operations and state changes of a contract call without modifying the blockchain state. This method can assist in debugging and identifying potential issues with contract execution, as well as understanding how gas is consumed during the execution of a call. - -### Parameters - -The `debug_traceCall` method accepts the following parameters: - -* `transaction`: An object that contains the following fields: - * `from`: The address from which the call is initiated. Example: `"0xa7d9ddbe1f17865597fbd27ec712455208b6b76d"` - * `to`: The address of the contract to be called. Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` - * `gas`: (Optional) The gas limit for the call. Example: `"0x76c0"` - * `gasPrice`: (Optional) The gas price for the call. Example: `"0x9184e72a000"` - * `value`: (Optional) The value to be transferred during the call. Example: `"0x9184e72a"` - * `data`: (Optional) The input data for the call, encoded as a hexadecimal string. Example: `"0x606060..."` -* `blockNumber`: The block number as a hexadecimal string for which the call should be traced. Example: `"0x1b4"` - -### Return Object - -The return object is an object containing the following fields: - -* `output`: The output data from the call. -* `gasUsed`: The total gas used by the call. -* `calls`: An array of objects, each representing a nested call made during the call. Each object contains: - * `from`: The address the call was made from. - * `gas`: The gas provided for the call. - * `gasUsed`: The gas used by the call. - * `to`: The address the call was made to. - * `input`: The input data for the call. - * `output`: The output data from the call. - * `type`: The type of the call (e.g., "STATICCALL"). - -{% hint style="info" %} -This method is available only on the full archive node. -{% endhint %} - -### JSON-RPC Request and Response Examples - -#### Request - -
{
-  "jsonrpc": "2.0",
-  "id": 1,
-  "method": "debug_traceCall",
-  "params": [
-    {
-      "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d",
-      "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
-      "gas": "0x76c0",
-      "gasPrice": "0x9184e72a000",
-      "value": "0x9184e72a",
-      "data": "0x606060..."
-    },
-    "0x1b4"
-  ]
-}
-
- -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 2, - "result": { - "from": "0x0a6d033f6628ef715732d61e059187b7330305ff", - "gas": "0x51fba", - "gasUsed": "0x41711", - "to": "0x19e870855cb8fd8f6689743d3c28311c0d62a24c", - "input": "0xcba9bc66000000000000000000000000f62ef040fb5ea7d0828ff50bced9a7720f1387c7000000000000000000000000325e343f1de602396e256b67efd1f61c3a6b38bd00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000001158e460913d000000000000000000000000000000000000000000000000000000100a08761e1547f0000000000000000000000000a6d033f6628ef715732d61e059187b7330305ff000000000000000000000000000000000000000000000000000000000000000300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000053e562b9b7e5e94b81f10e96ee70ad06df3d265700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "output": "0x0000000000000000000000000000000000000000000000000102b1eda6a2682d", - "calls": [ - { - "from": "0x19e870855cb8fd8f6689743d3c28311c0d62a24c", - "gas": "0x4f638", - "gasUsed": "0x4cf", - "to": "0x55d398326f99059ff775485246999027b3197955", - "input": "0x70a082310000000000000000000000000a6d033f6628ef715732d61e059187b7330305ff", - "output": "0x00000000000000000000000000000000000000000000002ca114a674b092dd94", - "type": "STATICCALL" - } - ], - "value": "0x0", - "type": "CALL" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/debug_tracetransaction.md b/v1.0/RPC Nodes/others/rpc-tron/debug_tracetransaction.md deleted file mode 100644 index b752d9f5..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/debug_tracetransaction.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "debug_tracetransaction" -slug: "rpc-tron-debug_tracetransaction" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - diff --git a/v1.0/RPC Nodes/others/rpc-tron/delegateresource.md b/v1.0/RPC Nodes/others/rpc-tron/delegateresource.md deleted file mode 100644 index 214af79c..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/delegateresource.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: "delegateresource" -slug: "rpc-tron-delegateresource" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use It - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, BigNumber, TronStakeType } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.delegateResource('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', 'TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1', new BigNumber(1000000), TronStakeType.BANDWIDTH, false) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `delegateResource` method enables the delegation of bandwidth or energy resources to other accounts in TRON's Stake2.0. This could be useful for supporting specific operations of receiver accounts or to participate in staking and earn rewards. - -### Parameters - -Here are the parameters for the `delegateResource` method: - -* `ownerAddress` (string): The address of the account that is delegating the resources. Default format is hexString. -* `receiverAddress` (string): The address of the account that will receive the delegated resources. -* `balance` (integer): The amount of TRX staked for resources to be delegated, unit is sun. -* `resource` (string): The type of resource to delegate, either 'BANDWIDTH' or 'ENERGY'. -* `lock` (boolean): Determines whether the delegation is locked. If set to true, the delegated resources cannot be undelegated within 3 days. If the owner delegates the same type of resources using the lock to the same address, the lock time will be reset to 3 days. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Determines whether the address is in base58 format. - * `permissionId` (integer, optional): Used for multi-signature transactions. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `DelegateResourceContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address`: The address of the account that delegated the resources. -* `resource`: The type of delegated resource. -* `receiver_address`: The address of the account that received the delegated resources. -* `balance`: The amount of TRX staked for resources that were delegated. -* `lock`: Indicates whether the delegation was locked. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "receiver_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "balance": 1000000, - "resource": "BANDWIDTH", - "lock": false, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "txID": "3d0a235547b08f9d5e1d465f6d7dc28da6436a8d9c3b768d1a989cac7e5c94cf", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "receiver_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "balance": 1000000, - "resource": "BANDWIDTH", - "lock": false, - }, - "type_url": "type.googleapis.com/protocol.DelegateResourceContract" - }, - "type": "DelegateResourceContract" - } - ], - "ref_block_bytes": "4a1b", - "ref_block_hash": "4dc3c8c4476d5d56", - "expiration": 1582208742000, - "timestamp": 1582208686873, - "fee_limit": 1000000000 - }, - "raw_data_hex": "0a024a1b22084dc3c8c4476d5d5640c8fcaf8d2d5a2e5a680801126a0a3074..." -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/deploycontract.md b/v1.0/RPC Nodes/others/rpc-tron/deploycontract.md deleted file mode 100644 index 22ec5a42..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/deploycontract.md +++ /dev/null @@ -1,151 +0,0 @@ ---- -title: "deploycontract" -slug: "rpc-tron-deploycontract" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to Use It - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const abi = [{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" -const bytecode = "608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029" -const ownerAddress = "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh" -const name = "SomeContract" - -const res = await tatum.rpc.deployContract( - abi, - bytecode, - ownerAddress, - name, - { visible: true } -); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - - - -### Overview - -The `deployContract` method is used to deploy a smart contract to the TRON blockchain. This method takes the application binary interface (ABI) and bytecode of the contract, among other parameters, and returns an unsigned transaction that must be signed and sent to the blockchain to deploy the contract. - -### Parameters - -* `abi`(string): The application binary interface (ABI) of the smart contract. -* `bytecode`(string): The bytecode of the smart contract. -* `feeLimit`(BigNumber): The maximum TRX consumption, measured in SUN (1 TRX = 1,000,000 SUN). -* `parameter`(string): Parameter passed to the constructor of the contract. -* `originEnergyLimit`(BigNumber): The max energy that will be consumed by the owner during contract execution or creation. -* `ownerAddress`(string): The contract owner's address in hexadecimal format. -* `name`(string): The name of the smart contract. -* `callValue`(BigNumber): The amount of TRX transferred with this transaction, measured in SUN. -* `consumeUserResourcePercent`(integer): The percentage of resources designated for users who use this contract. Accepts integers between 0 and 100. -* `options` (optional): Additional options: - * `visible` (boolean, optional): Specifies whether the address is in base58 format. Default: false. - * `permission_id` (number, optional): The permission ID for multi-signature use. - -### Return Object - -* `txID`: String - The transaction ID. -* `raw_data`: Object - The raw data of the transaction, including the contract details. -* `signature`: Array - An array containing the signatures of the transaction. - -### HTTP Request Example - -```json -{ - "abi": "[{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]", - "bytecode": "608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029", - "owner_address": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh", - "name": "SomeContract", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "8e6c61ec8d6eee3685ddfde892f6d78609b30cd969f6c96ae13904dd9125afa7", - "contract_address": "41a7444de2b88e2d7a383d1a8c8d3c5c02b2939d61", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh", - "new_contract": { - "bytecode": "608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029", - "name": "SomeContract", - "origin_address": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh", - "abi": { - "entrys": [ - { - "inputs": [ - { - "name": "key", - "type": "uint256" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "set", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "name": "value", - "type": "uint256" - } - ], - "constant": true, - "inputs": [ - { - "name": "key", - "type": "uint256" - } - ], - "name": "get", - "stateMutability": "View", - "type": "Function" - } - ] - } - } - }, - "type_url": "type.googleapis.com/protocol.CreateSmartContract" - }, - "type": "CreateSmartContract" - } - ], - "ref_block_bytes": "e881", - "ref_block_hash": "f0d4c62907d3ad78", - "expiration": 1684765344000, - "timestamp": 1684765286344 - }, - "raw_data_hex": "0a02e8812208f0d4c62907d3ad78408082dc9e84315ad703081e12d2030a30747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e437265617465536d617274436f6e7472616374129d030a1541608f8da72479edc7dd921e4c30bb7e7cddbe722e1283030a1541608f8da72479edc7dd921e4c30bb7e7cddbe722e1a5c0a2b1a03736574220e12036b65791a0775696e743235362210120576616c75651a0775696e74323536300240030a2d10011a03676574220e12036b65791a0775696e743235362a10120576616c75651a0775696e743235363002400222fd01608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b250400293a0c536f6d65436f6e747261637470c8bfd89e8431" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/estimateenergy.md b/v1.0/RPC Nodes/others/rpc-tron/estimateenergy.md deleted file mode 100644 index 57ffe41c..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/estimateenergy.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: "estimateenergy" -slug: "rpc-tron-estimateenergy" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.estimateEnergy( - 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', - 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs', - 'balanceOf(address)', - '000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c', - { visible: true } -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `estimateEnergy` method is used to estimate the energy required for the successful execution of smart contract transactions on the TRON blockchain. It can be used to get a more accurate estimation of the energy consumption for executing certain special contracts compared to the existing `wallet/triggerconstantcontract` API. - -This method does not generate an on-chain transaction, nor does it change the status of the current node. The `energy_required` field in the returned value is the estimated energy amount. - -### Parameters - -* `ownerAddress` (string): The owner address that triggers the contract. If `visible=true`, use base58check format, otherwise use hex format. For a constant call, you can use the all-zero address. -* `contractAddress` (string): The smart contract address. If `visible=true`, use base58check format, otherwise use hex format. -* `functionSelector` (string): The function call. It must not be left blank. -* `parameter` (string): The parameter encoding needs to be in accordance with the ABI rules. -* `options` (object, optional): This is an optional parameter that can include: - * `visible` (boolean, optional): Specifies whether the address is in base58 format. - -### Return Object - -* `result: object` - The run result. - * `result` - Indicates if the estimate is successful. - * `code` - The response code. - * `message` - The result message. -* `energy_required` - The estimated energy to run the contract. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "function_selector": "balanceOf(address)", - "parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "result": { - "result": true - }, - "energy_required": 1082 -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_blocknumber.md b/v1.0/RPC Nodes/others/rpc-tron/eth_blocknumber.md deleted file mode 100644 index cb4e4d06..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_blocknumber.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "eth_blocknumber" -slug: "rpc-tron-eth_blocknumber" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const latestBlock = await tatum.rpc.blockNumber() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_blockNumber` method returns the number of the most recent block on the blockchain. This method is commonly used to track the current state of the network, monitor for new blocks, or fetch historical data. - -Use cases for `eth_blockNumber` include: - -* Synchronising a local copy of the blockchain with the network -* Checking the status of a transaction by comparing its block number to the current block number -* Determining the current network state for smart contract interactions\ - - -### Parameters - -The `eth_blockNumber` method does not require any parameters. - -### Return Object - -The `eth_blockNumber` method returns a single field: - -* **`blockNumber`**: The number of the most recent block on the blockchain. The value is returned as a hexadecimal string. - -### JSON-RPC Request Example - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_blockNumber", - "params": [] -} -``` - -### JSON-RPC Response Example - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": "0x4b7" // 1207 -} -``` \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_chainid.md b/v1.0/RPC Nodes/others/rpc-tron/eth_chainid.md deleted file mode 100644 index b709b550..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_chainid.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: "eth_chainid" -slug: "rpc-tron-eth_chainid" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const id = await tatum.rpc.chainId() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_chainId` method is an JSON-RPC method that allows developers to retrieve the currently configured chain ID of the network they are connected to. The chain ID is a unique identifier for different networks, such as mainnet or various testnets. - -This method is particularly useful when building applications that interact with multiple networks or need to verify the network to prevent replay attacks. By checking the chain ID, an application can ensure it is interacting with the intended network. - -### Parameters - -The `eth_chainId` method does not have any input parameters. - -### Return Object - -The return object contains a single field: - -* **`chainId`**: The hexadecimal string representation of the chain ID. - -### Example Request and Response - -JSON-RPC request: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_chainId", - "params": [] -} -``` - -JSON-RPC response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0xe" -} -``` - diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_estimategas.md b/v1.0/RPC Nodes/others/rpc-tron/eth_estimategas.md deleted file mode 100644 index 034b1698..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_estimategas.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: "eth_estimategas" -slug: "rpc-tron-eth_estimategas" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const estimate = await tatum.rpc.estimateGas({ - "from": "0xa41d19F4258a388c639B7CcD938FCE3fb7D05e86", - "to": "0xa41d19F4258a388c639B7CcD938FCE3fb7D05e87", - "value": "0xde0b6b3a7640000", - "data": "0x606060" - }) - - await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`eth_estimateGas` is an JSON-RPC method that estimates the amount of gas required to execute a given transaction. This method can be used to determine the gas cost before sending a transaction, allowing developers to better predict the gas fees and avoid issues like out-of-gas errors. - -Use cases for `eth_estimateGas` include: - -* Estimating gas costs for contract deployments -* Estimating gas costs for contract function calls -* Estimating gas costs for standard transfers - -### Parameters - -The `eth_estimateGas` method takes a single parameter, an object representing the transaction details. The fields in the transaction object include: - -* **`from`** (optional, string): The address that the transaction is sent from. - * Example: `"from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -* **`to`** (optional, string): The address the transaction is sent to. - * Example: `"to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -* **`gas`** (optional, string): The maximum amount of gas provided for the transaction. - * Example: `"gas": "0x76c0"` -* **`gasPrice`** (optional, string): The price of gas in wei. - * Example: `"gasPrice": "0x9184e72a000"` -* **`value`** (optional, string): The amount of ZEN to send in the transaction, in wei. - * Example: `"value": "0xde0b6b3a7640000"` -* **`data`** (optional, string): The data payload of the transaction, typically used for contract function calls or contract deployment. - * Example: `"data": "0x606060..."` -* **`nonce`** (optional, string): The transaction count of the `from` address. - * Example: `"nonce": "0x1"` - -### Return Object - -The return value of the `eth_estimateGas` method is a single field: - -* `gasEstimate` (string): The estimated gas cost for the transaction, represented as a hexadecimal string. - * Example: `"0x5208"` - -### JSON-RPC Request and Response Examples - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_estimateGas", - "params": [ - { - "from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "value": "0xde0b6b3a7640000", - "data": "0x606060..." - } - ] -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0x5208" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_gasprice.md b/v1.0/RPC Nodes/others/rpc-tron/eth_gasprice.md deleted file mode 100644 index d0a3efa8..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_gasprice.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "eth_gasprice" -slug: "rpc-tron-eth_gasprice" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const gasPrice = await tatum.rpc.gasPrice() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_gasPrice` method is an JSON-RPC method used to estimate the average gas price required for transactions in the network. This method provides a suggestion for the gas price to be used in a transaction to increase the likelihood of it being mined and included in a block in a reasonable amount of time. The `eth_gasPrice` method is particularly useful for developers and users who want to create and send transactions, as it helps them estimate the appropriate gas price to ensure timely processing. - -### Parameters - -The `eth_gasPrice` method does not require any parameters. - -### Return Value - -The `eth_gasPrice` method returns a single value as a hexadecimal string: - -* `gasPrice`: The estimated average gas price in wei. Example: `"0x4a817c800"` - -### JSON-RPC Request and Response Examples - -#### Request - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_gasPrice", - "params": [] -} -``` - -#### Response - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": "0x4a817c800" -} -``` - -By using the `eth_gasPrice` method, developers and users can estimate the appropriate gas price for their transactions, improving the overall user experience and ensuring that their transactions are processed in a timely manner. diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getbalance.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getbalance.md deleted file mode 100644 index 959a1fdb..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getbalance.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: "eth_getbalance" -slug: "rpc-tron-eth_getbalance" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const balance = await tatum.rpc.getBalance('0xa41d19F4258a388c639B7CcD938FCE3fb7D05e86') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} - -{% tab title="C#" %} -```csharp -// dotnet add ${your_project} package Tatum - -var tatumSdk = await TatumSdk.InitAsync(); - -var rpcCall = new JsonRpcCall -{ - Id = "1", - JsonRpc = "2.0", - Method = "eth_getBalance", - Params = new object[] - { - "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "latest" - } -}; - -var result = await tatumSdk.Rpc.Flare.Call(rpcCall); -``` -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_getBalance` method is an JSON-RPC method that allows you to retrieve the balance of a specified address. This method can be used to query the balance of any address, whether it is a contract or an externally owned account (EOA). A common use case for this method is to display the current balance of a user's account in a wallet application or a decentralized application (DApp). - -### Parameters - -The method requires two parameters: - -1. **`address`** (required): The address of the account or contract whose balance you want to query. - * Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -2. **`blockParameter`** (optional): The block number or block identifier to specify the point in time for which you want to query the balance. - * Example: `"latest"` or `"0x1"` - -#### Transaction Details - -For the purpose of this documentation, we'll also describe the `transactions` field of a full transaction object. The `eth_getBalance` method does not return transaction details, but we provide this information for completeness. - -A full transaction object includes the following fields: - -* **`hash`**: The transaction hash. -* **`nonce`**: The number of transactions made by the sender prior to this one. -* **`blockHash`**: The hash of the block in which the transaction was included. -* **`blockNumber`**: The block number in which the transaction was included. -* **`transactionIndex`**: The index of the transaction in the block. -* **`from`**: The sender's address. -* **`to`**: The recipient's address (or `null` for contract creation transactions). -* **`value`**: The value transferred, in wei. -* **`gasPrice`**: The gas price provided by the sender, in wei. -* **`gas`**: The maximum gas allowed for the transaction. -* **`input`**: The data sent with the transaction (typically for contract interaction). -* **`v`**, **`r`**, **`s`**: The raw signature values of the transaction. - -### Return Object - -The method returns a single field: - -* `result`: The Flare balance of the specified address in wei, as a hexadecimal string. - * Example: `"0x1a2e1a"`, which corresponds to `1,726,666` wei. - -### JSON-RPC Request and Response Examples - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getBalance", - "params": [ - "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "latest" - ] -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0x1a2e1a" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getblockbyhash.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getblockbyhash.md deleted file mode 100644 index 6d1c67cd..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getblockbyhash.md +++ /dev/null @@ -1,152 +0,0 @@ ---- -title: "eth_getblockbyhash" -slug: "rpc-tron-eth_getblockbyhash" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const block = await tatum.rpc.getBlockByHash('0x48dfcf43404dffdb3b93a0b0d9982b642b221187bc3ed5c023bdab6c0e863e3d', true) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`eth_getBlockByHash` is an JSON-RPC method that allows developers to query a specific block in the blockchain by its block hash. This method can be used in various scenarios, such as analyzing historical transactions, validating the state of the blockchain, or monitoring the progress of mining activities. - -### Parameters - -The `eth_getBlockByHash` method accepts two parameters: - -1. **`blockHash`**: The hash of the block you want to retrieve information about. - * Type: `String` - * Example: `"0x078610ca461480e4b78557f20e544084cccc4accb41f5c1b7ef792246b78c94b"` -2. **`fullTransactionDetails`**: A boolean value indicating whether to return full transaction details or just transaction hashes. - * Type: `Boolean` - * Example: `true` - -### Return Object - -The returned block object includes the following fields: - -* **`number`** - The block number (hexadecimal string). -* **`hash`** - The block hash (32-byte string). -* **`parentHash`** - The hash of the parent block (32-byte string). -* **`nonce`** - The nonce used to generate the block (8-byte string). -* **`sha3Uncles`** - The SHA3 hash of the uncles in the block (32-byte string). -* **`logsBloom`** - The logs bloom filter of the block (256-byte string). -* **`transactionsRoot`** - The root of the transaction trie (32-byte string). -* **`stateRoot`** - The root of the state trie (32-byte string). -* **`miner`** - The address of the miner who mined the block (20-byte string). -* **`difficulty`** - The difficulty of the block (hexadecimal string). -* **`totalDifficulty`** - The total difficulty of the chain up to this block (hexadecimal string). -* **`extraData`** - Extra data included by the miner in the block (byte string). -* **`size`** - The block size in bytes (hexadecimal string). -* **`gasLimit`** - The gas limit for the block (hexadecimal string). -* **`gasUsed`** - The total gas used by all transactions in the block (hexadecimal string). -* **`timestamp`** - The block timestamp (hexadecimal string). -* **`transactions`** - An array of transaction objects or transaction hashes, depending on the `returnFullTransactionObjects` parameter. -* **`uncles`** - An array of uncle block hashes (32-byte strings). - -If `returnFullTransactionObjects` is `true`, the `transactions` field contains transaction objects with the following fields: - -* **`hash`** - The transaction hash (32-byte string). -* **`nonce`** - The number of transactions sent by the sender before this transaction (hexadecimal string). -* **`blockHash`** - The block hash where the transaction is included (32-byte string). -* **`blockNumber`** - The block number where the transaction is included (hexadecimal string). -* **`transactionIndex`** - The index of the transaction in the block (hexadecimal string). -* **`from`** - The sender address (20-byte string). -* **`to`** - The recipient address, or `null` for contract creation transactions (20-byte string). -* **`value`** - The value being transferred (hexadecimal string). -* **`gasPrice`** - The gas price in wei (hexadecimal string). -* **`gas`** - The gas provided for the transaction (hexadecimal string). -* **`input`** - The input data for the transaction (byte string). - -### JSON-RPC Request and Response Examples - -Here are examples of JSON-RPC request and response for the `eth_getBlockByNumber` method: - -#### Request - -```json -{ - "jsonrpc": "2.0", - "method": "eth_getBlockByHash", - "params": ["0x078610ca461480e4b78557f20e544084cccc4accb41f5c1b7ef792246b78c94b", true], - "id": 1 -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "difficulty": "0x2", - "extraData": "0xd883010114846765746888676f312e31392e36856c696e75780000008279af9a2f9343c00920c795a7abe84303ee56588946383a15d1e9ee422a7df6dcbe199e4ec93511fe1ffa3c3ab10cb5b12459e8f64553ad3a741e9562e1d5e522c336a400", - "gasLimit": "0x2faed85", - "gasUsed": "0xd81f1", - "hash": "0x078610ca461480e4b78557f20e544084cccc4accb41f5c1b7ef792246b78c94b", - "logsBloom": "0x0020001000000000000001000000000000000000000000040000000000084000000004000800000000c06100800000000000000000010000200000000024008000004000000000000000001800001000a050000000040004000000000000000000000220020200000000000000400800080008000000000000001010004000400000000000010000000000000000000000002400000008000000008000000021022000000000000000000000000000000000000000000000000000000000010010180003000800000000000000000000000000800000000020000082000060000010000000001002010800000000000000020000080000800000000000000000", - "miner": "0x35552c16704d214347f29fa77f77da6d75d7c752", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x0000000000000000", - "number": "0x1b5dd23", - "parentHash": "0x41f85649fa6d5e58a4631f76724a96dba8313302323f0834b9cf2b63d0308e0f", - "receiptsRoot": "0x81835f75c1f7521016ce3404f19a44f10c4d56b6ab780fad3388d490c154afbe", - "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "size": "0x8e9", - "stateRoot": "0xda34eefae13e5940f564f3f6cc63c96fb9a0ee015b66552f01a14c2b002b0f7f", - "timestamp": "0x642ea5d2", - "totalDifficulty": "0x36908d2", - "transactions": [ - { - "blockHash": "0x078610ca461480e4b78557f20e544084cccc4accb41f5c1b7ef792246b78c94b", - "blockNumber": "0x1b5dd23", - "from": "0xaa25aa7a19f9c426e07dee59b12f944f4d9f1dd3", - "gas": "0x5208", - "gasPrice": "0x430e23400", - "hash": "0x82544cc4cf767ec9d235f2afa72af2cf468b25c682c302b76390cf0830006174", - "input": "0x", - "nonce": "0x87bf4f", - "to": "0x2fc9076c0ebfa453dee1649721010764cbdf18fc", - "transactionIndex": "0x0", - "value": "0x16345785d8a0000", - "type": "0x0", - "v": "0xe5", - "r": "0x282c0953168acda79a7ec86be5392370bbce08441aa803be0576dfa467a46329", - "s": "0x59e528253c8fe85e72c43d84dd13d6fe724899cf3f94c4800761f2414b2b8f1e" - } - ], - "transactionsRoot": "0xc6939e1f42fa4c4a264a1c1617cc0a6ac7122f3cb5c2848e53b3fba35b33f6ad", - "uncles": [] - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getblockbynumber.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getblockbynumber.md deleted file mode 100644 index 08166316..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getblockbynumber.md +++ /dev/null @@ -1,150 +0,0 @@ ---- -title: "eth_getblockbynumber" -slug: "rpc-tron-eth_getblockbynumber" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const block = await tatum.rpc.getBlockByNumber('latest', true) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs - -{% endtab %} -{% endtabs %} - -### Overview - -`eth_getBlockByNumber` is an JSON-RPC method that allows developers to query a specific block in the blockchain by its block number. This method can be used in various scenarios, such as analyzing historical transactions, validating the state of the blockchain, or monitoring the progress of mining activities. - -### Parameters - -There are two required parameters for this method: - -1. **`blockNumber`** - The block number of the block to be retrieved. This can be a hexadecimal string or one of the predefined aliases: `"earliest"`, `"latest"`, or `"pending"`. - - Example: `"0x1b4"` -2. **`returnFullTransactionObjects`** - A boolean value that determines whether the returned block contains complete transaction objects (`true`) or only transaction hashes (`false`). - - Example: `true` - -### Return Object - -The returned block object includes the following fields: - -* **`number`** - The block number (hexadecimal string). -* **`hash`** - The block hash (32-byte string). -* **`parentHash`** - The hash of the parent block (32-byte string). -* **`nonce`** - The nonce used to generate the block (8-byte string). -* **`sha3Uncles`** - The SHA3 hash of the uncles in the block (32-byte string). -* **`logsBloom`** - The logs bloom filter of the block (256-byte string). -* **`transactionsRoot`** - The root of the transaction trie (32-byte string). -* **`stateRoot`** - The root of the state trie (32-byte string). -* **`miner`** - The address of the miner who mined the block (20-byte string). -* **`difficulty`** - The difficulty of the block (hexadecimal string). -* **`totalDifficulty`** - The total difficulty of the chain up to this block (hexadecimal string). -* **`extraData`** - Extra data included by the miner in the block (byte string). -* **`size`** - The block size in bytes (hexadecimal string). -* **`gasLimit`** - The gas limit for the block (hexadecimal string). -* **`gasUsed`** - The total gas used by all transactions in the block (hexadecimal string). -* **`timestamp`** - The block timestamp (hexadecimal string). -* **`transactions`** - An array of transaction objects or transaction hashes, depending on the `returnFullTransactionObjects` parameter. -* **`uncles`** - An array of uncle block hashes (32-byte strings). - -If `returnFullTransactionObjects` is `true`, the `transactions` field contains transaction objects with the following fields: - -* **`hash`** - The transaction hash (32-byte string). -* **`nonce`** - The number of transactions sent by the sender before this transaction (hexadecimal string). -* **`blockHash`** - The block hash where the transaction is included (32-byte string). -* **`blockNumber`** - The block number where the transaction is included (hexadecimal string). -* **`transactionIndex`** - The index of the transaction in the block (hexadecimal string). -* **`from`** - The sender address (20-byte string). -* **`to`** - The recipient address, or `null` for contract creation transactions (20-byte string). -* **`value`** - The value being transferred (hexadecimal string). -* **`gasPrice`** - The gas price in wei (hexadecimal string). -* **`gas`** - The gas provided for the transaction (hexadecimal string). -* **`input`** - The input data for the transaction (byte string). - -### JSON-RPC Request and Response Examples - -Here are examples of JSON-RPC request and response for the `eth_getBlockByNumber` method: - -#### Request - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getBlockByNumber", - "params": ["latest", true] -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "difficulty": "0x2", - "extraData": "0xd883010114846765746888676f312e31392e36856c696e75780000008279af9a2f9343c00920c795a7abe84303ee56588946383a15d1e9ee422a7df6dcbe199e4ec93511fe1ffa3c3ab10cb5b12459e8f64553ad3a741e9562e1d5e522c336a400", - "gasLimit": "0x2faed85", - "gasUsed": "0xd81f1", - "hash": "0x078610ca461480e4b78557f20e544084cccc4accb41f5c1b7ef792246b78c94b", - "logsBloom": "0x0020001000000000000001000000000000000000000000040000000000084000000004000800000000c06100800000000000000000010000200000000024008000004000000000000000001800001000a050000000040004000000000000000000000220020200000000000000400800080008000000000000001010004000400000000000010000000000000000000000002400000008000000008000000021022000000000000000000000000000000000000000000000000000000000010010180003000800000000000000000000000000800000000020000082000060000010000000001002010800000000000000020000080000800000000000000000", - "miner": "0x35552c16704d214347f29fa77f77da6d75d7c752", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x0000000000000000", - "number": "0x1b5dd23", - "parentHash": "0x41f85649fa6d5e58a4631f76724a96dba8313302323f0834b9cf2b63d0308e0f", - "receiptsRoot": "0x81835f75c1f7521016ce3404f19a44f10c4d56b6ab780fad3388d490c154afbe", - "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "size": "0x8e9", - "stateRoot": "0xda34eefae13e5940f564f3f6cc63c96fb9a0ee015b66552f01a14c2b002b0f7f", - "timestamp": "0x642ea5d2", - "totalDifficulty": "0x36908d2", - "transactions": [ - { - "blockHash": "0x078610ca461480e4b78557f20e544084cccc4accb41f5c1b7ef792246b78c94b", - "blockNumber": "0x1b5dd23", - "from": "0xaa25aa7a19f9c426e07dee59b12f944f4d9f1dd3", - "gas": "0x5208", - "gasPrice": "0x430e23400", - "hash": "0x82544cc4cf767ec9d235f2afa72af2cf468b25c682c302b76390cf0830006174", - "input": "0x", - "nonce": "0x87bf4f", - "to": "0x2fc9076c0ebfa453dee1649721010764cbdf18fc", - "transactionIndex": "0x0", - "value": "0x16345785d8a0000", - "type": "0x0", - "v": "0xe5", - "r": "0x282c0953168acda79a7ec86be5392370bbce08441aa803be0576dfa467a46329", - "s": "0x59e528253c8fe85e72c43d84dd13d6fe724899cf3f94c4800761f2414b2b8f1e" - } - ], - "transactionsRoot": "0xc6939e1f42fa4c4a264a1c1617cc0a6ac7122f3cb5c2848e53b3fba35b33f6ad", - "uncles": [] - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getblocktransactioncountbyhash.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getblocktransactioncountbyhash.md deleted file mode 100644 index 4b6023f1..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getblocktransactioncountbyhash.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: "eth_getblocktransactioncountbyhash" -slug: "rpc-tron-eth_getblocktransactioncountbyhash" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const response = await tatum.rpc.getBlockTransactionCountByHash('0x48dfcf43404dffdb3b93a0b0d9982b642b221187bc3ed5c023bdab6c0e863e3d') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`eth_getBlockTransactionCountByHash` is a RPC method used to fetch the number of transactions in a block by the block's hash. It is useful when you want to know the total number of transactions included in a specific block and don't want to retrieve the entire block data. This method can be used in various scenarios, such as monitoring the network activity or estimating transaction confirmation times. - -### Parameters - -This method requires a single parameter: - -* **`blockHash`**: The hash of the target block for which the transaction count will be retrieved. It should be a valid 32-byte hex string. - -Example of the parameter: - -* `blockHash`: `"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"` - -### Return - -The method returns a single value: - -* `transactionCount`: The total number of transactions included in the specified block. It is returned as a hexadecimal value. - -### Examples - -#### JSON-RPC request - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getBlockTransactionCountByHash", - "params": [ - "0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238" - ] -} -``` - -#### JSON-RPC response - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": "0xa" -} -``` - -In this example, the block with the hash `"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"` has a total of 10 transactions (indicated by the hexadecimal value `"0xa"`). diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getblocktransactioncountbynumber.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getblocktransactioncountbynumber.md deleted file mode 100644 index bb6f1fd1..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getblocktransactioncountbynumber.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "eth_getblocktransactioncountbynumber" -slug: "rpc-tron-eth_getblocktransactioncountbynumber" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const response = await tatum.rpc.getBlockTransactionCountByNumber('0xAD7C5E') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_getBlockTransactionCountByNumber` JSON-RPC method allows you to retrieve the number of transactions in a specified block. This method is particularly useful when you need to analyze the transaction activity of a specific block. You can use it to gain insights into network usage, analyze the impact of specific events on the network, or monitor transaction congestion in certain blocks. - -### Parameters - -1. **`blockNumber`**: The block number for which the transaction count should be retrieved. It should be a hex-encoded value representing the block number. - * Example: `"0x1b4"` (block number 436) - -### Return Object - -The return object is a hex-encoded value representing the number of transactions in the specified block. - -* Example: `"0xa"` (10 transactions) - -### JSON-RPC Request and Response Examples - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getBlockTransactionCountByNumber", - "params": ["0x1b4"] -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0xa" -} -``` - - - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getcode.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getcode.md deleted file mode 100644 index 59bc2833..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getcode.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: "eth_getcode" -slug: "rpc-tron-eth_getcode" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const code = await tatum.rpc.getCode('0xa41d19F4258a388c639B7CcD938FCE3fb7D05e86') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_getCode` method is part of the JSON-RPC API, which allows users to interact with the blockchain. This method is specifically used to retrieve the contract code (bytecode) of an account at a specific block number. It is helpful when developers need to examine the bytecode of a deployed contract or validate that the contract code on the blockchain matches the intended code. - -Use cases for this method could include: - -* Debugging a smart contract -* Verifying the integrity of a deployed contract -* Analyzing contract bytecode for security vulnerabilities - -### Parameters - -The `eth_getCode` method accepts two parameters: - -1. **`address`** (string): The address of the contract whose bytecode you want to retrieve. This should be a 20-byte address, formatted as a hex string with a `0x` prefix. - * Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -2. **`block`** (string): The block number at which you want to retrieve the contract code. This can be specified as a hex string or one of the following special keywords: - * `"earliest"`: The first block in the blockchain - * `"latest"`: The most recent block in the blockchain - * `"pending"`: The upcoming block that is being mined - * Example: `"0x1"` or `"latest"` - -### Return Object - -The `eth_getCode` method returns a string representing the contract bytecode. The returned value is a hex string with a `0x` prefix. - -* If the account has contract code, the returned string will contain the bytecode. -* If the account is not a contract or does not exist, the returned string will be `0x`. - -### JSON Examples - -#### Request - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getCode", - "params": [ - "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "latest" - ] -} -``` - -#### Response - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": "0x606060...code_here...3839" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getlogs.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getlogs.md deleted file mode 100644 index 171348cc..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getlogs.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: "eth_getlogs" -slug: "rpc-tron-eth_getlogs" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const logs = await tatum.rpc.getLogs({ address : '0xa41d19F4258a388c639B7CcD938FCE3fb7D05e86'}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_getLogs` method is an JSON-RPC method that allows developers to query logs generated by the network, specifically event logs emitted by smart contracts. These logs are an essential part of the ecosystem as they provide a way for developers to monitor contract events and track contract state changes. - -This method is particularly useful when building decentralized applications (dApps) that rely on events emitted by smart contracts, as it enables developers to retrieve logs based on specific filter criteria. By using `eth_getLogs`, developers can efficiently track and react to events happening on the blockchain. - -### Parameters - -The `eth_getLogs` method takes a single input parameter: an object containing the filter criteria. The filter object can have the following fields: - -* **`fromBlock`**: (optional) The starting block number for the search. Can be a block number or one of the following strings: `"earliest"`, `"latest"`, or `"pending"`. - * Example: `"fromBlock": "0x1"` -* **`toBlock`**: (optional) The ending block number for the search. Can be a block number or one of the following strings: `"earliest"`, `"latest"`, or `"pending"`. - * Example: `"toBlock": "0x2"` -* **`address`**: (optional) The address or list of addresses of the contracts to filter logs from. Can be a single address or an array of addresses. - * Example: `"address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -* **`topics`**: (optional) An array of up to four 32-byte topics. Topics are order-dependent, and each topic can be an array of topic hashes or `null`. - * Example: `"topics": ["0x123..."]` -* **`blockhash`**: (optional) The block hash to filter logs from. If provided, `fromBlock` and `toBlock` are ignored. - * Example: `"blockhash": "0xc6ef9..."` - -In addition to the above fields, the `transactions` field in the filter object can be specified to include full transaction details instead of just transaction hashes. This is useful when you need more information about the transactions in which the events were emitted. - -### Return Object - -The `eth_getLogs` method returns an array of log objects. Each log object contains the following fields: - -* **`removed`**: A boolean indicating whether the log was removed due to a chain reorganization. - * Example: `"removed": false` -* **`logIndex`**: The log index position in the block. - * Example: `"logIndex": "0x1"` -* **`transactionIndex`**: The transaction index position in the block. - * Example: `"transactionIndex": "0x0"` -* **`transactionHash`**: The hash of the transaction that emitted the log. - * Example: `"transactionHash": "0x88eef..."` -* **`blockHash`**: The hash of the block containing the log. - * Example: `"blockHash": "0xc6ef9..."` -* **`blockNumber`**: The block number containing the log. - * Example: `"blockNumber": "0x1"` -* **`address`**: The address of the contract that emitted the log. - * Example: `"address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -* **`data`**: The data associated with the log. - * Example: `"data":"0x0000000000000000000000000000000000000000000000000000000000000020"` -* **`topics`**: An array of topics (order-dependent) associated with the log. - * Example: `"topics": ["0x123..."]` - -## JSON-RPC Examples - -#### Request - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getLogs", - "params": [ - { - "fromBlock": "0x1", - "toBlock": "0x2", - "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "topics": ["0x123..."] - } - ] -} -``` - -#### Response - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": [ - { - "removed": false, - "logIndex": "0x1", - "transactionIndex": "0x0", - "transactionHash": "0x88eef...", - "blockHash": "0xc6ef9...", - "blockNumber": "0x1", - "address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "data": "0x0000000000000000000000000000000000000000000000000000000000000020", - "topics": ["0x123..."] - } - ] -} -``` - -This documentation provides a comprehensive overview of the `eth_getLogs` JSON-RPC method, its parameters, return objects, and JSON-RPC examples. By using this method, developers can effectively query logs generated by the network and use the retrieved data to track and react to events happening on the blockchain. diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getproof.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getproof.md deleted file mode 100644 index 8f2524e4..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getproof.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: "eth_getproof" -slug: "rpc-tron-eth_getproof" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const result = await tatum.rpc.getProof("0xa41d19F4258a388c639B7CcD938FCE3fb7D05e86", - ["0x0000000000000000000000000000000000000000000000000000000000000000"], - "latest") - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_getProof` is a JSON-RPC method that retrieves the Merkle-Patricia proof for an account, storage key-value pairs, and account transaction count. It allows developers to verify the state of an account or storage value at a specific block without needing the entire state trie. This method is particularly useful for light clients or off-chain applications that require proof of an account's state or specific storage values. - -### Parameters - -1. **`address`** - `Data`, 20 Bytes - * The address of the account. - * Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -2. **`keys`** - `Array` of `Data` - * An array of storage keys for which the proof should be generated. - * Example: `["0x0000000000000000000000000000000000000000000000000000000000000000"]` -3. **`blockNumber`** - `Quantity` or `String` - * The block number for which the proof should be generated. - * Example: `"0x1"` or `"latest"` - -### Return Object - -The method returns an object containing the following fields: - -1. **`accountProof`** - `Array` of `Data` - * The serialized Merkle-Patricia proof for the account. -2. **`balance`** - `Quantity` - * The balance of the account at the specified block. -3. **`codeHash`** - `Data`, 32 Bytes - * The hash of the code for the account at the specified block. -4. **`nonce`** - `Quantity` - * The transaction count of the account at the specified block. -5. **`storageProof`** - `Array` of `Object` - * An array of storage proof objects, one for each requested key, containing the following fields: - * `key` - `Data`, 32 Bytes: The storage key. - * `value` - `Quantity`: The storage value. - * `proof` - `Array` of `Data`: The serialized Merkle-Patricia proof for the key-value pair. - -### JSON-RPC Request and Response Examples - -_Request_: - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getProof", - "params": [ - "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - [ - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "latest" - ] -} -``` - -_Response_: - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": { - "accountProof": [ - "0x...", - "0x...", - "0x..." - ], - "balance": "0xde0b6b3a7640000", - "codeHash": "0x...", - "nonce": "0x1", - "storageProof": [ - { - "key": "0x0000000000000000000000000000000000000000000000000000000000000000", - "value": "0xde0b6b3a7640000", - "proof": [ - "0x...", - "0x...", - "0x..." - ] - } - ] - } -} - -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getstorageat.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getstorageat.md deleted file mode 100644 index 7e90c327..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getstorageat.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: "eth_getstorageat" -slug: "rpc-tron-eth_getstorageat" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const response = await tatum.rpc.getStorageAt('0xa41d19F4258a388c639B7CcD938FCE3fb7D05e86', '0x0') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`eth_getStorageAt` is an JSON-RPC method that allows you to query the storage value of a contract at a given position. It can be used to inspect the internal state of a smart contract. This method is particularly useful for developers, auditors, and analysts who want to examine contract storage values for various purposes, such as debugging, verifying contract behavior, or analyzing data. - -### Parameters - -`eth_getStorageAt` accepts three parameters: - -1. **`address`**: The address of the contract you want to query. - * Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -2. **`position`**: The storage position (slot) you want to query. - * Example: `"0x0"` -3. **`blockParameter`**: The block number, block hash, or one of the string literals (`"earliest"`, `"latest"` or `"pending"`), representing the point in the blockchain to query the storage value. - * Example: `"latest"` - -### Return Object - -The return object is a single string value, representing the storage value at the given position in the contract. - -* `result`: The storage value in a 32-byte (64 character) hexadecimal format. - -### JSON-RPC Request Example - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getStorageAt", - "params": [ - "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "0x0", - "latest" - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": "0x0000000000000000000000000000000000000000000000000000000000000123" -} -``` - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyblockhashandindex.md b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyblockhashandindex.md deleted file mode 100644 index 3d5c376e..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyblockhashandindex.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: "eth_gettransactionbyblockhashandindex" -slug: "rpc-tron-eth_gettransactionbyblockhashandindex" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const tx = await tatum.rpc.getTransactionByBlockHashAndIndex('0x48dfcf43404dffdb3b93a0b0d9982b642b221187bc3ed5c023bdab6c0e863e3d', 0) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`eth_getTransactionByBlockHashAndIndex` is an JSON-RPC method that allows you to fetch the transaction details based on the block hash and the index of the transaction within that block. This method can be useful when you want to retrieve transaction details for a specific transaction without knowing its transaction hash. - -Use cases for this method may include: - -* Inspecting transaction details for debugging purposes -* Gathering data for transaction analysis -* Fetching transaction information for specific blocks in a block explorer application - -### Parameters - -The `eth_getTransactionByBlockHashAndIndex` method accepts two parameters: - -1. `blockHash` (required): The hash of the block containing the transaction. - * Example: `"0x9a9a2a0d69b4ff48f7a2a8a26d135e1dbcbd3c3be3e8a3c90de0bcb104e4c4b4"` -2. `transactionIndex` (required): The index of the transaction within the specified block. The index is a hexadecimal value. - * Example: `"0x0"` - -### Return Object - -The method returns a JSON object containing the following fields: - -1. `hash`: The transaction hash as a 32-byte hex string. -2. `nonce`: The number of transactions made by the sender prior to this one. -3. `blockHash`: The hash of the block in which this transaction is included. -4. `blockNumber`: The block number in which this transaction is included. -5. `transactionIndex`: The index of the transaction within the block. -6. `from`: The address of the sender. -7. `to`: The address of the recipient. `null` if the transaction is a contract creation transaction. -8. `value`: The value transferred in wei. -9. `gasPrice`: The gas price provided by the sender in wei. -10. `gas`: The gas limit provided by the sender. -11. `input`: The data sent along with the transaction. - -### JSON Examples - -Request: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getTransactionByBlockHashAndIndex", - "params": [ - "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", - "0x0" - ] -} -``` - -Response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", - "blockNumber": "0x316624", - "from": "0x37a53636ee68f59d9346aabcfc0d36011d9d5b35", - "gas": "0x5b8d80", - "gasPrice": "0x59682f0a", - "maxFeePerGas": "0x59682f10", - "maxPriorityFeePerGas": "0x59682f00", - "hash": "0x40a0f78e346d15b05efa1861149e5999ea48197dcf104d69160d45b08b7a5118", - "input": "0xb1dc65a4000129d4314ec8c4bafb6468cc9d3c21de025fa54002558c9f76aec833406ab600000000000000000000000000000000000000000000000000000000001ccc01f18333a24416e0a0be9cdb78505c9c3c27fa42bccdbe6456cd6c1fc81bee7c0e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000003a001000000010100010100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000003d150000000000000000000000000000000000000000000000000000000000003d17325325668a08b50a9587fd4605ce02dbc5ccefc4883a41b485ff4dc4a4f86f1e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000a8690000000000000000000000000000000000000000000000000000009d29229e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ba6547e7b549a1f180c5ad4f2e2e7104fecb8373482f3de6574ecbeefdc9be9dfd9f1934768a23584f1508adad8a7bbfbe445a27bed9f1d4538d4e4c9e458b0c5274b6f714f5aee9a8d56aeb8957b6da6b8914e445a46dcd349737b2eb7d72132e41926d07355de577b13e6ec8e55eaaf628b333197a8d1292bed1c375e891e1da1d519aabbebcc6d299b575b7bef506e2db9493de6f0cfdb0436a81597eb155edc63a8ea655a9b405a0c41c923b1734d78b5d9812f36a602ace3d8c5b22beb9519e406f32de9768e518f2b253a95364a9a2838ba5023c52d503fe8fa811c8803399679a19513671b13d4040e46be74e152d39be4f68bfecaa57d27965ba724a09464734faf7230b19e04f4aa581f10066884e2f402af36f0cdbf08de95e190f4f31fd3b718c1317b65fba9e7ea45ef6180e4861839c6395c814214ee8d56b28ba19f47b6b80f43045635432971b30f2bfb3a26a53ca502bf21fa598c5ddb934b000000000000000000000000000000000000000000000000000000000000000b3ab737e679aefe131ad3efc850fd2c50b316aabcdaa4368587d9606df84b3590541698c7c5538111187964e1b3f39fa033033bb7cab30275ea11b912089663ec43243ff37fa9d2cce04dfce25738c3a484d42f8d8a2c6be226627606f75788ee0e777481b5bd100d00d118bddd18e8726f7a54333b6228f57fa3237799079eb56e6e0ac0cb0f334d23f7284e2dcb2f463d8104fc198389e42a9d1bad1dcfe983115d3d85474db611a6e82b2f61b8d93efa77bc039bd5b3b0f02a7fc587d4a12a0daf256c21ecb9664e6c90c2bfb72a753ff008d3306f7cd4c823df6685fc4cba1514ed132d6367a8f99fba241fc6ef6917f5279ebfdd3e05a296e5c4d77a5463037d7c8180d0644d7e90123918c30fca011d710201ceabcae277924f32ff6b9d0e4d285eb59b4b56d3af8d4b2ab1a39ec2d4324e49deea661cbd43f21cbdc76a10a14055ecdd3251a5860c3bb02bcc1f21da5564fc05adbac70c7565fb5f44b8", - "nonce": "0xec0", - "to": "0x8febc74c26129c8d7e60288c6dccc75eb494aa3c", - "transactionIndex": "0x0", - "value": "0x0", - "type": "0x2", - "accessList": [], - "chainId": "0xaa36a7", - "v": "0x1", - "r": "0xccf7b8fd2d63782e651f4d9650c0ed1a430060fd947d97b6504876f8ea16b357", - "s": "0x50c56d90105b1b8aa475c9500137e9b7c4f0a331fee076bc395a695dc471dc05" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyblocknumberandindex.md b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyblocknumberandindex.md deleted file mode 100644 index 01f07fe8..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyblocknumberandindex.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: "eth_gettransactionbyblocknumberandindex" -slug: "rpc-tron-eth_gettransactionbyblocknumberandindex" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const tx = await tatum.rpc.getTransactionByBlockNumberAndIndex('0xAD7C5E', 0) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`eth_getTransactionByBlockHashAndIndex` is an JSON-RPC method that allows you to fetch the transaction details based on the block hash and the index of the transaction within that block. This method can be useful when you want to retrieve transaction details for a specific transaction without knowing its transaction hash. - -Use cases for this method may include: - -* Inspecting transaction details for debugging purposes -* Gathering data for transaction analysis -* Fetching transaction information for specific blocks in a block explorer application - -### Parameters - -The `eth_getTransactionByBlockHashAndIndex` method accepts two parameters: - -1. `blockNumber` (required): The hash of the block containing the transaction. - * Example: `"0x316624"` -2. `transactionIndex` (required): The index of the transaction within the specified block. The index is a hexadecimal value. - * Example: `"0x0"` - -### Return Object - -The method returns a JSON object containing the following fields: - -1. `hash`: The transaction hash as a 32-byte hex string. -2. `nonce`: The number of transactions made by the sender prior to this one. -3. `blockHash`: The hash of the block in which this transaction is included. -4. `blockNumber`: The block number in which this transaction is included. -5. `transactionIndex`: The index of the transaction within the block. -6. `from`: The address of the sender. -7. `to`: The address of the recipient. `null` if the transaction is a contract creation transaction. -8. `value`: The value transferred in wei. -9. `gasPrice`: The gas price provided by the sender in wei. -10. `gas`: The gas limit provided by the sender. -11. `input`: The data sent along with the transaction. - -### JSON Examples - -Request: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getTransactionByBlockNumberAndIndex", - "params": [ - "0x316624", - "0x0" - ] -} -``` - -Response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", - "blockNumber": "0x316624", - "from": "0x37a53636ee68f59d9346aabcfc0d36011d9d5b35", - "gas": "0x5b8d80", - "gasPrice": "0x59682f0a", - "maxFeePerGas": "0x59682f10", - "maxPriorityFeePerGas": "0x59682f00", - "hash": "0x40a0f78e346d15b05efa1861149e5999ea48197dcf104d69160d45b08b7a5118", - "input": "0xb1dc65a4000129d4314ec8c4bafb6468cc9d3c21de025fa54002558c9f76aec833406ab600000000000000000000000000000000000000000000000000000000001ccc01f18333a24416e0a0be9cdb78505c9c3c27fa42bccdbe6456cd6c1fc81bee7c0e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000003a001000000010100010100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000003d150000000000000000000000000000000000000000000000000000000000003d17325325668a08b50a9587fd4605ce02dbc5ccefc4883a41b485ff4dc4a4f86f1e0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000a8690000000000000000000000000000000000000000000000000000009d29229e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ba6547e7b549a1f180c5ad4f2e2e7104fecb8373482f3de6574ecbeefdc9be9dfd9f1934768a23584f1508adad8a7bbfbe445a27bed9f1d4538d4e4c9e458b0c5274b6f714f5aee9a8d56aeb8957b6da6b8914e445a46dcd349737b2eb7d72132e41926d07355de577b13e6ec8e55eaaf628b333197a8d1292bed1c375e891e1da1d519aabbebcc6d299b575b7bef506e2db9493de6f0cfdb0436a81597eb155edc63a8ea655a9b405a0c41c923b1734d78b5d9812f36a602ace3d8c5b22beb9519e406f32de9768e518f2b253a95364a9a2838ba5023c52d503fe8fa811c8803399679a19513671b13d4040e46be74e152d39be4f68bfecaa57d27965ba724a09464734faf7230b19e04f4aa581f10066884e2f402af36f0cdbf08de95e190f4f31fd3b718c1317b65fba9e7ea45ef6180e4861839c6395c814214ee8d56b28ba19f47b6b80f43045635432971b30f2bfb3a26a53ca502bf21fa598c5ddb934b000000000000000000000000000000000000000000000000000000000000000b3ab737e679aefe131ad3efc850fd2c50b316aabcdaa4368587d9606df84b3590541698c7c5538111187964e1b3f39fa033033bb7cab30275ea11b912089663ec43243ff37fa9d2cce04dfce25738c3a484d42f8d8a2c6be226627606f75788ee0e777481b5bd100d00d118bddd18e8726f7a54333b6228f57fa3237799079eb56e6e0ac0cb0f334d23f7284e2dcb2f463d8104fc198389e42a9d1bad1dcfe983115d3d85474db611a6e82b2f61b8d93efa77bc039bd5b3b0f02a7fc587d4a12a0daf256c21ecb9664e6c90c2bfb72a753ff008d3306f7cd4c823df6685fc4cba1514ed132d6367a8f99fba241fc6ef6917f5279ebfdd3e05a296e5c4d77a5463037d7c8180d0644d7e90123918c30fca011d710201ceabcae277924f32ff6b9d0e4d285eb59b4b56d3af8d4b2ab1a39ec2d4324e49deea661cbd43f21cbdc76a10a14055ecdd3251a5860c3bb02bcc1f21da5564fc05adbac70c7565fb5f44b8", - "nonce": "0xec0", - "to": "0x8febc74c26129c8d7e60288c6dccc75eb494aa3c", - "transactionIndex": "0x0", - "value": "0x0", - "type": "0x2", - "accessList": [], - "chainId": "0xaa36a7", - "v": "0x1", - "r": "0xccf7b8fd2d63782e651f4d9650c0ed1a430060fd947d97b6504876f8ea16b357", - "s": "0x50c56d90105b1b8aa475c9500137e9b7c4f0a331fee076bc395a695dc471dc05" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyhash.md b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyhash.md deleted file mode 100644 index d7bb8cf5..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyhash.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: "eth_gettransactionbyhash" -slug: "rpc-tron-eth_gettransactionbyhash" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const tx = await tatum.rpc.getTransactionByHash('0x6aefbd1a9c9e4c310cadde3bcdd809a14da87caa8fa4f10ca04d9e357a3907e9') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`eth_getTransactionByHash` is an JSON-RPC method that allows you to query transaction details based on its hash. This method is useful when you want to retrieve information about a specific transaction, such as its sender, receiver, value, and more. Common use cases include tracking transaction status, monitoring incoming transactions, or analyzing historical transaction data. - -### Parameters - -The `eth_getTransactionByHash` method takes one parameter: - -* **`transactionHash`**: The hash of the transaction you want to retrieve. This should be a 32-byte hash string with a `0x` prefix. - * Example: `"0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13"` - -### Return Object - -The method returns a transaction object with the following fields: - -* **`hash`**: The hash of the transaction (32 bytes). -* **`nonce`**: The number of transactions sent by the sender prior to this one (integer). -* **`blockHash`**: The hash of the block in which the transaction was included (32 bytes), or `null` if the transaction is not yet mined. -* **`blockNumber`**: The block number in which the transaction was included (integer), or `null` if the transaction is not yet mined. -* **`transactionIndex`**: The index of the transaction in the block (integer), or `null` if the transaction is not yet mined. -* **`from`**: The address of the sender (20 bytes). -* **`to`**: The address of the receiver (20 bytes), or `null` for contract creation transactions. -* **`value`**: The value transferred in the transaction, in wei. -* **`gasPrice`**: The price of gas for the transaction, in wei. -* **`maxFeePerGas`** - The maximum fee per gas set in the transaction. -* **`maxPriorityFeePerGas`** - The maximum priority gas fee set in the transaction. -* **`gas`**: The maximum amount of gas the transaction is allowed to consume. -* **`input`**: The data payload of the transaction (string), or `0x` for simple value transfers. - -### JSON-RPC Examples - -Request: - -```json -{ - "jsonrpc": "2.0", - "method": "eth_getTransactionByHash", - "params": ["0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13"], - "id": 1 -} -``` - -Response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", - "blockNumber": "0x316624", - "from": "0x53e8577c4347c365e4e0da5b57a589cb6f2ab848", - "gas": "0x3c524", - "gasPrice": "0x306dc421e", - "hash": "0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13", - "input": "0x50bb4e7f00000000000000000000000074b4551c177592a908c6ab9ce671bfe8c1b5bd40000000000000000000000000000000000000000000000000000056b990e70e000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006068747470733a2f2f6574682d6d61696e6e65742e672e616c6368656d792e636f6d2f76322f72646f704c505054424a31536f786b2d555179306b7464676f4b45326146637a2f6765744e4654732f3f6f776e65723d766974616c696b2e657468", - "nonce": "0xc97", - "to": "0x211500d1960bdb7ba3390347ffd8ad486b897a18", - "transactionIndex": "0x4", - "value": "0x0", - "type": "0x0", - "chainId": "0xaa36a7", - "v": "0x1546d71", - "r": "0xf89098451217613aa4abbb3f8988e75e20ae948d07bf8b26c472bc9bda50c9d9", - "s": "0x15cfb5b34bcb23730aeadc28df3b66fa9cf28103ffc8b557d76f0c1df078028e" - } -} -``` - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactioncount.md b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactioncount.md deleted file mode 100644 index 67e4f361..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactioncount.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: "eth_gettransactioncount" -slug: "rpc-tron-eth_gettransactioncount" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const result = await tatum.rpc.getTransactionCount('0xa41d19F4258a388c639B7CcD938FCE3fb7D05e86', 'latest') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_getTransactionCount` method is an JSON-RPC method that retrieves the number of transactions sent from a given address. It is a useful method for developers who need to keep track of an account's nonce value to avoid transaction collisions or incorrect order of execution. The nonce value is essential for ensuring transaction uniqueness and preventing replay attacks. - -Use cases for this method include: - -* Determining the nonce value for a new transaction to be sent from a specific address -* Monitoring the number of transactions sent by an address to observe its activity -* Troubleshooting transaction issues and verifying if a transaction was submitted successfully - -### Parameters - -The `eth_getTransactionCount` method accepts two parameters: - -1. **`address`** - The address whose transaction count will be retrieved. - * Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` -2. **`blockParameter`** - A string indicating the block number or block state to consider when retrieving the transaction count. - * Possible values: `"earliest"`, `"latest"`, `"pending"`, or a specific block number in hexadecimal format - * Example: `"latest"` - -### Return Object - -The method returns a single value: - -* **`transactionCount`** - A hexadecimal representation of the number of transactions sent from the specified address. - * Example: `"0x1e"` - -### JSON-RPC Request and Response Examples - -_Request_: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getTransactionCount", - "params": [ - "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", - "latest" - ] -} -``` - -_Response_: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0x1e" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionreceipt.md b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionreceipt.md deleted file mode 100644 index 12a14a7c..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionreceipt.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: "eth_gettransactionreceipt" -slug: "rpc-tron-eth_gettransactionreceipt" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const tx = await tatum.rpc.getTransactionReceipt('0x6aefbd1a9c9e4c310cadde3bcdd809a14da87caa8fa4f10ca04d9e357a3907e9') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`eth_getTransactionReceipt` is an JSON-RPC method that retrieves the transaction receipt of a given transaction hash. This method is particularly useful when you need to obtain detailed information about a transaction's execution, such as its status (success or failure), gas usage, and logs (events). Common use cases include checking the status of a transaction after it has been mined or inspecting the events emitted by a smart contract during a specific transaction. - -### Parameters - -This method requires a single parameter: - -* **`transactionHash`**: The hash of the transaction for which you want to obtain the receipt. - * Example: `"0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13"` - -### Return Object - -The method returns an object containing the following fields: - -* **`transactionHash`**: The hash of the transaction. -* **`transactionIndex`**: The transaction's index position in the block. -* **`blockHash`**: The hash of the block where this transaction was mined. -* **`blockNumber`**: The block number where this transaction was mined. -* **`from`**: The address of the sender. -* **`to`**: The address of the receiver. `null` when it's a contract creation transaction. -* **`cumulativeGasUsed`**: The total amount of gas used when this transaction was executed in the block. -* **`gasUsed`**: The amount of gas used by this specific transaction alone. -* **`contractAddress`**: The address of the contract created, if the transaction was a contract creation. Otherwise, `null`. -* **`logs`**: An array of log objects, which were emitted during the transaction. -* **`logsBloom`**: A 256-byte bloom filter, which is a compressed representation of the logs emitted during the transaction. -* **`status`**: The status of the transaction's execution. `"0x1"` indicates success, while `"0x0"` indicates failure. - -### JSON-RPC Examples - -Request: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getTransactionReceipt", - "params": [ - "0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13" - ] -} -``` - -Response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", - "blockNumber": "0x316624", - "contractAddress": null, - "cumulativeGasUsed": "0x7ad81", - "effectiveGasPrice": "0x306dc421e", - "from": "0x53e8577c4347c365e4e0da5b57a589cb6f2ab848", - "gasUsed": "0x3c518", - "logs": [ - { - "address": "0x211500d1960bdb7ba3390347ffd8ad486b897a18", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000074b4551c177592a908c6ab9ce671bfe8c1b5bd40", - "0x000000000000000000000000000000000000000000000000000056b990e70e00" - ], - "data": "0x", - "blockNumber": "0x316624", - "transactionHash": "0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13", - "transactionIndex": "0x4", - "blockHash": "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", - "logIndex": "0x3", - "removed": false - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000010000000000000800000000000000000000000010000040000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000100000000000000000000000000000000002000000200000000000100000000000800000000000000000000020000000000000000000000200000000000000000000000000000000000000000000", - "status": "0x1", - "to": "0x211500d1960bdb7ba3390347ffd8ad486b897a18", - "transactionHash": "0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13", - "transactionIndex": "0x4", - "type": "0x0" - } -} -``` - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getunclecountbyblockhash.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getunclecountbyblockhash.md deleted file mode 100644 index 53746e05..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getunclecountbyblockhash.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: "eth_getunclecountbyblockhash" -slug: "rpc-tron-eth_getunclecountbyblockhash" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const result = await tatum.rpc.getUncleCountByBlockHash('0x48dfcf43404dffdb3b93a0b0d9982b642b221187bc3ed5c023bdab6c0e863e3d') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_getUncleCountByBlockHash` method is an JSON-RPC method that returns the number of uncles in a specified block by its hash. This method can be useful for gathering information about the performance of the network and to analyze the security of the blockchain. - -Uncles are blocks that are not included in the main blockchain but are still valid, and they contribute to the overall security and decentralization of the network. The inclusion of uncles helps prevent centralization and ensures the mining process remains competitive. - -### Parameters - -The `eth_getUncleCountByBlockHash` method takes one parameter: - -* `blockHash`: The hash of the block for which you want to get the uncle count. - * Example value: `"0x3a3e528dcd6e05a614c9241b0a9296db961fa6a92e05af9f6c0d7d2f6bc92f7a"` - -### Return Object - -The return object for this method is a hex-encoded integer representing the number of uncles in the specified block. - -* Example value: `"0x1"` (1 uncle) - -### JSON-RPC Request and Response Examples - -Here is an example JSON-RPC request and response for the `eth_getUncleCountByBlockHash` method: - -**Request:** - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getUncleCountByBlockHash", - "params": [ - "0x3a3e528dcd6e05a614c9241b0a9296db961fa6a92e05af9f6c0d7d2f6bc92f7a" - ] -} -``` - -**Response:** - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": "0x1" -} -``` - -In this example, the JSON-RPC request asks for the number of uncles in the block with the specified hash. The response indicates that there is one uncle in the block. - diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_getunclecountbyblocknumber.md b/v1.0/RPC Nodes/others/rpc-tron/eth_getunclecountbyblocknumber.md deleted file mode 100644 index 577ab3b7..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_getunclecountbyblocknumber.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: "eth_getunclecountbyblocknumber" -slug: "rpc-tron-eth_getunclecountbyblocknumber" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const result = await tatum.rpc.getUncleCountByBlockNumber('0xAD7C5E') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_getUncleCountByBlockHash` method is an JSON-RPC method that returns the number of uncles in a specified block by its hash. This method can be useful for gathering information about the performance of the network and to analyze the security of the blockchain. - -Uncles are blocks that are not included in the main blockchain but are still valid, and they contribute to the overall security and decentralization of the network. The inclusion of uncles helps prevent centralization and ensures the mining process remains competitive. - -### Parameters - -The `eth_getUncleCountByBlockHash` method takes one parameter: - -* `blockNumber`: The number of the block for which you want to get the uncle count. - * Example value: `"0x12345"` - -### Return Object - -The return object for this method is a hex-encoded integer representing the number of uncles in the specified block. - -* Example value: `"0x1"` (1 uncle) - -### JSON-RPC Request and Response Examples - -Here is an example JSON-RPC request and response for the `eth_getUncleCountByBlockNumber` method: - -**Request:** - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getUncleCountByBlockNumber", - "params": [ - "0x12345" - ] -} -``` - -**Response:** - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": "0x1" -} -``` - -In this example, the JSON-RPC request asks for the number of uncles in the block with the specified hash. The response indicates that there is one uncle in the block. - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_maxpriorityfeepergas.md b/v1.0/RPC Nodes/others/rpc-tron/eth_maxpriorityfeepergas.md deleted file mode 100644 index cbf7ebd3..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_maxpriorityfeepergas.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: "eth_maxpriorityfeepergas" -slug: "rpc-tron-eth_maxpriorityfeepergas" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const gasPrice = await tatum.rpc.maxPriorityFeePerGas() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_maxPriorityFeePerGas` RPC method is used to retrieve the maximum priority fee per gas set by the user for a transaction. This method can be used to determine the maximum fee that can be paid for a transaction to be included in a block quickly. - -### Use case - -This method is particularly useful when the user wants to ensure that a transaction is processed quickly, even in a congested network where transaction fees may fluctuate rapidly. By setting a high maximum priority fee per gas, the user can ensure that the transaction is processed as quickly as possible. - -### Parameters - -`None.` - -## Return Object - -* `maxPriorityFeePerGas` - The maximum priority fee per gas the user is willing to pay, in wei. - -### JSON Examples - -#### Request - -```json -{ - "jsonrpc": "2.0", - "method": "eth_maxPriorityFeePerGas", - "params": [], - "id": 1 -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0x3b9aca00" -} -``` - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/eth_sendrawtransaction.md b/v1.0/RPC Nodes/others/rpc-tron/eth_sendrawtransaction.md deleted file mode 100644 index 8d9d94f4..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/eth_sendrawtransaction.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: "eth_sendrawtransaction" -slug: "rpc-tron-eth_sendrawtransaction" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const gasPrice = await tatum.rpc.sendRawTransaction('0x0000.......') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `eth_sendRawTransaction` RPC method is used to send a signed and serialized transaction to the network. This method is particularly useful when you want to have full control over the signing process, e.g., when using hardware wallets, cold storage, or custom signing libraries. It can be utilized in various use cases, such as transferring, interacting with smart contracts, or deploying new contracts. - -### Parameters - -The method accepts a single parameter: - -* **`data`**: The signed and serialized transaction data as a hexadecimal string. - -### Return Value - -The method returns a single value: - -* `transactionHash`: The hash of the submitted transaction as a hexadecimal string, e.g., `"0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b"`. - -### JSON-RPC Request Example - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "method": "eth_sendRawTransaction", - "params": [ - "0xf86d8201...94a7bc" - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b" -} -``` - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/freezebalance.md b/v1.0/RPC Nodes/others/rpc-tron/freezebalance.md deleted file mode 100644 index 1191e78b..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/freezebalance.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: "freezebalance" -slug: "rpc-tron-freezebalance" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, TronStakeType, BigNumber, FreezeAccountOptions } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const ownerAddress = 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g' -const frozenBalance = new BigNumber(10000000) -const frozenDuration = 3 -const resource = TronStakeType.ENERGY - -const res = await tatum.rpc.freezeBalance(ownerAddress, frozenBalance, frozenDuration, resource, { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `freezeBalance` method is used to stake TRX to obtain resources. The interface has been deprecated, consider using `FreezeBalanceV2` instead. The owner of the address can lock a certain amount of TRX for a certain period to gain resources such as bandwidth and energy. - -### Parameters - -* `owner_address` (string): The owner address (default in hexString format). -* `frozen_balance` (integer): The amount of TRX to stake (unit is in sun). -* `frozen_duration` (integer): The lock-up duration for this stake, currently only 3 days are accepted. -* `resource` (string): The type of TRX stake, either 'BANDWIDTH' or 'ENERGY'. -* `options` (object, optional): This optional parameter contains the following properties: - * `receiver_address` (string, optional): Optional parameter for the address that will receive the resource (default in hexString format). - * `permission_id` (integer, optional): for multi-signature use. - * `visible` (boolean, optional): Defaults to false. Whether addresses are in base58check format. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is FreezeBalanceContract, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `frozen_duration`: The lock-up duration for this stake -* `frozen_balance`: The amount of TRX to stake (unit is in sun). -* `owner_address`: The owner address. -* `resource`: The type of TRX stake, either 'BANDWIDTH' or 'ENERGY'. - -### HTTP Request Example - -```json -{ - "owner_address": "4100776428620856AE1D71562812B734E356B68551", - "frozen_balance": 10000000, - "frozen_duration": 3, - "resource": "ENERGY" -} -``` - -### HTTP Response Example - -```json -{ - "visible": false, - "txID": "efb6ff6dba6e5998d7258a63436e4717428892f02df2adb6deea8550d36e5e34", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "resource": "ENERGY", - "frozen_duration": 3, - "frozen_balance": 10000000, - "owner_address": "4100776428620856ae1d71562812b734e356b68551" - }, - "type_url": "type.googleapis.com/protocol.FreezeBalanceContract" - }, - "type": "FreezeBalanceContract" - } - ], - "ref_block_bytes": "3041", - "ref_block_hash": "3d1b89e6c7c34b52", - "expiration": 1649176881000, - "timestamp": 1649176821557 - }, - "raw_data_hex": "0a02304122083d1b89e6c7c34b5240e8cee8d4ff2f5a5a080b12560a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747261637412200a154100776428620856ae1d71562812b734e356b685511080ade2041803500170b5fee4d4ff2f" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/freezebalancev2.md b/v1.0/RPC Nodes/others/rpc-tron/freezebalancev2.md deleted file mode 100644 index a8b9a917..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/freezebalancev2.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "freezebalancev2" -slug: "rpc-tron-freezebalancev2" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.freezeBalanceV2('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', 10000000, 'ENERGY', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `freezeBalanceV2` method is a feature of Stake2.0 on the TRON blockchain. It allows you to stake a specific amount of TRX to obtain bandwidth or energy, and in return, you receive an equivalent amount of TRON Power (TP) according to the staked amount. This method can be useful in various use cases, such as securing network resources or participating in network governance by voting with TRON Power. - -### Parameters - -* `ownerAddress`(string): The account address in default hexString format. -* `frozenBalance`(integer): The amount of TRX to stake, in sun units. -* `resource`(string): The type of TRX stake, either 'BANDWIDTH' or 'ENERGY'. -* `options` (object, optional): This optional parameter contains the following properties: - * `permissionId`(integer, optional): This is used for multi-signature transactions. - * `visible`(string, optional):. Default is false. This parameter indicates whether addresses are in base58check format. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is FreezeBalanceV2Contract, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address`: The account address. -* `resource`: The resource type. -* `frozen_balance`: The staked amount in sun units. - - - -### HTTP Request Example - -Here is an example of a CURL request to the `freezeBalanceV2` method: - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "frozenBalance": 1000000, - "resource": "BANDWIDTH", - "visible": true -} -``` - -### HTTP Response Example - -The response to a successful request is a `200 OK` status code, and it returns the transaction object. If the request fails, you will receive a `400 Bad Request` status code with an error message. diff --git a/v1.0/RPC Nodes/others/rpc-tron/getaccount.md b/v1.0/RPC Nodes/others/rpc-tron/getaccount.md deleted file mode 100644 index e4c91e8b..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getaccount.md +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: "getaccount" -slug: "rpc-tron-getaccount" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumcom/js - -import { TatumSDK, Tron, Network } from '@tatumcom/js' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const account = await tatum.rpc.getAccount('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAccount` method is used to query information about an account on the TRON network. It provides details including TRX balance, TRC-10 balances, stake information, vote information, permissions, and more. - -{% embed url="https://codepen.io/tatum-devrel/pen/oNQOmqa" %} - -### Parameters - -* `address` (string): The account address to be queried. It should be converted to a hex string. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Determines whether the address is in base58 format. Default is false. - -### Return Object - -* `account_name` (string): The name of the account. The account name can be modified once through the `wallet/updateaccount` interface. -* `address` (string): Account address. -* `create_time` (int64): Account creation time, i.e. account activation time on the TRON network. -* `balance` (int64): TRX balance of the account. -* `frozen` (object): Contains two properties - `frozen_balance` (int64) which is the total amount of TRX staked by the account to obtain bandwidth in Stake 1.0, and `expire_time` (int64) which is the expiration time of the stake operation performed by the account to obtain bandwidth. The account can perform the unstake operation after this time. -* `delegated_frozen_balance_for_bandwidth` (int64): Total amount of TRX staked by the account for others to get bandwidth in Stake 1.0. -* `acquired_delegated_frozen_balance_for_bandwidth` (int64): Total amount of TRX staked by other accounts for this account to get bandwidth in Stake 1.0. -* `account_resource` (object): Contains information about the account's resources, including `frozen_balance_for_energy` (object) with `frozen_balance` (int64) and `expire_time` (int64), `delegated_frozen_balance_for_energy` (int64), `acquired_delegated_frozen_balance_for_energy` (int64), `delegated_frozenV2_balance_for_energy` (int64), `acquired_delegated_frozenV2_balance_for_energy` (int64), `energy_window_size` (int64), `energy_usage` (int64), and `latest_consume_time_for_energy` (int64). -* `delegated_frozenV2_balance_for_bandwidth` (int64): Total amount of TRX staked by the account for others to get bandwidth in Stake 2.0. -* `acquired_delegated_frozenV2_balance_for_bandwidth` (int64): Total amount of TRX staked by other accounts for this account to get bandwidth in Stake 2.0. -* `frozenV2` (FreezeV2\[]): In Stake 2.0, the total amount of TRX staked to obtain various types of resources does not include the delegated TRX. -* `unfrozenV2` (UnFreezeV2\[]): In Stake 2.0, each unstaking information. One of the unstaking information contains three fields: `type` (resource type), `unfreeze_amount` (the amount of unstaked TRX), `unfreeze_expire_time` (the start timestamp when the unstaked TRX can be withdrawn, in ms). -* `net_usage` (int64): The amount of bandwidth used by the account. -* `free_net_usage` (int64): The amount of free bandwidth used by the account. -* `net_window_size` (int64): The number of block times required for bandwidth obtained by stake to fully recover. -* `free_asset_net_usageV2` (map\): The amount of trc10's free bandwidth used by this account. -* `votes` (Vote): The number of votes for each Super Representative. -* `latest_opration_time` (int64): The last operation time. -* `latest_consume_time` (int64): The last time the account consumed bandwidth. -* `latest_consume_free_time` (int64): The last time the account consumed free bandwidth. - -### HTTP Request Example - -The HTTP request body for invoking this method is: - -```json -{ - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "visible": true -} -``` - -### HTTP Response Example - -A successful response might look like: - -```json -{ - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "balance": 2000000000, - "create_time": 1637411046000, - "net_window_size": 28800, - "account_resource": { - "energy_window_size": 28800 - }, - "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" - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getaccountbalance.md b/v1.0/RPC Nodes/others/rpc-tron/getaccountbalance.md deleted file mode 100644 index 96b9fae4..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getaccountbalance.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: "getaccountbalance" -slug: "rpc-tron-getaccountbalance" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, AccountIdentifier, BlockIdentifier, VisibleOption } from '@tatumio/tatum' -import BigNumber from "bignumber.js"; - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const accountIdentifier: AccountIdentifier = { - address: "TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm" -} - -const blockIdentifier: BlockIdentifier = { - hash: "0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9", - number: new BigNumber(68682) -} - -const res = await tatum.rpc.getAccountBalance(accountIdentifier, blockIdentifier, { - visible: true -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAccountBalance` method is used to retrieve an account's balance at a specific block on the TRON network. This is particularly useful when you need to audit the state of an account at a particular point in time or to verify a transaction's execution result against the blockchain state at a given block. - -### Parameters - -* `accountIdentifier` (AccountIdentifier): An object that represents the account identifier which includes: - * `address` (string): The account address. -* `blockIdentifier` (BlockIdentifier): An object that represents the block identifier which includes: - * `hash` (string): The block hash. - * `number` (number): The block number. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Optional parameter to specify whether the address is in base58 format. - -### Return Object - -The method returns a JSON object that contains the following properties: - -* `balance` (integer): The balance of the account. -* `block_identifier.hash` (string): The block hash. -* `block_identifier.number` (integer): The block number. - -### HTTP Request Example - -```json -{ - "account_identifier": { - "address": "TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm" - }, - "block_identifier": { - "hash": "0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9", - "number": 68682 - }, - "visible": true -} -``` - -### HTTP Response ExampleThe response will be a JSON object representing the balance and block information: - -```json -{ - "balance": 100000, - "block_identifier": { - "hash": "0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9", - "number": 68682 - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getaccountnet.md b/v1.0/RPC Nodes/others/rpc-tron/getaccountnet.md deleted file mode 100644 index ad13be3b..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getaccountnet.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: "getaccountnet" -slug: "rpc-tron-getaccountnet" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, VisibleOption } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const address = 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g' - -const res = await tatum.rpc.getAccountNet(address, { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAccountNet` method is used to query bandwidth information of a specific account on the TRON network. This method can be useful for assessing an account's remaining network capacity. - -{% embed url="https://codepen.io/tatum-devrel/pen/RwqOvyO" %} - -### Parameters - -* `address` (string): The address of the account whose bandwidth information is to be queried. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Optional parameter to specify whether the address is in base58 format. - -### Return Object - -The method returns a JSON object that contains the following properties: - -* `freeNetUsed` (integer): Free bandwidth used. -* `freeNetLimit` (integer): Total free bandwidth. -* `NetUsed` (integer): Used amount of bandwidth obtained by staking. -* `NetLimit` (integer): Total bandwidth obtained by staking. -* `TotalNetLimit` (integer): Total bandwidth can be obtained by staking by the whole network. -* `TotalNetWeight` (integer): Total TRX staked for bandwidth by the whole network. -* `assetNetUsed` (map\): The amount of free bandwidth of each TRC10 asset used by the account. -* `assetNetLimit` (map\): The amount of free bandwidth for each TRC10 asset in the account. - -### HTTP Request Example - -```json -{ - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "freeNetLimit": 1500, - "TotalNetLimit": 43200000000, - "TotalNetWeight": 84593524300 -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getaccountresource.md b/v1.0/RPC Nodes/others/rpc-tron/getaccountresource.md deleted file mode 100644 index d8762747..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getaccountresource.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: "getaccountresource" -slug: "rpc-tron-getaccountresource" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, VisibleOption } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const address = 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g' - -const res = await tatum.rpc.getAccountResources(address, { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAccountResources` method is used to query resource information (such as bandwidth, energy) of a specific account on the TRON network. This method can be useful for assessing an account's remaining computational and storage capacity. - -{% embed url="https://codepen.io/tatum-devrel/pen/rNQbPvG" %} - -### Parameters - -* `address` (string): The address of the account whose resources are to be queried. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Optional parameter to specify whether the address is in base58 format. - -### Return Object - -* `freeNetUsed` (integer): Free bandwidth used. -* `freeNetLimit` (integer): Total free bandwidth. -* `NetUsed` (integer): Used amount of bandwidth obtained by staking. -* `NetLimit` (integer): Total bandwidth obtained by staking. -* `TotalNetLimit` (integer): Total bandwidth can be obtained by staking by the whole network. -* `TotalNetWeight` (integer): Total TRX staked for bandwidth by the whole network. -* `totalTronPowerWeight` (integer): The total amount of voting rights obtained by the whole network. -* `tronPowerLimit` (integer): TRON Power (vote). -* `tronPowerUsed` (integer): TRON Power (vote) used. -* `EnergyUsed` (integer): Energy used. -* `EnergyLimit` (integer): Total energy obtained by staking. -* `TotalEnergyLimit` (integer): Total energy can be obtained by staking by the whole network. -* `TotalEnergyWeight` (integer): Total TRX staked for energy by the whole network. -* `assetNetUsed` (map\): The amount of free bandwidth of each TRC10 asset used by the account. -* `assetNetLimit` (map\): The amount of free bandwidth for each TRC10 asset in the account. - -### HTTP Request Example - -```json -{ - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "freeNetLimit": 1500, - "TotalNetLimit": 43200000000, - "TotalNetWeight": 84593524300, - "TotalEnergyLimit": 50000000000000, - "TotalEnergyWeight": 12189370443 -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyaccount.md b/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyaccount.md deleted file mode 100644 index fba246f8..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyaccount.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: "getassetissuebyaccount" -slug: "rpc-tron-getassetissuebyaccount" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getAssetIssueByAccount('TTzC9cm1vbsyBzhC8n4z3k6eAVkryDyKU8', { -visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAssetIssueByAccount` method queries the TRC10 token information issued by a specified account. The main use case for this method is to gather information about tokens issued by a certain address on the TRON blockchain. - -### Parameters - -* `address` (string): This is the address of the Token Issuer account. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Whether the address is in base58 format. - -### Return Object - -* `assetIssue`: (array) - * `id`: (integer) token ID - * `owner_address`: (string) issuer address - * `name`: (string) token name - * `abbr`: (string) token abbreviation - * `total_supply`: (integer) total supply - * `frozen_supply`: (Array) The number of tokens to be frozen is specified by the issuer of the token when it is issued - * `trx_num`: (integer) Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN) - * `precision`: (integer) precision - * `num`: (integer) Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN) - * `start_time`: (integer) ICO start time - * `end_time`: (integer) ICO end time - * `description`: (string) token description - * `url`: (string) Token official website url, default hexString - * `free_asset_net_limit`: (integer) Token free asset net limit - * `public_free_asset_net_limit`: (integer) Token public free asset net limit for a account - * `public_free_asset_net_usage`: (integer) The total number of token free bandwidth used by all token owner - * `public_latest_free_net_time`: (integer) The timestamp of the last consumption of this token's free bandwidth - -### HTTP Request Example - -```json -{ - "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "assetIssue": [ - { - "id": 1, - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "name": "TokenName", - "abbr": "TKN", - "total_supply": 1000000, - "frozen_supply": [], - "trx_num": 1, - "precision": 6, - "num": 1, - "start_time": 1622376000000, - "end_time": 1622462400000, - "description": "This is a test token", - "url": "https://tokenwebsite.com", - "free_asset_net_limit": 5000, - "public_free_asset_net_limit": 10000, - "public_free_asset_net_usage": 0, - "public_latest_free_net_time": 0 - } - ] -} -``` - -*** diff --git a/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyid.md b/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyid.md deleted file mode 100644 index fcb8536d..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyid.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: "getassetissuebyid" -slug: "rpc-tron-getassetissuebyid" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getAssetIssueById(1002357) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -This method is used to query a token by its token id in the TRON blockchain. Since TRON allows for duplicate token names (TRC10 tokens), tokens are identifiable by a unique Token ID. The function `getAssetIssueById` takes this Token ID and returns the token object, which includes the token name. - -### Parameters - -* `value` (string): The address of the TRON account. - -### Return Object - -The function returns a promise that resolves to an object of type `AssetIssueCapsule`. This object contains the following properties: - - - -* `id`: (integer) Token ID. -* `owner_address`: (string) Issuer address. -* `name`: (string) Token name. -* `abbr`: (string) Token abbreviation. -* `total_supply`: (integer) Total supply of tokens. -* `frozen_supply`: (FrozenSupply\[]) The number of tokens to be frozen as specified by the issuer when it was issued. -* `trx_num`: (integer) Defines the price by the ratio of trx\_num/num. The unit of 'trx\_num' is SUN. -* `precision`: (integer) Precision of the token. -* `num`: (integer) Defines the price by the ratio of trx\_num/num. The unit of 'trx\_num' is SUN. -* `start_time`: (integer) ICO start time. -* `end_time`: (integer) ICO end time. -* `description`: (string) Token description. -* `url`: (string) Token's official website URL, default hexString. -* `free_asset_net_limit`: (integer) Token's free asset net limit. -* `public_free_asset_net_limit`: (integer) Token's public free asset net limit for an account. -* `public_free_asset_net_usage`: (integer) The total number of token free bandwidth used by all token owner. -* `public_latest_free_net_time`: (integer) The timestamp of the last consumption of this token's free bandwidth. - -### HTTP Request Example - -```json -{ - "value":1000001 -} -``` - -### HTTP Response Example - -```json -{ - "owner_address": "412e1934759faf93497d6742208e2e521f7043e2ff", - "name": "62747474657374", - "abbr": "62747474657374", - "total_supply": 1000000000000000, - "trx_num": 1000000, - "precision": 6, - "num": 1000000, - "start_time": 1575648000000, - "end_time": 1575734400000, - "description": "62747474657374", - "url": "68747470733a2f2f62746673736f7465722e726561646d652e696f2f646f63732f686f772d746f2d6765742d737461727465642d776974682d736f746572", - "id": "1000001" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyname.md b/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyname.md deleted file mode 100644 index 91dafe9d..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyname.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: "getassetissuebyname" -slug: "rpc-tron-getassetissuebyname" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getAssetIssueByName('474d436f696e') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAssetIssueByName` method allows you to query a token by name on the TRON blockchain. This method is useful when you need to get detailed information about a specific token, such as its total supply, issuer address, precision, and other related details. - -### Parameters - -* `name` (string): The TRC 10 token name, default hexString. - -### Return Object - -* `id` (string): Token ID. -* `owner_address` (string): Issuer address. -* `name` (string): Token name. -* `abbr` (string): Token abbreviation. -* `total_supply` (integer): Total supply. -* `frozen_supply` (FrozenSupply\[]): The number of tokens to be frozen is specified by the issuer of the token when it is issued. -* `trx_num` (integer): Define the price by the ratio of trx\_num/num (The unit of 'trx\_num' is SUN). -* `precision` (integer): Precision. -* `num` (integer): Define the price by the ratio of trx\_num/num (The unit of 'trx\_num' is SUN). -* `start_time` (integer): ICO start time. -* `end_time` (integer): ICO end time. -* `description` (string): Token description. -* `url` (string): Token official website URL, default hexString. -* `free_asset_net_limit` (integer): Token free asset net limit. -* `public_free_asset_net_limit` (integer): Token public free asset net limit for an account. -* `public_free_asset_net_usage` (integer): The total number of token free bandwidth used by all token owners. -* `public_latest_free_net_time` (integer): The timestamp of the last consumption of this token's free bandwidth. - -### HTTP Request Example - -```json -{ - "value": "62747474657374" -} -``` - -### HTTP Response Example - -```json -{ - "id": "1000011", - "owner_address": "41e552f6487585c2b58bc2c9bb4492bc1f17132cd0", - "name": "62747474657374", - "abbr": "BTTS", - "total_supply": 1000000000000000, - "frozen_supply": [], - "trx_num": 1, - "num": 1, - "precision": 6, - "start_time": 1530894319000, - "end_time": 1533472719000, - "description": "BitTorrent Token", - "url": "https://www.bittorrent.com/", - "free_asset_net_limit": 0, - "public_free_asset_net_limit": 0, - "public_free_asset_net_usage": 0, - "public_latest_free_net_time": 0 -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getassetissuelist.md b/v1.0/RPC Nodes/others/rpc-tron/getassetissuelist.md deleted file mode 100644 index 9c4c3b3a..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getassetissuelist.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: "getassetissuelist" -slug: "rpc-tron-getassetissuelist" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use It - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getAssetIssueList() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAssetIssueList` RPC method allows you to query the list of all the TRC10 tokens on the TRON network. - -{% embed url="https://codepen.io/tatum-devrel/pen/XWyQOLq" %} - -### Parameters - -This RPC method doesn't require any parameters. - -### Return Object - -* `assetIssue`: (array) - * `id`: (integer) token ID - * `owner_address`: (string) issuer address - * `name`: (string) token name - * `abbr`: (string) token abbreviation - * `total_supply`: (integer) total supply - * `frozen_supply`: (Array) The number of tokens to be frozen is specified by the issuer of the token when it is issued - * `trx_num`: (integer) Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN) - * `precision`: (integer) precision - * `num`: (integer) Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN) - * `start_time`: (integer) ICO start time - * `end_time`: (integer) ICO end time - * `description`: (string) token description - * `url`: (string) Token official website url, default hexString - * `free_asset_net_limit`: (integer) Token free asset net limit - * `public_free_asset_net_limit`: (integer) Token public free asset net limit for a account - * `public_free_asset_net_usage`: (integer) The total number of token free bandwidth used by all token owner - * `public_latest_free_net_time`: (integer) The timestamp of the last consumption of this token's free bandwidth - -### HTTP Request Example - -Below is an example of how to use the `getAssetIssueList` RPC method with a curl HTTP request: - -```shell -curl --request GET \ - --url https://api.tatum.io/v3/blockchain/node/tron-testnet/wallet/getassetissuelist -``` - -### HTTP Response Example - -```json -{ - "assetIssue": [ - { - "owner_address": "412e1934759faf93497d6742208e2e521f7043e2ff", - "name": "62747474657374", - "abbr": "62747474657374", - "total_supply": 1000000000000000, - "trx_num": 1000000, - "precision": 6, - "num": 1000000, - "start_time": 1575648000000, - "end_time": 1575734400000, - "description": "62747474657374", - "url": "68747470733a2f2f62746673736f7465722e726561646d652e696f2f646f63732f686f772d746f2d6765742d737461727465642d776974682d736f746572", - "id": "1000001" - }, - { - "owner_address": "411e260aeff8bd61d42590d256b671c8062926ef20", - "name": "6f756363746f6b656e", - "abbr": "4f554343", - "total_supply": 10000000000, - "trx_num": 1000000, - "num": 1, - "start_time": 1575648000000, - "end_time": 1640275200000, - "description": "74657374", - "url": "687474703a2f2f7777772e62616964752e636f6d", - "id": "1000002" - } - ] -} -``` - diff --git a/v1.0/RPC Nodes/others/rpc-tron/getassetissuelistbyname.md b/v1.0/RPC Nodes/others/rpc-tron/getassetissuelistbyname.md deleted file mode 100644 index 222a68c8..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getassetissuelistbyname.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: "getassetissuelistbyname" -slug: "rpc-tron-getassetissuelistbyname" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getAssetIssueListByName('62747474657374') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAssetIssueListByName` method allows users to query the list of all the TRC10 tokens by a specific name. This can be useful in various scenarios, such as when one needs to quickly identify tokens with a specific name, or for tracking purposes, where knowing the associated tokens can provide valuable insights. - -### Parameters - -* `value` (string): Name of the TRC10 token to be queried. This parameter is required. - -### Return Object - -* `assetIssue`: (array) - * `id`: (integer) token ID - * `owner_address`: (string) issuer address - * `name`: (string) token name - * `abbr`: (string) token abbreviation - * `total_supply`: (integer) total supply - * `frozen_supply`: (Array) The number of tokens to be frozen is specified by the issuer of the token when it is issued - * `trx_num`: (integer) Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN) - * `precision`: (integer) precision - * `num`: (integer) Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN) - * `start_time`: (integer) ICO start time - * `end_time`: (integer) ICO end time - * `description`: (string) token description - * `url`: (string) Token official website url, default hexString - * `free_asset_net_limit`: (integer) Token free asset net limit - * `public_free_asset_net_limit`: (integer) Token public free asset net limit for a account - * `public_free_asset_net_usage`: (integer) The total number of token free bandwidth used by all token owner - * `public_latest_free_net_time`: (integer) The timestamp of the last consumption of this token's free bandwidth - -### HTTP Request Example - -```json -{ - "value": "49504653" -} -``` - -### HTTP Response Example - -```json -{ - "assetIssue": [ - { - "owner_address": "41d13433f53fdf88820c2e530da7828ce15d6585cb", - "name": "49504653", - "abbr": "49504653", - "total_supply": 100000000000, - "trx_num": 1000000, - "num": 1, - "start_time": 1529990700000, - "end_time": 1537632000000, - "description": "4950465320636f696e", - "url": "687474703a2f2f", - "id": "1000003" - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getavailableunfreezecount.md b/v1.0/RPC Nodes/others/rpc-tron/getavailableunfreezecount.md deleted file mode 100644 index ab75f327..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getavailableunfreezecount.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: "getavailableunfreezecount" -slug: "rpc-tron-getavailableunfreezecount" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getAvailableUnfreezeCount('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getAvailableUnfreezeCount` method is used to retrieve the remaining times of executing the unstake operation in Stake 2.0 on the TRON blockchain. Stake 2.0 supports unstaking in batches, but it imposes a limit of 32 unstake operations that can be executed simultaneously. This means that when a user initiates the first unstake operation, they can only initiate another 31 unstake operations until the TRX of the first unstaking arrives and is ready to be withdrawn to their account. This limitation is in place to prevent malicious attacks. - -{% embed url="https://codepen.io/tatum-devrel/pen/JjeVxBB" %} - -### Parameters - -* `ownerAddress` (string): The owner address for which to retrieve the remaining times of available unstaking. Default is in hexadecimal format. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Whether the address is in base58 format. - -### Return Object - -* `count`: The remaining times of available unstaking. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "count": 32 -} -``` - diff --git a/v1.0/RPC Nodes/others/rpc-tron/getbandwidthprices.md b/v1.0/RPC Nodes/others/rpc-tron/getbandwidthprices.md deleted file mode 100644 index d619f719..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getbandwidthprices.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: "getbandwidthprices" -slug: "rpc-tron-getbandwidthprices" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getBandwidthPrices() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getBandwidthPrices()` method is used to retrieve historical bandwidth unit prices on the TRON blockchain. Bandwidth is an essential resource in the TRON network used for performing transactions. This method will return all historical prices, where each unit price change is separated by a comma. - -{% embed url="https://codepen.io/tatum-devrel/pen/xxQeMNy" %} - -### Parameters - -This method doesn't require any parameters. - -### Return Object - -* `prices`: A string that represents all historical bandwidth unit price information. Each unit price change is separated by a comma. Before the colon is the millisecond timestamp, and after the colon is the bandwidth unit price in sun. - -### HTTP Request Example - -```shell -{} -``` - -### HTTP Response Example - -```json -{ - "prices": "1613713487000:100,1613799887000:200,1613886287000:150" -} -``` - -In this example, the first bandwidth unit price change was at timestamp `1613713487000` with a price of `100` sun, the second at timestamp `1613799887000` with a price of `200` sun, and so on. diff --git a/v1.0/RPC Nodes/others/rpc-tron/getblock.md b/v1.0/RPC Nodes/others/rpc-tron/getblock.md deleted file mode 100644 index c627c2e0..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getblock.md +++ /dev/null @@ -1,296 +0,0 @@ ---- -title: "getblock" -slug: "rpc-tron-getblock" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getBlock('1000000', { - detail: false, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getBlock` method allows you to query block header information or entire block information according to block height or block hash. This can be particularly useful in situations where you need to inspect the contents of a particular block in the TRON blockchain for transaction verification or data analysis. - -{% embed url="https://codepen.io/tatum-devrel/pen/RwqOvez" %} - -### Parameters - -* `idOrNum` (string): This parameter can be the block height or the block hash. Not providing a value means that it will query the latest block. -* `options` (object, optional): This is an optional parameter that can include: - * `detail` (boolean, optional): If set to true, it queries the entire block information including the header and body. If false, it only queries the block header information. - -### Return Object - -The method returns a Promise that resolves to an object with the following properties: - -* `blockID` (string): The block hash. -* `block_header` (object) - * `raw_data` (object) - * `timestamp` (integer): The timestamp of the block. - * `txTrieRoot` (string): The root of the transaction merkle tree. - * `parentHash` (string): The parent block hash. - * `number` (integer): The block number. - * `witness_id` (integer): The witness id. - * `witness_address` (string): The witness address. - * `version` (integer): The version. - * `accountStateRoot` (string): The root of the account state tree. - * `witness_signature` (string): The signature of the Super Representative (SR). -* `transactions` (Array): Contains transaction information in the block. - * `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). - * `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. - * `raw_data.data` - Transaction memo. - * `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. - * `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. - * `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. - * `txID` - transaction id - -### HTTP Request Example - -```json -{ - "id_or_num": "1000000", - "detail": true -} -``` - -### HTTP Response Example - -```json -{ - "blockID": "00000000000f424013e51b18e0782a32fa079ddafdb2f4c343468cf8896dc887", - "block_header": { - "raw_data": { - "number": 1000000, - "txTrieRoot": "e2dd42daa9c853e070df1e4fc927851a7438c601fb12cf945922629d5cec187b", - "witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95", - "parentHash": "00000000000f423fbccd9cdb9e410eabdf9f94145cf5b71a678b8b9616619125", - "version": 9, - "timestamp": 1578594852000 - }, - "witness_signature": "179caed28b3d129dee6d553ae6761a8c8698f890e5f38e062d56e2d0d0b8c9a20317b7753b3fd1be261935d6182434a6c057f8926f25027b9859cde3da3a655300" - }, - "transactions": [ - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "95428ed2e263600933f82bf67f43e15450bc2da3b7b2987a7f46b0b9b9c4aae7ba5ea005b9297fbff5bca5fe5c9b05299433e36e10224c167f9c613b6dded39000" - ], - "txID": "7faabd22623eb53467d34b2a417262f6df75433566c104b6c6eec5a227090df6", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "ae21db6f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000051f5e04fa0000000000000000000000000000000000000000000000000000000004a9681c0000000000000000000000000000000000000000000000000000000004a8fe400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000051f5e04f9000000000000000000000000000000000000000000000000000000051f5e04f8000000000000000000000000000000000000000000000000000000051f5e04f7000000000000000000000000000000000000000000000000000000051f5e04f6000000000000000000000000000000000000000000000000000000051f5e04f5000000000000000000000000000000000000000000000000000000051f5e04f4000000000000000000000000000000000000000000000000000000051f5e04f3", - "owner_address": "41920bb75dd5751afd68e1d55a8a0bc1bc39b32c78", - "contract_address": "417090190c41ba59f763e2cbe7d885e007e94be5d2" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423e", - "ref_block_hash": "5c35fda2f1a9a386", - "expiration": 1578594906000, - "fee_limit": 1000000000, - "timestamp": 1578594849159 - }, - "raw_data_hex": "0a02423e22085c35fda2f1a9a3864090dfdadcf82d5af003081f12eb030a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412b5030a1541920bb75dd5751afd68e1d55a8a0bc1bc39b32c781215417090190c41ba59f763e2cbe7d885e007e94be5d2228403ae21db6f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000051f5e04fa0000000000000000000000000000000000000000000000000000000004a9681c0000000000000000000000000000000000000000000000000000000004a8fe400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000051f5e04f9000000000000000000000000000000000000000000000000000000051f5e04f8000000000000000000000000000000000000000000000000000000051f5e04f7000000000000000000000000000000000000000000000000000000051f5e04f6000000000000000000000000000000000000000000000000000000051f5e04f5000000000000000000000000000000000000000000000000000000051f5e04f4000000000000000000000000000000000000000000000000000000051f5e04f37087a3d7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "6e3f72c5d8bf433bf98ac3bbcdfbbb179d8cd8f5f6da5f1eb0466bbc80bcebee6dc0e5312796c37c3fe73d49f9b350cf61f4830deb7d846c90570f8afb3f513400" - ], - "txID": "98d0f4149bf8023a9df4d2b754f6c728a5b6d021c4497c6cd5452b97f01b0548", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "0204b01b000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa", - "owner_address": "41ed2f4270fa5a7cae1efd4706ae27a4335406921e", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "call_value": 14000000 - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423f", - "ref_block_hash": "bccd9cdb9e410eab", - "expiration": 1578594909000, - "fee_limit": 1000000000, - "timestamp": 1578594849385 - }, - "raw_data_hex": "0a02423f2208bccd9cdb9e410eab40c8f6dadcf82d5ad401081f12cf010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e74726163741299010a1541ed2f4270fa5a7cae1efd4706ae27a4335406921e1215418d9dd663cf90256fdf2faba2a1be71f8a0147f8c1880bfd60622640204b01b000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa70e9a4d7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "230b8767e8745d01f38d2b9f742f4037eb81e93bcc9c2d60bedf4bab3b9e0c16692138a112f1610b505cf3109f3a5ff00d6687c09b3c94a734dd8aedfc92d82101" - ], - "txID": "17e7321320bb08c40f027cbcca320152c2396c77a910f387849a944ee8aa0cb1", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "f6d4ef1a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000051f5e04fa", - "owner_address": "41920bb75dd5751afd68e1d55a8a0bc1bc39b32c78", - "contract_address": "4179c23a5666042e40420d6afdc1541e3926205eba" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423e", - "ref_block_hash": "5c35fda2f1a9a386", - "expiration": 1578594906000, - "fee_limit": 1000000000, - "timestamp": 1578594849187 - }, - "raw_data_hex": "0a02423e22085c35fda2f1a9a3864090dfdadcf82d5aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541920bb75dd5751afd68e1d55a8a0bc1bc39b32c7812154179c23a5666042e40420d6afdc1541e3926205eba2244f6d4ef1a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000051f5e04fa70a3a3d7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "55124a9bfb733a27fc193b00c9c2ce0c1f969ffd0ec59c295fea00a75501206b0d5333c16c8f6a5aa7a32a03268edd3ca903d41f386001733a7d0199bcedb8bb01" - ], - "txID": "4ef51a5760bf98dc2dd752658f48db1445e8ca75f8a6efe14d5a462a15edd3f0", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "0204b01b00000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000003000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa", - "owner_address": "41f07e117a4b5f1fda66f8fcedf44065f1dafc5ad7", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "call_value": 1982000000 - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423f", - "ref_block_hash": "bccd9cdb9e410eab", - "expiration": 1578594909000, - "fee_limit": 1000000000, - "timestamp": 1578594850315 - }, - "raw_data_hex": "0a02423f2208bccd9cdb9e410eab40c8f6dadcf82d5ad501081f12d0010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e7472616374129a010a1541f07e117a4b5f1fda66f8fcedf44065f1dafc5ad71215418d9dd663cf90256fdf2faba2a1be71f8a0147f8c1880d78bb10722640204b01b00000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000003000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa708bacd7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "153d437be2c417d88bef564a1421d2c3debb9f3828e9276a58578eb566091d6a612d3294c124ba3a5da37815d49b7cc7a91be04c0304a8e9ecee02f4d3dc420901" - ], - "txID": "80e07e3f2b92a0e9974b1398964e006288836dee82aa3a81e579a512e6581354", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "0204b01b00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000003000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa", - "owner_address": "419ac63dd8e80daf0a786bf962860e2209b7fa5fb9", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "call_value": 11000000 - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423f", - "ref_block_hash": "bccd9cdb9e410eab", - "expiration": 1578594909000, - "fee_limit": 1000000000, - "timestamp": 1578594851357 - }, - "raw_data_hex": "0a02423f2208bccd9cdb9e410eab40c8f6dadcf82d5ad401081f12cf010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e74726163741299010a15419ac63dd8e80daf0a786bf962860e2209b7fa5fb91215418d9dd663cf90256fdf2faba2a1be71f8a0147f8c18c0b19f0522640204b01b00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000003000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa709db4d7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "a2e6784005b0bd9f80dcb92de8f37133e3355a09496bd7467580805226e2ed520e48858456151dc681e423f0041ae877369a16e6d805facc7af9d27b712891bb01" - ], - "txID": "ba8e727c03d588619310d7a16a95fcfd31a516dbf8893ddd585e0bbd7e0deae4", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "8a157bf900000000000000000000000000000000000000000000000000000000000019be", - "owner_address": "4141c910d7942636ae041975616104ef253e5a8371", - "contract_address": "41174e91a57d68f5ac1bc485d03a038fe745a3b89b" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423f", - "ref_block_hash": "bccd9cdb9e410eab", - "expiration": 1578594909000, - "fee_limit": 10000000, - "timestamp": 1578594850984 - }, - "raw_data_hex": "0a02423f2208bccd9cdb9e410eab40c8f6dadcf82d5a8e01081f1289010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412540a154141c910d7942636ae041975616104ef253e5a8371121541174e91a57d68f5ac1bc485d03a038fe745a3b89b22248a157bf900000000000000000000000000000000000000000000000000000000000019be70a8b1d7dcf82d900180ade204" - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getblockbalance.md b/v1.0/RPC Nodes/others/rpc-tron/getblockbalance.md deleted file mode 100644 index 8104f8a3..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getblockbalance.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: "getblockbalance" -slug: "rpc-tron-getblockbalance" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @@tatumio/tatum -import { TatumSDK, Tron, Network, BigNumber } from '@tatumio/tatum' -import BigNumber from "bignumber.js"; - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getBlockBalance('00000000032669d53545fc1becc4d0cc9287e6324fb3a9230103aa0922f84544', new BigNumber(52849109), { visible: true }) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getBlockBalance` RPC method retrieves all balance change operations in a specific block. This method is useful for tracking transactional changes and balances within a given block. At present, the interface data can only be queried through specific official nodes (47.241.20.47, 161.117.85.97, 161.117.224.116, 161.117.83.38). - -### Parameters - -* `hash` (string): The hash of the block for which you want to get the balance change operations. For example: '0000000001f5b9ca67c722d9263879696c92e8e383d4f0b31c15a91b8a249029'. -* `number` (integer): The number of the block for which you want to get the balance change operations. For example: 32881098. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Whether the address is in base58 format. - -### Return Object - -The method returns an object with the following properties: - -* `timestamp` (integer): The timestamp of the block. -* `block_identifier.hash` (string): The hash of the block. -* `block_identifier.number` (integer): The number of the block. -* `transaction_balance_trace` (TransactionBalanceTrace\[]): An array of transaction information with balance changes. Each TransactionBalanceTrace object contains: - * `transaction_identifier` (string): The hash of the transaction. - * `operation` (Operation\[]): An array of operations involved in the transaction. Each operation contains: - * `operation_identifier` (integer): The identifier of the operation. - * `address` (string): The address involved in the operation. - * `amount` (integer): The amount of balance increase or decrease. - * `type` (string): The type of the transaction. - * `status` (string): The result of the transaction. - -### HTTP Request Example - -```json -{ - "hash": "0000000001f5b9ca67c722d9263879696c92e8e383d4f0b31c15a91b8a249029", - "number": 32881098, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "timestamp": 1630847456000, - "block_identifier": { - "hash": "0000000001f5b9ca67c722d9263879696c92e8e383d4f0b31c15a91b8a249029", - "number": 32881098 - }, - "transaction_balance_trace": [ - { - "transaction_identifier": "ea75b733582194c3c4da8a4c962c5c5a1dfabf525e8db300678b4d18b3adc7fa", - "operation": [ - { - "operation_identifier": 0, - "address": "TKJUZBU4wFm5Vc3MJboGLp7MEeYQ9xEJGy", - "amount": -1000000 - }, - { - "operation_identifier": 1, - "address": "TAUN6FwrnwwmaEqYcckffC7wYmbaS6cBiX", - "amount": 1000000 - } - ], - "type": "TransferContract", - "status": "SUCCESS" - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getblockbyid.md b/v1.0/RPC Nodes/others/rpc-tron/getblockbyid.md deleted file mode 100644 index ebae911b..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getblockbyid.md +++ /dev/null @@ -1,286 +0,0 @@ ---- -title: "getblockbyid" -slug: "rpc-tron-getblockbyid" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getBlockById('000000000326bcabea2fa533c7080c8baf231f320d3ccdd54a59e3fcb1760364') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getBlockById` method allows you to query a specific block on the TRON blockchain by providing the block's ID. This can be useful when you want to retrieve specific transactional or metadata about a particular block. - -### Parameters - -* `value` (string): The ID of the block to query. This is the block hash which uniquely identifies each block on the TRON blockchain. - -### Return Object - -* `blockID` (string): The block hash. -* `block_header` (object) - * `raw_data` (object) - * `timestamp` (integer): The timestamp of the block. - * `txTrieRoot` (string): The root of the transaction merkle tree. - * `parentHash` (string): The parent block hash. - * `number` (integer): The block number. - * `witness_id` (integer): The witness id. - * `witness_address` (string): The witness address. - * `version` (integer): The version. - * `accountStateRoot` (string): The root of the account state tree. - * `witness_signature` (string): The signature of the Super Representative (SR). -* `transactions` (Array): Contains transaction information in the block. - * `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). - * `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. - * `raw_data.data` - Transaction memo. - * `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. - * `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. - * `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. - * `txID` - transaction id - -### HTTP Request Example - -```json -{ - "value": "0x000000000332a91b74ac983b698b9b6ddb087631992fcf8a4cf838b8500e7767" -} -``` - -### HTTP Response Example - -```json -{ - "blockID": "00000000000f424013e51b18e0782a32fa079ddafdb2f4c343468cf8896dc887", - "block_header": { - "raw_data": { - "number": 1000000, - "txTrieRoot": "e2dd42daa9c853e070df1e4fc927851a7438c601fb12cf945922629d5cec187b", - "witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95", - "parentHash": "00000000000f423fbccd9cdb9e410eabdf9f94145cf5b71a678b8b9616619125", - "version": 9, - "timestamp": 1578594852000 - }, - "witness_signature": "179caed28b3d129dee6d553ae6761a8c8698f890e5f38e062d56e2d0d0b8c9a20317b7753b3fd1be261935d6182434a6c057f8926f25027b9859cde3da3a655300" - }, - "transactions": [ - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "95428ed2e263600933f82bf67f43e15450bc2da3b7b2987a7f46b0b9b9c4aae7ba5ea005b9297fbff5bca5fe5c9b05299433e36e10224c167f9c613b6dded39000" - ], - "txID": "7faabd22623eb53467d34b2a417262f6df75433566c104b6c6eec5a227090df6", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "ae21db6f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000051f5e04fa0000000000000000000000000000000000000000000000000000000004a9681c0000000000000000000000000000000000000000000000000000000004a8fe400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000051f5e04f9000000000000000000000000000000000000000000000000000000051f5e04f8000000000000000000000000000000000000000000000000000000051f5e04f7000000000000000000000000000000000000000000000000000000051f5e04f6000000000000000000000000000000000000000000000000000000051f5e04f5000000000000000000000000000000000000000000000000000000051f5e04f4000000000000000000000000000000000000000000000000000000051f5e04f3", - "owner_address": "41920bb75dd5751afd68e1d55a8a0bc1bc39b32c78", - "contract_address": "417090190c41ba59f763e2cbe7d885e007e94be5d2" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423e", - "ref_block_hash": "5c35fda2f1a9a386", - "expiration": 1578594906000, - "fee_limit": 1000000000, - "timestamp": 1578594849159 - }, - "raw_data_hex": "0a02423e22085c35fda2f1a9a3864090dfdadcf82d5af003081f12eb030a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412b5030a1541920bb75dd5751afd68e1d55a8a0bc1bc39b32c781215417090190c41ba59f763e2cbe7d885e007e94be5d2228403ae21db6f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000051f5e04fa0000000000000000000000000000000000000000000000000000000004a9681c0000000000000000000000000000000000000000000000000000000004a8fe400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000051f5e04f9000000000000000000000000000000000000000000000000000000051f5e04f8000000000000000000000000000000000000000000000000000000051f5e04f7000000000000000000000000000000000000000000000000000000051f5e04f6000000000000000000000000000000000000000000000000000000051f5e04f5000000000000000000000000000000000000000000000000000000051f5e04f4000000000000000000000000000000000000000000000000000000051f5e04f37087a3d7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "6e3f72c5d8bf433bf98ac3bbcdfbbb179d8cd8f5f6da5f1eb0466bbc80bcebee6dc0e5312796c37c3fe73d49f9b350cf61f4830deb7d846c90570f8afb3f513400" - ], - "txID": "98d0f4149bf8023a9df4d2b754f6c728a5b6d021c4497c6cd5452b97f01b0548", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "0204b01b000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa", - "owner_address": "41ed2f4270fa5a7cae1efd4706ae27a4335406921e", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "call_value": 14000000 - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423f", - "ref_block_hash": "bccd9cdb9e410eab", - "expiration": 1578594909000, - "fee_limit": 1000000000, - "timestamp": 1578594849385 - }, - "raw_data_hex": "0a02423f2208bccd9cdb9e410eab40c8f6dadcf82d5ad401081f12cf010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e74726163741299010a1541ed2f4270fa5a7cae1efd4706ae27a4335406921e1215418d9dd663cf90256fdf2faba2a1be71f8a0147f8c1880bfd60622640204b01b000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa70e9a4d7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "230b8767e8745d01f38d2b9f742f4037eb81e93bcc9c2d60bedf4bab3b9e0c16692138a112f1610b505cf3109f3a5ff00d6687c09b3c94a734dd8aedfc92d82101" - ], - "txID": "17e7321320bb08c40f027cbcca320152c2396c77a910f387849a944ee8aa0cb1", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "f6d4ef1a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000051f5e04fa", - "owner_address": "41920bb75dd5751afd68e1d55a8a0bc1bc39b32c78", - "contract_address": "4179c23a5666042e40420d6afdc1541e3926205eba" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423e", - "ref_block_hash": "5c35fda2f1a9a386", - "expiration": 1578594906000, - "fee_limit": 1000000000, - "timestamp": 1578594849187 - }, - "raw_data_hex": "0a02423e22085c35fda2f1a9a3864090dfdadcf82d5aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541920bb75dd5751afd68e1d55a8a0bc1bc39b32c7812154179c23a5666042e40420d6afdc1541e3926205eba2244f6d4ef1a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000051f5e04fa70a3a3d7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "55124a9bfb733a27fc193b00c9c2ce0c1f969ffd0ec59c295fea00a75501206b0d5333c16c8f6a5aa7a32a03268edd3ca903d41f386001733a7d0199bcedb8bb01" - ], - "txID": "4ef51a5760bf98dc2dd752658f48db1445e8ca75f8a6efe14d5a462a15edd3f0", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "0204b01b00000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000003000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa", - "owner_address": "41f07e117a4b5f1fda66f8fcedf44065f1dafc5ad7", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "call_value": 1982000000 - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423f", - "ref_block_hash": "bccd9cdb9e410eab", - "expiration": 1578594909000, - "fee_limit": 1000000000, - "timestamp": 1578594850315 - }, - "raw_data_hex": "0a02423f2208bccd9cdb9e410eab40c8f6dadcf82d5ad501081f12d0010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e7472616374129a010a1541f07e117a4b5f1fda66f8fcedf44065f1dafc5ad71215418d9dd663cf90256fdf2faba2a1be71f8a0147f8c1880d78bb10722640204b01b00000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000003000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa708bacd7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "153d437be2c417d88bef564a1421d2c3debb9f3828e9276a58578eb566091d6a612d3294c124ba3a5da37815d49b7cc7a91be04c0304a8e9ecee02f4d3dc420901" - ], - "txID": "80e07e3f2b92a0e9974b1398964e006288836dee82aa3a81e579a512e6581354", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "0204b01b00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000003000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa", - "owner_address": "419ac63dd8e80daf0a786bf962860e2209b7fa5fb9", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "call_value": 11000000 - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423f", - "ref_block_hash": "bccd9cdb9e410eab", - "expiration": 1578594909000, - "fee_limit": 1000000000, - "timestamp": 1578594851357 - }, - "raw_data_hex": "0a02423f2208bccd9cdb9e410eab40c8f6dadcf82d5ad401081f12cf010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e74726163741299010a15419ac63dd8e80daf0a786bf962860e2209b7fa5fb91215418d9dd663cf90256fdf2faba2a1be71f8a0147f8c18c0b19f0522640204b01b00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000003000000000000000000000000db4df489cf3977fbf0d06e47885f3dc85446b4aa709db4d7dcf82d90018094ebdc03" - }, - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "a2e6784005b0bd9f80dcb92de8f37133e3355a09496bd7467580805226e2ed520e48858456151dc681e423f0041ae877369a16e6d805facc7af9d27b712891bb01" - ], - "txID": "ba8e727c03d588619310d7a16a95fcfd31a516dbf8893ddd585e0bbd7e0deae4", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "8a157bf900000000000000000000000000000000000000000000000000000000000019be", - "owner_address": "4141c910d7942636ae041975616104ef253e5a8371", - "contract_address": "41174e91a57d68f5ac1bc485d03a038fe745a3b89b" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "423f", - "ref_block_hash": "bccd9cdb9e410eab", - "expiration": 1578594909000, - "fee_limit": 10000000, - "timestamp": 1578594850984 - }, - "raw_data_hex": "0a02423f2208bccd9cdb9e410eab40c8f6dadcf82d5a8e01081f1289010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412540a154141c910d7942636ae041975616104ef253e5a8371121541174e91a57d68f5ac1bc485d03a038fe745a3b89b22248a157bf900000000000000000000000000000000000000000000000000000000000019be70a8b1d7dcf82d900180ade204" - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getblockbylatestnum.md b/v1.0/RPC Nodes/others/rpc-tron/getblockbylatestnum.md deleted file mode 100644 index c70ec7d3..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getblockbylatestnum.md +++ /dev/null @@ -1,187 +0,0 @@ ---- -title: "getblockbylatestnum" -slug: "rpc-tron-getblockbylatestnum" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getBlockByLatestNum(5) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getBlockByLatestNum` method retrieves a specified number of the most recent blocks from the TRON blockchain. This can be helpful when you need to analyse or display recent blockchain data. - -{% embed url="https://codepen.io/tatum-devrel/pen/ExOJrGL" %} - -### Parameters - -* `num` (integer): The number of the most recent blocks to retrieve. - -### Return Object - -* `block:` Array of blocks - * - * `blockID` (string): The block hash. - * `block_header` (object) - * `raw_data` (object) - * `timestamp` (integer): The timestamp of the block. - * `txTrieRoot` (string): The root of the transaction merkle tree. - * `parentHash` (string): The parent block hash. - * `number` (integer): The block number. - * `witness_id` (integer): The witness id. - * `witness_address` (string): The witness address. - * `version` (integer): The version. - * `accountStateRoot` (string): The root of the account state tree. - * `witness_signature` (string): The signature of the Super Representative (SR). - * `transactions` (Array): Contains transaction information in the block. - * `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). - * `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. - * `raw_data.data` - Transaction memo. - * `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. - * `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. - * `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. - * `txID` - transaction id - -### HTTP Request Example - -```json -{ - "num": 5 -} -``` - -### HTTP Response Example - -```json -{ - "block": [ - { - "blockID": "000000000203c375c7521ef953106e9a112e1902664a91becc5f40371a7397d7", - "block_header": { - "raw_data": { - "number": 33801077, - "txTrieRoot": "30fe6502e11e110fa389d5c17e1cf53fa8df93f26297d9f27cd8c07d3558d722", - "witness_address": "41e71c365c9dbf284ca8c1eed2d7877638941b9011", - "parentHash": "000000000203c3741f9a08f594934bd26df95cc6c49b475d118e3a87aed5a4a4", - "version": 27, - "timestamp": 1684509309000 - }, - "witness_signature": "cb4845bbd745f620852a1a54a955cee0d1aecc209f2f96e9b4ea53bf3d2ceb0f665fa07a5e870fcf9c6b98110a33d5bba5f35b588cc4123394b7e9f439fe265301" - }, - "transactions": [ - { - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "95874b4774ba56125dfd7bf2a99a0652d4abda98c6977e3f417852b7ea6f2b81ff2f260df473d186be9586b6bbeb74b5382d7f058593fd72fb60da5d0f77f77100" - ], - "txID": "31370141e3345421bdb92eff72f0d69aba8d04e636317ed52745d3f97e9faabb", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "37383d0e00000000000000000000000000000000000000000000000000000188349354c9", - "owner_address": "41fcf7ab2a2fb29362babd41647a22b223f7fbedec", - "contract_address": "41c3c5115bd3f5cfe5559c634eeb250f339ae3e29c" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "c362", - "ref_block_hash": "4ddf60f936a910d9", - "expiration": 1684509366000, - "fee_limit": 150000000, - "timestamp": 1684509306936 - }, - "raw_data_hex": "0a02c36222084ddf60f936a910d940f0add4a483315a8e01081f1289010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412540a1541fcf7ab2a2fb29362babd41647a22b223f7fbedec121541c3c5115bd3f5cfe5559c634eeb250f339ae3e29c222437383d0e00000000000000000000000000000000000000000000000000000188349354c970b8e0d0a48331900180a3c347" - } - ] - }, - { - "blockID": "000000000203c376d3d45ca88309982517d69ff0ec4d9a9f9f25536cebcdd76b", - "block_header": { - "raw_data": { - "number": 33801078, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41e61626ef01662b320a8ba38372e9db9cca940a3b", - "parentHash": "000000000203c375c7521ef953106e9a112e1902664a91becc5f40371a7397d7", - "version": 27, - "timestamp": 1684509312000 - }, - "witness_signature": "f38e08044df52f0bd3314a0dc73431290c323e20a67297da8be939041a8eae484e1094ba455c78b71f198bfaf80aee68bb5e9d40f9146158e88ed776d2034e9800" - } - }, - { - "blockID": "000000000203c3772b4f36792ea4f44a6d8345ccacee8a00d6f309a206193f1c", - "block_header": { - "raw_data": { - "number": 33801079, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41e76da262ad1ca05274f74258ee18bc7fcc4987dc", - "parentHash": "000000000203c376d3d45ca88309982517d69ff0ec4d9a9f9f25536cebcdd76b", - "version": 27, - "timestamp": 1684509315000 - }, - "witness_signature": "c6413a9d83553d6243eff19c27c136436e9e2e1b2315849e71232ae473614fdf3034ce215c8695c7ca15742899dcf6c276b3be918b6b8049b74f3b81a3c695b500" - } - }, - { - "blockID": "000000000203c378d7df0f9d0edecc8b5e7edac57543e6fa421bbae6b1448e5f", - "block_header": { - "raw_data": { - "number": 33801080, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41290bf92b578a1c615ebb273aff6a285230c02f65", - "parentHash": "000000000203c3772b4f36792ea4f44a6d8345ccacee8a00d6f309a206193f1c", - "version": 27, - "timestamp": 1684509318000 - }, - "witness_signature": "122a4463f64743b90f1e0f476bd878aae576225591643972595a7bb250ddee2757287b8c8ab627ba95e027e55421160ea2b6bb543bcaa89b871427113bbab6a101" - } - }, - { - "blockID": "000000000203c3799526a98bab56861511f0e67ec65557826d7bfc0b36e17450", - "block_header": { - "raw_data": { - "number": 33801081, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41977f82c69011cf4a7db6f7339edcded85c614d45", - "parentHash": "000000000203c378d7df0f9d0edecc8b5e7edac57543e6fa421bbae6b1448e5f", - "version": 27, - "timestamp": 1684509321000 - }, - "witness_signature": "bd07babfec59340828d6d82032a0865f22391df29c43647c0e3186e21b9df43d2f78f3cb50d4a0113f08ebd7c02663ffc169352297256cce4bd62b04a4289e1d01" - } - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getblockbylimitnext.md b/v1.0/RPC Nodes/others/rpc-tron/getblockbylimitnext.md deleted file mode 100644 index ad952757..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getblockbylimitnext.md +++ /dev/null @@ -1,147 +0,0 @@ ---- -title: "getblockbylimitnext" -slug: "rpc-tron-getblockbylimitnext" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum -import { TatumSDK, Tron, Network } from '@tatumio/tatum'; - -const tatum = await TatumSDK.init({network: Network.TRON}); - -const res = await tatum.rpc.getBlockByLimitNext(1, 5); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getBlockByLimitNext` method allows interaction with the TRON blockchain to fetch a range of blocks. The method requires the starting and ending block heights as input and returns the list of Block Objects included in the range. - -Use cases include, but are not limited to, data analysis, tracking block transactions, and network monitoring. - -### Parameters - -The method takes two parameters: - -* `startNum` (integer): The starting block height, inclusive. -* `endNum` (integer): The ending block height, exclusive. - -### Return Object - -* `block:` Array of blocks - * `blockID` (string): The block hash. - * `block_header` (object) - * `raw_data` (object) - * `timestamp` (integer): The timestamp of the block. - * `txTrieRoot` (string): The root of the transaction merkle tree. - * `parentHash` (string): The parent block hash. - * `number` (integer): The block number. - * `witness_id` (integer): The witness id. - * `witness_address` (string): The witness address. - * `version` (integer): The version. - * `accountStateRoot` (string): The root of the account state tree. - * `witness_signature` (string): The signature of the Super Representative (SR). - * `transactions` (Array): Contains transaction information in the block. - * `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). - * `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. - * `raw_data.data` - Transaction memo. - * `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. - * `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. - * `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. - * `txID` - transaction id - -### HTTP Request Example - -Here's how the request looks as a CURL command: - -```json -{ - "startNum": 1, - "endNum": 5 -} -``` - -### HTTP Response Example - -This is a general representation of a response. The actual response will contain a list of blocks based on the range specified: - -```json -{ - "block": [ - { - "blockID": "0000000000000001049f911bc1069bfd2c2225bc3cd210abd02fb219751813f0", - "block_header": { - "raw_data": { - "number": 1, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95", - "parentHash": "0000000000000000de1aa88295e1fcf982742f773e0419c5a9c134c994a9059e", - "version": 9, - "timestamp": 1575594015000 - }, - "witness_signature": "a3feb861edcf246bd51a447f8f91636c1d7e6868b346eb2773e24859aacceaed4aa032664c2433bce5dc58e6febe87d3a7e70841684536964670fcad05fe111601" - } - }, - { - "blockID": "00000000000000028e917e1dcf24b45bf9ba16d59d77f9a1846bc4861e7045e4", - "block_header": { - "raw_data": { - "number": 2, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95", - "parentHash": "0000000000000001049f911bc1069bfd2c2225bc3cd210abd02fb219751813f0", - "version": 9, - "timestamp": 1575594024000 - }, - "witness_signature": "076e8610191e5e1b010697ed40fc4a8b316010374e27add85ca117160582223559e14195c7f475020b66f6136807a96c8aaea4b8a8061a9ab50d1d19234034eb00" - } - }, - { - "blockID": "0000000000000003e7025004f6a699db79bd9d5f20bc5e363344f8b01f959394", - "block_header": { - "raw_data": { - "number": 3, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95", - "parentHash": "00000000000000028e917e1dcf24b45bf9ba16d59d77f9a1846bc4861e7045e4", - "version": 9, - "timestamp": 1575594027000 - }, - "witness_signature": "fa4bf8994324f816b8ad1e85ae06b93b33e24cce84255c5656415573641b01410f5e2152d328c32525b8a03ca06dc6100e26fddb2c4836e3e4357134399372a901" - } - }, - { - "blockID": "00000000000000044a56ccc0ee2c6ce0f6d1aeeeca788486ea0f6ad52853749c", - "block_header": { - "raw_data": { - "number": 4, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95", - "parentHash": "0000000000000003e7025004f6a699db79bd9d5f20bc5e363344f8b01f959394", - "version": 9, - "timestamp": 1575594030000 - }, - "witness_signature": "192eadd1f1ae870d0e7464a72829307e5b214e1e3be16e03f223d264acf9c2f715b4b647e836c62cb88a428752b225aa8f3c6d9c85696c8f06635091b1c1982600" - } - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getblockbynum.md b/v1.0/RPC Nodes/others/rpc-tron/getblockbynum.md deleted file mode 100644 index f598d427..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getblockbynum.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: "getblockbynum" -slug: "rpc-tron-getblockbynum" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to Use It - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize Tatum SDK for TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -// Get the block by number -const block = await tatum.rpc.getBlockByNum(200) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getBlockByNum` method returns the block object corresponding to the block height specified (the number of blocks preceding it). This could be useful for retrieving specific block data or for validating transactions within a certain block. - -{% embed url="https://codepen.io/tatum-devrel/pen/GRwLzPK" %} - -### Parameters - -* `num` (integer): The height of the block to retrieve. - -### Return Object - -The method returns a promise that resolves to a block object with the following fields: - -* -* `blockID` (string): The block hash. -* `block_header` (object) - * `raw_data` (object) - * `timestamp` (integer): The timestamp of the block. - * `txTrieRoot` (string): The root of the transaction merkle tree. - * `parentHash` (string): The parent block hash. - * `number` (integer): The block number. - * `witness_id` (integer): The witness id. - * `witness_address` (string): The witness address. - * `version` (integer): The version. - * `accountStateRoot` (string): The root of the account state tree. - * `witness_signature` (string): The signature of the Super Representative (SR). -* `transactions` (Array): Contains transaction information in the block. - * `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). - * `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. - * `raw_data.data` - Transaction memo. - * `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. - * `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. - * `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. - * `txID` - transaction id - -### HTTP Request Example - -```json -{ - "num":200 -} -``` - -### HTTP Response Example - -```json -{ - "blockID": "00000000000000c86d2473411771f83db5e314c01bc8f8cf0dc2f8892be6fd7f", - "block_header": { - "raw_data": { - "number": 200, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95", - "parentHash": "00000000000000c7d4d47132f21fd0b74e2f8bcb0c2e9130f7cab35b5d38af9f", - "version": 9, - "timestamp": 1575594618000 - }, - "witness_signature": "97ecda5b130600d18304e02f7fd5ab9d115c5ec9c0e312c8c6fe83939771bb85505fafee598541dc902b1a7b8ca2735c83a12e640203ed4b8529d47ce4f413df00" - } -} -``` - -*** diff --git a/v1.0/RPC Nodes/others/rpc-tron/getburntrx.md b/v1.0/RPC Nodes/others/rpc-tron/getburntrx.md deleted file mode 100644 index e32d2f41..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getburntrx.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: "getburntrx" -slug: "rpc-tron-getburntrx" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum'; - -const tatum = await TatumSDK.init({network: Network.TRON}); - -const res = await tatum.rpc.getBurnTRX(); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getBurnTRX()` RPC method allows to query the amount of TRX burned due to on-chain transaction fees since the No. 54 Committee Proposal took effect. - -Before the No. 54 Committee Proposal takes effect, the destruction of transaction fees is completed by transferring to the black hole address TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy. After the No. 54 committee proposal takes effect, it will no longer be transferred to the black hole address, but will be directly recorded in the node database. - -Use cases of this method include monitoring the total amount of TRX burned due to transaction fees, which can be useful for data analysis and transparency purposes. - -{% embed url="https://codepen.io/tatum-devrel/pen/VwVNgOO" %} - -### Parameters - -The `getBurnTRX()` RPC method does not require any parameters. - -### Return Object - -* `burnTrxAmount`: This is the amount of TRX burned due to on-chain transaction fees. The amount is returned in sun (1 TRX = 1,000,000 sun). - -### HTTP Request Example - -```bash -{} -``` - -### HTTP Response Example - -```json -{ - "burnTrxAmount": 200 -} -``` - -Note that the `burnTrxAmount` is returned as an integer in sun. - -*** diff --git a/v1.0/RPC Nodes/others/rpc-tron/getcandelegatedmaxsize.md b/v1.0/RPC Nodes/others/rpc-tron/getcandelegatedmaxsize.md deleted file mode 100644 index 5b287cc5..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getcandelegatedmaxsize.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "getcandelegatedmaxsize" -slug: "rpc-tron-getcandelegatedmaxsize" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({ network: Network.TRON }) - -const res = await tatum.rpc.getCanDelegatedMaxSize('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', 0, { - visible: true -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getCanDelegatedMaxSize` method is used to query the amount of delegatable resources share of the specified resource type for a given address on the TRON blockchain. The unit of measurement for the amount is sun. This method is part of the Stake2.0 functionality. - -Use cases for this method include: - -* Determining the amount of delegatable bandwidth or energy resources for an address. -* Calculating the available resources for delegation before initiating a delegation transaction. - -{% embed url="https://codepen.io/tatum-devrel/pen/zYMXeJR" %} - -### Parameters - -1. `ownerAddress` (string): The owner address for which the delegatable resource share needs to be queried. It should be provided as a hexadecimal string. -2. `type` (integer): The resource type to query. Use `0` for bandwidth and `1` for energy. -3. `options` (object, optional): Additional options for the method. - * `visible` (boolean, optional): Whether the address is in base58 format. Defaults to `true`. - -### Return Object - -The `getCanDelegatedMaxSize` method returns the following object: - -* `max_size`: The amount of delegatable resource share in sun. - -Note: If the delegating transaction has a memo, it would consume more bandwidth. Therefore, the actual delegatable share might be less than the value returned by this API. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "type": 0, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "max_size": 12311 -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getcanwithdrawunfreezeamount.md b/v1.0/RPC Nodes/others/rpc-tron/getcanwithdrawunfreezeamount.md deleted file mode 100644 index b38b8e7a..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getcanwithdrawunfreezeamount.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "getcanwithdrawunfreezeamount" -slug: "rpc-tron-getcanwithdrawunfreezeamount" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -import { TatumSDK, Tron, Network } from '@tatumcom/js'; - -const tatum = await TatumSDK.init({ network: Network.TRON }); - -const res = await tatum.rpc.getCanWithdrawUnfreezeAmount('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', { - timestamp: 1667977444000, - visible: true, -}); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getCanWithdrawUnfreezeAmount` method allows you to retrieve the withdrawable balance for a specified owner address at a specific timestamp. This method is primarily used in the Stake 2.0 protocol on the TRON blockchain. - -{% embed url="https://codepen.io/tatum-devrel/pen/BaGEMON" %} - -Use Cases: - -* Calculating the available balance that can be withdrawn by an owner address in the Stake 2.0 protocol. -* Providing real-time balance information to users or applications. - -### Parameters - -* `ownerAddress` (string): The owner address for which the withdrawable balance needs to be retrieved. (Default: hexString) -* `options` (object, optional): This optional parameter contains the following properties: - * `timestamp` (integer, optional): The query cutoff timestamp in milliseconds. - * `visible` (boolean, optional): parameter to indicate whether the address is in base58 format. - -### Return Object - -The `getCanWithdrawUnfreezeAmount` method returns the following object: - -* `amount`: The withdrawable balance in TRX, where the unit is sun. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "timestamp": 1667977444000, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "amount": 1000000 -} -``` - diff --git a/v1.0/RPC Nodes/others/rpc-tron/getchainparameters.md b/v1.0/RPC Nodes/others/rpc-tron/getchainparameters.md deleted file mode 100644 index 5d97b43d..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getchainparameters.md +++ /dev/null @@ -1,303 +0,0 @@ ---- -title: "getchainparameters" -slug: "rpc-tron-getchainparameters" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const chainParameters = await tatum.rpc.getChainParameters() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getChainParameters` method retrieves all parameters that the blockchain committee can set. This method is useful for getting detailed information about the blockchain's configurable parameters. - -{% embed url="https://codepen.io/tatum-devrel/pen/BaGEMej" %} - -### Parameters - -This method doesn't require any parameters. - -### Return Object - -The return object is an array of ChainParameters objects. Each ChainParameters object contains the following parameters: - -* `chainParameter (array)` - * `key` (string): The parameter name. - * `value` (integer): The parameter value. - -### HTTP Request Example - -```curl -{] -``` - -### HTTP Response Example - -```json -{ - "chainParameter": [ - { - "key": "getMaintenanceTimeInterval", - "value": 600000 - }, - { - "key": "getAccountUpgradeCost", - "value": 9999000000 - }, - { - "key": "getCreateAccountFee", - "value": 100000 - }, - { - "key": "getTransactionFee", - "value": 1000 - }, - { - "key": "getAssetIssueFee", - "value": 1024000000 - }, - { - "key": "getWitnessPayPerBlock", - "value": 100000000000 - }, - { - "key": "getWitnessStandbyAllowance", - "value": 100000000 - }, - { - "key": "getCreateNewAccountFeeInSystemContract", - "value": 1000000 - }, - { - "key": "getCreateNewAccountBandwidthRate", - "value": 1 - }, - { - "key": "getAllowCreationOfContracts", - "value": 1 - }, - { - "key": "getRemoveThePowerOfTheGr", - "value": -1 - }, - { - "key": "getEnergyFee", - "value": 420 - }, - { - "key": "getExchangeCreateFee", - "value": 1024000000 - }, - { - "key": "getMaxCpuTimeOfOneTx", - "value": 120 - }, - { - "key": "getAllowUpdateAccountName" - }, - { - "key": "getAllowSameTokenName", - "value": 1 - }, - { - "key": "getAllowDelegateResource", - "value": 1 - }, - { - "key": "getTotalEnergyLimit", - "value": 50000000000 - }, - { - "key": "getAllowTvmTransferTrc10", - "value": 1 - }, - { - "key": "getTotalEnergyCurrentLimit", - "value": 50000000000000 - }, - { - "key": "getAllowMultiSign", - "value": 1 - }, - { - "key": "getAllowAdaptiveEnergy", - "value": 1 - }, - { - "key": "getTotalEnergyTargetLimit", - "value": 3472222 - }, - { - "key": "getTotalEnergyAverageUsage", - "value": 8384 - }, - { - "key": "getUpdateAccountPermissionFee", - "value": 100000000 - }, - { - "key": "getMultiSignFee", - "value": 1000000 - }, - { - "key": "getAllowAccountStateRoot" - }, - { - "key": "getAllowProtoFilterNum" - }, - { - "key": "getAllowTvmConstantinople", - "value": 1 - }, - { - "key": "getAllowTvmSolidity059", - "value": 1 - }, - { - "key": "getAllowTvmIstanbul", - "value": 1 - }, - { - "key": "getAllowShieldedTRC20Transaction", - "value": 1 - }, - { - "key": "getForbidTransferToContract" - }, - { - "key": "getAdaptiveResourceLimitTargetRatio", - "value": 10 - }, - { - "key": "getAdaptiveResourceLimitMultiplier", - "value": 1000 - }, - { - "key": "getChangeDelegation", - "value": 1 - }, - { - "key": "getWitness127PayPerBlock", - "value": 10000000 - }, - { - "key": "getAllowMarketTransaction" - }, - { - "key": "getMarketSellFee" - }, - { - "key": "getMarketCancelFee" - }, - { - "key": "getAllowPBFT" - }, - { - "key": "getAllowTransactionFeePool" - }, - { - "key": "getMaxFeeLimit", - "value": 15000000000 - }, - { - "key": "getAllowOptimizeBlackHole", - "value": 1 - }, - { - "key": "getAllowNewResourceModel" - }, - { - "key": "getAllowTvmFreeze" - }, - { - "key": "getAllowTvmVote", - "value": 1 - }, - { - "key": "getAllowTvmLondon", - "value": 1 - }, - { - "key": "getAllowTvmCompatibleEvm" - }, - { - "key": "getAllowAccountAssetOptimization" - }, - { - "key": "getFreeNetLimit", - "value": 1500 - }, - { - "key": "getTotalNetLimit", - "value": 43200000000 - }, - { - "key": "getAllowHigherLimitForMaxCpuTimeOfOneTx", - "value": 1 - }, - { - "key": "getAllowAssetOptimization", - "value": 1 - }, - { - "key": "getAllowNewReward", - "value": 1 - }, - { - "key": "getMemoFee", - "value": 1000000 - }, - { - "key": "getAllowDelegateOptimization", - "value": 1 - }, - { - "key": "getUnfreezeDelayDays", - "value": 14 - }, - { - "key": "getAllowOptimizedReturnValueOfChainId", - "value": 1 - }, - { - "key": "getAllowDynamicEnergy", - "value": 1 - }, - { - "key": "getDynamicEnergyThreshold", - "value": 3000000000 - }, - { - "key": "getDynamicEnergyIncreaseFactor", - "value": 2000 - }, - { - "key": "getDynamicEnergyMaxFactor", - "value": 12000 - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getcontract.md b/v1.0/RPC Nodes/others/rpc-tron/getcontract.md deleted file mode 100644 index 4e4135db..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getcontract.md +++ /dev/null @@ -1,317 +0,0 @@ ---- -title: "getcontract" -slug: "rpc-tron-getcontract" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getContract('TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getContract` method allows you to query a contract's information from the TRON blockchain. This includes the bytecode of the contract, ABI, configuration parameters, and more. This can be useful in a variety of use-cases such as contract verification, auditing, and debugging. - -{% embed url="https://codepen.io/Night-Shift-Dev/pen/wvQaBNR" %} - -### Parameters - -* `value` (string): The contract address, as a string. -* `options` (optional): Additional options. - * `visible` (boolean, optional): Whether the address is in visible format(base58check) or hex. - -### Return Object - -The method returns an object with the following properties: - -* `origin_address` (string): Contract creator address. -* `contract_address` (string): Contract address. -* `abi` (ABI): ABI of the contract. -* `bytecode` (string): Bytecode of the contract. -* `call_value` (integer): The amount of TRX passed into the contract when deploying the contract. -* `consume_user_resource_percent` (integer): Proportion of user energy consumption. -* `name` (string): Contract name. -* `origin_energy_limit` (integer): Each transaction is allowed to consume the maximum energy of the contract creator, the unit is sun. -* `code_hash` (string): Code hash of the contract. - -### HTTP Request Example - -```json -{ - "value": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "bytecode": "608060405234801561001057600080fd5b50d3801561001d57600080fd5b50d2801561002a57600080fd5b50604080518082018252600b81526a2a32ba3432b92a37b5b2b760a91b6020808301918252835180850190945260048452631554d11560e21b90840152815191929160069161007c9160039190610236565b508151610090906004906020850190610236565b506005805460ff191660ff92909216919091179055506100cc9050336100b46100d1565b60ff16600a0a6402540be400026100db60201b60201c565b6102ce565b60055460ff165b90565b6001600160a01b038216610136576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61014f816002546101d560201b61078c1790919060201c565b6002556001600160a01b0382166000908152602081815260409091205461017f91839061078c6101d5821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60008282018381101561022f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061027757805160ff19168380011785556102a4565b828001600101855582156102a4579182015b828111156102a4578251825591602001919060010190610289565b506102b09291506102b4565b5090565b6100d891905b808211156102b057600081556001016102ba565b6108ad806102dd6000396000f3fe608060405234801561001057600080fd5b50d3801561001d57600080fd5b50d2801561002a57600080fd5b50600436106100b35760003560e01c806306fdde03146100b8578063095ea7b31461013557806318160ddd1461017557806323b872dd1461018f578063313ce567146101c557806339509351146101e357806370a082311461020f57806395d89b4114610235578063a457c2d71461023d578063a9059cbb14610269578063dd62ed3e14610295575b600080fd5b6100c06102c3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fa5781810151838201526020016100e2565b50505050905090810190601f1680156101275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101616004803603604081101561014b57600080fd5b506001600160a01b038135169060200135610359565b604080519115158252519081900360200190f35b61017d61036f565b60408051918252519081900360200190f35b610161600480360360608110156101a557600080fd5b506001600160a01b03813581169160208101359091169060400135610375565b6101cd6103cc565b6040805160ff9092168252519081900360200190f35b610161600480360360408110156101f957600080fd5b506001600160a01b0381351690602001356103d5565b61017d6004803603602081101561022557600080fd5b50356001600160a01b0316610411565b6100c061042c565b6101616004803603604081101561025357600080fd5b506001600160a01b03813516906020013561048d565b6101616004803603604081101561027f57600080fd5b506001600160a01b0381351690602001356104c9565b61017d600480360360408110156102ab57600080fd5b506001600160a01b03813581169160200135166104d6565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561034f5780601f106103245761010080835404028352916020019161034f565b820191906000526020600020905b81548152906001019060200180831161033257829003601f168201915b5050505050905090565b6000610366338484610501565b50600192915050565b60025490565b60006103828484846105ed565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546103c29186916103bd908663ffffffff61072f16565b610501565b5060019392505050565b60055460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103669185906103bd908663ffffffff61078c16565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561034f5780601f106103245761010080835404028352916020019161034f565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103669185906103bd908663ffffffff61072f16565b60006103663384846105ed565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166105465760405162461bcd60e51b81526004018080602001828103825260248152602001806108566024913960400191505060405180910390fd5b6001600160a01b03821661058b5760405162461bcd60e51b815260040180806020018281038252602281526020018061080f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106325760405162461bcd60e51b81526004018080602001828103825260258152602001806108316025913960400191505060405180910390fd5b6001600160a01b0382166106775760405162461bcd60e51b81526004018080602001828103825260238152602001806107ec6023913960400191505060405180910390fd5b6001600160a01b0383166000908152602081905260409020546106a0908263ffffffff61072f16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546106d5908263ffffffff61078c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610786576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000828201838110156107e4576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26474726f6e58205ad8bd992125d73612e695872f74ea2d6951c0410b7633d79c611eec48000cf864736f6c63430005120031", - "name": "Token", - "origin_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW", - "abi": { - "entrys": [ - { - "stateMutability": "Nonpayable", - "type": "Constructor" - }, - { - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "Event" - }, - { - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "Event" - }, - { - "outputs": [ - { - "type": "uint256" - } - ], - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - }, - { - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "approve", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "type": "uint256" - } - ], - "constant": true, - "inputs": [ - { - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "uint8" - } - ], - "constant": true, - "name": "decimals", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "type": "string" - } - ], - "constant": true, - "name": "name", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "string" - } - ], - "constant": true, - "name": "symbol", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "uint256" - } - ], - "constant": true, - "name": "totalSupply", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "sender", - "type": "address" - }, - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "stateMutability": "Nonpayable", - "type": "Function" - } - ] - }, - "origin_energy_limit": 10000000, - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "code_hash": "5933c5f6804befa730c18e6bf1b14393d9e062b466c2a772f81a6bfa932a8d46" -} -``` - -*** diff --git a/v1.0/RPC Nodes/others/rpc-tron/getcontractinfo.md b/v1.0/RPC Nodes/others/rpc-tron/getcontractinfo.md deleted file mode 100644 index 661d1311..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getcontractinfo.md +++ /dev/null @@ -1,327 +0,0 @@ ---- -title: "getcontractinfo" -slug: "rpc-tron-getcontractinfo" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getContractInfo('TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs', { -visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getContractInfo` method allows you to query a contract's information from the blockchain. This interface returns not only the bytecode but also the runtime bytecode of the contract. Unlike bytecode, runtime bytecode does not contain constructor and constructor parameter information. - -{% embed url="https://codepen.io/tatum-devrel/pen/eYQoXOM" %} - -### Parameters - -* `value`: (string) The contract address, converted to a hex string. -* `options` (optional): Additional options for the transaction. - * `visible`: (boolean, optional) Whether the address is in visible format (base58check) or hex. - -### Return Object - -The `getContractInfo` method returns an object containing the following fields: - -* `runtimecode`: (String) The contract's runtime code. -* `smart_contract`: (SmartContract) A smart contract object. - * `origin_address` (string): Contract creator address. - * `contract_address` (string): Contract address. - * `abi` (ABI): ABI of the contract. - * `bytecode` (string): Bytecode of the contract. - * `call_value` (integer): The amount of TRX passed into the contract when deploying the contract. - * `consume_user_resource_percent` (integer): Proportion of user energy consumption. - * `name` (string): Contract name. - * `origin_energy_limit` (integer): Each transaction is allowed to consume the maximum energy of the contract creator, the unit is sun. - * `code_hash` (string): Code hash of the contract. -* `contract_state`: (ContractState) The contract's state, which includes: - * `contract_state.energy_usage`: (Integer) The total amount of basic energy usage of the contract in the current maintenance cycle. - * `contract_state.energy_factor`: (Integer) The contract's energy factor. - * `contract_state.update_cycle`: (Integer) The current maintenance cycle number. - -### HTTP Request Example - -```json -{ - "value": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "runtimecode": "608060405234801561001057600080fd5b50d3801561001d57600080fd5b50d2801561002a57600080fd5b50600436106100b35760003560e01c806306fdde03146100b8578063095ea7b31461013557806318160ddd1461017557806323b872dd1461018f578063313ce567146101c557806339509351146101e357806370a082311461020f57806395d89b4114610235578063a457c2d71461023d578063a9059cbb14610269578063dd62ed3e14610295575b600080fd5b6100c06102c3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fa5781810151838201526020016100e2565b50505050905090810190601f1680156101275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101616004803603604081101561014b57600080fd5b506001600160a01b038135169060200135610359565b604080519115158252519081900360200190f35b61017d61036f565b60408051918252519081900360200190f35b610161600480360360608110156101a557600080fd5b506001600160a01b03813581169160208101359091169060400135610375565b6101cd6103cc565b6040805160ff9092168252519081900360200190f35b610161600480360360408110156101f957600080fd5b506001600160a01b0381351690602001356103d5565b61017d6004803603602081101561022557600080fd5b50356001600160a01b0316610411565b6100c061042c565b6101616004803603604081101561025357600080fd5b506001600160a01b03813516906020013561048d565b6101616004803603604081101561027f57600080fd5b506001600160a01b0381351690602001356104c9565b61017d600480360360408110156102ab57600080fd5b506001600160a01b03813581169160200135166104d6565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561034f5780601f106103245761010080835404028352916020019161034f565b820191906000526020600020905b81548152906001019060200180831161033257829003601f168201915b5050505050905090565b6000610366338484610501565b50600192915050565b60025490565b60006103828484846105ed565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546103c29186916103bd908663ffffffff61072f16565b610501565b5060019392505050565b60055460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103669185906103bd908663ffffffff61078c16565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561034f5780601f106103245761010080835404028352916020019161034f565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103669185906103bd908663ffffffff61072f16565b60006103663384846105ed565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166105465760405162461bcd60e51b81526004018080602001828103825260248152602001806108566024913960400191505060405180910390fd5b6001600160a01b03821661058b5760405162461bcd60e51b815260040180806020018281038252602281526020018061080f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106325760405162461bcd60e51b81526004018080602001828103825260258152602001806108316025913960400191505060405180910390fd5b6001600160a01b0382166106775760405162461bcd60e51b81526004018080602001828103825260238152602001806107ec6023913960400191505060405180910390fd5b6001600160a01b0383166000908152602081905260409020546106a0908263ffffffff61072f16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546106d5908263ffffffff61078c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610786576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000828201838110156107e4576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26474726f6e58205ad8bd992125d73612e695872f74ea2d6951c0410b7633d79c611eec48000cf864736f6c63430005120031", - "smart_contract": { - "bytecode": "608060405234801561001057600080fd5b50d3801561001d57600080fd5b50d2801561002a57600080fd5b50604080518082018252600b81526a2a32ba3432b92a37b5b2b760a91b6020808301918252835180850190945260048452631554d11560e21b90840152815191929160069161007c9160039190610236565b508151610090906004906020850190610236565b506005805460ff191660ff92909216919091179055506100cc9050336100b46100d1565b60ff16600a0a6402540be400026100db60201b60201c565b6102ce565b60055460ff165b90565b6001600160a01b038216610136576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61014f816002546101d560201b61078c1790919060201c565b6002556001600160a01b0382166000908152602081815260409091205461017f91839061078c6101d5821b17901c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60008282018381101561022f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061027757805160ff19168380011785556102a4565b828001600101855582156102a4579182015b828111156102a4578251825591602001919060010190610289565b506102b09291506102b4565b5090565b6100d891905b808211156102b057600081556001016102ba565b6108ad806102dd6000396000f3fe608060405234801561001057600080fd5b50d3801561001d57600080fd5b50d2801561002a57600080fd5b50600436106100b35760003560e01c806306fdde03146100b8578063095ea7b31461013557806318160ddd1461017557806323b872dd1461018f578063313ce567146101c557806339509351146101e357806370a082311461020f57806395d89b4114610235578063a457c2d71461023d578063a9059cbb14610269578063dd62ed3e14610295575b600080fd5b6100c06102c3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fa5781810151838201526020016100e2565b50505050905090810190601f1680156101275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101616004803603604081101561014b57600080fd5b506001600160a01b038135169060200135610359565b604080519115158252519081900360200190f35b61017d61036f565b60408051918252519081900360200190f35b610161600480360360608110156101a557600080fd5b506001600160a01b03813581169160208101359091169060400135610375565b6101cd6103cc565b6040805160ff9092168252519081900360200190f35b610161600480360360408110156101f957600080fd5b506001600160a01b0381351690602001356103d5565b61017d6004803603602081101561022557600080fd5b50356001600160a01b0316610411565b6100c061042c565b6101616004803603604081101561025357600080fd5b506001600160a01b03813516906020013561048d565b6101616004803603604081101561027f57600080fd5b506001600160a01b0381351690602001356104c9565b61017d600480360360408110156102ab57600080fd5b506001600160a01b03813581169160200135166104d6565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561034f5780601f106103245761010080835404028352916020019161034f565b820191906000526020600020905b81548152906001019060200180831161033257829003601f168201915b5050505050905090565b6000610366338484610501565b50600192915050565b60025490565b60006103828484846105ed565b6001600160a01b0384166000908152600160209081526040808320338085529252909120546103c29186916103bd908663ffffffff61072f16565b610501565b5060019392505050565b60055460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103669185906103bd908663ffffffff61078c16565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561034f5780601f106103245761010080835404028352916020019161034f565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103669185906103bd908663ffffffff61072f16565b60006103663384846105ed565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166105465760405162461bcd60e51b81526004018080602001828103825260248152602001806108566024913960400191505060405180910390fd5b6001600160a01b03821661058b5760405162461bcd60e51b815260040180806020018281038252602281526020018061080f6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166106325760405162461bcd60e51b81526004018080602001828103825260258152602001806108316025913960400191505060405180910390fd5b6001600160a01b0382166106775760405162461bcd60e51b81526004018080602001828103825260238152602001806107ec6023913960400191505060405180910390fd5b6001600160a01b0383166000908152602081905260409020546106a0908263ffffffff61072f16565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546106d5908263ffffffff61078c16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610786576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000828201838110156107e4576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26474726f6e58205ad8bd992125d73612e695872f74ea2d6951c0410b7633d79c611eec48000cf864736f6c63430005120031", - "name": "Token", - "origin_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW", - "abi": { - "entrys": [ - { - "stateMutability": "Nonpayable", - "type": "Constructor" - }, - { - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "Event" - }, - { - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "Event" - }, - { - "outputs": [ - { - "type": "uint256" - } - ], - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - }, - { - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "approve", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "type": "uint256" - } - ], - "constant": true, - "inputs": [ - { - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "uint8" - } - ], - "constant": true, - "name": "decimals", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "type": "string" - } - ], - "constant": true, - "name": "name", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "string" - } - ], - "constant": true, - "name": "symbol", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "uint256" - } - ], - "constant": true, - "name": "totalSupply", - "stateMutability": "View", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "stateMutability": "Nonpayable", - "type": "Function" - }, - { - "outputs": [ - { - "type": "bool" - } - ], - "inputs": [ - { - "name": "sender", - "type": "address" - }, - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "stateMutability": "Nonpayable", - "type": "Function" - } - ] - }, - "origin_energy_limit": 10000000, - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "code_hash": "5933c5f6804befa730c18e6bf1b14393d9e062b466c2a772f81a6bfa932a8d46" - }, - "contract_state": { - "update_cycle": 146215 - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresource.md b/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresource.md deleted file mode 100644 index ca46e23c..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresource.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "getdelegatedresource" -slug: "rpc-tron-getdelegatedresource" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, VisibleOption } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getDelegatedResource('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', 'TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getDelegatedResource` method retrieves all resources delegations during the stake1.0 phase from one account to another. It is useful when you need to assess the resources that an address delegates to a target address. The `fromAddress` parameter can be retrieved from the GetDelegatedResourceAccountIndex API. - -{% embed url="https://codepen.io/tatum-devrel/pen/ZEmZwRJ" %} - -### Parameters - -* `fromAddress` (string, required): The energy from address. Default is hexString. -* `toAddress` (string, required): The target address for the energy delegation information. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Defaults to false. Whether addresses are in base58 format. - -### Return Object - -The return object is a list of `DelegatedResource` objects. Each `DelegatedResource` object contains: - -* `from` (string): Delegate account -* `to` (string): Resource receiving account -* `frozen_balance_for_bandwidth` (integer): Bandwidth delegate share -* `frozen_balance_for_energy` (integer): Energy delegate share -* `expire_time_for_bandwidth` (integer): Deadline of this delegate bandwidth's lock period -* `expire_time_for_energy` (integer): Deadline of this delegate energy's lock period - -### HTTP Request Example - -```json -{ - "fromAddress": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "toAddress": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "visible": true -} -``` - -### HTTP Response Example - -```json -[ - { - "from": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "to": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "frozen_balance_for_bandwidth": 2000, - "frozen_balance_for_energy": 3000, - "expire_time_for_bandwidth": 1672448400000, - "expire_time_for_energy": 1675040400000 - } -] -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourceaccountindex.md b/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourceaccountindex.md deleted file mode 100644 index ae0fb1f8..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourceaccountindex.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: "getdelegatedresourceaccountindex" -slug: "rpc-tron-getdelegatedresourceaccountindex" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getDelegatedResourceAccountIndex('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -`getDelegatedResourceAccountIndex` is a method provided by TRON RPC allowing you to query the resource delegation by an account during stake1.0 phase. Essentially, this allows you to list all addresses that have delegated resources to a specific account. - -{% embed url="https://codepen.io/tatum-devrel/pen/vYQMbrM" %} - -### Parameters - -* `value` (string): Address, default hexString. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional) - Whether the address is in base58 format. - -### Return Object - -* `account` (string) - account address. -* `fromAccounts` (string\[]) - A list of account addresses which delegate resource to this account. -* `toAccounts` (string\[]) - A list of account addresses which receive resources delegated by this account. - -### HTTP Request Example - -```json -{ - "value": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "account": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" -} -``` - -Please note that the addresses in `fromAccounts` and `toAccounts` will vary based on the resources delegated to and from the account. diff --git a/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourceaccountindexv2.md b/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourceaccountindexv2.md deleted file mode 100644 index 0d7d62aa..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourceaccountindexv2.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: "getdelegatedresourceaccountindexv2" -slug: "rpc-tron-getdelegatedresourceaccountindexv2" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -## TRON RPC Method: getDelegatedResourceAccountIndexV2 - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const result = await tatum.rpc.getDelegatedResourceAccountIndexV2('TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1', { -visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -`getDelegatedResourceAccountIndexV2` is an RPC method provided by TRON's API. It is used in the context of TRON's Stake2.0 system to query the resource delegation index by an account. It returns two lists: one is the list of addresses the account has delegated its resources to (`toAccounts`), and the other is the list of addresses that have delegated resources to the account (`fromAccounts`). - -Some potential use cases include: - -1. Checking the status of resource delegations for a specific account. -2. Understanding the delegation relationships of an account. - -{% embed url="https://codepen.io/tatum-devrel/pen/poQBGxe" %} - -### Parameters - -* `value:` (string): The account address. By default, it is in hexString format. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Optional parameter to specify whether the address is in base58 format. - -### Return Object - -The returned object includes the following fields: - -* `account` - The account address. -* `fromAccounts` - The list of addresses that have delegated resources to the account. -* `toAccounts` - The list of addresses the account has delegated its resources to. - -### HTTP Request Example - -```json -{ - "value": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "account": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourcev2.md b/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourcev2.md deleted file mode 100644 index f115a44c..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourcev2.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: "getdelegatedresourcev2" -slug: "rpc-tron-getdelegatedresourcev2" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const result = await tatum.rpc.getDelegatedResourceV2('fromAddress', 'toAddress', { -visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -`getDelegatedResourceV2` is an RPC method provided by TRON's API. In the context of TRON's Stake2.0 system, it is used to query detailed information about the resource share delegated from one address to another. - -Some potential use cases might include: - -1. Checking the status of resource sharing between addresses. -2. Assessing the delegation history between two addresses. - -{% embed url="https://codepen.io/tatum-devrel/pen/vYQMbzM" %} - -### Parameters - -* `fromAddress` (string): - The address from which resources are delegated. By default, it is in hexString format. -* `toAddress` (string): - The address to which resources are delegated. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Optional parameter to specify whether the address is in base58 format. - -### Return Object - -The returned object includes a `delegatedResource` list. Each item in the list includes the following fields: - -* `from` (string): The owner's address. -* `to` (string): The recipient's address. -* `frozen_balance_for_bandwidth` (integer): The amount of TRX staked for bandwidth delegated from the `from` address to the `to` address. -* `frozen_balance_for_energy` (integer): The amount of TRX staked for energy delegated from the `from` address to the `to` address. -* `expire_time_for_bandwidth` (integer): The lock-up period deadline for bandwidth delegation. If no lock is specified when delegating resources, this field will not be displayed in the returned result and the value will be 0. -* `expire_time_for_energy` (integer): The lock-up period deadline for energy delegation. If no lock is specified when delegating resources, this field will not be displayed in the returned result and the value will be 0. - -### HTTP Request Example - -
{
-  "fromAddress": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
-  "toAddress": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1",
-  "visible": true
-}
-
- -### HTTP Response Example - -```json -[ - { - "from": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "to": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "frozen_balance_for_bandwidth": 1000, - "frozen_balance_for_energy": 1000, - "expire_time_for_bandwidth": 1597463006000, - "expire_time_for_energy": 1597463006000 - } -] -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getenergyprices.md b/v1.0/RPC Nodes/others/rpc-tron/getenergyprices.md deleted file mode 100644 index 50c7f5ef..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getenergyprices.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: "getenergyprices" -slug: "rpc-tron-getenergyprices" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum'; - -const tatum = await TatumSDK.init({network: Network.TRON}); - -const res = await tatum.rpc.getEnergyPrices(); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getEnergyPrices` method is used to query historical energy unit price on the TRON network. The energy unit price is the cost of performing operations on the TRON network, measured in "sun" units. The historical data can be useful in various situations like estimating future energy costs based on historical data or analysing network activity over time. - -{% embed url="https://codepen.io/tatum-devrel/pen/KKrYJLm" %} - -### Parameters - -This method does not require any parameters. - -### Return Object - -* `prices` - string: All historical energy unit price information. Each unit price change is separated by a comma. Before the colon is the millisecond timestamp, and after the colon is the energy unit price in sun. - -### HTTP Request Example - -```bash -{} -``` - -### HTTP Response Example - -```json -{ - "prices": "1614227200000:15,1614313600000:20,1614400000000:25" -} -``` - -In this example response, three price changes are listed: on the timestamp `1614227200000`, the price was `15` sun; on `1614313600000`, the price changed to `20` sun; and on `1614400000000`, the price was `25` sun. diff --git a/v1.0/RPC Nodes/others/rpc-tron/getnodeinfo.md b/v1.0/RPC Nodes/others/rpc-tron/getnodeinfo.md deleted file mode 100644 index 30b6933d..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getnodeinfo.md +++ /dev/null @@ -1,293 +0,0 @@ ---- -title: "getnodeinfo" -slug: "rpc-tron-getnodeinfo" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const nodeInfo = await tatum.rpc.getNodeInfo() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getNodeInfo` method is used to query information about the current state of the TRON node. This includes details about the latest block information, the number of active and passive connections, the total TCP flow, and other vital node details. This information is critical for monitoring the health and status of the TRON network. - -{% embed url="https://codepen.io/tatum-devrel/pen/qBQwgwQ" %} - -### Parameters - -This method doesn't require any parameters. - -### Return Object - -* `beginSyncNum` (integer): The begin sync block number. -* `block` (string): The latest block information, including block height and block id. -* `solidityBlock` (string): The latest solidified block information, including block height and block id. -* `currentConnectCount` (integer): The current connect count. -* `activeConnectCount` (integer): Active node connection count. -* `passiveConnectCount` (integer): Passive node connection count. -* `totalFlow` (integer): Total TCP flow. -* `peerInfoList` (PeerInfo\[]): Peer node information. -* `configNodeInfo` (ConfigNodeInfo): Node configuration information. -* `machineInfo` (MachineInfo): The information of the machine where the node is located. -* `cheatWitnessInfoMap` (map\): SR information that may be suspected of cheating. - -### HTTP Request Example - -```curl -{} -``` - -### HTTP Response Example - -```json -{ - "activeConnectCount": 2, - "beginSyncNum": 33868394, - "block": "Num:33868413,ID:000000000204ca7d21eec047b7bd9659e633f27eabe7133aa8ae1f35c7800835", - "cheatWitnessInfoMap": {}, - "configNodeInfo": { - "activeNodeSize": 2, - "allowAdaptiveEnergy": 1, - "allowCreationOfContracts": 1, - "backupListenPort": 10001, - "backupMemberSize": 0, - "backupPriority": 6, - "codeVersion": "4.7.1.1", - "dbVersion": 2, - "discoverEnable": true, - "listenPort": 16666, - "maxConnectCount": 30, - "maxTimeRatio": 5, - "minParticipationRate": 0, - "minTimeRatio": 0, - "p2pVersion": "1", - "passiveNodeSize": 2, - "sameIpMaxConnectCount": 2, - "sendNodeSize": 3, - "supportConstant": true, - "versionNum": "17686" - }, - "currentConnectCount": 5, - "machineInfo": { - "cpuCount": 4, - "cpuRate": 0.012658227848101266, - "deadLockThreadCount": 0, - "deadLockThreadInfoList": [], - "freeMemory": 391487488, - "javaVersion": "1.8.0_291", - "jvmFreeMemory": 11439582784, - "jvmTotalMemory": 12850036736, - "memoryDescInfoList": [ - { - "initSize": 2555904, - "maxSize": 268435456, - "name": "Code Cache", - "useRate": 0.2647867202758789, - "useSize": 71078144 - }, - { - "initSize": 0, - "maxSize": -1, - "name": "Metaspace", - "useRate": 0.9261336443443698, - "useSize": 78023544 - }, - { - "initSize": 0, - "maxSize": 1073741824, - "name": "Compressed Class Space", - "useRate": 0.007893860340118408, - "useSize": 8475968 - }, - { - "initSize": 68222976, - "maxSize": 279183360, - "name": "Par Eden Space", - "useRate": 0.13357790378337736, - "useSize": 37292728 - }, - { - "initSize": 8519680, - "maxSize": 34865152, - "name": "Par Survivor Space", - "useRate": 0.16272110329534775, - "useSize": 5673296 - }, - { - "initSize": 170590208, - "maxSize": 12535988224, - "name": "CMS Old Gen", - "useRate": 0.10908497228658533, - "useSize": 1367487928 - } - ], - "osName": "Linux 3.10.0-1160.49.1.el7.x86_64", - "processCpuRate": 0.012658227848101266, - "threadCount": 185, - "totalMemory": 16260251648 - }, - "passiveConnectCount": 3, - "peerList": [ - { - "active": true, - "avgLatency": 0, - "blockInPorcSize": 0, - "connectTime": 1681960376733, - "disconnectTimes": 0, - "headBlockTimeWeBothHave": 0, - "headBlockWeBothHave": "Num:33868390,ID:000000000204ca664c3e79e480b435591d53e0bcd7d8697a0b11e51ece052e84", - "host": "/54.186.12.211", - "inFlow": 0, - "lastBlockUpdateTime": 1684738920033, - "lastSyncBlock": "", - "localDisconnectReason": "", - "needSyncFromPeer": false, - "needSyncFromUs": false, - "nodeCount": 4, - "nodeId": "2e278e5e01e48a4da86d0ee547447917cbf08433fdb438e22cf0f2362d09ee33412a7f035e53931efed83f22e72b705044384db2a09e59885310574d06b33f8d", - "port": 16666, - "remainNum": 0, - "remoteDisconnectReason": "", - "score": 0, - "syncBlockRequestedSize": 0, - "syncFlag": false, - "syncToFetchSize": 0, - "syncToFetchSizePeekNum": -1, - "unFetchSynNum": 0 - }, - { - "active": true, - "avgLatency": 0, - "blockInPorcSize": 0, - "connectTime": 1681960358724, - "disconnectTimes": 0, - "headBlockTimeWeBothHave": 0, - "headBlockWeBothHave": "Num:33824159,ID:0000000002041d9f47331f314d2e124dde87180cae606f005d8c26023a1c2e21", - "host": "/54.69.254.172", - "inFlow": 0, - "lastBlockUpdateTime": 1684588047076, - "lastSyncBlock": "Num:33217176,ID:0000000001fada9882d944c94f79b01305e0bfdc43536fc9530eecc16ae1ac49", - "localDisconnectReason": "", - "needSyncFromPeer": false, - "needSyncFromUs": false, - "nodeCount": 4, - "nodeId": "2e278e5e01e48a4da86d0ee547447917cbf08433fdb438e22cf0f2362d09ee33412a7f035e53931efed83f22e72b705044384db2a09e59885310574d06b33f8d", - "port": 16666, - "remainNum": 0, - "remoteDisconnectReason": "", - "score": 0, - "syncBlockRequestedSize": 0, - "syncFlag": false, - "syncToFetchSize": 0, - "syncToFetchSizePeekNum": -1, - "unFetchSynNum": 0 - }, - { - "active": false, - "avgLatency": 0, - "blockInPorcSize": 0, - "connectTime": 1682772783216, - "disconnectTimes": 0, - "headBlockTimeWeBothHave": 0, - "headBlockWeBothHave": "Num:33868413,ID:000000000204ca7d21eec047b7bd9659e633f27eabe7133aa8ae1f35c7800835", - "host": "/54.69.105.245", - "inFlow": 0, - "lastBlockUpdateTime": 1684738998026, - "lastSyncBlock": "Num:33524301,ID:0000000001ff8a4dd686ace89310555cacfdaa929ea24de2bff34369fce82a64", - "localDisconnectReason": "", - "needSyncFromPeer": false, - "needSyncFromUs": false, - "nodeCount": 4, - "nodeId": "2e278e5e01e48a4da86d0ee547447917cbf08433fdb438e22cf0f2362d09ee33412a7f035e53931efed83f22e72b705044384db2a09e59885310574d06b33f8d", - "port": 16666, - "remainNum": 0, - "remoteDisconnectReason": "", - "score": 0, - "syncBlockRequestedSize": 0, - "syncFlag": false, - "syncToFetchSize": 0, - "syncToFetchSizePeekNum": -1, - "unFetchSynNum": 0 - }, - { - "active": false, - "avgLatency": 71, - "blockInPorcSize": 0, - "connectTime": 1681961633946, - "disconnectTimes": 0, - "headBlockTimeWeBothHave": 0, - "headBlockWeBothHave": "Num:33868413,ID:000000000204ca7d21eec047b7bd9659e633f27eabe7133aa8ae1f35c7800835", - "host": "/47.90.207.227", - "inFlow": 0, - "lastBlockUpdateTime": 1684738998108, - "lastSyncBlock": "Num:33156658,ID:0000000001f9ee326f10e9b927216b5459579e57b781b9f6702a4d76e205ef7b", - "localDisconnectReason": "", - "needSyncFromPeer": false, - "needSyncFromUs": false, - "nodeCount": 4, - "nodeId": "2e278e5e01e48a4da86d0ee547447917cbf08433fdb438e22cf0f2362d09ee33412a7f035e53931efed83f22e72b705044384db2a09e59885310574d06b33f8d", - "port": 16666, - "remainNum": 0, - "remoteDisconnectReason": "", - "score": 0, - "syncBlockRequestedSize": 0, - "syncFlag": false, - "syncToFetchSize": 0, - "syncToFetchSizePeekNum": -1, - "unFetchSynNum": 0 - }, - { - "active": false, - "avgLatency": 75, - "blockInPorcSize": 0, - "connectTime": 1682398959068, - "disconnectTimes": 1, - "headBlockTimeWeBothHave": 0, - "headBlockWeBothHave": "Num:33868050,ID:000000000204c91264aedf926cd8f53e9d67ec2e1ccf6d0da98fbf3ab12ed27f", - "host": "/47.89.186.34", - "inFlow": 0, - "lastBlockUpdateTime": 1684737768295, - "lastSyncBlock": "", - "localDisconnectReason": "", - "needSyncFromPeer": false, - "needSyncFromUs": false, - "nodeCount": 4, - "nodeId": "2e278e5e01e48a4da86d0ee547447917cbf08433fdb438e22cf0f2362d09ee33412a7f035e53931efed83f22e72b705044384db2a09e59885310574d06b33f8d", - "port": 16666, - "remainNum": 0, - "remoteDisconnectReason": "TIME_OUT", - "score": 0, - "syncBlockRequestedSize": 0, - "syncFlag": false, - "syncToFetchSize": 0, - "syncToFetchSizePeekNum": -1, - "unFetchSynNum": 0 - } - ], - "solidityBlock": "Num:33868395,ID:000000000204ca6bce66b0a2b5694dffbb37eb2ff3f83040457f4c88115c0ee3", - "totalFlow": 0 -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getnowblock.md b/v1.0/RPC Nodes/others/rpc-tron/getnowblock.md deleted file mode 100644 index a7bd30a0..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getnowblock.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -title: "getnowblock" -slug: "rpc-tron-getnowblock" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum'; - -const tatum = await TatumSDK.init({ network: Network.TRON }); - -const res = await tatum.rpc.getNowBlock(); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getNowBlock()` method is used to query the latest block information on the TRON network. It interacts with the TRON RPC to fetch the data, making it a crucial function for applications needing real-time information about the TRON blockchain. Examples of such applications include blockchain explorers, cryptocurrency wallets, or decentralised applications. - -{% embed url="https://codepen.io/tatum-devrel/pen/GRwLzzK" %} - -### Parameters - -This method doesn't require any parameters. - -### Return Object - -* `blockID` (string): The block hash. -* `block_header` (object) - * `raw_data` (object) - * `timestamp` (integer): The timestamp of the block. - * `txTrieRoot` (string): The root of the transaction merkle tree. - * `parentHash` (string): The parent block hash. - * `number` (integer): The block number. - * `witness_id` (integer): The witness id. - * `witness_address` (string): The witness address. - * `version` (integer): The version. - * `accountStateRoot` (string): The root of the account state tree. - * `witness_signature` (string): The signature of the Super Representative (SR). -* `transactions` (Array): Contains transaction information in the block. - * `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). - * `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. - * `raw_data.data` - Transaction memo. - * `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. - * `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. - * `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. - * `txID` - transaction id - -### HTTP Request Example - -```bash -{} -``` - -### HTTP Response Example - -The HTTP response for the `getNowBlock()` function is a JSON object representing the latest block data. The exact fields can vary due to the dynamic nature of the blockchain data. Here is an example of how the HTTP response could look like: - -```json -{ - "blockID": "000000000203c44fb29c8b78d653607e5b7c210a9b415c0daa1f84f00c8fa9af", - "block_header": { - "raw_data": { - "number": 33801295, - "txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "witness_address": "41977f82c69011cf4a7db6f7339edcded85c614d45", - "parentHash": "000000000203c44e82ebe5332248e40efa68a5243458dc398628b1ce05db0d36", - "version": 27, - "timestamp": 1684510050000 - }, - "witness_signature": "05cd4c14889dc39a0465fc6c769fb6c39f986c90cfe0ef8cbf4be6402f7b25b613b97c4c7ee2e411b908d53658752102a7292a4965002609a50e075f171c151e01" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/getpaginatedassetissuelist.md b/v1.0/RPC Nodes/others/rpc-tron/getpaginatedassetissuelist.md deleted file mode 100644 index ab84f14e..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/getpaginatedassetissuelist.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: "getpaginatedassetissuelist" -slug: "rpc-tron-getpaginatedassetissuelist" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -Use the Tatum SDK to access the TRON network as follows: - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.getPaginatedAssetIssueList(0, 20) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -* `assetIssue`: (array) - * `id`: (integer) token ID - * `owner_address`: (string) issuer address - * `name`: (string) token name - * `abbr`: (string) token abbreviation - * `total_supply`: (integer) total supply - * `frozen_supply`: (Array) The number of tokens to be frozen is specified by the issuer of the token when it is issued - * `trx_num`: (integer) Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN) - * `precision`: (integer) precision - * `num`: (integer) Define the price by the ratio of trx\_num/num(The unit of 'trx\_num' is SUN) - * `start_time`: (integer) ICO start time - * `end_time`: (integer) ICO end time - * `description`: (string) token description - * `url`: (string) Token official website url, default hexString - * `free_asset_net_limit`: (integer) Token free asset net limit - * `public_free_asset_net_limit`: (integer) Token public free asset net limit for a account - * `public_free_asset_net_usage`: (integer) The total number of token free bandwidth used by all token owner - * `public_latest_free_net_time`: (integer) The timestamp of the last consumption of this token's free bandwidth - -{% embed url="https://codepen.io/tatum-devrel/pen/abQxXea" %} - -### Parameters - -1. `offset` (integer) - The index of the start token. This parameter allows you to specify the starting point in the list of tokens. -2. `limit` (integer) - The amount of tokens per page. This parameter allows you to limit the number of tokens returned in a single request. - -### Return Object - -This method returns a promise that resolves to an array of `AssetIssueCapsule` objects. Each `AssetIssueCapsule` object represents a TRC10 token and includes detailed fields as described in the `GetAssetIssueByAccount` method. - -### HTTP Request Example - -A typical HTTP request using this method looks like this: - -```json -{ - "offset": 0, - "limit": 20 -} -``` - -### HTTP Response Example - -```json -{ - "assetIssue": [ - { - "owner_address": "41f3642e1824d654fed5e71f850fd82d24ed8545ed", - "name": "2e6874616363657373", - "abbr": "74657374", - "total_supply": 1000000000, - "trx_num": 1, - "precision": 6, - "num": 1, - "start_time": 1629878133455, - "end_time": 1629978123454, - "description": "74657374", - "url": "68747470733a2f2f73757065726d61747269782e696f", - "id": "1000942" - }, - { - "owner_address": "411fafb1e96dfe4f609e2259bfaf8c77b60c535b93", - "name": "303734363537333734", - "abbr": "36353738363136643730366336353631363236323732", - "total_supply": 100000000, - "frozen_supply": [ - { - "frozen_amount": 1, - "frozen_days": 2 - } - ], - "trx_num": 1, - "num": 1, - "start_time": 1576684800000, - "end_time": 1576728000000, - "description": "3635373836313664373036633635323036343635373336333732363937303734363936663665", - "url": "373737373737326536353738363136643730366336353265363336663664", - "free_asset_net_limit": 10000, - "public_free_asset_net_limit": 10000, - "id": "1000030" - }, - { - "owner_address": "414f10065476e61054dad85d1c9a32cf429a6bc8cd", - "name": "3077426974636f696e", - "abbr": "57425443", - "total_supply": 100000000000000, - "trx_num": 6000000, - "precision": 4, - "num": 10000, - "start_time": 1609023600000, - "end_time": 1609110000000, - "description": "426974636f696e20546f6b656e", - "url": "68747470733a2f2f7368617374612e74726f6e7363616e2e6f72672f232f", - "id": "1000507" - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/gettransactionbyid.md b/v1.0/RPC Nodes/others/rpc-tron/gettransactionbyid.md deleted file mode 100644 index 44444784..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/gettransactionbyid.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: "gettransactionbyid" -slug: "rpc-tron-gettransactionbyid" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to Use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const transaction = await tatum.rpc.getTransactionById('7c2d4206c03a883dd9066d620335dc1be272a8dc733cfa3f6d10308faa37facc', { -visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getTransactionById` method is used to query transaction information using a transaction ID on the TRON network. This can be beneficial in several use cases, such as retrieving details about a specific transaction, verifying the transaction status, and checking the transaction content. - -{% embed url="https://codepen.io/tatum-devrel/pen/wvQZNOG" %} - -### Parameters - -* `value` (string): ID of the transaction to be queried. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Whether the address is in base58 format. - -### Return Object - -The method returns a Promise resolving to a Transaction object containing: - - - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -### HTTP Request Example - -```json -{ - "value": "0x94eea63bb6774c1565a5a5adc37cc8b73bb5292c63f7829231e195314d338b98", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "ret": [ - { - "contractRet": "SUCCESS" - } - ], - "signature": [ - "90f1b82fecfef333afc338d243bfd7e6506fc400f5cbb74034d2eff58ba04d520b5d12ab34f8dfd4d29e999ca1f86184670df41e0aa6131b38e52289acb6499000" - ], - "txID": "7c2d4206c03a883dd9066d620335dc1be272a8dc733cfa3f6d10308faa37facc", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "amount": 2000000, - "owner_address": "TMmYhZ5XyjWwkPSLizzMoqyQLVrwqDdH5Y", - "to_address": "TEouV6gdGqZvFDde6dDKHBJgbVFV2NW48T" - }, - "type_url": "type.googleapis.com/protocol.TransferContract" - }, - "type": "TransferContract" - } - ], - "ref_block_bytes": "b663", - "ref_block_hash": "fb1feb948ee9fff2", - "expiration": 1681403964000, - "fee_limit": 500000, - "timestamp": 1681368025716 - }, - "raw_data_hex": "0a02b6632208fb1feb948ee9fff240e0d4f1dbf7305a67080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541816cf60987aa124eed29db9a057e476861b8d8dc1215413516435fb1e706c51efff614c7e14ce2625f28e51880897a70f494e0caf7309001a0c21e" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/gettransactioninfobyblocknum.md b/v1.0/RPC Nodes/others/rpc-tron/gettransactioninfobyblocknum.md deleted file mode 100644 index a22cf762..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/gettransactioninfobyblocknum.md +++ /dev/null @@ -1,352 +0,0 @@ ---- -title: "gettransactioninfobyblocknum" -slug: "rpc-tron-gettransactioninfobyblocknum" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -You can use the `getTransactionInfoByBlockNum` method with Tatum SDK by following the below example: - -
// yarn add @tatumio/tatum
-
-import { TatumSDK, Tron, Network } from '@@tatumio/tatum'
-
-const tatum = await TatumSDK.init({network: Network.TRON})
-
-const transactionInfo = await tatum.rpc.getTransactionInfoByBlockNum(1000000)
-
-await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
-
- -Replace `1000000` with the actual block height that you want to get information about. - -### Overview - -The `getTransactionInfoByBlockNum` method allows you to query the TransactionInfo data of all transactions contained in the block of a specified height. This can be particularly useful when you need to track the status of all transactions within a particular block or analyse the transactions for auditing purposes. - -{% embed url="https://codepen.io/tatum-devrel/pen/dyQLarr" %} - -### Parameters - -The `getTransactionInfoByBlockNum` method requires the following parameter: - -* `num`: The block height you want to get transaction information about. It should be an integer. - -### Return Object - -Array of: - -* `id`: The transaction ID (string) -* `fee`: The total number of TRX burned in this transaction, represented as an integer. -* `blockNumber`: The block number (integer) -* `blockTimeStamp`: The block timestamp, in milliseconds (integer) -* `contractResult`: Transaction execution results (string array) -* `contract_address`: Contract address (string) -* `receipt`: Transaction receipt, including transaction execution result and transaction fee details. It contains the following fields: - * `energy_usage`: The amount of energy consumed in the caller's account - * `energy_fee`: The amount of TRX burned to pay for energy - * `origin_energy_usage`: The amount of energy consumed in the contract deployer's account - * `energy_usage_total`: The total amount of energy consumed by the transaction - * `net_usage`: The amount of bandwidth consumed - * `net_fee`: The amount of TRX burned to pay for the bandwidth - * `result`: Transaction execution result - * `energy_penalty_total`: The amount of extra energy that needs to be paid for calling a few popular contracts -* `log`: The log of events triggered during the smart contract call. -* `result`: Execution results. If the execution is successful, the field will not be displayed in the returned value, if the execution fails, the field will be "FAILED" -* `resMessage`: When the transaction execution fails, the details of the failure will be returned through this field. Hex format, you can convert it to a string to get plaintext information. -* `withdraw_amount`: For the withdrawal reward transaction, unfreeze transaction, they will withdraw the vote reward to account. The number of rewards withdrawn to the account is returned through this field, and the unit is sun. -* `unfreeze_amount`: In the Stake1.0 stage, for unstaking transactions, this field returns the amount of unstaked TRX, the unit is sun. -* `internal_transactions`: Internal transaction -* `withdraw_expire_amount`: In the Stake2.0 stage, for unstaking transactions and withdrawing unfrozen balance transactions, this field returns the amount of unfrozen TRX withdrawn to the account in this transaction, the unit is sun. - -### HTTP Request Example - -```json -{ - "num": 1000000 -} -``` - -### HTTP Response Example - -```json -[ - { - "log": [ - { - "address": "7090190c41ba59f763e2cbe7d885e007e94be5d2", - "data": "000000000000000000000000000000000000000000000000000000051f5e04fa0000000000000000000000000000000000000000000000000000000004a9681c0000000000000000000000000000000000000000000000000000000004a8fe4001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000", - "topics": [ - "baca790fd027b9b7f36b90c3084718a3a039693cdf83844342f5f1edc839c3af" - ] - } - ], - "blockNumber": 1000000, - "contractResult": [ - "" - ], - "blockTimeStamp": 1578594852000, - "receipt": { - "result": "SUCCESS", - "energy_usage": 124980, - "energy_usage_total": 124980, - "net_usage": 668 - }, - "id": "7faabd22623eb53467d34b2a417262f6df75433566c104b6c6eec5a227090df6", - "contract_address": "417090190c41ba59f763e2cbe7d885e007e94be5d2" - }, - { - "log": [ - { - "address": "8d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "data": "0000000000000000000000000000000000000000000000000000000001c890cf00000000000000000000000000000000000000000000000000000000000000150000000000000000000000000000000000000000000000000000000000000002", - "topics": [ - "50b0fde04a05002ee4ba3c03973059b7d8af741148bf53ff213e39d2867a7930", - "000000000000000000000000ed2f4270fa5a7cae1efd4706ae27a4335406921e" - ] - }, - { - "address": "8d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "data": "0000000000000000000000000000000000000000000000000000000001cef96f", - "topics": [ - "6a965f98da6f13a2ccafa10fd99074eb59617607c5c8153ceded5713e33c2cc1" - ] - }, - { - "address": "8d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "data": "000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000d59f800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000290000000000000000000000000000000000000000000000000000000000000000", - "topics": [ - "df1b2fae932fd98400d3d19f3d68900102b199899050d106565310ffd640c594", - "000000000000000000000000ed2f4270fa5a7cae1efd4706ae27a4335406921e" - ] - } - ], - "fee": 433850, - "blockNumber": 1000000, - "contractResult": [ - "0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001500000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000001cef96f00000000000000000000000000000000000000000000000000000000000000290000000000000000000000000000000000000000000000000000000000000000" - ], - "blockTimeStamp": 1578594852000, - "receipt": { - "result": "SUCCESS", - "energy_fee": 433850, - "energy_usage_total": 43385, - "net_usage": 384 - }, - "id": "98d0f4149bf8023a9df4d2b754f6c728a5b6d021c4497c6cd5452b97f01b0548", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "internal_transactions": [ - { - "caller_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "note": "63616c6c", - "transferTo_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "callValueInfo": [ - {} - ], - "hash": "ef89ade61942aa3371a3f006e6406fd4758ef648ee38c04f70a57b296668d3ed" - }, - { - "caller_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "note": "63616c6c", - "transferTo_address": "413a5bfb715d2086ec513b64e98531e2f58154c44c", - "callValueInfo": [ - { - "callValue": 700000 - } - ], - "hash": "a630ff6999c4762637d5cecf109c55e225064bd11afcbb1ae301fbaa21cf3a78" - } - ] - }, - { - "log": [ - { - "address": "79c23a5666042e40420d6afdc1541e3926205eba", - "data": "000000000000000000000000000000000000000000000000000000051f5e04fa", - "topics": [ - "678ae61fcbde3426947a5076f2541a6705fa78577e819a420c826e9c722ff792" - ] - } - ], - "blockNumber": 1000000, - "contractResult": [ - "" - ], - "blockTimeStamp": 1578594852000, - "receipt": { - "result": "SUCCESS", - "energy_usage": 28643, - "energy_usage_total": 28643, - "net_usage": 346 - }, - "id": "17e7321320bb08c40f027cbcca320152c2396c77a910f387849a944ee8aa0cb1", - "contract_address": "4179c23a5666042e40420d6afdc1541e3926205eba", - "internal_transactions": [ - { - "caller_address": "4179c23a5666042e40420d6afdc1541e3926205eba", - "note": "63616c6c", - "transferTo_address": "4179c23a5666042e40420d6afdc1541e3926205eba", - "callValueInfo": [ - {} - ], - "hash": "60b85ea10861cd2352f34de84fe72792fa9f02165f215f4432a54b152a30eb8e" - } - ] - }, - { - "log": [ - { - "address": "8d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "data": "0000000000000000000000000000000000000000000000000000000001cef96f00000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000001", - "topics": [ - "50b0fde04a05002ee4ba3c03973059b7d8af741148bf53ff213e39d2867a7930", - "000000000000000000000000f07e117a4b5f1fda66f8fcedf44065f1dafc5ad7" - ] - }, - { - "address": "8d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "data": "00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000007622eb8000000000000000000000000000000000000000000000000000000000a9aba44200000000000000000000000000000000000000000000000000000000000000440000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000001f0000000000000000000000000000000000000000000000000000000000000000", - "topics": [ - "df1b2fae932fd98400d3d19f3d68900102b199899050d106565310ffd640c594", - "000000000000000000000000f07e117a4b5f1fda66f8fcedf44065f1dafc5ad7" - ] - } - ], - "fee": 376380, - "blockNumber": 1000000, - "contractResult": [ - "0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000a9aba4420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000001cef96f000000000000000000000000000000000000000000000000000000000000001f0000000000000000000000000000000000000000000000000000000000000000" - ], - "blockTimeStamp": 1578594852000, - "receipt": { - "result": "SUCCESS", - "energy_fee": 376380, - "energy_usage_total": 37638, - "net_usage": 385 - }, - "id": "4ef51a5760bf98dc2dd752658f48db1445e8ca75f8a6efe14d5a462a15edd3f0", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "internal_transactions": [ - { - "caller_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "note": "63616c6c", - "transferTo_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "callValueInfo": [ - {} - ], - "hash": "ebd48b28e91e23a0f190b2ef898c6c89d0723759eb17ceb9203fcd6a4b0b313e" - }, - { - "caller_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "note": "63616c6c", - "transferTo_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "callValueInfo": [ - {} - ], - "hash": "4369d49d09a1d17cbff6a3c69e3bcd081f4c1d10fc176cab53371908e03819f1" - }, - { - "caller_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "note": "63616c6c", - "transferTo_address": "41f07e117a4b5f1fda66f8fcedf44065f1dafc5ad7", - "callValueInfo": [ - { - "callValue": 2457950000 - } - ], - "hash": "b31eeb5d614133be49ff5be526d8bd258583b478c5daad9713b68591141b5f10" - } - ] - }, - { - "log": [ - { - "address": "8d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "data": "0000000000000000000000000000000000000000000000000000000001cef96f000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000002", - "topics": [ - "50b0fde04a05002ee4ba3c03973059b7d8af741148bf53ff213e39d2867a7930", - "0000000000000000000000009ac63dd8e80daf0a786bf962860e2209b7fa5fb9" - ] - }, - { - "address": "8d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "data": "0000000000000000000000000000000000000000000000000000000001d4027f", - "topics": [ - "6a965f98da6f13a2ccafa10fd99074eb59617607c5c8153ceded5713e33c2cc1" - ] - }, - { - "address": "8d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "data": "000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000a7d8c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000", - "topics": [ - "df1b2fae932fd98400d3d19f3d68900102b199899050d106565310ffd640c594", - "0000000000000000000000009ac63dd8e80daf0a786bf962860e2209b7fa5fb9" - ] - } - ], - "fee": 433850, - "blockNumber": 1000000, - "contractResult": [ - "0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000001d4027f00000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000" - ], - "blockTimeStamp": 1578594852000, - "receipt": { - "result": "SUCCESS", - "energy_fee": 433850, - "energy_usage_total": 43385, - "net_usage": 384 - }, - "id": "80e07e3f2b92a0e9974b1398964e006288836dee82aa3a81e579a512e6581354", - "contract_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "internal_transactions": [ - { - "caller_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "note": "63616c6c", - "transferTo_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "callValueInfo": [ - {} - ], - "hash": "3e32e3a6ef17975e8d2ac842a520cef987bf9d93d7c2538857b06d1c792da36e" - }, - { - "caller_address": "418d9dd663cf90256fdf2faba2a1be71f8a0147f8c", - "note": "63616c6c", - "transferTo_address": "413a5bfb715d2086ec513b64e98531e2f58154c44c", - "callValueInfo": [ - { - "callValue": 550000 - } - ], - "hash": "bc9897f79e4eaa5f795626b853a29baacb132283f5d0e6f94c0462894683cf9b" - } - ] - }, - { - "fee": 3130, - "blockNumber": 1000000, - "contractResult": [ - "" - ], - "blockTimeStamp": 1578594852000, - "receipt": { - "result": "SUCCESS", - "net_fee": 3130, - "energy_usage": 328466, - "energy_usage_total": 328466 - }, - "id": "ba8e727c03d588619310d7a16a95fcfd31a516dbf8893ddd585e0bbd7e0deae4", - "contract_address": "41174e91a57d68f5ac1bc485d03a038fe745a3b89b" - } -] -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/gettransactioninfobyid.md b/v1.0/RPC Nodes/others/rpc-tron/gettransactioninfobyid.md deleted file mode 100644 index e2d07eac..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/gettransactioninfobyid.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: "gettransactioninfobyid" -slug: "rpc-tron-gettransactioninfobyid" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const transactionInfo = await tatum.rpc.getTransactionInfoById('7c2d4206c03a883dd9066d920335dc1be272a8dc733cfa3f6d10308faa37facc') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `getTransactionInfoById` method allows you to query the transaction fee, block height, and other related information by a transaction id. This can be particularly useful when you need to track the status of specific transactions or analyse the transactions for auditing purposes. - -{% embed url="https://codepen.io/tatum-devrel/pen/XWyQOGE" %} - -### Parameters - -* `value`: The transaction hash, or transaction ID, you want to get information about. It should be a string. - -### Return Object - -* `id`: The transaction ID (string) -* `fee`: The total number of TRX burned in this transaction, represented as an integer. -* `blockNumber`: The block number (integer) -* `blockTimeStamp`: The block timestamp, in milliseconds (integer) -* `contractResult`: Transaction execution results (string array) -* `contract_address`: Contract address (string) -* `receipt`: Transaction receipt, including transaction execution result and transaction fee details. It contains the following fields: - * `energy_usage`: The amount of energy consumed in the caller's account - * `energy_fee`: The amount of TRX burned to pay for energy - * `origin_energy_usage`: The amount of energy consumed in the contract deployer's account - * `energy_usage_total`: The total amount of energy consumed by the transaction - * `net_usage`: The amount of bandwidth consumed - * `net_fee`: The amount of TRX burned to pay for the bandwidth - * `result`: Transaction execution result - * `energy_penalty_total`: The amount of extra energy that needs to be paid for calling a few popular contracts -* `log`: The log of events triggered during the smart contract call. -* `result`: Execution results. If the execution is successful, the field will not be displayed in the returned value, if the execution fails, the field will be "FAILED" -* `resMessage`: When the transaction execution fails, the details of the failure will be returned through this field. Hex format, you can convert it to a string to get plaintext information. -* `withdraw_amount`: For the withdrawal reward transaction, unfreeze transaction, they will withdraw the vote reward to account. The number of rewards withdrawn to the account is returned through this field, and the unit is sun. -* `unfreeze_amount`: In the Stake1.0 stage, for unstaking transactions, this field returns the amount of unstaked TRX, the unit is sun. -* `internal_transactions`: Internal transaction -* `withdraw_expire_amount`: In the Stake2.0 stage, for unstaking transactions and withdrawing unfrozen balance transactions, this field returns the amount of unfrozen TRX withdrawn to the account in this transaction, the unit is sun. - -### HTTP Request Example - -```json -{ - "value": "0x94eea63bb6774c1565a5a5adc37cc8b73bb5292c63f7829231e195314d338b98", -} -``` - -### HTTP Response Example - -```json -{ - "id": "7c2d4206c03a883dd9066d620335dc1be272a8dc733cfa3f6d10308faa37facc", - "fee": 1100000, - "blockNumber": 32880248, - "blockTimeStamp": 1681368027000, - "contractResult": [ - "" - ], - "receipt": { - "net_fee": 100000 - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/listnodes.md b/v1.0/RPC Nodes/others/rpc-tron/listnodes.md deleted file mode 100644 index 30c45acb..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/listnodes.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: "listnodes" -slug: "rpc-tron-listnodes" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to Use It - -You can interact with the TRON blockchain by using the `listNodes` method in the Tatum SDK. Here's an example: - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// Import necessary components from the SDK -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({ network: Network.TRON }) - -// Use the RPC method -const nodeList = await tatum.rpc.listNodes() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `listNodes` method is an RPC method provided by the TRON blockchain. It returns a list of nodes connected to the TRON network, including their host addresses and ports. This information can be used for various purposes, such as network analysis, node performance assessment, or setting up a new node connection. - -{% embed url="https://codepen.io/tatum-devrel/pen/WNYWPWo" %} - -### Parameters - -The `listNodes` method does not accept any parameters. - -### Return Object - -* `nodes` (array) - * `address` (object) - * `host` (string): The host address of the node. - * `port` (integer): The port number of the node. - -### HTTP Request Example - -```bash -{} -``` - -### HTTP Response Example - -```json -{ - "nodes": [ - { - "address": { - "host": "34372e38392e3138362e3334", - "port": 16666 - } - }, - { - "address": { - "host": "35322e31312e34322e3439", - "port": 16666 - } - }, - { - "address": { - "host": "34372e39302e3230372e323237", - "port": 16666 - } - }, - { - "address": { - "host": "34372e39302e3230362e313439", - "port": 16666 - } - } - ] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/participateassetissue.md b/v1.0/RPC Nodes/others/rpc-tron/participateassetissue.md deleted file mode 100644 index be071d18..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/participateassetissue.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: "participateassetissue" -slug: "rpc-tron-participateassetissue" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use It - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.participateAssetIssue( - 'TPswDDCAWhJAZG5nEf8TkNToDX1', - 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', - '1000001031303030303031', - 100000, - { - visible: true, - } -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `participateAssetIssue` method allows an account to participate in a token issuance on the TRON blockchain. This participation involves purchasing the issued tokens with TRX, the native currency of TRON. The method returns an unsigned transaction object which contains the details of the ParticipateAssetIssueContract. - -### Parameters - -* `toAddress` (string): The issuer's address. -* `ownerAddress` (string): The account address participating in the token issuance. -* `assetName` (string): The token ID. -* `amount` (integer): The amount of TRX used to purchase the issued token. The unit is in sun. -* `options` (object, optional): Additional options, which include: - * `visible` (boolean, optional): Specifies whether the address is in base58 format. - -### Return Object - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `ParticipateAssetIssueContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` - Account address participating in the token issuance. (Type: string) -* `to_address` - The issuer's address. (Type: string) -* `asset_name` - Token ID. (Type: string) -* `amount` - The amount of TRX used to purchase the issued token. Unit is in sun. (Type: integer - -### HTTP Request Example - -```json -{ - "to_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "asset_name": "1000001031303030303031", - "amount": 100000, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "1789f68952b601243e09fc851eeed547cc1c9e16b0fc2cb6bf219aa07a1a8a9c", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "start_time": 2684752341111, - "trx_num": 1, - "frozen_supply": [ - { - "frozen_amount": 1, - "frozen_days": 2 - } - ], - "total_supply": 100, - "num": 1, - "name": "asdfasdfadsf", - "end_time": 2684752345111, - "description": "0x4578616d706c654465736372697074696f6e", - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "abbr": "asdfsdf", - "url": "0x7777772e6578616d706c652e636f6d" - }, - "type_url": "type.googleapis.com/protocol.ParticipateAssetIssueContract" - }, - "type": "ParticipateAssetIssueContract" - } - ], - "ref_block_bytes": "e206", - "ref_block_hash": "034cf77f0ad4956a", - "expiration": 1684759677000, - "timestamp": 1684759617932 - }, - "raw_data_hex": "0a02e2062208034cf77f0ad4956a40c890829c84315acd01080612c8010a2f747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e41737365744973737565436f6e74726163741294010a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e120c6173646661736466616473661a076173646673646620642a04080110023001400148f7d0d6bd914e5097f0d6bd914ea201263078343537383631366437303663363534343635373336333732363937303734363936663665aa01203078373737373737326536353738363136643730366336353265363336663664708cc3fe9b8431" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/transferasset.md b/v1.0/RPC Nodes/others/rpc-tron/transferasset.md deleted file mode 100644 index e60681c0..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/transferasset.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: "transferasset" -slug: "rpc-tron-transferasset" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, TransferAssetIssueByAccountOptions } from '@tatumio/tatum' -import { BigNumber } from 'bignumber.js'; - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const options: TransferAssetIssueByAccountOptions = { - // optional parameters -}; - -const ownerAddress = "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g"; -const toAddress = "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1"; -const assetName = "31303030303031"; -const amount = new BigNumber(1); - -const res = await tatum.rpc.transferAsset(ownerAddress, toAddress, assetName, amount, options); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `transferAsset` method is used to transfer TRC10 tokens from one address to another on the TRON network. This could be used in a variety of situations, such as transferring tokens to a user's account after they've made a purchase, or redistributing tokens between accounts as part of a dApp's internal logic. - -### Parameters - -* `ownerAddress` (string) - The account address from which the tokens are transferred. -* `toAddress` (string) - The target address to receive the transferred tokens. -* `assetName` (string) - The token ID to transfer. -* `amount` (BigNumber) - The amount of token to transfer. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean) - Whether the address is in base58 format. - * `extraData` (string) - Notes on the transaction, HEX format. - -### Return Object - -`transaction` (`TransferContract`): - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `TransferAssetContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): Transaction initiator's address. -* `asset_name` (string): The token id to transfer -* `to_address` (string): The target address to transfer -* `amount` (integer): The amount of token to transfer. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "to_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "asset_name": "31303030303031", - "amount": 1, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "094d59ae6c22cb6f206f4b263eec54a1dbfc1d1704d0c43a31d90b8b66ee4fbb", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "amount": 1000, - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "to_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "asset_name: "62747474657374" - }, - "type_url": "type.googleapis.com/protocol.TransferContract" - }, - "type": "TransferContract" - } - ], - "ref_block_bytes": "ab93", - "ref_block_hash": "88c6e64972349f0f", - "expiration": 1684488576000, - "timestamp": 1684488517323 - }, - "raw_data_hex": "0a02ab93220888c6e64972349f0f4080b8df9a83315a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e12154198927ffb9f554dc4a453c64b2e553a02d6df514b18e80770cbeddb9a8331" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/triggerconstantcontract.md b/v1.0/RPC Nodes/others/rpc-tron/triggerconstantcontract.md deleted file mode 100644 index c3675cb5..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/triggerconstantcontract.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -title: "triggerconstantcontract" -slug: "rpc-tron-triggerconstantcontract" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.triggerConstantContract( - 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', - 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs', - 'balanceOf(address)', - '000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c', - { - visible: true, - } -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `triggerConstantContract` method is used to interact with smart contracts on the TRON blockchain. It allows you to invoke either readonly (view or pure) or non-readonly functions of a contract for contract data queries or estimating energy consumption. Notably, this operation does not generate an on-chain transaction and does not change the status of the current node. - -### Parameters - -* `ownerAddress` (string): The owner's address that triggers the contract. Use base58check format if visible=true, otherwise use hex format. -* `contractAddress` (string): The smart contract address. Use base58check format if visible=true, otherwise use hex format. -* `functionSelector` (string): The function call; must not be left blank. -* `parameter` (string): The parameter encoding must be in accordance with the ABI rules. -* `options` (object, optional): Optional settings for the contract trigger, including: - * `callValue` (integer, optional): The amount of TRX transferred to the contract with this transaction, in sun. This field may be used when estimating energy consumption. - * `visible` (boolean, optional): Optional. Whether the address is in base58 format. - -### Return Object - -* `result` - * `result` - When error ocuurs, this is empty, otherwise true. - * `code` - Error code. - * `message -` Error message. -* `energy_used` (integer): The estimated energy consumption. -* `constant_result` (array of strings): The result list of triggered functions. -* `transaction`: Transaction information. For details, refer to GetTransactionByID. - * `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). - * `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. - * `raw_data.data` - Transaction memo. - * `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. - * `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. - * `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. - * `txID` - transaction id - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "function_selector": "balanceOf(address)", - "parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "result": { - "result": true - }, - "energy_used": 541, - "constant_result": [ - "00000000000000000000000000000000000000000000000000000000000186a0" - ], - "transaction": { - "ret": [ - {} - ], - "visible": true, - "txID": "342791a4015feba921cea6e7c3e3d5ba4d1ede50f3508a686e643709b14abce2", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "70a08231000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c", - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "e80d", - "ref_block_hash": "7547cc93d09e65de", - "expiration": 1684764945000, - "timestamp": 1684764885358 - }, - "raw_data_hex": "0a02e80d22087547cc93d09e65de40e8d4c39e84315a8e01081f1289010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412540a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e12154142a1e39aefa49290f2b3f9ed688d7cecf86cd6e0222470a08231000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c70ee82c09e8431" - } -} -``` - diff --git a/v1.0/RPC Nodes/others/rpc-tron/triggersmartcontract.md b/v1.0/RPC Nodes/others/rpc-tron/triggersmartcontract.md deleted file mode 100644 index 02013de8..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/triggersmartcontract.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -title: "triggersmartcontract" -slug: "rpc-tron-triggersmartcontract" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to Use It - -Here is an example of how you can use the `triggerSmartContract` method with the Tatum SDK. - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const options = { - feeLimit: 1000000000, - callValue: 0, -} - -const result = await tatum.rpc.triggerSmartContract( - 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', - 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs', - 'transfer(address,uint256)', - '00000000000000000000004115208EF33A926919ED270E2FA61367B2DA3753DA0000000000000000000000000000000000000000000000000000000000000032', - options -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `triggerSmartContract` method is used to call a smart contract function on the TRON network. The function parameters are encoded according to the ABI rules and the method returns an unsigned transaction, ready to be signed and broadcasted to the network. This method can be used for interacting with deployed smart contracts and triggering their functions. - -### Parameters - -* `ownerAddress`(string): Account address triggering the contract, converted to a hex string. -* `contractAddress`(string): Smart contract address, converted to a hex string. -* `functionSelector`(string): Function call from the smart contract. Must not be left blank. -* `parameter`(string): Function parameters, encoded according to the ABI rules. -* `options`: (object, optional): Additional options for the contract triggering. - * `feeLimit`(integer, optional): Maximum TRX consumption, measured in SUN (1 TRX = 1,000,000 SUN). - * `callValue`(integer, optional): Amount of TRX transferred with this transaction, measured in SUN. - * `permission_id`(integer, optional): For multi-signature. - * `visible`(boolean, optional): Whether the address is in base58check format. - -### Return Object - -* `result` - * `result` - When error ocuurs, this is empty, otherwise true. - * `code` - Error code. - * `message -` Error message. -* `transaction` - * `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). - * `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. - * `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. - * `raw_data.data` - Transaction memo. - * `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. - * `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. - * `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. - * `txID` - transaction id - -Since the transaction type is `TriggerSmartContract`, the fields contained in `transaction.raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address`: string. Account address. -* `contract_address`: string. Contract address. -* `call_value`: integer. The amount of TRX passed into the contract. -* `data`: string. Operating parameters. -* `call_token_value`: integer. The amount of TRC-10 transferred into the contract. -* `token_id`: integer. TRC-10 token id. - -### HTTP Request Example - -Here is an example of an HTTP request to trigger a smart contract: - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "function_selector": "transfer(address,uint256)", - "parameter": "00000000000000000000004115208EF33A926919ED270E2FA61367B2DA3753DA0000000000000000000000000000000000000000000000000000000000000032", - "fee_limit": 1000000000, - "call_value": 0, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "result": { - "result": true - }, - "transaction": { - "visible": true, - "txID": "27318af0aca1e748919c9f28a40c66776d468d06ec936cad1f56130df7704db7", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "data": "a9059cbb00000000000000000000004115208ef33a926919ed270e2fa61367b2da3753da0000000000000000000000000000000000000000000000000000000000000032", - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs" - }, - "type_url": "type.googleapis.com/protocol.TriggerSmartContract" - }, - "type": "TriggerSmartContract" - } - ], - "ref_block_bytes": "e70f", - "ref_block_hash": "bde2c956cedbf2ae", - "expiration": 1684764078000, - "fee_limit": 1000000000, - "timestamp": 1684764019325 - }, - "raw_data_hex": "0a02e70f2208bde2c956cedbf2ae40b0df8e9e84315aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e12154142a1e39aefa49290f2b3f9ed688d7cecf86cd6e02244a9059cbb00000000000000000000004115208ef33a926919ed270e2fa61367b2da3753da000000000000000000000000000000000000000000000000000000000000003270fd948b9e843190018094ebdc03" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/txpool_content.md b/v1.0/RPC Nodes/others/rpc-tron/txpool_content.md deleted file mode 100644 index fcf525f6..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/txpool_content.md +++ /dev/null @@ -1,144 +0,0 @@ ---- -title: "txpool_content" -slug: "rpc-tron-txpool_content" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const content = await tatum.rpc.txPoolContent() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `txpool_content` method provides information about the transactions currently pending in the transaction pool of the Flare node. It can be helpful for developers and node operators to monitor and manage the transaction pool, especially in scenarios where it's necessary to analyze transaction congestion or prioritize specific transactions. - -Use cases for the `txpool_content` method include: - -* Analyzing network congestion by inspecting the transaction pool -* Prioritizing transactions by gas price -* Monitoring transactions from specific addresses -* Debugging and troubleshooting pending transactions - -### Parameters - -This method does not require any parameters. - -### Return Object - -The `txpool_content` method returns an object with two fields: `pending` and `queued`. Each field contains a nested object with addresses as keys and their respective transactions as values. - -* **`pending`**: An object containing transactions that are currently pending for inclusion in the next block(s). -* **`queued`**: An object containing transactions that are currently queued (i.e., transactions that do not meet certain criteria for inclusion in the next block, like low gas price or nonce gaps). - -Each transaction object includes the following information: - -* **`hash`**: The hash of the transaction (32 bytes). -* **`nonce`**: The number of transactions sent by the sender prior to this one (integer). -* **`blockHash`**: The hash of the block in which the transaction was included (32 bytes), or `null` if the transaction is not yet mined. -* **`blockNumber`**: The block number in which the transaction was included (integer), or `null` if the transaction is not yet mined. -* **`transactionIndex`**: The index of the transaction in the block (integer), or `null` if the transaction is not yet mined. -* **`from`**: The address of the sender (20 bytes). -* **`to`**: The address of the receiver (20 bytes), or `null` for contract creation transactions. -* **`value`**: The value transferred in the transaction, in wei. -* **`gasPrice`**: The price of gas for the transaction, in wei. -* **`maxFeePerGas`** - The maximum fee per gas set in the transaction. -* **`maxPriorityFeePerGas`** - The maximum priority gas fee set in the transaction. -* **`gas`**: The maximum amount of gas the transaction is allowed to consume. -* **`input`**: The data payload of the transaction (string), or `0x` for simple value transfers. - -### JSON-RPC Request Example - -```json -jsonCopy code{ - "id": 1, - "jsonrpc": "2.0", - "method": "txpool_content", - "params": [] -} -``` - -### JSON-RPC Response Example - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "pending": { - "0x01d3B93AaADE8A4066DAaBc8fd8482173A6aD120": { - "197": { - "blockHash": null, - "blockNumber": null, - "from": "0x01d3b93aaade8a4066daabc8fd8482173a6ad120", - "gas": "0x1c9c380", - "gasPrice": "0x16cf917", - "maxFeePerGas": "0x16cf917", - "maxPriorityFeePerGas": "0x16cf917", - "hash": "0x1da9c2a8f0787bac4747c5ed1035e81f6a6745aeea43943e63635fc367b817f7", - "input": "0x00000000", - "nonce": "0xc5", - "to": "0x4f023eb8c6bc3116e35b67e03bf2c17f2e4f7e7e", - "transactionIndex": null, - "value": "0x0", - "type": "0x2", - "accessList": [], - "chainId": "0xaa36a7", - "v": "0x1", - "r": "0x14f7578b57fd9f87acf5bbceb0a47f2d2d3f39b49169357457618c9634c45e8a", - "s": "0x775fa9976c571751a79f069f8c96f6489f286246e157a31fa99b33062631b46d" - } - } - }, - "queued": { - "0x03321406635a04D37Cf9211F2ea3AFc83a87e777": { - "5096281": { - "blockHash": null, - "blockNumber": null, - "from": "0x03321406635a04d37cf9211f2ea3afc83a87e777", - "gas": "0x5208", - "gasPrice": "0xc570bd200", - "hash": "0x05f5fb8e46793fafdc924917c0afdd0afb4a53cb562542d5399234bc1eff759b", - "input": "0x", - "nonce": "0x4dc359", - "to": "0x77b1c86ab0aa9066803ed567e1f00973976638f6", - "transactionIndex": null, - "value": "0xb1a2b96602aa20", - "type": "0x0", - "chainId": "0xaa36a7", - "v": "0x1546d72", - "r": "0x62bd220b95ec13827c0d9b643b9beaf6f4c66d4a8ef08bb10f93d5e5c7ae0068", - "s": "0x467f76847cfdf43a002defe054030c1a88a9e6f56539c051c3cba46b2dd2cc89" - } - } - } - } -``` - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/txpool_inspect.md b/v1.0/RPC Nodes/others/rpc-tron/txpool_inspect.md deleted file mode 100644 index 97f81b99..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/txpool_inspect.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: "txpool_inspect" -slug: "rpc-tron-txpool_inspect" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const inspect = await tatum.rpc.txPoolInspect() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `txpool_inspect` method is a JSON-RPC method used to inspect the current transaction pool of a running node. The method allows you to view all pending transactions and their details, including transaction hashes, gas prices, and transaction data. This method is useful for developers who want to monitor the status of pending transactions or debug transaction-related issues. - -### Parameters - -The `txpool_inspect` method takes one optional parameter: - -* **`include`**: A string specifying the type of transactions to include in the response. Possible values are **`pending`** (default) and **`queued`**. - -### Return Object - -The `txpool_inspect` method returns an object with the following fields: - -* **`pending`**: An array of transaction objects, with textual data -* **`queued`**: An array of transaction objects, with textual data - -## Example Request: - -```json -{ - "jsonrpc": "2.0", - "method": "txpool_inspect", - "params": [ - "pending" - ], - "id": 1 -} -``` - -## Example Response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "pending": { - "0x01d3B93AaADE8A4066DAaBc8fd8482173A6aD120": { - "197": "0x4f023eB8C6BC3116E35B67E03bf2C17f2e4f7e7e: 0 wei + 30000000 gas × 23918871 wei" - } - }, - "queued": { - "0x03321406635a04D37Cf9211F2ea3AFc83a87e777": { - "5096281": "0x77b1C86Ab0aa9066803eD567e1F00973976638F6: 49999988041886240 wei + 21000 gas × 53000000000 wei", - "8308536": "0x77b1C86Ab0aa9066803eD567e1F00973976638F6: 100000000000000000 wei + 21000 gas × 53000000000 wei", - "231211221": "0x77b1C86Ab0aa9066803eD567e1F00973976638F6: 1000000000000000 wei + 21000 gas × 11958113760 wei" - } - } - } -} -``` - -\ diff --git a/v1.0/RPC Nodes/others/rpc-tron/txpool_status.md b/v1.0/RPC Nodes/others/rpc-tron/txpool_status.md deleted file mode 100644 index 847d9d83..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/txpool_status.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: "txpool_status" -slug: "rpc-tron-txpool_status" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const status = await tatum.rpc.txPoolStatus() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -The `txpool_status` method returns statistics about the current state of the transaction pool. The transaction pool is a queue of pending transactions waiting to be included in the next block by miners. - -This method can be useful for monitoring the health of the network and analyzing the behavior of the miners. It can also be used to estimate the time it will take for a transaction to be processed, as well as to determine the gas price necessary to ensure prompt inclusion of a transaction in the next block. - -### Parameters - -This method does not take any parameters. - -### Return Object - -The `txpool_status` method returns an object with the following fields: - -* **`pending`**: Number of pending transactions in the pool -* **`queued`**: Number of queued transactions in the pool - -### Example Request - -```json -{ - "jsonrpc":"2.0", - "method":"txpool_status", - "params":[], - "id":1 -} -``` - -### Example Response - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "pending": 4, - "queued": 10 - } -} -``` - -In this example response, there are currently 4 pending transactions and 10 queued transactions waiting to be processed by miners. diff --git a/v1.0/RPC Nodes/others/rpc-tron/undelegateresource.md b/v1.0/RPC Nodes/others/rpc-tron/undelegateresource.md deleted file mode 100644 index bf048112..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/undelegateresource.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: "undelegateresource" -slug: "rpc-tron-undelegateresource" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -You can interact with the `unDelegateResource` method using the Tatum SDK. Here is an example on how you can do it: - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, BigNumber, TronStakeType, VisibleAndPermissionIdOptions } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.unDelegateResource('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', 'TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1', new BigNumber(1000000), TronStakeType.BANDWIDTH, true, { -visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `unDelegateResource` method allows for cancelling the delegation of bandwidth or energy resources to other accounts in Stake2.0 on the TRON blockchain. This could be useful in scenarios where the original owner needs to reclaim staked resources. - -### Parameters - -The `unDelegateResource` method accepts the following parameters: - -* `ownerAddress` (string): The account address of the owner. By default, it should be in the hexString format. -* `receiverAddress` (string): The address of the account that is receiving the resource. -* `balance` (integer): The amount of TRX staked for resources to be delegated. The unit is sun. Example: 1000000 -* `resource` (TronStakeType): The type of resource, can either be 'BANDWIDTH' or 'ENERGY' -* `lock` (boolean): This parameter signifies whether the resources should be locked or not. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): This parameter signifies whether the address is in base58 format. - * `permissionId` (integer, optional): This parameter is used for multi-signature purpose. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `UnDelegateResourceContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address`: The address of the account that delegated the resources. -* `resource`: The type of delegated resource. -* `receiver_address`: The address of the account that received the delegated resources. -* `balance`: The amount of TRX staked for resources that were delegated. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "receiver_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "balance": 1000000, - "resource": "BANDWIDTH", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "txID": "3d0a235547b08f9d5e1d465f6d7dc28da6436a8d9c3b768d1a989cac7e5c94cf", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "receiver_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "balance": 1000000, - "resource": "BANDWIDTH", - "lock": false, - }, - "type_url": "type.googleapis.com/protocol.UnDelegateResource" - }, - "type": "UnDelegateResource" - } - ], - "ref_block_bytes": "4a1b", - "ref_block_hash": "4dc3c8c4476d5d56", - "expiration": 1582208742000, - "timestamp": 1582208686873, - "fee_limit": 1000000000 - }, - "raw_data_hex": "0a024a1b22084dc3c8c4476d5d5640c8fcaf8d2d5a2e5a680801126a0a3074..." -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/unfreezeasset.md b/v1.0/RPC Nodes/others/rpc-tron/unfreezeasset.md deleted file mode 100644 index b2588feb..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/unfreezeasset.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: "unfreezeasset" -slug: "rpc-tron-unfreezeasset" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -
// yarn add @tatumio/tatum
-
-import { TatumSDK, Tron, Network } from '@tatumio/tatum'
-
-const tatum = await TatumSDK.init({network: Network.TRON})
-
-const res = await tatum.rpc.unfreezeAsset('TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1', {
-visible: true,
-})
-
-await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
-
- -### Overview - -The `unfreezeAsset` method allows the unstaking of a token that has passed the minimum freeze duration on the TRON blockchain. - -### Parameters - -This method accepts the following parameters: - -* `ownerAddress` (string): Account address. The address of the owner of the assets. This must be a hexString. -* `options` (optional): Additional options for the transaction. - * `permission_id` (integer, optional): This is optional and mainly used for multi-signature transactions. - * `visible` (boolean, optional): Indicates whether the address is in base58 format. This is also optional. Default value is true. - -### Return Object - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `UnfreezeAssetContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): Account address - -### HTTP Request Example - -```json -{ - "owner_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "094d59ae6c22cb6f206f4b263eec54a1dbfc1d1704d0c43a31d90b8b66ee4fbb", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" - }, - "type_url": "type.googleapis.com/protocol.UnfreezeAssetContract" - }, - "type": "UnfreezeAssetContract" - } - ], - "ref_block_bytes": "ab93", - "ref_block_hash": "88c6e64972349f0f", - "expiration": 1684488576000, - "timestamp": 1684488517323 - }, - "raw_data_hex": "0a02ab93220888c6e64972349f0f4080b8df9a83315a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e12154198927ffb9f554dc4a453c64b2e553a02d6df514b18e80770cbeddb9a8331" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/unfreezebalance.md b/v1.0/RPC Nodes/others/rpc-tron/unfreezebalance.md deleted file mode 100644 index 867492dd..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/unfreezebalance.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "unfreezebalance" -slug: "rpc-tron-unfreezebalance" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, TronStakeType, UnFreezeAccountOptions } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const ownerAddress = 'TZZyXU3pYgKkcc6RBVYHzY1JRLyPeN5BWy' - -const res = await tatum.rpc.unfreezeBalance(ownerAddress, TronStakeType.ENERGY, { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `unfreezeBalance` method is used to unstake previously staked TRX and release the obtained bandwidth or energy and TP. This operation will automatically cancel all votes. - -### Parameters - -* `owner_address` (string): The owner address (default in hexString format). -* `resource` (string): The type of TRX stake, either 'BANDWIDTH' or 'ENERGY'. -* `options` (object, optional): This optional parameter contains the following properties: - * `receiver_address` (string, optional): Optional parameter for the address that will lose the resource (default in hexString format). - * `permission_id` (integer, optional): For multi-signature use. - * `visible` (boolean, optional): Defaults to false. Whether addresses are in base58 format. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulentl -* `txID` - transaction id - -Since the transaction type is `UnfreezeBalanceContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address`: The owner address. -* `resource`: The type of TRX stake, either 'BANDWIDTH' or 'ENERGY'. -* `receiver_address`: The address that will lose the resource. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "resource": "BANDWIDTH", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": false, - "txID": "efb6ff6dba6e5998d7258a63436e4717428892f02df2adb6deea8550d36e5e34", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "resource": "BANDWIDTH", - "owner_address": "4100776428620856ae1d71562812b734e356b68551" - }, - "type_url": "type.googleapis.com/protocol.UnfreezeBalanceContract" - }, - "type": "UnfreezeBalanceContract" - } - ], - "ref_block_bytes": "3041", - "ref_block_hash": "3d1b89e6c7c34b52", - "expiration": 1649176881000, - "timestamp": 1649176821557 - }, - "raw_data_hex": "0a02304122083d1b89e6c7c34b5240e8cee8d4ff2f5a5a080b12560a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/unfreezebalancev2.md b/v1.0/RPC Nodes/others/rpc-tron/unfreezebalancev2.md deleted file mode 100644 index 825e3c1d..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/unfreezebalancev2.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: "unfreezebalancev2" -slug: "rpc-tron-unfreezebalancev2" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' -import { BigNumber } from 'bignumber.js' -import { TronStakeType } from '@tatumio/tatum/dist/src/blockchain' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.unfreezeBalanceV2( - 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', - new BigNumber(1000000), - TronStakeType.BANDWIDTH, - { visible: true } -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `unfreezeBalanceV2` method is used to unlock TRX staked at the Stake 2.0 stage. After unstaking, the user needs to wait for 14 days before they can withdraw the funds. The method also withdraws any unclaimed voting rewards to the account, and if previously unstaked funds have passed the lock-up period, it also withdraws them at the same time. The voting reward withdrawn and the amount of funds withdrawn can be queried through the `gettransactioninfobyid` API. - -### Parameters - -The `unfreezeBalanceV2` method accepts the following parameters: - -* `ownerAddress` (string): The account address -* `unfreeze_balance` (BigNumber): The amount of TRX to unstake, in sun -* `resource` (string): The resource type: 'BANDWIDTH' or 'ENERGY' -* `options` (object, optional): An object that can have the following properties: - * `visible` (boolean): Whether the address is in base58 format - * `permissionId` (integer): For multi-signature use, optional - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is UnFreezeBalanceV2Contract, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address`: The account address -* `resource`: The resource type -* `unfreeze_balance`: The unstake amount, unit is sun - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "unfreeze_balance": 1000000, - "resource": "BANDWIDTH", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "txID": "3d0a235547b08f9d5e1d465f6d7dc28da6436a8d9c3b768d1a989cac7e5c94cf", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "unfreeze_balance": 1000000, - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "resource": "BANDWIDTH" - }, - "type_url": "type.googleapis.com/protocol.UnfreezeBalanceContract" - }, - "type": "UnfreezeBalanceContract" - } - ], - "ref_block_bytes": "4a1b", - "ref_block_hash": "4dc3c8c4476d5d56", - "expiration": 1582208742000, - "timestamp": 1582208686873, - "fee_limit": 1000000000 - }, - "raw_data_hex": "0a024a1b22084dc3c8c4476d5d5640c8fcaf8d2d5a2e5a680801126a0a3074..." -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/updateaccount.md b/v1.0/RPC Nodes/others/rpc-tron/updateaccount.md deleted file mode 100644 index 191b3a16..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/updateaccount.md +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: "updateaccount" -slug: "rpc-tron-updateaccount" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, VisibleAndPermissionIdOptions } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.updateAccount('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', '0x7570646174654e616d6531353330383933343635353139', { - visible: true, - permissionId: 1 -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `updateAccount` method is used to modify the name of a TRON account. It's a powerful feature for personalizing and organizing accounts. After successfully updating, the response would be an unsigned transaction JSON object. The transaction type is `AccountUpdateContract`. - -### Parameters - -* `ownerAddress` (string): The account address to be modified. It should be converted to a hex string. -* `accountName` (string): The name of the account. It should be converted to a hex string. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Optional parameter to specify whether the address is in base58 format. - * `permissionId` (integer, optional): Optional parameter used for multi-signature accounts. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `AccountUpdateContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): The address of the transaction initiator. -* `account_name` (string): The account name. - -### HTTP Request Example - -```json -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "account_name": "0x7570646174654e616d6531353330383933343635353139", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "a00fd4a6fbb6dd42061b184cfd9bbbcd4faae5cf94c06dedb1c55c7b168c37cb", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "account_name": "0x7570646174654e616d6531353330383933343635353139", - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" - }, - "type_url": "type.googleapis.com/protocol.AccountUpdateContract" - }, - "type": "AccountUpdateContract" - } - ], - "ref_block_bytes": "ad91", - "ref_block_hash": "c7f32299fd0bae0e", - "expiration": 1684490307000, - "timestamp": 1684490248394 - }, - "raw_data_hex": "0a02ad912208c7f32299fd0bae0e40b88bc99b83315a8301080a127f0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e74557064617465436f6e747261637412490a30307837353730363436313734363534653631366436353331333533333330333833393333333433363335333533313339121541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e70cac1c59b8331" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/updateasset.md b/v1.0/RPC Nodes/others/rpc-tron/updateasset.md deleted file mode 100644 index 483eb95d..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/updateasset.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: "updateasset" -slug: "rpc-tron-updateasset" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to Use It - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.updateAsset('TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1', 'https://mytokenwebsite.com', { - description: 'My Token Description', - new_limit: 10000, - new_public_limit: 50000, - permission_id: 1, - visible: true -}); - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `updateAsset` method is used to update basic information about a TRC10 token on the TRON network. This method could be useful when the information of a TRC10 token needs to be updated, for instance, if the token's website URL changes or the bandwidth limits for the token are adjusted. - -### Parameters - -* `ownerAddress`(string): The issuer's address of the token in hexString format. -* `url`(string): The token's website url in hexString format. -* `options` (optional): An object containing additional parameters: - * `description`(string, optional): The description of the token in hexString format. - * `new_limit`(integer, optional): Each token holder's free bandwidth limit. - * `new_public_limit`(integer, optional): The total free bandwidth limit of the token. - * `permission_id`(integer, optional): Used for multi-signature purposes. - * `visible`(boolean, optional): A boolean value indicating whether the address is in base58 format. - -### Return Object - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `UpdateAssetContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address`: Account address -* `description`: Description -* `url`: Token's website Url -* `new_limit`: The limit of Bandwidth point which each caller can consume -* `new_public_limit`: The limit of Bandwidth point which all callers can consume - -### HTTP Request Example - -```json -{ - "owner_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "description": "My Token Description", - "url": "https://mytokenwebsite.com", - "new_limit": 10000, - "new_public_limit": 50000, - "permission_id": 1, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "transaction": { - "txID": "b5e7e6e7908d295feb3e91784c68ddd0640830a27c465a4e8ee4ad87e7aff263", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1", - "description": "My Token Description", - "url": "https://mytokenwebsite.com", - "new_limit": 10000, - "new_public_limit": 50000 - }, - "type_url": "type.googleapis.com/protocol.UpdateAssetContract" - }, - "type": "UpdateAssetContract" - } - ], - "ref_block_bytes": "09f6", - "ref_block_hash": "fec5e58087511d2a", - "expiration": 1570676090000, - "timestamp": 1570676035768 - }, - "raw_data_hex": "0a0209f62202..." - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/updateenergylimit.md b/v1.0/RPC Nodes/others/rpc-tron/updateenergylimit.md deleted file mode 100644 index bbcb3268..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/updateenergylimit.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: "updateenergylimit" -slug: "rpc-tron-updateenergylimit" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const res = await tatum.rpc.updateEnergyLimit('TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW', 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs', 100000000, { -visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -`updateEnergyLimit` is a TRON RPC method used to update the `origin_energy_limit` parameter of a smart contract. The `origin_energy_limit` is a required parameter for deploying new contracts with a value larger than 0. - -Use cases: - -* Deploying new smart contracts -* Updating the energy limit for existing smart contracts - -### Parameters - -* `ownerAddress` (string): Account address of the transaction creator, in hex string format. -* `contractAddress` (string): Address of the contract to be modified, in hex string format. -* `originEnergyLimit` (integer): The maximum energy set by the creator. This refers to the greatest amount of energy the creator consumes during contract execution or creation process. -* `options` (object, optional): Additional options. - * `visible` (boolean, optional): Specifies if the address is in base58 format. - * `permission_id` (integer, optional): Used for multi-signature. - -### Return Object - - - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `UpdateEnergyLimitContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): Account address. -* `contract_address` (string): Contract address. -* `origin_energy_limit` (string): Adjusted upper limit of energy provided by smart contract deployers in one transaction. - -### HTTP Request Example - -```json -{ - "owner_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "origin_energy_limit": 100000000, - "visible": true -} -``` - -### HTTP Response Example - -A successful response will return a `200` status code. - -```json -{ - "visible": true, - "txID": "158a188799ab507e9a4a5d673250c5e1b3ab3f8722ae9778be87c3087fc36453", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW", - "origin_energy_limit": 100000000, - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs" - }, - "type_url": "type.googleapis.com/protocol.UpdateEnergyLimitContract" - }, - "type": "UpdateEnergyLimitContract" - } - ], - "ref_block_bytes": "ee2f", - "ref_block_hash": "f408ae3f40e49e07", - "expiration": 1684770300000, - "timestamp": 1684770243112 - }, - "raw_data_hex": "0a02ee2f2208f408ae3f40e49e0740e0c08aa184315a71082d126d0a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e557064617465456e657267794c696d6974436f6e747261637412330a1541b3dcf27c251da9363f1a4888257c16676cf54edf12154142a1e39aefa49290f2b3f9ed688d7cecf86cd6e01880c2d72f70a88487a18431" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/updatesetting.md b/v1.0/RPC Nodes/others/rpc-tron/updatesetting.md deleted file mode 100644 index b0c3a21e..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/updatesetting.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: "updatesetting" -slug: "rpc-tron-updatesetting" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network, VisibleAndPermissionIdOptions } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.TRON}) - -const ownerAddress = 'TSNEe5Tf4rnc9zPMNXfaTFKHSANinZseWnPcX' -const contractAddress = 'TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs' -const consumeUserResourcePercent = 10 -const options: VisibleAndPermissionIdOptions = { - visible: true, -} - -const res = await tatum.rpc.updateSetting(ownerAddress, contractAddress, consumeUserResourcePercent, options) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `updateSetting` method is used to update the `consume_user_resource_percent` parameter of a smart contract on the TRON blockchain. This setting controls how much of a user's resource balance is consumed when they interact with the contract. - -### Parameters - -The following parameters are required for the `updateSetting` method: - -* `ownerAddress` (string): Account address. Transaction creator's address, in hex string format. -* `contractAddress` (string): Contract address. The address of the contract to be modified, in hex string format. -* `consumeUserResourcePercent` (integer): User Energy Proportion. Consume user's resource percentage. It should be an integer between \[0, 100]. if 0, means it does not consume user's resource until the developer's resource has been used up. -* `options` (optional): Additional options - * `visible` (boolean, optional): Whether the address is in base58 format. - * `permission_id` (integer, optional): For multi-signature use. - -### Return Object - -* `raw_data.contract` - The main content of the transaction,`contract` is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is `UpdateSettingContract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): Account address. -* `contract_address` (string): Contract address. -* `consume_user_resource_percent` (integer): User energy proportion. - -### HTTP Request Example - -```json -{ - "owner_address": "TSNEe5Tf4rnc9zPMNXfaTFKHSANinZseWnPcX", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "consume_user_resource_percent": 10, - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "visible": true, - "txID": "1bdf05c55b6034743aef2a02906b3a1bfd98832bf0dc35caa96ccf701de972a0", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "consume_user_resource_percent": 10, - "owner_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW", - "contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs" - }, - "type_url": "type.googleapis.com/protocol.UpdateSettingContract" - }, - "type": "UpdateSettingContract" - } - ], - "ref_block_bytes": "ea5d", - "ref_block_hash": "049f1eb82a28ee3d", - "expiration": 1684766970000, - "timestamp": 1684766911523 - }, - "raw_data_hex": "0a02ea5d2208049f1eb82a28ee3d4090a1bf9f84315a6a082112660a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e55706461746553657474696e67436f6e747261637412300a1541b3dcf27c251da9363f1a4888257c16676cf54edf12154142a1e39aefa49290f2b3f9ed688d7cecf86cd6e0180a70a3d8bb9f8431" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-tron/validateaddress.md b/v1.0/RPC Nodes/others/rpc-tron/validateaddress.md deleted file mode 100644 index baa479ea..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/validateaddress.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: "validateaddress" -slug: "rpc-tron-validateaddress" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -Below is an example of how to use the `validateAddress` method with the Tatum SDK: - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -// Call validateAddress RPC method -const res = await tatum.rpc.validateAddress('TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -The `validateAddress` method is used to validate the format of a given TRON blockchain address. It verifies if the address is in the correct format, i.e., base58checksum, hexString, or base64 format, and returns a result indicating whether the format is correct or not, along with a message specifying the address format type or an error message. - -### Try the call - -{% embed url="https://codepen.io/tatum-devrel/pen/zYMXepP" %} - -### Parameters - -This method accepts the following parameters: - -* `address` (string): This is a required parameter. The address should be in base58checksum, hexString, or base64 format. -* `visible` (boolean): Specifies the visibility of the address. It can be set to either true or false. (Optional) - -### Return Object - -This method returns an object with the following parameters: - -* `result` (boolean): Indicates whether the address format is correct. -* `message` (string): Provides the address format type or an error message if the format is incorrect. - -### HTTP Request Example - -```bash -{ - "address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs", - "visible": true -} -``` - -### HTTP Response Example - -A successful HTTP response returns a status code of 200 and a JSON body similar to the following example: - -```json -{ - "result": true, - "message": "Base58check format" -} -``` - -In case of an error, the HTTP response returns a status code of 400 with a body containing an error message. diff --git a/v1.0/RPC Nodes/others/rpc-tron/web3_clientversion.md b/v1.0/RPC Nodes/others/rpc-tron/web3_clientversion.md deleted file mode 100644 index 888237c3..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/web3_clientversion.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "web3_clientversion" -slug: "rpc-tron-web3_clientversion" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -// Initialize the SDK for the TRON network -const tatum = await TatumSDK.init({network: Network.TRON}) - -const version = await tatum.rpc.clientVersion() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`web3_clientVersion` is a method of the JSON-RPC API that allows the client to retrieve the current version of the client software being used by the node. - -This method is read-only and does not require authentication. The `web3_clientVersion` method can be used by developers to confirm the version of the client software they are using and ensure that it is compatible with their application. - -### Parameters - -This method has no parameters. It only retrieves the current version of the client software. - -### Return Object - -The `web3_clientVersion` method returns a string representing the version of the client software being used. The string includes the client name, version number, and build information. - -* `String` - Version string of the client software being used. - -### Example Request - -#### JSON Request - -```json -{ - "jsonrpc": "2.0", - "method": "web3_clientVersion", - "params": [], - "id": 1 -} -``` - -### Example Response - -#### JSON Response - -```json -{ - "jsonrpc": "2.0", - "id": 67, - "result": "v0.9.0" -} -``` - diff --git a/v1.0/RPC Nodes/others/rpc-tron/withdrawexpireunfreeze.md b/v1.0/RPC Nodes/others/rpc-tron/withdrawexpireunfreeze.md deleted file mode 100644 index a0145894..00000000 --- a/v1.0/RPC Nodes/others/rpc-tron/withdrawexpireunfreeze.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: "withdrawexpireunfreeze" -slug: "rpc-tron-withdrawexpireunfreeze" -excerpt: "Tron RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tron RPC" - image: [] - keywords: "tron, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Tron, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({ network: Network.TRON }) - -const res = await tatum.rpc.withdrawExpireUnfreeze('ra5nK24KXen9AHvsdFTKHSANinZseWnPcX', { - visible: true, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} - -### Overview - -Withdraw unfrozen balance in Stake 2.0. This method allows users to retrieve their funds after executing the `/wallet/unfreezebalancev2` transaction and waiting for a certain number of days. The number of days is determined by a network parameter. - -Note: Stake 2.0 supports multiple partial unstakes. When calling this API, all unstaked funds that have passed the lock-up period will be withdrawn at once. - -### Parameters - -* `ownerAddress` (string): Owner address in hexadecimal format. -* `options` (object, optional): This optional parameter contains the following properties: - * `visible` (boolean, optional): Specifies whether the address is in base58 format. - * `permissionId` (integer, optional): Used for multi-signature scenarios. - -### Return Object - -* `raw_data.contract` - The main content of the transaction, contract is a list, but only one element is used at present. Different types of transactions have different contract contents. For example, for a TRX transfer type transaction, the contract will include the transfer amount, receiver address and other information. TRON supports multiple types of contracts, please refer to the official documentation [Types of Transaction](https://developers.tron.network/docs/tron-protocol-transaction#types-of-transaction). -* `raw_data.ref_block_bytes` - The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.ref_block_hash` - The hash of the transaction reference block, using the 8th to 16th (exclusive) bytes of the reference block hash, a total of 8 bytes. The reference block is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block. Generally, the latest solidified block is used as the reference block. -* `raw_data.expiration` - Transaction expiration time, beyond which the transaction will no longer be packed. If the transaction is created by calling the java-tron API, its expiration time will be automatically set by the node to the value of adding 60 seconds to the timestamp of the node's latest block. The expiration time interval can be modified in the node's configuration file, the maximum value cannot exceed 24 hours. -* `raw_data.data` - Transaction memo. -* `raw_data.timestamp` - Transaction timestamp, set as the transaction creation time. -* `raw_data.fee_limit` - The maximum energy cost allowed for the execution of smart contract transactions. Only deploying and triggering smart contract transactions need to be set, others not. -* `signature` - The sender's signature for the transaction. This proves that the transaction could only have come from the sender and was not sent fraudulently. -* `txID` - transaction id - -Since the transaction type is WithdrawExpireUnfreezeContract, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows: - -* `owner_address` (string): Account address. - -### HTTP Request Example - -```bash -{ - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", - "visible": true -} -``` - -### HTTP Response Example - -```json -{ - "txID": "3d0a235547b08f9d5e1d465f6d7dc28da6436a8d9c3b768d1a989cac7e5c94cf", - "raw_data": { - "contract": [ - { - "parameter": { - "value": { - "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" - }, - "type_url": "type.googleapis.com/protocol.WithdrawExpireUnfreezeContract" - }, - "type": "WithdrawExpireUnfreezeContract" - } - ], - "ref_block_bytes": "4a1b", - "ref_block_hash": "4dc3c8c4476d5d56", - "expiration": 1582208742000, - "timestamp": 1582208686873, - "fee_limit": 1000000000 - }, - "raw_data_hex": "0a024a1b22084dc3c8c4476d5d5640c8fcaf8d2d5a2e5a680801126a0a3074..." -} -``` - diff --git a/v1.0/RPC Nodes/others/rpc-tron.md b/v1.0/RPC Nodes/others/rpc-xrp.md similarity index 87% rename from v1.0/RPC Nodes/others/rpc-tron.md rename to v1.0/RPC Nodes/others/rpc-xrp.md index 0b68e850..a7bb7a48 100644 --- a/v1.0/RPC Nodes/others/rpc-tron.md +++ b/v1.0/RPC Nodes/others/rpc-xrp.md @@ -1,6 +1,6 @@ --- -title: "Tron" -slug: "rpc-tron" +title: "XRP" +slug: "rpc-xrp" excerpt: "" category: 65c5e93c623cad004b45d505 hidden: false diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_channels.md b/v1.0/RPC Nodes/others/rpc-xrp/account_channels.md new file mode 100644 index 00000000..adc6b115 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/account_channels.md @@ -0,0 +1,120 @@ +--- +title: "account_channels" +slug: "rpc-xrp-account_channels" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.accountChannels('rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn', { + destinationAccount: 'ra5nK24KXen9AHvsdFTKHSANinZseWnPcX', + ledgerIndex: 'validated', +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `account_channels` RPC method allows you to retrieve information about an account's Payment Channels on the XRP Ledger. This includes only channels where the specified account is the source (or owner) of the channel, not the destination. The information returned is relative to a particular version of the ledger. + +Use cases for `account_channels` include: + +* Tracking the status of open Payment Channels +* Auditing total outbound XRP from an account via Payment Channels +* Monitoring Payment Channel balances to determine if they need to be topped up + +{% embed url="https://codepen.io/tatum-devrel/pen/dyQLjEX" %} + +### Parameters + +The `account_channels` RPC method includes the following parameters: + +* `account`: The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. +* `destination_account` (Optional): The unique identifier of an account, typically the account's Address. If provided, filter results to payment channels whose destination is this account. +* `ledger_hash` (Optional): A 20-byte hex string for the ledger version to use. +* `ledger_index` (Optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. +* `limit` (Optional): Limit the number of transactions to retrieve. Cannot be less than 10 or more than 400. The default is 200. +* `marker` (Optional): Value from a previous paginated response. Resume retrieving data where that response left off. + +### Return Object + +The response to the `account_channels` RPC call includes an array of Channel Objects, each containing the following fields: + +* `account` (String): The address of the source/owner of the payment channels. This corresponds to the account field of the request. +* `channels` (Array of Channel Objects): Payment channels owned by this account. Each Channel Object includes: + * `account` (String): The owner of the channel, as an Address. + * `amount` (String): The total amount of XRP, in drops allocated to this channel. + * `balance` (String): The total amount of XRP, in drops, paid out from this channel, as of the ledger version used. + * `channel_id` (String): A unique ID for this channel, as a 64-character hexadecimal string. This is also the ID of the channel object in the ledger's state data. + * `destination_account` (String): The destination account of the channel, as an Address. Only this account can receive the XRP in the channel while it is open. + * `settle_delay` (Unsigned Integer): The number of seconds the payment channel must stay open after the owner of the channel requests to close it. + * `public_key` (String): May be omitted. The public key for the payment channel in the XRP Ledger's base58 format. + * `public_key_hex` (String): May be omitted. The public key for the payment channel in hexadecimal format. + * `expiration` (Unsigned Integer): May be omitted. Time, in seconds since the Ripple Epoch, when this channel is set to expire. + * `cancel_after` (Unsigned Integer): May be omitted. Time, in seconds since the Ripple Epoch, of this channel's immutable expiration. + * `source_tag` (Unsigned Integer): May be omitted. A 32-bit unsigned integer to use as a source tag for payments through this payment channel. + * `destination_tag` (Unsigned Integer): May be omitted. A 32-bit unsigned integer to use as a destination tag for payments through this channel. +* `ledger_hash` (String): May be omitted. The identifying hash of the ledger version used to generate this response. +* `ledger_index` (Number): The ledger index of the ledger version used to generate this response. +* `validated` (Boolean): May be omitted. If true, this data comes from a validated ledger version. +* `limit` (Number): May be omitted. The limit to how many channel objects were actually returned by this request. +* `marker` (Marker): May be omitted. Server-defined value for pagination. Pass this to the next call to resume getting results where this call left off. + +### JSON-RPC Request Example + +```json +{ + "method": "account_channels", + "params": [{ + "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", + "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", + "ledger_index": "validated" + }] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", + "channels": [ + { + "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", + "amount": "1000", + "balance": "0", + "channel_id": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7", + "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", + "public_key": "aBR7mdD75Ycs8DRhMgQ4EMUEmBArF8SEh1hfjrT2V9DQTLNbJVqw", + "public_key_hex": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2", + "settle_delay": 60 + } + ], + "ledger_hash": "27F530E5C93ED5C13994812787C1ED073C822BAEC7597964608F2C049C2ACD2D", + "ledger_index": 71766343, + "status": "success", + "validated": true + } +} +``` + +Please note, the response may contain an array of channel objects if there are multiple channels associated with the provided account. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_currencies.md b/v1.0/RPC Nodes/others/rpc-xrp/account_currencies.md new file mode 100644 index 00000000..301a4b07 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/account_currencies.md @@ -0,0 +1,89 @@ +--- +title: "account_currencies" +slug: "rpc-xrp-account_currencies" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.accountCurrencies('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', { + ledgerIndex: 'validated', + strict: true +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `accountCurrencies` method retrieves a list of currencies that an account can send or receive, based on its trust lines. This isn't a thoroughly confirmed list but can be used to populate user interfaces. + +{% embed url="https://codepen.io/tatum-devrel/pen/gOQyjNx" %} + +### Parameters + +The method accepts two parameters: + +* `account` (**required**): A unique identifier for the account, most commonly the account's Address. +* `options` (**optional**): An object with the following properties: + * `ledgerHash`: A 20-byte hex string for the ledger version to use. + * `ledgerIndex`: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. + * `strict`: If true, then the `account` field only accepts a public key or XRP Ledger address. Otherwise, `account` can be a secret or passphrase (not recommended). The default is false. + +### Return Object + +The `accountCurrencies` method returns an object with following fields: + +* `ledger_hash` (String - Hash): May be omitted. The identifying hash of the ledger version used to retrieve this data, as hex. +* `ledger_index` (Integer - Ledger Index): The ledger index of the ledger version used to retrieve this data. +* `receive_currencies` (Array of Strings): Array of Currency Codes for currencies that this account can receive. +* `send_currencies` (Array of Strings): Array of Currency Codes for currencies that this account can send. +* `validated` (Boolean): If true, this data comes from a validated ledger.\ + + +### JSON-RPC Request Example + +Here's an example of how the JSON-RPC request might look like: + +```json +{ + "command": "account_currencies", + "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "strict": true, + "ledger_index": "validated" +} +``` + +### JSON-RPC Response Example + +Here's an example of how the JSON-RPC response might look like: + +```json +{ + "result": { + "ledger_index": 11775844, + "receive_currencies": ["BTC", "CNY", "DYM", "EUR", "JOE", "MXN", "USD", "015841551A748AD2C1F76FF6ECB0CCCD00000000"], + "send_currencies": ["ASP", "BTC", "CHF", "CNY", "DYM", "EUR", "JOE", "JPY", "MXN", "USD"], + "validated": true + }, + "status": "success", + "type": "response" +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_info.md b/v1.0/RPC Nodes/others/rpc-xrp/account_info.md new file mode 100644 index 00000000..a115ec6d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/account_info.md @@ -0,0 +1,148 @@ +--- +title: "account_info" +slug: "rpc-xrp-account_info" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.accountInfo('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn', { + ledgerIndex: 'current', + strict: true, + queue: true, + signerLists: true +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `accountInfo` method retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger. + +{% embed url="https://codepen.io/tatum-devrel/pen/RwqOYKL" %} + +### Parameters + +The method accepts two parameters: + +* `account` (**required**): A unique identifier for the account, most commonly the account's Address. +* `options` (**optional**): An object with the following properties: + * `ledgerHash`: A 20-byte hex string for the ledger version to use. + * `ledgerIndex`: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. + * `queue`: If true, also returns stats about queued transactions associated with this account. Can only be used when querying for the data from the current open ledger. + * `signerLists`: If true, also returns any SignerList objects associated with this account. + * `strict`: If true, then the `account` field only accepts a public key or XRP Ledger address. Otherwise, `account` can be a secret or passphrase (not recommended). The default is false. + +### Return Object + +The `accountInfo` method returns object with following fields: + +* `account_data`: This is an object that contains the AccountRoot ledger object with this account's information, as stored in the ledger. +* `signer_lists`: This is an array of SignerList ledger objects associated with this account for Multi-Signing. This field is omitted unless the request specified signer\_lists and at least one SignerList is associated with the account. Since an account can own at most one SignerList, this array must have exactly one member if it is present. +* `ledger_current_index`: This is the ledger index of the current in-progress ledger, which was used when retrieving this information. This is omitted if ledger\_index is provided instead. +* `ledger_index`: This is the ledger index of the ledger version used when retrieving this information. The information does not contain any changes from ledger versions newer than this one. This is omitted if ledger\_current\_index is provided instead. +* `queue_data`: This is an object that contains information about queued transactions sent by this account. This information describes the state of the local rippled server, which may be different from other servers in the peer-to-peer XRP Ledger network. Some fields may be omitted because the values are calculated "lazily" by the queuing mechanism. This is omitted unless queue specified as true and querying the current open ledger. +* `validated`: This is a boolean value that is true if this data is from a validated ledger version. If omitted or set to false, this data is not final. + +The `queue_data` parameter, if present, contains the following fields: + +* `txn_count`: The number of queued transactions from this address. +* `auth_change_queued`: Whether a transaction in the queue changes this address's ways of authorizing transactions. If true, this address can queue no further transactions until that transaction has been executed or dropped from the queue. +* `lowest_sequence`: The lowest Sequence Number among transactions queued by this address. +* `highest_sequence`: The highest Sequence Number among transactions queued by this address. +* `max_spend_drops_total`: The integer amount of drops of XRP that could be debited from this address if every transaction in the queue consumes the maximum amount of XRP possible. +* `transactions`: An array containing information about each queued transaction from this address. Each object in the `transactions` array, if present, may contain any or all of the following fields: + * `auth_change`: Whether this transaction changes this address's ways of authorizing transactions. + * `fee`: The Transaction Cost of this transaction, in drops of XRP. + * `fee_level`: The transaction cost of this transaction, relative to the minimum cost for this type of transaction, in fee levels. + * `max_spend_drops`: The maximum amount of XRP, in drops, this transaction could send or destroy. + * `seq`: The Sequence Number of this transaction. + +\ + + +### JSON-RPC Request Example + +Here's an example of how the JSON-RPC request might look like: + +```json +{ + "id": 2, + "command": "account_info", + "account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn", + "strict": true, + "ledger_index": "current", + "queue": true +} +``` + +### JSON-RPC Response Example + +Here's an example of how the JSON-RPC response might look like: + +```json +{ + "id": 5, + "status": "success", + "type": "response", + "result": { + "account_data": { + "Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn", + "Balance": "999999999960", + "Flags": 8388608, + "LedgerEntryType": "AccountRoot", + "OwnerCount": 0, + "PreviousTxnID": "4294BEBE5B569A18C0A2702387C9B1E7146DC3A5850C1E87204951C6FDAA4C42", + "PreviousTxnLgrSeq": 3, + "Sequence": 6, + "index": "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F" + }, + "ledger_current_index": 4, + "queue_data": { + "auth_change_queued": true, + "highest_sequence": 10, + "lowest_sequence": 6, + "max_spend_drops_total": "500", + "transactions": [ + { + "auth_change": false, + "fee": "100", + "fee_level": "2560", + "max_spend_drops": "100", + "seq": 6 + }, + ... (trimmed for length) ... + { + "LastLedgerSequence": 10, + "auth_change": true, + "fee": "100", + "fee_level": "2560", + "max_spend_drops": "100", + "seq": 10 + } + ], + "txn_count": 5 + }, + "status": "success", + "validated": false + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_lines.md b/v1.0/RPC Nodes/others/rpc-xrp/account_lines.md new file mode 100644 index 00000000..b0ed73ea --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/account_lines.md @@ -0,0 +1,130 @@ +--- +title: "account_lines" +slug: "rpc-xrp-account_lines" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.accountLines('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', { + ledgerIndex: 'validated', + peer: 'r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z', + limit: 10, + marker: 'example_marker', +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `account_lines` method returns information about an account's trust lines, which contain balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger. + +{% embed url="https://codepen.io/tatum-devrel/pen/abQxawN" %} + +### Parameters + +* `account`: (String) A unique identifier for the account, most commonly the account's Address. +* `options`: (AccountLinesOptions) An object with optional parameters: + * `ledgerHash`: (Optional, String) A 20-byte hex string for the ledger version to use. + * `ledgerIndex`: (Optional, LedgerIndex) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. Can be 'validated', 'closed', 'current', or a number. + * `peer`: (Optional, String) The Address of a second account. If provided, show only lines of trust connecting the two accounts. + * `limit`: (Optional, Number) Limit the number of results to retrieve. + * `marker`: (Optional, unknown) Value from a previous paginated response. Resume retrieving data where that response left off. + +### Return Object + +The response object has the following properties: + +* `account`: (String) Unique Address of the account this request corresponds to. This is the "perspective account" for the purpose of the trust lines. +* `lines`: (Array) Array of trust line objects, as described below. If the number of trust lines is large, only returns up to the limit at a time. +* `ledger_current_index`: (Optional, Integer) The ledger index of the current open ledger, which was used when retrieving this information. +* `ledger_index`: (Optional, Integer) The ledger index of the ledger version that was used when retrieving this data. +* `ledger_hash`: (Optional, String) The identifying hash of the ledger version that was used when retrieving this data. +* `marker`: (Optional, Marker) Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. + +Each trust line object has some combination of the following fields: + +* `account`: (String) The unique Address of the counterparty to this trust line. +* `balance`: (String) Representation of the numeric balance currently held against this line. A positive balance means that the perspective account holds value; a negative balance means that the perspective account owes value. +* `currency`: (String) A Currency Code identifying what currency this trust line can hold. +* `limit`: (String) The maximum amount of the given currency that this account is willing to owe the peer account. +* `limit_peer`: (String) The maximum amount of currency that the counterparty account is willing to owe the perspective account. +* `quality_in`: (Unsigned Integer) Rate at which the account values incoming balances on this trust line, as a ratio of this value per 1 billion units. +* `quality_out`: (Unsigned Integer) Rate at which the account values outgoing balances on + +this trust line, as a ratio of this value per 1 billion units. + +* `no_ripple`: (Optional, Boolean) If true, this account has enabled the No Ripple flag for this trust line. +* `no_ripple_peer`: (Optional, Boolean) If true, the peer account has enabled the No Ripple flag for this trust line. +* `authorized`: (Optional, Boolean) If true, this account has authorized this trust line. +* `peer_authorized`: (Optional, Boolean) If true, the peer account has authorized this trust line. +* `freeze`: (Optional, Boolean) If true, this account has frozen this trust line. +* `freeze_peer`: (Optional, Boolean) If true, the peer account has frozen this trust line. + +### JSON-RPC Request Example + +```json +{ + "id": 1, + "command": "account_lines", + "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "ledger_index": "validated", + "peer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", + "limit": 10, + "marker": "example_marker" +} +``` + +### JSON-RPC Response Example + +```json +{ + "id": 1, + "status": "success", + "type": "response", + "result": { + "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "lines": [ + { + "account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", + "balance": "0", + "currency": "ASP", + "limit": "0", + "limit_peer": "10", + "quality_in": 0, + "quality_out": 0 + }, + { + "account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", + "balance": "0", + "currency": "XAU", + "limit": "0", + "limit_peer": "0", + "no_ripple": true, + "no_ripple_peer": true, + "quality_in": 0, + "quality_out": 0 + } + ], + "ledger_index": 1000000 + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_nfts.md b/v1.0/RPC Nodes/others/rpc-xrp/account_nfts.md new file mode 100644 index 00000000..32927d24 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/account_nfts.md @@ -0,0 +1,102 @@ +--- +title: "account_nfts" +slug: "rpc-xrp-account_nfts" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.accountNfts('rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx', { + ledger_index: 'validated', + limit: 100 +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `accountNfts` method returns a list of Non-Fungible Tokens (NFTs) objects for a specific account. This method is useful when you want to retrieve all the NFTs owned by a particular account. The method is available due to the NonFungibleTokensV1\_1 amendment. + +{% embed url="https://codepen.io/tatum-devrel/pen/NWEmLae" %} + +### Parameters + +#### Main Parameters + +* `account`: A unique identifier for the account, most commonly the account's Address. + +#### Optional Parameters (part of `options?: Ledger & Pagination` object) + +* `ledger_hash`: A 20-byte hex string for the ledger version to use. +* `ledger_index`: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. +* `limit`: Limit the number of token pages to retrieve. Each page can contain up to 32 NFTs. The limit value cannot be lower than 20 or more than 400. The default is 100. +* `marker`: Value from a previous paginated response. Resume retrieving data where that response left off. + +### Return Object + +The returned object will be a successful result containing the account's address and an array of NFT objects. + +Here are the fields in the response: + +* `Flags`: This is a number that represents a bit-map of boolean flags enabled for this NFToken. This can provide additional information about the token, such as whether it's transferable, mintable, etc. The specific flags and their meanings can vary based on the implementation. +* `Issuer`: This is a string that represents the address of the account that issued this NFToken. It's the unique identifier of the account that created and originally owned this token. +* `NFTokenID`: This is a string that represents the unique identifier of this NFToken, in hexadecimal. This is typically a unique identifier that differentiates this token from all others on the ledger. +* `NFTokenTaxon`: This is a number that represents the unscrambled version of this token's taxon. Several tokens with the same taxon might represent instances of a limited series. This can be used to group similar tokens together. +* `URI`: This is a string that represents the URI data associated with this NFToken, in hexadecimal. This often points to a resource that has more information about the token, such as an image, audio file, or a webpage. +* `nft_serial`: This is a number that represents the token sequence number of this NFToken, which is unique for its issuer. This can be used to determine the order in which the tokens were created. + +### JSON-RPC Request Example + +```json +{ + "method": "account_nfts", + "params": [ + { + "account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx", + "ledger_index": "validated", + "limit": 100 + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx", + "account_nfts": [ + { + "Flags": 1, + "Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm", + "NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004", + "NFTokenTaxon": 0, + "URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469", + "nft_serial": 4 + }, + // More NFTs... + ], + "status": "success", + "validated": true + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_objects.md b/v1.0/RPC Nodes/others/rpc-xrp/account_objects.md new file mode 100644 index 00000000..a66e43b1 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/account_objects.md @@ -0,0 +1,177 @@ +--- +title: "account_objects" +slug: "rpc-xrp-account_objects" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.accountObjects('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', { + ledger_index: 'validated', + type: 'state', + deletion_blockers_only: false, + limit: 10 +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `accountObjects` method returns the raw ledger format for all objects owned by an account. This includes Offer objects for orders that are currently live, unfunded, or expired but not yet removed, RippleState objects for trust lines where this account's side is not in the default state, the account's SignerList, if the account has multi-signing enabled, Escrow objects for held payments that have not yet been executed or canceled, PayChannel objects for open payment channels, Check objects for pending Checks, DepositPreauth objects for deposit preauthorizations, Ticket objects for Tickets, and NFTokenPage objects for collections of NFTs. + +{% embed url="https://codepen.io/tatum-devrel/pen/bGQJxYQ" %} + +### Parameters + +#### Main Parameters + +* `account`: A unique identifier for the account, most commonly the account's Address. + +#### Optional Parameters (part of `options?: AccountObjectsOptions` object) + +* `deletion_blockers_only`: If true, the response only includes objects that would block this account from being deleted. The default is false. +* `ledger_hash`: A 20-byte hex string for the ledger version to use. +* `ledger_index`: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. +* `limit`: The maximum number of objects to include in the results. Must be within the inclusive range 10 to 400 on non-admin connections. The default is 200. +* `marker`: Value from a previous paginated response. Resume retrieving data where that response left off. +* `type`: Filter results by a ledger entry type. The valid types are: check, deposit\_preauth, escrow, nft\_offer, offer, payment\_channel, signer\_list, state (trust line), and ticket. + +### Return Object + +The returned object will be a successful result containing the account's address and an array of objects owned by this account. + +Here are the fields in the response: + +* `account`: This is a string that represents the unique address of the account that this request corresponds to. +* `account_objects`: This is an array of objects owned by the account. Each object is in its raw ledger format. The specific fields in each object can vary depending on the type of the object. Common ledger object types include Offer, RippleState, AccountRoot, and others. +* `ledger_hash`: This is a string that may be omitted. It represents the identifying hash of the ledger that was used to generate this response. +* `ledger_index`: This is a number that may be omitted. It represents the ledger index of the ledger version that was used to generate this response. +* `ledger_current_index`: This is a number that may be omitted. It represents the ledger index of the current in-progress ledger version, which was used to generate this response. +* `limit`: This is a number that may be omitted. It represents the limit that was used in this request, if any. +* `marker`: This is a server-defined value indicating the response is paginated. You can pass this to the next call to resume where this call left off. It is omitted when there are no additional pages after this one. +* `validated`: This is a boolean. If included and set to true, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change. + +### JSON-RPC Request Example + +```json +{ + "method": "account_objects", + "params": [ + { + "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "ledger_index": "validated", + "type": "state", + "deletion_blockers_only": false, + "limit": 10 + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "account_objects": [ + { + "Balance": { + "currency": "ASP", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 65536, + "HighLimit": { + "currency": "ASP", + "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "value": "0" + }, + "HighNode": "0000000000000000", + "LedgerEntryType": "RippleState", + "LowLimit": { + "currency": "ASP", + "issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", + "value": "10" + }, + "LowNode": "0000000000000000", + "PreviousTxnID": "BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862", + "PreviousTxnLgrSeq": 1438879, + "index": "2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9" + }, + { + "Balance": { + "currency": "XAU", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 3342336, + "HighLimit": { + "currency": "XAU", + "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "value": "0" + }, + "HighNode": "0000000000000000", + "LedgerEntryType": "RippleState", + "LowLimit": { + "currency": "XAU", + "issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", + "value": "0" + }, + "LowNode": "0000000000000000", + "PreviousTxnID": "79B26D7D34B950AC2C2F91A299A6888FABB376DD76CFF79D56E805BF439F6942", + "PreviousTxnLgrSeq": 5982530, + "index": "9ED4406351B7A511A012A9B5E7FE4059FA2F7650621379C0013492C315E25B97" + }, + { + "Balance": { + "currency": "USD", + "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", + "value": "0" + }, + "Flags": 1114112, + "HighLimit": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "0" + }, + "HighNode": "0000000000000000", + "LedgerEntryType": "RippleState", + "LowLimit": { + "currency": "USD", + "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "value": "5" + }, + "LowNode": "0000000000000000", + "PreviousTxnID": "6FE8C824364FB1195BCFEDCB368DFEE3980F7F78D3BF4DC4174BB4C86CF8C5CE", + "PreviousTxnLgrSeq": 10555014, + "index": "2DECFAC23B77D5AEA6116C15F5C6D4669EBAEE9E7EE050A40FE2B1E47B6A9419" + } + ], + "ledger_hash": "4C99E5F63C0D0B1C2283B4F5DCE2239F80CE92E8B1A6AED1E110C198FC96E659", + "ledger_index": 14380380, + "limit": 10, + "marker": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93,94A9F05FEF9A153229E2E997E64919FD75AAE2028C8153E8EBDB4440BD3ECBB5", + "status": "success", + "validated": true + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_offers.md b/v1.0/RPC Nodes/others/rpc-xrp/account_offers.md new file mode 100644 index 00000000..e753f829 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/account_offers.md @@ -0,0 +1,122 @@ +--- +title: "account_offers" +slug: "rpc-xrp-account_offers" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +// Initialize the SDK for the XRP network +const tatum = await TatumSDK.init({network: Network.XRP}) + +// Use the account_offers method +const res = await tatum.rpc.accountOffers('rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM', { + ledgerIndex: 'validated', +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `account_offers` method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version. It is typically used for monitoring the open offers that a particular account has made on the XRP Ledger's decentralised exchange. + +{% embed url="https://codepen.io/tatum-devrel/pen/mdQgGpx" %} + +### Parameters + +The `account_offers` method accepts the following parameters: + +* `account`: A unique identifier for the account, most commonly the account's Address. +* `ledger_hash` (Optional): A 20-byte hex string identifying the ledger version to use. +* `ledger_index` (Optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. +* `limit` (Optional): Limit the number of Offers to retrieve. The server may return fewer than this number of results. Must be within the inclusive range 10 to 400. The default is 200. +* `marker` (Optional): Value from a previous paginated response. Resume retrieving data where that response left off. +* `strict` (Optional): If true, then the account field only accepts a public key or XRP Ledger address. Otherwise, account can be a secret or passphrase (not recommended). The default is false. + +### Return Object + +The response follows the standard format, with a successful result containing the following fields: + +* `account`: Unique Address identifying the account that made the offers +* `offers`: Array of objects, where each object represents an offer made by this account that is outstanding as of the requested ledger version. +* `ledger_current_index` (Optional): The ledger index of the current in-progress ledger version, which was used when retrieving this data. +* `ledger_index` (Optional): The ledger index of the ledger version that was used when retrieving this data, as requested. +* `ledger_hash` (Optional): The identifying hash of the ledger version that was used when retrieving this data. +* `marker` (Optional): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. + +### JSON-RPC Request Example + +```json +{ + "method": "account_offers", + "params": [ + { + "account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM" + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM", + "ledger_current_index": 18539596, + "offers": [{ + "flags": 0, + "quality": "0.000000007599140009999998", + "seq": 6578020, + "taker_gets": "29740867287", + "taker_pays": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "226.0050145327418" + } + }, { + "flags": 0, + "quality": "7989247009094510e-27", + "seq": 6572128, + "taker_gets": "2361918758", + "taker_pays": { + "currency": "XAU", + "issuer": "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67", + "value": "0.01886995237307572" + } + }, { + "flags": 0, + "quality": "0.00000004059594001318974", + "seq": 6576905, + "taker_gets": "3892952574", + "taker_pays": { + "currency": "CNY", + "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", + "value": "158.0380691682966" + } + }, + + ... + + ], + "status": "success", + "validated": false + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_tx.md b/v1.0/RPC Nodes/others/rpc-xrp/account_tx.md new file mode 100644 index 00000000..2abd58c4 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/account_tx.md @@ -0,0 +1,236 @@ +--- +title: "account_tx" +slug: "rpc-xrp-account_tx" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use It + +```typescript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.accountTx('rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w', { + ledgerIndexMin: -1, + ledgerIndexMax: -1, + binary: false, + forward: false, +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `account_tx` method is a part of the XRP Ledger's RPC API, allowing you to retrieve a list of transactions that involve a specified account. This method is useful when you need to track and analyze transactions related to a particular account, which can be necessary for various operations such as auditing, debugging or just for general monitoring purposes. + +{% embed url="https://codepen.io/tatum-devrel/pen/abQxaqm" %} + +### Parameters + +The `accountTx` method accepts the following parameters: + +* `account`: A unique identifier for the account, most commonly the account's address. +* `ledgerIndexMin`: (Optional) Use to specify the earliest ledger to include transactions from. A value of -1 instructs the server to use the earliest validated ledger version available. +* `ledgerIndexMax`: (Optional) Use to specify the most recent ledger to include transactions from. A value of -1 instructs the server to use the most recent validated ledger version available. +* `binary`: (Optional) Defaults to false. If set to true, returns transactions as hex strings instead of JSON. +* `forward`: (Optional) Defaults to false. If set to true, returns values indexed with the oldest ledger first. Otherwise, the results are indexed with the newest ledger first. + +### Return Object + +The response object includes the following fields: + +* `account`: Unique Address identifying the related account. +* `ledger_index_min`: The ledger index of the earliest ledger actually searched for transactions. +* `ledger_index_max`: The ledger index of the most recent ledger actually searched for transactions. +* `limit`: The limit value used in the request. +* `marker`: Server-defined value indicating the response is paginated. +* `transactions`: Array of transactions matching the request's criteria. +* `validated`: If included and set to true, the information in this response comes from a validated ledger version. + +Each transaction object includes the following fields: + +* `ledger_index`: The ledger index of the ledger version that included this transaction. +* `meta`: If binary is True, then this is a hex string of the transaction metadata. Otherwise, the transaction metadata is included in JSON format. +* `tx`: (JSON mode only) JSON object defining the transaction. +* `validated`: Whether or not the transaction is included in a validated ledger. + +### JSON-RPC Request Example + +```json +{ + "method": "account_tx", + "params": [ + { + "account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", + "binary": false, + "forward": false, + "ledger_index_max": -1, + "ledger_index_min": -1, + "limit": 2 + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", + "ledger_index_max": 57112019, + "ledger_index_min": 56248229, + "limit": 2, + "marker": { + "ledger": 57112007, + "seq": 13 + }, + "status": "success", + "transactions": [ + { + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", + "Balance": "3732290013101", + "Flags": 131072, + "OwnerCount": 0, + "Sequence": 702820 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574", + "PreviousFields": { + "Balance": "3732745656171", + "Sequence": 702819 + }, + "PreviousTxnID": "7C031FD5B710E3C048EEF31254089BEEC505900BCC9A842257A0319453333998", + "PreviousTxnLgrSeq": 57112010 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5", + "Balance": "4231510602153", + "Flags": 0, + "OwnerCount": 0, + "Sequence": 96486 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "39DC5D448DECEFC3CD20818788E3DA891CA943935E8D7B12FCB5B5871FCB1638", + "PreviousFields": { + "Balance": "4231054959123" + }, + "PreviousTxnID": "33D2014C832610293730028CA37857AC183BFCE3E42B9979C491FB8B82B3E9DC", + "PreviousTxnLgrSeq": 57112004 + } + } + ], + "TransactionIndex": 12, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "455643030" + }, + "tx": { + "Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", + "Amount": "455643030", + "Destination": "raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5", + "DestinationTag": 18240312, + "Fee": "40", + "Flags": 2147483648, + "LastLedgerSequence": 57112037, + "Sequence": 702819, + "SigningPubKey": "020A46D8D02AC780C59853ACA309EAA92E7D8E02DD72A0B6AC315A7D18A6C3276A", + "TransactionType": "Payment", + "TxnSignature": "30450221008602B2E390C0C7B65182C6DBC86292052C1961B2BEFB79C2C8431722C0ADB911022024B74DCF910A4C8C95572CF662EB7F5FF67E1AC4D7B9B7BFE2A8EE851EC16576", + "date": 649200322, + "hash": "08EF5BDA2825D7A28099219621CDBECCDECB828FEA202DEB6C7ACD5222D36C2C", + "inLedger": 57112015, + "ledger_index": 57112015 + }, + "validated": true + }, + { + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", + "Balance": "3732745656171", + "Flags": 131072, + "OwnerCount": 0, + "Sequence": 702819 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574", + "PreviousFields": { + "Balance": "3732246155784" + }, + "PreviousTxnID": "CCBCCB528F602007C937C496F0828C118E073DF180084CCD3646EC1E414844E4", + "PreviousTxnLgrSeq": 57112007 + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg", + "Balance": "236476361", + "Flags": 131072, + "OwnerCount": 0, + "Sequence": 466335 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "CC20FEBEA6D2AF969EC46F2BD92684D9FBABC3F238E841B5E056FE4EBF4379A9", + "PreviousFields": { + "Balance": "735976788", + "Sequence": 466334 + }, + "PreviousTxnID": "C528B32DD588EFAE2FE833E8AA92E6AE2DF2C8DB3DB8C6C4F334AD37B253D72A", + "PreviousTxnLgrSeq": 57112010 + } + } + ], + "TransactionIndex": 33, + "TransactionResult": "tesSUCCESS", + "delivered_amount": "499500387" + }, + "tx": { + "Account": "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg", + "Amount": "499500387", + "Destination": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", + "DestinationTag": 1, + "Fee": "40", + "Flags": 2147483648, + "LastLedgerSequence": 57112032, + "Sequence": 466334, + "SigningPubKey": "0381575032E254BF4D699C3D8D6EFDB63B3A71F97475C6F6885BC7DAEEE55D9A01", + "TransactionType": "Payment", + "TxnSignature": "3045022100C7EA1701FE48C75508EEBADBC9864CD3FFEDCEB48AB99AEA960BFA360AE163ED0220453C9577502924C9E1A9A450D4B950A44016813BC70E1F16A65A402528D730B7", + "date": 649200302, + "hash": "7C031FD5B710E3C048EEF31254089BEEC505900BCC9A842257A0319453333998", + "inLedger": 57112010, + "ledger_index": 57112010 + }, + "validated": true + } + ], + "validated": true + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/book_offers.md b/v1.0/RPC Nodes/others/rpc-xrp/book_offers.md new file mode 100644 index 00000000..4f2ee07a --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/book_offers.md @@ -0,0 +1,93 @@ +--- +title: "book_offers" +slug: "rpc-xrp-book_offers" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +
// yarn add @tatumio/tatum
+
+import { TatumSDK, Xrp, Network } from '@tatumio/tatum'
+
+const tatum = await TatumSDK.init({network: Network.XRP})
+
+const takerGets = { currency: 'XRP' }
+const takerPays = { currency: 'USD', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' }
+
+const res = await tatum.rpc.bookOffers(takerGets, takerPays, { taker: 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', limit: 10 })
+
+await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
+
+ +### Overview + +The `book_offers` method is used to fetch a list of offers between two different currencies on the XRP Ledger. This method is crucial for trading and asset management applications as it provides an in-depth view of the market depth for a specific trading pair. + +{% embed url="https://codepen.io/tatum-devrel/pen/NWEmELX" %} + +### Parameters + +* `takerGets` (Object): The asset the account taking the offer would receive, as a currency without an amount. +* `takerPays` (Object): The asset the account taking the offer would pay, as a currency without an amount. +* `options` (BookOffersOptions): Optional parameters which includes ledger details, pagination, and the taker address. + +### Return Object + +The `book_offers` method returns an object that provides information about a list of offers in the order book. The object contains the following fields: + +* `ledger_current_index`: (Omitted if `ledger_index` is provided) A ledger index that represents the ledger index of the current in-progress ledger version, which was used to retrieve this information. +* `ledger_index`: (Omitted if `ledger_current_index` is provided) A ledger index that represents the ledger index of the ledger version that was used when retrieving this data, as requested. +* `ledger_hash`: (May be omitted) A hash that represents the identifying hash of the ledger version that was used when retrieving this data, as requested. +* `offers`: An array of offer objects, each of which has the fields of an Offer object. + +Each offer object in the `offers` array can include the following fields: + +* `owner_funds`: A string that represents the amount of the `TakerGets` currency the side placing the offer has available to be traded. (XRP is represented as drops; any other currency is represented as a decimal value.) If a trader has multiple offers in the same book, only the highest-ranked offer includes this field. +* `taker_gets_funded`: (Only included in partially-funded offers) A currency amount that represents the maximum amount of currency that the taker can get, given the funding status of the offer. +* `taker_pays_funded`: (Only included in partially-funded offers) A currency amount that represents the maximum amount of currency that the taker would pay, given the funding status of the offer. +* `quality`: A string that represents the exchange rate, as the ratio of `taker_pays` divided by `taker_gets`. For fairness, offers that have the same quality are automatically taken first-in, first-out. (In other words, if multiple people offer to exchange currency at the same rate, the oldest offer is taken first.) + +### JSON-RPC Request Example + +```json +{ + "method": "book_offers", + "params": [ + { + "taker": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "taker_gets": { + "currency": "XRP" + }, + "taker_pays": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" + }, + "limit": 10 + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "ledger_current_index": 8696243, + "offers": [], + "status": "success", + "validated": false + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/channel_authorize.md b/v1.0/RPC Nodes/others/rpc-xrp/channel_authorize.md new file mode 100644 index 00000000..4341ad65 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/channel_authorize.md @@ -0,0 +1,87 @@ +--- +title: "channel_authorize" +slug: "rpc-xrp-channel_authorize" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```typescript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network, Secrets } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.channelAuthorize( + '1000000', + '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', + { keyType: 'secp256k1', seed: 's████████████████████████████' } +) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `channel_authorize` method creates a signature that can be used to redeem a specific amount of XRP from a payment channel. This method was added by the PayChan amendment and is available starting from the `rippled` 0.33.0 version. + +This method can be used when an account wants to authorize a specific amount of XRP to be redeemed from a payment channel it has created. It generates a signature for a claim, which the receiving account can use to redeem a specific amount of XRP from the channel. + +### Parameters + +The `channel_authorize` method includes the following parameters: + +* `amount`: Cumulative amount of XRP, in drops, to authorize. If the destination has already received a lesser amount of XRP from this channel, the signature created by this method can be redeemed for the difference. +* `channelId`: The unique ID of the payment channel to use. +* `options`: (Optional) An object that includes secrets for signing the claim: + * `keyType`: (Optional) The signing algorithm of the cryptographic key pair provided. Valid types are `secp256k1` or `ed25519`. The default is `secp256k1`. + * `seed`: (Optional) The secret seed to use to sign the claim. This must be the same key pair as the public key specified in the channel. Must be in the XRP Ledger's base58 format. + +### Return Object + +The `channel_authorize` method returns a result object that includes: + +* `signature`: The signature for this claim, as a hexadecimal value. To process the claim, the destination account of the payment channel must send a PaymentChannelClaim transaction with this signature, the exact Channel ID, XRP amount, and public key of the channel. + +### JSON-RPC Request Example + +```json +{ + "method": "channel_authorize", + "params": [ + { + "channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3", + "seed": "s████████████████████████████", + "key_type": "secp256k1", + "amount": "1000000", + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "id": "channel_authorize_example_id1", + "status": "success", + "result": { + "signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800 + +BBC43746F34AF50290064", + } +} +``` + +> **Warning:** Do not send secret keys to untrusted servers or through unsecured network connections. (This includes the secret, seed, seed\_hex, or passphrase fields of this request.) You should only use this method on a secure, encrypted network connection to a server you run or fully trust with your funds. Otherwise, eavesdroppers could use your secret key to sign claims and take all the money from this payment channel and anything else using the same key pair. See Set Up Secure Signing for instructions. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/channel_verify.md b/v1.0/RPC Nodes/others/rpc-xrp/channel_verify.md new file mode 100644 index 00000000..b83f5f6d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/channel_verify.md @@ -0,0 +1,84 @@ +--- +title: "channel_verify" +slug: "rpc-xrp-channel_verify" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```typescript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.channelVerify( + '1000000', + '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', + 'aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3', + '304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064' +) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `channel_verify` method is used to check the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel. This method was added by the PayChan amendment and is available starting from the `rippled` 0.33.0 version. + +The main use case of this method is to confirm the validity of a claim before attempting to redeem it. This is especially useful for payment channel recipients who want to ensure they are receiving valid claims. + +### Parameters + +The `channel_verify` method includes the following parameters: + +* `amount`: The amount of XRP, in drops, the provided signature authorizes. +* `channelId`: The Channel ID of the channel that provides the XRP. This is a 64-character hexadecimal string. +* `publicKey`: The public key of the channel and the key pair that was used to create the signature, in hexadecimal or the XRP Ledger's base58 format. +* `signature`: The signature to verify, in hexadecimal. + +### Return Object + +The `channel_verify` method returns a result object that includes: + +* `signature_verified`: If true, the signature is valid for the stated amount, channel, and public key. + +> **Caution:** This does not indicate check that the channel has enough XRP allocated to it. Before considering a claim valid, you should look up the channel in the latest validated ledger and confirm that the channel is open and its amount value is equal or greater than the amount of the claim. To do so, use the `account_channels` method. + +### JSON-RPC Request Example + +```json +{ + "method": "channel_verify", + "params": [{ + "channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3", + "signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064", + "public_key": "aB44YfzW24VDEJQ2U + +uLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3", + "amount": "1000000" + }] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "signature_verified":true, + "status":"success" + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/deposit_authorized.md b/v1.0/RPC Nodes/others/rpc-xrp/deposit_authorized.md new file mode 100644 index 00000000..869bfa7e --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/deposit_authorized.md @@ -0,0 +1,85 @@ +--- +title: "deposit_authorized" +slug: "rpc-xrp-deposit_authorized" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const sourceAccount = 'rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de' +const destinationAccount = 'rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8' + +const res = await tatum.rpc.depositAuthorized(sourceAccount, destinationAccount, { ledgerIndex: 'validated' }) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `deposit_authorized` method is used to verify if a specific account is authorized to send payments to another account. This feature becomes particularly useful in scenarios where accounts have deposit authorization enabled, which is a setting that requires accounts to be preauthorized before they can send payments. + +### Parameters + +* `sourceAccount` (String): The sender of a possible payment. +* `destinationAccount` (String): The recipient of a possible payment. +* `options` (Ledger): Optional parameter that includes details about the ledger to use. + +### Return Object + +The `deposit_authorized` method returns an object that provides information about whether the specified source account is authorized to send payments directly to the destination account. The object contains the following fields: + +* `deposit_authorized`: A boolean indicating whether the specified source account is authorized to send payments directly to the destination account. If true, either the destination account does not require Deposit Authorization or the source account is preauthorized. +* `destination_account`: A string that represents the destination account specified in the request. +* `ledger_hash`: (May be omitted) A string that represents the identifying hash of the ledger that was used to generate this response. +* `ledger_index`: (May be omitted) A number that represents the ledger index of the ledger version that was used to generate this response. +* `ledger_current_index`: (May be omitted) A number that represents the ledger index of the current in-progress ledger version, which was used to generate this response. +* `source_account`: A string that represents the source account specified in the request. +* `validated`: (May be omitted) A boolean indicating whether the information comes from a validated ledger version. If true, the information comes from a validated ledger version. + +### JSON-RPC Request Example + +```json +{ + "method": "deposit_authorized", + "params": [ + { + "source_account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de", + "destination_account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8", + "ledger_index": "validated" + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "deposit_authorized": true, + "destination_account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8", + "ledger_hash": "BD03A10653ED9D77DCA859B7A735BF0580088A8F287FA2C5403E0A19C58EF322", + "ledger_index": 8, + "source_account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de", + "status": "success", + "validated": true + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/fee.md b/v1.0/RPC Nodes/others/rpc-xrp/fee.md new file mode 100644 index 00000000..7f1be6da --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/fee.md @@ -0,0 +1,99 @@ +--- +title: "fee" +slug: "rpc-xrp-fee" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```typescript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.fee() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `fee` method reports the current state of the open-ledger requirements for the transaction cost. This method requires the FeeEscalation amendment to be enabled. It was introduced in `rippled` version 0.31.0 and updated for public use in version 0.32.0. + +The `fee` method is useful for gaining insight into the current transaction costs and the state of the ledger and transaction queue. It can be used by unprivileged users to understand the fees associated with transactions at a particular point in time. + +{% embed url="https://codepen.io/tatum-devrel/pen/RwqOqdK" %} + +### Parameters + +The `fee` method does not take any parameters. + +### Return Object + +The `fee` method returns an object with the following fields: + +* `current_ledger_size`: Number of transactions provisionally included in the in-progress ledger. +* `current_queue_size`: Number of transactions currently queued for the next ledger. +* `drops`: Object with various information about the transaction cost, in drops of XRP. + * `base_fee`: The transaction cost required for a reference transaction to be included in a ledger under minimum load, represented in drops of XRP. + * `median_fee`: An approximation of the median transaction cost among transactions included in the previous validated ledger, represented in drops of XRP. + * `minimum_fee`: The minimum transaction cost for a reference transaction to be queued for a later ledger, represented in drops of XRP. + * `open_ledger_fee`: The minimum transaction cost that a reference transaction must pay to be included in the current open ledger, represented in drops of XRP. +* `expected_ledger_size`: The approximate number of transactions expected to be included in the current ledger. +* `ledger_current_index`: The Ledger Index of the current open ledger these stats describe. +* `levels`: Object with various information about the transaction cost, in fee levels. + * `median_level`: The median transaction cost among transactions in the previous validated ledger, represented in fee levels. + * `minimum_level`: The minimum transaction cost required to be queued for a future ledger, represented in fee levels. + * `open_ledger_level`: The minimum transaction cost required to be included in the current open ledger, represented in fee levels. + * `reference_level`: The equivalent of the minimum transaction cost, represented in fee levels. +* `max_queue_size`: The maximum number of transactions that the transaction queue can currently hold. + +### JSON-RPC Request Example + +```json +{ + "method": "fee", + "params": [{}] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "current_ledger_size": "56", + "current_queue_size": "11", + "drops": { + "base_fee": "10", + "median_fee": "10000", + "minimum_fee": "10", + "open_ledger_fee": "2653937" + }, + "expected_ledger_size": "55", + "ledger_current_index": 26575101, + "levels": { + "median_level": "256000", + "minimum_level": "256", + "open_ledger_level": "67940792", + "reference_level": "256" + }, + "max_queue_size": "1100", + "status": "success" + } + + +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ledger.md b/v1.0/RPC Nodes/others/rpc-xrp/ledger.md new file mode 100644 index 00000000..02a72bee --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/ledger.md @@ -0,0 +1,143 @@ +--- +title: "ledger" +slug: "rpc-xrp-ledger" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +{% hint style="warning" %} +XRP only maintains history from ledger 32570, for more info see [onxrp.com/missing-genesis-block-xrpl/](https://onxrp.com/missing-genesis-block-xrpl/) +{% endhint %} + +### How to use it + +```javascript +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.ledger({ + ledgerIndex: 'validated', + full: false, + accounts: false, + transactions: false, + expand: false, + ownerFunds: false, +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `ledger` RPC method is used to retrieve information about the public ledger in XRP. You can specify various options to customize the returned information, such as the ledger version, whether to include full information on the entire ledger, the ledger's entire state data, information on transactions in the specified ledger version, and so on. + +Use cases for this method include retrieving information about a specific ledger, examining the transactions that have occurred in a specific ledger version, examining the state data of a ledger, and more. + +{% embed url="https://codepen.io/tatum-devrel/pen/GRwLXGG?editors=1111" %} + +### Parameters + +The `ledger` method takes an optional `LedgerOptions` object. This object can contain the following fields: + +* `full` (boolean): If true, return full information on the entire ledger. +* `accounts` (boolean): If true, return the ledger's entire state data. +* `transactions` (boolean): If true, return information on transactions in the specified ledger version. +* `expand` (boolean): Provide full JSON-formatted information for transaction/account information instead of only hashes. +* `ownerFunds` (boolean): If true, include owner\_funds field in the metadata of OfferCreate transactions in the response. +* `binary` (boolean): If true, return the requested ledger object's contents as a hex string in the XRP Ledger's binary format. + +### Return Object + +The method returns a promise that resolves to an `XrpResult` object. This object contains information about the ledger, including the following fields: + +* `ledger.account_hash`: A string representing the hash of all account state information in this ledger, as hexadecimal. +* `ledger.accountState`: An array of all the account-state information in this ledger. This field is omitted unless explicitly requested. +* `ledger.close_flags`: An integer representing a bitmap of flags relating to the closing of this ledger. +* `ledger.close_time`: An integer representing the time this ledger was closed, in seconds since the Ripple Epoch. +* `ledger.close_time_human`: A string representing the time this ledger was closed, in human-readable format. Always uses the UTC time zone. +* `ledger.close_time_resolution`: An integer representing how ledger close times are rounded. Ledger close times are rounded to within this many seconds. +* `ledger.closed`: A boolean indicating whether or not this ledger has been closed. +* `ledger.ledger_hash`: A string representing the unique identifying hash of the entire ledger. +* `ledger.ledger_index`: A string representing the Ledger Index of this ledger, as a quoted integer. +* `ledger.parent_close_time`: An integer representing the time at which the previous ledger was closed. +* `ledger.parent_hash`: A string representing the unique identifying hash of the ledger that came immediately before this one. +* `ledger.total_coins`: A string representing the total number of XRP drops in the network, as a quoted integer. This decreases as transaction costs destroy XRP. +* `ledger.transaction_hash`: A string representing the hash of the transaction information included in this ledger, as hexadecimal. +* `ledger.transactions`: An array of transactions applied in this ledger version. By default, members are the transactions' identifying Hash strings. If the request specified `expand` as true, members are full representations of the transactions instead, in either JSON or binary depending on whether the request specified binary as true. + +Within the `queue_data` object, which is an array of objects describing queued transactions, you can find the following fields: + +* `account`: The Address of the sender for this queued transaction. +* `tx`: By default, this is a string containing the identifying hash of the transaction. If transactions are expanded in binary format, this is an object whose only field is `tx_blob`, containing the binary form of the transaction as a decimal string. If transactions are expanded in JSON format, this is an object containing the transaction object including the transaction's identifying hash in the `hash` field. +* `retries_remaining`: The number of times this transaction can be retried before being dropped. +* `preflight_result`: The tentative result from preliminary transaction checking. This is always `tesSUCCESS`. +* `last_result`: If this transaction was left in the queue after getting a retriable (ter) result, this is the exact ter result code it got. This field may be omitted. +* `auth_change`: Indicates whether this transaction changes this address's ways of authorizing transactions. This field may be omitted. +* `fee`: The Transaction Cost of this transaction, in drops of XRP. This field may be omitted. +* `fee_level`: The transaction cost of this transaction, relative to the minimum cost for this type of transaction, in fee levels. This field may be omitted. +* `max_spend_drops`: The maximum amount of XRP, in drops, this transaction could potentially send or destroy. This field may be omitted. + + + +### JSON-RPC Request Example + +Here is an example of a JSON-RPC request using the `ledger` method: + +```json +{ + "method": "ledger", + "params": [ + { + "ledger_index": "validated", + "accounts": false, + "full": false, + "transactions": false, + "expand": false, + "owner_funds": false + } + ] +} +``` + +### JSON-RPC Response Example + +Here is an example of a successful JSON-RPC response: + +```json +{ + "result": { + "ledger": { + "accepted": true, + "account_hash": "B258A8BB4743FB74CBBD6E9F67E4A56C4432EA09E5805E4CC2DA26F2DBE8F3D1", + "close_flags": 0, + "close_time": 638329271, + "close_time_human": "2020-Mar-24 01:41:11.000000000 UTC", + "close_time_resolution": 10, + "closed": true, + "hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A", + "ledger_hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A", + "ledger_index": "54300940", + "parent_close_time": 638329270, + "parent_hash": "AE996778246BC81F85D5AF051241DAA577C23BCA04C034A7074F93700194520D", + "seqNum": "54300940", + "totalCoins": "99991024049618156", + "total_coins": "99991024049618156", + "transaction_hash": "FC6FFCB71B2527DDD630EE5409D38913B4D4C026AA6C3B14A3E9D4ED45CFE30D" + }, + "ledger_hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A", + "ledger_index": 54300940, + "status": "success", + "validated": true + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ledger_closed.md b/v1.0/RPC Nodes/others/rpc-xrp/ledger_closed.md new file mode 100644 index 00000000..d4b59df2 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/ledger_closed.md @@ -0,0 +1,75 @@ +--- +title: "ledger_closed" +slug: "rpc-xrp-ledger_closed" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.ledgerClosed() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `ledger_closed` method is used to fetch the unique identifiers of the most recently closed ledger. Note that the ledger might not be validated and immutable yet, so use this method when you need information about the latest ledger and not necessarily the final state. + +{% embed url="https://codepen.io/tatum-devrel/pen/MWzRPbb" %} + +### Parameters + +This method does not require any parameters. + +### Return Object + +The `ledger_closed` method returns an object with the following fields: + +* `ledger_hash` (String): The unique hash of this ledger version, in hexadecimal. +* `ledger_index` (Unsigned Integer): The ledger index of this ledger version. + +### JSON-RPC Request Example + +Here's an example of the `ledger_closed` method request: + +```json +{ + "id": 2, + "command": "ledger_closed" +} +``` + +### JSON-RPC Response Example + +Here's an example of a successful response: + +```json +{ + "id": 1, + "status": "success", + "type": "response", + "result": { + "ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02", + "ledger_index": 6643099 + } +} +``` + +In this response, `ledger_hash` is the unique identifier of the ledger, and `ledger_index` is the index number of this ledger version. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ledger_data.md b/v1.0/RPC Nodes/others/rpc-xrp/ledger_data.md new file mode 100644 index 00000000..2683a21b --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/ledger_data.md @@ -0,0 +1,119 @@ +--- +title: "ledger_data" +slug: "rpc-xrp-ledger_data" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.ledgerData({ + ledger_hash: "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8", + limit: 5, + binary: true +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `ledger_data` method retrieves the contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version. + +{% embed url="https://codepen.io/tatum-devrel/pen/eYQoPWW" %} + +### Parameters + +The `ledger_data` method takes the following parameters: + +* `ledger_hash` (Hash): A 20-byte hex string identifying the ledger version to use. (Optional) +* `ledger_index` (Ledger Index): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (Optional) +* `binary` (Boolean): If true, return ledger entries as hexadecimal strings instead of JSON. The default is false. (Optional) +* `limit` (Number): Limit the number of ledger entries to retrieve. The server may return fewer than this number of entries. Cannot be more than 2048 (when requesting binary) or 256 (when requesting JSON). The default is the maximum. (Optional) +* `marker` (Marker): Value from a previous paginated response. Resume retrieving data where that response left off. (Optional) +* `type` (String): Filter results to a specific type of ledger entry. Valid types include account, amendments, amm, check, deposit\_preauth, directory, escrow, fee, hashes, nft\_offer, offer, payment\_channel, signer\_list, state (trust line), and ticket. (Optional) + +### Return Object + +The `ledger_data` response provides information about the state tree of a specific ledger version. It follows the standard format and a successful result contains the following fields: + +* `ledger_index`: An unsigned integer representing the ledger index of this ledger version. +* `ledger_hash`: A string representing the unique identifying hash of this ledger version. +* `state`: An array of JSON objects containing data from the ledger's state tree. The format of these objects will depend on whether binary was set to true in the request. +* `marker`: A server-defined value indicating the response is paginated. This can be passed to the next call to resume where this call left off. + +If a type field is mentioned in the request, the state array will be empty if the first set of array objects does not match the type requested. In such cases, the marker from this response can be used to paginate and retrieve further data. + +Each object in the `state` array may include the following fields: + +* `data`: A string representing the hex representation of the requested data. This field is included only if "binary" was set to true in the request. +* `LedgerEntryType`: A string indicating what type of ledger object this object represents. This field is included only if "binary" was set to false in the request. +* Additional fields describing the object, depending on which ledger object type it is. These fields are included only if "binary" was set to false in the request. +* `index`: A string representing the unique identifier for this ledger entry, in hexadecimal format. + +### JSON-RPC Request Example + +Here's an example of the `ledger_data` method request: + +```json +{ + "id": 2, + "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8", + "command": "ledger_data", + "limit": 5, + "binary": true +} +``` + +### JSON-RPC Response Example + +Here's an example of a successful response: + +```json +{ + "result": { + "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8", + "ledger_index": "6885842", + "marker": "0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF", + "state": [ + { + "data": "11006122000000002400000001250062FEA42D0000000055C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA0466240000000354540208114C909F42250CFE8F12A7A1A0DFBD3CBD20F32CD79", + "index": "00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F" + }, + { + "data": "11006F22000000002400000003250035788533000000000000000034000000000000000055555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F501071633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C6800064D4838D7EA4C68000000000000000000000000000425443000000000035DD7DF146893456296BF4061FBE68735D28F3286540000000000F42408114A4B8F5F7B644AEDC3447F9459C132EEB016A133B", + "index": "000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5" + }, + { + "data": "11006F2200020000240000000A250067395C33000000000000000034000000000000000055A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C5010DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C00064D554C88B43EFA00000000000000000000000000055534400000000000A20B3C85F482532A9578DBB3950B85CA06594D165400000B59B9F780081148366FB9ACD2A0FD822E31112D2EB6F98C317C2C1", + "index": "0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7" + }, + { + "data": "1100612200000000240000000125003E742F2D0000000055286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21624000000306DC42008114225BAB89C4A4B94624BB069D6DB3C819F934991C", + "index": "0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23" + }, + { + "data": "110072220002000025000B65783700000000000000003800000000000000005587591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D03756280000000000000000000000000000000000000004254430000000000000000000000000000000000000000000000000166800000000000000000000000000000000000000042544300000000000A20B3C85F482532A9578DBB3950B85CA06594D167D4C38D7EA4C680000000000000000000000000004254430000000000C795FDF8A637BCAAEDAD1C434033506236C82A2D", + "index": "000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58" + } + ], + "status": "success" + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ledger_entry.md b/v1.0/RPC Nodes/others/rpc-xrp/ledger_entry.md new file mode 100644 index 00000000..67f78e1d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/ledger_entry.md @@ -0,0 +1,95 @@ +--- +title: "ledger_entry" +slug: "rpc-xrp-ledger_entry" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.ledgerEntry({ + ledgerIndex: 'validated', + index: '7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4' +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +In this example, we're initializing the SDK for the XRP network and calling the `ledgerEntry` method with a specific ledger index and object ID. + +### Overview + +The `ledgerEntry` method of Tatum SDK facilitates interaction with the XRP Ledger. This method allows you to retrieve a single ledger object from the XRP Ledger in its raw format. It is a powerful and flexible tool with numerous use-cases such as obtaining account details, checking the state of an offer, retrieving trust lines, and much more. + +This method is comprehensive and can retrieve several different types of data. The specific type of item you wish to retrieve can be selected by passing the appropriate parameters. + +{% embed url="https://codepen.io/tatum-devrel/pen/QWJPZmE" %} + +### Parameters + +The `ledgerEntry` method accepts a parameter of `LedgerEntryOptions` type, which may contain the following fields: + +* `index`: the object ID of a single object to retrieve from the ledger, as a 64-character (256-bit) hexadecimal string. +* `accountRoot`: the classic address of the AccountRoot object to retrieve. +* `directory`: the object ID of the directory or an object requiring either `dir_root` or `owner` as a sub-field, plus optionally a `sub_index` sub-field. +* `offer`: the unique object ID to the Offer or an object requiring the sub-fields `account` and `seq` to uniquely identify the offer. +* `rippleState`: an object specifying the RippleState (trust line) object to retrieve, with the `accounts` and `currency` sub-fields required. +* `check`: the object ID of a Check object to retrieve. +* `escrow`: the object ID of the Escrow or an object requiring `owner` and `seq` sub-fields. +* `paymentChannel`: the object ID of a PayChannel object to retrieve. +* `depositPreauth`: the object ID of the DepositPreauth object or an object requiring `owner` and `authorized` sub-fields. +* `ticket`: the object ID of the Ticket or an object requiring `account` and `ticket_seq` sub-fields. +* `nftPage`: the object ID of an NFT Page to retrieve. + +### Return Object + +The `ledger_entry` response provides information about a specific ledger object and follows the standard format. A successful result contains the following fields: + +* `index`: A string representing the unique ID of the ledger object. +* `ledger_index`: An unsigned integer representing the ledger index of the ledger that was used when retrieving this data. +* `node`: An object containing the data of the ledger object, according to the ledger format. This field is omitted if the "binary": true parameter is specified. +* `node_binary`: A string representing the binary representation of the ledger object in hexadecimal format. This field is included only if the "binary": true parameter is specified. + +### JSON-RPC Request Example + +```json +{ + "method": "ledger_entry", + "params": [ + { + "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4", + "ledger_index": "validated" + } + ] +} +``` + +In this example, we're requesting a ledger entry for a particular object ID and using the 'validated' ledger index. + +### JSON-RPC Response Example + +```json +{ + "result": { + "ledger_index": 464, + "nft_page": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4", + "ledger_index": "validated" + }] +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/manifest.md b/v1.0/RPC Nodes/others/rpc-xrp/manifest.md new file mode 100644 index 00000000..7279b3a8 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/manifest.md @@ -0,0 +1,85 @@ +--- +title: "manifest" +slug: "rpc-xrp-manifest" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.manifest('nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p') + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `manifest` method is a specialized RPC method provided by the Ripple (XRP) blockchain to report the current "manifest" information for a given validator's public key. The "manifest" is a block of data that authorizes an ephemeral signing key with a signature from the validator's master key pair. + +This method is particularly useful in scenarios where one needs to verify the authenticity of a validator. It could also be used to gather information about a validator's association with a domain, its ephemeral and master keys, and the sequence number of its manifest. + +{% embed url="https://codepen.io/tatum-devrel/pen/PoxgXRB" %} + +### Parameters + +The `manifest` method accepts a single parameter: + +* `publicKey`: The base58-encoded public key of the validator to look up. This can be the master public key or ephemeral public key. + +### Return Object + +The `manifest` method returns an object with the following fields: + +* `details`: An object containing detailed information about the manifest. This field is omitted if the server does not have a manifest for the `public_key` from the request. The details object has the following fields: + * `domain`: The domain name this validator claims to be associated with. If the manifest does not contain a domain, this is an empty string. + * `ephemeral_key`: The ephemeral public key for this validator, in base58. + * `master_key`: The master public key for this validator, in base58. + * `seq`: The sequence number of this manifest. This number increases whenever the validator operator updates the validator's token to rotate ephemeral keys or change settings. +* `manifest`: The full manifest data in base64 format. This data is serialized to binary before being base64-encoded. This field is omitted if the server does not have a manifest for the `public_key` from the request. +* `requested`: The `public_key` from the request. +* `status`: The status of the request, typically "success". + +### JSON-RPC Request Example + +```json +{ + "method": "manifest", + "params": [{ + "public_key":"nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p" + }] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "details": { + "domain": "", + "ephemeral_key": "n9J67zk4B7GpbQV5jRQntbgdKf7TW6894QuG7qq1rE5gvjCu6snA", + "master_key": "nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p", + "seq": 1 + }, + "manifest": "JAAAAAFxIe3AkJgOyqs3y+UuiAI27Ff3Mrfbt8e7mjdo06bnGEp5XnMhAhRmvCZmWZXlwShVE9qXs2AVCvhVuA/WGYkTX/vVGBGwdkYwRAIgGnYpIGufURojN2cTXakAM7Vwa0GR7o3osdVlZShroXQCIH9R/Lx1v9rdb4YY2n5nrxdnhSSof3U6V/wIHJmeao5ucBJA9D1iAMo7YFCpb245N3Czc0L1R2Xac0YwQ6XdGT+cZ7yw2n8JbdC3hH8Xu9OUqc867Ee6JmlXtyDHzBdY/hdJCQ==", + "requested": "nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p", + "status": "success" + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/nft_buy_offers.md b/v1.0/RPC Nodes/others/rpc-xrp/nft_buy_offers.md new file mode 100644 index 00000000..852300b3 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/nft_buy_offers.md @@ -0,0 +1,86 @@ +--- +title: "nft_buy_offers" +slug: "rpc-xrp-nft_buy_offers" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const nftId = '00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007' + +const res = await tatum.rpc.nftBuyOffers(nftId, { ledgerIndex: 'validated', limit: 250 }) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `nft_buy_offers` method is used to get a list of active buy offers for a specific NFToken. This allows users to track and analyze offers for a particular token and make informed decisions based on the market demand. + +{% embed url="https://codepen.io/tatum-devrel/pen/Poxgxyj" %} + +### Parameters + +* `nftId` (String): The unique identifier of a NFToken object. +* `options` (Ledger & Pagination): Optional parameter that includes details about the ledger to use and pagination options. + +### Return Object + +The `nft_buy_offers` method returns an object that provides information about the buy offers for a specific non-fungible token (NFT). The object contains the following fields: + +* `nft_id`: A string that represents the NFT these offers are for, as specified in the request. +* `offers`: An array that contains a list of buy offers for the token. Each member of this array represents one NFTokenOffer object to buy the NFT in question and has the following fields: + * `amount`: A string or an object that represents the amount offered to buy the NFT for. This could be a string representing an amount in drops of XRP, or an object representing an amount of a fungible token. + * `flags`: A number that represents a set of bit-flags for this offer. See NFTokenOffer flags for possible values. + * `nft_offer_index`: A string that represents the ledger object ID of this offer. + * `owner`: A string that represents the account that placed this offer. +* `limit`: (May be omitted) A number that represents the limit, as specified in the request. +* `marker`: (May be omitted) A server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. This field is omitted when there are no pages of information after this one. + +### JSON-RPC Request Example + +```json +{ + "method": "nft_buy_offers", + "params": [{ + "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", + "ledger_index": "validated" + }] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", + "offers": [ + { + "amount": "1500", + "flags": 0, + "nft_offer_index": "3212D26DB00031889D4EF7D9129BB0FA673B5B40B1759564486C0F0946BA203F", + "owner": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx" + } + ], + "status": "success" + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/nft_sell_offers.md b/v1.0/RPC Nodes/others/rpc-xrp/nft_sell_offers.md new file mode 100644 index 00000000..c0a5d9f2 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/nft_sell_offers.md @@ -0,0 +1,86 @@ +--- +title: "nft_sell_offers" +slug: "rpc-xrp-nft_sell_offers" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const nftId = '00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007' + +const res = await tatum.rpc.nftSellOffers(nftId, { ledgerIndex: 'validated', limit: 250 }) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `nft_sell_offers` method is used to get a list of active sell offers for a specific NFToken. This allows users to track and analyze offers for a particular token and make informed decisions based on the market demand. + +{% embed url="https://codepen.io/tatum-devrel/pen/QWJPJZr" %} + +### Parameters + +* `nftId` (String): The unique identifier of a NFToken object. +* `options` (Ledger & Pagination): Optional parameter that includes details about the ledger to use and pagination options. + +### Return Object + +\ +The `nft_sell_offers` method returns an object that provides information about the sell offers for a specific non-fungible token (NFT). The object contains the following fields: + +* `nft_id`: A string that represents the NFT these offers are for, as specified in the request. +* `offers`: An array that contains a list of sell offers for the token. Each member of this array represents one NFTokenOffer object to sell the NFT in question and has the following fields: + * `amount`: A string or an object that represents the amount offered to sell the NFT for. This could be a string representing an amount in drops of XRP, or an object representing an amount of a fungible token. + * `flags`: A number that represents a set of bit-flags for this offer. See NFTokenOffer flags for possible values. + * `nft_offer_index`: A string that represents the ledger object ID of this offer. + * `owner`: A string that represents the account that placed this offer. +* `limit`: (May be omitted) A number that represents the limit, as specified in the request. +* `marker`: (May be omitted) A server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. This field is omitted when there are no pages of information after this one. + +### JSON-RPC Request Example + +```json +{ + "method": "nft_sell_offers", + "params": [{ + "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007" + }] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", + "offers": [ + { + "amount": "1000", + "flags": 1, + "nft_offer_index": "9E28E366573187F8E5B85CE301F229E061A619EE5A589EF740088F8843BF10A1", + "owner": "rLpSRZ1E8JHyNDZeHYsQs1R5cwDCB3uuZt" + } + ], + "status": "success" + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/noripple_check.md b/v1.0/RPC Nodes/others/rpc-xrp/noripple_check.md new file mode 100644 index 00000000..49383198 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/noripple_check.md @@ -0,0 +1,120 @@ +--- +title: "noripple_check" +slug: "rpc-xrp-noripple_check" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const result = await tatum.rpc.norippleCheck('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', 'gateway', { + transactions: true, + limit: 2 +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `noripple_check` method provides a quick way to check the status of the Default Ripple field for an account and the No Ripple flag of its trust lines, compared with the recommended settings. This can be useful for developers and administrators who want to ensure that their accounts are configured correctly, especially when managing the accounts of large or complex financial organisations. + +{% embed url="https://codepen.io/tatum-devrel/pen/poQBOLM" %} + +### Parameters + +* `account` (String): A unique identifier for the account, most commonly the account's address. +* `role` (String): Whether the address refers to a gateway or user. Recommendations depend on the role of the account. Issuers must have Default Ripple enabled and must disable No Ripple on all trust lines. Users should have Default Ripple disabled, and should enable No Ripple on all trust lines. +* `transactions` (Boolean, optional): If true, include an array of suggested transactions, as JSON objects, that you can sign and submit to fix the problems. Defaults to false. +* `limit` (Number, optional): The maximum number of trust line problems to include in the results. Defaults to 300. + +### Return Object + +The `noripple_check` method returns an object with the following fields: + +* `ledger_current_index` (Number): The ledger index of the ledger used to calculate these results. +* `problems` (Array): Array of strings with human-readable descriptions of the problems. This includes up to one entry if the account's Default Ripple setting is not as recommended, plus up to limit entries for trust lines whose No Ripple setting is not as recommended. +* `transactions` (Array): If the request specified transactions as true, this is an array of JSON objects, each of which is the JSON form of a transaction that should fix one of the described problems. The length of this array is the same as the problems array, and each entry is intended to fix the problem described at the same index into that array. + +### JSON-RPC Request Example + +```json +{ + "method": "noripple_check", + "params": [ + { + "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "ledger_index": "current", + "limit": 2, + "role": "gateway", + "transactions": true + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "ledger_current_index": 14380381, + "problems": [ + "You should immediately set your default ripple flag", + "You should clear the no ripple flag on your XAU line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", + "You should clear the no ripple flag on your USD line to rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q" + ], + "status": "success", + "transactions": [ + { + "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "Fee": 10000, + "Sequence": 1406, + "SetFlag": 8, + "TransactionType": "AccountSet" + }, + { + "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "Fee": 10000, + "Flags": 262144, + "LimitAmount": { + "currency": "XAU", + "issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", + "value": "0" + }, + "Sequence": 1407, + "TransactionType": "TrustSet" + }, + { + "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "Fee": 10000, + "Flags": 262144, + "LimitAmount": { + "currency": "USD", + "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", + "value": "5" + }, + "Sequence": 1408, + "TransactionType": "TrustSet" + } + ], + "validated": false + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ping.md b/v1.0/RPC Nodes/others/rpc-xrp/ping.md new file mode 100644 index 00000000..7b6a9e17 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/ping.md @@ -0,0 +1,70 @@ +--- +title: "ping" +slug: "rpc-xrp-ping" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.ping() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `ping` method is a simple RPC method provided by the Ripple (XRP) blockchain, used primarily to check the connection status and latency to the XRP blockchain node. It's a useful tool in debugging and network troubleshooting scenarios, as it provides an easy way to verify the connection and round-trip time between the client and the server. + +{% embed url="https://codepen.io/tatum-devrel/pen/oNQOJdw" %} + +### Parameters + +The `ping` method accepts no parameters. + +### Return Object + +The `ping` method returns a simple object with the following field: + +* `status`: The status of the request, typically "success". The presence of this field in the response indicates a successful round trip. + +The client can measure the round-trip time from the request to the response as latency. + +### JSON-RPC Request Example + +```json +{ + "method": "ping", + "params": [ + {} + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "status": "success" + } +} +``` + +This response signifies a successful connection to the XRP node. The time it takes to receive this response can be used to measure network latency. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/random.md b/v1.0/RPC Nodes/others/rpc-xrp/random.md new file mode 100644 index 00000000..a756259f --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/random.md @@ -0,0 +1,70 @@ +--- +title: "random" +slug: "rpc-xrp-random" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.random() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `random` method is an RPC method provided by the Ripple (XRP) blockchain. This command returns a random number that can be used as a source of entropy for random number generation by clients. It's particularly useful in scenarios where a high-entropy random number is required, such as cryptographic operations or unique identifier generation. + +{% embed url="https://codepen.io/tatum-devrel/pen/MWzRZXW" %} + +### Parameters + +The `random` method accepts no parameters. + +### Return Object + +The `random` method returns an object with the following fields: + +* `random`: A Random 256-bit hex value. +* `status`: The status of the request, typically "success". + +### JSON-RPC Request Example + +```json +{ + "method": "random", + "params": [ + {} + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "random": "4E57146AA47BC6E88FDFE8BAA235B900126C916B6CC521550996F590487B837A", + "status": "success" + } +} +``` + +This response includes a random 256-bit hex value generated by the XRP node. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ripple_path_find.md b/v1.0/RPC Nodes/others/rpc-xrp/ripple_path_find.md new file mode 100644 index 00000000..bf54dcb6 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/ripple_path_find.md @@ -0,0 +1,151 @@ +--- +title: "ripple_path_find" +slug: "rpc-xrp-ripple_path_find" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```typescript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network, CurrencyAmount, RipplePathFindOptions } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const destinationAmount: CurrencyAmount = { + currency: 'USD', + issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B', + value: '0.001', +} + +const res = await tatum.rpc.ripplePathFind( + 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', + 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', + destinationAmount +) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `ripple_path_find` method is a simplified version of the `path_find` method that provides a single response with a payment path that can be used immediately. It tries to find the cheapest path or combination of paths for making a payment, but it is not guaranteed that the paths returned are, in fact, the best paths. + +The method is available in both the WebSocket and JSON-RPC APIs. However, the results tend to become outdated as time passes. Instead of making multiple calls to stay updated, it is recommended to use the `path_find` method to subscribe to continued updates where possible. + +One thing to note is that pathfinding results from untrusted servers need to be handled with care. A server could be modified to return less-than-optimal paths to earn money for its operators. A server may also return poor results when under heavy load. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results. + +### Parameters + +The `ripple_path_find` method includes the following parameters: + +* `source_account`: Unique address of the account that would send funds in a transaction +* `destination_account`: Unique address of the account that would receive funds in a transaction +* `destination_amount`: Currency Amount that the destination account would receive in a transaction. Special case: New in: rippled 0.30.0 You can specify "-1" (for XRP) or provide -1 as the contents of the value field (for non-XRP currencies). This requests a path to deliver as much as possible, while spending no more than the amount specified in send\_max (if provided). +* `send_max`: (Optional) Currency Amount that would be spent in the transaction. Cannot be used with source\_currencies. New in: rippled 0.30.0 +* `source_currencies`: (Optional) Array of currencies that the source account might want to spend. Each entry in the array should be a JSON object with a mandatory currency field and optional issuer field, like how currency amounts are specified. Cannot contain more than 18 source currencies. By default, uses all source currencies available up to a maximum of 88 different currency/issuer pairs. +* `ledger_hash`: (Optional) A 20-byte hex string for the ledger version to use. (See Specifying Ledgers) +* `ledger_index`: (Optional) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers) + +### Return Object + +The `ripple_path_find` method returns a result object that includes: + +* `alternatives`: Array of objects with possible paths to take. If empty, then there are no paths connecting the source and destination accounts. +* `destination_account`: Unique address of the account that would receive a payment transaction +* `destination_currencies`: Array of strings representing the currencies that the destination accepts, as 3-letter codes like "USD" or as 40-character hex like "015841551A748AD2C1F76FF6ECB0CCCD00000000" + +Each element in the alternatives array is an object that represents a path from one possible source currency (held by the initiating account) to the destination account and currency. This object has the following fields: + +* `paths_computed`: Array of arrays of objects defining payment paths +* `source_amount`: Currency Amount that the source would have to send along this path for the destination to receive the desired amount + +### JSON-RPC Request Example + +```json +{ + "method": "ripple_path_find", + "params": [ + { + "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "destination_amount": { + "currency": "USD", + "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "value": "0.001" + }, + "source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "source_currencies": [ + { + "currency": "XRP" + }, + { + "currency": "USD" + } + ] + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "alternatives": [ + { + "paths_computed": [ + [ + { + "currency": "USD", + "issuer": "rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2", + "type": 48, + "type_hex": "0000000000000030" + }, + { + "account": "rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2", + "type": 1, + "type_hex": "0000000000000001" + }, + { + "account": "rfDeu7TPUmyvUrffexjMjq3mMcSQHZSYyA", + "type": 1, + "type_hex": "0000000000000001" + }, + { + "account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", + "type": 1, + "type_hex": "0000000000000001" + } + ] + ], + "source_amount": "207414" + } + ], + "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", + "destination_currencies": [ + "USD", + "JOE", + "BTC", + "DYM", + "CNY", + "EUR", + "015841551A748AD2C1F76FF6ECB0CCCD00000000", + "MXN", + "XRP" + ], + "status": "success" + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/server_info.md b/v1.0/RPC Nodes/others/rpc-xrp/server_info.md new file mode 100644 index 00000000..f2edc91a --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/server_info.md @@ -0,0 +1,172 @@ +--- +title: "server_info" +slug: "rpc-xrp-server_info" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +// Initialize Tatum SDK for XRP +const tatum = await TatumSDK.init({network: Network.XRP}) + +// Call the serverInfo method +const serverInfo = await tatum.rpc.serverInfo() + +console.log(serverInfo) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `serverInfo` method provides a human-readable version of various information about the rippled server being queried. This information can be crucial for understanding the current state of the server, including its uptime, validation quorum, current ledger sequence, transaction load, and much more. + +Use cases for `serverInfo` include: + +* Monitoring server performance and resource usage. +* Checking the server's connection status to the XRP Ledger network. +* Investigating the server's ledger history and validation status. + +{% embed url="https://codepen.io/Martin-Zemanek/pen/JjeXYxB" %} + +### Parameters + +The `serverInfo` method doesn't require any parameters. + +Here are the fields for the `server_info` method: + +* `amendment_blocked`: (May be omitted) A Boolean value that indicates whether this server is amendment blocked. If the server is not amendment blocked, the response omits this field. +* `build_version`: A string that represents the version number of the running `rippled` server. +* `closed_ledger`: (May be omitted) An object that provides information about the most recently closed ledger that has not been validated by consensus. If the most recently validated ledger is available, the response omits this field and includes `validated_ledger` instead. The member fields are the same as the `validated_ledger` field. +* `complete_ledgers`: A string that indicates the range of ledger versions the local `rippled` has in its database. This may be a disjoint sequence. If the server does not have any complete ledgers, this is the string "empty". +* `hostid`: On an admin request, returns the hostname of the server running the `rippled` instance; otherwise, returns a single RFC-1751 word based on the node public key. +* `io_latency_ms`: A number that shows the amount of time spent waiting for I/O operations, in milliseconds. If this number is high, then the `rippled` server is probably having serious load issues. +* `jq_trans_overflow`: The number of times (since starting up) that this server has had over 250 transactions waiting to be processed at once. A large number here may mean that your server is unable to handle the transaction load of the XRP Ledger network. +* `last_close`: An object that provides information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating. + * `last_close.converge_time_s`: A number that represents the amount of time it took to reach a consensus on the most recently validated ledger version, in seconds. + * `last_close.proposers`: A number that shows how many trusted validators the server considered (including itself, if configured as a validator) in the consensus process for the most recently validated ledger version. +* `load`: (Admin only) An object that provides detailed information about the current load state of the server. + * `load.job_types`: (Admin only) An array that provides information about the rate of different types of jobs the server is doing and how much time it spends on each. + * `load.threads`: (Admin only) A number that shows the number of threads in the server's main job pool. +* `load_factor`: A number that represents the load-scaled open ledger transaction cost the server is currently enforcing, as a multiplier on the base transaction cost. +* `load_factor_local`: (May be omitted) A number that represents the current multiplier to the transaction cost based on load to this server. +* `load_factor_net`: (May be omitted) A number that represents the current multiplier to the transaction cost being used by the rest of the network (estimated from other servers' reported load values). +* `load_factor_cluster`: (May be omitted) A number that represents the current multiplier to the transaction cost based on load to servers in this cluster. +* `load_factor_fee_escalation`: (May be omitted) A number that represents the current multiplier to the transaction cost that a transaction must pay to get into the open ledger. +* `load_factor_fee_queue`: (May be omitted) A number that represents the current multiplier to the transaction cost that a transaction must pay to get into the queue, if the queue is full. +* `load_factor_server`: (May be omitted) A number that represents the load factor the server is enforcing, not + +including the open ledger cost. + +* `peers`: (Omitted by reporting mode servers) A number that shows how many other `rippled` servers this one is currently connected to. +* `pubkey_node`: A string that represents the public key used to verify this server for peer-to-peer communications. +* `pubkey_validator`: (Admin only) A string that represents the public key used by this node to sign ledger validations. +* `reporting`: (Reporting mode servers only) An object that provides information about this server's reporting-mode specific configurations. +* `reporting.etl_sources`: (Reporting mode servers only) An array that lists the P2P-mode servers this reporting mode is retrieving data from. +* `reporting.is_writer`: (Reporting mode servers only) A Boolean value that indicates whether this server is writing to the external database with ledger data. +* `reporting.last_publish_time`: (Reporting mode servers only) A string that represents an ISO 8601 timestamp indicating when this server last published a validated ledger to its subscription streams. +* `server_state`: A string that indicates to what extent the server is participating in the network. +* `server_state_duration_us`: A number that represents the number of consecutive microseconds the server has been in the current state. +* `state_accounting`: An object that is a map of various server states with information about the time the server spends in each. +* `state_accounting.*.duration_us`: A string that shows the number of microseconds the server has spent in this state. +* `state_accounting.*.transitions`: A string that shows the number of times the server has changed into this state. +* `time`: A string that represents the current time in UTC, according to the server's clock. +* `uptime`: A number that represents the number of consecutive seconds that the server has been operational. +* `validated_ledger`: (May be omitted) An object that provides information about the most recent fully-validated ledger. + * `validated_ledger.age`: A number that shows the time since the ledger was closed, in seconds. + * `validated_ledger.base_fee_xrp`: A number that represents the base fee, in XRP. + * `validated_ledger.hash`: A string that represents the unique hash for the ledger, as hexadecimal. + * `validated_ledger.reserve_base_xrp`: A number that represents the minimum amount of XRP (not drops) necessary for every account to keep in reserve. + * `validated_ledger.reserve_inc_xrp`: A number that represents the amount of XRP (not drops) added to the account reserve for each object an account owns in the ledger. + * `validated_ledger.seq`: A number that represents the ledger index of the latest validated ledger. +* `validation_quorum`: A number that represents the minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations. +* `validator_list_expires`: (Admin only) A string that either represents the human readable time, in UTC, when the current validator list expires, the string "unknown" if the server has yet to load a published validator list or the string "never" if the server uses a static validator list. + +### JSON-RPC Request Example + +```json +{ + "method": "server_info", + "params": [ + {} + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "info": { + "build_version": "1.9.4", + "complete_ledgers": "32570-75801747", + "hostid": "ABET", + "initial_sync_duration_us": "566800928", + "io_latency_ms": 1, + "jq_trans_overflow": "47035", + "last_close": { + "converge_time_s": 3, + "proposers": 35 + }, + "load_factor": 1, + "network_id": 0, + "peer_disconnects": "542", + "peer_disconnects_resources": "1", + "peers": 24, + "pubkey_node": "n9LvjJyaYHBWUvQUat632RrnpS7UHVLW2tLUGXSZ2yXouh4goDHX", + "server_state": "full", + "server_state_duration_us": "3612238603", + "state_accounting": { + "connected": { + "duration_us": "125498126", + "transitions": "67" + }, + "disconnected": { + "duration_us": "473415516", + "transitions": "2" + }, + "full": { + "duration_us": "4365855930299", + "transitions": "337" + }, + "syncing": { + "duration_us": "1383837914", + "transitions": "311" + }, + "tracking": { + "duration_us": "518995710", + "transitions": "374" + } + }, + "time": "2022-Nov-16 21:51:03.737667 UTC", + "uptime": 4368357, + "validated_ledger": { + "age": 1, + "base_fee_xrp": 0.00001, + "hash": "D54A94D5EF620DC212EAB5958D592EC641FC94ED92146477A04DCE5B006DFF05", + "reserve_base_xrp": 10, + "reserve_inc_xrp": 2, + "seq": 75801747 + }, + "validation_quorum": 28 + }, + "status": "success" + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/server_state.md b/v1.0/RPC Nodes/others/rpc-xrp/server_state.md new file mode 100644 index 00000000..f5af6893 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/server_state.md @@ -0,0 +1,172 @@ +--- +title: "server_state" +slug: "rpc-xrp-server_state" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.serverState() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `server_state` RPC method is used to retrieve various machine-readable information about the rippled server's current state. The response provided by this method is almost the same as the `server_info` method, but uses units that are easier to process instead of easier to read. For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds. + +This method can be useful when you need to gather specific information about the server's state, such as the build version, complete ledgers, load base, load factor, server state, and more. This information can be useful for monitoring the health and performance of a rippled server. + +{% embed url="https://codepen.io/tatum-devrel/pen/mdQgaXx" %} + +### Parameters + +The `server_state` method does not require any parameters. + +### Return Object + +The `server_state` method returns an object with the following fields: + +* `amendment_blocked`: (Optional) A Boolean value that indicates if the server is amendment blocked. This field may be omitted if the server is not amendment blocked. +* `build_version`: A string that provides the version number of the running `rippled` version. +* `complete_ledgers`: A string that indicates the sequence numbers of the ledger versions the local `rippled` has in its database. This could be a disjoint sequence like "2500-5000,32570-7695432". If the server does not have any complete ledgers (for example, if it recently started syncing with the network), this is an empty string. +* `closed_ledger`: (Optional) An object that provides information on the most recently closed ledger that has not been validated by consensus. If the most recently validated ledger is available, the response omits this field and includes `validated_ledger` instead. The member fields are the same as the `validated_ledger` field. +* `io_latency_ms`: A number that indicates the amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the `rippled` server is probably having serious load issues. +* `jq_trans_overflow`: A string-number that represents the number of times this server has had over 250 transactions waiting to be processed at once. A large number here may mean that your server is unable to handle the transaction load of the XRP Ledger network. +* `last_close`: An object that provides information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating. This object includes: + * `last_close.converge_time`: A number that shows the amount of time it took to reach a consensus on the most recently validated ledger version, in milliseconds. + * `last_close.proposers`: A number that indicates how many trusted validators the server considered (including itself, if configured as a validator) in the consensus process for the most recently validated ledger version. +* `load`: (Admin only) An object that provides detailed information about the current load state of the server. This object includes: + * `load.job_types`: (Admin only) An array that provides information about the rate of different types of jobs the server is doing and how much time it spends on each. + * `load.threads`: (Admin only) A number that indicates the number of threads in the server's main job pool. +* `load_base`: An integer that represents the baseline amount of server load used in transaction cost calculations. If the `load_factor` is equal to the `load_base` then only the base transaction cost is enforced. If the `load_factor` is higher than the `load_base`, then transaction costs are multiplied by the ratio between them. +* `load_factor`: A number that represents the load factor the server is currently enforcing. The ratio between this value and the `load_base` determines the multiplier for transaction costs. The load factor is determined by the highest of the individual server's load factor, cluster's load factor, the open ledger cost, and the overall network's load factor. +* `load_factor_fee_escalation`: (Optional) A number that indicates the current multiplier to the transaction cost to get into the open ledger, in fee levels. +* `load_factor_fee_queue`: (Optional) A number that indicates the current multiplier to the transaction cost to get into the queue, if the queue is full, in fee levels. +* `load_factor_fee_reference`: (Optional) A number that indicates the transaction cost with no load scaling, in fee levels. +* `load_factor_server`: (Optional) A number that represents the load factor the server is enforcing, not including the open ledger cost. +* `peers`: A number that shows how many other `rippled` servers this one is currently connected to. This field is omitted by reporting mode servers. +* `pubkey_node`: A string that represents the public key used to verify this server for peer-to-peer communications. This node key pair is automatically generated by the server the first time it starts up. +* `pubkey_validator`: (Admin only) A string that represents the public key used by this node to sign ledger validations. This validation key pair is derived from the `[validator_token]` or `[validation_seed]` config field. +* `reporting`: (Reporting mode servers only) An object that provides information about this server's reporting-mode specific configurations. This object includes: + * `reporting.etl_sources`: (Reporting mode servers only) An array that lists P2P-mode servers this reporting mode is retrieving data from. Each entry in this array is an ETL Source object. + * `reporting.is_writer`: (Reporting mode servers only) A Boolean value that indicates if this server is writing to the external database with ledger data. If false, it is not currently writing, possibly because another reporting mode server is currently populating a shared database, or because it's configured as read-only. + * `reporting.last_publish_time`: (Reporting mode servers only) A string that represents an ISO 8601 timestamp indicating when this server last saw a new validated ledger from any of its P2P mode sources. +* `server_state`: A string that indicates to what extent the server is participating in the network. +* `server_state_duration_us`: A number that shows the number of consecutive microseconds the server has been in the current state. +* `state_accounting`: An object that represents a map of various server states with information about the time the server spends in each. This object includes: + * `state_accounting.*.duration_us`: A string that indicates the number of microseconds the server has spent in this state. This is updated whenever the server transitions into another state. + * `state_accounting.*.transitions`: A string that shows the number of times the server has changed into this state. +* `time`: A string that indicates the current time in UTC, according to the server's clock. +* `uptime`: A number that indicates the number of consecutive seconds that the server has been operational. +* `validated_ledger`: (Optional) An object that provides information about the most recent fully-validated ledger. This object includes: + * `validated_ledger.base_fee`: A number that indicates the base fee, in drops of XRP, for propagating a transaction to the network. + * `validated_ledger.close_time`: A number that shows the time this ledger was closed, in seconds since the Ripple Epoch. + * `validated_ledger.hash`: A string that represents the unique hash of this ledger version, as hexadecimal. + * `validated_ledger.reserve_base`: A number that shows the minimum account reserve, as of the most recent validated ledger version. + * `validated_ledger.reserve_inc`: A number that shows the owner reserve for each item an account owns, as of the most recent validated ledger version. + * `validated_ledger.seq`: A number that represents the ledger index of the most recently validated ledger version. +* `validation_quorum`: A number that indicates the minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations. +* `validator_list_expires`: (Admin only) A number that shows when the current validator list expires, in seconds since the Ripple Epoch, or 0 if the server has yet to load a published validator list. + +For the `ETL Source Object`, each member of the `etl_sources` field is an object with the following fields: + +* `connected`: A Boolean value that indicates if the reporting mode server is connected to this P2P mode server. If false, the server is not connected. +* `grpc_port`: A string that shows the port number on the P2P mode server where this reporting mode server is configured to connect and retrieve ledger data via gRPC. +* `ip`: A string that represents the IP address (IPv4 or IPv6) of the P2P mode server. +* `last_message_arrival_time`: A string that represents an ISO 8601 timestamp indicating the most recent time the reporting mode server received a message from this P2P server. +* `validated_ledgers_range`: A string that shows the range of validated ledger versions this P2P mode server reports that it has available, in the same format as complete\_ledgers. +* `websocket_port`: A string that shows the port number on the P2P server where this reporting mode server is configured to forward WebSocket requests that cannot be served directly from reporting mode. + +### JSON-RPC Request Example + +```json +{ + "method": "server_state", + "params": [ + {} + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "state": { + "build_version": "1.7.2", + "complete_ledgers": "65844785-65887184", + "io_latency_ms": 3, + "jq_trans_overflow": "580", + "last_close": { + "converge_time": 3012, + "proposers": 41 + }, + "load_base": 256, + "load_factor": 134022, + "load_factor_fee_escalation": 134022, + "load_factor_fee_queue": 256, + "load_factor_fee_reference": 256, + "load_factor_server": 256, + "peer_disconnects": "792367", + "peer_disconnects_resources": "7273", + "peers": 72, + "pubkey_node": "n9LNvsFiYfFf8va6pma2PHGJKVLSyZweN1iBAkJQSeHw4GjM8gvN", + "server_state": "full", + "server_state_duration_us": "422128665555", + "state_accounting": { + "connected": { + "duration_us": "172799714", + "transitions": "1" + }, + "disconnected": { + "duration_us": "309059", + "transitions": "1" + }, + "full": { + "duration_us": "6020429212246", + "transitions": "143" + }, + "syncing": { + "duration_us": "413813232", + "transitions": "152" + }, + "tracking": { + "duration_us": "266553605", + "transitions": "152" + } + }, + "time": "2021-Aug-24 20:43:43.043406 UTC", + "uptime": 6021282, + "validated_ledger": { + "base_fee": 10, + "close_time": 683153020, + "hash": "ABEF3D24015E8B6B7184B4ABCEDC0E0E3AA4F0677FAB91C40B1E500707C1F3E5", + "reserve_base": 20000000, + "reserve_inc": 5000000, + "seq": 65887184 + }, + "validation_quorum": 33 + }, + "status": "success" + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/submit.md b/v1.0/RPC Nodes/others/rpc-xrp/submit.md new file mode 100644 index 00000000..09bad74a --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/submit.md @@ -0,0 +1,159 @@ +--- +title: "submit" +slug: "rpc-xrp-submit" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const tx = { + TransactionType: "Payment", + Account: "rBPAQmwMrt7FDDPNyjwFgwSqbWZPf6GieV", + Destination: "rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY", + Amount: "2000000", + Flags: 2147483648 +} + +const res = await tatum.rpc.submit(tx, { + secret: 's████████████████████████████' +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `submit` method is an RPC method in the XRP Ledger which is used to apply a transaction and send it to the network for confirmation and inclusion in future ledgers. It has two modes: Submit-only mode, where a signed and serialized transaction is submitted as-is, and Sign-and-submit mode, where a JSON-formatted transaction object is completed, signed, and then submitted. It is generally recommended to use the Submit-only mode for robustness. + +Use cases for this method include submitting transactions to the XRP ledger, such as sending payments, managing trust lines, or deploying smart contracts. + +{% embed url="https://codepen.io/tatum-devrel/pen/LYXvXLw" %} + +### Parameters + +The `submit` method takes the following parameters: + +* `tx` (required): A string or JSON object representing the transaction to be submitted. This can be a hex representation of the signed transaction or a transaction definition in JSON format. +* `options` (optional): An object containing additional parameters. These can include: + * `secret` (optional): The secret seed of the account. + * `seed` (optional): The secret seed of the account in the XRP Ledger's base58 format. + * `seedHex` (optional): The secret seed of the account in the hexadecimal format. + * `passphrase` (optional): The secret seed of the account as the string passphrase. + * `keyType` (optional): The signing algorithm of the cryptographic key pair provided (secp256k1 or ed25519). + * `failHard` (optional): If true, and the transaction fails locally, do not retry or relay the transaction to other servers. + * `offline` (optional): If true, when constructing the transaction, do not try to automatically fill in or validate values. + * `buildPath` (optional): If true, the server auto-fills the Paths field of a Payment transaction before signing. + * `feeMultMax` (optional): Sign-and-submit fails with the error rpcHIGH\_FEE if the auto-filled Fee value would be greater than the reference transaction cost × feeMultMax ÷ feeDivMax. + * `feeDivMax` (optional): Sign-and-submit fails with the error rpcHIGH\_FEE if the auto-filled Fee value would be greater than the reference transaction cost × feeMultMax ÷ feeDivMax. + +### Return Object + +The `submit` method returns an object that provides information about the result of the submitted transaction. The object contains the following fields: + +* `engine_result`: A string that represents a code indicating the preliminary result of the transaction, for example, "tesSUCCESS". +* `engine_result_code`: An integer that represents a numeric version of the result code. This is directly correlated to the `engine_result`. +* `engine_result_message`: A string that represents a human-readable explanation of the transaction's preliminary result. +* `tx_blob`: A string that represents the complete transaction in hexadecimal string format. +* `tx_json`: An object that represents the complete transaction in JSON format. +* `accepted`: A boolean value that indicates whether the transaction was accepted. This field is omitted in sign-and-submit mode. +* `account_sequence_available`: A number indicating the next Sequence Number available for the sending account after all pending and queued transactions. This field is omitted in sign-and-submit mode. +* `account_sequence_next`: A number indicating the next Sequence Number for the sending account after all transactions that have been provisionally applied, but not transactions in the queue. This field is omitted in sign-and-submit mode. +* `applied`: A boolean value indicating whether the transaction was applied to the open ledger. This field is omitted in sign-and-submit mode. +* `broadcast`: A boolean value indicating whether the transaction was broadcast to peer servers in the peer-to-peer XRP Ledger network. This field is omitted in sign-and-submit mode. +* `kept`: A boolean value indicating whether the transaction was kept to be retried later. This field is omitted in sign-and-submit mode. +* `queued`: A boolean value indicating whether the transaction was put in the Transaction Queue. This field is omitted in sign-and-submit mode. +* `open_ledger_cost`: A string indicating the current open ledger cost before processing this transaction. Transactions with a lower cost are likely to be queued. This field is omitted in sign-and-submit mode. +* `validated_ledger_index`: An integer indicating the ledger index of the newest validated ledger at the time of submission. This field is omitted in sign-and-submit mode. + +### JSON-RPC Request Example - Submit Only + +```json +{ + "method": "submit", + "params": [ + { + "tx_blob": "1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754" + } + ] +} +``` + +### JSON-RPC Request Example - Submit Only + +```json +{ + "method": "submit", + "params": [ + { + "offline": false, + "secret": "s████████████████████████████", + "tx_json": { + "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", + "Amount": { + "currency": "USD", + "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", + "value": "1" + }, + "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", + "TransactionType": "Payment" + }, + "fee_mult_max": 1000 + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "accepted" : true, + "account_sequence_available" : 362, + "account_sequence_next" : 362, + "applied" : true, + "broadcast" : true, + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied. Only final in a validated ledger.", + "status": "success", + "kept" : true, + "open_ledger_cost": "10", + "queued" : false, + "tx_blob": "1200002280000000240000016961D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F181144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754", + "tx_json": { + "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", + "Amount": { + "currency": "USD", + "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", + "value": "1" + }, + "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", + "Fee": "10000", + "Flags": 2147483648, + "Sequence": 361, + "SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB", + "TransactionType": "Payment", + "TxnSignature": "3045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F1", + "hash": "5B31A7518DC304D5327B4887CD1F7DC2C38D5F684170097020C7C9758B973847" + } + }, + "validated_ledger_index" : 21184416 +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/submit_multisigned.md b/v1.0/RPC Nodes/others/rpc-xrp/submit_multisigned.md new file mode 100644 index 00000000..3799ee33 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/submit_multisigned.md @@ -0,0 +1,117 @@ +--- +title: "submit_multisigned" +slug: "rpc-xrp-submit_multisigned" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const txJson = { /* your transaction JSON here */ } +const options = { failHard: true } // optional + +const res = await tatum.rpc.submitMultisigned(txJson, options) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `submitMultisigned` method in the XRP RPC API allows you to apply a multi-signed transaction and send it to the network to be included in future ledgers. This method requires the MultiSign amendment to be enabled and was introduced in rippled 0.31.0. + +This method is used when multiple parties are required to authorise a transaction, which can be a useful feature for securing high-value accounts, implementing distributed decision-making processes, or creating more complex authorisation structures for transactions. + +{% embed url="https://codepen.io/tatum-devrel/pen/XWyQyao" %} + +### Parameters + +* `txJson` (TxJson): The transaction in JSON format with an array of Signers. To be successful, the weights of the signatures must be equal to or higher than the quorum of the SignerList. +* `options` (FailOption, optional): This parameter is optional. If `failHard` is true, and the transaction fails locally, it will not retry or relay the transaction to other servers. The default is false. + +### Return Object + +The `submit_multisigned` method returns an object that provides information about the result of the submitted multisigned transaction. The object contains the following fields: + +* `engine_result`: A string that represents a code indicating the preliminary result of the transaction, for example, "tesSUCCESS". +* `engine_result_code`: An integer that represents a numeric code indicating the preliminary result of the transaction. This is directly correlated to the `engine_result`. +* `engine_result_message`: A string that represents a human-readable explanation of the preliminary transaction result. +* `tx_blob`: A string that represents the complete transaction in hexadecimal string format. +* `tx_json`: An object that represents the complete transaction in JSON format. + +### JSON-RPC Request Example + +```json +{ + "method": "submit_multisigned", + "params": [ + { + "tx_json": { + "Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC", + "Fee": "30000", + /* ... rest of the transaction ... */ + }, + "fail_hard": true + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "engine_result": "tesSUCCESS", + "engine_result_code": 0, + "engine_result_message": "The transaction was applied. Only final in a validated ledger.", + "status": "success", + "tx_blob": "120014220004000024000000046380000000000000000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF74473045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B78114204288D2E47F8EF6C99BCC457966320D12409711E1E010732103398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C174473045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D0881143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1", + "tx_json": { + "Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC", + "Fee": "30000", + "Flags": 262144, + "LimitAmount": { + "currency": "USD", + "issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "value": "0" + }, + "Sequence": 4, + "Signers": [ + { + "Signer": { + "Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW", + "SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF", + "TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7" + } + }, + { + "Signer": { + "Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n", + "SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1", + "TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08" + } + } + ], + "SigningPubKey": "", + "TransactionType": "TrustSet", + "hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8" + } + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/transaction_entry.md b/v1.0/RPC Nodes/others/rpc-xrp/transaction_entry.md new file mode 100644 index 00000000..bae237f6 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/transaction_entry.md @@ -0,0 +1,92 @@ +--- +title: "transaction_entry" +slug: "rpc-xrp-transaction_entry" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum + +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const res = await tatum.rpc.transactionEntry('C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9', { + ledgerIndex: '56865245', +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `transaction_entry` method retrieves information on a single transaction from a specific ledger version. It does not search all ledgers for the specified transaction, unlike the `tx` method, which does. The `transaction_entry` method is useful for fetching transaction data from a specified ledger, making it an essential method for auditing or tracking transaction histories. + +It's important to note that this method does not support retrieving information from the current in-progress ledger. A ledger version must be specified in either `ledger_index` or `ledger_hash`. + +This method can fail to find the transaction due to the following reasons: + +* The transaction does not exist. +* The transaction exists, but not in the specified ledger version. +* The server does not have the specified ledger version available. Another server that has the correct version on hand may have a different response. + +{% embed url="https://codepen.io/tatum-devrel/pen/xxQeQXN" %} + +### Parameters + +The parameters required for this method are: + +* `txHash`: (String) The unique hash of the transaction you are looking up. +* `options`: (Ledger) Options for specifying the ledger to use. It includes the following properties: + * `ledger_hash`: (Optional) A 20-byte hex string for the ledger version to use. + * `ledger_index`: (Optional) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. + +### Return Object + +The `transaction_entry` method returns an object that provides detailed information about a transaction from a specified ledger. The object contains the following fields: + +* `ledger_index`: A number that represents the ledger index of the ledger version the transaction was found in; this is the same as the one from the request. +* `ledger_hash`: A string that represents the identifying hash of the ledger version the transaction was found in; this is the same as the one from the request. This field may be omitted. +* `metadata`: An object that represents the transaction metadata. This shows the exact results of the transaction in detail. +* `tx_json`: An object that represents the JSON representation of the Transaction object. + +### JSON-RPC Request Example + +```json +{ + "method": "transaction_entry", + "params": [ + { + "tx_hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", + "ledger_index": 56865245 + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "ledger_hash": "793E56131D8D4ABFB27FA383BFC44F2978B046E023FF46C588D7E0C874C2472A", + "ledger_index": 56865245, + "metadata": { /* Detailed result of the transaction */ }, + "status": "success", + "tx_json": { /* JSON representation of the Transaction object */ }, + "validated": true + } +} +``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/tx.md b/v1.0/RPC Nodes/others/rpc-xrp/tx.md new file mode 100644 index 00000000..84ba9b4f --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-xrp/tx.md @@ -0,0 +1,199 @@ +--- +title: "tx" +slug: "rpc-xrp-tx" +excerpt: "XRP RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "XRP RPC" + image: [] + keywords: "xrp, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +```javascript +// yarn add @tatumio/tatum +import { TatumSDK, Xrp, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.XRP}) + +const transactionDetails = await tatum.rpc.tx('C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9', { + binary: false, + minLedger: 10000, + maxLedger: 20000, +}) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` + +### Overview + +The `tx` method in XRP ledger's RPC API retrieves information on a single transaction by its identifying hash. It is primarily used for querying details about specific transactions that have occurred on the XRP Ledger. The transaction could be any type of operation such as a payment, offer creation, offer cancellation, trust set operation, etc. + +This method can be very useful when tracking payment statuses, auditing transactions, or developing blockchain analysis tools. However, it should be noted that the command may successfully find the transaction even if it is included in a ledger outside the range of min\_ledger to max\_ledger. + +{% embed url="https://codepen.io/tatum-devrel/pen/ExOJOQJ" %} + +### Parameters + +The `tx` method accepts the following parameters: + +* `transaction`: (Type: String) The 256-bit hash of the transaction, as hex. +* `binary`: (Type: Boolean, Optional) If true, return transaction data and metadata as binary serialized to hexadecimal strings. If false, return transaction data and metadata as JSON. The default is false. +* `minLedger`: (Type: Number, Optional) Use this with `maxLedger` to specify a range of up to 1000 ledger indexes, starting with this ledger (inclusive). +* `maxLedger`: (Type: Number, Optional) Use this with `minLedger` to specify a range of up to 1000 ledger indexes, ending with this ledger (inclusive). + +### Return Object + +The `tx` method returns an object that provides information about a prepared transaction. The object contains the following fields: + +* `date`: A number that represents the number of seconds since January 1, 2000 (00:00 UTC) indicating the close time of the ledger in which the transaction was applied. This value does not have a precise relationship with physical time, and is dependent on the close time resolution. +* `hash`: A string that represents the SHA-512 hash of the transaction. +* `inLedger`: (Deprecated) An alias for `ledger_index`. +* `ledger_index`: A number that represents the ledger index of the ledger that includes this transaction. +* `meta`: An object (JSON) or a string (binary) that represents the transaction metadata, which describes the results of the transaction. +* `validated`: A boolean that indicates if this data comes from a validated ledger version; if omitted or set to false, this data is not final. +* `(Various)`: (Various) Other fields from the Transaction object. + +### JSON-RPC Request Example + +```json +{ + "method": "tx", + "params": [ + { + "transaction": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", + "binary": false, + "minLedger": 10000, + "maxLedger": 20000 + } + ] +} +``` + +### JSON-RPC Response Example + +```json +{ + "result": { + "Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", + "Fee": "12", + "Flags": 0, + "LastLedgerSequence": 56865248, + "OfferSequence": 5037708, + "Sequence": 5037710, + "SigningPubKey": "03B51A3EDF70E4098DA7FB053A01C5A6A0A163A30ED1445F14F87C7C3295FCB3BE", + "TakerGets": "15000000000", + "TakerPays": { + "currency": "CNY", + "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", + "value": "20160.75" + }, + "TransactionType": "OfferCreate", + "TxnSignature": "3045022100A5023A0E64923616FCDB6D664F569644C7C9D1895772F986CD6B981B515B02A00220530C973E9A8395BC6FE2484948D2751F6B030FC7FB8575D1BFB406368AD554D9", + "date": 648248020, + "hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", + "inLedger": 56865245, + "ledger_index": 56865245, + "meta": { + "AffectedNodes": [ + { + "ModifiedNode": { + "FinalFields": { + "ExchangeRate": "4F04C66806CF7400", + "Flags": 0, + "RootIndex": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400", + "TakerGetsCurrency": "0000000000000000000000000000000000000000", + "TakerGetsIssuer": "0000000000000000000000000000000000000000", + "TakerPaysCurrency": "000000000000000000000000434E590000000000", + "TakerPaysIssuer": "CED6E99370D5C00EF4EBF72567DA99F5661BFB3A" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", + "Balance": "10404767991", + "Flags": 0, + "OwnerCount": 3, + "Sequence": 5037711 + }, + "LedgerEntryType": "AccountRoot", + "LedgerIndex": "1DECD9844E95FFBA273F1B94BA0BF2564DDF69F2804497A6D7837B52050174A2", + "PreviousFields": { + "Balance": "10404768003", + "Sequence": 5037710 + }, + "PreviousTxnID": "4DC47B246B5EB9CCE92ABA8C482479E3BF1F946CABBEF74CA4DE36521D5F9008", + "PreviousTxnLgrSeq": 56865244 + } + }, + { + "DeletedNode": { + "FinalFields": { + "Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", + "BookDirectory": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400", + "BookNode": "0000000000000000", + "Flags": 0, + "OwnerNode": "0000000000000000", + "PreviousTxnID": "8F5FF57B404827F12BDA7561876A13C3E3B3095CBF75334DBFB5F227391A660C", + "PreviousTxnLgrSeq": 56865244, + "Sequence": 5037708, + "TakerGets": "15000000000", + "TakerPays": { + "currency": "CNY", + "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", + "value": "20160.75" + } + }, + "LedgerEntryType": "Offer", + "LedgerIndex": "26AAE6CA8D29E28A47C92ADF22D5D96A0216F0551E16936856DDC8CB1AAEE93B" + } + }, + { + "ModifiedNode": { + "FinalFields": { + "Flags": 0, + "IndexNext": "0000000000000000", + "IndexPrevious": "0000000000000000", + "Owner": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", + "RootIndex": "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548" + }, + "LedgerEntryType": "DirectoryNode", + "LedgerIndex": "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548" + } + }, + { + "CreatedNode": { + "LedgerEntryType": "Offer", + "LedgerIndex": "8BAEE3C7DE04A568E96007420FA11ABD0BC9AE44D35932BB5640E9C3FB46BC9B", + "NewFields": { + "Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", + "BookDirectory": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400", + "Sequence": 5037710, + "TakerGets": "15000000000", + "TakerPays": { + "currency": "CNY", + "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", + "value": "20160.75" + } + } + } + } + ], + "TransactionIndex": 0, + "TransactionResult": "tesSUCCESS" + }, + "status": "success", + "validated": true + } +} +```