Skip to Content
APIDaemon

Daemon API

You can use this API to retrieve information about the blockchain like block height, network difficulty, etc.
It includes a lof of methods to manage transactions, query details and monitor the network.

Send a POST request to /json_rpc.

curl -X POST -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "method": "get_info", "id": 1}' \ https://node.xelis.io/json_rpc
fetch('https://node.xelis.io/json_rpc', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'get_info', id: 1 }) })

Methods

get_version

Retrieve current daemon version

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_version", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": "1.2.0" }

get_info

Retrieve current info from chain

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_info", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "average_block_time": 16494, "block_reward": 145979248, "miner_reward": 1313813232, "dev_reward": 14597924, "block_time_target": 15000, "block_version": 6, "burned_supply": 0, "circulating_supply": 3155962164200, "difficulty": "62283705000", "emitted_supply": 3155962164200, "height": 21510, "maximum_supply": 1840000000000000, "mempool_size": 0, "network": "Testnet", "pruned_topoheight": null, "stableheight": 21502, "stable_topoheight": 21796, "top_block_hash": "000000000b47de796f1c033a23ddeacd2321606b8f0b3e5b5e11ba23b1d59dbb", "topoheight": 21809, "version": "1.8.0-70169a8" } }

get_dev_fee_thresholds

Retrieve configured dev fees thresholds

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_dev_fee_thresholds", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "fee_percentage": 15, "height": 0 }, { "fee_percentage": 10, "height": 1250000 }, { "fee_percentage": 5, "height": 3000000 } ] }

get_size_on_disk

Retrieve blockchain size on disk

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_size_on_disk", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "size_bytes": 94896128, "size_formatted": "90.5 MiB" } }

get_height

Retrieve current height of the chain

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_height", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 23 }

get_topoheight

Retrieve current topological height of the chain

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_topoheight", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 23 }

get_pruned_topoheight

Retrieve the pruned topoheight if the node has a pruned chain. Otherwise, returns null as value.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_pruned_topoheight", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": null }

get_stable_height

Retrieve current stable height of the chain. get_stableheight is kept as a backward-compatible alias.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_stable_height", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 15 }

get_stableheight

Backward-compatible alias for get_stable_height.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_stableheight", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 15 }

get_stable_topoheight

Retrieve current stable topoheight of the chain.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_stable_topoheight", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 18 }

get_difficulty

Retrieve current difficulty and associated network hashrate.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_difficulty", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "difficulty": "79746345000", "hashrate": "5316423000", "hashrate_formatted": "5.32 GH/s" } }

get_hard_forks

Retrieve the list of configured hard forks with their activation heights and changelogs.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_hard_forks", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "height": 0, "version": 0, "changelog": "Genesis version", "version_requirement": null }, { "height": 434514, "version": 1, "changelog": "...", "version_requirement": ">=1.10.0" } ] }

validate_address

Validate a wallet address by accepting or not integrated address.

Parameters

NameTypeRequiredNote
addressAddressRequiredwallet address to verify
allow_integratedBooleanOptionalAllow integrated addresses. By default set to false
max_integrated_data_sizeIntegerOptionalMaximum accepted integrated data size

Request

{ "jsonrpc": "2.0", "id": 1, "method": "validate_address", "params": { "address": "xel:vs3mfyywt0fjys0rgslue7mm4wr23xdgejsjk0ld7f2kxng4d4nqqnkdufz", "allow_integrated": false, "max_integrated_data_size": 1024 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "is_integrated": false, "is_valid": true } }

split_address

Split address and integrated data in two differents fields.

Parameters

NameTypeRequiredNote
addressAddressRequiredAddress to split in two parts: original address, and integrated data

Request

{ "jsonrpc": "2.0", "method": "split_address", "id": 1, "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32szqsrqyzkjar9d4esyqgpq4ehwmmjvsqqypgpq45x2mrvduqqzpthdaexceqpq4mk7unywvqsgqqpq4yx2mrvduqqzp2hdaexceqqqyzxvun0d5qqzp2cg4xyj5ct5udlg" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "integrated_data": { "hello": "world", "items": { "sword": 5 }, "words": [ "Hello", "World", "from", "XELIS" ] }, "size": 55 } }

extract_key_from_address

Extract public key from a wallet address

Parameters

NameTypeRequiredNote
addressAddressRequiredwallet address to verify
as_hexBooleanOptionalReturns Public Key as hexadecimal. By default set to false and returns a byte array.

NOTE: If as_hex is false, the response result will contains a field named bytes instead of hex.

Request

{ "jsonrpc": "2.0", "id": 1, "method": "extract_key_from_address", "params": { "address": "xel:vs3mfyywt0fjys0rgslue7mm4wr23xdgejsjk0ld7f2kxng4d4nqqnkdufz", "as_hex": true } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "hex": "6423b4908e5bd32241e3443fccfb7bab86a899a8cca12b3fedf255634d156d66" } }

make_integrated_address

Create an integrated address using a wallet address and data to include.

NOTE: Integrated data can be useful for services like Exchanges to identify a user transaction by integrating an ID (or anything else) in the address (like PaymentID for Monero).

It is not mandatory and support any data formatted in JSON up to 1 KB in serialized format.

Parameters

NameTypeRequiredNote
addressAddressRequiredWallet address to use for the integrated address
integrated_dataJSONRequiredAny data type in JSON format

Request

{ "jsonrpc": "2.0", "method": "make_integrated_address", "id": 1, "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "integrated_data": { "hello": "world", "items": { "sword": 5 }, "words": [ "Hello", "World", "from", "XELIS" ] } } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": "xel:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32szqsrqyzkjar9d4esyqgpq4ehwmmjvsqqypgpq45x2mrvduqqzpthdaexceqpq4mk7unywvqsgqqpq4yx2mrvduqqzp2hdaexceqqqyzxvun0d5qqzp2cg4xyj5ct5udlg" }

get_block_difficulty_by_hash

Retrieve the difficulty and hashrate for a specific block by its hash.

Parameters

NameTypeRequiredNote
block_hashHashRequiredBlock hash to look up

Request

{ "jsonrpc": "2.0", "method": "get_block_difficulty_by_hash", "id": 1, "params": { "block_hash": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "difficulty": "79746345000", "hashrate": "5316423000", "hashrate_formatted": "5.32 GH/s" } }

get_block_base_fee_by_hash

Retrieve the base fee per KB and block size EMA for a specific block by its hash.

Parameters

NameTypeRequiredNote
block_hashHashRequiredBlock hash to look up

Request

{ "jsonrpc": "2.0", "method": "get_block_base_fee_by_hash", "id": 1, "params": { "block_hash": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "fee_per_kb": 10000, "block_size_ema": 1024 } }

key_to_address

Convert a public key to an address.

Parameters

NameTypeRequiredNote
hexStringOne ofPublic key encoded as hexadecimal
bytesInteger[]One ofPublic key encoded as 32 raw byte integers

Parameter is either { "hex": "..." } or { "bytes": [...] }.

Request

