Polluxchain
  1. Account Resources
Polluxchain
  • Background
  • API key
    • Rate Limits
    • Security Settings
  • Full Node HTTP API
    • Address Utilities
      • ValidateAddress
    • Transactions
      • BroadcastTransaction
      • BroadcastHex
      • CreateTransaction
    • Accounts
      • CreateAccount
      • GetAccount
      • UpdateAccount
      • AccountPermissionUpdate
      • GetAccountBalance
    • Account Resources
      • GetAccountResource
        POST
      • GetAccountNet
        POST
      • FreezeBalance
        POST
      • UnfreezeBalanceV2
        POST
      • CancelAllUnfreezeV2
        POST
      • DelegateResource
        POST
      • UnDelegateResource
        POST
      • WithdrawExpireUnfreeze
        POST
      • GetAvailableUnfreezeCount
        POST
      • GetCanWithdrawUnfreezeAmount
        POST
      • GetCanDelegatedMaxSize
        POST
      • GetDelegatedResourceV2
        POST
      • GetDelegatedResourceAccountIndexV2
        POST
    • Query The Network
      • GetBlock
      • GetBlockByNum
      • GetBlockById
      • GetBlockByLatestNum
      • GetBlockByLimitNext
      • GetNowBlock
      • GetTransactionById
      • GetTransactionInfoById
      • GetTransactionInfoByBlockNum
      • ListNodes
      • GetNodeInfo
      • GetChainParameters
      • GetBlockBalance
      • GetEnergyPrices
      • GetBandwidthPrices
      • GetBurnTRX
      • GetApprovedList
    • Smart Contract
      • GetContract
      • GetContractInfo
      • TriggerSmartContract
      • TriggerConstantContract
      • DeployContract
      • UpdateSetting
      • UpdateEnergyLimit
      • ClearAbi
      • EstimateEnergy
    • Voting & SRs
      • ListWitnesses
      • CreateWitness
      • UpdateWitness
      • GetBrokerage
      • UpdateBrokerage
      • VoteWitnessAccount
      • GetReward
      • WithdrawBalance
      • GetNextMaintenanceTime
    • Proposals
      • ListProposals
      • GetProposalById
      • ProposalCreate
      • ProposalApprove
      • ProposalDelete
    • Pending pool
      • GetTransactionListFromPending
      • GetTransactionFromPending
      • GetPendingSize
  • Full Node Solidity HTTP API
    • Transactions
      • GetTransactionById
      • GetTransactionInfoById
      • GetTransactionInfoByBlockNum
      • GetTransactionCountByBlockNum
    • Blocks
      • GetBlock
      • GetNowBlock
      • GetBlockByNum
      • GetBlockById
      • GetBlockByLatestNum
      • GetBlockByLimitNext
    • Account Resources
      • GetAccount
      • GetDelegatedResource
      • GetDelegatedResourceAccountIndex
      • GetCanDelegatedMaxSize
      • GetCanWithdrawUnfreezeAmount
      • GetDelegatedResourceAccountIndexV2
      • GetAvailableUnfreezeCount
    • Node & Chain
      • GetNodeInfo
      • GetBurnPOX
    • Smart Contracts
      • TriggerConstantContract
      • EstimateEnergy
    • Voting & SRs
      • ListWitnesses
      • GetReward
      • GetBrokerage
  • Full Node JSON-RPC API
    • Overview
    • buildTransaction
    • eth
      • eth_accounts
      • eth_blockNumber
      • eth_call
      • eth_chainId
      • eth_coinbase
      • eth_estimateGas
      • eth_gasPrice
      • eth_getBalance
      • eth_getBlockByHash
      • eth_getBlockByNumber
      • eth_getBlockTransactionCountByHash
      • eth_getBlockTransactionCountByNumber
      • eth_getCode
      • eth_getStorageAt
      • eth_getTransactionByBlockHashAndIndex
      • eth_getTransactionByBlockNumberAndIndex
      • eth_getTransactionByHash
      • eth_getTransactionReceipt
      • eth_getWork
      • eth_protocolVersion
      • eth_syncing
      • eth_newFilter
      • eth_newBlockFilter
      • eth_getFilterChanges
      • eth_getFilterLogs
      • eth_uninstallFilter
      • eth_getLogs
    • net
      • net_listening
      • net_peerCount
      • net_version
    • web3
      • web3_clientVersion
      • web3_sha3
  • PolluxWeb
    • address
    • createAccount
    • createRandom
    • fromAscii
    • fromDecimal
    • fromMnemonic
    • fromUtf8
    • getEventByTransactionID
    • getEventResult
    • isAddress
    • isConnected
    • setHeader
    • setDefaultBlock
    • setPrivateKey
    • setAddress
    • sha3
    • toAscii
    • toBigNumber
    • toDecimal
    • toHex
    • toRAM
    • toUtf8
    • BigNumber
    • polluxweb.trx
      • getAccount
      • getAccountResources
      • getApprovedList
      • getAvailableUnfreezeCount
      • getBalance
      • getBandwidth
      • getBlock
      • getBlockByHash
      • getBlockByNumber
      • getBlockRange
      • getBlockTransactionCount
      • getBrokerage
      • getCanDelegatedMaxSize
      • getCanWithdrawUnfreezeAmount
      • getChainParameters
      • getConfirmedTransaction
      • getContract
      • getCurrentBlock
      • getDelegatedResourceV2
      • getDelegatedResourceAccountIndexV2
      • getExchangeByID
      • getNodeInfo
      • getReward
      • getTokenByID
      • getTokenFromID
      • getTokenListByName
      • getTokensIssuedByAddress
      • getTransaction
      • getTransactionFromBlock
      • getTransactionInfo
      • getUnconfirmedBalance
      • getUnconfirmedBrokerage
      • getUnconfirmedReward
      • listExchanges
      • listExchangesPaginated
      • listNodes
      • listProposals
      • listSuperRepresentatives
      • listTokens
      • sendRawTransaction
      • sendHexTransaction
      • sendToken
      • sendTransaction
      • sign
      • signMessageV1
      • signMessageV2
      • timeUntilNextVoteCycle
      • multiSign
      • verifyMessage
      • verifyMessageV2
      • _signTypedData
      • verifyTypedData
    • polluxweb.transactionBuilder
      • addUpdateData
      • applyForSR
      • cancelUnfreezeBalanceV2
      • createAccount
      • createAsset
      • createProposal
      • createSmartContract
      • createToken
      • delegateResource
      • deleteProposal
      • estimateEnergy
      • extendExpiration
      • freezeBalance
      • freezeBalanceV2
      • injectExchangeTokens
      • purchaseAsset
      • purchaseToken
      • sendAsset
      • sendToken
      • sendTrx
      • tradeExchangeTokens
      • triggerConfirmedConstantContract
      • triggerConstantContract
      • triggerSmartContract
      • undelegateResource
      • unfreezeBalance
      • unfreezeBalanceV2
      • updateSetting
      • updateAccountPermissions
      • updateAsset
      • updateBrokerage
      • updateEnergyLimit
      • updateToken
      • vote
      • voteProposal
      • withdrawBlockRewards
      • withdrawExchangeTokens
      • withdrawExpireUnfreeze
    • poxweb.contract
      • polluxweb.contract.new
      • polluxweb.contract()
      • method.call()
      • method.send()
    • polluxweb.utils
      • transaction.txJsonToPb
      • transaction.txPbToTxID
      • message.hashMessage
  • Pollux CLI
    • Pollux CLI
  1. Account Resources

