Tron RPC
Archive Method
Only on the full archive nodes. Complex queries might take longer and incur additional cost
How to use it
import { TatumSDK, Tron, Network } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Tron>({ network: Network.TRON })
const res = await tatum.rpc.getCanDelegatedMaxSize('TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g', 0, {
visible: true,
})
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
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.
Parameters
ownerAddress
(string): The owner address for which the delegatable resource share needs to be queried. It should be provided as a hexadecimal string.type
(integer): The resource type to query. Use0
for bandwidth and1
for energy.options
(object, optional): Additional options for the method.visible
(boolean, optional): Whether the address is in base58 format. Defaults totrue
.
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
{
"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
"type": 0,
"visible": true
}
HTTP Response Example
{
"max_size": 12311
}