APIs for querying account resources and delegating, undelegating, or reclaiming resources.
Common tasks
| Goal | Recommended path |
|---|---|
| Query Bandwidth, Energy, and usage | GetAccountResource; see Query balance and resources for a combined account query |
| Stake and confirm resource availability | FreezeBalanceV2 → sign → broadcast → solidified receipt → GetAccountResource; see Stake 2.0 |
| Delegate and confirm resources | GetCanDelegatedMaxSize → DelegateResource → solidified receipt → GetDelegatedResourceV2; see Resource delegation |
| Unstake and withdraw | UnfreezeBalanceV2 → waiting period → GetCanWithdrawUnfreezeAmount → WithdrawExpireUnfreeze; see Unstaking |
APIs in this group
Resource queries
| API | Purpose |
|---|---|
| GetAccountResource | Query an account's Bandwidth, Energy, and staking-related resource state. |
| GetAvailableUnfreezeCount | Query the number of available unstake operations for an account. |
| GetCanWithdrawUnfreezeAmount | Query the amount that can be withdrawn after unstaking. |
| GetCanDelegatedMaxSize | Query the maximum resource amount that can be delegated. |
| GetDelegatedResourceV2 | Query delegated resources between two accounts. |
| GetDelegatedResourceAccountIndexV2 | Query resource delegation indexes for an account. |
Stake 2.0 resource operations
| API | Purpose |
|---|---|
| FreezeBalanceV2 | Stake TRX to obtain Bandwidth or Energy. |
| UnfreezeBalanceV2 | Unstake TRX from Stake 2.0. |
| WithdrawExpireUnfreeze | Withdraw TRX after the unstaking lock period ends. |
| DelegateResource | Delegate Bandwidth or Energy to another account. |
| UnDelegateResource | Reclaim delegated resources. |
| CancelAllUnfreezeV2 | Cancel all pending unstake operations. |
Related resources
- Resource model — Bandwidth, Energy, staking, and resource consumption
- Stake 2.0 — stake, unstake, delegate, and reclaim resources