{ "jsonrpc": "2.0", "method": "key_to_address", "id": 1, "params": { "hex": "6423b4908e5bd32241e3443fccfb7bab86a899a8cca12b3fedf255634d156d66" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" }

get_block_template

Retrieve the block template (Block Header) for PoW work.

Block Header can be serialized/deserialized using following order on byte array:

  • 1 byte for version
  • 8 bytes for height (u64) big endian format
  • 8 bytes for timestamp (u64) big endian format
  • 8 bytes for nonce (u64) big endian format
  • 32 bytes for extra nonce (this space is free and can be used to spread more the work or write anything)
  • 1 byte for tips count
  • 32 bytes per hash (count of elements is based on previous byte)
  • 2 bytes for txs hashes count (u16) big endian format
  • 32 bytes per hash (count of elements is based on previous value)
  • 32 bytes for miner public key

Parameters

NameTypeRequiredNote
addressAddressRequiredMiner address for rewards

Request

{ "jsonrpc": "2.0", "method": "get_block_template", "id": 1, "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "difficulty": "15000", "height": 45, "template": "00000000000000002d0000018f1cbd697000000000000000000eded85557e887b45989a727b6786e1bd250de65042d9381822fa73d01d2c4ff01d3a0154853dbb01dc28c9102e9d94bea355b8ee0d82c3e078ac80841445e86520000d67ad13934337b85c34985491c437386c95de0d97017131088724cfbedebdc55", "topoheight": 44, "algorithm": "xel/v1" } }

get_miner_work

Get a miner work based on a block template set in parameter. It is working the same as GetWork Server

A MinerWork struct is created from the block header work hash which represent the immutable part.

For the mutable part that can be updated by the miner we have the following field:

  • timestamp (u64) big endian format
  • nonce (u64) big endian format
  • miner key (32 bytes)
  • extra nonce (32 bytes)

NOTE: topoheight field is only the current node topoheight, it is included for visual only.

Due to DAG, you are not mining on a topoheight (which is set later dynamically by DAG order) but on a height.

Parameters

NameTypeRequiredNote
templateBlockTemplateRequiredBlock Template from which the MinerWork will be created
addressAddressOptionalMiner address for rewards. By default use address from template

Request

{ "jsonrpc": "2.0", "method": "get_miner_work", "id": 1, "params": { "template": "010000000000000054000001903764c5a70000000000000000f9ad5aa02ac0f78cad0f7c7f45c0af76c7908c2af490f4c23a32c96b8a336cc1019a687b66ed4e0bde3aea9f0d621a0df6cd751275748dccdd3c61578964ee602c00007e97ae5c4541acf3a43bd5789beda45586e28c427333373f96c2dc23fca46753", "address": "xet:06t6uhz9gxk08fpm64ufhmdy2krw9rzzwvenw0ukctwz8l9yvafsqdltctp" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "algorithm": "xel/v2", "difficulty": "107445", "height": 84, "miner_work": "e306a56d779b2cc9dc3b117eda5e02804c49a7ca3f2075b1c2a4ea870c92c0df000001903764c5a70000000000000000f9ad5aa02ac0f78cad0f7c7f45c0af76c7908c2af490f4c23a32c96b8a336cc17e97ae5c4541acf3a43bd5789beda45586e28c427333373f96c2dc23fca46753", "topoheight": 83 } }

submit_block

Submit a block header in hexadecimal format to the daemon.

NOTE: Parameter miner_work is optional has it is also supported to be directly applied on block_template.

Parameters

NameTypeRequiredNote
block_templateStringRequiredBlock in hex format
miner_workStringOptionalMiner work in hex format

Request

{ "jsonrpc": "2.0", "id": 0, "method": "submit_block", "params": { "block_template": "00000000000000002d0000018f1cbd697000000000000000000eded85557e887b45989a727b6786e1bd250de65042d9381822fa73d01d2c4ff01d3a0154853dbb01dc28c9102e9d94bea355b8ee0d82c3e078ac80841445e86520000d67ad13934337b85c34985491c437386c95de0d97017131088724cfbedebdc55" } }

Response

{ "id": 0, "jsonrpc": "2.0", "result": true }

get_block_at_topoheight

Retrieve a block at a specific topo height

Parameters

NameTypeRequiredNote
topoheightIntegerRequiredTopoheight must be equal or less than current topoheight
include_txsBooleanOptionalInclude txs serialized

Request

{ "jsonrpc": "2.0", "method": "get_block_at_topoheight", "id": 1, "params": { "topoheight": 10 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "block_type": "Sync", "cumulative_difficulty": "192780001", "difficulty": "27915000", "extra_nonce": "0a560da5a79ee20c286be60563ec56aa8ca3d4a0a08fb8c253d90523ec231d00", "hash": "0000000b308634e9a34256c90df9023d979e3f7e7290c4d8e479424ba6c06871", "height": 10, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "nonce": 432581, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 1608530035, "timestamp": 1711135323375, "tips": [ "000000263fc1172a2fdbbcf34334fd1853cc72618233be2b3bf247436f92ebea" ], "topoheight": 10, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "txs_hashes": [], "version": 0 } }

NOTE: The transactions field is only included when include_txs is set to true.

get_blocks_at_height

Retrieve all blocks at a specific height

Parameters

NameTypeRequiredNote
heightIntegerRequiredHeight must be equal or less than current height
include_txsBooleanOptionalInclude txs serialized

Request

{ "jsonrpc": "2.0", "method": "get_blocks_at_height", "id": 1, "params": { "height": 23 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "block_type": "Sync", "cumulative_difficulty": "971580001", "difficulty": "68940000", "extra_nonce": "4633b3dfdb9e99a607835f1e4d05cb0338c7d9e938a4e58659601b45b2704d00", "hash": "0000001e7c2427f078f49d70002a568d050c2726a959b23b6c500307183cc943", "height": 23, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "nonce": 13171398, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 3509518265, "timestamp": 1711135431639, "tips": [ "00000024f5688723a4afb000f49ed23b2a00bb25744b822700b82655c0df80b8" ], "topoheight": 23, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "txs_hashes": [], "version": 0 } ] }

NOTE: The transactions field is only included when include_txs is set to true.

get_block_by_hash

Retrieve a block by its hash

Parameters

NameTypeRequiredNote
hashHashRequiredValid block Hash present in the chain
include_txsBooleanOptionalInclude txs serialized

Request

{ "jsonrpc": "2.0", "method": "get_block_by_hash", "id": 1, "params": { "hash": "0000000242978129bc2f36b732afe2dca0da717c43efa2442eb76bb765ddbccd", "include_txs": false } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "block_type": "Sync", "cumulative_difficulty": "13952430001", "difficulty": "1100460000", "extra_nonce": "21436825cfa7f4acb5be459e52fedd23523783f241f9744a3013b8fd178bf80a", "hash": "0000000242978129bc2f36b732afe2dca0da717c43efa2442eb76bb765ddbccd", "height": 69, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "nonce": 133614499, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 10279945002, "timestamp": 1711310140627, "tips": [ "00000003ca482c0b91e103c180f3ac675b4f4a1e061086d382ec8879b19f8d16" ], "topoheight": 70, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "txs_hashes": [], "version": 0 } }

NOTE: The transactions field is only included when include_txs is set to true.

get_top_block

Retrieve the highest block based on the topological height

Parameters

NameTypeRequiredNote
include_txsBooleanOptionalInclude txs serialized

Request

{ "jsonrpc": "2.0", "method": "get_top_block", "id": 1, "params": { "include_txs": false } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "block_type": "Normal", "cumulative_difficulty": "871369752120001", "difficulty": "55459980000", "extra_nonce": "7951ff513c29bbb55b305592b10bbe274627573d42fe08a7c3223c82b0f73323", "hash": "0000000001e99d90bea903ba618bb4f4d4a408a70ac4874bfcd1cb3a281199e9", "height": 21875, "miner": "xet:sj7cfaalq5l5qlvtwlf4zmgrzv3jje08dc6dpgc5zjk6djqqvyrsqly8rex", "nonce": 35440241, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 3209375196561, "timestamp": 1711663576873, "tips": [ "0000000001ef6ad0bcc58afd8ffdd458ce262132b88211dcc0b6fd0f8505b858" ], "topoheight": 22177, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "txs_hashes": [], "version": 0 } }

NOTE: The transactions field is only included when include_txs is set to true.

get_block_summary_at_topoheight

Retrieve a summarized version of a block at a specific topoheight, including transaction summaries.

Parameters

NameTypeRequiredNote
topoheightIntegerRequiredTopoheight of block to fetch

Request

{ "jsonrpc": "2.0", "method": "get_block_summary_at_topoheight", "id": 1, "params": { "topoheight": 22177 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "block_hash": "0000000001ef6ad0bcc58afd8ffdd458ce262132b88211dcc0b6fd0f8505b858", "height": 22177, "timestamp": 1711663576873, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "transactions": [], "block_type": "Normal", "difficulty": "79746345000", "cumulative_difficulty": "1234567890000", "topoheight": 22177, "reward": 137924147, "miner_reward": 124131733, "dev_reward": 13792414, "supply": 3209375196561, "total_fees": 0, "total_fees_burned": 0 } }

get_block_summary_by_hash

Retrieve a summarized version of a block by its hash, including transaction summaries.

Parameters

NameTypeRequiredNote
hashHashRequiredBlock hash to look up

Request

{ "jsonrpc": "2.0", "method": "get_block_summary_by_hash", "id": 1, "params": { "hash": "0000000001ef6ad0bcc58afd8ffdd458ce262132b88211dcc0b6fd0f8505b858" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "block_hash": "0000000001ef6ad0bcc58afd8ffdd458ce262132b88211dcc0b6fd0f8505b858", "height": 22177, "timestamp": 1711663576873, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "transactions": [], "block_type": "Normal", "difficulty": "79746345000", "cumulative_difficulty": "1234567890000", "topoheight": 22177, "reward": 137924147, "miner_reward": 124131733, "dev_reward": 13792414, "supply": 3209375196561, "total_fees": 0, "total_fees_burned": 0 } }

get_nonce

Retrieve the nonce for address in request params.

If no nonce is found for this address and its a valid one, it is safe to assume its nonce start at 0. Each nonce represents how many TX has been made by this address and prevent replay attacks.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_nonce", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "nonce": 1459, "previous_topoheight": 11269, "topoheight": 11982 } }

NOTE: topoheight is the last nonce topoheight (the last time account sent a transaction)

has_nonce

Verify if address has a nonce on-chain registered.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
topoheightIntegerOptionalnonce at specified topoheight

Request

{ "jsonrpc": "2.0", "id": 1, "method": "has_nonce", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "exist": true } }

get_nonce_at_topoheight

Get nonce from address at exact topoheight

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
topoheightIntegerRequiredTopoheight to retrieve a version (if exists) of balance

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_nonce_at_topoheight", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "topoheight": 11269 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "nonce": 1458, "previous_topoheight": 11266 } }

NOTE: topoheight field isn’t returned because you’re requesting an exact topoheight already, so you know it.

get_balance

Get up-to-date asset’s balance for a specific address

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
assetHashRequiredAsset ID registered on chain

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_balance", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "asset": "0000000000000000000000000000000000000000000000000000000000000000" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "topoheight": 21337, "version": { "balance_type": "input", "final_balance": { "commitment": [...], "handle": [...] }, "output_balance": null, "previous_topoheight": 11982 } } }

