RPC Reference
Web Socket RPC
subscribe
public function subscribe(string addresses, bool? blocks, bool? transactions) const returns uint64
Subscribe to streams of incoming blocks and transactions optionally include blocks and transactions relevant to comma separated address list
unsubscribe
public function unsubscribe() const returns void
Unsubscribe from all streams
Utility RPC
decodemessage
public function decodemessage(string message) const returns any[]
Decode message
decodeaddress
public function decodeaddress(string address) const returns string
Decode address
encodeaddress
public function encodeaddress(string public_key_hash) const returns string
Encode public key hash
decodetransaction
public function decodetransaction(string message_hex) const returns { transaction: txn, signer_address: string }
Decode transaction message and convert to object
help
public function help() const returns { declaration: string, method: string, description: string }[]
Get reference of all methods
Ledger RPC
public view function getmultiform(string type, any column, any row) const returns multiform
Get multiform by type, column and row
getaccountbalance
public view function getaccountbalance(string address, string asset) const returns multiform
Get account balance by address and asset
public view function getaccountmultiform(string address, string column, string row) const returns multiform
Get account storage by address, column and row
getvalidatorattestationwithrewards
public view function getvalidatorattestationwithrewards(string asset, string address) const returns multiform
Get validator attestation by address and asset
public view function getmultiformsbycolumnfilter(string type, any column, string rank_condition = '>' | '>=' | '=' | '<>' | '<=' | '<', uint256 rank_value, int8 rank_order, uint64 offset, uint64 count) const returns multiform[]
Get multiform by type, column and rank
getblockgaspricebyhash
public view function getblockgaspricebyhash(uint256 hash, string asset, double? percentile = 0.5) const returns decimal
Get gas price from percentile of block transactions by hash
public view function getuniform(string type, any index) const returns uniform
Get uniform by type and index
getvalidatorattestationreward
public view function getvalidatorattestationreward(string address, string asset) const returns multiform
Get validator attestation reward by address and asset
getvalidatorproductionwithrewards
public view function getvalidatorproductionwithrewards(string address) const returns multiform
Get validator production with rewards by address
public view function getmultiformsbyrowfilter(string type, any row, string rank_condition = '>' | '>=' | '=' | '<>' | '<=' | '<', uint256 rank_value, int8 rank_order, uint64 offset, uint64 count) const returns multiform[]
Get multiform by type, row and rank
getvalidatorparticipation
public view function getvalidatorparticipation(string address) const returns multiform
Get validator participation by address
public view function getmultiformscountbyrowfilter(string type, any row, string rank_condition = '>' | '>=' | '=' | '<>' | '<=' | '<', uint256 rank_value) const returns uint64
Get multiform count by type, row and rank
public view function getmultiformscountbycolumnfilter(string type, any column, string rank_condition = '>' | '>=' | '=' | '<>' | '<=' | '<', uint256 rank_value) const returns uint64
Get multiform count by type, column and rank
getbestvalidatorattestations
public view function getbestvalidatorattestations(string asset, uint256 commitment, uint64 offset, uint64 count) const returns multiform[]
Get best validator attestations (zero commitment = offline, non-zero commitment = online threshold)
getassetholders
public view function getassetholders(string asset, uint256 rank) const returns uint64
Get amount of asset holders with rank (balance value) greater or equal some value
getblockgaspricebynumber
public view function getblockgaspricebynumber(uint64 number, string asset, double? percentile = 0.5) const returns decimal
Get gas price from percentile of block transactions by number
getvalidatorproductionreward
public view function getvalidatorproductionreward(string address, string asset) const returns multiform
Get validator production reward by address and asset
public view function getmultiformsbycolumn(string type, any column, uint64 offset, uint64 count) const returns multiform[]
Get multiform by type and column
calltransaction
public view function calltransaction(string asset, string from_address, string to_address, string function, any... args) const returns program_trace
Execute of immutable function of program assigned to to_address
getvalidatorproduction
public view function getvalidatorproduction(string address) const returns multiform
Get validator production by address
getvalidatorparticipationrewards
public view function getvalidatorparticipationrewards(string address, uint64 offset, uint64 count) const returns multiform
Get validator participation rewards by address
getblockstatebyhash
public view function getblockstatebyhash(uint256 hash, uint8? unrolling = 0) const returns (uint256[] | (uniform|multiform)[])
Get block state by hash
getblockstatebynumber
public view function getblockstatebynumber(uint64 number, uint8? unrolling = 0) const returns (uint256[] | (uniform|multiform)[])
Get block state by number
public view function getmultiformscountbyrow(string type, any row) const returns uint64
Get multiform count by type and row
getvalidatorparticipationref
public view function getvalidatorparticipationref(string owner_address, string ref_owner_address, string ref_asset, uint256 ref_hash) const returns multiform
Get validator participation by ref
public view function getmultiformscountbycolumn(string type, any column) const returns uint64
Get multiform count by type and column
getblockassetpricebyhash
public view function getblockassetpricebyhash(uint256 hash, string asset_from, string asset_to, double? percentile = 0.5) const returns decimal
Get gas asset from percentile of block transactions by hash
getblockassetpricebynumber
public view function getblockassetpricebynumber(uint64 number, string asset_from, string asset_to, double? percentile = 0.5) const returns decimal
Get gas asset from percentile of block transactions by number
public view function getmultiformsbyrow(string type, any row, uint64 offset, uint64 count) const returns multiform[]
Get multiform by type and row
getaccountnonce
public view function getaccountnonce(string address) const returns uint64
Get account nonce by address
getaccountprogram
public view function getaccountprogram(string address) const returns uniform
Get account program hashcode by address
public view function getaccountuniform(string address, string index) const returns uniform
Get account storage by address and index
public view function getaccountmultiforms(string address, string column, uint64 offset, uint64 count) const returns multiform[]
Get account storage by address and column
getaccountbalances
public view function getaccountbalances(string address, uint64 offset, uint64 count) const returns multiform[]
Get account balances by address
getbestvalidatorproducers
public view function getbestvalidatorproducers(uint256 commitment, uint64 offset, uint64 count) const returns multiform[]
Get best validator producers (zero commitment = offline, non-zero commitment = online threshold)
getvalidatorproductionrewards
public view function getvalidatorproductionrewards(string address, uint64 offset, uint64 count) const returns multiform
Get validator production rewards by address
getvalidatorparticipationwithrewards
public view function getvalidatorparticipationwithrewards(string address) const returns multiform
Get validator participation with rewards by address
getvalidatorparticipations
public view function getvalidatorparticipations(string address, uint64 offset, uint64 count) const returns multiform[]
Get validator participations by address
getbestvalidatorparticipation
public view function getbestvalidatorparticipation(uint256 commitment, uint64 offset, uint64 count) const returns multiform[]
Get best validator participations (zero commitment = offline, non-zero commitment = online threshold)
getvalidatorparticipationreward
public view function getvalidatorparticipationreward(string address, string asset) const returns multiform
Get validator participation reward by address and asset
getvalidatorparticipationrefs
public view function getvalidatorparticipationrefs(string owner_address, uint64 offset, uint64 count) const returns multiform
Get validator participation refs by address
getvalidatorattestation
public view function getvalidatorattestation(string asset, string address) const returns multiform
Get validator attestation by address and asset
getvalidatorattestations
public view function getvalidatorattestations(string address, uint64 offset, uint64 count) const returns multiform[]
Get validator attestations by address
getvalidatorattestationswithrewards
public view function getvalidatorattestationswithrewards(string address) const returns multiform[]
Get validator attestations with rewards by address
getvalidatorattestationrewards
public view function getvalidatorattestationrewards(string address, uint64 offset, uint64 count) const returns multiform
Get validator attestation rewards by address
getbridgeaccount
public view function getbridgeaccount(string owner_address, string asset, uint256 hash) const returns multiform
Get bridge account by owner addresses, asset and hash
getbridgeaccounts
public view function getbridgeaccounts(uint256 hash, uint64 offset, uint64 count) const returns multiform[]
Get bridge accounts by hash
getbridgeinstance
public view function getbridgeinstance(string asset, uint256 hash) const returns multiform
Get bridge instance by asset and hash
getbridgeinstances
public view function getbridgeinstances(string asset, uint64 offset, uint64 count) const returns multiform[]
Get bridge balances by asset
getbestbridgeinstances
public view function getbestbridgeinstances(string asset, uint64 offset, uint64 count) const returns multiform[]
Get best bridge balances by asset
getbestbridgeinstancesbysecurity
public view function getbestbridgeinstancesbysecurity(string asset, uint64 offset, uint64 count) const returns { instance: multiform, balance: multiform? }[]
Get best bridge instance based on security level
getbestbridgeinstancesbybalance
public view function getbestbridgeinstancesbybalance(string asset, uint64 offset, uint64 count) const returns { instance: multiform?, balance: multiform }[]
Get best bridge instance based on total value locked
getbridgebalance
public view function getbridgebalance( string asset, uint256 hash) const returns multiform
Get bridge balance by asset and hash
getbridgebalances
public view function getbridgebalances(uint256 hash, uint64 offset, uint64 count) const returns multiform[]
Get bridge balances by hash
getbestbridgebalances
public view function getbestbridgebalances(string asset, uint64 offset, uint64 count) const returns multiform[]
Get accounts with best bridge balance
getwitnessprogram
public view function getwitnessprogram(string hashcode) const returns uniform
Get witness program by hashcode (512bit number)
getwitnessevent
public view function getwitnessevent(uint256 transaction_hash) const returns uniform
Get witness event by transaction hash
getwitnessaccount
public view function getwitnessaccount(string address, string asset, string wallet_address) const returns multiform
Get witness address by owner address, asset, wallet address
getwitnessaccounttagged
public view function getwitnessaccounttagged(string asset, string wallet_address, uint64 offset) const returns multiform
Get witness address by asset and wallet address
getwitnessaccounts
public view function getwitnessaccounts(string address, uint64 offset, uint64 count) const returns multiform[]
Get witness addresses by owner address
getwitnessaccountsbypurpose
public view function getwitnessaccountsbypurpose(string address, string purpose = 'witness' | 'router' | 'custodian' | 'bridge', uint64 offset, uint64 count) const returns multiform[]
Get witness addresses by owner address
getwitnesstransaction
public view function getwitnesstransaction(string asset, string transaction_id) const returns uniform
Get witness transaction by asset and transaction id
Block RPC
getblocktiphash
public view function getblocktiphash() const returns uint256
Get block tip hash
getblocks
public view function getblocks(uint64 number, uint64 count) const returns uint256[]
Get block hashes
getrawblockbyhash
public view function getrawblockbyhash(uint256 hash) const returns string
Get block by hash
getblockcheckpointhash
public view function getblockcheckpointhash() const returns uint256
Get block checkpoint hash
getblockcheckpointnumber
public view function getblockcheckpointnumber() const returns uint64
Get block checkpoint number
getblocktipnumber
public view function getblocktipnumber() const returns uint64
Get block tip number
getblockbyhash
public view function getblockbyhash(uint256 hash, uint8? unrolling = 0) const returns block
Get block by hash
getblockbynumber
public view function getblockbynumber(uint64 number, uint8? unrolling = 0) const returns block
Get block by number
getrawblockbynumber
public view function getrawblockbynumber(uint64 number) const returns string
Get block by number
getblockproofbyhash
public view function getblockproofbyhash(uint256 hash, bool? transactions, bool? receipts, bool? states) const returns block::proof
Get block proof by hash
getblockproofbynumber
public view function getblockproofbynumber(uint64 number, bool? transactions, bool? receipts, bool? states) const returns block::proof
Get block proof by number
getblocknumberbyhash
public view function getblocknumberbyhash(uint256 hash) const returns uint64
Get block number by hash
getblockhashbynumber
public view function getblockhashbynumber(uint64 number) const returns uint256
Get block hash by number
Validator RPC
acceptnode
private function acceptnode(string uri_address) returns void
Try to accept and connect to a node possibly by ip address
status
public view function status() const returns validator::status
Get validator status
exportentropies
private view function exportentropies(string participant_address, string password) const returns void
Export a set of encrypted entropy messages
getnode
public view function getnode(string uri_address) const returns validator
Get a node by ip address
getblockchains
public view function getblockchains() const returns superchain::asset_info[]
Get supported blockchains
importentropies
private function importentropies(string participant_address, string password, string... messages) returns void
Import a set of encrypted entropy messages
setwallet
private view function setwallet(string type = 'mnemonic' | 'seed' | 'key', string entropy) const returns wallet
Set validator wallet from mnemonic phrase, seed value or secret key
getwallet
private view function getwallet() const returns wallet
Get validator wallet
verify
private view function verify(uint64 number, uint64 count, bool? validate) const returns uint256[]
Verify chain and possibly re-execute each block
revert
private function revert(uint64 number, bool? keep_reverted_transactions) returns { new_tip_block_number: uint64, old_tip_block_number: uint64, mempool_transactions: uint64, block_delta: int64, transaction_delta: int64, state_delta: int64, is_fork: bool }
Revert chainstate to block number and possibly send removed transactions to mempool
rejectnode
private function rejectnode(string uri_address) returns void
Reject and disconnect from a node by ip address
submitblock
private function submitblock() returns void
Try to propose a block from mempool transactions
Mempool RPC
getmempooltransactionbyhash
public view function getmempooltransactionbyhash(uint256 hash) const returns txn
Get mempool transaction by hash
addnode
private function addnode(string uri_address) returns void
Add node ip address to trial addresses
getaddresses
public view function getaddresses(uint64 offset, uint64 count, string? services = 'consensus' | 'discovery' | 'superchain' | 'rpc' | 'rpc_public_access' | 'rpc_web_sockets' | 'production' | 'participation' | 'attestation') const returns string[]
Get best node ip addresses with optional comma separated list of services
getclosestnode
public view function getclosestnode(uint64? offset) const returns validator
Get closest node info
getclosestnodecount
public view function getclosestnodecount() const returns uint64
Get closest node count
getgasprice
public view function getgasprice(string asset, double? percentile = 0.5, bool? mempool_only) const returns { price: decimal, paid: boolean }
Get gas price from percentile of pending transactions
getassetprice
public view function getassetprice(string asset_from, string asset_to, double? percentile = 0.5) const returns decimal
Get gas asset from percentile of pending transactions
simulatetransaction
public view function simulatetransaction(string message_hex) const returns uint256
Execute transaction with block gas limit and return the receipt
getrawmempooltransactionbyhash
public view function getrawmempooltransactionbyhash(uint256 hash) const returns string
Get raw mempool transaction by hash
getnextaccountnonce
public view function getnextaccountnonce(string owner_address) const returns uint64
Get account nonce for next transaction by owner
getmempooltransactions
public view function getmempooltransactions(bool commitment, uint64 offset, uint64 count, uint8? unrolling) const returns (uint256[] | txn[])
Get mempool transactions
getmempooltransactionsbyowner
public view function getmempooltransactionsbyowner(const string address, uint64 offset, uint64 count, uint8? direction = 1, uint8? unrolling) const returns (uint256[] | txn[])
Get mempool transactions by signing address
submittransaction
public view function submittransaction(string message_hash) returns uint256
Try to accept and relay a mempool transaction from raw data and possibly validate over latest chainstate
rejecttransaction
private function rejecttransaction(uint256 hash) returns void
Remove mempool transaction by hash
simulatebridge
private function simulatebridge(string asset, string bridge_hash, string to_address, decimal to_value) returns superchain_transaction
Build an off-chain attestation transaction payload using off-chain node
clearnode
private function clearnode(string uri_address) returns void
Remove associated node info by ip address
Transaction RPC
getblocktransactionsbyhash
public view function getblocktransactionsbyhash(uint256 hash, uint8? unrolling = 0) const returns (uint256[] | txn[] | block::txn[])
Get block transactions by hash
getreceiptbytransactionhash
public view function getreceiptbytransactionhash(uint256 hash) const returns receipt
Get receipt by transaction hash
getblocktransactionsbynumber
public view function getblocktransactionsbynumber(uint64 number, uint8? unrolling = 0) const returns (uint256[] | txn[] | block::txn[])
Get block transactions by number
getblockreceiptsbyhash
public view function getblockreceiptsbyhash(uint256 hash, uint8? unrolling = 0) const returns (uint256[] | receipt[])
Get block receipts by hash
getblockreceiptsbynumber
public view function getblockreceiptsbynumber(uint64 number, uint8? unrolling = 0) const returns (uint256[] | receipt[])
Get block receipts by number
getfinalizedtransactions
public view function getfinalizedtransactions(uint64 offset, uint64 count, uint8? unrolling = 0) const returns (uint256[] | txn[] | block::txn[])
Get latest finalized transactions
getpendingtransactionsbyhash
public view function getpendingtransactionsbyhash(uint256 hash, uint8? unrolling = 0) const returns (uint256[] | txn[] | block::txn[])
Get block transactions by hash
getpendingtransactionsbynumber
public view function getpendingtransactionsbynumber(uint64 number, uint8? unrolling = 0) const returns (uint256[] | txn[] | block::txn[])
Get block transactions by number
gettransactionsbyowner
public view function gettransactionsbyowner(string owner_address, uint64 offset, uint64 count, uint8? direction = 1, uint8? unrolling = 0) const returns (uint256[] | txn[] | block::txn[])
Get transactions by owner
gettransactionsbyhash
public view function gettransactionsbyhash(uint256 hash, uint8? unrolling = 0) const returns (txn | block::txn)
Get transactions by hash including aliases
gettransactionbyhash
public view function gettransactionbyhash(uint256 hash, uint8? unrolling = 0) const returns (txn | block::txn)
Get transaction by hash including aliases
getrawtransactionbyhash
public view function getrawtransactionbyhash(uint256 hash) const returns string
Get raw transaction by hash