Skip to main content
Version: 1.14.0

Abstract Interface: Chain<F extends ChainFamily = ChainFamily>

Defined in: chain.ts:873

Works like an interface for a base Chain class, but provides implementation (which can be specialized) for some basic methods

Extended by​

Type Parameters​

Type ParameterDefault type
F extends ChainFamilyChainFamily

Indexable​

[key: symbol]: () => string

Properties​

abort​

readonly abort: AbortSignal

Defined in: chain.ts:890

Fires when the chain should tear down: either Chain.destroy was called, or the ChainContext abort signal fired. Listeners registered with { once: true } therefore self-unregister on whichever condition happens first, so no listener ever outlives its chain on a long-lived context.


apiClient​

readonly apiClient: CCIPAPIClient | null

Defined in: chain.ts:877

CCIP API client (null if opted out)


apiRetryConfig​

readonly apiRetryConfig: Required<ApiRetryConfig> | null

Defined in: chain.ts:879

Retry configuration for API fallback operations (null if API client is disabled)


destroy​

destroy: (reason?: unknown) => void

Defined in: chain.ts:942

Cleanup method to release resources (e.g., close connections).

Parameters​

ParameterType
reason?unknown

Returns​

void


logger​

logger: Logger

Defined in: chain.ts:875


network​

readonly network: NetworkInfo<F>

Defined in: chain.ts:874


verificationsIndexer?​

readonly optional verificationsIndexer?: readonly string[]

Defined in: chain.ts:881

Default CCIP v2 indexer base URLs for getVerifications (undefined → network defaults)


verifierTransport?​

readonly optional verifierTransport?: VerifierTransport

Defined in: chain.ts:883

Transport for direct verifier reads (undefined → grpc-web over fetch)

Methods​

estimateReceiveExecution()?​

optional estimateReceiveExecution(opts: { message: Omit<EstimateMessageInput, "onRampAddress" | "offRampAddress">; offRamp: string; } | { messageId: string; }): Promise<number>

Defined in: chain.ts:2657

Estimate ccipReceive execution cost (gas, computeUnits) for this destination chain.

Parameters​

ParameterTypeDescription
opts{ message: Omit<EstimateMessageInput, "onRampAddress" | "offRampAddress">; offRamp: string; } | { messageId: string; }Either: - { offRamp, message } — estimate from message fields directly. message must include sourceChainSelector, messageId, receiver, and optionally sender, data, destTokenAmounts. - { messageId } — fetch the message from the CCIP API via getMessageById, resolve the offRamp from the message metadata or getExecutionInput, then estimate. Requires apiClient to be available.

Returns​

Promise<number>

Estimated execution cost (gas for EVM, compute units for Solana)


execute()​

abstract execute(opts: ExecuteOpts & { wallet: unknown; }): Promise<CCIPExecution>

Defined in: chain.ts:1899

Execute messages in report in an offRamp.

Parameters​

ParameterTypeDescription
optsExecuteOpts & { wallet: unknown; }ExecuteOpts with chain-specific wallet to sign and send tx.

Returns​

Promise<CCIPExecution>

Promise resolving to transaction of the execution.

Throws​

CCIPWalletNotSignerError if wallet is not a valid signer.

Throws​

CCIPExecTxNotConfirmedError if execution transaction fails to confirm.

Throws​

CCIPExecTxRevertedError if execution transaction reverts.

Throws​

CCIPMerkleRootMismatchError if merkle proof is invalid.

Examples​

Manual execution using message ID (simplified, requires API)

TypeScript
const receipt = await dest.execute({ messageId: '0x...', wallet })

Manual execution using transaction hash

TypeScript
const input = await source.getExecutionInput({ request, verifications })
const receipt = await dest.execute({ offRamp, input, wallet })

fetchCCVResults()​