NOTE: balance_type values are: input, output or both. This determine what changes happened on the encrypted balance.

get_stable_balance

Same as get_balance, Get up-to-date asset’s balance for a specific address.

The only difference is its searching first for:

  • the latest balance with a output included (even in in unstable height)
  • If not found, the latest available balance in stable height.

This difference is made so that ZK Proofs are less likely to be invalidated. The reference (block hash, topoheight) is also included in the response.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
assetHashRequiredAsset ID registered on chain

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_stable_balance", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "asset": "0000000000000000000000000000000000000000000000000000000000000000" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "stable_topoheight": 21337, "stable_block_hash": "3a4584239039a9024e205c18a2f81b9f5d1eaa8a8e22a3e384aeada1124590f3", "topoheight": 21337, "version": { "balance_type": "input", "final_balance": { "commitment": [...], "handle": [...] }, "output_balance": null, "previous_topoheight": 11982 } } }

has_balance

Verify if address has a balance on-chain registered for requested asset.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
assetHashRequiredAsset ID registered on chain
topoheightIntegerOptionalnonce at specified topoheight

Request

{ "jsonrpc": "2.0", "id": 1, "method": "has_balance", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "asset": "0000000000000000000000000000000000000000000000000000000000000000" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "exist": true } }

NOTE: If you don’t precise the topoheight parameter, this will search if this account had already a balance at any moment of this asset.

get_balance_at_topoheight

Get encrypted asset’s balance from address at exact topoheight.

An error his returned if account has no asset’s balance at requested topoheight.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
assetHashRequiredAsset ID registered on chain
topoheightIntegerRequiredTopoheight to retrieve a version (if exists) of balance

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_balance_at_topoheight", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "asset": "0000000000000000000000000000000000000000000000000000000000000000", "topoheight": 60 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "balance_type": "input", "final_balance": { "commitment": [...], "handle": [...] }, "output_balance": null, "previous_topoheight": 59 } }

get_balances_at_maximum_topoheight

Retrieve balances for multiple assets at a maximum topoheight for an account. This returns the last version of each balance that is at or below the specified topoheight.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
assetsHash[]RequiredList of asset hashes to retrieve balances (max 64)
maximum_topoheightIntegerRequiredMaximum topoheight to search for balances

Request

{ "jsonrpc": "2.0", "method": "get_balances_at_maximum_topoheight", "id": 1, "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "assets": [ "0000000000000000000000000000000000000000000000000000000000000000" ], "maximum_topoheight": 22177 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "topoheight": 22100, "balance_type": "output", "final_balance": { "commitment": [...], "handle": [...] }, "output_balance": { "commitment": [...], "handle": [...] }, "previous_topoheight": 21500 } ] }

get_assets

Get all assets available on network with its registered topoheight and necessary decimals for a full coin.

Parameters

NameTypeRequiredNote
skipIntegerOptionalHow many assets to skip
maximumIntegerOptionalMaximum assets to fetch (limited to 64)
minimum_topoheightIntegerOptionalOnly include assets registered at or after this topoheight
maximum_topoheightIntegerOptionalOnly include assets registered at or before this topoheight

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_assets", "params": {} }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "decimals": 8, "max_supply": { "fixed": 1840000000000000 }, "name": "XELIS", "owner": "none", "ticker": "XEL", "topoheight": 0 } ] }

get_asset

Get registered topoheight and decimals data from a specific asset.

Parameters

NameTypeRequiredNote
assetHashRequiredAsset ID requested

Request

{ "jsonrpc": "2.0", "method": "get_asset", "id": 1, "params": { "asset": "0000000000000000000000000000000000000000000000000000000000000000" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "decimals": 8, "max_supply": { "fixed": 1840000000000000 }, "name": "XELIS", "owner": "none", "ticker": "XEL", "topoheight": 0 } }

get_asset_supply

Retrieve the current circulating supply for an asset.

Parameters

NameTypeRequiredNote
assetHashRequiredAsset hash to look up

Request

{ "jsonrpc": "2.0", "method": "get_asset_supply", "id": 1, "params": { "asset": "0000000000000000000000000000000000000000000000000000000000000000" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "topoheight": 22177, "data": 3209375196561, "previous_topoheight": 22176 } }

get_asset_supply_at_topoheight

Retrieve the circulating supply for an asset at a specific topoheight.

Parameters

NameTypeRequiredNote
assetHashRequiredAsset hash to look up
topoheightIntegerRequiredTopoheight to retrieve at

Request

{ "jsonrpc": "2.0", "method": "get_asset_supply_at_topoheight", "id": 1, "params": { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "topoheight": 22177 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "data": 3209375196561, "previous_topoheight": 22176 } }

count_assets

Counts the number of assets saved on disk

Parameters No parameters

Request

{ "jsonrpc": "2.0", "id": 1, "method": "count_assets" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 1 }

count_accounts

Counts the number of accounts saved on disk

Parameters No parameters

Request

{ "jsonrpc": "2.0", "id": 1, "method": "count_accounts" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 1271 }

count_transactions

Counts the number of transactions saved on disk

Parameters No parameters

Request

{ "jsonrpc": "2.0", "id": 1, "method": "count_transactions" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 44 }

count_contracts

Counts the number of contracts saved on disk

Parameters No parameters

Request

{ "jsonrpc": "2.0", "id": 1, "method": "count_contracts" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 17 }

get_tips

Retrieve Tips (highest blocks from blockDAG) from chain. This is the available blocks hashes to mine on to continue the chain and merge DAG branches in one chain.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_tips" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ "0000073b071e04ce4e79b095f3c44f4aefb65f4e70f8a5591c986cb4b688d692" ] }

p2p_status

Retrieve some informations about P2p

Parameters No parameters

Request

{ "jsonrpc": "2.0", "id": 1, "method": "p2p_status" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "best_topoheight": 23, "median_topoheight": 23, "max_peers": 32, "our_topoheight": 23, "peer_count": 1, "peer_id": 17384099500704996810, "tag": null } }

get_peers

Retrieve all peers connected

Parameters No parameters

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_peers" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "hidden_peers": 0, "peers": [ { "addr": "162.19.249.100:2125", "bytes_recv": 204800, "bytes_sent": 102400, "connected_on": 1711663198, "cumulative_difficulty": "874788276435001", "height": 21939, "id": 7089875151156203202, "last_ping": 1711664680, "local_port": 2125, "peers": { "255.255.255.255:2125": { "out": { "sent_at": 1746147705443 } }, "74.208.251.149:2125": { "both": { "received_at": 1745996467029, "sent_at": 1745953407894 } }, "74.208.251.149:2126": { "in": { "received_at": 1745996467029 } } }, "pruned_topoheight": null, "tag": null, "top_block_hash": "0000000007eeed3fecdaedff82ad867a224826230c12465cf39186471e2e360e", "topoheight": 22241, "version": "1.8.0-58bb439" }, { "addr": "74.208.251.149:2125", "bytes_recv": 81920, "bytes_sent": 40960, "connected_on": 1711663199, "cumulative_difficulty": "874788276435001", "height": 21939, "id": 2448648666414530279, "last_ping": 1711664682, "local_port": 2125, "peers": {}, "pruned_topoheight": null, "tag": null, "top_block_hash": "0000000007eeed3fecdaedff82ad867a224826230c12465cf39186471e2e360e", "topoheight": 22241, "version": "1.8.0-58bb439" } ], "total_peers": 4 } }

NOTE: Addresses displayed in this example are not real one and were replaced for privacy reasons.

get_p2p_block_propagation

Retrieve the P2P block propagation timing information, showing when each peer sent or received a specific block.

Parameters

NameTypeRequiredNote
hashHashRequiredBlock hash to retrieve propagation data for
outgoingBooleanOptionalInclude outgoing propagation data (default: true)
incomingBooleanOptionalInclude incoming propagation data (default: true)

Request

{ "jsonrpc": "2.0", "method": "get_p2p_block_propagation", "id": 1, "params": { "hash": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "peers": { "7542674138406502028": { "in": { "received_at": 1711663576873 } } }, "first_seen": 1711663576800, "processing_at": 1711663576850 } }

get_dag_order

Retrieve the whole DAG order (all blocks hash ordered by topoheight). If no parameters are set, it will retrieve the last 64 blocks hash ordered descending. Maximum of 64 blocks hashes only per request.

Parameters

NameTypeRequiredNote
start_topoheightIntegerOptionalIf not set, will retrieve last 64 blocks hash
end_topoheightIntegerOptionalMust be under current topoheight

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_dag_order", "params": { "start_topoheight": 0, "end_topoheight": 5 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ "b715cb0229d13f5f540ae48adf03bc31b094b040b0756a2454631b2ddd899c3a", "00000079f04345ac9e14116385dc845a77ad1d4f9f83d8b2b7a84ce3beaa4522", "000000c09b5ccd8749feb3d27fe72203ddca2f6f44998ab9db977d2724eaf032", "000000fca9a3e66a8f0cfba1138a740ed7ca74ee1b6c915c35717756baa80386", "0000007c0d5744a003f0dbc09c08429297f677e7ed49d02bc4455f0ecaf315a4", "00000063204b910d1cb486f1705efdaea8a42fbcaef8d3c308c1f3bd296601e9" ] }

