/walletsolidity/getdelegatedresourcev2 - Tron

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://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/getdelegatedresourcev2 over the latest, possibly unconfirmed state.

Parameters

ParameterTypeRequiredDescription
fromAddressstringYesAddress that delegated the resource
toAddressstringYesAddress that received the delegated resource
visiblebooleanNoAccept and return addresses in base58 format

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/walletsolidity/getdelegatedresourcev2' \
--header 'Content-Type: application/json' \
--data-raw '{
  "fromAddress": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
  "toAddress": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh",
  "visible": true
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.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

pythonimport requests

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

print(response.json())

Response

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

Response Parameters

FieldTypeDescription
delegatedResourcearrayDelegation entries between the two accounts
delegatedResource[].frozen_balance_for_energyintegerStaked TRX delegated for Energy, in SUN
delegatedResource[].expire_time_for_energyintegerLock 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 StatusMessageDescription
200OKThe request succeeded; some TRON errors are returned in the 200 body as an Error field
400Bad requestThe request body is malformed or a required field is missing
500Internal errorThe node failed to process the request