protected fetchCCVResults(messageId: string, policy: VerificationPolicy, opts: { indexer?: NetworkType | readonly string[]; offRamp: string; request: { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { blockTimestamp: number; }; message: { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">): Promise<VerifierResult[]>

Defined in: chain.ts:1983

Collect a CCIP v2.0 message's CCV results against the destination policy, from every source: opts.ccvData, then the CCIP API raced against the indexers, then opts.verifiers (read via ChainContext.verifierTransport). For families' getVerifications implementations.

Parameters​

ParameterTypeDescription
messageIdstringThe message id
policyVerificationPolicyThis destination's CCV policy for the message
opts{ indexer?: NetworkType | readonly string[]; offRamp: string; request: { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { blockTimestamp: number; }; message: { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">The getVerifications options

Returns​

Promise<VerifierResult[]>

The results covering policy

Throws​

CCIPMessageNotVerifiedYetError if the sources can't cover policy


generateUnsignedExecute()​

abstract generateUnsignedExecute(opts: ExecuteOpts & { payer: string; }): Promise<UnsignedTx[F]>

Defined in: chain.ts:1871

Generate unsigned tx to manuallyExecute a message.

Parameters​

ParameterTypeDescription
optsExecuteOpts & { payer: string; }ExecuteOpts with payer address which will send the exec tx

Returns​

Promise<UnsignedTx[F]>

Promise resolving to chain-family specific unsigned txs

Example​

Generate unsigned execution tx

TypeScript
const unsignedTx = await dest.generateUnsignedExecute({
offRamp: offRampAddress,
input,
payer: walletAddress,
})
// Sign and send with external wallet

generateUnsignedSendMessage()​

abstract generateUnsignedSendMessage(opts: SendMessageOpts & { sender: string; }): Promise<UnsignedTx[F]>

Defined in: chain.ts:1681

Generate unsigned txs for ccipSend'ing a message.

Parameters​

ParameterTypeDescription
optsSendMessageOpts & { sender: string; }SendMessageOpts with sender address

Returns​

Promise<UnsignedTx[F]>

Promise resolving to chain-family specific unsigned txs

Example​

Generate unsigned transaction

TypeScript
const unsignedTx = await chain.generateUnsignedSendMessage({
router: routerAddress,
destChainSelector: destSelector,
message: { receiver: '0x...', data: '0x1337' },
sender: walletAddress,
})
// Sign and send with external wallet

getBalance()​

abstract getBalance(opts: GetBalanceOpts): Promise<bigint>

Defined in: chain.ts:1495

Query token balance for an address.

Parameters​

ParameterTypeDescription
optsGetBalanceOptsBalance query options

Returns​

Promise<bigint>

Token balance information including raw and formatted values

Throws​

CCIPNotImplementedError if chain family doesn't support this method

Examples​

Query native token balance

TypeScript
const balance = await chain.getBalance({ holder: '0x123...' })
console.log(`Native balance: ${balance}`) // balance in wei

Query ERC20 token balance

TypeScript
const balance = await chain.getBalance({
holder: '0x123...',
token: '0xLINK...'
})
console.log(`LINK balance: ${balance}`) // balance in smallest units

getBlockInfo()​

abstract getBlockInfo(block: number | bigint | "finalized" | "latest"): Promise<BlockInfo>

Defined in: chain.ts:963

Fetch info (number and timestamp) for a given block or finality tag.

Parameters​

ParameterTypeDescription
blocknumber | bigint | "finalized" | "latest"Block number, or tag like 'finalized' or 'latest'

Returns​

Promise<BlockInfo>

Block info with number and timestamp

Throws​

CCIPBlockNotFoundError if block does not exist

Example​

Get finalized block info

TypeScript
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
const info = await chain.getBlockInfo('finalized')
console.log(`Finalized block ${info.number} at ${new Date(info.timestamp * 1000).toISOString()}`)

getBlockTimestamp()​

getBlockTimestamp(block: number | bigint | "finalized" | "latest"): Promise<number>

Defined in: chain.ts:971

Fetch the timestamp of a given block.

Parameters​

ParameterTypeDescription
blocknumber | bigint | "finalized" | "latest"Block number or finality tag

Returns​

Promise<number>

Unix timestamp in seconds

Deprecated​

Use Chain.getBlockInfo instead.


getExecutionInput()​

getExecutionInput(opts: { request: CCIPRequest; verifications: CCIPVerifications; } & Pick<LogFilter, "page">): Promise<ExecutionInput>

Defined in: chain.ts:1240

Fetch input data needed for executing messages Should be called on the source instance

Parameters​

ParameterTypeDescription
opts{ request: CCIPRequest; verifications: CCIPVerifications; } & Pick<LogFilter, "page">getExecutionInput options containing request and verifications

Returns​

Promise<ExecutionInput>

input payload to be passed to execute

See​

execute - method to execute a message


getExecutionReceipts()​

getExecutionReceipts(opts: { messageId?: string; offRamp: string; sequenceNumber?: bigint; sourceChainSelector?: bigint; verifications?: CCIPVerifications; } & Pick<LogFilter, "startBlock" | "startTime" | "watch" | "page" | "since">): AsyncIterableIterator<CCIPExecution>

Defined in: chain.ts:2160

Default/generic implementation of getExecutionReceipts. Yields execution receipts for a given offRamp.

Parameters​

ParameterTypeDescription
opts{ messageId?: string; offRamp: string; sequenceNumber?: bigint; sourceChainSelector?: bigint; verifications?: CCIPVerifications; } & Pick<LogFilter, "startBlock" | "startTime" | "watch" | "page" | "since">getExecutionReceipts options

Returns​

AsyncIterableIterator<CCIPExecution>

Async generator of CCIPExecution receipts

Example​

Watch for execution receipts

TypeScript
for await (const exec of dest.getExecutionReceipts({
offRamp: offRampAddress,
messageId: request.message.messageId,
startBlock: commit.log.blockNumber,
})) {
console.log(`State: ${exec.receipt.state}`)
if (exec.receipt.state === ExecutionState.Success) break
}

getFee()​

abstract getFee(opts: Omit<SendMessageOpts, "approveMax">): Promise<bigint>

Defined in: chain.ts:1663

Fetch the current fee for a given intended message.

Parameters​

ParameterTypeDescription
optsOmit<SendMessageOpts, "approveMax">SendMessageOpts without approveMax

Returns​

Promise<bigint>

Fee amount in the feeToken's smallest units

Example​

Calculate message fee

TypeScript
const fee = await chain.getFee({
router: routerAddress,
destChainSelector: destSelector,
message: { receiver: '0x...', data: '0x' },
})
console.log(`Fee: ${fee} wei`)

getFeeTokens()​

abstract getFeeTokens(router: string): Promise<Record<string, TokenInfo>>

Defined in: chain.ts:2465

Fetch list and info of supported feeTokens.

Parameters​

ParameterTypeDescription
routerstringRouter address on this chain

Returns​

Promise<Record<string, TokenInfo>>

Promise resolving to mapping of token addresses to TokenInfo objects

Example​

Get available fee tokens

TypeScript
const feeTokens = await chain.getFeeTokens(routerAddress)
for (const [addr, info] of Object.entries(feeTokens)) {
console.log(`${info.symbol}: ${addr}`)
}

getLaneFeatures()​

getLaneFeatures(opts: { destChainSelector: bigint; router: string; token?: string; }): Promise<Partial<LaneFeatures>>

Defined in: chain.ts:2089

Retrieve features for a lane (router/destChainSelector/token triplet).

Parameters​

ParameterType
opts{ destChainSelector: bigint; router: string; token?: string; }
opts.destChainSelectorbigint
opts.routerstring
opts.token?string

Returns​

Promise<Partial<LaneFeatures>>

Promise resolving to partial lane features record

Throws​

CCIPNotImplementedError if not implemented for this chain family

Example​

Get lane features

TypeScript
const features = await chain.getLaneFeatures({
router: '0x...',
destChainSelector: 4949039107694359620n,
})
// FINALITY_FAST has three states:
// - undefined: FTF is not supported on this lane (pre-v2.0)
// - 0: the lane supports FTF, but it is not enabled for this token
// - > 0: FTF is enabled with this many block confirmations
const ftf = features[LaneFeature.FINALITY_FAST]
if (ftf != null && ftf > 0) {
console.log(`FTF enabled with ${ftf} block confirmations`)
} else if (ftf === 0) {
console.log('FTF supported on this lane but not enabled for this token')
}

getLaneLatency()​

getLaneLatency(destChainSelector: bigint, numberOfBlocks?: number): Promise<LaneLatencyResponse>

Defined in: chain.ts:2048

Fetches estimated lane latency to a destination chain. Uses this chain's selector as the source.

Parameters​

ParameterTypeDescription
destChainSelectorbigintDestination CCIP chain selector (bigint)
numberOfBlocks?numberOptional number of block confirmations to use for latency calculation. When omitted or 0, uses the lane's default finality. When provided as a positive integer, the API returns latency for that custom finality value.

Returns​

Promise<LaneLatencyResponse>

Promise resolving to LaneLatencyResponse containing:

  • totalMs - Estimated delivery time in milliseconds

Throws​

CCIPApiClientNotAvailableError if apiClient was disabled (set to null)

Throws​

CCIPLaneLatencyInsufficientDataError if the API has too little history for the lane

Throws​

CCIPHttpError if API request fails (network error, 4xx, 5xx status)

Remarks​

Each call makes a fresh API request. Consider caching results if making frequent calls for the same lane.

Examples​

Get estimated delivery time

TypeScript
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
try {
const latency = await chain.getLaneLatency(4949039107694359620n) // Arbitrum
console.log(`Estimated delivery: ${Math.round(latency.totalMs / 60000)} minutes`)
} catch (err) {
if (err instanceof CCIPHttpError) {
console.error(`API error: ${err.context.apiErrorCode}`)
}
}

Get latency with custom block confirmations

TypeScript
const latency = await chain.getLaneLatency(4949039107694359620n, 10)
console.log(`Latency with 10 confirmations: ${Math.round(latency.totalMs / 60000)} minutes`)

getLogs()​

abstract getLogs(opts: { address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; since?: { blockTimestamp?: number | bigint; }; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; }): AsyncIterableIterator<{ blockTimestamp: number; data: Record<string, unknown> | BytesLike; tx?: { blockNumber: number; error?: unknown; from: string; hash: string; logs?: readonly { transactionHash: string; blockNumber: number; address: string; topics: readonly string[]; index: number; blockTimestamp: number; data: Record<string, unknown> | BytesLike; tx?: { hash: string; ... 4 more ...; logs?: readonly ...[] | undefined; } | undefined; }[]; timestamp: number; }; }>

Defined in: chain.ts:1075

An async generator that yields logs based on the provided options.

Parameters​

ParameterTypeDescription
opts{ address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; since?: { blockTimestamp?: number | bigint; }; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; }Options object containing: - startBlock: fetch and generate logs forward starting from this block; required unless startTime is provided; explicit 0 is allowed - startTime: instead of a startBlock, a start timestamp may be provided; if either is provided, fetch logs forward from this starting point - since: a previous log (preferably the last finalized from a previous call), as log cursor; may be more efficient in some chains for paginating, and may replace startTime or startBlock - endBlock: a fixed block height, finality tag or negative finality depth to stop iteration at; defaults to latest - endBefore: optional hint signature for end of iteration, instead of endBlock - address: if provided, fetch logs for this address only (may be required in some networks/implementations) - topics: if provided, fetch logs for these topics only; if string[], it's assumed to be a list of topic0s (i.e. string[] or string[][0], event_ids); some networks/implementations may not be able to filter topics other than topic0s, so one may want to assume those are optimization hints, instead of hard filters, and verify results - page: if provided, try to use this page/range for batches - watch: true or cancellation promise, stream logs after initial catch-up until endBlock finality tag (e.g. 'finalized'); requires endBlock to be a finality tag
opts.address?stringContract address to filter logs by.
opts.endBefore?stringCursor hint for the exclusive upper end of iteration on chains that support it.
opts.endBlock?number | bigint | "finalized" | "latest"Ending block number (inclusive).
opts.page?number | bigintPage size for pagination.
opts.since?{ blockTimestamp?: number | bigint; }Resume hint: the last log emitted by a previous getLogs call on the same address/filter. Any subset of fields may be provided; each chain uses what it can. Two layers of behavior: 1. Start floors (ALL chains — see withSinceStart): blockNumber and blockTimestamp stand in for startBlock/startTime — each effective floor is the LARGER of the explicitly requested bound and the hint's — so a since carrying either satisfies the start requirement on its own. Blocks/versions are always fetched and emitted complete. 2. Block completeness: all chains implementations must guarantee all logs in some block are yielded in the same call before it returns. 3. Exclusive resume (chains with a native per-log cursor): the hinted log itself is NOT re-emitted, and other logs in the same block/tx may also not be; some chains may attempt to yield logs in the same block or transaction, but from 2., the contract guarantees only that logs from the next block or tx on are emitted, so for an hermetic poller, it's safer to only ever pass the last finalized log in the previous call as since hint. The hint only ever RAISES the start floors — startBlock is the scan floor (the scan never starts below it) and, when a startBlock exists, startTime is evaluated at filter-time just before emitting. A stale, foreign or malformed hint may be ignored (the usual walk runs). At-least-once is the only guarantee all families share: dedupe by (transactionHash, index). Cursors are FILTER-SCOPED: a hint produced by a NARROWER filter must never be replayed on a wider one. Where the cursor is a per-block prefix (EVM), the wider filter's earlier-index logs in the hinted block count as already emitted and are SKIPPED — a loss, not a duplicate. The SDK cannot validate this: the hint carries the log's own topics, never the breadth of the filter that produced it, so a wide sweep and a narrow one over the same block hand out a byte-identical hint while requiring opposite resume behavior (an address mismatch IS detectable and is rejected; a topic-subset resume is not). Key each cursor by the filter that produced it, and start a new filter from its own startBlock. Per-family resume — EVM/Solana/TON: the hinted block/tx streams whole and logs at/before the hinted index are skipped (later same-block/same-tx logs still flow; TON floors its v3 /messages fast path at the hint's created_lt). Aptos: event index on single-topic streams, blockNumber + 1 on multi-topic ones. Sui: inclusive checkpoint floors (re-delivered). Canton: unsupported.
opts.since.blockTimestamp?number | bigint-
opts.startBlock?number | bigintStarting block number (inclusive). Required unless startTime is provided; explicit 0 is allowed.
opts.startTime?number | bigintStarting Unix timestamp (inclusive).
opts.topics?(string | string[] | null)[]Topics to filter logs by.
opts.typeAndVersions?readonly (string | RegExp)[]Restrict logs to contracts whose Chain.typeAndVersion matches any of these. Useful when filtering by topic alone (no address) would otherwise match logs from many unrelated contract types — e.g. ConfigSet is emitted by OnRamp, OffRamp, CommitStore, FeeQuoter, TokenPool, and PriceRegistry alike. Pass e.g. ['OnRamp'] to keep only on-ramps. See passesTypeAndVersion for the exact matching rule. undefined/empty means no restriction (default), and costs nothing — typeAndVersion is never called.
opts.watch?boolean | AbortSignalwatch mode: polls for new logs after fetching since start (required), until endBlock finality tag (e.g. endBlock=finalized polls only finalized logs); can be an AbortSignal to cancel loop

Returns​

AsyncIterableIterator<{ blockTimestamp: number; data: Record<string, unknown> | BytesLike; tx?: { blockNumber: number; error?: unknown; from: string; hash: string; logs?: readonly { transactionHash: string; blockNumber: number; address: string; topics: readonly string[]; index: number; blockTimestamp: number; data: Record<string, unknown> | BytesLike; tx?: { hash: string; ... 4 more ...; logs?: readonly ...[] | undefined; } | undefined; }[]; timestamp: number; }; }>

An async iterable iterator of logs.

Throws​

CCIPLogsWatchRequiresFinalityError if watch mode is used without a finality endBlock tag

Throws​

CCIPLogsRequiresStartError if used without startBlock or startTime

Throws​

CCIPLogsAddressRequiredError if address is required but not provided (chain-specific)


getMessageById()​

getMessageById(messageId: string, _opts?: { onRamp?: string; page?: number; }): Promise<CCIPRequest<CCIPVersion>>

Defined in: chain.ts:1188

Fetch a CCIP message by its unique message ID.

Parameters​

ParameterTypeDescription
messageIdstringThe unique message ID (0x + 64 hex chars)
_opts?{ onRamp?: string; page?: number; }Optional: onRamp hint for non-EVM chains
_opts.onRamp?string-
_opts.page?number-

Returns​

Promise<CCIPRequest<CCIPVersion>>

CCIPRequest with metadata populated from API

Remarks​

Uses the CCIP API to retrieve message details. The returned request includes a metadata field with API-specific information.

Example​

TypeScript
const request = await chain.getMessageById(messageId)
console.log(`Sender: ${request.message.sender}`)

if (request.metadata) {
console.log(`Status: ${request.metadata.status}`)
if (request.metadata.deliveryTime) {
console.log(`Delivered in ${request.metadata.deliveryTime}ms`)
}
}

Throws​

CCIPApiClientNotAvailableError if API disabled

Throws​

CCIPMessageIdNotFoundError if message not found

Throws​

CCIPOnRampRequiredError if onRamp is required but not provided

Throws​

CCIPHttpError if API request fails


getMessagesInBatch()​

getMessagesInBatch<R extends { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { blockTimestamp: number; }; message: { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; }; }>(request: R, range: Pick<CommitReport, "minSeqNr" | "maxSeqNr">, opts?: { page?: number; }): Promise<R["message"][]>

Defined in: chain.ts:1218

Fetches all CCIP messages contained in a given commit batch. To be implemented for chains supporting CCIPVersion v1.6.0 and earlier

Type Parameters​

Type Parameter
R extends { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { blockTimestamp: number; }; message: { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; }; }

Parameters​

ParameterTypeDescription
requestRCCIPRequest to fetch batch for
rangePick<CommitReport, "minSeqNr" | "maxSeqNr">batch range { minSeqnr, maxSeqNr }, e.g. from CommitReport
opts?{ page?: number; }Optional parameters (e.g., page for pagination width)
opts.page?number-

Returns​

Promise<R["message"][]>

Array of messages in the batch

Throws​

CCIPMessageBatchIncompleteError if not all messages in range could be fetched

Example​

Get all messages in a batch

TypeScript
const verifications = await dest.getVerifications({ offRamp, request })
const messages = await source.getMessagesInBatch(request, verifications.report)
console.log(`Found ${messages.length} messages in batch`)

getMessagesInRange()​

getMessagesInRange(opts: { address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; since?: { blockTimestamp?: number | bigint; }; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; }): AsyncIterableIterator<CCIPRequest<CCIPVersion>>

Defined in: chain.ts:1154

Discover and decode CCIP messages within a block/slot/checkpoint range.

Parameters​

ParameterTypeDescription
opts{ address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; since?: { blockTimestamp?: number | bigint; }; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; }LogFilter options (startBlock, endBlock, address, topics, page)
opts.address?stringContract address to filter logs by.
opts.endBefore?stringCursor hint for the exclusive upper end of iteration on chains that support it.
opts.endBlock?number | bigint | "finalized" | "latest"Ending block number (inclusive).
opts.page?number | bigintPage size for pagination.
opts.since?{ blockTimestamp?: number | bigint; }Resume hint: the last log emitted by a previous getLogs call on the same address/filter. Any subset of fields may be provided; each chain uses what it can. Two layers of behavior: 1. Start floors (ALL chains — see withSinceStart): blockNumber and blockTimestamp stand in for startBlock/startTime — each effective floor is the LARGER of the explicitly requested bound and the hint's — so a since carrying either satisfies the start requirement on its own. Blocks/versions are always fetched and emitted complete. 2. Block completeness: all chains implementations must guarantee all logs in some block are yielded in the same call before it returns. 3. Exclusive resume (chains with a native per-log cursor): the hinted log itself is NOT re-emitted, and other logs in the same block/tx may also not be; some chains may attempt to yield logs in the same block or transaction, but from 2., the contract guarantees only that logs from the next block or tx on are emitted, so for an hermetic poller, it's safer to only ever pass the last finalized log in the previous call as since hint. The hint only ever RAISES the start floors — startBlock is the scan floor (the scan never starts below it) and, when a startBlock exists, startTime is evaluated at filter-time just before emitting. A stale, foreign or malformed hint may be ignored (the usual walk runs). At-least-once is the only guarantee all families share: dedupe by (transactionHash, index). Cursors are FILTER-SCOPED: a hint produced by a NARROWER filter must never be replayed on a wider one. Where the cursor is a per-block prefix (EVM), the wider filter's earlier-index logs in the hinted block count as already emitted and are SKIPPED — a loss, not a duplicate. The SDK cannot validate this: the hint carries the log's own topics, never the breadth of the filter that produced it, so a wide sweep and a narrow one over the same block hand out a byte-identical hint while requiring opposite resume behavior (an address mismatch IS detectable and is rejected; a topic-subset resume is not). Key each cursor by the filter that produced it, and start a new filter from its own startBlock. Per-family resume — EVM/Solana/TON: the hinted block/tx streams whole and logs at/before the hinted index are skipped (later same-block/same-tx logs still flow; TON floors its v3 /messages fast path at the hint's created_lt). Aptos: event index on single-topic streams, blockNumber + 1 on multi-topic ones. Sui: inclusive checkpoint floors (re-delivered). Canton: unsupported.
opts.since.blockTimestamp?number | bigint-
opts.startBlock?number | bigintStarting block number (inclusive). Required unless startTime is provided; explicit 0 is allowed.
opts.startTime?number | bigintStarting Unix timestamp (inclusive).
opts.topics?(string | string[] | null)[]Topics to filter logs by.
opts.typeAndVersions?readonly (string | RegExp)[]Restrict logs to contracts whose Chain.typeAndVersion matches any of these. Useful when filtering by topic alone (no address) would otherwise match logs from many unrelated contract types — e.g. ConfigSet is emitted by OnRamp, OffRamp, CommitStore, FeeQuoter, TokenPool, and PriceRegistry alike. Pass e.g. ['OnRamp'] to keep only on-ramps. See passesTypeAndVersion for the exact matching rule. undefined/empty means no restriction (default), and costs nothing — typeAndVersion is never called.
opts.watch?boolean | AbortSignalwatch mode: polls for new logs after fetching since start (required), until endBlock finality tag (e.g. endBlock=finalized polls only finalized logs); can be an AbortSignal to cancel loop

Returns​

AsyncIterableIterator<CCIPRequest<CCIPVersion>>

Async iterator of CCIPRequest objects in native log order

Remarks​

This is the range-scanning equivalent of getMessagesInTx. Results are yielded in native log order (block number + log index for EVM, slot order for Solana). Non-CCIP logs in the range are silently skipped.

On Solana, the address parameter is required (router program address). On EVM, it is optional but recommended for public RPCs that require address filtering.

Throws​

CCIPChainFamilyUnsupportedError if a pre-v1.6 message is found on a non-EVM chain

Throws​

CCIPLogsAddressRequiredError on Solana if address is not provided (thrown by underlying Chain.getLogs)

See​

Example​

Scan a block range on EVM

TypeScript
for await (const request of chain.getMessagesInRange({
startBlock: 1000000,
endBlock: 1001000,
address: '0xOnRampAddress...', // optional on EVM
})) {
console.log(`seqNr=${request.message.sequenceNumber} dest=${request.lane.destChainSelector}`)
}

getMessagesInTx()​

getMessagesInTx(tx: string | ChainTransaction): Promise<CCIPRequest<CCIPVersion>[]>

Defined in: chain.ts:1095

Fetch all CCIP requests in a transaction.

Parameters​

ParameterTypeDescription
txstring | ChainTransactionChainTransaction or txHash to fetch requests from

Returns​

Promise<CCIPRequest<CCIPVersion>[]>

Promise resolving to CCIP messages in the transaction (at least one)

Throws​

CCIPTransactionNotFoundError if transaction does not exist

Throws​

CCIPMessageNotFoundInTxError if no CCIPSendRequested events in tx

Example​

Get messages from transaction

TypeScript
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
const requests = await chain.getMessagesInTx('0xabc123...')
for (const req of requests) {
console.log(`Message ID: ${req.message.messageId}`)
}

getNativeTokenForRouter()​

abstract getNativeTokenForRouter(router: string): Promise<string>

Defined in: chain.ts:1387

Get the native token address for a Router.

Parameters​

ParameterTypeDescription
routerstringRouter contract address

Returns​

Promise<string>

Promise resolving to native token address (usually wrapped)

Example​

Get wrapped native token

TypeScript
const weth = await chain.getNativeTokenForRouter(routerAddress)
console.log(`Wrapped native: ${weth}`)

getOffchainTokenData()​

getOffchainTokenData(request: { log: { }; message: { ccipReceiveGasLimit: number; ccvAndExecutorHash: string; data: string; destBlob: string; destChainSelector: bigint; encodedMessage: string; executionGasLimit: number; feeToken: string; feeTokenAmount: bigint; finality: FinalityRequested; messageId: string; messageNumber: bigint; offRampAddress: string; onRampAddress: string; receipts: readonly { destBytesOverhead: bigint; destGasLimit: bigint; extraArgs: string; feeTokenAmount: bigint; issuer: string; }[]; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmountBeforeTokenPoolFees: bigint; tokenAmounts: readonly { amount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; sourceTokenAddress: string; tokenReceiver: string; }[]; verifierBlobs: readonly string[]; } | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; token: string; }[]; } | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; token: string; }[]; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; } | { accountIsWritableBitmap: bigint; accounts: string[]; allowOutOfOrderExecution: boolean; computeUnits: bigint; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; receiverObjectIds: string[]; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; }; }): Promise<OffchainTokenData[]>

Defined in: chain.ts:1734

Fetch supported offchain token data for a request from this network. It logs but doesn't throw in case it can't fetch attestation, as the transfers may not be from the expected attestation providers. It returns default offchainData=undefined for those.

Parameters​

ParameterTypeDescription
request{ log: { }; message: { ccipReceiveGasLimit: number; ccvAndExecutorHash: string; data: string; destBlob: string; destChainSelector: bigint; encodedMessage: string; executionGasLimit: number; feeToken: string; feeTokenAmount: bigint; finality: FinalityRequested; messageId: string; messageNumber: bigint; offRampAddress: string; onRampAddress: string; receipts: readonly { destBytesOverhead: bigint; destGasLimit: bigint; extraArgs: string; feeTokenAmount: bigint; issuer: string; }[]; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmountBeforeTokenPoolFees: bigint; tokenAmounts: readonly { amount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; sourceTokenAddress: string; tokenReceiver: string; }[]; verifierBlobs: readonly string[]; } | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; token: string; }[]; } | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; token: string; }[]; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; } | { accountIsWritableBitmap: bigint; accounts: string[]; allowOutOfOrderExecution: boolean; computeUnits: bigint; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; receiverObjectIds: string[]; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; }; }CCIP request, with tx.hash and message
request.log{ }-
request.message{ ccipReceiveGasLimit: number; ccvAndExecutorHash: string; data: string; destBlob: string; destChainSelector: bigint; encodedMessage: string; executionGasLimit: number; feeToken: string; feeTokenAmount: bigint; finality: FinalityRequested; messageId: string; messageNumber: bigint; offRampAddress: string; onRampAddress: string; receipts: readonly { destBytesOverhead: bigint; destGasLimit: bigint; extraArgs: string; feeTokenAmount: bigint; issuer: string; }[]; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmountBeforeTokenPoolFees: bigint; tokenAmounts: readonly { amount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; sourceTokenAddress: string; tokenReceiver: string; }[]; verifierBlobs: readonly string[]; } | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; token: string; }[]; } | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; token: string; }[]; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; } | { accountIsWritableBitmap: bigint; accounts: string[]; allowOutOfOrderExecution: boolean; computeUnits: bigint; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; receiverObjectIds: string[]; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; }-

