Quaiscan
  • Quaiscan Open-Source Explorer
  • 🙎Using Quaiscan
    • Getting Started
      • Glossary of Terms
      • Main Menu
      • Blocks
      • Transaction Types
    • Token Support
      • ERC-1155 Support
  • 👩‍💻Developer Support
    • Quaiscan API
      • REST API Endpoints
      • GraphQL
      • JSON RPC & Quai Compatible RPC Endpoints
        • Account
        • Block
        • Contract
        • Logs
        • Stats
        • Token
        • Transaction
        • Quai RPC API
    • Smart Contract Verification
      • Quaiscan UI
      • Quaiscan smart-contract verification API
      • Hardhat Verification Plugin
    • Local Deployment
  • FAQs
    • User FAQs
    • Developer FAQs
  • 🧩Resources
    • Media kit
    • Release Notes
      • v1.0.0
    • Discussion
    • GitHub Repo
Powered by GitBook
On this page
  • quai_blockNumber
  • quai_getBalance
  • More examples
Export as PDF
  1. Developer Support
  2. Quaiscan API
  3. JSON RPC & Quai Compatible RPC Endpoints

Quai RPC API

PreviousTransactionNextSmart Contract Verification

Last updated 7 months ago

In addition to the custom , the Quaiscan Quai RPC API supports most used methods in the exact format specified for Quai Network nodes, see the 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 for more examples and info on the remaining methods.

👩‍💻
RPC endpoints documented here
Quai Network JSON-RPC Specification
Quai Network JSON-RPC Specification