For the complete documentation index, see llms.txt. This page is also available as Markdown.

/walletsolidity/getdelegatedresourcev2 - Tron

Example code for the getdelegatedresourcev2 Solidity API method. Complete guide on how to use getdelegatedresourcev2 Solidity API method in GetBlock Web3 documentation.

This endpoint returns the Stake 2.0 resources delegated from one account to another, read from confirmed state on the Solidity node.

This is a Solidity-node endpoint. It returns only confirmed, irreversible data, so it is the correct interface for balance and payment verification. The Fullnode serves the same operation at https://go.getblock.io/<ACCESS-TOKEN>/wallet/getdelegatedresourcev2 over the latest, possibly unconfirmed state.

Parameters

Parameter
Type
Required
Description

fromAddress

string

Yes

Address that delegated the resource

toAddress

string

Yes

Address that received the delegated resource

visible

boolean

No

Accept and return addresses in base58 format

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/walletsolidity/getdelegatedresourcev2' \
--header 'Content-Type: application/json' \
--data-raw '{
  "fromAddress": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
  "toAddress": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh",
  "visible": true
}'
example.js
const response = await fetch(
    'https://go.getblock.io/<ACCESS-TOKEN>/walletsolidity/getdelegatedresourcev2',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"fromAddress": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "toAddress": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh", "visible": true})
    }
);
console.log(await response.json());
example.py
import requests

response = requests.post(
    'https://go.getblock.io/<ACCESS-TOKEN>/walletsolidity/getdelegatedresourcev2',
    headers={'Content-Type': 'application/json'},
    json={"fromAddress": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "toAddress": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh", "visible": true}
)

print(response.json())

Response

{
  "delegatedResource": [
    {
      "from": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
      "to": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh",
      "frozen_balance_for_energy": 1000000000,
      "expire_time_for_energy": 0
    }
  ]
}

Response Parameters

Field
Type
Description

delegatedResource

array

Delegation entries between the two accounts

delegatedResource[].frozen_balance_for_energy

integer

Staked TRX delegated for Energy, in SUN

delegatedResource[].expire_time_for_energy

integer

Lock expiry time, or 0 when not locked

Use Cases

  • Delegation Audits: Read confirmed resource delegations between accounts

  • Sponsorship Tracking: Verify Energy delegated to a receiver

  • Reconciliation: Confirm delegation state for accounting

  • Wallet Views: Show a user their confirmed delegations

Error Handling

HTTP Status
Message
Description

200

OK

The request succeeded; some TRON errors are returned in the 200 body as an Error field

400

Bad request

The request body is malformed or a required field is missing

500

Internal error

The node failed to process the request

Was this helpful?