Returns​

Promise<OffchainTokenData[]>

Promise resolving to array with one offchain token data for each token transfer

Example​

Get offchain token data for USDC transfer

TypeScript
const offchainData = await source.getOffchainTokenData(request)
// Use in execution report

getOffRampConfig()​

abstract getOffRampConfig(offRamp: string, sourceChainSelector: bigint): Promise<OffRampConfig>

Defined in: chain.ts:1328

Fetch the full OffRamp configuration for a given source chain.

Parameters​

ParameterTypeDescription
offRampstringOffRamp contract address.
sourceChainSelectorbigintSource chain selector.

Returns​

Promise<OffRampConfig>

Merged OffRamp config — at minimum router, onRamp, type, version, typeAndVersion.

Remarks​

Returns a merged object containing every static (per-contract) and per-source field exposed by the underlying contract. Concrete subclasses preserve the contract-native field names and return richer objects than the OffRampConfig base interface declares — they may include extra fields available only on specific versions (e.g. EVM v2.0 exposes onRamps: string[]).

Throws​

CCIPContractTypeInvalidError if address is not an OffRamp.


getOffRampsForRouter()​

abstract getOffRampsForRouter(router: string, sourceChainSelector: bigint): Promise<string[]>

Defined in: chain.ts:1402

Fetch the OffRamps allowlisted in a Router. Used to discover OffRamp connected to an OnRamp.

