API
Daemon

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.

Setup

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.

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.

Request

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

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "average_block_time": 11812,
    "block_reward": 865869,
    "block_time_target": 15000,
    "difficulty": 35533666,
    "height": 27552,
    "mempool_size": 0,
    "circulating_supply": 24141030101,
    "maximum_supply": 18400000000000,
    "network": "Testnet",
    "pruned_topoheight": null,
    "stableheight": 27544,
    "top_block_hash": "00000014adb905b46053363e264975dd32cd0020eaf474fe08c5f492110aa95c",
    "topoheight": 28032,
    "version": "1.4.0"
  }
}

get_height

Retrieve current height of the chain.

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.

Request

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

Response

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

get_stableheight

Retrieve current stable height of the chain.

Request

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

Response

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

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
  • 1 byte for tips count
  • 32 bytes per hash (count of elements is based on previous byte)
  • 32 bytes for extra nonce (this space is free and can be used to spread more the work or write anything)
  • 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:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5"
  }
}

Response

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

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 serialized txs

Request

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

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "block_type": "Normal",
    "cumulative_difficulty": 76173573,
    "difficulty": 7902701,
    "extra_nonce": "cac46116afea8a00d2d9f9ea10d20a3a5bc9c2ae7f47201f24450e3e3fe5ec09",
    "hash": "0000019fab49717777dba2ee23f46f9f27706a9c5103a5550cf429f9c786b1e4",
    "height": 23,
    "miner": "xet:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "nonce": 183776,
		"reward": 146229454,
		"miner_reward": 131606509,
		"dev_reward": 14622945,
    "supply": 42113762,
    "timestamp": 1674226439134,
    "tips": [
      "000001aa69c15167a192de809eeed112f50ec91e513cfbf7b1674523583acbf9"
    ],
    "topoheight": 23,
    "total_fees": null,
    "total_size_in_bytes": 131,
    "txs_hashes": [],
    "version": 0
  }
}

get_blocks_at_height

Retrieve all blocks at a specific height.

Parameters

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

Request

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

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [{
    "block_type": "Normal",
    "cumulative_difficulty": 76173573,
    "difficulty": 7902701,
    "extra_nonce": "cac46116afea8a00d2d9f9ea10d20a3a5bc9c2ae7f47201f24450e3e3fe5ec09",
    "hash": "0000019fab49717777dba2ee23f46f9f27706a9c5103a5550cf429f9c786b1e4",
    "height": 23,
    "miner": "xet:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "nonce": 183776,
		"reward": 146229454,
		"miner_reward": 131606509,
		"dev_reward": 14622945,
    "supply": 42113762,
    "timestamp": 1674226439134,
    "tips": [
        "000001aa69c15167a192de809eeed112f50ec91e513cfbf7b1674523583acbf9"
    ],
    "topoheight": 23,
    "total_fees": null,
    "total_size_in_bytes": 131,
    "txs_hashes": [],
    "version": 0
  }]
}

get_block_by_hash

Retrieve a block by its hash.

Parameters

NameTypeRequiredNote
hashHashRequiredValid block Hash present in the chain
include_txsBooleanOptionalInclude serialized txs

Request

{
  "jsonrpc": "2.0",
  "method": "get_block_by_hash",
  "id": 1,
  "params": {
    "hash": "000002144bb86d9fcbe223aff1f6c2526d0c47eef0b8f7433b3abec22685fb31"
  }
}

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "block_type": "Normal",
    "cumulative_difficulty": 76173573,
    "difficulty": 7902701,
    "extra_nonce": "cac46116afea8a00d2d9f9ea10d20a3a5bc9c2ae7f47201f24450e3e3fe5ec09",
    "hash": "0000019fab49717777dba2ee23f46f9f27706a9c5103a5550cf429f9c786b1e4",
    "height": 23,
    "miner": "xet:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "nonce": 183776,
		"reward": 146229454,
		"miner_reward": 131606509,
		"dev_reward": 14622945,
    "supply": 42113762,
    "timestamp": 1674226439134,
    "tips": [
      "000001aa69c15167a192de809eeed112f50ec91e513cfbf7b1674523583acbf9"
    ],
    "topoheight": 23,
    "total_fees": null,
    "total_size_in_bytes": 131,
    "txs_hashes": [],
    "version": 0
  }
}

get_top_block

Retrieve the highest block based on the topological height.

Parameters

NameTypeRequiredNote
include_txsBooleanOptionalInclude serialized txs

Request

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

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "block_type": "Normal",
    "cumulative_difficulty": 76173573,
    "difficulty": 7902701,
    "extra_nonce": "cac46116afea8a00d2d9f9ea10d20a3a5bc9c2ae7f47201f24450e3e3fe5ec09",
    "hash": "0000019fab49717777dba2ee23f46f9f27706a9c5103a5550cf429f9c786b1e4",
    "height": 23,
    "miner": "xet:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "nonce": 183776,
		"reward": 146229454,
		"miner_reward": 131606509,
		"dev_reward": 14622945,
    "supply": 42113762,
    "timestamp": 1674226439134,
    "tips": [
      "000001aa69c15167a192de809eeed112f50ec91e513cfbf7b1674523583acbf9"
    ],
    "topoheight": 23,
    "total_fees": null,
    "total_size_in_bytes": 131,
    "txs_hashes": [],
    "version": 0
  }
}

get_nonce