submit_transaction

Submit a transaction in hex format to daemon mempool.

Parameters

NameTypeRequiredNote
dataStringRequiredTransaction in HEX format

Request

{ "jsonrpc": "2.0", "id": 0, "method": "submit_transaction", "params": { "data": "a15637c25cefd438998a2a043867ef8df905542078a8724ada1aabce003df3cc010100000000000000000000000000000000000000000000000000000000000000000000000000003a986c24cdc1c8ee8f028b8cafe7b79a66a0902f26d89dd54eeff80abcf251a9a3bd0000000000000003e80000000000000002d297ef720d388ff2aaedf6755a1f93b4ac1b55c987da5dc53c19350d8a779d970c7f4cfcc25d2f4ce3f4ef3a77d0f31d15635d221d5a72ef6651dbb7f1810301" } }

Response

{ "id": 0, "jsonrpc": "2.0", "result": true }

get_transaction

Fetch a transaction on disk and in mempool by its hash from daemon.

NOTE: result returned in data field can changes based on the Transaction Type (transfers, burn, Smart Contract call, Deploy Code..)

Parameters

NameTypeRequiredNote
hashHashRequiredTransaction hash to fetch

Request

{ "jsonrpc": "2.0", "method": "get_transaction", "id": 1, "params": { "hash": "dd693bad09cb03ba0bf9a6fa7b787f918748db869c1463b7fa16e20b498dea88" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "blocks": [ "000000000e4547de9f088734d54d0199605338896a58b7d2d7dea06c1ef35cfc" ], "data": { "transfers": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "commitment": [...], "ct_validity_proof": { "Y_0": [...], "Y_1": [...], "z_r": [...], "z_x": [...] }, "destination": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "extra_data": null, "receiver_handle": [...], "sender_handle": [...] } ] }, "executed_in_block": "000000000e4547de9f088734d54d0199605338896a58b7d2d7dea06c1ef35cfc", "fee": 25000, "fee_limit": 30000, "fee_paid": 25400, "fee_refund": 4600, "hash": "dd693bad09cb03ba0bf9a6fa7b787f918748db869c1463b7fa16e20b498dea88", "in_mempool": false, "first_seen": null, "multisig": null, "nonce": 4, "range_proof": [...], "reference": { "hash": "0000000007068e3656a526e04280b0f975bf9d9d1e156ea0677970abe6cceafa", "topoheight": 10656 }, "signature": "37a6b9bf89e524a7481b6427c2d5d026a212b230410cedbe46fedb615edbb107288663e24567485d4802659f0f03ca5e6b27e7ea35541d07b2c71ed2ad94f300", "size": 1517, "source": "xet:dn3x9yspqtuzhm874m267a3g9fkdztr3uztyx534wdx3p9rkdspqqhpss5d", "source_commitments": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "commitment": [...], "proof": { "Y_0": [...], "Y_1": [...], "Y_2": [...], "z_r": [...], "z_s": [...], "z_x": [...] } } ], "version": 0 } }

get_mempool

Fetch transactions presents in the mempool

Parameters

NameTypeRequiredNote
skipIntegerOptionalHow many TXs to skip
maximumIntegerOptionalMaximum TXs to fetch (limited to 20)

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_mempool" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "transactions": [ { "blocks": null, "data": { "transfers": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "commitment": [...], "ct_validity_proof": { "Y_0": [...], "Y_1": [...], "z_r": [...], "z_x": [...] }, "destination": "xet:q622pz5exf5hmw98d73dlqhwjvfwd5g9k0tpuay90ga634c64cgsqczfmvx", "extra_data": null, "receiver_handle": [...], "sender_handle": [...] } ] }, "executed_in_block": null, "fee": 25000, "fee_limit": 30000, "first_seen": 1711665284, "hash": "5c0c4a0d58cf678015af2e10f79119ed6d969dd3d1e98ca4ffefbb4439765658", "in_mempool": true, "multisig": null, "nonce": 1461, "range_proof": [...], "reference": { "hash": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8", "topoheight": 22285 }, "size": 1517, "signature": "b3362192f0ae054964279fc67e55f3dc2cde9c6d6d0c98b00a1c31672d6a330aa1cdad4929662d68fa0a830349da429eef342fef43125b97fea87c16fa2f6607", "source": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "source_commitments": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "commitment": [...], "proof": { "Y_0": [...], "Y_1": [...], "Y_2": [...], "z_r": [...], "z_s": [...], "z_x": [...] } } ], "version": 0 } ], "total": 1 } }

get_mempool_summary

Fetch transactions summary presents in the mempool

Parameters

NameTypeRequiredNote
skipIntegerOptionalHow many TXs to skip
maximumIntegerOptionalMaximum TXs to fetch (limited to 1024)

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_mempool_summary" }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "transactions": [ { "fee": 25000, "fee_per_kb": 16479, "first_seen": 1711665284, "hash": "5c0c4a0d58cf678015af2e10f79119ed6d969dd3d1e98ca4ffefbb4439765658", "source": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "size": 1517 } ], "total": 1 } }

get_transaction_executor

Fetch the block hash where the transaction was executed and its topoheight.

Parameters

NameTypeRequiredNote
hashHashRequiredTransaction hash to fetch

Request

{ "jsonrpc": "2.0", "method": "get_transaction_executor", "id": 1, "params": { "hash": "dd693bad09cb03ba0bf9a6fa7b787f918748db869c1463b7fa16e20b498dea88" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "block_topoheight": 22285, "block_hash": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8", "block_timestamp": 1711665284000 } }

get_transactions

Fetch transactions by theirs hashes from database and mempool of daemon and keep the same order in response If a transaction is not found, its position in the result array will be null.

Parameters

NameTypeRequiredNote
tx_hashesHash[]RequiredTransaction hashes to fetch (max 20)

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_transactions", "params": { "tx_hashes": [ "5c0c4a0d58cf678015af2e10f79119ed6d969dd3d1e98ca4ffefbb4439765658" ] } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "blocks": [ "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8" ], "data": { "transfers": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "commitment": [...], "ct_validity_proof": { "Y_0": [...], "Y_1": [...], "z_r": [...], "z_x": [...] }, "destination": "xet:q622pz5exf5hmw98d73dlqhwjvfwd5g9k0tpuay90ga634c64cgsqczfmvx", "extra_data": null, "receiver_handle": [...], "sender_handle": [...] } ] }, "executed_in_block": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8", "fee": 25000, "fee_limit": 30000, "fee_paid": 25400, "fee_refund": 4600, "hash": "cb26c0a203cd75206ebd122213e442ffabf5dc21286fbe92e46c864ba723dcdd", "in_mempool": false, "first_seen": null, "multisig": null, "nonce": 1460, "range_proof": [...], "reference": { "hash": "00000000040f90c8bcbb33bc832c1cd9f0683204af1c099a0af52c7a247840f5", "topoheight": 22284 }, "signature": "afe694d96aa7a4ea44e57e7f7090a19a84105fc49df40c35cb5c1bfe4a949303d8b918e2ccbc38c8058449edcb334883471265743c99be39180a574d2adbfd05", "size": 1517, "source": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "source_commitments": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "commitment": [...], "proof": { "Y_0": [...], "Y_1": [...], "Y_2": [...], "z_r": [...], "z_s": [...], "z_x": [...] } } ], "version": 0 } ] }

get_transactions_summary

Fetch a summarized version of transactions by their hashes. Returns source, fee, size and hash for each transaction. If a transaction is not found, its position in the result array will be null.

Parameters

NameTypeRequiredNote
tx_hashesHash[]RequiredTransaction hashes to fetch (max 64)

Request

{ "jsonrpc": "2.0", "method": "get_transactions_summary", "id": 1, "params": { "tx_hashes": [ "dd693bad09cb03ba0bf9a6fa7b787f918748db869c1463b7fa16e20b498dea88" ] } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "hash": "dd693bad09cb03ba0bf9a6fa7b787f918748db869c1463b7fa16e20b498dea88", "source": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "fee": 25000, "size": 1517 } ] }

get_account_history

Fetch up to 20 history events for an account on a specific asset.

NOTE: If no asset is provided, default is set to XELIS.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
assetHashOptionalAsset to track
minimum_topoheightIntegerOptionalminimum topoheight for history
maximum_topoheightIntegerOptionalMaximum topoheight for history
outgoing_flowBooleanOptionalSet to true by default, filter outgoing transactions
incoming_flowBooleanOptionalSet to true by default, filter incoming transactions / coinbase

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_account_history", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "asset": "0000000000000000000000000000000000000000000000000000000000000000" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "block_timestamp": 1711665303229, "hash": "5c0c4a0d58cf678015af2e10f79119ed6d969dd3d1e98ca4ffefbb4439765658", "outgoing": { "to": "xet:q622pz5exf5hmw98d73dlqhwjvfwd5g9k0tpuay90ga634c64cgsqczfmvx" }, "topoheight": 22286 }, { "block_timestamp": 1711487499112, "hash": "0000000001088c329a08fce87b8ce49734d1508d91708aa4234ba1548190c75b", "mining": { "reward": 131491368 }, "topoheight": 11203 }, { "block_timestamp": 1711478790950, "hash": "1a16381b252405636b72756a5b4c664a043a8a7ed659f5724085286250fd1f07", "outgoing": { "to": "xet:t23w8pp90zsj04sp5r3r9sjpz3vq7rxcwhydf5ztlk6efhnusersqvf8sny" }, "topoheight": 10659 } ] }