Parameters​

ParameterTypeDescription
routerstringRouter contract address
sourceChainSelectorbigintSource chain selector

Returns​

Promise<string[]>

Promise resolving to array of OffRamp addresses

Example​

Get offRamps for a source chain

TypeScript
const offRamps = await dest.getOffRampsForRouter(routerAddress, sourceSelector)
console.log(`Found ${offRamps.length} offRamp(s)`)

getOnRampConfig()​

abstract getOnRampConfig(onRamp: string, destChainSelector: bigint): Promise<OnRampConfig>

Defined in: chain.ts:1310

Fetch the full OnRamp configuration for a given destination chain.

Parameters​

ParameterTypeDescription
onRampstringOnRamp contract address.
destChainSelectorbigintDestination chain selector.

Returns​

Promise<OnRampConfig>

Merged OnRamp config — at minimum router, type, version, typeAndVersion.

Remarks​

Returns a merged object containing every static (per-contract) and per-destination field exposed by the underlying contract. Concrete subclasses (e.g. EVMChain) preserve the contract-native field names and return richer objects than the OnRampConfig base interface declares — they may include extra fields available only on specific versions.

Throws​

CCIPContractTypeInvalidError if address is not an OnRamp.


getOnRampForRouter()​

abstract getOnRampForRouter(router: string, destChainSelector: bigint): Promise<string>

