Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

LayerZero Scan

The SDK includes a LayerZero Scan module for tracking cross-chain messages. This is useful for building transaction history UIs, monitoring bridge progress, and decoding OFT (Omnichain Fungible Token) payloads.

This module is also what the official frontend (develop-sdk) uses; LayerZero tracking logic was moved out of frontend-only services into this shared SDK surface.

Overview

When zERC20 tokens are transferred cross-chain (e.g., cross-chain unwrap via Stargate), the transaction goes through LayerZero's messaging protocol. The LayerZero Scan module provides:

  • API client -- Query the LayerZero Scan API for wallet messages and transaction messages

  • Payload decoding -- Decode OFT send() calldata, compose messages, and bridge requests

  • Status orchestration -- High-level fetchWalletStatus() that fetches, filters, and decodes all messages for a wallet

Configuration

The module requires a LayerZeroScanConfig object instead of reading from environment variables. This allows framework-agnostic usage:

import type { LayerZeroScanConfig } from "@zerc20/client-sdk";

const scanConfig: LayerZeroScanConfig = {
  baseUrl: "https://scan.layerzero-api.com",
  apiKey: "your-api-key",  // optional
};

Fetch Wallet Status

The primary entry point. Fetches all LayerZero messages for a wallet, filters by token, and decodes payloads:

FetchWalletStatusParams

Field
Type
Required
Description

address

string

Yes

Wallet address to query

tokens

TokenEntry[]

Yes

Token configuration for filtering and decoding

scanConfig

LayerZeroScanConfig

Yes

API base URL and optional API key

createReadProvider

(token: TokenEntry) => EvmReadProvider

Yes

Factory to create read providers per token

limit

number

No

Messages per page (default: 25)

nextToken

string

No

Pagination cursor from a previous response

filterByToken

boolean

No

Filter messages to only those involving the configured tokens

WalletStatusResult

Field
Type
Description

items

LayerZeroMessageSummary[]

Decoded message summaries

nextToken

string | undefined

Pagination cursor for the next page

walletUrl

string

LayerZero Scan URL for this wallet

LayerZeroMessageSummary

Each decoded message contains:

Field
Type
Description

guid

string

Unique message identifier

pathway

object

Source and destination chain info (src, dst, nonce, srcEid, dstEid)

sourceTx

string

Source transaction hash

sourceBlock

string

Source block info

destinationTx

string | undefined

Destination transaction hash (once delivered)

send

SendPayloadSummary | null

Decoded send payload (amounts, addresses)

composeFollowups

ComposeFollowupSummary[]

Compose message follow-ups (e.g., bridge requests)

status

string

Message status (e.g., "DELIVERED", "INFLIGHT")

raw

LayerZeroScanMessage

Original API response

Low-Level API

Scan API Client

Query the LayerZero Scan API directly:

Payload Decoding

Decode OFT send payloads and compose messages:

Formatting Utilities

See Also

Last updated