Account Resources
Account Resources
getaccountresource
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getaccountresource?apikey={apikey}
Query the resource information of an account(bandwidth,energy,etc)
请求参数说明:
- address: string. default hexString.
- visible: boolean. Optional,whether the address is in base58 format
Returns:
- freeNetUsed: Free bandwidth used
- freeNetLimit: Total free bandwidth.
- NetUsed: Used amount of bandwidth obtained by staking.
- NetLimit: Total bandwidth obtained by staking.
- TotalNetLimit: Total bandwidth can be obtained by staking by the whole network.
- TotalNetWeight: Total TRX staked for bandwidth by the whole network.
- totalTronPowerWeight: The total amount of voting rights obtained by the whole network.
- tronPowerLimit: TRON Power(vote).
- tronPowerUsed: TRON Power(vote) used.
- EnergyUsed: Energy used.
- EnergyLimit: Total energy obtained by staking.
- TotalEnergyLimit: Total energy can be obtained by staking by the whole network.
- TotalEnergyWeight: Total TRX staked for energy by the whole network.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getaccountresource?apikey={apikey}' \
--data '{
"address": "41BF97A54F4B829C4E9253B26024B1829E1A3B1120"
}'
Response
{
"freeNetLimit": 1500,
"NetLimit": 4,
"assetNetUsed": [
{
"key": "1002721",
"value": 0
},
{
"key": "1000322",
"value": 0
},
{
"key": "1002544",
"value": 0
},
{
"key": "1002742",
"value": 0
},
{
"key": "1003533",
"value": 0
},
{
"key": "1002342",
"value": 0
},
{
"key": "1003134",
"value": 0
},
{
"key": "1002927",
"value": 0
},
{
"key": "1002907",
"value": 0
},
{
"key": "1002845",
"value": 0
},
{
"key": "1002000",
"value": 0
},
{
"key": "1002798",
"value": 0
},
{
"key": "1002897",
"value": 0
},
{
"key": "1002775",
"value": 0
},
{
"key": "1002459",
"value": 0
},
{
"key": "1002398",
"value": 0
},
{
"key": "1002992",
"value": 0
},
{
"key": "1002573",
"value": 0
},
{
"key": "1002672",
"value": 0
},
{
"key": "1002939",
"value": 0
},
{
"key": "1002636",
"value": 0
},
{
"key": "1002757",
"value": 0
},
{
"key": "1002517",
"value": 0
},
{
"key": "1002814",
"value": 0
},
{
"key": "1002858",
"value": 0
},
{
"key": "1002010",
"value": 0
},
{
"key": "1002670",
"value": 0
},
{
"key": "1004031",
"value": 0
}
],
"assetNetLimit": [
{
"key": "1002721",
"value": 0
},
{
"key": "1000322",
"value": 0
},
{
"key": "1002544",
"value": 0
},
{
"key": "1002742",
"value": 0
},
{
"key": "1003533",
"value": 0
},
{
"key": "1002342",
"value": 0
},
{
"key": "1003134",
"value": 0
},
{
"key": "1002927",
"value": 0
},
{
"key": "1002907",
"value": 0
},
{
"key": "1002845",
"value": 0
},
{
"key": "1002000",
"value": 0
},
{
"key": "1002798",
"value": 0
},
{
"key": "1002897",
"value": 0
},
{
"key": "1002775",
"value": 0
},
{
"key": "1002459",
"value": 0
},
{
"key": "1002398",
"value": 0
},
{
"key": "1002992",
"value": 0
},
{
"key": "1002573",
"value": 0
},
{
"key": "1002672",
"value": 0
},
{
"key": "1002939",
"value": 0
},
{
"key": "1002636",
"value": 0
},
{
"key": "1002757",
"value": 0
},
{
"key": "1002517",
"value": 0
},
{
"key": "1002814",
"value": 0
},
{
"key": "1002858",
"value": 0
},
{
"key": "1002010",
"value": 0
},
{
"key": "1002670",
"value": 0
},
{
"key": "1004031",
"value": 0
}
],
"TotalNetLimit": 43200000000,
"TotalNetWeight": 39068305368,
"tronPowerUsed": 2,
"tronPowerLimit": 4,
"TotalEnergyLimit": 90000000000,
"TotalEnergyWeight": 5298982398
}
getaccountnet
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getaccountnet?apikey={apikey}
Query bandwidth information.
请求参数说明:
- address: string. Account address, converted to a hex string.
- visible: boolean. Optional,whether the address is in base58 format
Returns:
- Bandwidth information for the account.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getaccountnet?apikey={apikey}' \
--data '{
"address": "41BF97A54F4B829C4E9253B26024B1829E1A3B1120"
}'
Response
{
"freeNetLimit": 1500,
"NetLimit": 4,
"assetNetUsed": [
{
"key": "1002721",
"value": 0
},
{
"key": "1000322",
"value": 0
},
{
"key": "1002544",
"value": 0
},
{
"key": "1002742",
"value": 0
},
{
"key": "1003533",
"value": 0
},
{
"key": "1002342",
"value": 0
},
{
"key": "1003134",
"value": 0
},
{
"key": "1002927",
"value": 0
},
{
"key": "1002907",
"value": 0
},
{
"key": "1002845",
"value": 0
},
{
"key": "1002000",
"value": 0
},
{
"key": "1002798",
"value": 0
},
{
"key": "1002897",
"value": 0
},
{
"key": "1002775",
"value": 0
},
{
"key": "1002459",
"value": 0
},
{
"key": "1002398",
"value": 0
},
{
"key": "1002992",
"value": 0
},
{
"key": "1002573",
"value": 0
},
{
"key": "1002672",
"value": 0
},
{
"key": "1002939",
"value": 0
},
{
"key": "1002636",
"value": 0
},
{
"key": "1002757",
"value": 0
},
{
"key": "1002517",
"value": 0
},
{
"key": "1002814",
"value": 0
},
{
"key": "1002858",
"value": 0
},
{
"key": "1002010",
"value": 0
},
{
"key": "1002670",
"value": 0
},
{
"key": "1004031",
"value": 0
}
],
"assetNetLimit": [
{
"key": "1002721",
"value": 0
},
{
"key": "1000322",
"value": 0
},
{
"key": "1002544",
"value": 0
},
{
"key": "1002742",
"value": 0
},
{
"key": "1003533",
"value": 0
},
{
"key": "1002342",
"value": 0
},
{
"key": "1003134",
"value": 0
},
{
"key": "1002927",
"value": 0
},
{
"key": "1002907",
"value": 0
},
{
"key": "1002845",
"value": 0
},
{
"key": "1002000",
"value": 0
},
{
"key": "1002798",
"value": 0
},
{
"key": "1002897",
"value": 0
},
{
"key": "1002775",
"value": 0
},
{
"key": "1002459",
"value": 0
},
{
"key": "1002398",
"value": 0
},
{
"key": "1002992",
"value": 0
},
{
"key": "1002573",
"value": 0
},
{
"key": "1002672",
"value": 0
},
{
"key": "1002939",
"value": 0
},
{
"key": "1002636",
"value": 0
},
{
"key": "1002757",
"value": 0
},
{
"key": "1002517",
"value": 0
},
{
"key": "1002814",
"value": 0
},
{
"key": "1002858",
"value": 0
},
{
"key": "1002010",
"value": 0
},
{
"key": "1002670",
"value": 0
},
{
"key": "1004031",
"value": 0
}
],
"TotalNetLimit": 43200000000,
"TotalNetWeight": 39068410267
}
freezebalance
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/freezebalance?apikey={apikey}
This interface has been deprecated, please use FreezeBalanceV2 to stake TRX to obtain resources.
请求参数说明:
- owner_address: string. default hexString.
- frozen_balance: int64. TRX stake amount, the unit is sun.
- frozen_duration: int32. Lock-up duration for this stake, now the value can only be 3 days. It is not allowed to unstake within 3 days after the stake. You can unstake TRX after the 3 lock-up days.
- resource: string. TRX stake type, 'BANDWIDTH' or 'ENERGY'.
- receiver_address: string. Optional,the address that will receive the resource, default hexString.
- permission_id: int32. Optional, for multi-signature use.
- visible: boolean. Optional. Defaults to false. Whether addresses are in base58check format.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/freezebalance?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551",
"frozen_balance": 10000000,
"frozen_duration": 3,
"resource": "ENERGY"
}'
Response
unfreezebalance
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/unfreezebalance?apikey={apikey}
Unstake the TRX staked during Stake1.0, release the obtained bandwidth or energy and TP. This operation will cause automatically cancel all votes.
请求参数说明:
- owner_address: string. default hexString.
- resource: string. Stake TRX for 'BANDWIDTH' or 'ENERGY'.
- receiver_address: string. Optional,the address that will lose the resource, default hexString.
- permission_id: int32. Optional, for multi-signature use.
- visible: boolean. Optional, Whether the address is in base58 format.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/unfreezebalance?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551",
"resource": "BANDWIDTH"
}'
Response
getdelegatedresource
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getdelegatedresource?apikey={apikey}
Returns all resources delegations from an account to another account. The fromAddress can be retrieved from the GetDelegatedResourceAccountIndex API.
Parameters
- fromAddress: string. required. Energy from address, default hexString.
- toAddress: string. required.Energy delegation information.
- visible: boolean. Optional, Whether the address is in base58 format.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getdelegatedresource?apikey={apikey}' \
--data '{
"fromAddress": "419844f7600e018fd0d710e2145351d607b3316ce9",
"toAddress": "41c6600433381c731f22fc2b9f864b14fe518b322f"
}'
Response
getdelegatedresourceaccountindex
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getdelegatedresourceaccountindex?apikey={apikey}
Query the energy delegation by an account. i.e. list all addresses that have delegated resources to an account.
请求参数说明:
- value: string. Address, default hexString.
- visible: boolean. Optional, Whether the address is in base58 format.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getdelegatedresourceaccountindex?apikey={apikey}' \
--data '{
"value": "419844f7600e018fd0d710e2145351d607b3316ce9"
}'
Response
{
"account": "419844f7600e018fd0d710e2145351d607b3316ce9"
}
freezebalancev2
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/freezebalancev2?apikey={apikey}
In Stake2.0, stake an amount of TRX to obtain bandwidth or energy, and obtain equivalent TRON Power(TP) according to the staked amount.
请求参数说明:
- owner_address: string. required. default hexString.
- frozen_balance: int64. required. TRX stake amount, the unit is sun.
- resource: string. required. TRX stake type, 'BANDWIDTH' or 'ENERGY'.
- permission_id: int32.Optional, for multi-signature use.
- visible: boolean. Optional. Default is false. Whether addresses are in base58check format.
Returns:
- Unsigned transaction - JSON string.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/freezebalancev2?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551",
"frozen_balance": 10000000,
"resource": "ENERGY"
}'
Response
unfreezebalancev2
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/unfreezebalancev2?apikey={apikey}
Unstake some TRX staked in Stake2.0, release the corresponding amount of bandwidth or energy, and voting rights (TP)
Unlock the TRX staked at the Stake 2.0 stage through this interface. After unstaking, the user needs to wait for N days before calling the /wallet/withdrawexpireunfreeze interface to withdraw the funds of this unstaking.
When executing unstaking, if there are unclaimed voting rewards, the voting rewards will be withdrawn to the account first; if there is a previously unstaked funds that has passed the lock-up period, then this unstaking operation will also withdraw the unstaked funds that has passed the lock-up period to the account at the same time. You can query the voting reward withdrawn and the amount of funds withdrawn in this transaction through gettransactioninfobyid API.
请求参数说明:
- owner_address: string. default hexString.
- unfreeze_balance: int64. The amount of TRX to unstake, in sun.
- resource: string. Resource type: 'BANDWIDTH' or 'ENERGY'.
- permission_id: int32. Optional, for multi-signature use.
- visible: boolean. Optional, Whether the address is in base58 format.
Returns:
- Unsigned transaction - JSON string.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/unfreezebalancev2?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551",
"unfreeze_balance": 1000000,
"resource": "BANDWIDTH"
}'
Response
cancelallunfreezev2
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/cancelallunfreezev2?apikey={apikey}
Cancel unstakings, all unstaked funds still in the waiting period will be re-staked, all unstaked funds that exceeded the 14-day waiting period will be automatically withdrawn to the owner’s account.
When canceling unstakings, all unstaked funds still in the waiting period will be re-staked, and the resource obtained through the re-staking remains the same as before. Unstakings that exceeded the 14-day waiting period cannot be canceled, and this part of the unstaked funds will be automatically withdrawn to the owner’s account. The users can use wallet/gettransactioninfobyid
to query the amount of unstaking TRX that canceled (cancel_unfreezeV2_amount
) and the amount of unstaked TRX withdrawn to the account (withdraw_expire_amount
).
请求参数说明:
- owner_address: string. default hexString.
- permission_id: int32. Optional, for multi-signature use.
- visible: boolean. Optional, Whether the address is in base58 format.
Returns:
- owner_address:string. Account address.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/cancelallunfreezev2?apikey={apikey}' \
--data '{
"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
"visible": true
}'
Response
delegateresource
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/delegateresource?apikey={apikey}
Delegate bandwidth or energy resources to other accounts in Stake2.0.
请求参数说明:
- owner_address: string. default hexString.
- receiver_address: string. Resource receiver address.
- balance: int64. Amount of TRX staked for resources to be delegated, unit is sun.
- resource: string. Resource type: 'BANDWIDTH' or 'ENERGY'.
- lock: boolean. Whether it is locked, if it is set to true, the delegated resources cannot be undelegated within 3 days. When the lock time is not over, if the owner delegates the same type of resources using the lock to the same address, the lock time will be reset to 3 days.
- visible: boolean. Optional, Whether the address is in base58 format.
- permission_id: int32. Optional, for multi-signature use.
Returns:
- Unsigned transaction - JSON string.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/delegateresource?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551",
"receiver_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
"balance": 1000000,
"resource": "BANDWIDTH",
"lock": false
}'
Response
undelegateresource
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/undelegateresource?apikey={apikey}
Cancel the delegation of bandwidth or energy resources to other accounts in Stake2.0.
请求参数说明:
- owner_address: string. default hexString.
- receiver_address: string. Resource receiver address.
- balance: int64. Amount of TRX staked for resources to be delegated, unit is sun.
- resource: string. Resource type: 'BANDWIDTH' or 'ENERGY'.
- visible: boolean. Optional, Whether the address is in base58 format.
- permission_id: int32. Optional, for multi-signature use.
Returns:
- Unsigned transaction - JSON string.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/undelegateresource?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551",
"receiver_address": "41d1e7a6bc354106cb410e65ff8b181c600ff14292",
"balance": 1000000,
"resource": "BANDWIDTH"
}'
Response
withdrawexpireunfreeze
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/withdrawexpireunfreeze?apikey={apikey}
Withdraw unfrozen balance in Stake2.0, the user can call this API to get back their funds after executing /wallet/unfreezebalancev2 transaction and waiting N days, N is a network parameter.
请求参数说明:
- owner_address: string. default hexString.
- visible: boolean. Optional, Whether the address is in base58 format.
- permission_id: int32. Optional, for multi-signature use.
Returns:
- Unsigned transaction - JSON string.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/withdrawexpireunfreeze?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551"
}'
Response
getavailableunfreezecount
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getavailableunfreezecount?apikey={apikey}
Remaining times of executing unstake operation in Stake2.0.
Stake 2.0 supports unstaking in batches, but only allows a maximum of 32 unstake operations at the same time. That is to say, when a user initiates the first unstake operation, before the TRX of the first unstaking arrives and is ready to be withdrawn to his or her account, he or she can only initiate another 31 unstake operations. This can prevent malicious attacks.
请求参数说明:
- owner_address: string. default hexString.
- visible: boolean. Optional, Whether the address is in base58 format.
Returns:
- count : int64 : Remaining times of available unstaking.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getavailableunfreezecount?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551"
}'
Response
{
"count": 32
}
getcanwithdrawunfreezeamount
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getcanwithdrawunfreezeamount?apikey={apikey}
Query the withdrawable balance at the specified timestamp In Stake2.0.
请求参数说明:
- owner_address: string. default hexString.
- timestamp: int64. query cutoff timestamp, in milliseconds.
- visible: boolean. Optional, Whether the address is in base58 format.
Returns:
- amount - int64 : withdrawable balance, unit is sun.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getcanwithdrawunfreezeamount?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551",
"timestamp": 1667977444000
}'
Response
getcandelegatedmaxsize
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getcandelegatedmaxsize?apikey={apikey}
In Stake2.0, query the amount of delegatable resources share of the specified resource type for an address, unit is sun.
请求参数说明:
- owner_address: string. default hexString
- type: int32. resource type, 0 is bandwidth, 1 is energy
- visible: boolean. Optional, Whether the address is in base58 format.
Returns:
- max_size - int64 : the amount of delegatable resource share, unit is sun.
Note: If the delegating transaction has a memo, it would consume more bandwidth, therefore the actual delegatable share would be less than the return of this API.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getcandelegatedmaxsize?apikey={apikey}' \
--data '{
"owner_address": "4100776428620856AE1D71562812B734E356B68551",
"type": 0
}'
Response
getdelegatedresourcev2
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getdelegatedresourcev2?apikey={apikey}
In Stake2.0, query the detail of resource share delegated from fromAddress to toAddress.
Parameters:
- fromAddress: string. default hexString.
- toAddress: string. resource to address.
- visible: boolean. Optional, Whether the address is in base58 format.
Returns:
- delegatedResource - List: Resource delegation list, each resource delegation information includes below fields:
Field | Description |
---|---|
from | owner address |
to | recipient address |
frozen_balance_for_bandwidth | amount of TRX staked for bandwidth delegated from from address to to address |
frozen_balance_for_energy | amount of TRX staked for energy delegated from from address to to address |
expire_time_for_bandwidth | Lock-up period deadline for bandwidth delegation |
expire_time_for_energy | Lock-up period deadline for energy delegation |
Note that if the field value is 0 or null, the field will not be displayed in the returned result. For delegation deadlines, expire_time_for_bandwidth or expire_time_for_energy will be 0 if no lock is specified when delegating resources, and does not been displayed.
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getdelegatedresourcev2?apikey={apikey}' \
--data '{
"fromAddress": "4100776428620856AE1D71562812B734E356B68551",
"toAddress": "419A9AFE56E155EF0FF3F680D00ECF19DEFF60BDCA"
}'
Response
getdelegatedresourceaccountindexv2
POST
https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getdelegatedresourceaccountindexv2?apikey={apikey}
In Stake2.0, query the resource delegation index by an account. Two lists will return, one is the list of addresses the account has delegated its resources(toAddress), and the other is the list of addresses that have delegated resources to the account(fromAddress).
请求参数说明:
- value: string. default hexString.
- visible: boolean. Optional, Whether the address is in base58 format.
Returns:
Field | Description |
---|---|
account | Account address |
fromAccounts | The list of addresses that have delegated resources to the account |
toAccounts | The list of addresses the account has delegated its resources to |
Request
curl --location -g 'https://services.tokenview.io/vipapi/nodeservice/trx/wallet/getdelegatedresourceaccountindexv2?apikey={apikey}' \
--data '{
"value": "4100776428620856AE1D71562812B734E356B68551"
}'
Response
{
"account": "4100776428620856ae1d71562812b734e356b68551"
}