Defined in: chain.ts:1418

Fetch the OnRamp registered in a Router for a destination chain.

Parameters​

ParameterTypeDescription
routerstringRouter contract address
destChainSelectorbigintDestination chain selector

Returns​

Promise<string>

Promise resolving to OnRamp address

Throws​

CCIPLaneNotFoundError if no lane exists to destination

Example​

Get onRamp for destination

TypeScript
const onRamp = await source.getOnRampForRouter(routerAddress, destSelector)
console.log(`OnRamp: ${onRamp}`)

getOnRampsForOffRamp()​

getOnRampsForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string[]>

Defined in: chain.ts:1438

Fetch the OnRamps addresses set in OffRamp config. Used to discover OffRamp connected to an OnRamp.

Parameters​

ParameterTypeDescription
offRampstringOffRamp contract address
sourceChainSelectorbigintSource chain selector

Returns​

Promise<string[]>

Promise resolving to OnRamps addresses

Remarks​

Default implementation reads from Chain.getOffRampConfig; if the concrete config exposes an onRamps: string[] (e.g. EVM v2.0 with multiple historical OnRamps), it is returned as-is; otherwise [cfg.onRamp] is returned.

Example​

Get onRamp from offRamp config

TypeScript
const [onRamp] = await dest.getOnRampsForOffRamp(offRampAddress, sourceSelector)
console.log(`OnRamp: ${onRamp}`)