Retrieve the nonce for address in request params.

If no nonce is found for this address and its valid, value start at 0.
Each nonce represents how many TX has been made by this address.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain

Request

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

Response

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

has_nonce

Verify if the address has a registered nonce.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
topoheightIntegerOptionalnonce at specified topoheight

Request

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

Response

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

get_nonce_at_topoheight

Get topoheight nonce value of an address.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
topoheightIntegerRequirednonce at specified topoheight

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_nonce_at_topoheight",
  "params": {
    "address": "xet:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "topoheight": 0
  }
}

Response

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

get_balance

Get up-to-date asset's encrypted balance for a specific address.

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

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
assetHashRequiredAsset ID registered on chain

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_balance",
  "result": {
    "address": "xet:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "asset": "0000000000000000000000000000000000000000000000000000000000000000"
  }
}

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "topoheight": 21337,
    "version": {
      "balance_type": "input",
      "final_balance": {
        "commitment": [22,183,144,165,136,210,70,241,198,222,153,185,106,129,206,59,87,170,84,46,92,255,123,37,13,46,151,145,178,174,229,112],
        "handle": [178,229,67,191,17,36,76,48,173,11,225,181,151,61,47,241,96,181,250,151,110,224,65,49,211,10,25,33,120,110,103,10]
      },
      "output_balance": null,
      "previous_topoheight": 11982
    }
  }
}

has_balance

Check if the address has balance for an asset.

Parameters

NameTypeRequiredNote
addressAddressRequiredValid address registered on chain
assetHashRequiredAsset ID registered on chain
topoheightIntegerOptional

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

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "has_balance",
  "result": {
    "address": "xet:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "asset": "0000000000000000000000000000000000000000000000000000000000000000"
  }
}

Response

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

get_balance_at_topoheight

Get asset's encrypted balance from an address at exact 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:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "asset": "0000000000000000000000000000000000000000000000000000000000000000",
    "topoheight": 30
  }
}

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "balance_type": "input", // input, output, both
    "final_balance": {
      "commitment": [22,183,144,165,136,210,70,241,198,222,153,185,106,129,206,59,87,170,84,46,92,255,123,37,13,46,151,145,178,174,229,112],
      "handle": [178,229,67,191,17,36,76,48,173,11,225,181,151,61,47,241,96,181,250,151,110,224,65,49,211,10,25,33,120,110,103,10]
    },
    "output_balance": null,
    "previous_topoheight": 11982
  }
}

get_asset

Get asset data with hash.

Parameters

NameTypeRequiredNote
assetHashRequiredAsset ID registered on chain

Request

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

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "topoheight": 0, // registered topoheight
    "decimals": 8
  }
}

get_assets

Get all assets available on network.

Parameters

NameTypeRequiredNote
skipIntegerOptionalHow many assets to skip
maximumIntegerOptionalMaximum assets to fetch (limited to 100)

Request

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

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "asset": "0000000000000000000000000000000000000000000000000000000000000000",
			"decimals": 8, // balance is in atomic unit this is the number in decimal places
			"topoheight": 0 // registered topoheight
    }
  ]
}

count_assets

Counts the number of assets saved on disk.

Request

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

Response

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

count_transactions

Counts the number of transactions saved on disk.

Request

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

Response

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

count_accounts

Counts the number of accounts saved on disk.

Request

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

Response

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

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.

Request

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

Response

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

p2p_status

Retrieve some informations about P2p.

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_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 hash 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": [
      "83f6a544d69ca4852e8e2b6bc98b3a1602509e8feea7d744f6a60deeef51c663",
      "00005c58f5c2a506b2a24e79967db009d3b2be13f15e657d6352b1aa59cdfedc",
      "00002d138fbab2bc14958061edbc4a0c272d1ac27d60ef4a72e2f5ac9d1a2b0a"
  ]
}

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
}

submit_transaction

Submit a transaction in HEX format to the daemon mempool.

Parameters

NameTypeRequiredNote
hexStringRequiredTransaction in HEX format

Request

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

Response

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

get_mempool

Fetch all transactions presents in the mempool.

Request

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

Response

