Polluxchain
  1. Full Node JSON-RPC API
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
      • GetAccountNet
      • FreezeBalance
      • UnfreezeBalanceV2
      • CancelAllUnfreezeV2
      • DelegateResource
      • UnDelegateResource
      • WithdrawExpireUnfreeze
      • GetAvailableUnfreezeCount
      • GetCanWithdrawUnfreezeAmount
      • GetCanDelegatedMaxSize
      • GetDelegatedResourceV2
      • GetDelegatedResourceAccountIndexV2
    • 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. Full Node JSON-RPC API

buildTransaction

Create a transaction, different transaction types have different parameters

TransferContract
Parameters
Object - the items in object as below:
Param NameData TypeDescription
fromDATA, 20 BytesThe address the transaction is sent from.
toDATA, 20 BytesThe address the transaction is directed to.
valueDATAthe transfer amount
Returns
Object - transaction of TransferContract or an error
Result

TransferAssetContract#

Parameters
Object - the items in object as below:
Item NameData TypeDescription
fromDATA, 20 BytesThe address the transaction is sent from
toDATA, 20 BytesThe address the transaction is directed to
tokenIdQUANTITYToken ID
tokenValueQUANTITYThe transfer amount of PRC10
Returns
Object - transaction of TransferAssetContract or an error
Example
cURL
Result
JSON
{"jsonrpc":"2.0","id":44,"error":{"code":-32600,"message":"assetBalance must be greater than 0.","data":"{}"}}

CreateSmartContract#

Parameters
Object - the items in object as below:
FieldData TypeDescription
fromDATA, 20 BytesThe address the transaction is sent from
nameDATAThe name of the smart contract
gasDATAFee limit
abiDATAThe ABI of the smart contract
dataDATAThe byte code of the smart contract
consumeUserResourcePercentQUANTITYThe consume user resource percent
originEnergyLimitQUANTITYThe origin energy limit
valueDATAThe data passed through call_value
tokenIdQUANTITYToken ID
tokenValueQUANTITYThe transfer amount of PRC10
Returns
Object - transaction of CreateSmartContract or an error
Example
cURL
Result
JSON
{"jsonrpc":"2.0","id":1337,"result":{"transaction":{"visible":false,"txID":"598d8aafbf9340e92c8f72a38389ce9661b643ff37dd2a609f393336a76025b9","contract_address":"41dfd93697c0a978db343fe7a92333e11eeb2f967d","raw_data":{"contract":[{"parameter":{"value":{"token_id":1000033,"owner_address":"41c4db2c9dfbcb6aa344793f1dda7bd656598a06d8","call_token_value":100000,"new_contract":{"bytecode":"6080604052d3600055d2600155346002556101418061001f6000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305c24200811461005b5780633be9ece71461008157806371dc08ce146100aa575b600080fd5b6100636100b2565b60408051938452602084019290925282820152519081900360600190f35b6100a873ffffffffffffffffffffffffffffffffffffffff600435166024356044356100c0565b005b61006361010d565b600054600154600254909192565b60405173ffffffffffffffffffffffffffffffffffffffff84169082156108fc029083908590600081818185878a8ad0945050505050158015610107573d6000803e3d6000fd5b50505050565bd3d2349091925600a165627a7a72305820a2fb39541e90eda9a2f5f9e7905ef98e66e60dd4b38e00b05de418da3154e7570029","consume_user_resource_percent":100,"name":"transferTokenContract","origin_address":"41c4db2c9dfbcb6aa344793f1dda7bd656598a06d8","abi":{"entrys":[{"outputs":[{"type":"trcToken"},{"type":"uint256"},{"type":"uint256"}],"payable":true,"name":"getResultInCon","stateMutability":"Payable","type":"Function"},{"payable":true,"inputs":[{"name":"toAddress","type":"address"},{"name":"id","type":"trcToken"},{"name":"amount","type":"uint256"}],"name":"TransferTokenTo","stateMutability":"Payable","type":"Function"},{"outputs":[{"type":"trcToken"},{"type":"uint256"},{"type":"uint256"}],"payable":true,"name":"msgTokenValueAndTokenIdTest","stateMutability":"Payable","type":"Function"},{"payable":true,"stateMutability":"Payable","type":"Constructor"}]},"origin_energy_limit":11111111111111,"call_value":500}},"type_url":"type.googleapis.com/protocol.CreateSmartContract"},"type":"CreateSmartContract"}],"ref_block_bytes":"80be","ref_block_hash":"ac7c3d59c55ac92c","expiration":1634030190000,"fee_limit":333333280,"timestamp":1634030131693},"raw_data_hex":"0a0280be2208ac7c3d59c55ac92c40b0fba79ec72f5ad805081e12d3050a30747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e437265617465536d617274436f6e7472616374129e050a1541c4db2c9dfbcb6aa344793f1dda7bd656598a06d812fc040a1541c4db2c9dfbcb6aa344793f1dda7bd656598a06d81adb010a381a0e676574526573756c74496e436f6e2a0a1a08747263546f6b656e2a091a0775696e743235362a091a0775696e743235363002380140040a501a0f5472616e73666572546f6b656e546f22141209746f416464726573731a0761646472657373220e120269641a08747263546f6b656e22111206616d6f756e741a0775696e743235363002380140040a451a1b6d7367546f6b656e56616c7565416e64546f6b656e4964546573742a0a1a08747263546f6b656e2a091a0775696e743235362a091a0775696e743235363002380140040a0630013801400422e0026080604052d3600055d2600155346002556101418061001f6000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305c24200811461005b5780633be9ece71461008157806371dc08ce146100aa575b600080fd5b6100636100b2565b60408051938452602084019290925282820152519081900360600190f35b6100a873ffffffffffffffffffffffffffffffffffffffff600435166024356044356100c0565b005b61006361010d565b600054600154600254909192565b60405173ffffffffffffffffffffffffffffffffffffffff84169082156108fc029083908590600081818185878a8ad0945050505050158015610107573d6000803e3d6000fd5b50505050565bd3d2349091925600a165627a7a72305820a2fb39541e90eda9a2f5f9e7905ef98e66e60dd4b38e00b05de418da3154e757002928f40330643a157472616e73666572546f6b656e436f6e747261637440c7e3d28eb0c30218a08d0620e1843d70edb3a49ec72f9001a086f99e01"}}}