getRegistryTokenConfig()​

abstract getRegistryTokenConfig(registry: string, token: string): Promise<RegistryTokenConfig>

Defined in: chain.ts:2341

Fetch token configuration from a TokenAdminRegistry.

Parameters​

ParameterTypeDescription
registrystringTokenAdminRegistry contract address.
tokenstringToken address to query.

Returns​

Promise<RegistryTokenConfig>

RegistryTokenConfig containing administrator and pool information.

Remarks​

The TokenAdminRegistry is a contract that tracks token administrators and their associated pools. Each token has an administrator who can update pool configurations.

Example​

Query a token's registry configuration

TypeScript
const config = await chain.getRegistryTokenConfig(registryAddress, tokenAddress)
console.log(`Administrator: ${config.administrator}`)
if (config.tokenPool) {
console.log(`Pool: ${config.tokenPool}`)
}

Throws​

CCIPTokenNotInRegistryError if token is not registered.


getRequiredCCVs()?​

optional getRequiredCCVs(opts: { message: GetRequiredCCVsMessage; offRamp: string; }): Promise<GetRequiredCCVsResult>

Defined in: chain.ts:2675

Resolve the CCV set the destination OffRamp will require for a candidate message, and whether its finality is accepted (a rejection throws CCIPFinalityNotAllowedError). A read via the getCCVsForMessage resolver; EVM destinations only. The set is informative and sender-scoped.

Parameters​

ParameterTypeDescription
opts{ message: GetRequiredCCVsMessage; offRamp: string; }Destination OffRamp (v2.0) address and the candidate message (GetRequiredCCVsMessage).
opts.messageGetRequiredCCVsMessage-
opts.offRampstring-

Returns​

Promise<GetRequiredCCVsResult>

{ requiredCCVs, optionalCCVs, optionalThreshold }.


getRouterForOffRamp()​

getRouterForOffRamp(offRamp: string, sourceChainSelector: bigint): Promise<string>

Defined in: chain.ts:1372

Fetch the Router address set in OffRamp config.

Parameters​

ParameterTypeDescription
offRampstringOffRamp contract address
sourceChainSelectorbigintSource chain selector

Returns​

Promise<string>

Promise resolving to Router address

Remarks​

Default implementation reads .router from Chain.getOffRampConfig; subclasses generally need not override this.

Throws​

CCIPContractTypeInvalidError if address is not an OffRamp

Example​

Get router from offRamp

TypeScript
const router = await chain.getRouterForOffRamp(offRampAddress, sourceSelector)
console.log(`Router: ${router}`)

getRouterForOnRamp()​

getRouterForOnRamp(onRamp: string, destChainSelector: bigint): Promise<string>

Defined in: chain.ts:1350

Fetch the Router address set in OnRamp config. Used to discover OffRamp connected to OnRamp.

Parameters​

ParameterTypeDescription
onRampstringOnRamp contract address
destChainSelectorbigintDestination chain selector

Returns​

Promise<string>

Promise resolving to Router address

Remarks​

Default implementation reads .router from Chain.getOnRampConfig; subclasses generally need not override this.

Throws​

CCIPContractTypeInvalidError if address is not an OnRamp

Example​

Get router from onRamp

TypeScript
const router = await chain.getRouterForOnRamp(onRampAddress, destSelector)
console.log(`Router: ${router}`)

getSupportedTokens()​

abstract getSupportedTokens(address: string, opts?: { page?: number; }): Promise<string[]>

Defined in: chain.ts:2318

List tokens supported by given TokenAdminRegistry contract.

Parameters​

ParameterTypeDescription
addressstringUsually TokenAdminRegistry, but chain may support receiving Router, OnRamp, etc.
opts?{ page?: number; }Optional parameters (e.g., page for pagination range)
opts.page?number-

Returns​

Promise<string[]>

Promise resolving to array of supported token addresses

Example​

Get all supported tokens

TypeScript
const tokens = await chain.getSupportedTokens(registryAddress)
console.log(`${tokens.length} tokens supported`)

getTokenAdminRegistryFor()​

abstract getTokenAdminRegistryFor(address: string, destChainSelector?: bigint): Promise<string>

Defined in: chain.ts:1510

Fetch TokenAdminRegistry configured in a given OnRamp, Router, etc. Needed to map a source token to its dest counterparts.

Parameters​

ParameterTypeDescription
addressstringContract address (OnRamp, Router, etc.)
destChainSelector?bigintSome dest chain connected to this address/router

Returns​

Promise<string>

Promise resolving to TokenAdminRegistry address

Example​

Get token registry

TypeScript
const registry = await chain.getTokenAdminRegistryFor(onRampAddress)
console.log(`Registry: ${registry}`)

getTokenForTokenPool()​

getTokenForTokenPool(tokenPool: string): Promise<string>

Defined in: chain.ts:1455

Fetch the TokenPool's token/mint.

Parameters​

ParameterTypeDescription
tokenPoolstringTokenPool address

Returns​

Promise<string>

Promise resolving to token or mint address

Example​

Get token for pool

TypeScript
const token = await chain.getTokenForTokenPool(tokenPoolAddress)
console.log(`Token: ${token}`)

getTokenInfo()​

abstract getTokenInfo(token: string): Promise<TokenInfo>

Defined in: chain.ts:1471

Fetch token metadata.

Parameters​

ParameterTypeDescription
tokenstringToken address

Returns​

Promise<TokenInfo>

Promise resolving to token symbol, decimals, and optionally name

Example​

Get token info

TypeScript
const info = await chain.getTokenInfo(tokenAddress)
console.log(`${info.symbol}: ${info.decimals} decimals`)

getTokenPoolConfig()​

abstract getTokenPoolConfig(tokenPool: string, feeOpts?: TokenTransferFeeOpts): Promise<TokenPoolConfig>

Defined in: chain.ts:2370

Fetch configuration of a token pool.

Parameters​

ParameterTypeDescription
tokenPoolstringToken pool contract address.
feeOpts?TokenTransferFeeOptsOptional parameters to also fetch token transfer fee config.

Returns​

Promise<TokenPoolConfig>

TokenPoolConfig containing token, router, version info, and optionally fee config.

Remarks​

Return type varies by chain:

  • EVM: typeAndVersion is always present (required)
  • Solana: Includes extra tokenPoolProgram field
  • Aptos: Standard fields only
  • Sui/TON: Throws CCIPNotImplementedError

Example​

Type-safe access to chain-specific fields

TypeScript
// Use instanceof to narrow the chain type
if (chain instanceof SolanaChain) {
const config = await chain.getTokenPoolConfig(poolAddress)
console.log(config.tokenPoolProgram) // TypeScript knows this exists!
} else if (chain instanceof EVMChain) {
const config = await chain.getTokenPoolConfig(poolAddress)
console.log(config.typeAndVersion) // TypeScript knows this is required!
}