{
    "id": 0,
    "jsonrpc": "2.0",
    "result": [
    {
      "blocks": null,
      "data": {
        "transfers": [
          {
            "asset": "0000000000000000000000000000000000000000000000000000000000000000",
            "commitment":[218,137,118,13,16,98,204,27,215,144,246,211,178,168,50,50,214,47,38,213,149,49,46,101,251,35,2,84,54,7,68,94],
            "ct_validity_proof":{
              "Y_0":[158,231,220,17,123,132,51,28,233,0,168,98,126,7,204,191,246,187,147,221,210,166,249,38,76,110,12,160,87,190,73,66],
              "Y_1":[224,7,55,141,143,193,193,116,14,21,254,72,202,135,223,232,143,29,173,215,27,13,142,70,128,77,157,173,219,40,107,14],
              "z_r":[101,195,217,89,4,15,150,77,34,185,137,33,255,103,191,44,99,34,54,217,235,49,172,242,45,152,6,198,185,36,221,9],
              "z_x":[0,38,78,61,66,242,187,16,155,139,250,140,3,85,253,202,190,26,183,196,8,239,141,147,57,19,21,37,84,70,27,10],
            },
            "destination": "xet:q622pz5exf5hmw98d73dlqhwjvfwd5g9k0tpuay90ga634c64cgsqczfmvx",
            "extra_data": null,
            "receiver_handle": [24,152,119,104,18,50,26,255,8,247,126,14,156,62,135,55,131,133,33,233,248,202,145,75,233,224,102,163,0,64,196,63],
            "sender_handle": [20,59,247,220,127,42,78,103,239,17,131,30,126,110,74,163,142,85,90,52,154,129,10,49,21,74,104,98,237,16,156,1]
          }
        ]
      },
      "executed_in_block": null,
      "fee": 25000,
      "first_seen": 1711665284,
      "hash": "5c0c4a0d58cf678015af2e10f79119ed6d969dd3d1e98ca4ffefbb4439765658",
      "in_mempool": true,
      "nonce": 1461,
      "range_proof": [152,151,60,45,85,18,16,164,118,234,156,125,246,97,104,9,127,48,209,201,216,221,90,165,40,92,168,17,141,27,234,66,16,112,30,126,229,71,182,165,209,223,33,13,46,79,39,85,24,124,214,238,32,211,121,62,17,183,134,67,200,13,34,90,48,159,174,238,16,134,120,177,210,122,246,203,179,74,1,176,225,122,230,124,194,82,37,137,116,137,64,167,149,54,188,36,6,24,206,54,245,111,185,21,79,168,207,10,60,190,15,103,130,136,86,46,156,145,143,114,96,121,190,193,188,193,13,46,68,220,94,70,90,47,99,254,33,158,147,100,83,172,24,18,160,67,122,31,26,226,79,251,169,119,50,116,179,223,137,3,157,237,40,81,53,44,177,21,244,147,135,5,67,59,48,254,204,147,8,104,192,166,48,39,43,228,118,108,190,129,209,12,47,118,41,173,134,102,169,27,246,45,215,3,148,97,240,111,171,131,134,170,27,160,45,189,121,2,54,53,130,76,42,1,144,146,190,213,109,239,10,58,82,65,186,40,32,69,185,127,115,236,5,151,36,47,152,155,18,95,56,69,75,184,94,68,14,237,228,245,111,203,206,42,52,59,180,8,45,206,9,129,52,93,231,152,128,177,153,44,73,162,86,15,44,234,130,40,60,81,238,36,11,41,213,158,231,130,236,185,60,172,84,221,219,78,97,61,56,39,198,126,28,62,169,52,44,122,230,101,204,247,17,247,42,238,121,167,126,206,156,195,185,18,81,163,211,1,239,10,215,0,219,242,191,197,142,118,248,77,86,57,2,40,161,195,165,31,232,92,228,26,147,77,148,40,109,44,116,128,149,144,218,136,204,233,208,160,172,179,207,218,174,16,242,28,90,132,88,42,112,131,154,2,63,160,210,57,79,27,11,132,86,81,110,154,243,47,94,29,241,252,11,31,103,4,118,170,187,179,237,160,37,35,75,120,186,151,164,83,55,139,147,4,89,231,226,21,182,189,59,61,120,120,231,40,109,60,26,156,77,240,152,136,139,199,168,33,156,245,218,0,226,64,149,97,97,25,212,197,148,231,215,75,79,216,154,84,72,66,214,62,190,169,22,150,40,53,2,96,102,44,67,90,56,147,69,131,186,223,24,181,53,97,60,102,68,12,26,27,208,106,186,32,220,18,199,120,108,230,245,58,77,239,179,172,103,169,152,201,204,105,189,69,9,180,251,17,233,118,67,150,201,14,58,138,121,104,30,158,46,137,12,63,5,86,58,207,50,240,226,94,105,110,37,181,108,84,196,222,195,156,207,146,168,1,180,138,113,24,210,252,109,207,139,27,42,47,71,113,208,210,189,168,219,200,216,174,135,217,90,126,173,108,231,80,100,69,196,50,69,252,145,163,211,201,217,141,89,184,171,31,88,113,226,130,195,2,44,71,213,60,16,169,255,136,118,82,181,117,172,115,7,172,53,76,22,38,53,116,174,217,175,91,33,159,255,195,84,112,54,141,165,186,148,240,207,2,22,97,48,74,85,182,5,71,153,249,41,165,215,18,185,143,101,205,74,210,120,51,17,212,193,63,196,16,170,2,225,230,243,87,168,14,3,152,101,127,84,120,135,132,126,80,136,124,133,106,66,182,185,56,31,202,237,60,7,244,89,180,151,138,231,25,20,3],
      "reference": {
        "hash": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8",
        "topoheight": 22285
      },
      "signature": "b3362192f0ae054964279fc67e55f3dc2cde9c6d6d0c98b00a1c31672d6a330aa1cdad4929662d68fa0a830349da429eef342fef43125b97fea87c16fa2f6607",
      "source": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk",
      "source_commitments": [
        {
          "asset": "0000000000000000000000000000000000000000000000000000000000000000",
          "commitment": [162,234,124,8,122,42,11,22,134,13,71,91,26,80,192,4,149,92,35,2,69,33,94,84,83,83,50,84,209,203,45,40],
          "proof":{
            "Y_0":[116,218,91,32,206,34,61,109,135,5,174,150,213,28,15,5,79,168,84,64,199,155,22,248,76,5,201,196,66,69,228,32],
            "Y_1":[232,30,221,209,235,222,168,0,204,1,10,186,182,228,205,104,242,219,123,147,135,35,12,202,232,1,102,134,41,158,212,29],"Y_2":[14,184,127,213,147,230,161,52,135,223,62,143,110,219,156,170,241,152,8,241,89,249,46,183,17,173,129,172,150,45,215,105],
            "z_r":[33,238,204,122,192,122,31,198,135,69,31,98,72,90,41,244,184,159,106,125,17,248,30,170,73,107,91,124,15,60,98,1],"z_s":[176,230,7,8,210,21,88,239,54,119,207,5,27,137,141,68,142,55,5,0,97,67,90,223,150,126,112,219,243,131,171,14],
            "z_x":[226,223,152,216,17,235,42,50,243,244,232,177,183,178,27,46,203,154,18,177,82,53,203,213,178,112,156,49,21,191,125,8]
          }
        }
      ],
      "version": 0
    }
  ]
}

