Skip to content

Highlayer HTTP API

Highlayer sequencer/node expose RESTful API for interacting with highlayer and reading state of contracts, balances etc.

This document provides overview of exposed HTTP endpoints, also acting as a reference/standard for implementing custom nodes.

Please note that most of the structured values are returned in Msgpack format unless explicitly specified otherwise.

Sequencer API

This section describes endpoints exposed by the highlayer sequencer. You can find sequencer endpoint in magic values.

Fetch transaction by sequencer transaction index

GET /ledger/$sequencerTxIndex

The sequencer assigns a unique number to each transaction it processes in incremental order (if index 2 exists, index 1 must exist too).

Returns Transaction

Fetch available deposit on sequencer

GET /depositBalance/$address

Fetch current balance on highlayer sequencer.

It is useful when needed to estimate if a current deposit is enough for the transaction to be accepted by the sequencer.

Returns Alans

See Depositing to sequencer for more details.

Post transaction to highlayer

POST /tx

Posts transaction to sequencer.

Required headers:

Header nameHeader value
Content-Typeapplication/vnd.msgpack
Content-LengthByte length of transaction

Body must be Transaction in encoded form with valid signature provided.

Fetch pricing per byte

GET /sequencerPrices

Fetches the price that the sequencer will charge per byte of uploaded transaction.

Returns
KeyValue
feePerByteAlans

Highlayerd node API

This section describes endpoints exposed by the highlayer's highlayerd node. You can find public node endpoint in magic values or host your own node.

Fetch network/node info

GET /info

Gives overview of network that highlayerd node is running.

Returns
KeyValue
network(Name).(T/M/B for testnet, mainnet, betanet)/(version), i.e "Highlayer.T/0.4"

Recommended cache level (for node operators): 1 second

Fetch account KV pair

GET /kv/$account:$key

Fetches account's KV store value with provided key.

Returns

Msgpack representation of value.

Recommended cache level (for node operators): 10 seconds

Fetch data blob uploaded to highlayer

GET /data/$dataId

Fetches data blob with provided data ID.

Returns

Binary

Recommended cache level (for node operators): Full

Fetch balance

GET /balance/$address

Fetches HI/tHI balance of an address.

Returns

Alans

Recommended cache level (for node operators): 10 seconds

Fetch transaction

GET /tx/$id

Fetches raw, encoded transaction by txID. Signed by the sequencer.

Returns

Transaction

Recommended cache level (for node operators): Full

POST /calculateTxGas

Ask node to calculate gas for your transaction's actions (without gas consumed by smart contracts executed).

Required headers:

Header nameHeader value
Content-Typeapplication/vnd.msgpack
Content-LengthByte length of transaction

Body must be Transaction in encoded form WITHOUT signature provided.

Returns
KeyValue
gasString of digits. Must be positive for transaction to be executed by network.

Recommended cache level (for node operators): None