get_account_assets

Retrieve all assets for an account

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
skipIntegerOptionalHow many assets to skip
maximumIntegerOptionalMaximum assets to fetch (limited to 64)

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_account_assets", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ "0000000000000000000000000000000000000000000000000000000000000000" ] }

get_accounts

Retrieve a list of available accounts (each account returned had at least one interaction on-chain) The topoheight range in parameters search for all accounts having a on-chain interaction in this inclusive range.

Parameters

NameTypeRequiredNote
skipIntegerOptionalHow many accounts to skip
maximumIntegerOptionalMaximum accounts to fetch (limited to 100)
minimum_topoheightIntegerOptionalMinimum topoheight for first on-chain interaction
maximum_topoheightIntegerOptionalMaximum topoheight for first on-chain interaction

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_accounts", "params": {} }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ "xet:qze954a6tjc2d36zdjuapgu75hpckvtlmfxsymevmqn9ewvpkfasqkrzdql", "xet:qf5u2p46jpgqmypqc2xwtq25yek2t7qhnqtdhw5kpfwcrlavs5asq0r83r7", "xet:qn7qwdmweculrklzh94p6wvss2yj46vrgmlh8y6fh7rue2fmn9usqr3dq78", "xet:q622pz5exf5hmw98d73dlqhwjvfwd5g9k0tpuay90ga634c64cgsqczfmvx", "xet:pquh4gagcfmjg42jvx0ywc6a3ph03n6zxynaak9gdv5eh0zdysrqq5mrlz3", "xet:pg6nn3q3fqqaw0h7p689ul4a0tz9z76kkj6ys2umexs08flsrvmsqg4eea0", "xet:zpt4h6tcqhrdatkyvwmcffmjrqwq00ryy62tzgu7ra5uvhqx0ckqq537j52", "xet:z63vuknmvtq2yqj320dgc3vzsvszyxmd2w5j06k539snv9pxlcsqqkkusu9", "xet:rqp2gplxyy9duud0jh7kz7kamcujfrcdmqtpgu2tx46fk7yzwa4qqdrgpmn", "xet:rr3s2erc8ta6qg29m8ujksxdw26053wev8ja8kaxc62yc0yuceqqqqedmvd", "xet:rt7260ltjnnqw9qfpgcackrhwkaeyc8hhtp8vls6ws99g5lq44xsqrjs9r9", "xet:rjq4yt20zwcq3tyc7z4kjdp9e2h7q5f29wjht7vht575jtlkkq6qqhlx97s", "xet:r6zyz66ppefhxy3mmhvlyeplmp734zpltl270egxd04u02pe2fdsqzmts74", "xet:ypyeqzf6wyedmjeqrkplpwqkz0yp3rj4nnepmpvqvjj7gv4ae54qqzfaw3n", "xet:yp8rlns8ufqd2ktfs86e0h93e92vy5u8pd9m8652n4fppdtjwsaqquzug5z", "xet:xc73lapnp2qar6u804f5px756k9xayfssvrr24k9g7d9vxhx650qqg0euc0", "xet:xc7ux9465mxjffuafv2t9lpt5nhquvfsqk7fmaa983vppz3dygmsqql9pts", "xet:8jj5v2xqje9r4lmn0xjak7khfx0qr6x5fp629mqszre609m2r9fsqzxm6kq", "xet:gpxqv0gs89tmdz8ggv6anhlx94ed6lwmwedl0j4ukepxpwu7sgjqqmvvyn9", "xet:g6520vnznu6t6zt8fu85srm7upnlp7tpd5u5tu0urdptmldnwvcqqd539vl" ] }

is_account_registered

Verify if the account on chain is registered. This is useful to determine if we should pay additionnal fee or not.

For transactions, it is recommended to verify that the account is already registered in stable height.

Parameters

NameTypeRequiredNote
addressAddressRequiredAccount address to search for
in_stable_heightBooleanRequiredIf registration must be done only in stable height or not

Request

{ "jsonrpc": "2.0", "method": "is_account_registered", "id": 1, "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "in_stable_height": true } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": true }

get_account_registration_topoheight

Retrieve the account registration topoheight.

This is like its “first time” doing an action on the chain.

Parameters

NameTypeRequiredNote
addressAddressRequiredAccount address to search for

Request

{ "jsonrpc": "2.0", "method": "get_account_registration_topoheight", "id": 1, "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": 57 }

get_blocks_range_by_topoheight

Retrieve a specific range of blocks (up to 20 maximum) based on topoheight.

NOTE: Bounds are inclusive.

Parameters

NameTypeRequiredNote
start_topoheightIntegerOptionalIf not set, will retrieve last 20 blocks
end_topoheightIntegerOptionalMust be under current topoheight

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_blocks_range_by_topoheight", "params": { "start_topoheight": 0, "end_topoheight": 2 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "block_type": "Sync", "cumulative_difficulty": "1", "difficulty": "1", "extra_nonce": "0000000000000000000000000000000000000000000000000000000000000000", "hash": "b715cb0229d13f5f540ae48adf03bc31b094b040b0756a2454631b2ddd899c3a", "height": 0, "miner": "xet:3tr88r8vvx3qxvgr7gdja5kae784v8htc7ayaj4nxlzgflhchlmqqdmycjf", "nonce": 0, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 146230061, "timestamp": 1708339574098, "tips": [], "topoheight": 0, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 92, "txs_hashes": [], "version": 0 }, { "block_type": "Sync", "cumulative_difficulty": "15000001", "difficulty": "15000000", "extra_nonce": "fa001f6340fbe79e4263ef60610d4f4ce82e69771805772e69735ea9c1df2300", "hash": "00000079f04345ac9e14116385dc845a77ad1d4f9f83d8b2b7a84ce3beaa4522", "height": 1, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "nonce": 2969302, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 292460111, "timestamp": 1711135309926, "tips": [ "b715cb0229d13f5f540ae48adf03bc31b094b040b0756a2454631b2ddd899c3a" ], "topoheight": 1, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "txs_hashes": [], "version": 0 }, { "block_type": "Sync", "cumulative_difficulty": "30000001", "difficulty": "15000000", "extra_nonce": "aa5c6ccea415e2c39704dedc582ac6ca6a1701a549f5199dffd37e30f93d5900", "hash": "000000c09b5ccd8749feb3d27fe72203ddca2f6f44998ab9db977d2724eaf032", "height": 2, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "nonce": 12047121, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 438690149, "timestamp": 1711135311567, "tips": [ "00000079f04345ac9e14116385dc845a77ad1d4f9f83d8b2b7a84ce3beaa4522" ], "topoheight": 2, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "txs_hashes": [], "version": 0 } ] }

get_blocks_range_by_height

Retrieve a specific range of blocks (up to 20 maximum) based on height.

NOTE: Bounds are inclusive.

Parameters

NameTypeRequiredNote
start_heightIntegerOptionalIf not set, will retrieve last 20 blocks
end_heightIntegerOptionalMust be under current height

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_blocks_range_by_height", "params": { "start_height": 0, "end_height": 2 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "block_type": "Sync", "cumulative_difficulty": "1", "difficulty": "1", "extra_nonce": "0000000000000000000000000000000000000000000000000000000000000000", "hash": "b715cb0229d13f5f540ae48adf03bc31b094b040b0756a2454631b2ddd899c3a", "height": 0, "miner": "xet:3tr88r8vvx3qxvgr7gdja5kae784v8htc7ayaj4nxlzgflhchlmqqdmycjf", "nonce": 0, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 146230061, "timestamp": 1708339574098, "tips": [], "topoheight": 0, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 92, "txs_hashes": [], "version": 0 }, { "block_type": "Sync", "cumulative_difficulty": "15000001", "difficulty": "15000000", "extra_nonce": "fa001f6340fbe79e4263ef60610d4f4ce82e69771805772e69735ea9c1df2300", "hash": "00000079f04345ac9e14116385dc845a77ad1d4f9f83d8b2b7a84ce3beaa4522", "height": 1, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "nonce": 2969302, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 292460111, "timestamp": 1711135309926, "tips": [ "b715cb0229d13f5f540ae48adf03bc31b094b040b0756a2454631b2ddd899c3a" ], "topoheight": 1, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "txs_hashes": [], "version": 0 }, { "block_type": "Sync", "cumulative_difficulty": "30000001", "difficulty": "15000000", "extra_nonce": "aa5c6ccea415e2c39704dedc582ac6ca6a1701a549f5199dffd37e30f93d5900", "hash": "000000c09b5ccd8749feb3d27fe72203ddca2f6f44998ab9db977d2724eaf032", "height": 2, "miner": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "nonce": 12047121, "reward": 146229454, "miner_reward": 131606509, "dev_reward": 14622945, "supply": 438690149, "timestamp": 1711135311567, "tips": [ "00000079f04345ac9e14116385dc845a77ad1d4f9f83d8b2b7a84ce3beaa4522" ], "topoheight": 2, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "txs_hashes": [], "version": 0 } ] }