get_transaction

Fetch a transaction by its hash from daemon.

Result returned in `data` field can changes based on the TransactionType (transfer, burn, Smart Contract call, Deploy Code..)

Parameters

NameTypeRequiredNote
hashHashRequiredTransaction hash to fetch

Request

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "get_transaction",
  "params": {
    "hash": "136e9c19f8e9afd814e1e5f819914dca8fc0df01b68c5744bcfba0ab224dc0c2"
  }
}

Response

{
  "id": 0,
  "jsonrpc": "2.0",
  "result": {
    "blocks": [
      "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8"
    ],
    "data": {
      "transfers": [
        {
          "asset": "0000000000000000000000000000000000000000000000000000000000000000",
          "commitment": [250,223,149,61,162,95,167,123,147,48,229,121,70,107,159,33,93,138,52,125,112,67,196,92,229,122,189,104,59,206,43,3],
          "ct_validity_proof": {
            "Y_0": [240,56,135,79,159,131,179,215,10,173,199,218,211,152,3,119,177,130,82,11,186,45,189,4,177,242,57,215,208,18,156,38],
            "Y_1": [96,109,73,111,203,185,150,92,241,162,66,103,119,135,244,47,3,4,209,167,173,37,0,236,45,151,150,224,127,169,46,98],
            "z_r": [247,33,119,43,63,160,69,28,100,125,103,81,79,249,247,99,157,207,253,92,251,107,237,126,108,197,226,7,133,176,88,6],
            "z_x": [14,152,174,185,108,19,100,100,12,48,46,93,174,151,157,155,162,90,148,78,33,36,50,119,249,77,198,234,175,143,198,12]
          },
          "destination": "xet:q622pz5exf5hmw98d73dlqhwjvfwd5g9k0tpuay90ga634c64cgsqczfmvx",
          "extra_data": null,
          "receiver_handle": [52,82,52,83,129,131,58,205,187,254,112,59,69,128,62,11,42,203,113,2,123,33,239,179,17,203,49,51,16,145,7,106],
          "sender_handle": [188,54,8,9,247,56,242,39,232,99,0,158,33,27,235,151,179,101,72,71,175,255,7,240,45,159,243,241,91,139,140,6]
        }
      ]
    },
    "executed_in_block": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8",
    "fee": 25000,
    "hash": "cb26c0a203cd75206ebd122213e442ffabf5dc21286fbe92e46c864ba723dcdd",
    "in_mempool": false,
    "nonce": 1460,
    "range_proof": [124,241,170,167,140,68,24,166,41,145,191,69,234,201,234,239,61,60,99,63,200,141,100,229,15,102,94,188,248,30,4,48,42,120,154,41,222,76,118,151,244,51,113,250,217,83,96,203,197,148,184,74,60,166,241,160,143,102,62,155,215,38,37,122,42,248,247,186,179,253,194,35,207,139,39,187,239,147,82,62,108,59,155,205,191,135,218,57,36,189,189,84,151,1,39,107,208,196,174,14,189,108,152,135,212,165,216,216,5,92,113,45,238,54,128,107,187,198,112,167,232,179,104,254,250,231,189,87,82,52,38,254,193,108,172,216,158,181,100,119,124,16,138,131,228,171,63,181,25,3,110,91,165,101,94,170,238,103,98,3,174,73,71,183,231,165,105,188,78,62,176,243,8,136,227,139,43,32,142,224,69,103,152,64,121,148,80,249,71,245,153,9,64,81,107,254,25,185,43,46,168,157,255,232,217,255,98,1,206,13,161,124,126,241,83,166,157,151,195,71,84,244,83,3,240,39,164,253,188,212,254,252,17,100,140,197,27,29,30,222,188,172,39,143,135,203,210,18,203,59,67,207,192,90,152,78,144,105,115,204,215,73,135,212,0,102,83,236,36,167,123,128,246,39,64,76,38,214,230,158,211,115,69,55,26,124,130,127,88,49,80,53,74,123,64,176,12,181,200,168,101,218,106,7,2,82,77,24,152,118,19,230,145,194,226,230,4,106,233,1,18,49,98,210,85,137,0,175,91,101,139,123,205,99,221,6,250,28,16,139,248,161,202,43,143,57,24,103,74,77,56,77,160,128,80,105,27,166,46,236,142,138,52,118,129,246,186,14,159,85,134,22,22,125,144,1,248,84,165,160,71,108,116,103,162,198,160,167,110,45,106,26,193,118,110,104,165,91,81,98,236,144,142,109,13,83,10,14,56,117,231,93,105,76,186,89,178,230,151,186,254,145,134,135,112,48,213,215,243,237,174,89,170,71,151,125,185,140,234,66,44,184,130,122,187,103,22,13,138,180,224,115,92,221,6,143,62,9,188,39,190,20,69,173,44,5,57,147,130,83,45,22,34,159,159,192,123,212,189,97,56,198,4,239,167,31,177,203,2,171,170,121,160,46,185,104,60,24,175,236,123,238,149,49,233,88,127,119,221,221,159,10,234,223,4,56,108,153,103,252,91,128,224,22,240,98,250,111,204,177,49,20,63,229,58,255,177,22,127,15,54,124,38,5,104,241,71,23,110,150,13,123,92,186,79,55,192,15,225,113,95,233,82,69,123,67,239,27,57,149,28,157,121,12,132,26,48,74,31,202,234,140,29,237,180,5,73,171,248,103,27,98,114,222,91,236,211,54,115,32,150,172,148,224,214,174,231,7,232,102,236,255,130,169,169,36,229,25,75,43,80,97,189,23,189,177,215,118,139,164,7,249,193,221,163,78,162,216,149,27,88,168,250,34,158,65,24,219,150,110,41,200,20,40,216,180,150,151,24,81,49,73,179,204,238,34,140,243,130,51,226,56,251,158,86,132,170,107,160,7,88,111,129,136,218,41,43,251,102,232,204,38,228,223,139,49,60,170,245,210,135,41,32,10,27,151,62,177,224,107,94,138,21,49,42,87,3,37,218,213,6,162,121,20,132,241,191,213,46,96,142,169,44,57,44,12],
    "reference": {
      "hash": "00000000040f90c8bcbb33bc832c1cd9f0683204af1c099a0af52c7a247840f5",
      "topoheight": 22284
    },
    "signature": "afe694d96aa7a4ea44e57e7f7090a19a84105fc49df40c35cb5c1bfe4a949303d8b918e2ccbc38c8058449edcb334883471265743c99be39180a574d2adbfd05",
    "source": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk",
    "source_commitments": [
      {
        "asset": "0000000000000000000000000000000000000000000000000000000000000000",
        "commitment": [30,9,94,111,239,211,250,72,102,174,187,72,167,33,129,6,73,190,134,190,64,225,59,197,136,241,222,65,35,83,225,102],
        "proof": {
          "Y_0": [132,37,94,173,246,110,115,155,19,237,96,209,166,69,71,48,84,116,64,118,81,92,49,175,166,52,213,167,139,99,75,38],
          "Y_1": [102,101,95,195,49,88,151,204,18,197,170,13,70,148,228,161,246,36,215,153,249,144,136,193,100,236,238,129,206,102,140,27],
          "Y_2": [234,117,216,69,16,98,103,162,226,39,135,167,169,215,205,93,1,40,42,42,60,88,141,35,184,20,218,7,0,100,157,73],
          "z_r": [122,202,29,135,106,190,110,76,17,36,196,111,108,216,183,199,156,138,71,134,212,70,62,172,134,206,177,180,146,172,189,15],
          "z_s": [208,43,20,1,26,162,40,9,66,134,126,104,102,12,50,240,94,101,51,44,124,226,219,41,167,143,62,77,157,35,190,8],
          "z_x": [22,249,106,65,177,124,195,165,212,66,207,4,169,121,83,133,125,240,201,94,62,73,202,42,185,86,23,215,117,198,206,15]
        }
      }
    ],
    "version": 0
  }
}