Throws​

CCIPNotImplementedError on Sui or TON chains


getTokenPoolRemote()​

getTokenPoolRemote(tokenPool: string, remoteChainSelector: bigint): Promise<TokenPoolRemote>

Defined in: chain.ts:2438

Fetch remote chain configuration for a token pool for a specific destination.

Parameters​

ParameterTypeDescription
tokenPoolstringToken pool address on the current chain.
remoteChainSelectorbigintChain selector of the desired remote chain.

Returns​

Promise<TokenPoolRemote>

TokenPoolRemote config for the specified remote chain.

Remarks​

Convenience wrapper around getTokenPoolRemotes that returns a single configuration instead of a Record. Use this when you need configuration for a specific destination chain.

Example​

TypeScript
const arbitrumSelector = 4949039107694359620n
const remote = await chain.getTokenPoolRemote(poolAddress, arbitrumSelector)
console.log(`Remote token: ${remote.remoteToken}`)
console.log(`Remote pools: ${remote.remotePools.join(', ')}`)

Throws​

CCIPTokenPoolChainConfigNotFoundError if no configuration found for the specified remote chain.


getTokenPoolRemotes()​

abstract getTokenPoolRemotes(tokenPool: string, remoteChainSelector?: bigint): Promise<Record<string, TokenPoolRemote>>

Defined in: chain.ts:2413

Fetch remote chain configurations for a token pool.

Parameters​

ParameterTypeDescription
tokenPoolstringToken pool address on the current chain.
remoteChainSelector?bigintOptional chain selector to filter results to a single destination.

Returns​

Promise<Record<string, TokenPoolRemote>>

Record where keys are chain names (e.g., "ethereum-mainnet") and values are TokenPoolRemote configs.

Remarks​

A token pool maintains configurations for each destination chain it supports. The returned Record maps chain names to their respective configurations.

Examples​

Get all supported destinations

TypeScript
const remotes = await chain.getTokenPoolRemotes(poolAddress)
// Returns: {
// "ethereum-mainnet": { remoteToken: "0x...", remotePools: [...], ... },
// "ethereum-mainnet-arbitrum-1": { remoteToken: "0x...", remotePools: [...], ... },
// "solana-mainnet": { remoteToken: "...", remotePools: [...], ... }
// }

// Access a specific chain's config
const arbConfig = remotes['ethereum-mainnet']
console.log(`Remote token: ${arbConfig.remoteToken}`)

Filter to a specific destination

TypeScript
import { networkInfo } from '@chainlink/ccip-sdk'

const arbitrumSelector = 4949039107694359620n
const remotes = await chain.getTokenPoolRemotes(poolAddress, arbitrumSelector)
// Returns only: { "arbitrum-mainnet": { ... } }

const chainName = networkInfo(arbitrumSelector).name
const config = remotes[chainName]

Throws​

CCIPTokenPoolChainConfigNotFoundError if remoteChainSelector is specified but not configured.


getTokenPrice()​

getTokenPrice(_opts: { router: string; timestamp?: number; token: string; }): Promise<TokenPrice>

Defined in: chain.ts:2597

Fetch the on-chain USD price of a token from the FeeQuoter or PriceRegistry.

Parameters​

ParameterType
_opts{ router: string; timestamp?: number; token: string; }
_opts.routerstring
_opts.timestamp?number
_opts.tokenstring

Returns​

Promise<TokenPrice>

Promise resolving to TokenPrice with the USD price per whole token.

Remarks​

On EVM, the price contract is resolved via the Router's OnRamp: PriceRegistry for v1.2/v1.5 lanes, FeeQuoter for v1.6+ lanes. When timestamp is provided on EVM, the price is read at the block closest to that timestamp (requires archive node). On Solana and Aptos, the FeeQuoter is resolved directly from the Router config; timestamp is not yet supported and will be ignored.

Throws​

CCIPNotImplementedError if not implemented for this chain family

Example​

TypeScript
const { price } = await chain.getTokenPrice({
router: routerAddress,
token: linkAddress,
})
console.log(`LINK: $${price.toFixed(2)}`)

getTotalFeesEstimate()​

getTotalFeesEstimate(_opts: Omit<SendMessageOpts, "approveMax">): Promise<TotalFeesEstimate>

Defined in: chain.ts:2563

Estimate total fees for a cross-chain message.

Returns two components:

  • ccipFee: from Router.getFee(), denominated in the message's feeToken (native token if omitted). Includes gas, DON costs, and FeeQuoter-level token transfer overhead (all CCIP versions).
  • tokenTransferFee: pool-level BPS fee deducted from the transferred token amount (v2.0+ only). The recipient receives amount - feeDeducted on the destination chain. Absent on pre-v2.0 lanes or data-only messages.

Parameters​

ParameterTypeDescription
_optsOmit<SendMessageOpts, "approveMax">SendMessageOpts without approveMax

Returns​

Promise<TotalFeesEstimate>

Promise resolving to TotalFeesEstimate

Throws​

CCIPNotImplementedError if not implemented for this chain family


getTransaction()​

abstract getTransaction(hash: string): Promise<ChainTransaction>

Defined in: chain.ts:995

Fetch a transaction by its hash.

Parameters​

ParameterTypeDescription
hashstringTransaction hash

Returns​

Promise<ChainTransaction>

Promise resolving to generic transaction details

Throws​

CCIPTransactionNotFoundError if transaction does not exist (transient)

Example​

Fetch transaction details

TypeScript
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
try {
const tx = await chain.getTransaction('0xabc123...')
console.log(`Block: ${tx.blockNumber}, Timestamp: ${tx.timestamp}`)
} catch (err) {
if (err instanceof CCIPTransactionNotFoundError && err.isTransient) {
// Transaction may be pending
}
}

getVerifications()​

