Quai RPC API

In addition to the custom RPC endpoints documented here, the Quaiscan Quai RPC API supports most used methods in the exact format specified for Quai Network nodes, see the Quai Network JSON-RPC Specification for more details.

These methods are provided for your convenience and are most suitable as a fallback option in your JSON RPC API providers. For other use cases, REST or custom RPC methods are recommended.

The following methods are supported:

  • quai_blockNumber

  • quai_getBalance

  • quai_getLogs

  • quai_gasPrice

  • quai_getTransactionByHash

  • quai_getTransactionReceipt

  • quai_chainId

  • quai_maxPriorityFeePerGas

  • quai_getTransactionCount

  • quai_getCode

  • quai_getStorageAt

  • quai_estimateGas

  • quai_getBlockByNumber

  • quai_getBlockByHash

  • quai_sendRawTransaction

  • quai_call

In the following examples we use the Quai Network mainnet with the base instance url https://quaiscan.io. When sending a request add /api/eth-rpc to the end of the base url.

quai_blockNumber

Returns the latest block number in the chain in hexidecimal format. No params are needed. Type: POST

Example

// Request
curl -H "content-type: application/json" -X POST --data '{"id":0,"jsonrpc":"2.0","method":"quai_blockNumber","params":[]}' https://quaiscan.io/api/eth-rpc
// Response
{
  "jsonrpc": "2.0",
  "result": "0xfa0b0e",
  "id": 0
}

quai_getBalance

Returns the balance of a given address in its. Note the earliest parameter does not work as expected because genesis block balances are not currently imported. Parameters are required.

Required Parameters

Type

POST

Data (string)

20 Byte address to check balance

Quantity or Tag (string)

Integer value of a block number, or a tag "latest" for the most recent block.

Example

// Request
curl -H "content-type: application/json" -X POST --data '{"id":0,"jsonrpc":"2.0","method":"quai_getBalance","params":["0x005f644097F8f0E9f996Dca4F4F23aBB6C1Cc8b3","latest"]}' https://quaiscan.io/api/eth-rpc
// Response
{
  "jsonrpc": "2.0",
  "result": "0x1d863bf76508104fb", //34039260923474019579
  "id": 0
}

More examples

Refer to the Quai Network JSON-RPC Specification for more examples and info on the remaining methods.

Last updated