DelegateResource

POST
/wallet/delegateresource
Delegate bandwidth or energy resources to other accounts in Stake2.0.

Returns
Transaction object - JSON object: Unsigned transaction, please refer to the Transaction chapter for the fields contained in it. Since the transaction type is DelegateResourceContract, the fields contained in raw_data.contract[0].parameter.value in the transaction are as follows:
FieldTypeDescription
owner_addressstringAccount address
resourcestringResource type
receiver_addressstringResource receiver address
balanceInt64Resource delegate amount, the unit is RAM
lockboolWhether to lock the resource delegation, true means locked the delegation, the delegating cannot be canceled within the period specified by lock_period, false means non-locked, the resource delegating can be canceled at any time
lock_periodInt64Lock period, the unit is block interval(3 seconds). Only when lock is true, this field is valid. If the delegate lock period is 1 day, the lock_period is 28800.

Request

Body Params application/json
object {0}
Example
{
  "owner_address": "PHqgRM8giN6Nr9DgA1FybUjKFwd79cxhyp",
  "receiver_address": "PSzTrL9rUT9ak5MZbResVqUV9Ztqz83PAA",
  "balance": 1000000,
  "resource": "ENERGY",
  "lock": false,
  "visible": true
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/wallet/delegateresource' \
--header 'Content-Type: application/json' \
--data-raw '{
  "owner_address": "PHqgRM8giN6Nr9DgA1FybUjKFwd79cxhyp",
  "receiver_address": "PSzTrL9rUT9ak5MZbResVqUV9Ztqz83PAA",
  "balance": 1000000,
  "resource": "ENERGY",
  "lock": false,
  "visible": true
}'

Responses

🟢200Success
application/json
Body
object {0}
Examples
{
    "visible": true,
    "txID": "5478c1a4cdcdb3066a86b98674c759fb63f344760e39ea2a95d088c2b564857d",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "balance": 1000000,
                        "resource": "ENERGY",
                        "receiver_address": "PSzTrL9rUT9ak5MZbResVqUV9Ztqz83PAA",
                        "owner_address": "PHqgRM8giN6Nr9DgA1FybUjKFwd79cxhyp"
                    },
                    "type_url": "type.googleapis.com/protocol.DelegateResourceContract"
                },
                "type": "DelegateResourceContract"
            }
        ],
        "ref_block_bytes": "1438",
        "ref_block_hash": "38afe2373ca42884",
        "expiration": 1736491836000,
        "timestamp": 1736491778617
    },
    "raw_data_hex": "0a021438220838afe2373ca4288440e0c4eaf7c4325a710839126d0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412340a153765776280f01cdc51d0bc2b5a952a552d1c62bc2f100118c0843d221537c9d9c4a8f138d2d83e0a854fa9c9292d4e5090a770b984e7f7c432"
}
Previous
CancelAllUnfreezeV2
Next
UnDelegateResource
Built with