getVerifications(opts: { indexer?: NetworkType | readonly string[]; offRamp: string; request: { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { blockTimestamp: number; }; message: { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">): Promise<CCIPVerifications>

Defined in: chain.ts:1933

Look for a CommitReport at dest for given CCIP request. May be specialized by some subclasses.

Parameters​

ParameterTypeDescription
opts{ indexer?: NetworkType | readonly string[]; offRamp: string; request: { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { blockTimestamp: number; }; message: { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; }; }; } & VerificationSourcesOpts & Pick<LogFilter, "startBlock" | "watch" | "page">getVerifications options

Returns​

Promise<CCIPVerifications>

CCIPVerifications

Throws​

CCIPCommitNotFoundError if no commit found for the request (transient)

Examples​

Get commit for a request

TypeScript
const verifications = await dest.getVerifications({
offRamp: offRampAddress,
request,
})
console.log(`Committed at block: ${verifications.log.blockNumber}`)

CCIP v2.0: fall back to a verifier the indexers don't carry

TypeScript
const { verificationPolicy, verifications } = await dest.getVerifications({
offRamp,
request,
verifiers: ['https://verifier.example'], // grpc-web proxy in front of its aggregator
})

resolveEncodedMessage()​

protected resolveEncodedMessage(request: { message: { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; }; }): Promise<string>

Defined in: chain.ts:1963

The MessageV1Codec-encoded form of a CCIP v2.0 request's message: taken from the request when it carries one (decoded from source logs), else fetched from the CCIP API (whose getMessageById requests don't).

Parameters​

ParameterTypeDescription
request{ message: { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; }; }The v2.0 request
request.message{ messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; } | { messageId: string; }-

Returns​

Promise<string>

The 0x-prefixed encoded message

Throws​

CCIPApiClientNotAvailableError if it must be fetched and the API is disabled


resolveExecuteOpts()​

protected resolveExecuteOpts(opts: ExecuteOpts): Promise<{ input: ExecutionInput; offRamp: string; } & { forceBuffer?: boolean; forceLookupTable?: boolean; gasLimit?: number; receiver?: string; tokensGasLimit?: number; txGasLimit?: number; }>

Defined in: chain.ts:1751

Resolves ExecuteOpts that may contain a messageId (API shorthand) into the canonical { offRamp, input } form required by generateUnsignedExecute.

When opts already contains input the method is a no-op and returns it unchanged. When opts contains only a messageId it calls apiClient.getExecutionInput and merges the result back with any extra opts fields (e.g. gasLimit). If opts.gasLimit is undefined and estimateReceiveExecution is available, try to estimate gasLimitOverride

Parameters​

ParameterType
optsExecuteOpts

Returns​

Promise<{ input: ExecutionInput; offRamp: string; } & { forceBuffer?: boolean; forceLookupTable?: boolean; gasLimit?: number; receiver?: string; tokensGasLimit?: number; txGasLimit?: number; }>

Throws​

CCIPApiClientNotAvailableError if messageId is provided but no apiClient


sendMessage()​

abstract sendMessage(opts: SendMessageOpts & { txGasLimit?: number; wallet: unknown; }): Promise<CCIPRequest<CCIPVersion>>

Defined in: chain.ts:1712

Send a CCIP message through a router using provided wallet.

Parameters​

ParameterTypeDescription
optsSendMessageOpts & { txGasLimit?: number; wallet: unknown; }SendMessageOpts with chain-specific wallet for signing

Returns​

Promise<CCIPRequest<CCIPVersion>>

Promise resolving to CCIP request with message details

Throws​

CCIPWalletNotSignerError if wallet is not a valid signer

Throws​

CCIPLaneNotFoundError if no lane exists to destination

Example​

Send cross-chain message

TypeScript
const request = await chain.sendMessage({
router: '0x...',
destChainSelector: 4949039107694359620n,
message: {
receiver: '0x...',
data: '0x1337',
tokenAmounts: [{ token: '0x...', amount: 100n }],
feeToken: '0xLinkToken',
},
wallet: signer,
})
console.log(`Message ID: ${request.message.messageId}`)

simulateLockOrBurn()?​

optional simulateLockOrBurn(opts: { amount: bigint; destChainSelector: bigint; finality?: FinalityRequested; onRamp: string; originalSender?: string; receiver?: string; token: string; tokenArgs?: string; tokenReceiver?: string; }): Promise<{ destPoolData: string; destTokenAddress: string; destTokenAmount: bigint; sourcePoolAddress: string; }>

Defined in: chain.ts:2616

Simulate the source pool's lockOrBurn for a prospective token transfer and return the pool-reported destTokenAddress, destPoolData (the value the destination pool's releaseOrMint consumes as sourcePoolData) and destTokenAmount (the post-fee amount the OnRamp writes into the emitted message), plus the resolved source pool address.

Optional; currently implemented for EVM chains. Used by estimateReceiveExecution to feed the destination-liquidity simulation the same source pool data a real transfer would carry.

Parameters​

ParameterTypeDescription
opts{ amount: bigint; destChainSelector: bigint; finality?: FinalityRequested; onRamp: string; originalSender?: string; receiver?: string; token: string; tokenArgs?: string; tokenReceiver?: string; }lane (onRamp, destChainSelector), token and amount (source decimals), and optionally originalSender, receiver, tokenReceiver, tokenArgs, and the requested finality
opts.amountbigintAmount in the source token's decimals
opts.destChainSelectorbigintDestination chain selector
opts.finality?FinalityRequestedRequested finality (v2 pools take it as the 2nd lockOrBurn argument)
opts.onRampstringOnRamp registered on the source Router for the destination chain
opts.originalSender?stringSender of the prospective message
opts.receiver?stringReceiver on the destination chain
opts.tokenstringSource token address
opts.tokenArgs?stringMessage-level GenericExtraArgsV3.tokenArgs, passed through to IPoolV2 pools
opts.tokenReceiver?stringToken receiver on the destination chain (v3 extraArgs); when set, takes precedence over receiver as the pool's lockOrBurnIn.receiver, mirroring the OnRamp

Returns​

Promise<{ destPoolData: string; destTokenAddress: string; destTokenAmount: bigint; sourcePoolAddress: string; }>

resolved sourcePoolAddress, destTokenAddress + destPoolData as returned by the pool, and the post-fee destTokenAmount


typeAndVersion()​

abstract typeAndVersion(address: string): Promise<[string, string, string, string]>

Defined in: chain.ts:1290

Fetch typeAndVersion for a given CCIP contract address.

Parameters​

ParameterTypeDescription
addressstringCCIP contract address

Returns​

Promise<[string, string, string, string]>

Promise resolving to tuple:

  • type - Parsed type of the contract, e.g. OnRamp
  • version - Parsed version of the contract, e.g. 1.6.0
  • typeAndVersion - Original (unparsed) typeAndVersion() string
  • suffix - Suffix of the version, if any (e.g. -dev)

Throws​

CCIPTypeVersionInvalidError if typeAndVersion string cannot be parsed

Example​

Check contract version

TypeScript
const [type, version] = await chain.typeAndVersion(contractAddress)
console.log(`Contract: ${type} v${version}`)
if (version < '1.6.0') {
console.log('Legacy contract detected')
}

waitFinalized()​

waitFinalized(opts: { abort?: AbortSignal; finality?: number | bigint | "finalized" | "latest"; pollInterval?: number; reorgSafetyBlocks?: number; } & { request: { log: { blockTimestamp: number | bigint; }; }; } | { log: { blockTimestamp: number | bigint; }; }): Promise<BlockInfo | undefined>

Defined in: chain.ts:1017

Confirm a log tx is finalized or wait for it to be finalized.

Parameters​

ParameterTypeDescription
opts{ abort?: AbortSignal; finality?: number | bigint | "finalized" | "latest"; pollInterval?: number; reorgSafetyBlocks?: number; } & { request: { log: { blockTimestamp: number | bigint; }; }; } | { log: { blockTimestamp: number | bigint; }; }Options containing the request, finality level, and optional cancel promise

Returns​

Promise<BlockInfo | undefined>

Some block info at or after tx finalization

Throws​

CCIPTransactionNotFinalizedError if the transaction is not included (e.g., due to a reorg)

Example​

Wait for message finality

TypeScript
const request = await source.getMessagesInTx(txHash)
try {
await source.waitFinalized({ request: request[0] })
console.log('Transaction finalized')
} catch (err) {
if (err instanceof CCIPTransactionNotFinalizedError) {
console.log('Transaction not yet finalized')
}
}