Xar Network (3.0)

Download OpenAPI specification:Download

A REST interface for state queries, transaction generation and broadcasting.

node

Basic node info and health statistics

The properties of the connected node

Information about the connected node

Responses

200

Node status

500

Failed to query node status

get /node_info
https://node.xar.network/node_info

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "node_info":
    {
    },
  • "application_version":
    {
    }
}

Syncing state of node

Get if the node is currently syning with other nodes

Responses

200

"true" or "false"

500

Server internal error

get /syncing
https://node.xar.network/syncing

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "syncing": true
}

blockchain

APIs, such as query blocks, transactions and validatorset

Get the latest block

Responses

200

The latest block

500

Server internal error

get /blocks/latest
https://node.xar.network/blocks/latest

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "block_meta":
    {
    },
  • "block":
    {
    }
}

Get a block at a certain height

path Parameters
height
required
number
Example: 1

Block height

Responses

200

The block at a specific height

400

Invalid height

404

Request block height doesn't

500

Server internal error

get /blocks/{height}
https://node.xar.network/blocks/{height}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "block_meta":
    {
    },
  • "block":
    {
    }
}

Get the latest validator set

Responses

200

The validator set at the latest block height

500

Server internal error

get /validatorsets/latest
https://node.xar.network/validatorsets/latest

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "height": 0,
  • "result":
    {
    }
}

Get a validator set a certain height

path Parameters
height
required
number
Example: 1

Block height

Responses

200

The validator set at a specific block height

400

Invalid height

404

Block at height not available

500

Server internal error

get /validatorsets/{height}
https://node.xar.network/validatorsets/{height}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "height": 0,
  • "result":
    {
    }
}

transactions

Query and send transactions

Get a Tx by hash

path Parameters
hash
required
string
Example: 6E307745D8D12D3D20EB0BB9F8F07A584731769DB922F4B649CD30478510A056

Tx hash

Responses

200

Tx with the provided hash

500

Internal Server Error

get /txs/{hash}
https://node.xar.network/txs/{hash}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "height": 157807,
  • "txhash": "6E307745D8D12D3D20EB0BB9F8F07A584731769DB922F4B649CD30478510A056",
  • "raw_log":
    [
    ],
  • "logs":
    [
    ],
  • "gas_wanted": 200000,
  • "gas_used": 42082,
  • "tx":
    {