diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getBigMapValue.md b/v1.0/RPC Nodes/others/rpc-tezos/getBigMapValue.md deleted file mode 100644 index cac57c49..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getBigMapValue.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: "getBigMapValue" -slug: "rpc-tezos-getBigMapValue" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the contract ID -const contractId = { contractId: 'YOUR_CONTRACT_ID' }; - -// Retrieve the value from a big map associated with a Tezos smart contract -const bigMapValue = await tatum.rpc.getBigMapValue(contractId); - -// Log the value from the big map -console.log(`Value from Big Map for Contract ${contractId.contractId}:`, bigMapValue); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getBigMapValue` method is used to retrieve the value associated with a specific key from a big map associated with a Tezos smart contract. Big maps are used to store and retrieve key-value pairs within smart contracts. - -### Example Use Cases: - -1. **Data Retrieval:** Developers and users can use this method to query and retrieve specific data stored in a big map within a Tezos smart contract. This is particularly useful for accessing relevant information within decentralized applications. - -2. **Contract Interaction:** Smart contracts may use big maps to store and manage data. Developers interacting with such contracts can use this method to access the data they need for contract interactions. - -### Request Parameters - -The `getBigMapValue` method requires the following parameter: - -- `contractId` (string, required): A contract identifier encoded in b58check, representing the Tezos smart contract that contains the big map. - -### Return Object - -The method returns an object containing the following properties: - -- `key` (string): The key used to query the big map and retrieve the associated value. - -- `type` (string): The type of the value associated with the specified key in the big map. - -Users can use this method to access and utilize data stored within big maps in Tezos smart contracts. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getBlock.md b/v1.0/RPC Nodes/others/rpc-tezos/getBlock.md deleted file mode 100644 index 4416e5fe..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getBlock.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: "getBlock" -slug: "rpc-tezos-getBlock" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the chain ID and block ID (Replace placeholders with actual values) -const params = { - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID (hash) -}; - -// Fetch details of a specific block by its ID -const blockDetails = await tatum.rpc.getBlock(params); - -// Log the block details -console.log('Block Details:', blockDetails); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getBlock` method allows you to retrieve detailed information about a specific block within a Tezos chain. By providing the chain ID and block ID as parameters, you can access various data associated with the chosen block, including its hash, timestamp, operations, and more. - -### Example use cases: - -1. **Block Inspection:** - Developers and analysts can use this method to inspect and verify the details of a specific block on the Tezos blockchain. This can be useful for auditing purposes. - -2. **Transaction Confirmation:** - Applications built on Tezos may use this method to confirm the inclusion of specific transactions in a block, ensuring their execution. - -3. **Historical Data Retrieval:** - Researchers may need to retrieve historical data from specific blocks for data analysis, historical record-keeping, or statistical analysis. - -### Request Parameters - -The `getBlock` method requires the following parameters: - -- `chainId` (string, required): - The identifier of the Tezos chain from which to retrieve the block. - -- `blockId` (string, required): - The unique identifier (hash) of the block for which you want to retrieve details. - -### Return Object - -The `getBlock` method returns an object containing various details about the requested block: - -- `protocol` (string): The protocol identifier, e.g., "PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf". -- `chain_id` (string): The chain's unique identifier, e.g., "NetXdQprcVkpaWU". -- `hash` (string): The hash of the block, e.g., "BLVRfBFc8Mb7s4PUacDfaeQTPj9HtzTNEArM1Ni1YbxRuK73htp". -- `level` (integer): The level (block number) of the block, e.g., 4456790. -- `proto` (integer): The protocol version, e.g., 17. -- `predecessor` (string): The hash of the block's predecessor. -- `timestamp` (string): The block's timestamp, e.g., "2023-10-24T11:21:30Z". -- `validation_pass` (integer): The number of validation passes, e.g., 4. -- `operations_hash` (string): The hash of the operations included in this block. - -(Note: There are additional fields in the response not covered in this list, such as `fitness`, `context`, and `signature` which provide further information about the block.) diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getBlockHash.md b/v1.0/RPC Nodes/others/rpc-tezos/getBlockHash.md deleted file mode 100644 index e578fa56..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getBlockHash.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: "getBlockHash" -slug: "rpc-tezos-getBlockHash" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the chain ID and block ID (Replace placeholders with actual values) -const params = { - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID (hash) -}; - -// Fetch the hash of a specific block by its ID -const blockHash = await tatum.rpc.getBlockHash(params); - -// Log the block hash -console.log('Block Hash:', blockHash); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getBlockHash` method allows you to retrieve the hash of a specific block within a Tezos chain. By providing the chain ID and block ID as parameters, you can access the unique hash associated with the chosen block. - -### Example use cases: - -1. **Block Identification:** - Developers and applications can use this method to identify and reference a specific block on the Tezos blockchain using its hash. - -2. **Transaction Verification:** - When verifying transactions or interactions with smart contracts, you may need the block hash as part of the verification process. - -3. **Historical Data Retrieval:** - Researchers and analysts can retrieve block hashes for historical data analysis and record-keeping. - -### Request Parameters - -The `getBlockHash` method requires the following parameters: - -- `chainId` (string, required): - The identifier of the Tezos chain from which to retrieve the block hash. - -- `block` (string, required): - The unique identifier (hash) of the block for which you want to retrieve the hash. - -### Return Object - -The `getBlockHash` method returns a string representing the hash of the requested block. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getBlockHashes.md b/v1.0/RPC Nodes/others/rpc-tezos/getBlockHashes.md deleted file mode 100644 index e08bf0bf..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getBlockHashes.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "getBlockHashes" -slug: "rpc-tezos-getBlockHashes" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch block hashes from a specific chain in Tezos using the getBlockHashes method -const blockHashes = await tatum.rpc.getBlockHashes({ - chainId: 'main', // Specify the Tezos chain ID (usually 'main' for mainnet) - length: 5, // Optional: Number of predecessor blocks to return - head: 'BLockHashHere', // Optional: Specify a block hash to fetch specific fragments of the chain - minDate: '2023-10-01' // Optional: Filter out blocks before this date -}); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getBlockHashes` method retrieves block hashes from a specified chain in Tezos, sorted by decreasing fitness. Without arguments, it returns the head of the chain. Optional arguments enable the return of the list of predecessors of a specified block or set of blocks. - -### Example use cases: - -1. **Chain Inspection:** - Quickly identify and inspect the most recent blocks in the chain by their hash, aiding in network monitoring and analysis. - -2. **Historical Data Analysis:** - Fetch specific sections of the blockchain for in-depth study or to construct a localized view of the chain's history. - -3. **Data Validation:** - Validators and node operators can use this method to cross-check and validate their local chain's state against the broader network. - -### Request Parameters - -The `getBlockHashes` method supports several optional parameters: - -- `chainId` (string, required): - The unique identifier of the Tezos chain for which block hashes are being requested. - -- `length` (uint, optional): - The number of predecessor blocks to return. - -- `head` (block_hash, optional): - An empty argument requests blocks starting from the current head. Specifying block hashes allows fetching specific fragments of the chain. - -- `minDate` (date, optional): - Blocks with a timestamp before this date will be filtered out. If `length` is also provided, up to that number of predecessors will be returned regardless of their date. - -### Return Object - -The `getBlockHashes` method returns an array of block hashes included in the specified chain: - -- An array of block hashes, sorted by decreasing fitness. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getBlockHeader.md b/v1.0/RPC Nodes/others/rpc-tezos/getBlockHeader.md deleted file mode 100644 index a01e57dc..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getBlockHeader.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: "getBlockHeader" -slug: "rpc-tezos-getBlockHeader" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the chain ID (For this example, we use "NetXdQprcVkpaWU" as a placeholder) -const params = { - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID (hash) -}; - -// Fetch the header of a specific block by its ID -const blockHeader = await tatum.rpc.getBlockHeader(params); - -// Log the block header details -console.log('Block Header:', blockHeader); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getBlockHeader` method allows you to retrieve the header of a specific block within a Tezos chain. You can use this method to fetch essential information about a particular block, such as its hash, timestamp, and other metadata. - -### Example use cases: - -1. **Block Analysis:** - Researchers and analysts can use this method to access detailed information about a specific block, enabling them to perform in-depth analysis and investigation. - -2. **Transaction Confirmation:** - Developers building applications on Tezos may need to confirm the details of a specific block to ensure the validity of transactions or smart contract interactions. - -3. **Historical Data Retrieval:** - This method is valuable for retrieving historical block data for auditing, compliance, or historical record-keeping purposes. - -### Request Parameters - -The `getBlockHeader` method requires the following parameters: - -- `chainId` (string, required): - The identifier of the Tezos chain from which to retrieve the block header. - -- `blockId` (string, required): - The unique identifier (hash) of the block for which you want to retrieve the header. - -### Return Object - -The `getBlockHeader` method returns an object with details of the block's header: - -- `protocol` (string): The protocol identifier, e.g., "PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf". -- `chain_id` (string): The chain's unique identifier, e.g., "NetXdQprcVkpaWU". -- `hash` (string): The hash of the block, e.g., "BLVRfBFc8Mb7s4PUacDfaeQTPj9HtzTNEArM1Ni1YbxRuK73htp". -- `level` (integer): The level (block number) of the block, e.g., 4456790. -- `proto` (integer): The protocol version, e.g., 17. -- `predecessor` (string): The hash of the block's predecessor. -- `timestamp` (string): The block's timestamp, e.g., "2023-10-24T11:21:30Z". -- `validation_pass` (integer): The number of validation passes, e.g., 4. -- `operations_hash` (string): The hash of the operations included in this block. - -(Note: There are additional fields in the response not covered in this list, such as `fitness`, `context`, and `signature` which provide further information about the block. The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getBlockShell.md b/v1.0/RPC Nodes/others/rpc-tezos/getBlockShell.md deleted file mode 100644 index 75f7227e..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getBlockShell.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: "getBlockShell" -slug: "rpc-tezos-getBlockShell" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Importing Tatum SDK for Tezos blockchain -import { TatumSDK, Network, Tezos } from '@tatumio/tatum'; - -// Initializing SDK for Tezos blockchain -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define parameters for the query -const params = { - chainId: 'YOUR_CHAIN_ID', // Required - blockId: 'YOUR_BLOCK_ID' // Required -}; - -// Fetching the block header shell -const blockHeaderShell = await tatum.rpc.getBlockShell(params); -console.log(blockHeaderShell); - -// Cleaning up resources used by Tatum SDK -await tatum.destroy(); -``` - -### Overview - -The `getBlockShell` method is used to retrieve the shell header of a specific block on the Tezos blockchain. - -### Request Parameters - -- `chainId` (string, required): The ID of the chain. -- `blockId` (string, required): The unique identifier (hash) of the block for which you want to retrieve the shell header. - -### Return Object - -The method returns an object representing the shell header of the specified block on the Tezos blockchain. - -- `level` (integer): The level (block number) of the block, e.g., 4000000. -- `proto` (integer): The protocol version of the block, e.g., 17. -- `predecessor` (string): The hash of the block's predecessor, e.g., "BMR5RnbukbbDw3ZXN1RbKEPYg6aFvLQuCgxPBhRLg3vmdVLbLJv". -- `timestamp` (string): The timestamp of the block, e.g., "2023-08-05T07:23:15Z". -- `validation_pass` (integer): The number of validation passes, e.g., 4. -- `operations_hash` (string): The hash of the operations included in this block, e.g., "LLoaEA9PAMVP7HGpdb4nKLM8oyVnSMy5gJBEwyftjCsyk7EhnvSm7". -- `fitness` (array): An array of fitness values, e.g., -- `context` (string): The context hash of the block, e.g., "CoW4EjrMzokDdz8v8qBPMXhrjStzuQU9bSGNFHsyej6mNkY89g7f". - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getBlocksHead.md b/v1.0/RPC Nodes/others/rpc-tezos/getBlocksHead.md deleted file mode 100644 index b90a7d33..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getBlocksHead.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "getBlocksHead" -slug: "rpc-tezos-getBlocksHead" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 - -```typescript -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the chain ID -const chainId = { chainId : 'CHAIN_ID'}; - -// Fetch the details of the latest (head) block on the specified Tezos chain -const latestBlockDetails = await tatum.rpc.getBlocksHead(chainId); - -// Log the latest block details -console.log('Latest Block Details:', latestBlockDetails); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getBlocksHead` method allows you to retrieve details about the latest (head) block on a specific Tezos chain. You can use this method to access key information about the most recent block, such as its hash, level, timestamp, and more. - -### Example Use Cases - -1. **Real-Time Data Display:** - Developers can use this method to display real-time information about the latest block on a blockchain explorer or monitoring dashboard. - -2. **Transaction Monitoring:** - Applications monitoring the Tezos blockchain can utilize this method to keep track of incoming transactions and their details. - -3. **Network Analytics:** - Researchers and analysts can gather data from the latest block for network performance analysis and reporting. - -### Request Parameters - -The `getBlocksHead` method requires the following parameter: - -- `chainId` (string, required): - The identifier of the Tezos chain for which you want to retrieve the latest block details. - -### Return Object - -The `getBlocksHead` method returns an object with details of the latest (head) block: - -- `protocol` (string): The protocol identifier, e.g., "PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf". -- `chain_id` (string): The chain's unique identifier, e.g., "NetXdQprcVkpaWU". -- `hash` (string): The hash of the latest block, e.g., "BLVRfBFc8Mb7s4PUacDfaeQTPj9HtzTNEArM1Ni1YbxRuK73htp". -- `level` (integer): The level (block number) of the latest block, e.g., 4456790. -- `proto` (integer): The protocol version, e.g., 17. -- `predecessor` (string): The hash of the block's predecessor. -- `timestamp` (string): The timestamp of the latest block, e.g., "2023-10-24T11:21:30Z". -- `validation_pass` (integer): The number of validation passes, e.g., 4. -- `operations_hash` (string): The hash of the operations included in the latest block. - -(Note: There are additional fields in the response not covered in this list, such as `fitness`, `context`, and `signature` which provide further information about the block. The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getChainId.md b/v1.0/RPC Nodes/others/rpc-tezos/getChainId.md deleted file mode 100644 index 259c7200..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getChainId.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: "getChainId" -slug: "rpc-tezos-getChainId" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch the unique chain identifier for a specific Tezos chain using the getChainId method -const chainIdentifier = await tatum.rpc.getChainId({ - chainId: 'main' // Specify the Tezos chain ID (usually 'main' for mainnet) -}); - -console.log(`The unique identifier for the chain is: ${chainIdentifier}`); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getChainId` method retrieves the unique identifier of a specified chain in Tezos. - -### Example use cases: - -1. **Chain Verification:** - To ensure that interactions and transactions are occurring on the intended Tezos chain, developers and users can validate the chain's unique identifier. - -2. **Multi-chain Environments:** - In setups where multiple Tezos chains might be in use, this method can differentiate and identify each chain uniquely. - -3. **Dynamic Chain Configuration:** - For applications that adapt to multiple chain environments, the method provides a way to fetch and set the active chain based on its identifier. - -### Request Parameters - -The `getChainId` method requires: - -- `chainId` (string, required): - The identifier of the Tezos chain from which the unique chain identifier is being requested. - -### Return Object - -The `getChainId` method returns a string: - -- The unique identifier of the specified chain. diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getConfig.md b/v1.0/RPC Nodes/others/rpc-tezos/getConfig.md deleted file mode 100644 index bcedc2a8..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getConfig.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: "getConfig" -slug: "rpc-tezos-getConfig" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch Tezos configuration information -const configInfo = await tatum.rpc.config(); - -// Log the Tezos configuration information -console.log(`Tezos Configuration:`, configInfo); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `config` method is used to retrieve configuration information about the Tezos blockchain. - -### Request Parameters - -The `config` method doesn't require specific parameters in the request body. - -### Return Object - -The method returns an object containing various configuration parameters and settings related to the Tezos blockchain. Here's a description of the top-level objects within the returned object: - -- `data-dir` (string): The data directory path for the Tezos node. - -- `rpc` (object): An object with RPC (Remote Procedure Call) related configuration details. - -- `p2p` (object): An object with peer-to-peer (P2P) related configuration details. - -- `shell` (object): An object with shell-related configuration details. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getConractTickets.md b/v1.0/RPC Nodes/others/rpc-tezos/getConractTickets.md deleted file mode 100644 index 5db2e585..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getConractTickets.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: "getConractTickets" -slug: "rpc-tezos-getConractTickets" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the contract ID -const params = { - contractId: 'YOUR_CONTRACT_ID', - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID if needed -}; - -// Retrieve all ticket balances for a specific Tezos smart contract -const ticketBalances = await tatum.rpc.getConractTickets(params); - -// Log the ticket balances -console.log(`All Ticket Balances for Contract ${contractId}:`, ticketBalances); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getConractTickets` method is used to retrieve the balances of all tickets associated with a specific Tezos smart contract. Tickets represent assets or tokens held within a smart contract, and this method provides information about those assets' balances. - -### Example Use Cases: - -1. **Asset Management:** Developers and users can use this method to query the balances of all tickets held within a Tezos smart contract. This is particularly useful for asset management and tracking within decentralized applications. - -2. **Audit and Verification:** Auditors and verifiers can check the ticket balances within a smart contract to ensure that the contract behaves as expected and that all assets are accounted for. - -### Request Parameters - -The `getConractTickets` method requires the following parameter: - -- `contractId` (string, required): The contract ID (address) of the Tezos smart contract for which you want to retrieve the ticket balances. -- `chainId` (string, required): The ID of the chain where the block is located. -- `blockId` (string, required): The unique identifier (hash) of the block. - -### Return Object - -The method returns an array of objects, each representing a ticket balance within the specified Tezos smart contract. Each object includes the following properties: - -- `ticketer` (string): The ticketer associated with the ticket balance. - -- `content_type` (string): The content type of the ticket. - -- `content` (string): The content associated with the ticket. - -- `amount` (string): The amount or balance of the ticket. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getConstants.md b/v1.0/RPC Nodes/others/rpc-tezos/getConstants.md deleted file mode 100644 index 3908fb1d..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getConstants.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -title: "getConstants" -slug: "rpc-tezos-getConstants" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch the constants from the Tezos blockchain -const constants = await tatum.rpc.getConstants(); - -// Log the constants -console.log('Tezos Constants:', constants); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getConstants` method allows you to retrieve all the constants from the Tezos blockchain. These constants include various operational parameters like proof of work nonce size, max operation data length, and others that are crucial for understanding the blockchain's current configuration. - -### Example use cases: - -1. **Blockchain Configuration Analysis:** - Developers and researchers can use this method to obtain detailed information about the Tezos blockchain's current configuration, aiding in development and analysis. - -2. **Smart Contract Development:** - Smart contract developers can use these constants to better understand the operational parameters of the Tezos blockchain, ensuring their contracts are optimized for the current environment. - -3. **Operational Monitoring:** - This method can be used for monitoring the blockchain's parameters, which can be crucial for applications that depend on these constants for their operation. - -### Request Parameters - -The `getConstants` method does not require any parameters. - -### Return Object - -The `getConstants` method returns an object containing various constants from the Tezos blockchain. These constants include, but are not limited to: - -- `proof_of_work_nonce_size` (number): Size of the nonce in proof of work. -- `nonce_length` (number): Length of the nonce. -- `max_anon_ops_per_block` (number): Maximum anonymous operations per block. -- `max_operation_data_length` (number): Maximum data length for operations. -- `max_proposals_per_delegate` (number): Max proposals per delegate. -- `max_micheline_node_count` (number): Max node count in Micheline. -- `max_micheline_bytes_limit` (number): Max byte size for Micheline. -- `max_allowed_global_constants_depth` (number): Max depth for global constants. -- `cache_layout_size` (number): Size of cache layout. -- `michelson_maximum_type_size` (number): Maximum size for Michelson types. -- `smart_rollup_max_wrapped_proof_binary_size` (number): Max size for wrapped proof binaries in smart rollups. -- `smart_rollup_message_size_limit` (number): Message size limit in smart rollups. -- `smart_rollup_max_number_of_messages_per_level` (number): Max messages per level in smart rollups. -- `preserved_cycles` (number): Number of cycles to preserve. -- `blocks_per_cycle` (number): Number of blocks per cycle. -- `blocks_per_commitment` (number): Blocks per commitment. -- `nonce_revelation_threshold` (number): Threshold for nonce revelation. -- `blocks_per_stake_snapshot` (number): Blocks per stake snapshot. -- `cycles_per_voting_period` (number): Cycles per voting period. -- `hard_gas_limit_per_operation` (number): Hard gas limit per operation. -- `hard_gas_limit_per_block` (number): Hard gas limit per block. -- `proof_of_work_threshold` (number): Threshold for proof of work. -- `minimal_stake` (number): Minimal stake requirement. -- `vdf_difficulty` (number): Difficulty for VDF. -- `seed_nonce_revelation_tip` (number): Tip for seed nonce revelation. -- `origination_size` (number): Size of origination. -- `baking_reward_fixed_portion` (number): Fixed portion of baking reward. -- `baking_reward_bonus_per_slot` (number): Bonus reward per slot for baking. -- `endorsing_reward_per_slot` (number): Reward per slot for endorsing. -- `cost_per_byte` (number): Cost per byte. -- `hard_storage_limit_per_operation` (number): Hard storage limit per operation. -- `quorum_min` (number): Minimum quorum. -- `quorum_max` (number): Maximum quorum. -- `min_proposal_quorum` (number): Minimum proposal quorum. -- `liquidity_baking_subsidy` (number): Subsidy for liquidity baking. -- `liquidity_baking_toggle_ema_threshold` (number): EMA threshold for liquidity baking toggle. -- `max_operations_time_to_live` (number): Max TTL for operations. -- `minimal_block_delay` (number): Minimum delay between blocks. -- `delay_increment_per_round` (number): Delay increment per round. -- `consensus_committee_size` (number): Size of the consensus committee. -- `consensus_threshold` (number): Threshold for consensus. -- `minimal_participation_ratio` (number): Minimum participation ratio. -- `max_slashing_period` (number): Maximum slashing period. -- `frozen_deposits_percentage` (number): Percentage of frozen deposits. -- `double_baking_punishment` (number): Punishment for double baking. -- `ratio_of_frozen_deposits_slashed_per_double_endorsement` (number): Ratio of frozen deposits slashed per double endorsement. -- `cache_script_size` (number): Size limit for cached scripts. -- `cache_stake_distribution_cycles` (number): Number of cycles for caching stake distribution. -- `cache_sampler_state_cycles` (number): Cycles for caching sampler state. -- `tx_rollup_enable` (boolean): Flag to enable transaction rollups. -- `tx_rollup_origination_size` (number): Size limit for origination in transaction rollups. -- `tx_rollup_hard_size_limit_per_inbox` (number): Hard size limit per inbox in transaction rollups. -- `tx_rollup_hard_size_limit_per_message` (number): Hard size limit per message in transaction rollups. -- `tx_rollup_max_withdrawals_per_batch` (number): Maximum withdrawals allowed per batch in transaction rollups. -- `tx_rollup_commitment_bond` (mutez): Bond required for commitment in transaction rollups. -- `tx_rollup_finality_period` (number): Finality period for transaction rollups. -- `tx_rollup_withdraw_period` (number): Withdrawal period for transaction rollups. -- `tx_rollup_max_inboxes_count` (number): Maximum inboxes count for transaction rollups. -- `tx_rollup_max_messages_per_inbox` (number): Maximum messages per inbox in transaction rollups. -- `tx_rollup_max_commitments_count` (number): Maximum commitments count in transaction rollups. -- `tx_rollup_cost_per_byte_ema_factor` (number): EMA factor for cost per byte in transaction rollups. -- `tx_rollup_max_ticket_payload_size` (number): Maximum ticket payload size in transaction rollups. -- `tx_rollup_rejection_max_proof_size` (number): Maximum proof size for rejection in transaction rollups. -- `tx_rollup_sunset_level` (number): Sunset level for transaction rollups. -- `dal_parametric` (object): Parameters for Data Availability Layer. -- `smart_rollup_enable` (boolean): Flag to enable smart rollups. -- `smart_rollup_arith_pvm_enable` (boolean): Enable arithmetic proof verification mechanism in smart rollups. -- `smart_rollup_origination_size` (number): Origination size limit for smart rollups. -- `smart_rollup_challenge_window_in_blocks` (number): Challenge window in blocks for smart rollups. -- `smart_rollup_stake_amount` (mutez): Stake amount required for smart rollups. -- `smart_rollup_commitment_period_in_blocks` (number): Commitment period in blocks for smart rollups. -- `smart_rollup_max_lookahead_in_blocks` (number): Maximum lookahead in blocks for smart rollups. -- `smart_rollup_max_active_outbox_levels` (number): Maximum active outbox levels in smart rollups. -- `smart_rollup_max_outbox_messages_per_level` (number): Maximum outbox messages per level in smart rollups. -- `smart_rollup_number_of_sections_in_dissection` (number): Number of sections in dissection for smart rollups. -- `smart_rollup_timeout_period_in_blocks` (number): Timeout period in blocks for smart rollups. -- `smart_rollup_max_number_of_cemented_commitments` (number): Max number of cemented commitments in smart rollups. -- `smart_rollup_max_number_of_parallel_games` (number): Max number of parallel games in smart rollups. -- `zk_rollup_enable` (boolean): Flag to enable zero-knowledge rollups. -- `zk_rollup_origination_size` (number): Origination size for zero-knowledge rollups. -- `zk_rollup_min_pending_to_process` (number): Minimum pending transactions to process in zero-knowledge rollups. - -(Note: The actual return object will contain a comprehensive list of all Tezos constants, and the fields might vary based on the blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getContract.md b/v1.0/RPC Nodes/others/rpc-tezos/getContract.md deleted file mode 100644 index 9f9ce6ea..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getContract.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "getContract" -slug: "rpc-tezos-getContract" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the input parameters as a dictionary object -const params = { - contractId: 'YOUR_CONTRACT_ID', // Specify the contract ID - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID if needed - normalizeTypes: false // Optional: Set to true if you want to normalize types -}; - -// Access the complete status of a contract -const contractStatus = await tatum.rpc.getContract(params); - -// Log the contract status -console.log(`Status of Contract ${params.contractId}:`, contractStatus); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getContract` method allows you to access the complete status of a contract in the Tezos blockchain. This includes information about the contract's balance, delegate, script, and counter. - -### Example Use Cases: - -1. **Contract Analysis:** Developers and auditors can use this method to retrieve detailed information about a specific contract, including its balance, delegate, script, and counter. - -2. **Contract Interaction:** Users may want to examine the status of a contract to verify its current balance or delegate. - -### Request Parameters - -The `getContract` method requires the following parameters, all included in the `params` dictionary object: - -- `contractId` (string, required): A contract identifier encoded in b58check, representing the contract for which you want to access the status. - -- `chainId` (string, required): The network identifier (chain ID) for the Tezos blockchain. - -- `blockId` (string, optional): The unique identifier (hash) of the block. This parameter is optional, and if not provided, the method will retrieve the status from the latest block. - -- `normalizeTypes` (boolean, optional): Whether types should be normalized (annotations removed, combs flattened) or kept as they appeared in the original script. Set to `true` for normalization or `false` to keep original types. - -### Return Object - -The method returns an object representing the complete status of the specified contract, including the following properties: - -- `balance` (positive big number): The balance of the contract, represented as a positive big number. - -- `delegate` (public key hash): The delegate of the contract, represented as a Tezos public key hash (Base58Check-encoded). - -- `script` (scripted contract): The script associated with the contract, represented as a scripted contract object. - -- `counter` (positive big number): The counter of the contract, represented as a positive big number. - -Users can utilize this information for various purposes, such as contract analysis and verification. diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getContractBalance.md b/v1.0/RPC Nodes/others/rpc-tezos/getContractBalance.md deleted file mode 100644 index fbb9b3dd..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getContractBalance.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: "getContractBalance" -slug: "rpc-tezos-getContractBalance" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Importing Tatum SDK for Tezos blockchain -import { TatumSDK, Network, Tezos } from '@tatumio/tatum'; - -// Initializing SDK for Tezos blockchain -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define your chain ID and contract address -const params = { - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID - contractId: 'YOUR_CONTRACT_ID' // Specify the contract ID -}; - -// Fetching contract balance -const contractBalance = await tatum.rpc.getContractBalance(params); -console.log(contractBalance); - -// Cleaning up resources used by Tatum SDK -await tatum.destroy(); -``` - -### Overview - -The `getContractBalance` method retrieves the balance of a specific smart contract on the Tezos blockchain. - -### Parameters - -- `chainId` (string, required): The ID of the chain where the smart contract is deployed. -- `blockId` (string, required): The unique identifier (hash) of the block. -- `contractAddress` (string, required): The address of the smart contract - -### Return Object - -The method returns an object containing the `balance` of the specified smart contract. The structure of the return object may include various fields depending on the contract's status and balance. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getContractBalanceAndFrozenBonds.md b/v1.0/RPC Nodes/others/rpc-tezos/getContractBalanceAndFrozenBonds.md deleted file mode 100644 index 34218bd2..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getContractBalanceAndFrozenBonds.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: "getContractBalanceAndFrozenBonds" -slug: "rpc-tezos-getContractBalanceAndFrozenBonds" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the contract ID -const params = { - contractId: 'YOUR_CONTRACT_ID', // Spoecify the contract ID - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID -}; - -// Retrieve the sum of the spendable balance and frozen bonds for a specific Tezos smart contract -const contractBalance = await tatum.rpc.getContractBalanceAndFrozenBonds(params); - -// Log the contract's balance -console.log(`Sum of Spendable Balance and Frozen Bonds for Contract ${contractId.contractId}:`, contractBalance); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getContractBalanceAndFrozenBonds` method is used to retrieve the sum of the spendable balance and frozen bonds associated with a specific Tezos smart contract. This sum is considered part of the contract's stake, and it represents the contract's stake value if the contract is not a delegate. - -### Example Use Cases: - -1. **Contract Financial Analysis:** Developers and users can use this method to obtain the sum of the spendable balance and frozen bonds of a Tezos smart contract. This information is essential for financial analysis and decision-making within decentralized applications. - -2. **Audit and Verification:** Auditors and verifiers can review the financial status of a smart contract, including its stake value, to ensure that it has the required funds for operations. - -### Request Parameters - -The `getContractBalanceAndFrozenBonds` method requires the following parameter: - -- `contractId` (string, required): A contract identifier encoded in b58check, representing the Tezos smart contract for which you want to retrieve the sum of spendable balance and frozen bonds. -- `chainId` (string, required): The ID of the chain where the block is located. -- `blockId` (string, required): The unique identifier (hash) of the block. - -### Return Object - -The method returns a string representing the sum of the spendable balance and frozen bonds of the specified Tezos smart contract. This sum is considered part of the contract's stake and can be used to assess the contract's financial health. - -Users can use this information to understand the contract's stake value, which is particularly relevant when the contract is not a delegate. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getContractCounter.md b/v1.0/RPC Nodes/others/rpc-tezos/getContractCounter.md deleted file mode 100644 index 3244e551..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getContractCounter.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: "getContractCounter" -slug: "rpc-tezos-getContractCounter" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the contract ID -const params = { - contractId: 'YOUR_CONTRACT_ID', // Specify tthe contract ID - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID (hash) -}; - -// Retrieve the contract's counter value -const contractCounter = await tatum.rpc.getContractCounter(params); - -// Log the contract's counter value -console.log(`Contract Counter Value for Contract ${contractId.contractId}:`, contractCounter); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getContractCounter` method is used to retrieve the current counter value of a specific Tezos smart contract. The counter value represents the number of transactions or operations that have been performed on the contract. - -### Example Use Cases: - -1. **Transaction Verification:** Developers and users can use this method to verify the current counter value of a contract before initiating a transaction. This can help prevent accidental double-spending or ensure transaction order. - -2. **Contract Interaction:** When interacting with a Tezos smart contract, it's important to be aware of the contract's counter value to ensure proper sequencing and prevent conflicts. - -### Request Parameters - -The `getContractCounter` method requires the following parameter: - -- `contractId` (string, required): A contract identifier encoded in b58check, representing the Tezos smart contract for which you want to retrieve the counter value. -- `chainId` (string, required): The ID of the chain where the block is located. -- `blockId` (string, required): The unique identifier (hash) of the block. - -### Return Object - -The method returns an positive big number string representing the current counter value of the specified Tezos smart contract. This counter value reflects the number of transactions or operations that have been performed on the contract. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getContractDelegate.md b/v1.0/RPC Nodes/others/rpc-tezos/getContractDelegate.md deleted file mode 100644 index 0d0b0b1b..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getContractDelegate.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: "getContractDelegate" -slug: "rpc-tezos-getContractDelegate" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the contract ID -const params = { - contractId: 'YOUR_CONTRACT_ID', // Specify tthe contract ID - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID' // Optional: Specify the block ID - }; - -// Retrieve the delegate of a Tezos smart contract, if any -const contractDelegate = await tatum.rpc.getContractDelegate(params); - -// Log the contract's delegate, if available -console.log(`Delegate of Contract ${contractId.contractId}:`, contractDelegate); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getContractDelegate` method is used to access the delegate, if any, associated with a specific Tezos smart contract. In Tezos, a delegate is an entity that can participate in the consensus mechanism and represent other stakeholders' interests. - -### Example Use Cases: - -1. **Delegate Information:** Developers and users can use this method to retrieve information about the delegate associated with a smart contract. This information may include the delegate's public key hash and other relevant details. - -2. **Stakeholder Interactions:** When interacting with Tezos smart contracts, it's important to know if a contract has a delegate, as delegates can influence various aspects of the network. - -### Request Parameters - -The `getContractDelegate` method requires the following parameter: - -- `contract_id` (string, required): A contract identifier encoded in b58check, representing the Tezos smart contract for which you want to retrieve the delegate, if any. -- `chainId` (string, required): The ID of the chain where the block is located. -- `blockId` (string, required): The unique identifier (hash) of the block. - -### Return Object - -The method returns a string representing the delegate associated with the specified Tezos smart contract, if a delegate exists. The delegate is represented as an Ed25519, Secp256k1, P256, or BLS public key hash encoded in Base58Check format. - -If the contract does not have a delegate, the method returns `null`. Users can check for the presence of a delegate by examining the response value. - -This information can be useful for understanding the role and influence of delegates in the Tezos network. diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getContractEntrypoint.md b/v1.0/RPC Nodes/others/rpc-tezos/getContractEntrypoint.md deleted file mode 100644 index cb7be530..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getContractEntrypoint.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "getContractEntrypoint" -slug: "rpc-tezos-getContractEntrypoint" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the input params -const params = { - contractId: 'YOUR_CONTRACT_ID', // Specify the contract ID - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID if needed - entrypoint: 'YOUR_ENTRYPOINT_NAME', // Specify the desired entrypoint name - normalizeTypes: false // Optional: Set to true if you want to normalize types -}; - -const entrypoint = 'YOUR_ENTRYPOINT_NAME'; // Replace with the name of the desired entrypoint - -// Retrieve the type of the specified entrypoint of the Tezos smart contract -const entrypointType = await tatum.rpc.getContractEntryPointType(params); - -// Log the type of the specified entrypoint -console.log(`Type of Entrypoint ${entrypoint} in Contract ${contractId.contractId}:`, entrypointType); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getContractEntryPointType` method is used to return the type of a specific entrypoint within a Tezos smart contract. An entrypoint represents a callable function or method exposed by the contract. - -### Example Use Cases: - -1. **Entrypoint Type Inquiry:** Developers and users can use this method to retrieve the type information of a specific entrypoint within a smart contract. This information is essential for understanding how to interact with and invoke the entrypoint. - -2. **Contract Analysis:** Analysts and auditors may use this method to examine the types associated with contract entrypoints and ensure they align with the intended functionality. - -### Request Parameters - -The `getContractEntryPointType` method requires the following parameters: - -- `contract_id` (string, required): A contract identifier encoded in b58check, representing the Tezos smart contract for which you want to retrieve the entrypoint type. -- `chainId` (string, required): The ID of the chain where the block is located. -- `blockId` (string, required): The unique identifier (hash) of the block. -- `entrypoint` (string, required): A Michelson entrypoint name (string of length < 32), specifying the entrypoint for which you want to retrieve the type. -- `normalize_types` (boolean, optional): Indicates whether types should be normalized. If set to `true`, types will be normalized (annotations removed, combs flattened); if set to `false`, types will be kept as they appeared in the original script. - -### Return Object - -The method returns a Micheline expression representing the type of the specified entrypoint within the contract. This type information describes the structure and expected data for interacting with the entrypoint. - -Users can use this information to ensure proper data handling and validation when invoking contract entrypoints. - -Please note that the `normalize_types` parameter can affect the structure of the returned type based on whether types are normalized or kept as they appeared in the original script. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getContractEntrypoints.md b/v1.0/RPC Nodes/others/rpc-tezos/getContractEntrypoints.md deleted file mode 100644 index e904ca95..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getContractEntrypoints.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: "getContractEntrypoints" -slug: "rpc-tezos-getContractEntrypoints" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -const params = { - contractId: 'YOUR_CONTRACT_ID', // Specify the contract ID - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID', // Optional: Specify the block ID if needed - normalizeTypes: false // Optional: Set to true if you want to normalize types -}; - -// Retrieve the list of entrypoints of the Tezos smart contract -const entrypoints = await tatum.rpc.getContractEntrypoints(params); - -// Log the list of entrypoints -console.log(`Entry Points of Contract ${params.contractId}:`, entrypoints); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getContractEntrypoints` method is used to return the list of entrypoints available in a specific Tezos smart contract. Entrypoints represent the callable functions or methods that can be invoked on the contract. - -### Example Use Cases: - -1. **Contract Interaction:** Developers and users can use this method to discover the available entrypoints of a smart contract. This information is essential for interacting with and invoking specific contract functions. - -2. **Contract Analysis:** Analysts and auditors may use this method to examine the contract's exposed functions and ensure that they align with the intended functionality. - -### Request Parameters - -The `getContractEntrypoints` method requires the following parameters: - -- `contract_id` (string, required): A contract identifier encoded in b58check, representing the Tezos smart contract for which you want to retrieve the list of entrypoints. -- `chainId` (string, required): The ID of the chain where the block is located. -- `blockId` (string, required): The unique identifier (hash) of the block. -- `normalize_types` (boolean, optional): Indicates whether types should be normalized. If set to `true`, types will be normalized (annotations removed, combs flattened); if set to `false`, types will be kept as they appeared in the original script. - -### Return Object - -The method returns an object containing the following properties: - -- `unreachable` (array of objects): An array of unreachable entrypoints. Each object in the array contains a `path` property, which is an array of Michelson primitives. - -- `entrypoints` (object): An object containing the available entrypoints of the contract. Each entrypoint is represented as a property, and its value is a Micheline expression describing the entrypoint's type. - -Users can use this information to understand the contract's callable functions and types. - -Please note that the `normalize_types` parameter can affect the structure of the returned entrypoints based on whether types are normalized or kept as they appeared in the original script. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getContractManagerKey.md b/v1.0/RPC Nodes/others/rpc-tezos/getContractManagerKey.md deleted file mode 100644 index 506cc571..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getContractManagerKey.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: "getContractManagerKey" -slug: "rpc-tezos-getContractManagerKey" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the input parameters as a dictionary object -const params = { - contractId: 'YOUR_CONTRACT_ID', // Specify the contract ID - chainId: 'YOUR_CHAIN_ID', // Specify the chain ID (Network identifier) - blockId: 'YOUR_BLOCK_ID' // Optional: Specify the block ID if needed -}; - -// Retrieve the manager key of the implicit contract -const managerKey = await tatum.rpc.getContractManagerKey(params); - -// Log the manager key -console.log(`Manager Key of Contract ${params.contractId}:`, managerKey); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getContractManagerKey` method is used to access the manager of an implicit contract in the Tezos blockchain. The manager key represents the entity responsible for managing the contract's operations. - -### Example Use Cases: - -1. **Contract Analysis:** Developers and auditors can use this method to retrieve the manager key of an implicit contract, providing insights into the contract's ownership and management. - -2. **Contract Interaction:** Users may use this method to verify the manager's public key of a contract to ensure the validity of transactions. - -### Request Parameters - -The `getContractManagerKey` method requires the following parameters, all included in the `params` dictionary object: - -- `contractId` (string, required): A contract identifier encoded in b58check, representing the implicit contract for which you want to access the manager key. -- `chainId` (string, required): The network identifier (chain ID) for the Tezos blockchain. -- `blockId` (string, required): The unique identifier (hash) of the block. - -### Return Object - -The method returns an object representing the manager key of the implicit contract. The manager key is a nullable field, and it can be one of the following: - -- If a manager key exists, it is represented as a Tezos public key hash (Base58Check-encoded). - -- If there is no manager key, the response is nullable, indicating that no manager key is associated with the contract. - -Users can use this information to verify the ownership and management of the contract. diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getErrorsSchema.md b/v1.0/RPC Nodes/others/rpc-tezos/getErrorsSchema.md deleted file mode 100644 index 5d0f0c27..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getErrorsSchema.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "getErrorsSchema" -slug: "rpc-tezos-getErrorsSchema" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch a list of errors -const errors = await tatum.rpc.getErrorsSchema(); - -// Log the list of errors -console.log('Errors:', errors); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getErrorsSchema` method allows you to retrieve a list of errors with a status code of 200 from the Tezos network. These errors can provide insights into various aspects of the network, including smart contract execution, transaction failures, or other operational issues. - -### Example use cases: - -1. **Error Monitoring:** - Developers and node operators can use this method to fetch error information to monitor the health and performance of the Tezos network. This information can help diagnose and address issues promptly. - -2. **Troubleshooting:** - When encountering issues with transactions or smart contract interactions, developers can use this method to obtain detailed error messages, aiding in troubleshooting and debugging. - -3. **Network Analysis:** - Blockchain analysts and researchers can analyze error data to gain insights into network activity, identify patterns, and assess the overall health of the Tezos blockchain. - -### Request Parameters - -The `getErrorsSchema` method does not require any specific parameters. - -### Return Object - -The endpoint returns an array of errors from the Tezos blockchain. Each error is an object containing details about the error. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getHistoryMode.md b/v1.0/RPC Nodes/others/rpc-tezos/getHistoryMode.md deleted file mode 100644 index b39c6f28..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getHistoryMode.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: "getHistoryMode" -slug: "rpc-tezos-getHistoryMode" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch the history mode of the node's underlying storage -const historyMode = await tatum.rpc.getHistoryMode(); - -// Log the history mode -console.log(`Node's history mode:`, historyMode.historyMode); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getHistoryMode` method is utilized to retrieve the history mode of the node's underlying storage in the Tezos network. The history mode determines the extent of the historical data retained by the node, influencing storage requirements, the ability to query historical data, and recovery mechanisms. - -### Example use cases: - -1. **Storage Optimization:** - Node operators can use the `getHistoryMode` method to understand the storage mode of their node. Depending on the mode, they might decide to adjust storage resources or transition to a different mode to meet their operational needs. - -2. **Data Query and Analytics:** - Developers and analysts can check the history mode to ensure they can query the historical data they need. For instance, a node in `rolling` mode might not retain the entire history of the blockchain. - -3. **Node Configuration and Setup:** - When setting up new nodes or performing maintenance tasks, operators might need to check the history mode to ensure consistency across different nodes or to optimize for specific use cases. - -### Request Parameters - -The `getHistoryMode` method doesn't require specific parameters in the request body. - -### Return Object - -The `getHistoryMode` method returns an object indicating the history mode of the node's underlying storage: - -- `historyMode` (string): - Can be one of the following values: - - `archive`: The node retains the entire history of the chain. - - `full`: The node retains the full history but may prune some data. - - `rolling`: The node retains only a limited history, maintaining the most recent blocks and pruning older ones. \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getInvalidBlocks.md b/v1.0/RPC Nodes/others/rpc-tezos/getInvalidBlocks.md deleted file mode 100644 index 1badfc17..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getInvalidBlocks.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: "getInvalidBlocks" -slug: "rpc-tezos-getInvalidBlocks" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch the list of invalid blocks for a specific Tezos chain using the listInvalidBlocks method -const invalidBlocks = await tatum.rpc.listInvalidBlocks({ - chainId: 'main' // Specify the Tezos chain ID (usually 'main' for mainnet) -}); - -console.log(`The list of invalid blocks:`, invalidBlocks); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getInvalidBlocks` method retrieves blocks from a specified chain in Tezos that have been declared invalid. Alongside these blocks, the method provides details on the errors that led to their invalidation. - -### Example use cases: - -1. **Chain Audit & Monitoring:** - By identifying and studying invalid blocks, developers and network monitors can gain insights into potential issues or attacks on the Tezos network. - -2. **Network Health Analysis:** - Regularly checking for invalid blocks can be part of a routine health check of the Tezos blockchain, ensuring the network's integrity and robustness. - -3. **Error Handling:** - For developers building on Tezos, understanding why certain blocks were invalidated can aid in improving their applications and handling potential future errors. - -### Request Parameters - -The `getInvalidBlocks` method requires: - -- `chainId` (string, required): - The identifier of the Tezos chain from which the list of invalid blocks is being requested. - -### Return Object - -The `getInvalidBlocks` method returns an array of objects, where each object provides: - -- Block details and the associated errors that led to its invalidation. - diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getLevelsCaboose.md b/v1.0/RPC Nodes/others/rpc-tezos/getLevelsCaboose.md deleted file mode 100644 index 3239b839..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getLevelsCaboose.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: "getLevelsCaboose" -slug: "rpc-tezos-getLevelsCaboose" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch the caboose level for a specific Tezos chain -const cabooseLevel = await tatum.rpc.getLevelsCaboose({ - chainId: 'NetXdQprcVkpaWU' // Specify the Tezos chain ID (e.g., 'NetXdQprcVkpaWU' for mainnet) -}); - -// Log the caboose level -console.log(`Current caboose level:`, cabooseLevel.level); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getLevelsCaboose` method is used to retrieve the current caboose level of a specified chain on the Tezos network. The caboose is the earliest block still retained in the chain's rolling history, meaning it represents the oldest block in the chain's limited history when running in `rolling` mode. - -### Example use cases: - -1. **Monitoring Chain History:** - Developers and node operators can use the `getLevelsCaboose` method to monitor the extent of the rolling history maintained by their node, especially when running in `rolling` mode. - -2. **Data Pruning Decisions:** - By understanding the current caboose level, services can make informed decisions about pruning or archiving historical blockchain data that falls outside the rolling history. - -3. **Synchronization and Backup:** - Node operators might use the caboose level to synchronize or backup specific segments of the blockchain, ensuring they retain the desired portion of the chain's history. - -### Request Parameters - -The `getLevelsCaboose` method requires the following parameter: - -- `chainId` (string, required): - The identifier of the Tezos chain for which the caboose level is being requested. - -### Return Object - -The `getLevelsCaboose` method returns an object containing the specific level number of the caboose: - -- `level` (integer): - Represents the block number of the current caboose for the specified Tezos chain. \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getLevelsCheckpoint.md b/v1.0/RPC Nodes/others/rpc-tezos/getLevelsCheckpoint.md deleted file mode 100644 index 177ac48a..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getLevelsCheckpoint.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: "getLevelsCheckpoint" -slug: "rpc-tezos-getLevelsCheckpoint" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch the checkpoint for a specific Tezos chain using the deprecated getLevelsCheckpoint method -const checkpoint = await tatum.rpc.getLevelsCheckpoint({ - chainId: 'main' // Specify the Tezos chain ID (usually 'main' for mainnet) -}); - -console.log(`The checkpoint for the chain is:`, checkpoint); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -**DEPRECATED**: This method is deprecated. It is recommended to use `../levels/{checkpoint, savepoint, caboose, history_mode}` instead. The `getLevelsCheckpoint` method provides information about the current checkpoint for a specified chain in Tezos. - -### Example use cases: - -1. **Legacy System Support:** - While this method is deprecated, it may still be relevant for legacy systems or applications that have not transitioned to newer endpoints. - -2. **Checkpoint Retrieval:** - Checkpoints are crucial for validating the blockchain's integrity. The method allows for quick retrieval of the current checkpoint for audit or validation purposes. - -### Request Parameters - -The `getLevelsCheckpoint` method requires: - -- `chainId` (string, required): - The identifier of the Tezos chain from which the checkpoint information is being requested. - -### Return Object - -The `getLevelsCheckpoint` method returns an object containing details about the current checkpoint for the specified chain. \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getLevelsSavepoint.md b/v1.0/RPC Nodes/others/rpc-tezos/getLevelsSavepoint.md deleted file mode 100644 index 83069e5a..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getLevelsSavepoint.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: "getLevelsSavepoint" -slug: "rpc-tezos-getLevelsSavepoint" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the chain ID (For this example, we use "NetXdQprcVkpaWU" as a placeholder) -const chainId = { chainId: 'NetXdQprcVkpaWU' }; - -// Fetch a list of savepoint levels for the specified chain -const savepointLevels = await tatum.rpc.getLevelsSavepoint(chainId); - -// Log the list of savepoint levels -console.log('Savepoint levels:', savepointLevels); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getLevelsSavepoint` method allows you to retrieve a list of savepoint levels for a specific chain in the Tezos network. Savepoints are specific levels in the blockchain's history that can be used for various purposes, such as optimizing synchronization or rolling back to a specific point. - -### Example use cases: - -1. **Blockchain Optimization:** - Node operators and developers can use this method to obtain a list of savepoint levels to optimize their Tezos node's synchronization process by starting from a known savepoint. - -2. **Rollback Capability:** - Savepoints provide the ability to roll back the blockchain to a specific point in time. This can be helpful for handling issues or anomalies by reverting to a previous state. - -3. **Historical Data Retrieval:** - Researchers and analysts may use savepoints to fetch historical data for analysis and research purposes, ensuring consistent and accurate data retrieval. - -### Request Parameters - -The `getLevelsSavepoint` method requires the following parameter: - -- `chainId` (string, required): - The identifier of the Tezos chain for which to retrieve the savepoint levels. - -### Return Object - -The `getLevelsSavepoint` method returns an array of savepoint level objects, each containing relevant information about the savepoint level: - -- `block_hash` (string): The hash of the block at the savepoint level, e.g., "BLockGenesisGenesisGenesisGenesisGenesisf79b5d1CoW2". -- `level` (integer): The level (block number) of the savepoint, e.g., 0. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getNetworkDal.md b/v1.0/RPC Nodes/others/rpc-tezos/getNetworkDal.md deleted file mode 100644 index 5bce75aa..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getNetworkDal.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: "getNetworkDal" -slug: "rpc-tezos-getNetworkDal" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Get the configuration for the DAL (Data Access Layer) -const dalConfig = await tatum.rpc.getNetworkDal(); - -// Log the DAL configuration -console.log(`DAL Configuration:`, dalConfig); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getNetworkDal` method allows you to retrieve the configuration for the Data Access Layer (DAL) on the Tezos blockchain network. The DAL configuration includes various parameters related to network settings. - -### Example Use Cases: - -1. **Network Configuration:** Developers and node operators can use this method to access and review the current network configuration, including parameters like redundancy factor, page size, slot size, and the number of shards. - -2. **Testing Environments:** The `use_mock_srs_for_testing` parameter can be used in testing environments to simulate certain network settings. - -### Return Object - -The method returns an object that represents the configuration for the DAL: - -- `activated` (boolean): Indicates whether the DAL is activated. - -- `use_mock_srs_for_testing` (object or null): An optional object used for testing purposes. This object includes the following properties: - - `redundancy_factor` (integer, 0-255): The redundancy factor for testing. - - `page_size` (integer, 0-65535): The page size for testing. - - `slot_size` (integer, -1073741824 to 1073741823): The slot size for testing. - - `number_of_shards` (integer, 0-65535): The number of shards for testing. - -- `bootstrap_peers` (array of strings): An array of bootstrap peers for the DAL. - -Please note that the presence and structure of the `use_mock_srs_for_testing` object may vary based on the network's configuration. - -You can use this information to understand and configure the DAL settings on the Tezos network. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getNodeVersion.md b/v1.0/RPC Nodes/others/rpc-tezos/getNodeVersion.md deleted file mode 100644 index 877311ac..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getNodeVersion.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: "getNodeVersion" -slug: "rpc-tezos-getNodeVersion" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Importing Tatum SDK for Tezos blockchain -import { TatumSDK, Network, Tezos } from '@tatumio/tatum'; - -// Initializing SDK for Tezos blockchain -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetching the version information -const versionInfo = await tatum.rpc.version(); -console.log(versionInfo); - -// Cleaning up resources used by Tatum SDK -await tatum.destroy(); -``` - -### Overview - -The `version` method is used to retrieve version information about the Tezos blockchain. - -### Request Parameters - -The `version` method doesn't require specific parameters in the request body. - -### Return Object - -The method returns an object with version information. Here are descriptions for the top-level objects within the returned object: - -- `version` (object): An object with version details. -- `network_version` (object): An object with network version details. -- `commit_info` (object): An object with commit information. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getOperationHashes.md b/v1.0/RPC Nodes/others/rpc-tezos/getOperationHashes.md deleted file mode 100644 index 166d283d..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getOperationHashes.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: "getOperationHashes" -slug: "rpc-tezos-getOperationHashes" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Importing Tatum SDK for Tezos blockchain -import { TatumSDK, Network, Tezos } from '@tatumio/tatum'; - -// Initializing SDK for Tezos blockchain -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define parameters for the query -const params = { - chainId: 'YOUR_CHAIN_ID', - blockId: 'YOUR_BLOCK_ID' -}; - -// Fetching list of operation hashes -const operationHashes = await tatum.rpc.getOperationHashes(params); -console.log(operationHashes); - -// Cleaning up resources used by Tatum SDK -await tatum.destroy(); -``` - -### Overview - -The `getOperationHashes` method is used to retrieve a list of operation hashes from a specific block on the Tezos blockchain. - -### Request Parameters - -- `chainId` (string, required): The ID of the chain. -- `blockId` (string, required): The unique identifier (hash) of the block. - -### Return Object - -The method returns an array of strings, each representing an operation hash from the specified block on the Tezos blockchain. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getOperations.md b/v1.0/RPC Nodes/others/rpc-tezos/getOperations.md deleted file mode 100644 index 30575318..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getOperations.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: "getOperations" -slug: "rpc-tezos-getOperations" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Importing Tatum SDK for Tezos blockchain -import { TatumSDK, Network, Tezos } from '@tatumio/tatum'; - -// Initializing SDK for Tezos blockchain -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define parameters for the query -const params = { - chainId: 'YOUR_CHAIN_ID', - blockId: 'YOUR_BLOCK_ID' -}; - -// Fetching the operations -const operations = await tatum.rpc.getOperations(params); -console.log(operations); - -// Cleaning up resources used by Tatum SDK -await tatum.destroy(); -``` - -### Overview - -The `getOperations` method is used to retrieve a list of operations included in a specific block on the Tezos blockchain. - -### Request Parameters - -- `chainId` (string, required): The ID of the chain. -- `blockId` (string, required): The unique identifier (hash) of the block. - -### Return Object - -The method returns an array of operations from the specified block on the Tezos blockchain. Each operation is an object containing details about the operation. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getProtocol.md b/v1.0/RPC Nodes/others/rpc-tezos/getProtocol.md deleted file mode 100644 index 8f2d0443..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getProtocol.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: "getProtocol" -slug: "rpc-tezos-getProtocol" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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] - -### Overview - -The `getProtocolByHash` method retrieves information about a specific Tezos protocol based on its protocol hash. You can use this method to obtain details about the environment the protocol relies on and its components. - -### How to use it - -Here's a sample code snippet in TypeScript to call the `getProtocolByHash` method using the Tatum SDK: - -```typescript -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the protocol hash for the protocol you want to retrieve information about -const protocolHash = { protocolHash: 'YOUR_PROTOCOL_HASH' }; - -// Call the getProtocolByHash method to retrieve information about the protocol -const protocolInfo = await tatum.rpc.getProtocolByHash(protocolHash); - -// Log the protocol information -console.log('Protocol Information:', protocolInfo); - -// Always destroy the Tatum SDK instance when done to stop any background processes -tatum.destroy(); -``` - -### Example Use Cases - -1. **Protocol Version Information:** - Developers can use this method to fetch details about a specific Tezos protocol version based on its protocol hash. - -2. **Protocol Analysis:** - Researchers and analysts can use this method to study the environment and components of a particular protocol for research or auditing purposes. - -### Request Parameters - -- `Protocol_hash` (string, required): - The protocol hash of the Tezos protocol you want to retrieve information about. - -### Return Object - -The `getProtocolByHash` method returns an object with the following properties: - -- `expected_env_version` (string): The expected environment version of the protocol. -- `components` (array of objects): An array of components that make up the protocol, where each component has the following properties: - - `name` (string): The name of the component. - - `interface` (string): The interface of the component. - - `implementation` (string): The implementation of the component. - - (Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getProtocolEnvironment.md b/v1.0/RPC Nodes/others/rpc-tezos/getProtocolEnvironment.md deleted file mode 100644 index 330375c2..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getProtocolEnvironment.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: "getProtocolEnvironment" -slug: "rpc-tezos-getProtocolEnvironment" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 - -```typescript -// Importing Tatum SDK for Tezos blockchain -import { TatumSDK, Network, Tezos } from '@tatumio/tatum'; - -// Initializing SDK for Tezos blockchain -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define parameters for the query -const params = { protocolHash: 'YOUR_PROTOCOL_HASH' }; - -// Fetching the protocol environment -const environmentVersion = await tatum.rpc.getProtocolEnvironmentByHash(params); -console.log(environmentVersion); - -// Cleaning up resources used by Tatum SDK -tatum.destroy(); -``` - -### Overview - -The `getProtocolEnvironmentByHash` method retrieves information about the environment version of a specific Tezos protocol based on its protocol hash. You can use this method to obtain details about the environment version, which is represented as an integer. - -### Request Parameters - -- `Protocol_hash` (string, required): The protocol hash (Base58Check-encoded) for which you want to retrieve environment information. - -### Return Object - -The method returns an integer representing the environment version of the specified Tezos protocol based on its protocol hash. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getProtocols.md b/v1.0/RPC Nodes/others/rpc-tezos/getProtocols.md deleted file mode 100644 index 5871a576..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getProtocols.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: "getProtocols" -slug: "rpc-tezos-getProtocols" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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] - -### Overview - -The `getProtocols` method retrieves a list of protocol hashes for the Tezos blockchain. These protocol hashes represent different versions of the Tezos protocol that have been used or are available on the blockchain. - -### How to use it - -```typescript -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Call the getProtocols method to retrieve a list of protocol hashes -const protocols = await tatum.rpc.getProtocols(); - -// Log the list of protocol hashes -console.log('Protocols:', protocols); - -// Always destroy the Tatum SDK instance when done to stop any background processes -tatum.destroy(); -``` - -### Example Use Cases - -1. **Protocol Version Information:** - Developers can use this method to obtain a list of protocol hashes to understand the available protocol versions on the Tezos network. - -3. **Historical Analysis:** - Researchers and analysts can use this method to gather historical data on protocol versions used in the Tezos blockchain. - -### Request Parameters - -This method does not require any specific request parameters. - -### Return Object - -The `getProtocols` method returns an array of protocol hashes. Each protocol hash is represented as a string. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getUserActivatedProtocolOverrides.md b/v1.0/RPC Nodes/others/rpc-tezos/getUserActivatedProtocolOverrides.md deleted file mode 100644 index b7725f64..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getUserActivatedProtocolOverrides.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: "getUserActivatedProtocolOverrides" -slug: "rpc-tezos-getUserActivatedProtocolOverrides" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch user-activated protocol overrides in the Tezos network configuration -const overrides = await tatum.rpc.getUserActivatedProtocolOverrides(); - -// Log the user-activated protocol overrides -console.log(`User-Activated Protocol Overrides:`, overrides); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getUserActivatedProtocolOverrides` method is used to retrieve user-activated protocol overrides in the Tezos network configuration. These overrides may include specific settings or modifications to the protocol activated by the network's users. - -### Example Use Cases: - -1. **Protocol Customization:** Developers and node operators can use this method to check if there are any user-activated protocol overrides that affect the behavior of the Tezos network. This information can be crucial when customizing or interacting with the protocol. - -2. **Protocol Compliance:** Users and service providers can ensure that their actions on the Tezos network comply with any user-activated protocol overrides that may be in effect. - -### Request Parameters - -The `getUserActivatedProtocolOverrides` method doesn't require specific parameters in the request body. - -### Return Object - -The method returns an object containing information about user-activated protocol overrides in the Tezos network configuration. - -These user-activated protocol overrides may include settings, parameters, or rules that deviate from the standard protocol behavior, allowing users to collectively influence the network's operation. - -Here's the updated structure of the return object, with descriptions: - -- `replaced_protocol` (string): A Tezos protocol ID (Base58Check-encoded) representing the protocol that has been replaced or modified by the user-activated override. - -- `replacement_protocol` (string): A Tezos protocol ID (Base58Check-encoded) representing the protocol that serves as the replacement or modification in the user-activated override. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/getUserActivatedUpgrades.md b/v1.0/RPC Nodes/others/rpc-tezos/getUserActivatedUpgrades.md deleted file mode 100644 index 4299b340..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/getUserActivatedUpgrades.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: "getUserActivatedUpgrades" -slug: "rpc-tezos-getUserActivatedUpgrades" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch user-activated upgrades in the Tezos network configuration -const upgrades = await tatum.rpc.getUserActivatedUpgrades(); - -// Log the user-activated upgrades -console.log(`User-Activated Upgrades:`, upgrades); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `getUserActivatedUpgrades` method is used to retrieve information about user-activated upgrades in the Tezos network configuration. These upgrades represent changes to the Tezos protocol that have been activated by the network's users. - -### Example Use Cases: - -1. **Protocol Analysis:** Developers, analysts, and researchers can use this method to access information about user-activated upgrades in the Tezos network. This information can be valuable for understanding protocol changes and their implications. - -2. **Node Configuration:** Node operators and service providers can ensure that their Tezos nodes are configured to support user-activated upgrades to stay compatible with the network. - -### Request Parameters - -The `getUserActivatedUpgrades` method doesn't require specific parameters in the request body. - -### Return Object - -The method returns an array of objects, each containing information about user-activated upgrades in the Tezos network configuration. Here's the updated structure of the return object with descriptions: - -- `level` (integer, required): An integer representing the level at which the user-activated upgrade takes effect. The level can vary within the range from -2147483648 to 2147483647. - -- `replacement_protocol` (string, required): A Tezos protocol ID (Base58Check-encoded) representing the protocol that serves as the replacement or modification in the user-activated upgrade. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/injectBlock.md b/v1.0/RPC Nodes/others/rpc-tezos/injectBlock.md deleted file mode 100644 index bbec8235..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/injectBlock.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: "injectBlock" -slug: "rpc-tezos-injectBlock" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the block data and operations -const blockData = { - async: false, // Optional: Set to 'true' for asynchronous injection - force: false, // Optional: Set to 'true' to inject even on non-strictly increasing fitness - chain: 'main', // Optional: Specify the chain identifier (Replace with 'test' for test chain) - data: 'YOUR_BLOCK_DATA', // Replace with the block data as a string - operations: [ - // Define your operations here as an array - // Example: - [ - { - // Define the operation details here - } - ] - ] -}; - -// Inject a block in the node and broadcast it -const blockId = await tatum.rpc.injectBlock(blockData); - -// Log the block ID -console.log('Block ID:', blockId); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `injectBlock` method allows you to inject a block into the Tezos node and broadcast it. You can embed operations within the `blockData` parameter, which may be pre-validated using contextual RPCs from the latest block. This method returns the ID of the injected block. By default, the RPC waits for the block to be validated before responding. You can set the `async` parameter to 'true' for an immediate response. Additionally, you can use the `force` parameter to inject the block even on non-strictly increasing fitness. An optional `chain` parameter allows you to specify whether to inject on the main chain or the test chain. - -### Example Use Cases - -1. **Broadcast Custom Blocks:** - Developers can use this method to inject custom blocks into the Tezos network. This is useful for testing and development purposes, as well as for broadcasting custom transactions. - -2. **Advanced Testing:** - Test scenarios that involve specific block conditions or custom data can be simulated and injected into the Tezos network for validation. - -3. **Custom Operation Injections:** - When working with custom smart contracts or complex transactions, you can create custom blocks with specific operations and inject them using this method. - -### Request Parameters - -The `injectBlock` method accepts the following parameters: - -- `data` (string, required): - The block data as a string. - -- `operations` (array, required): - An array of operations to be included in the block. Each operation should be an array with the operation details. - -- `async` (boolean, optional): -Set to 'true' to receive an asynchronous response. Default is 'false'. - -- `force` (boolean, optional): - Set to 'true' to inject the block even on non-strictly increasing fitness. Default is 'false'. - -- `chain` (string, optional): - The chain identifier, which can be a chain hash in Base58Check notation or one of the predefined aliases: 'main' or 'test'. Default is 'main'. - -### Return Object - -The `injectBlock` method returns an object containing the ID of the injected block: - -- `blockId` (string): - A block identifier in Base58Check-encoded format. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/injectOperation.md b/v1.0/RPC Nodes/others/rpc-tezos/injectOperation.md deleted file mode 100644 index 52af96af..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/injectOperation.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "injectOperation" -slug: "rpc-tezos-injectOperation" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 code example -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the parameters for injecting an operation (Replace placeholders with actual values) -const params = { - operationBytes: 'OUR_SIGNED_OPERATION_CONTENTS' // Required: peration contents as a string - async: false, // Optional: Set to 'true' for asynchronous injection - chain: 'main' // Optional: Specify the chain identifier (Replace with 'test' for test chain) -}; - -// Inject an operation into the node and broadcast it -const operationId = await tatum.rpc.injectOperation(params); - -// Log the operation ID -console.log('Operation ID:', operationId); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `injectOperation` method allows you to inject an operation into the Tezos node and broadcast it. You should construct the `operationBytes` using contextual RPCs from the latest block and sign it with your client. The injection of the operation applies it to the current mempool context, which may change with each operation injection or reception from peers. By default, the RPC waits for the operation to be (pre-)validated before returning. However, setting `async` to 'true' makes the function return immediately. The optional `chain` parameter specifies whether to inject on the main chain or the test chain. - -### Example Use Cases - -1. **Broadcast Custom Operations:** - Developers can use this method to inject custom operations, such as transactions or smart contract interactions, into the Tezos network. - -2. **Transaction Signing and Injection:** - When building applications that require transaction signing, this method allows you to sign and inject transactions seamlessly. - -3. **Blockchain Integration:** - Service providers and blockchain integrators can use this method to facilitate the broadcast of operations from external systems. - -### Request Parameters - -The `injectOperation` method accepts the following parameters: - -- `async` (boolean, optional): - Set to 'true' to receive an asynchronous response. Default is 'false'. - -- `chain` (string, optional): - The chain identifier, which can be a chain hash in Base58Check notation or one of the predefined aliases: 'main' or 'test'. Default is 'main'. - -- `operationBytes` (string, required): - The signed operation contents as a string, constructed using contextual RPCs from the latest block and signed by the client. - -### Request Body - -The request body for `injectOperation` should be a string containing the signed operation contents. - -### Return Object - -The `injectOperation` method returns an object containing the ID of the injected operation: - -- `operationId` (string): - A Tezos operation ID in Base58Check-encoded format. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/injectProtocol.md b/v1.0/RPC Nodes/others/rpc-tezos/injectProtocol.md deleted file mode 100644 index 929c256c..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/injectProtocol.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: "injectProtocol" -slug: "rpc-tezos-injectProtocol" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 code example -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the protocol information as an object -const protocolInfo = { - expected_env_version: 'YOUR_ENV_VERSION', // Replace with the expected environment version - components: [ - { - name: 'COMPONENT_NAME', // Replace with the component name - interface: 'COMPONENT_INTERFACE', // Replace with the component interface - implementation: 'COMPONENT_IMPL' // Replace with the component implementation - } - ] - async: false // Optional: Set to 'true' for asynchronous injection -}; - -// Inject a protocol into the node -const protocolId = await tatum.rpc.injectProtocol(protocolInfo); - -// Log the protocol ID -console.log('Protocol ID:', protocolId); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `injectProtocol` method allows you to inject a protocol into the Tezos node. It returns the ID of the injected protocol. By default, the RPC waits for the protocol to be validated before returning. However, setting `async` to 'true' makes the function return immediately. - -### Example Use Cases - -1. **Protocol Upgrade:** - Developers can use this method to inject protocol upgrades and improvements into the Tezos network. - -2. **Network Maintenance:** - Validators and administrators can inject protocol updates to perform network maintenance and ensure the stability and security of the blockchain. - -### Request Parameters - -The `injectProtocol` method accepts the following parameter: - -- `expected_env_version` (string, required): - The expected environment version of the protocol. - -- `components` (array of objects, required): - An array of components that make up the protocol. Each component should include: - - `name` (string): The name of the component. - - `interface` (string): The interface of the component. - - `implementation` (string): The implementation of the component. - -- `async` (boolean, optional): - Set to 'true' to receive an asynchronous response. Default is 'false'. - -### Return Object - -The `injectProtocol` method returns an object containing the ID of the injected protocol: - -- `protocolId` (string): - A Tezos protocol ID in Base58Check-encoded format. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/isBootstrapped.md b/v1.0/RPC Nodes/others/rpc-tezos/isBootstrapped.md deleted file mode 100644 index 7f88704c..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/isBootstrapped.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: "isBootstrapped" -slug: "rpc-tezos-isBootstrapped" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Fetch the bootstrap and synchronization status for a specific Tezos chain -const bootstrapStatus = await tatum.rpc.isBootstrapped({ - chainId: 'NetXdQprcVkpaWU' // Specify the Tezos chain ID (e.g., 'NetXdQprcVkpaWU' for mainnet) -}); - -// Log the status results -console.log(`Is the node bootstrapped?`, bootstrapStatus.bootstrapped); -console.log(`Current synchronization state:`, bootstrapStatus.sync_state); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `isBootstrapped` method is used to retrieve the bootstrap status of a specified chain on the Tezos network. The bootstrap status indicates whether the node has synchronized with the network (i.e., downloaded all blocks up to the network's current state). - -### Example use cases: - -1. **Network Synchronization Verification:** - This method is crucial for developers and services to verify whether a node is fully synchronized with the rest of the Tezos network, ensuring that operations and queries are executed based on the latest blockchain state. - -2. **Node Setup and Maintenance:** - During the setup or maintenance of a Tezos node, `isBootstrapped` helps in determining the synchronization status, assisting operators in making informed decisions about starting or resuming services that depend on the node. - -3. **Health Checks and Monitoring:** - Services can regularly poll the bootstrap status of their nodes, enabling timely detection of potential synchronization issues and facilitating continuous monitoring of node health. - -### Request Parameters - -The `isBootstrapped` method requires the following parameter: - -- `chainId` (string, required): - The identifier of the Tezos chain for which the bootstrap status is being requested. - -### Return Object - -The `isBootstrapped` method returns an object containing detailed information regarding the node's bootstrap and synchronization status: - -- `bootstrapped` (boolean): - Indicates whether the node has completed the bootstrapping process. `true` signifies that the node has bootstrapped, while `false` indicates otherwise. - -- `sync_state` (`$chain_status`): - Provides the current synchronization status of the node in relation to its peers. The possible values for `$chain_status` are: - - `stuck`: The node considers itself synchronized with its peers, but from its perspective, the chain seems halted. - - `synced`: The node believes it is in sync with its peers and its current head timestamp is recent. - - `unsynced`: The node is not currently synchronized with any of its peers, likely because it is still in the bootstrapping phase and its head is lagging behind the chain's current state. - - (Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos/simulateOperation.md b/v1.0/RPC Nodes/others/rpc-tezos/simulateOperation.md deleted file mode 100644 index 6d83df37..00000000 --- a/v1.0/RPC Nodes/others/rpc-tezos/simulateOperation.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: "simulateOperation" -slug: "rpc-tezos-simulateOperation" -excerpt: "Tezos RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Tezos RPC" - image: [] - keywords: "tezos, 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 -// Import required libraries and modules from Tatum SDK -import { TatumSDK, Tezos, Network } from '@tatumio/tatum'; - -// Initialize the Tatum SDK for Tezos -const tatum = await TatumSDK.init({ network: Network.TEZOS }); - -// Define the operation parameters -const operationParams = { - blocks_before_activation: 1, - operation: { - // ... (operation details) - }, - chain_id: 'YOUR_CHAIN_ID', - latency: 0, -}; - -// Simulate the Tezos operation -const simulatedResult = await tatum.rpc.simulateOperation(operationParams); - -// Log the simulated operation result -console.log(`Simulated Operation Result:`, simulatedResult); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -``` - -### Overview - -The `simulateOperation` method allows you to simulate a Tezos operation, such as a smart contract call or transaction, without actually broadcasting it to the blockchain. This is useful for testing and verifying the outcome of an operation before committing it to the network. - -### Request Parameters - -The `simulateOperation` method requires the following parameters in the request body: - -- `blocks_before_activation` (integer, optional): An integer representing the number of blocks before the operation's activation. It should fall within the range from -2147483648 to 2147483647. - -- `operation` (object, required): The operation object to simulate. This typically includes details such as the contract method call, parameters, and gas limits. - -- `chain_id` (string, required): The network identifier (Base58Check-encoded) that specifies the Tezos network to use for the simulation. - -- `latency` (integer, optional): An integer representing the latency of the operation simulation. It should fall within the range from -32768 to 32767. - -### Response Parameters - -The method returns an object representing the result of simulating the Tezos operation. The exact structure of this object may vary based on the operation being simulated, but it typically includes the following: - -#### Operation_with_metadata (object): - -- `contents` (array): An array of operation contents. - -- `signature` (string): A signature, which can be Ed25519, Secp256k1, P256, or BLS (Base58Check-encoded). - -#### Operation_without_metadata (object): - -- `contents` (array): An array of operation contents. - -- `signature` (string): A signature, which can be Ed25519, Secp256k1, P256, or BLS (Base58Check-encoded). - -Users can use the simulated result to validate the operation's behavior and make informed decisions before proceeding with the actual operation on the Tezos blockchain. - -(Note: The exact fields in the return object might vary based on the Tezos blockchain's implementation and version.) \ No newline at end of file diff --git a/v1.0/RPC Nodes/others/rpc-tezos.md b/v1.0/RPC Nodes/others/rpc-tron.md similarity index 87% rename from v1.0/RPC Nodes/others/rpc-tezos.md rename to v1.0/RPC Nodes/others/rpc-tron.md index cf01ce38..0b68e850 100644 --- a/v1.0/RPC Nodes/others/rpc-tezos.md +++ b/v1.0/RPC Nodes/others/rpc-tron.md @@ -1,6 +1,6 @@ --- -title: "Tezos" -slug: "rpc-tezos" +title: "Tron" +slug: "rpc-tron" excerpt: "" category: 65c5e93c623cad004b45d505 hidden: false diff --git a/v1.0/RPC Nodes/others/rpc-tron/accountpermissionupdate.md b/v1.0/RPC Nodes/others/rpc-tron/accountpermissionupdate.md new file mode 100644 index 00000000..176fee4f --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/accountpermissionupdate.md @@ -0,0 +1,197 @@ +--- +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 new file mode 100644 index 00000000..fcf7b2dc --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/broadcasthex.md @@ -0,0 +1,85 @@ +--- +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 new file mode 100644 index 00000000..2374e064 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/broadcasttransaction.md @@ -0,0 +1,96 @@ +--- +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 new file mode 100644 index 00000000..3263c698 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/clearabi.md @@ -0,0 +1,99 @@ +--- +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 new file mode 100644 index 00000000..44f6e287 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/createaccount.md @@ -0,0 +1,112 @@ +--- +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 new file mode 100644 index 00000000..c57db9d3 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/createassetissue.md @@ -0,0 +1,174 @@ +--- +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 new file mode 100644 index 00000000..56dd4fe1 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/createtransaction.md @@ -0,0 +1,113 @@ +--- +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 new file mode 100644 index 00000000..6f58ff7b --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/debug_traceblockbyhash.md @@ -0,0 +1,129 @@ +--- +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 new file mode 100644 index 00000000..059c9f41 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/debug_traceblockbynumber.md @@ -0,0 +1,127 @@ +--- +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 new file mode 100644 index 00000000..cfd5b34a --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/debug_tracecall.md @@ -0,0 +1,142 @@ +--- +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-tezos/getcontracttickets.md b/v1.0/RPC Nodes/others/rpc-tron/debug_tracetransaction.md similarity index 78% rename from v1.0/RPC Nodes/others/rpc-tezos/getcontracttickets.md rename to v1.0/RPC Nodes/others/rpc-tron/debug_tracetransaction.md index 996dad4c..b752d9f5 100644 --- a/v1.0/RPC Nodes/others/rpc-tezos/getcontracttickets.md +++ b/v1.0/RPC Nodes/others/rpc-tron/debug_tracetransaction.md @@ -1,13 +1,13 @@ --- -title: "getcontracttickets" -slug: "rpc-tezos-getcontracttickets" -excerpt: "Tezos RPC" +title: "debug_tracetransaction" +slug: "rpc-tron-debug_tracetransaction" +excerpt: "Tron RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Tezos RPC" + description: "Tron RPC" image: [] - keywords: "tezos, rpc" + 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)" diff --git a/v1.0/RPC Nodes/others/rpc-tron/delegateresource.md b/v1.0/RPC Nodes/others/rpc-tron/delegateresource.md new file mode 100644 index 00000000..214af79c --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/delegateresource.md @@ -0,0 +1,112 @@ +--- +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 new file mode 100644 index 00000000..22ec5a42 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/deploycontract.md @@ -0,0 +1,151 @@ +--- +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 new file mode 100644 index 00000000..57ffe41c --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/estimateenergy.md @@ -0,0 +1,83 @@ +--- +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 new file mode 100644 index 00000000..cb4e4d06 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_blocknumber.md @@ -0,0 +1,78 @@ +--- +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 new file mode 100644 index 00000000..b709b550 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_chainid.md @@ -0,0 +1,76 @@ +--- +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 new file mode 100644 index 00000000..034b1698 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_estimategas.md @@ -0,0 +1,107 @@ +--- +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 new file mode 100644 index 00000000..d0a3efa8 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_gasprice.md @@ -0,0 +1,75 @@ +--- +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 new file mode 100644 index 00000000..959a1fdb --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getbalance.md @@ -0,0 +1,123 @@ +--- +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 new file mode 100644 index 00000000..6d1c67cd --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getblockbyhash.md @@ -0,0 +1,152 @@ +--- +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 new file mode 100644 index 00000000..08166316 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getblockbynumber.md @@ -0,0 +1,150 @@ +--- +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 new file mode 100644 index 00000000..4b6023f1 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getblocktransactioncountbyhash.md @@ -0,0 +1,83 @@ +--- +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 new file mode 100644 index 00000000..bb6f1fd1 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getblocktransactioncountbynumber.md @@ -0,0 +1,78 @@ +--- +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 new file mode 100644 index 00000000..59bc2833 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getcode.md @@ -0,0 +1,91 @@ +--- +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 new file mode 100644 index 00000000..171348cc --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getlogs.md @@ -0,0 +1,126 @@ +--- +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 new file mode 100644 index 00000000..8f2524e4 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getproof.md @@ -0,0 +1,122 @@ +--- +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 new file mode 100644 index 00000000..7e90c327 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getstorageat.md @@ -0,0 +1,84 @@ +--- +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 new file mode 100644 index 00000000..3d5c376e --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyblockhashandindex.md @@ -0,0 +1,117 @@ +--- +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 new file mode 100644 index 00000000..01f07fe8 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyblocknumberandindex.md @@ -0,0 +1,117 @@ +--- +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 new file mode 100644 index 00000000..d7bb8cf5 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionbyhash.md @@ -0,0 +1,107 @@ +--- +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 new file mode 100644 index 00000000..67e4f361 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactioncount.md @@ -0,0 +1,89 @@ +--- +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 new file mode 100644 index 00000000..12a14a7c --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_gettransactionreceipt.md @@ -0,0 +1,123 @@ +--- +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 new file mode 100644 index 00000000..53746e05 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getunclecountbyblockhash.md @@ -0,0 +1,85 @@ +--- +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 new file mode 100644 index 00000000..577ab3b7 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_getunclecountbyblocknumber.md @@ -0,0 +1,86 @@ +--- +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 new file mode 100644 index 00000000..cbf7ebd3 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_maxpriorityfeepergas.md @@ -0,0 +1,77 @@ +--- +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 new file mode 100644 index 00000000..8d9d94f4 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/eth_sendrawtransaction.md @@ -0,0 +1,77 @@ +--- +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 new file mode 100644 index 00000000..1191e78b --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/freezebalance.md @@ -0,0 +1,113 @@ +--- +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 new file mode 100644 index 00000000..a8b9a917 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/freezebalancev2.md @@ -0,0 +1,82 @@ +--- +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 new file mode 100644 index 00000000..e4c91e8b --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getaccount.md @@ -0,0 +1,129 @@ +--- +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 new file mode 100644 index 00000000..96b9fae4 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getaccountbalance.md @@ -0,0 +1,92 @@ +--- +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 new file mode 100644 index 00000000..ad13be3b --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getaccountnet.md @@ -0,0 +1,79 @@ +--- +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 new file mode 100644 index 00000000..d8762747 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getaccountresource.md @@ -0,0 +1,86 @@ +--- +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 new file mode 100644 index 00000000..fba246f8 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyaccount.md @@ -0,0 +1,103 @@ +--- +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 new file mode 100644 index 00000000..fcb8536d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyid.md @@ -0,0 +1,90 @@ +--- +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 new file mode 100644 index 00000000..91dafe9d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getassetissuebyname.md @@ -0,0 +1,91 @@ +--- +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 new file mode 100644 index 00000000..9c4c3b3a --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getassetissuelist.md @@ -0,0 +1,108 @@ +--- +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 new file mode 100644 index 00000000..222a68c8 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getassetissuelistbyname.md @@ -0,0 +1,90 @@ +--- +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 new file mode 100644 index 00000000..ab75f327 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getavailableunfreezecount.md @@ -0,0 +1,67 @@ +--- +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 new file mode 100644 index 00000000..d619f719 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getbandwidthprices.md @@ -0,0 +1,61 @@ +--- +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 new file mode 100644 index 00000000..c627c2e0 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getblock.md @@ -0,0 +1,296 @@ +--- +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 new file mode 100644 index 00000000..8104f8a3 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getblockbalance.md @@ -0,0 +1,99 @@ +--- +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 new file mode 100644 index 00000000..ebae911b --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getblockbyid.md @@ -0,0 +1,286 @@ +--- +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 new file mode 100644 index 00000000..c70ec7d3 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getblockbylatestnum.md @@ -0,0 +1,187 @@ +--- +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 new file mode 100644 index 00000000..ad952757 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getblockbylimitnext.md @@ -0,0 +1,147 @@ +--- +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 new file mode 100644 index 00000000..f598d427 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getblockbynum.md @@ -0,0 +1,100 @@ +--- +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 new file mode 100644 index 00000000..e32d2f41 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getburntrx.md @@ -0,0 +1,67 @@ +--- +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 new file mode 100644 index 00000000..5b287cc5 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getcandelegatedmaxsize.md @@ -0,0 +1,75 @@ +--- +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 new file mode 100644 index 00000000..b38b8e7a --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getcanwithdrawunfreezeamount.md @@ -0,0 +1,75 @@ +--- +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 new file mode 100644 index 00000000..5d97b43d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getchainparameters.md @@ -0,0 +1,303 @@ +--- +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 new file mode 100644 index 00000000..4e4135db --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getcontract.md @@ -0,0 +1,317 @@ +--- +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 new file mode 100644 index 00000000..661d1311 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getcontractinfo.md @@ -0,0 +1,327 @@ +--- +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 new file mode 100644 index 00000000..ca46e23c --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresource.md @@ -0,0 +1,82 @@ +--- +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 new file mode 100644 index 00000000..ae0fb1f8 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourceaccountindex.md @@ -0,0 +1,70 @@ +--- +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 new file mode 100644 index 00000000..0d7d62aa --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourceaccountindexv2.md @@ -0,0 +1,77 @@ +--- +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 new file mode 100644 index 00000000..f115a44c --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getdelegatedresourcev2.md @@ -0,0 +1,86 @@ +--- +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 new file mode 100644 index 00000000..50c7f5ef --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getenergyprices.md @@ -0,0 +1,61 @@ +--- +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 new file mode 100644 index 00000000..30b6933d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getnodeinfo.md @@ -0,0 +1,293 @@ +--- +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 new file mode 100644 index 00000000..a7bd30a0 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getnowblock.md @@ -0,0 +1,93 @@ +--- +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 new file mode 100644 index 00000000..ab84f14e --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/getpaginatedassetissuelist.md @@ -0,0 +1,134 @@ +--- +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 new file mode 100644 index 00000000..44444784 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/gettransactionbyid.md @@ -0,0 +1,107 @@ +--- +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 new file mode 100644 index 00000000..a22cf762 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/gettransactioninfobyblocknum.md @@ -0,0 +1,352 @@ +--- +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 new file mode 100644 index 00000000..e2d07eac --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/gettransactioninfobyid.md @@ -0,0 +1,91 @@ +--- +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 new file mode 100644 index 00000000..30c45acb --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/listnodes.md @@ -0,0 +1,90 @@ +--- +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 new file mode 100644 index 00000000..be071d18 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/participateassetissue.md @@ -0,0 +1,125 @@ +--- +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 new file mode 100644 index 00000000..e60681c0 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/transferasset.md @@ -0,0 +1,118 @@ +--- +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 new file mode 100644 index 00000000..c3675cb5 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/triggerconstantcontract.md @@ -0,0 +1,126 @@ +--- +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 new file mode 100644 index 00000000..02013de8 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/triggersmartcontract.md @@ -0,0 +1,137 @@ +--- +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 new file mode 100644 index 00000000..fcf525f6 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/txpool_content.md @@ -0,0 +1,144 @@ +--- +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 new file mode 100644 index 00000000..97f81b99 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/txpool_inspect.md @@ -0,0 +1,91 @@ +--- +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 new file mode 100644 index 00000000..847d9d83 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/txpool_status.md @@ -0,0 +1,79 @@ +--- +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 new file mode 100644 index 00000000..bf048112 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/undelegateresource.md @@ -0,0 +1,114 @@ +--- +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 new file mode 100644 index 00000000..b2588feb --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/unfreezeasset.md @@ -0,0 +1,95 @@ +--- +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 new file mode 100644 index 00000000..867492dd --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/unfreezebalance.md @@ -0,0 +1,104 @@ +--- +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 new file mode 100644 index 00000000..825e3c1d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/unfreezebalancev2.md @@ -0,0 +1,111 @@ +--- +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 new file mode 100644 index 00000000..191b3a16 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/updateaccount.md @@ -0,0 +1,101 @@ +--- +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 new file mode 100644 index 00000000..483eb95d --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/updateasset.md @@ -0,0 +1,118 @@ +--- +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 new file mode 100644 index 00000000..bbcb3268 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/updateenergylimit.md @@ -0,0 +1,113 @@ +--- +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 new file mode 100644 index 00000000..b0c3a21e --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/updatesetting.md @@ -0,0 +1,111 @@ +--- +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 new file mode 100644 index 00000000..baa479ea --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/validateaddress.md @@ -0,0 +1,81 @@ +--- +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 new file mode 100644 index 00000000..888237c3 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/web3_clientversion.md @@ -0,0 +1,78 @@ +--- +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 new file mode 100644 index 00000000..a0145894 --- /dev/null +++ b/v1.0/RPC Nodes/others/rpc-tron/withdrawexpireunfreeze.md @@ -0,0 +1,99 @@ +--- +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..." +} +``` +