get_transactions

Fetch transactions by theirs hashes from daemon and keep the same order in response.

Parameters

NameTypeRequiredNote
tx_hashesHash[]RequiredList of hash transactions

Request

{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "get_transactions",
  "params": {
    "tx_hashes": [
      "136e9c19f8e9afd814e1e5f819914dca8fc0df01b68c5744bcfba0ab224dc0c2",
      "136e9c19f8e9afd814e1e5f819914dca8fc0df01b68c5744bcfba0ab224dc0c3"
    ]
  }
}

Response

{
  "id": 0,
  "jsonrpc": "2.0",
  "result": [
    {
      "blocks": [
        "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8"
      ],
      "data": {
        "transfers": [
          {
            "asset": "0000000000000000000000000000000000000000000000000000000000000000",
            "commitment": [250,223,149,61,162,95,167,123,147,48,229,121,70,107,159,33,93,138,52,125,112,67,196,92,229,122,189,104,59,206,43,3],
            "ct_validity_proof": {
              "Y_0": [240,56,135,79,159,131,179,215,10,173,199,218,211,152,3,119,177,130,82,11,186,45,189,4,177,242,57,215,208,18,156,38],
              "Y_1": [96,109,73,111,203,185,150,92,241,162,66,103,119,135,244,47,3,4,209,167,173,37,0,236,45,151,150,224,127,169,46,98],
              "z_r": [247,33,119,43,63,160,69,28,100,125,103,81,79,249,247,99,157,207,253,92,251,107,237,126,108,197,226,7,133,176,88,6],
              "z_x": [14,152,174,185,108,19,100,100,12,48,46,93,174,151,157,155,162,90,148,78,33,36,50,119,249,77,198,234,175,143,198,12]
            },
            "destination": "xet:q622pz5exf5hmw98d73dlqhwjvfwd5g9k0tpuay90ga634c64cgsqczfmvx",
            "extra_data": null,
            "receiver_handle": [52,82,52,83,129,131,58,205,187,254,112,59,69,128,62,11,42,203,113,2,123,33,239,179,17,203,49,51,16,145,7,106],
            "sender_handle": [188,54,8,9,247,56,242,39,232,99,0,158,33,27,235,151,179,101,72,71,175,255,7,240,45,159,243,241,91,139,140,6]
          }
        ]
      },
      "executed_in_block": "000000000bc1070fda6b86eb31fbf3f15e89be9c10928415b2254fcab96088a8",
      "fee": 25000,
      "hash": "cb26c0a203cd75206ebd122213e442ffabf5dc21286fbe92e46c864ba723dcdd",
      "in_mempool": false,
      "nonce": 1460,
      "range_proof": [124,241,170,167,140,68,24,166,41,145,191,69,234,201,234,239,61,60,99,63,200,141,100,229,15,102,94,188,248,30,4,48,42,120,154,41,222,76,118,151,244,51,113,250,217,83,96,203,197,148,184,74,60,166,241,160,143,102,62,155,215,38,37,122,42,248,247,186,179,253,194,35,207,139,39,187,239,147,82,62,108,59,155,205,191,135,218,57,36,189,189,84,151,1,39,107,208,196,174,14,189,108,152,135,212,165,216,216,5,92,113,45,238,54,128,107,187,198,112,167,232,179,104,254,250,231,189,87,82,52,38,254,193,108,172,216,158,181,100,119,124,16,138,131,228,171,63,181,25,3,110,91,165,101,94,170,238,103,98,3,174,73,71,183,231,165,105,188,78,62,176,243,8,136,227,139,43,32,142,224,69,103,152,64,121,148,80,249,71,245,153,9,64,81,107,254,25,185,43,46,168,157,255,232,217,255,98,1,206,13,161,124,126,241,83,166,157,151,195,71,84,244,83,3,240,39,164,253,188,212,254,252,17,100,140,197,27,29,30,222,188,172,39,143,135,203,210,18,203,59,67,207,192,90,152,78,144,105,115,204,215,73,135,212,0,102,83,236,36,167,123,128,246,39,64,76,38,214,230,158,211,115,69,55,26,124,130,127,88,49,80,53,74,123,64,176,12,181,200,168,101,218,106,7,2,82,77,24,152,118,19,230,145,194,226,230,4,106,233,1,18,49,98,210,85,137,0,175,91,101,139,123,205,99,221,6,250,28,16,139,248,161,202,43,143,57,24,103,74,77,56,77,160,128,80,105,27,166,46,236,142,138,52,118,129,246,186,14,159,85,134,22,22,125,144,1,248,84,165,160,71,108,116,103,162,198,160,167,110,45,106,26,193,118,110,104,165,91,81,98,236,144,142,109,13,83,10,14,56,117,231,93,105,76,186,89,178,230,151,186,254,145,134,135,112,48,213,215,243,237,174,89,170,71,151,125,185,140,234,66,44,184,130,122,187,103,22,13,138,180,224,115,92,221,6,143,62,9,188,39,190,20,69,173,44,5,57,147,130,83,45,22,34,159,159,192,123,212,189,97,56,198,4,239,167,31,177,203,2,171,170,121,160,46,185,104,60,24,175,236,123,238,149,49,233,88,127,119,221,221,159,10,234,223,4,56,108,153,103,252,91,128,224,22,240,98,250,111,204,177,49,20,63,229,58,255,177,22,127,15,54,124,38,5,104,241,71,23,110,150,13,123,92,186,79,55,192,15,225,113,95,233,82,69,123,67,239,27,57,149,28,157,121,12,132,26,48,74,31,202,234,140,29,237,180,5,73,171,248,103,27,98,114,222,91,236,211,54,115,32,150,172,148,224,214,174,231,7,232,102,236,255,130,169,169,36,229,25,75,43,80,97,189,23,189,177,215,118,139,164,7,249,193,221,163,78,162,216,149,27,88,168,250,34,158,65,24,219,150,110,41,200,20,40,216,180,150,151,24,81,49,73,179,204,238,34,140,243,130,51,226,56,251,158,86,132,170,107,160,7,88,111,129,136,218,41,43,251,102,232,204,38,228,223,139,49,60,170,245,210,135,41,32,10,27,151,62,177,224,107,94,138,21,49,42,87,3,37,218,213,6,162,121,20,132,241,191,213,46,96,142,169,44,57,44,12],
      "reference": {
        "hash": "00000000040f90c8bcbb33bc832c1cd9f0683204af1c099a0af52c7a247840f5",
        "topoheight": 22284
      },
      "signature": "afe694d96aa7a4ea44e57e7f7090a19a84105fc49df40c35cb5c1bfe4a949303d8b918e2ccbc38c8058449edcb334883471265743c99be39180a574d2adbfd05",
      "source": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk",
      "source_commitments": [
        {
          "asset": "0000000000000000000000000000000000000000000000000000000000000000",
          "commitment": [30,9,94,111,239,211,250,72,102,174,187,72,167,33,129,6,73,190,134,190,64,225,59,197,136,241,222,65,35,83,225,102],
          "proof": {
            "Y_0": [132,37,94,173,246,110,115,155,19,237,96,209,166,69,71,48,84,116,64,118,81,92,49,175,166,52,213,167,139,99,75,38],
            "Y_1": [102,101,95,195,49,88,151,204,18,197,170,13,70,148,228,161,246,36,215,153,249,144,136,193,100,236,238,129,206,102,140,27],
            "Y_2": [234,117,216,69,16,98,103,162,226,39,135,167,169,215,205,93,1,40,42,42,60,88,141,35,184,20,218,7,0,100,157,73],
            "z_r": [122,202,29,135,106,190,110,76,17,36,196,111,108,216,183,199,156,138,71,134,212,70,62,172,134,206,177,180,146,172,189,15],
            "z_s": [208,43,20,1,26,162,40,9,66,134,126,104,102,12,50,240,94,101,51,44,124,226,219,41,167,143,62,77,157,35,190,8],
            "z_x": [22,249,106,65,177,124,195,165,212,66,207,4,169,121,83,133,125,240,201,94,62,73,202,42,185,86,23,215,117,198,206,15]
          }
        }
      ],
      "version": 0
    }
  ]
}