is_tx_executed_in_block

Verify if a transaction hash is executed in requested block hash.

Parameters

NameTypeRequiredNote
tx_hashHashRequiredTransaction hash to verify
block_hashHashRequiredExpected Block hash

Request

{ "jsonrpc": "2.0", "method": "is_tx_executed_in_block", "id": 1, "params": { "tx_hash": "dd693bad09cb03ba0bf9a6fa7b787f918748db869c1463b7fa16e20b498dea88", "block_hash": "000000000e4547de9f088734d54d0199605338896a58b7d2d7dea06c1ef35cfc" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": true }

get_mempool_cache

Retrieve the stored mempool cache for a requested address.

This includes nonce range (min/max) used, final output balances expected per asset used, and all transactions hashes related to this account.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_mempool_cache", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "balances": { "0000000000000000000000000000000000000000000000000000000000000000": { "commitment": [...], "handle": [...] } }, "max": 2829, "min": 2825, "txs": [ "78148376846b2a8ce1f3b248a65bd5ed4e22ebb6ac98514377a4ea47d08cb2a8", "d8b1d090eea0812e99c1384137240773079dcd79a4fbfe4d78d395288ff1823a", "c82cba8d5472dc2c1d6d38dd30ee3726d32638001e0c54903905c4f0c814ae6a", "2f4bf1ea35fc8ef33961a465ac0cf0dc2c6010daaee423ed06ffdcdf2b9c0d6d", "f1c8425a7f3bea049dbdcaf905ef447d43ca41763740b54d2958baac15d0d3ae" ] } }

get_estimated_fee_rates

Retrieve estimated fee rates for low, medium, and high priority transactions based on current mempool state.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_estimated_fee_rates", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "low": 10000, "medium": 25000, "high": 50000, "default": 10000 } }

get_estimated_fee_per_kb

Retrieve the current base fee per KB and the predicted fee per KB.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "get_estimated_fee_per_kb", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "fee_per_kb": 10000, "predicated_fee_per_kb": 10000 } }

get_multisig

Retrieve the latest multisig information for a specific address.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_multisig", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "state": { "active": { "participants": ["xet:yfxcjh7aua5lmpvmyh4fmhrjzlg9xx9p6uvel0248hxc42yja9usq27dz7s"], "threshold": 1 } }, "topoheight": 57 } }

get_multisig_at_topoheight

Retrieve the multisig information at a specific topoheight.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
topoheightIntegerRequiredTopoheight to retrieve the state

Request

{ "jsonrpc": "2.0", "id": 1, "method": "get_multisig_at_topoheight", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "topoheight": 57 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "state": { "active": { "participants": ["xet:yfxcjh7aua5lmpvmyh4fmhrjzlg9xx9p6uvel0248hxc42yja9usq27dz7s"], "threshold": 1 } } } }

NOTE: If the address has disabled its multisig setup, state will be "deleted" instead.

has_multisig

Verify if the address has a multisig setup.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain

Request

{ "jsonrpc": "2.0", "id": 1, "method": "has_multisig", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": true }

NOTE:

  • If the address has a deleted multisig state, it will returns false.

has_multisig_at_topoheight

Verify if the address has a multisig setup at a specific topoheight.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
topoheightIntegerRequiredTopoheight to retrieve the state

Request

{ "jsonrpc": "2.0", "id": 1, "method": "has_multisig_at_topoheight", "params": { "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk", "topoheight": 57 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": true }

NOTE:

  • If the address has a deleted multisig state, it will returns false.
  • If a version is not found at requested topoheight, an error will be returned.

decrypt_extra_data

Decrypt the extra data from a transaction.

Parameters

NameTypeRequiredNote
shared_keyHexadecimalRequiredShared Key in hexadecimal format used for decryption
extra_dataByte ArrayRequiredByte array containing the encrypted extra data

Request

{ "jsonrpc": "2.0", "method": "decrypt_extra_data", "id": 1, "params": { "shared_key": "<hexadecimal shared key>", "extra_data": [ ... ] } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "hello": "world!" } }

get_contracts_outputs

Retrieve contract transfers made to an address at a specific topoheight.

Parameters

NameTypeRequiredNote
addressAddressRequiredAddress receiving contract transfers
topoheightIntegerRequiredTopoheight to inspect

Request

{ "jsonrpc": "2.0", "method": "get_contracts_outputs", "id": 1, "params": { "address": "xel:qcd39a5u8cscztamjuyr7hdj6hh2wh9nrmhp86ljx2sz6t99ndjqqm7wxj8", "topoheight": 642000 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "executions": [ { "key": { "contract": "d4f7e8c3b2a1e6f5c4b3a2d1e0f9f8e7d6c5b4a3a2b1c0d9e8f7e6d5c4b3a2b1", "caller": "4951a4d10b8921c8e08d3c380993305a1e4706cbba606e2e79ffdfc06c54eb5f" }, "value": { "transfers": { "0000000000000000000000000000000000000000000000000000000000000000": 1000 } } } ] } }

get_contract_transactions

Retrieve all transaction hashes that have interacted with the requested contract.

Parameters

NameTypeRequiredNote
contractHashRequiredContract hash for lookup
skipIntegerOptionalNumber of hashes to skip
maximumIntegerOptionalMaximum number of hashes to return (max 20)

Request

{ "jsonrpc": "2.0", "method": "get_contract_transactions", "id": 1, "params": { "contract": "740e2f94ba264464551787ddd6fa5e3222da464c6c659848f6e9a9d0730ac288" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ "a7e35dfcbc333772e7bb47ad3d86a981d485950e2e5b76d3fcdeeba2742c9593" ] }

get_contract_data

Retrieve the contract data with the requested key.

Parameters

NameTypeRequiredNote
contractHashRequiredContract hash to search for the key
keyValueCellRequiredValueCell representing the key

Request

{ "jsonrpc": "2.0", "method": "get_contract_data", "id": 1, "params": { "contract": "b756566452b2c7bfea785f1b87b90d7bf075cb45a0dc33fb524e5e25f7e85fb4", "key": { "type": "default", "value": { "type": "string", "value": "my beautiful key" } } } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "topoheight": 70, "data": { "type": "default", "value": { "type": "string", "value": "my beautiful value" } }, "previous_topoheight": 68 } }

get_contract_data_at_topoheight

Retrieve the contract data with the requested key at a specific topoheight.

Parameters

NameTypeRequiredNote
contractHashRequiredContract hash to search for the key
keyValueCellRequiredValueCell representing the key
topoheightIntegerRequiredTopoheight to retrieve the data

Request

{ "jsonrpc": "2.0", "method": "get_contract_data_at_topoheight", "id": 1, "params": { "contract": "b756566452b2c7bfea785f1b87b90d7bf075cb45a0dc33fb524e5e25f7e85fb4", "topoheight": 70, "key": { "type": "default", "value": { "type": "string", "value": "my beautiful key" } } } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "data": { "type": "default", "value": { "type": "string", "value": "my beautiful value" } }, "previous_topoheight": 68 } }

get_contract_balance

Retrieve the contract balance

Parameters

NameTypeRequiredNote
contractHashRequiredContract hash to search for the balance
assetHashRequiredThe asset ID to determine which balance to fetch

Request

{ "jsonrpc": "2.0", "method": "get_contract_balance", "id": 1, "params": { "contract": "b756566452b2c7bfea785f1b87b90d7bf075cb45a0dc33fb524e5e25f7e85fb4", "asset": "0000000000000000000000000000000000000000000000000000000000000000" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "topoheight": 70, "data": 99900000, "previous_topoheight": null } }

get_contract_balance_at_topoheight

Retrieve the contract balance at a specific topoheight.

Parameters

NameTypeRequiredNote
contractHashRequiredContract hash to search for the balance
assetHashRequiredThe asset ID to determine which balance to fetch
topoheightIntegerRequiredTopoheight to retrieve the data

Request

{ "jsonrpc": "2.0", "method": "get_contract_balance_at_topoheight", "id": 1, "params": { "contract": "b756566452b2c7bfea785f1b87b90d7bf075cb45a0dc33fb524e5e25f7e85fb4", "asset": "0000000000000000000000000000000000000000000000000000000000000000", "topoheight": 70 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "data": 99900000, "previous_topoheight": null } }

get_contract_logs

Retrieve all contract logs for a specific caller (transaction hash).

Logs include information about entry exit codes, typed exit values, raised execution errors, gas refunds, transfers, asset minting/burning, scheduled executions, events, and more.

An entry without an explicit return type records a u64 exit code: 0 means success, while any value greater than 0 is a contract-defined error code. An entry with an explicit return type records its encoded return data as an exit_value, up to 256 bytes. If execution raises an error, for example because require(...) failed, the error is recorded in the logs.

Parameters

NameTypeRequiredNote
callerHashRequiredTransaction hash that called the contract

