Tron RPC
Archive Method
Only on the full archive nodes. Complex queries might take longer and incur additional cost
How to use it
// yarn add @tatumio/tatum
import { TatumSDK, Tron, Network } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Tron>({ network: Network.TRON })
const result = await tatum.rpc.getDelegatedResourceV2('fromAddress', 'toAddress', {
visible: true,
})
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
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:
- Checking the status of resource sharing between addresses.
- Assessing the delegation history between two addresses.
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 thefrom
address to theto
address.frozen_balance_for_energy
(integer): The amount of TRX staked for energy delegated from thefrom
address to theto
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
{
HTTP Response Example
[
{
"from": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
"to": "TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1",
"frozen_balance_for_bandwidth": 1000,
"frozen_balance_for_energy": 1000,
"expire_time_for_bandwidth": 1597463006000,
"expire_time_for_energy": 1597463006000
}
]