LogoLogo
  • ⏩Introduction
    • Hyperlane Introduction
    • Getting started
    • Why Should You Use Hyperlane?
  • Permissionless Interoperability
    • Overview
    • Deploy Hyperlane
    • Warp Routes
      • Deploy a Warp Route
      • Deploy a UI for your Warp Route
    • Modular Rollup Interoperability
  • Build With Hyperlane
    • Quickstarts
      • Messaging
      • Accounts
      • Queries
      • hyperlane-quickstart repo
    • Guides
      • Finding my messages
      • Automatically pay for interchain gas
      • Manually pay for interchain gas
      • Choosing an interchain gas paymaster contract
      • Unit testing
      • Specifying an ISM
      • V2 migration guide
    • Explorer
      • Debugging messages
      • Configuring PI Chains
      • REST API
      • GraphQL API
    • Troubleshooting/Developer FAQ
    • Example apps
  • APIs and SDKs
    • Messaging API
      • Send
      • Receive
    • Accounts API
    • Queries API
    • Warp Route API
    • Interchain gas paymaster API
    • Hyperlane App Framework
      • Example usage
        • HelloWorld
        • Interchain Token
      • Solidity SDK
        • HyperlaneConnectionClient
        • Router
      • NodeJS SDK
        • RPC Providers
        • Deployment
        • Interchain testing
        • Quoting gas payments
        • App Abstraction
    • Hooks API
      • Contract addresses
  • Protocol
    • Overview
    • Mailbox
    • Interchain security modules
      • Interface
      • Multisig ISM
      • Routing ISM
      • Aggregation ISM
      • Optimistic ISM
      • Wormhole ISM
      • Hook ISM
      • CCIP-Read ISM
    • Interchain gas payments
    • Staking and slashing
    • Agents
      • Validators
      • Relayers
      • Watchtowers
    • Warp Routes
    • Implementation Guide
  • Operators
    • Validators
      • Guide
      • AWS setup
      • Monitoring and alerting
    • Relayers
      • Guide
      • Message filtering
    • Agent keys
      • Hexadecimal keys
      • AWS KMS keys
    • Agent configuration
      • Configuration reference
    • Running with docker compose
  • Resources
    • FAQ
    • Glossary
    • Contract addresses
      • Permissionless Deployment Contract Addresses
    • Domain identifiers
      • Permissionless Domain Identifiers
    • Default ISM settings
    • Coming Soon: Hyperlane v3
    • Token sources & faucets
    • Latencies
    • Github
    • Discord
    • Website
Powered by GitBook
On this page
  • Example Query
  • API Reference
  • APIs for Permissionless Interoperability chains
  1. Build With Hyperlane
  2. Explorer

REST API

Retrieve info about messages using REST Queries

PreviousConfiguring PI ChainsNextGraphQL API

Last updated 2 years ago

The Hyperlane agents collect useful information about activity on the system, including all messages. That data can be queried via the APIs.

The APIs are currently available free of charge and without any required authentication.

Connect your preferred fetch client or library to to query data!

Example Query

Request

const baseUrl = 'https://explorer.hyperlane.xyz/api'
const action = 'module=message&action=get-messages'
const messageId = '62d30bde22af368e43f981f65186ff2c2b895a09774a9397f815dcc366793875'
const url =`${baseUrl}?${action}&id=${messageId}`;
const response = await fetch(url, {
  method: "GET",
  headers: { "Content-Type": "application/json" },
});
const data = await response.json();

Response

{
  "status": "1",
  "message": "OK",
  "result": [
    {
      "id": "62d30bde22af368e43f981f65186ff2c2b895a09774a9397f815dcc366793875",
      "status": "delivered",
      "sender": "0x854fd51c04408ad84da3838a4ff7282522f7866e",
      "recipient": "0x1c847335d123632fc7d662ab87ac7872acd920f2",
      "originDomainId": 80001,
      "destinationDomainId": 43113,
      "nonce": 613,
      "body": "0x48656c6c6f21",
      "originTransaction": {
        "from": "0x06c8798aa665bdbeea6aba6fc1b1d9bbdca8d613",
        "transactionHash": "0x8359f6c022a1e164e052f2a106c8f67a222c7e2355ded825c4112486510cdb80",
        "blockNumber": 30789012,
        "gasUsed": 100813,
        "timestamp": 1673373764000
      },
      "destinationTransaction": {
        "from": "0x0a1a869dc7f56c9fd4276b0568fd232a07d88e83",
        "transactionHash": "0x439ae6fbbd768404166ef31a08ade52d4659f9843ac490203b90406661b5001b",
        "blockNumber": 17884981,
        "gasUsed": 153381,
        "timestamp": 1673373842000
      }
    }
  ]
}

API Reference

Module: Message

Action: get-message, Parameter (1 required):

  • id: message id (string)

  • sender: address of message sender (string)

  • recipient: address of message recipient (string)

  • origin-tx-hash: hash of origin transaction (string)

  • origin-tx-sender: address of origin tx sender (string)

  • destination-tx-hash: hash of destination transaction (string)

  • destination-tx-sender: address of destination tx sender (string)

Action: get-status Parameter (1 required):

  • Same as get-message above

Action: search-messages, Parameter (1 required):

  • query: address or hash to search (string)

APIs for Permissionless Interoperability chains

const chainConfig = {
  "chainId": 1234,
  "name": "mychain",
  "publicRpcUrls": [{ "http": "https://myRpcUrl.com" }],
  "blockExplorers": [ {
      "name": "MyChainScan",
      "url": "https://myChainExplorer.com",
      "apiUrl": "https://myChainExplorer.com/api",
      "apiKey": "12345"
  } ],
  "contracts": {
    "mailbox": "0x123..."
  }
}

const baseUrl = 'https://explorer.hyperlane.xyz/api'
const action = 'module=message&action=search-pi-messages'
const query = '62d30bde22af368e43f981f65186ff2c2b895a09774a9397f815dcc366793875'
const url =`${baseUrl}?${action}&query=${query}`;
const response = await fetch(url, {
  method: "POST",
  body: JSON.stringify(chainConfig),
  headers: { "Content-Type": "application/json" },
});
const data = await response.json();

Chain Config Schema

Hyperlane can be to any chain, but messages on PI chains cannot be identified by the default Hyperlane agents. To view details about messages from PI chains, query the search-pi-messages action. The search requires a chain config in the request body. Note, this same functionality is also available in the .

The chain config schema is an extension of the Hyperlane SDK's but with a contracts object added. See for more details about this config object.

Explorer API page
permissionlessly deployed
explorer UI
ChainMetadata schema
Configuring PI Chains