Request

{ "jsonrpc": "2.0", "method": "get_contract_logs", "id": 1, "params": { "caller": "8a354baac1d53d02249aadee92c5a3e0585b126439947cb4a3c3aa9baaea5f17" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "type": "exit_code", "value": 0 }, { "type": "refund_gas", "value": { "amount": 99593 } } ] }

get_contract_scheduled_executions_at_topoheight

Retrieve the scheduled contract executions at a specific topoheight.

Parameters

NameTypeRequiredNote
topoheightIntegerRequiredTopoheight to retrieve scheduled executions
maxIntegerOptionalMaximum number of results to return (max 64)
skipIntegerOptionalNumber of results to skip

Request

{ "jsonrpc": "2.0", "method": "get_contract_scheduled_executions_at_topoheight", "id": 1, "params": { "topoheight": 22177 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [] }

get_contract_registered_executions_at_topoheight

Retrieve the registered scheduled contract executions at a specific topoheight.

Parameters

NameTypeRequiredNote
topoheightIntegerRequiredTopoheight to retrieve registered executions
maxIntegerOptionalMaximum number of results to return (max 64)
skipIntegerOptionalNumber of results to skip

Request

{ "jsonrpc": "2.0", "method": "get_contract_registered_executions_at_topoheight", "id": 1, "params": { "topoheight": 22177 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "execution_hash": "740e2f94ba264464551787ddd6fa5e3222da464c6c659848f6e9a9d0730ac288", "execution_topoheight": 22200 } ] }

get_contract_module

Retrieve the contract module (compiled code) for a specific contract.

Parameters

NameTypeRequiredNote
contractHashRequiredContract hash to fetch

Request

{ "jsonrpc": "2.0", "method": "get_contract_module", "id": 1, "params": { "contract": "740e2f94ba264464551787ddd6fa5e3222da464c6c659848f6e9a9d0730ac288" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "topoheight": 70, "data": "...", "previous_topoheight": null } }

get_contract_assets

Retrieve all asset hashes that a contract has balances for.

Parameters

NameTypeRequiredNote
contractHashRequiredContract hash to fetch assets for
skipIntegerOptionalNumber of assets to skip
maximumIntegerOptionalMaximum number of assets to return (max 64)

Request

{ "jsonrpc": "2.0", "method": "get_contract_assets", "id": 1, "params": { "contract": "740e2f94ba264464551787ddd6fa5e3222da464c6c659848f6e9a9d0730ac288" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ "0000000000000000000000000000000000000000000000000000000000000000" ] }

get_contracts

Retrieve all deployed contract hashes with optional pagination and topoheight filtering.

Parameters

NameTypeRequiredNote
skipIntegerOptionalNumber of contracts to skip
maximumIntegerOptionalMaximum number of contracts to return
minimum_topoheightIntegerOptionalOnly include contracts deployed at or after this
maximum_topoheightIntegerOptionalOnly include contracts deployed at or before this

Request

{ "jsonrpc": "2.0", "method": "get_contracts", "id": 1, "params": {} }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ "740e2f94ba264464551787ddd6fa5e3222da464c6c659848f6e9a9d0730ac288" ] }

get_contract_data_entries

Retrieve multiple data entries from a contract’s storage with optional pagination and topoheight filtering.

Parameters

NameTypeRequiredNote
contractHashRequiredContract hash to fetch data entries for
minimum_topoheightIntegerOptionalOnly include entries modified at or after this
maximum_topoheightIntegerOptionalOnly include entries modified at or before this
skipIntegerOptionalNumber of entries to skip
maximumIntegerOptionalMaximum number of entries to return (max 20)

Request

{ "jsonrpc": "2.0", "method": "get_contract_data_entries", "id": 1, "params": { "contract": "740e2f94ba264464551787ddd6fa5e3222da464c6c659848f6e9a9d0730ac288" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": [ { "key": { "type": "default", "value": { "type": "string", "value": "my beautiful key" } }, "value": { "type": "default", "value": { "type": "string", "value": "my beautiful value" } } } ] }

simulate_contract_invoke

Simulate a contract invocation without writing chain state.

This method is only registered when the daemon is started with --rpc-allow-contract-vm-executions.

The simulation result includes the same exit information a real execution would write to contract logs. Entries without an explicit return type report a u64 exit code, while entries with an explicit return type report an encoded exit_value of up to 256 bytes. Raised errors, including failed require(...) checks, are returned as execution errors.

Parameters

NameTypeRequiredNote
sourceAddressRequiredCaller address used for simulation
contractHashRequiredContract hash to invoke
depositsDepositsRequiredAssets deposited with the simulated call
entry_idIntegerRequiredContract entry id to call
parametersValueCell[]RequiredParameters passed to the contract
permissionInterContractPermissionOptionalInter-contract permission, defaults to none

Request

{ "jsonrpc": "2.0", "method": "simulate_contract_invoke", "id": 1, "params": { "source": "xel:qcd39a5u8cscztamjuyr7hdj6hh2wh9nrmhp86ljx2sz6t99ndjqqm7wxj8", "contract": "740e2f94ba264464551787ddd6fa5e3222da464c6c659848f6e9a9d0730ac288", "deposits": {}, "entry_id": 0, "parameters": [], "permission": "none" } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "base_fee": 25000, "result": { "used_gas": 1200, "burned_gas": 600, "fee_gas": 600, "vm_max_gas": 1200, "exit_value": { "type": "ExitCode", "value": 0 } }, "block_hash": "1914802b64b28386adc37927081beb6ac4677b6f85ee2149f7a143339c99d309", "topoheight": 761761 } }

Wallet

Events

This require to use the WebSocket connection.

All events sent by the wallet to be notified in real-time through the WebSocket.

Every events are registered using the following RPC request (example for new_topo_height event)

{ "jsonrpc": "2.0", "method": "subscribe", "id": 1, "params": { "notify": "new_topo_height" } }

This returns the following response:

{ "id": 1, "jsonrpc": "2.0", "result": true }

If its true, that means the wallet accepted the subscription to the requested event. If its returning false, that may means you are already subscribed to this event.

To unsubscribe from an event, replace the method name subscribe by unsubscribe.

NOTE: The field id used during the request subscribe of the event is reused for each event fired by the wallet. This is useful to determine which kind of event it is. You must set a unique id value to each event.

(Private) Methods

These methods must be enabled by starting the daemon with --rpc-allow-private-methods flag.

rewind_chain

Rewind the chain by a specific count of blocks.

Parameters

NameTypeRequiredNote
countIntegerRequiredCount of blocks to pop
until_stable_heightBooleanOptionalRewind max to stable height if possible. Default false

Request

{ "jsonrpc": "2.0", "id": 1, "method": "rewind_chain", "params": { "count": 10, "until_stable_height": false } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "topoheight": 18, "txs": ["011a3af694cf821e39e694baf533f4cb323785519a593e952a3e43e59250d4ea"] } }

clear_caches

Clear the current caches used by the daemon.

Parameters No parameters

Request

{ "jsonrpc": "2.0", "method": "clear_caches", "id": 1 }

Response

{ "id": 1, "jsonrpc": "2.0", "result": null }

prune_chain

Prune the chain up to a specific topoheight. This reduces disk usage by removing old block data.

Parameters

NameTypeRequiredNote
topoheightIntegerRequiredTopoheight until which to prune

Request

{ "jsonrpc": "2.0", "method": "prune_chain", "id": 1, "params": { "topoheight": 1000 } }

Response

{ "id": 1, "jsonrpc": "2.0", "result": { "pruned_topoheight": 1000 } }

JSON-RPC methods

Events

Events are only available through Websocket protocol.
Before listening to an event you must subscribe with an available method.

For example:

const ws = new WebSocket('wss://node.xelis.io/json_rpc') const message = { id: 1, jsonrpc: '2.0', method: 'subscribe', params: { notify: 'new_block' } } ws.onmessage = (message) => { console.log(message.data) } ws.send(JSON.stringify(message))

new_block

When a new block has been accepted and included in the chain by the daemon.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "block_type": "Normal", "cumulative_difficulty": "9909351292695001", "difficulty": "85713090000", "event": "new_block", "extra_nonce": "cb4a04b8cd2913f0947c323c8a2fe4d3623047f1e8a9f4e5f717aaf6ec5da70e", "hash": "0000000008ef82aeb890b919803e19985c430311ddd34aa9b0cb2d40a6dffb87", "height": 106173, "miner": "xet:4fcjmjxs6dyq7d3xl95m26wzfwrluz2tcqdtfp6fpc7rah2kmqusqdr3c66", "nonce": 121282154, "reward": 144997766, "supply": 15506012755620, "timestamp": 1713028338116, "tips": [ "0000000000beaccfbb05ffc3b33536daffa85a90cbbf4761287376a65dcac859" ], "topoheight": 107219, "total_fees": 0, "total_fees_burned": 0, "total_size_in_bytes": 124, "transactions": [], "txs_hashes": [], "version": 0 } }

new_block_template

When a new mining block template is available.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": "new_block_template", "template": "...", "algorithm": "xel/v2", "height": 106174, "topoheight": 107220, "difficulty": "85713090000" } }