get_blocks_range_by_topoheight

Get blocks between range of topoheight. Max of 20 blocks and if no params returns recent blocks.

Parameters

NameTypeRequiredNote
start_topoheightIntegerOptional0 or under topoheight
end_topoheightIntegerOptionalMust be under current topoheight

Request

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

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [{
    "block_type": "Sync",
    "cumulative_difficulty": 1,
    "difficulty": 1,
    "extra_nonce": "0000000000000000000000000000000000000000000000000000000000000000",
    "hash": "55a162b8e0e137bb6a8de9f4c4b214fb60bcd2df15ec32fdd8f06759b863f06e",
    "height": 0,
    "miner": "xet:qqqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680gtl9ky3",
    "nonce": 0,
		"reward": 146229454,
		"miner_reward": 131606509,
		"dev_reward": 14622945,
    "supply": 877380,
    "timestamp": 1678215431432,
    "tips": [],
    "topoheight": 0,
    "total_fees": null,
    "total_size_in_bytes": 99,
    "txs_hashes": [],
    "version": 0
  }]
}

get_blocks_range_by_height

Get blocks between range of height. Max of 20 blocks and if no params returns recent blocks.

Parameters

NameTypeRequiredNote
start_heightIntegerOptional0 or under height
end_heightIntegerOptionalMust be under current height

