Skip to content

Moonbeam Custom API

Finality RPC Endpoints

Moonbeam node has added support for two custom JSON-RPC endpoints, moon_isBlockFinalized and moon_isTxFinalized, that are useful for checking whether an on-chain event is finalized. The information on these two endpoints are as follows:

Variable Value
Endpoint moon_isBlockFinalized
Description Check for the finality of the block given by its block hash
Parameters block_hash: STRING The hash of the block, accepts either Substrate-style or Ethereum-style block hash as its input
Returns result: BOOLEAN Returns true if the block is finalized, false if the block is not finalized or not found
Variable Value
Endpoint moon_isTxFinalized
Description Check for the finality of the transaction given by its EVM tx hash
Parameters tx_hash: STRING The EVM tx hash of the transaction
Returns result: BOOLEAN Returns true if the tx is finalized; false if the tx is not finalized or not found

You can try out these endpoints with the following curl examples. These examples query the public RPC endpoint of Moonbase Alpha, but they can be modified to use with Moonbeam and Moonriver by changing the URL of the RPC endpoint to use your own endpoint and API key which you can get from one of the supported Endpoint Providers.

curl -H "Content-Type: application/json" -X POST --data '[
  {
    "jsonrpc": "2.0",
    "id": "1",
    "method": "moon_isBlockFinalized",
    "params": ["INSERT_BLOCK_HASH"]
  }
]'
https://rpc.api.moonbase.moonbeam.network
curl -H "Content-Type: application/json" -X POST --data '[
  {
    "jsonrpc": "2.0",
    "id": "1",
    "method": "moon_isTxFinalized",
    "params": ["INSERT_TX_HASH"]
  }
]'
https://rpc.api.moonbase.moonbeam.network
Last update: January 23, 2024
| Created: March 14, 2022