new_topo_height

When a new topoheight has been detected by the daemon.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "new_topoheight": 107219 } }

block_ordered

When a block has been ordered and executed by the DAG order.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "block_hash": "e42555732f8ca3a55bf97cbb8d63c73c0e8db8b376f60f4794871d468ffe83fc", "block_type": "Normal", "event": "block_ordered", "topoheight": 641917 } }

block_orphaned

When a block was previously executed in the DAG but due to DAG reorg, got rewinded.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "block_hash": "e42555732f8ca3a55bf97cbb8d63c73c0e8db8b376f60f4794871d468ffe83fc", "event": "block_orphaned", "old_topoheight": 641917 } }

stable_height_changed

When the DAG found a new stable height. This means no new blocks can be added at this height or below.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": "stable_height_changed", "new_stable_height": 611815, "previous_stable_height": 611814 } }

stable_topoheight_changed

When the DAG found a new stable topoheight.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": "stable_topoheight_changed", "new_stable_topoheight": 611815, "previous_stable_topoheight": 611814 } }

transaction_orphaned

When a transaction that was previously executed in the DAG but due to DAG reorg, got rewinded. If transaction couldn’t be added back to the mempool, it is orphaned.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "blocks": null, "data": { "transfers": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "commitment": [...], "ct_validity_proof": { "Y_0": [...], "Y_1": [...], "z_r": [...], "z_x": [...] }, "destination": "xel:qcd39a5u8cscztamjuyr7hdj6hh2wh9nrmhp86ljx2sz6t99ndjqqm7wxj8", "extra_data": [...], "receiver_handle": [...], "sender_handle": [...] } ] }, "event": "transaction_orphaned", "executed_in_block": null, "fee": 25000, "fee_limit": 30000, "first_seen": null, "hash": "4951a4d10b8921c8e08d3c380993305a1e4706cbba606e2e79ffdfc06c54eb5f", "in_mempool": false, "multisig": null, "nonce": 46056, "range_proof": [...], "reference": { "hash": "547ef0b63e8b6b26b299e8764614e439a4106a22418ade7f8b0280da405ca5b2", "topoheight": 641930 }, "signature": "9c0b4d7db7221e5866ad11ee495113b56b77360a5782b53ba189afb120b2a004678facbdb167cd9db0dd7d376caed2f24af781f2bae247b43779e54107e5f500", "size": 1517, "source": "xel:ntpjg269f0efkvft8rckyqd0dwq480jphngy0fujxal7ng6qmfxqqnp3r5l", "source_commitments": [ { "asset": "0000000000000000000000000000000000000000000000000000000000000000", "commitment": [...], "proof": { "Y_0": [...], "Y_1": [...], "Y_2": [...], "z_r": [...], "z_s": [...], "z_x": [...] } } ], "version": 0 } }

transaction_added_in_mempool

When a valid transaction is added in the daemon mempool.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": "transaction_added_in_mempool", "fee": 25000, "fee_per_kb": 16479, "first_seen": 1723502900, "hash": "4951a4d10b8921c8e08d3c380993305a1e4706cbba606e2e79ffdfc06c54eb5f", "size": 1517, "source": "xel:ntpjg269f0efkvft8rckyqd0dwq480jphngy0fujxal7ng6qmfxqqnp3r5l" } }

transaction_executed

When a transaction has been executed by the DAG order.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "block_hash": "f51d9df594e8222a51d060469478bd8f0c73cf67dde47d8f22eb215f633692a6", "event": "transaction_executed", "topoheight": 641928, "tx_hash": "591e28f8e03e234804fe51f6beef3553698f31015288f93a088f42430bbc0130" } }

contract_invoke

When the contract has been invoked and executed by the DAG order.

Subscribe with {"contract_invoke":{"contract":"<contract hash>"}}.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": { "contract_invoke": { "contract": "d4f7e8c3b2a1e6f5c4b3a2d1e0f9f8e7d6c5b4a3a2b1c0d9e8f7e6d5c4b3a2b1" } }, "tx_hash": "d4f7e8c3b2a1e6f5c4b3a2d1e0f9f8e7d6c5b4a3a2b1c0d9e8f7e6d5c4b3a2b1", "block_hash": "a1b2c3d4e5f60718273645566778899aabbccddeeff00112233445566778899", "topoheight": 642000, "contract_logs": [...] } }

contract_transfers

When a contract has transfered any asset to the receiver address, it is aggregated.

Subscribe with {"contract_transfers":{"address":"<address>"}}.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": { "contract_transfers": { "address": "xel:qcd39a5u8cscztamjuyr7hdj6hh2wh9nrmhp86ljx2sz6t99ndjqqm7wxj8" } }, "executions": [ { "key": { "contract": "d4f7e8c3b2a1e6f5c4b3a2d1e0f9f8e7d6c5b4a3a2b1c0d9e8f7e6d5c4b3a2b1", "caller": "4951a4d10b8921c8e08d3c380993305a1e4706cbba606e2e79ffdfc06c54eb5f" }, "value": { "transfers": { "0000000000000000000000000000000000000000000000000000000000000000": 1000 } } } ], "block_timestamp": 1723503200000, "block_hash": "a1b2c3d4e5f60718273645566778899aabbccddeeff00112233445566778899", "topoheight": 642000 } }

contract_event

When a contract fire an event.

Subscribe with {"contract_event":{"contract":"<contract hash>","id":42}}. Set id to null to receive all events from this contract.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": { "contract_event": { "contract": "d4f7e8c3b2a1e6f5c4b3a2d1e0f9f8e7d6c5b4a3a2b1c0d9e8f7e6d5c4b3a2b1", "id": 42 } }, "event_id": 42, "data": { "type": "primitive", "value": { "type": "string", "value": "Hello World!" } }, "block_hash": "a1b2c3d4e5f60718273645566778899aabbccddeeff00112233445566778899", "topoheight": 642000 } }

contract_deploy

When a contract has been deployed.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": "contract_deploy", "contract": "d4f7e8c3b2a1e6f5c4b3a2d1e0f9f8e7d6c5b4a3a2b1c0d9e8f7e6d5c4b3a2b1", "block_hash": "a1b2c3d4e5f60718273645566778899aabbccddeeff00112233445566778899", "topoheight": 642000 } }

new_asset

When a new asset has been registered.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": "new_asset", "asset": "d4f7e8c3b2a1e6f5c4b3a2d1e0f9f8e7d6c5b4a3a2b1c0d9e8f7e6d5c4b3a2b1", "block_hash": "a1b2c3d4e5f60718273645566778899aabbccddeeff00112233445566778899", "topoheight": 642000 } }

peer_connected

When a new peer is connected to our daemon and allows to be shared through API.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "addr": "127.0.0.1:9999", "bytes_recv": 224, "bytes_sent": 200, "connected_on": 1723503355, "cumulative_difficulty": "195612980025169136041", "event": "peer_connected", "height": 583755, "id": 19831114311557978, "last_ping": 0, "local_port": 2125, "peers": {}, "pruned_topoheight": null, "tag": null, "top_block_hash": "14e037f9bcf2ef932b51fffdacdb0e40f5c13cbc8c213fad108f6f1c7508be6e", "topoheight": 612269, "version": "1.13.3-55810cc" } }

peer_disconnected

When a peer previously connected disconnect from us.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "addr": "127.0.0.1:9999", "bytes_recv": 224, "bytes_sent": 200, "connected_on": 1723503355, "cumulative_difficulty": "195612980025169136041", "event": "peer_disconnected", "height": 583755, "id": 19831114311557978, "last_ping": 0, "local_port": 2125, "peers": {}, "pruned_topoheight": null, "tag": null, "top_block_hash": "14e037f9bcf2ef932b51fffdacdb0e40f5c13cbc8c213fad108f6f1c7508be6e", "topoheight": 612269, "version": "1.13.3-55810cc" } }

peer_peer_list_updated

When a peer peerlist has been updated.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": "peer_peer_list_updated", "peer_id": 7542674138406502028, "peerlist": [ "1.1.1.1:2125" ] } }

peer_state_updated

When a peer state has been updated due to a ping packet.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "addr": "0.0.0.0:35202", "bytes_recv": 20227736, "bytes_sent": 23927245, "connected_on": 1722433223, "cumulative_difficulty": "195614728296525524836", "event": "peer_state_updated", "height": 611867, "id": 7542674138406502028, "last_ping": 1723503479, "local_port": 2125, "peers": { "0.0.0.0:2125": "Out" }, "pruned_topoheight": 449592, "tag": null, "top_block_hash": "284dc3a7be770bf7b630df83d614aebbddb6a6e69b4a6c33b8cd42860aa13d7d", "topoheight": 641967, "version": "1.13.2-0027ba5" } }

peer_peer_disconnected

When a peer’s peer has disconnected from him and notified us.

On Event

{ "id": 1, "jsonrpc": "2.0", "result": { "event": "peer_peer_disconnected", "peer_addr": "1.1.1.1:2125", "peer_id": 7542674138406502028 } }

JSON-RPC (Private) Methods

These methods must be enabled by starting the daemon with --rpc-allow-private-methods flag.

Last updated on