Request

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

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [{
    "block_type": "Sync",
    "cumulative_difficulty": 1,
    "difficulty": 1,
    "extra_nonce": "0000000000000000000000000000000000000000000000000000000000000000",
    "hash": "55a162b8e0e137bb6a8de9f4c4b214fb60bcd2df15ec32fdd8f06759b863f06e",
    "height": 0,
    "miner": "xet:qqqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680gtl9ky3",
    "nonce": 0,
		"reward": 146229454,
		"miner_reward": 131606509,
		"dev_reward": 14622945,
    "supply": 877380,
    "timestamp": 1678215431432,
    "tips": [],
    "topoheight": 0,
    "total_fees": null,
    "total_size_in_bytes": 99,
    "txs_hashes": [],
    "version": 0
  }]
}

get_accounts

Retrieve a list of available accounts (each account must have one on-chain interaction).

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"
  ]
}

get_account_history

List mined blocks, incoming and outgoing transactions.

Parameters

NameTypeRequiredNote
addressAddressRequiredAccount address

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_account_history",
  "params": {
    "address": "xet:qze954a6tjc2d36zdjuapgu75hpckvtlmfxsymevmqn9ewvpkfasqkrzdql"
  }
}

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [{
    "block_timestamp": 1697749965331,
    "hash": "00000030bd46c7d790693fad42c9096744c343c75b9d45704ae182611e51dc82",
    "mining": {
        "reward": 116937
    },
    "topoheight": 499058
  }]
}

get_account_assets

List of assets within a specific address.

Parameters

NameTypeRequiredNote
addressAddressRequiredAccount address

Request

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

Response

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

get_peers

Get list of connected peers.

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",
				"connected_on": 1711663198,
				"cumulative_difficulty": "874788276435001",
				"height": 21939,
				"id": 7089875151156203202,
				"last_ping": 1711664680,
				"local_port": 2125,
				"peers": {
					"255.255.255.255:2125": "In",
					"74.208.251.149:2125": "Both"
				},
				"pruned_topoheight": null,
				"tag": null,
				"top_block_hash": "0000000007eeed3fecdaedff82ad867a224826230c12465cf39186471e2e360e",
				"topoheight": 22241,
				"version": "1.8.0-58bb439"
			},
			{
				"addr": "74.208.251.149:2125",
				"connected_on": 1711663199,
				"cumulative_difficulty": "874788276435001",
				"height": 21939,
				"id": 2448648666414530279,
				"last_ping": 1711664682,
				"local_port": 2125,
				"peers": {
					"127.0.0.1:2125": "In",
					"127.0.0.1:2126": "Both"
				},
				"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_dev_fee_thresholds

Hardcoded fee structure for each height intervals. Fee percentage of the block reward goes to dev funds.

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

Get the actual disk size of the blockchain.

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"
  }
}

is_tx_executed_in_block

Check if a transaction was executed in a specific block.

Parameters

NameTypeRequiredNote
tx_hashHashRequired
block_hashHashRequired

Request

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