TriggerSmartContract#

Parameters
Object - the items in object as below:
FieldData TypeDescription
fromDATA, 20 BytesThe address the transaction is sent from
toDATA, 20 BytesThe address of the smart contract
dataDATAThe invoked contract function and parameters
gasDATAFee limit
valueDATAThe data passed through call_value
tokenIdQUANTITYToken ID
tokenValueQUANTITYThe transfer amount of PRC10
Returns
Object - transaction of TriggerSmartContract or an error
Example
cURL
Result
JSON
{"jsonrpc":"2.0","id":1337,"result":{"transaction":{"visible":false,"txID":"c3c746beb86ffc366ec0ff8bf6c9504c88f8714e47bc0009e4f7e2b1d49eb967","raw_data":{"contract":[{"parameter":{"value":{"amount":10,"owner_address":"41c4db2c9dfbcb6aa344793f1dda7bd656598a06d8","to_address":"41f859b5c93f789f4bcffbe7cc95a71e28e5e6a5bd"},"type_url":"type.googleapis.com/protocol.TransferContract"},"type":"TransferContract"}],"ref_block_bytes":"958c","ref_block_hash":"9d8c6bae734a2281","expiration":1684469328000,"timestamp":1684469270364},"raw_data_hex":"0a02958c22089d8c6bae734a22814080d1c89183315a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541c4db2c9dfbcb6aa344793f1dda7bd656598a06d8121541f859b5c93f789f4bcffbe7cc95a71e28e5e6a5bd180a70dc8ec5918331"}}}
Previous
Overview
Next
eth_accounts
Built with