Response

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

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":[244,202,158,128,207,119,30,237,144,243,146,197,136,223,240,34,50,232,217,160,125,120,125,135,65,192,213,220,116,235,120,122],
            "handle":[122,13,209,236,109,230,21,124,148,244,88,0,117,99,188,49,90,214,225,239,229,183,230,142,10,56,82,96,70,232,110,104]
        }
      },
      "max": 2829,
      "min": 2825,
      "txs": [
        "78148376846b2a8ce1f3b248a65bd5ed4e22ebb6ac98514377a4ea47d08cb2a8",
        "d8b1d090eea0812e99c1384137240773079dcd79a4fbfe4d78d395288ff1823a",
        "c82cba8d5472dc2c1d6d38dd30ee3726d32638001e0c54903905c4f0c814ae6a",
        "2f4bf1ea35fc8ef33961a465ac0cf0dc2c6010daaee423ed06ffdcdf2b9c0d6d",
        "f1c8425a7f3bea049dbdcaf905ef447d43ca41763740b54d2958baac15d0d3ae"
      ]
    }
}

get_account_registration_topoheight

Retrieve the account's registration topoheight, which is the first time it performed an on-chain action, such as mining a new block.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_account_registration_topoheight",
  "param": { 
    "address": "xel:vfnv4zqkxlzv3n0usky0l6dl55arur3lmaskux5ksqa6ueuhcasqqa0av7z" 
  }
}

Response

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

create_miner_work

Create a work for miner based on a block template set in parameter.

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)

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": "create_miner_work",
  "id": 1,
  "params": {
    "template": "00000000000000c19a0000018f2c14497300000000000000005dc86515e4adbb394b11dcdd25efcb78a08729b6230065dbb9a3c85f960af89901a0ea4d7c7dee70a12b14e95c1385e06ecd6a14e1a63a8302ce3c1e4dd7994c2f00006423b4908e5bd32241e3443fccfb7bab86a899a8cca12b3fedf255634d156d66",
    "address": "xet:6eadzwf5xdacts6fs4y3csmnsmy4mcxewqt3xyygwfx0hm0tm32sqxdy9zk"
  }
}

Response

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

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

Request

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

Response

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

extract_key_from_address

Parameters

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

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": {
    "result": "6423b4908e5bd32241e3443fccfb7bab86a899a8cca12b3fedf255634d156d66"
  }
}

get_difficulty

Retrieve current difficulty and associated network hashrate.

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"
  }
}

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: 'NewBlock'
  }
}
 
ws.onmessage = (message) => {
  console.log(message.data)
}
 
ws.send(JSON.stringify(message))

new_block

When a new block is accepted by chain

On Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "block_type": "Normal",
    "cumulative_difficulty": 95411226796,
    "difficulty": 3291268,
    "event": "NewBlock",
    "extra_nonce": "2365cfaac7652364a8fc9cfeadcbb16a0e29ae8c3aa48f099449ac92d161f91e",
    "hash": "ad4c28c060f8bcc6fd7ccf955eeaebcd5611d69fc22a17b8ec6961a995b2c6be",
    "height": 20698,
    "miner": "xet:qyqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680g05xfx5",
    "nonce": 0,
		"reward": 146229454,
		"miner_reward": 131606509,
		"dev_reward": 14622945,
    "supply": 18071559927,
    "timestamp": 1677081254817,
    "tips": ["1faac9784c07b41d6e8740f15b23c163966aecebc1b7cac77aca74946a25625d"],
    "topoheight": 20698,
    "total_fees": 0,
    "total_size_in_bytes": 131,
    "txs_hashes": []
  }
}

transaction_added_in_mempool

When a new valid transaction is added in mempool

On Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "data": {
      "Transfer": [{
        "amount": 1,
        "asset": "0000000000000000000000000000000000000000000000000000000000000000",
        "extra_data": null,
        "to": "xet:qqqxcfxdc8ywarcz3wx2leahnfn2pyp0ymvfm42waluq408j2x5680gtl9ky3"
      }]
    },
    "event": "TransactionAddedInMempool",
    "fee": 1000,
    "hash": "43e10cf783e6596efdfdd1fe9480be7221e5bfb36c817a299a9fc95b98624e80",
    "nonce": 17,
    "owner": "xet:qqqtgm427maw6mjnnl26kvfpapwc82esqsd2ryzwk5hrckt77kjld7qx6dnxc",
    "signature": "1b479bc06963657d4f5d26b9f14fe8361a9eec7ef1e85e6f3c89fd5fec705fb0b2a04a98f7883f060245794f6f66c9de08c1a86dab5deb2dc544f6cda4b47a0a"
  }
}

transaction_executed

When a transaction has been included in a valid block & executed on chain

On Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "block_hash": "cdae731b35c7bef7bfa4678fb97618d13957e99009e1aa952b5b5598f717c49e",
    "event": "TransactionExecuted",
    "topoheight": 6472,
    "tx_hash": "43e10cf783e6596efdfdd1fe9480be7221e5bfb36c817a299a9fc95b98624e80"
  }
}

block_ordered

When a block is ordered for the first time or reordered to a new topoheight

transaction_sc_result

When a valid TX SC Call hash has been executed by chain

new_asset

When a new asset has been registered

peer_connected

When a new peer is connected with the node.

peer_disconnected

When a peer is disconnected from the node.

peer_state_updated

When a peer state is updated.

peer_peer_list_updated

When a peer list of a peer has been updated.

peer_peer_disconnected

When a peer from the peer list is disconnected.