Abstract Interface: Chain<F>
Defined in: chain.ts:500
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 Parameter | Default type |
|---|---|
F extends ChainFamily | ChainFamily |
Indexable
[
key:symbol]: () =>string
Properties
apiClient
readonlyapiClient:CCIPAPIClient|null
Defined in: chain.ts:504
CCIP API client (null if opted out)
apiRetryConfig
readonlyapiRetryConfig:Required<ApiRetryConfig> |null
Defined in: chain.ts:506
Retry configuration for API fallback operations (null if API client is disabled)
logger
logger:
Logger
Defined in: chain.ts:502
network
readonlynetwork:NetworkInfo<F>
Defined in: chain.ts:501
Methods
destroy()?
optionaldestroy():void|Promise<void>
Defined in: chain.ts:540
Cleanup method to release resources (e.g., close connections).
Returns
void | Promise<void>
estimateReceiveExecution()?
optionalestimateReceiveExecution(opts: {message: {data?:BytesLike;destTokenAmounts?: readonly {token:string; } | {destTokenAddress:string;extraData?:string; } & {amount:bigint; }[];messageId:string;receiver:string;sender?:string;sourceChainSelector:bigint; };offRamp:string; } | {messageId:string; }):Promise<number>
Defined in: chain.ts:1704
Estimate ccipReceive execution cost (gas, computeUnits) for this destination chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { message: { data?: BytesLike; destTokenAmounts?: readonly { token: string; } | { destTokenAddress: string; extraData?: string; } & { amount: bigint; }[]; messageId: string; receiver: string; sender?: string; sourceChainSelector: bigint; }; 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()
abstractexecute(opts:ExecuteOpts& {wallet:unknown; }):Promise<CCIPExecution>
Defined in: chain.ts:1208
Execute messages in report in an offRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | ExecuteOpts & { 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
const receipt = await dest.execute({ messageId: '0x...', wallet })
const input = await source.getExecutionInput({ request, verifications })
const receipt = await dest.execute({ offRamp, input, wallet })
generateUnsignedExecute()
abstractgenerateUnsignedExecute(opts:ExecuteOpts& {payer:string; }):Promise<UnsignedTx[F]>
Defined in: chain.ts:1180
Generate unsigned tx to manuallyExecute a message.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | ExecuteOpts & { 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
const unsignedTx = await dest.generateUnsignedExecute({
offRamp: offRampAddress,
input,
payer: walletAddress,
})
// Sign and send with external wallet
generateUnsignedSendMessage()
abstractgenerateUnsignedSendMessage(opts:SendMessageOpts& {sender:string; }):Promise<UnsignedTx[F]>
Defined in: chain.ts:1040
Generate unsigned txs for ccipSend'ing a message.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | SendMessageOpts & { sender: string; } | SendMessageOpts with sender address |
Returns
Promise<UnsignedTx[F]>
Promise resolving to chain-family specific unsigned txs
Example
const unsignedTx = await chain.generateUnsignedSendMessage({
router: routerAddress,
destChainSelector: destSelector,
message: { receiver: '0x...', data: '0x1337' },
sender: walletAddress,
})
// Sign and send with external wallet
getBalance()
abstractgetBalance(opts:GetBalanceOpts):Promise<bigint>
Defined in: chain.ts:991
Query token balance for an address.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | GetBalanceOpts | Balance query options |
Returns
Promise<bigint>
Token balance information including raw and formatted values
Throws
CCIPNotImplementedError if chain family doesn't support this method
Examples
const balance = await chain.getBalance({ holder: '0x123...' })
console.log(`Native balance: ${balance}`) // balance in wei
const balance = await chain.getBalance({
holder: '0x123...',
token: '0xLINK...'
})
console.log(`LINK balance: ${balance}`) // balance in smallest units
getBlockTimestamp()
abstractgetBlockTimestamp(block:number|"finalized"):Promise<number>
Defined in: chain.ts:562
Fetch the timestamp of a given block.
Parameters
| Parameter | Type | Description |
|---|---|---|
block | number | "finalized" | Positive block number, negative finality depth, or 'finalized' tag |
Returns
Promise<number>
Promise resolving to timestamp of the block, in seconds
Throws
CCIPBlockNotFoundError if block does not exist
Example
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
const timestamp = await chain.getBlockTimestamp('finalized')
console.log(`Finalized at: ${new Date(timestamp * 1000).toISOString()}`)
getExecutionInput()
getExecutionInput(
opts: {request:CCIPRequest;verifications:CCIPVerifications; } &Pick<LogFilter,"page">):Promise<ExecutionInput>
Defined in: chain.ts:794
Fetch input data needed for executing messages Should be called on the source instance
Parameters
| Parameter | Type | Description |
|---|---|---|
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;sourceChainSelector?:bigint;verifications?:CCIPVerifications; } &Pick<LogFilter,"startBlock"|"startTime"|"watch"|"page">):AsyncIterableIterator<CCIPExecution>
Defined in: chain.ts:1354
Default/generic implementation of getExecutionReceipts. Yields execution receipts for a given offRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { messageId?: string; offRamp: string; sourceChainSelector?: bigint; verifications?: CCIPVerifications; } & Pick<LogFilter, "startBlock" | "startTime" | "watch" | "page"> | getExecutionReceipts options |
Returns
AsyncIterableIterator<CCIPExecution>
Async generator of CCIPExecution receipts
Example
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()
abstractgetFee(opts:Omit<SendMessageOpts,"approveMax">):Promise<bigint>
Defined in: chain.ts:1022
Fetch the current fee for a given intended message.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | Omit<SendMessageOpts, "approveMax"> | SendMessageOpts without approveMax |
Returns
Promise<bigint>
Fee amount in the feeToken's smallest units
Example
const fee = await chain.getFee({
router: routerAddress,
destChainSelector: destSelector,
message: { receiver: '0x...', data: '0x' },
})
console.log(`Fee: ${fee} wei`)
getFeeTokens()
abstractgetFeeTokens(router:string):Promise<Record<string,TokenInfo>>
Defined in: chain.ts:1584
Fetch list and info of supported feeTokens.
Parameters
| Parameter | Type | Description |
|---|---|---|
router | string | Router address on this chain |
Returns
Promise<Record<string, TokenInfo>>
Promise resolving to mapping of token addresses to TokenInfo objects
Example
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:1327
Retrieve features for a lane (router/destChainSelector/token triplet).
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | { destChainSelector: bigint; router: string; token?: string; } | Options containing router address, destChainSelector, and optional token address (the token to be transferred in a hypothetical message on this lane) |
_opts.destChainSelector | bigint | - |
_opts.router | string | - |
_opts.token? | string | - |
Returns
Promise<Partial<LaneFeatures>>
Promise resolving to partial lane features record
Throws
CCIPNotImplementedError if not implemented for this chain family
Example
const features = await chain.getLaneFeatures({
router: '0x...',
destChainSelector: 4949039107694359620n,
})
// MIN_BLOCK_CONFIRMATIONS 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.MIN_BLOCK_CONFIRMATIONS
if (ftf != null && ftf > 0) {
console.log(`FTF enabled with ${ftf} 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:1286
Fetches estimated lane latency to a destination chain. Uses this chain's selector as the source.
Parameters
| Parameter | Type | Description |
|---|---|---|
destChainSelector | bigint | Destination CCIP chain selector (bigint) |
numberOfBlocks? | number | Optional 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
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
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}`)
}
}
const latency = await chain.getLaneLatency(4949039107694359620n, 10)
console.log(`Latency with 10 confirmations: ${Math.round(latency.totalMs / 60000)} minutes`)
getLogs()
abstractgetLogs(opts:LogFilter):AsyncIterableIterator<ChainLog>
Defined in: chain.ts:670
An async generator that yields logs based on the provided options.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | LogFilter | Options object containing: - startBlock: if provided, fetch and generate logs forward starting from this block; otherwise, returns logs backwards in time from endBlock; optionally, startTime may be provided to fetch logs forward starting from this time - startTime: instead of a startBlock, a start timestamp may be provided; if either is provided, fetch logs forward from this starting point; otherwise, backwards - endBlock: if omitted, use latest block; can be a block number, 'latest', 'finalized' or negative finality block depth - 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, getLogs continuously after initial fetch |
Returns
AsyncIterableIterator<ChainLog>
An async iterable iterator of logs.
Throws
CCIPLogsWatchRequiresFinalityError if watch mode is used without a finality endBlock tag
Throws
CCIPLogsWatchRequiresStartError if watch mode is 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:746
Fetch a CCIP message by its unique message ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
messageId | string | The 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
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()?
optionalgetMessagesInBatch<R>(request:R,range:Pick<CommitReport,"minSeqNr"|"maxSeqNr">,opts?: {page?:number; }):Promise<R["message"][]>
Defined in: chain.ts:776
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: { }; message: { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; }; } |
Parameters
| Parameter | Type | Description |
|---|---|---|
request | R | CCIPRequest to fetch batch for |
range | Pick<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
const verifications = await dest.getVerifications({ offRamp, request })
const messages = await source.getMessagesInBatch(request, verifications.report)
console.log(`Found ${messages.length} messages in batch`)
getMessagesInTx()
getMessagesInTx(
tx:string|ChainTransaction):Promise<CCIPRequest<CCIPVersion>[]>
Defined in: chain.ts:690
Fetch all CCIP requests in a transaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
tx | string | ChainTransaction | ChainTransaction 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
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()
abstractgetNativeTokenForRouter(router:string):Promise<string>
Defined in: chain.ts:896
Get the native token address for a Router.
Parameters
| Parameter | Type | Description |
|---|---|---|
router | string | Router contract address |
Returns
Promise<string>
Promise resolving to native token address (usually wrapped)
Example
const weth = await chain.getNativeTokenForRouter(routerAddress)
console.log(`Wrapped native: ${weth}`)
getOffchainTokenData()
getOffchainTokenData(
request: {message: {data:string;feeToken:string;feeTokenAmount:bigint;gasLimit:bigint;messageId:string;nonce:bigint;receiver:string;sender:string;sequenceNumber:bigint;sourceChainSelector:bigint;sourceTokenData: readonlystring[];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: readonlystring[];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; } | {ccipReceiveGasLimit:number;ccvAndExecutorHash:string;data:string;destBlob:string;destChainSelector:bigint;encodedMessage:string;executionGasLimit:number;feeToken:string;feeTokenAmount:bigint;finality:number;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: readonlystring[]; };tx: {hash:string; }; }):Promise<OffchainTokenData[]>
Defined in: chain.ts:1091
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
| Parameter | Type | Description |
|---|---|---|
request | { message: { 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; } | { ccipReceiveGasLimit: number; ccvAndExecutorHash: string; data: string; destBlob: string; destChainSelector: bigint; encodedMessage: string; executionGasLimit: number; feeToken: string; feeTokenAmount: bigint; finality: number; 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[]; }; tx: { hash: string; }; } | CCIP request, with tx.hash and message |
request.message | { 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; } | { ccipReceiveGasLimit: number; ccvAndExecutorHash: string; data: string; destBlob: string; destChainSelector: bigint; encodedMessage: string; executionGasLimit: number; feeToken: string; feeTokenAmount: bigint; finality: number; 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[]; } | - |
request.tx | { hash: string; } | Transaction that emitted the request. |
request.tx.hash | string | Transaction hash. |
Returns
Promise<OffchainTokenData[]>
Promise resolving to array with one offchain token data for each token transfer
Example
const offchainData = await source.getOffchainTokenData(request)
// Use in execution report
getOffRampsForRouter()
abstractgetOffRampsForRouter(router:string,sourceChainSelector:bigint):Promise<string[]>
Defined in: chain.ts:911
Fetch the OffRamps allowlisted in a Router. Used to discover OffRamp connected to an OnRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
router | string | Router contract address |
sourceChainSelector | bigint | Source chain selector |
Returns
Promise<string[]>
Promise resolving to array of OffRamp addresses
Example
const offRamps = await dest.getOffRampsForRouter(routerAddress, sourceSelector)
console.log(`Found ${offRamps.length} offRamp(s)`)
getOnRampForRouter()
abstractgetOnRampForRouter(router:string,destChainSelector:bigint):Promise<string>
Defined in: chain.ts:927
Fetch the OnRamp registered in a Router for a destination chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
router | string | Router contract address |
destChainSelector | bigint | Destination chain selector |
Returns
Promise<string>
Promise resolving to OnRamp address
Throws
CCIPLaneNotFoundError if no lane exists to destination
Example
const onRamp = await source.getOnRampForRouter(routerAddress, destSelector)
console.log(`OnRamp: ${onRamp}`)
getOnRampsForOffRamp()
abstractgetOnRampsForOffRamp(offRamp:string,sourceChainSelector:bigint):Promise<string[]>
Defined in: chain.ts:942
Fetch the OnRamps addresses set in OffRamp config. Used to discover OffRamp connected to an OnRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
offRamp | string | OffRamp contract address |
sourceChainSelector | bigint | Source chain selector |
Returns
Promise<string[]>
Promise resolving to OnRamps addresses
Example
const [onRamp] = await dest.getOnRampsForOffRamp(offRampAddress, sourceSelector)
console.log(`OnRamp: ${onRamp}`)
getRegistryTokenConfig()
abstractgetRegistryTokenConfig(registry:string,token:string):Promise<RegistryTokenConfig>
Defined in: chain.ts:1460
Fetch token configuration from a TokenAdminRegistry.
Parameters
| Parameter | Type | Description |
|---|---|---|
registry | string | TokenAdminRegistry contract address. |
token | string | Token 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
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.
getRouterForOffRamp()
abstractgetRouterForOffRamp(offRamp:string,sourceChainSelector:bigint):Promise<string>
Defined in: chain.ts:883
Fetch the Router address set in OffRamp config.
Parameters
| Parameter | Type | Description |
|---|---|---|
offRamp | string | OffRamp contract address |
sourceChainSelector | bigint | Source chain selector |
Returns
Promise<string>
Promise resolving to Router address
Throws
CCIPContractTypeInvalidError if address is not an OffRamp
Example
const router = await chain.getRouterForOffRamp(offRampAddress, sourceSelector)
console.log(`Router: ${router}`)
getRouterForOnRamp()
abstractgetRouterForOnRamp(onRamp:string,destChainSelector:bigint):Promise<string>
Defined in: chain.ts:867
Fetch the Router address set in OnRamp config. Used to discover OffRamp connected to OnRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
onRamp | string | OnRamp contract address |
destChainSelector | bigint | Destination chain selector |
Returns
Promise<string>
Promise resolving to Router address
Throws
CCIPContractTypeInvalidError if address is not an OnRamp
Example
const router = await chain.getRouterForOnRamp(onRampAddress, destSelector)
console.log(`Router: ${router}`)
getSupportedTokens()
abstractgetSupportedTokens(address:string,opts?: {page?:number; }):Promise<string[]>
Defined in: chain.ts:1437
List tokens supported by given TokenAdminRegistry contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string | Usually 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
const tokens = await chain.getSupportedTokens(registryAddress)
console.log(`${tokens.length} tokens supported`)
getTokenAdminRegistryFor()
abstractgetTokenAdminRegistryFor(address:string):Promise<string>
Defined in: chain.ts:1005
Fetch TokenAdminRegistry configured in a given OnRamp, Router, etc. Needed to map a source token to its dest counterparts.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string | Contract address (OnRamp, Router, etc.) |
Returns
Promise<string>
Promise resolving to TokenAdminRegistry address
Example
const registry = await chain.getTokenAdminRegistryFor(onRampAddress)
console.log(`Registry: ${registry}`)
getTokenForTokenPool()
abstractgetTokenForTokenPool(tokenPool:string):Promise<string>
Defined in: chain.ts:955
Fetch the TokenPool's token/mint.
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenPool | string | TokenPool address |
Returns
Promise<string>
Promise resolving to token or mint address
Example
const token = await chain.getTokenForTokenPool(tokenPoolAddress)
console.log(`Token: ${token}`)
getTokenInfo()
abstractgetTokenInfo(token:string):Promise<TokenInfo>
Defined in: chain.ts:968
Fetch token metadata.
Parameters
| Parameter | Type | Description |
|---|---|---|
token | string | Token address |
Returns
Promise<TokenInfo>
Promise resolving to token symbol, decimals, and optionally name
Example
const info = await chain.getTokenInfo(tokenAddress)
console.log(`${info.symbol}: ${info.decimals} decimals`)
getTokenPoolConfig()
abstractgetTokenPoolConfig(tokenPool:string,feeOpts?:TokenTransferFeeOpts):Promise<TokenPoolConfig>
Defined in: chain.ts:1489
Fetch configuration of a token pool.
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenPool | string | Token pool contract address. |
feeOpts? | TokenTransferFeeOpts | Optional 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:
typeAndVersionis always present (required) - Solana: Includes extra
tokenPoolProgramfield - Aptos: Standard fields only
- Sui/TON: Throws CCIPNotImplementedError
Example
// 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:1557
Fetch remote chain configuration for a token pool for a specific destination.
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenPool | string | Token pool address on the current chain. |
remoteChainSelector | bigint | Chain 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
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()
abstractgetTokenPoolRemotes(tokenPool:string,remoteChainSelector?:bigint):Promise<Record<string,TokenPoolRemote>>
Defined in: chain.ts:1532
Fetch remote chain configurations for a token pool.
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenPool | string | Token pool address on the current chain. |
remoteChainSelector? | bigint | Optional 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
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}`)
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:1688
Fetch the on-chain USD price of a token from the FeeQuoter or PriceRegistry.
Parameters
| Parameter | Type |
|---|---|
_opts | { router: string; timestamp?: number; token: string; } |
_opts.router | string |
_opts.timestamp? | number |
_opts.token | string |
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
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:1654
Estimate total fees for a cross-chain message.
Returns two components:
- ccipFee: from
Router.getFee(), denominated in the message'sfeeToken(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 - feeDeductedon the destination chain. Absent on pre-v2.0 lanes or data-only messages.
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | Omit<SendMessageOpts, "approveMax"> | SendMessageOpts without approveMax |
Returns
Promise<TotalFeesEstimate>
Promise resolving to TotalFeesEstimate
Throws
CCIPNotImplementedError if not implemented for this chain family
getTransaction()
abstractgetTransaction(hash:string):Promise<ChainTransaction>
Defined in: chain.ts:584
Fetch a transaction by its hash.
Parameters
| Parameter | Type | Description |
|---|---|---|
hash | string | Transaction hash |
Returns
Promise<ChainTransaction>
Promise resolving to generic transaction details
Throws
CCIPTransactionNotFoundError if transaction does not exist (transient)
Example
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: {offRamp:string;request: {lane: {destChainSelector:bigint;onRamp:string;sourceChainSelector:bigint;version:CCIPVersion; };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; };tx: {timestamp:number; }; }; } &Pick<LogFilter,"startBlock"|"watch"|"page">):Promise<CCIPVerifications>
Defined in: chain.ts:1233
Look for a CommitReport at dest for given CCIP request. May be specialized by some subclasses.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { offRamp: string; request: { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; 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; }; tx: { timestamp: number; }; }; } & Pick<LogFilter, "startBlock" | "watch" | "page"> | getVerifications options |
Returns
Promise<CCIPVerifications>
CCIPVerifications
Throws
CCIPCommitNotFoundError if no commit found for the request (transient)
Example
const verifications = await dest.getVerifications({
offRamp: offRampAddress,
request,
})
console.log(`Committed at block: ${verifications.log.blockNumber}`)
resolveExecuteOpts()
protectedresolveExecuteOpts(opts:ExecuteOpts):Promise<{input:ExecutionInput;offRamp:string; } & {forceBuffer?:boolean;forceLookupTable?:boolean;gasLimit?:number;tokensGasLimit?:number; }>
Defined in: chain.ts:1108
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
| Parameter | Type |
|---|---|
opts | ExecuteOpts |
Returns
Promise<{ input: ExecutionInput; offRamp: string; } & { forceBuffer?: boolean; forceLookupTable?: boolean; gasLimit?: number; tokensGasLimit?: number; }>
Throws
CCIPApiClientNotAvailableError if messageId is provided but no apiClient
sendMessage()
abstractsendMessage(opts:SendMessageOpts& {wallet:unknown; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: chain.ts:1071
Send a CCIP message through a router using provided wallet.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | SendMessageOpts & { 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
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}`)
typeAndVersion()
abstracttypeAndVersion(address:string):Promise<[string,string,string,string]>
Defined in: chain.ts:847
Fetch typeAndVersion for a given CCIP contract address.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string | CCIP contract address |
Returns
Promise<[string, string, string, string]>
Promise resolving to tuple:
type- Parsed type of the contract, e.g.OnRampversion- Parsed version of the contract, e.g.1.6.0typeAndVersion- Original (unparsed) typeAndVersion() stringsuffix- Suffix of the version, if any (e.g.-dev)
Throws
CCIPTypeVersionInvalidError if typeAndVersion string cannot be parsed
Example
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: {cancel$?:Promise<unknown>;finality?:number|"finalized";request: {log: {tx?: {timestamp:number; }; };tx?: {timestamp:number; }; }; }):Promise<true>
Defined in: chain.ts:606
Confirm a log tx is finalized or wait for it to be finalized.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { cancel$?: Promise<unknown>; finality?: number | "finalized"; request: { log: { tx?: { timestamp: number; }; }; tx?: { timestamp: number; }; }; } | Options containing the request, finality level, and optional cancel promise |
opts.cancel$? | Promise<unknown> | - |
opts.finality? | number | "finalized" | - |
opts.request | { log: { tx?: { timestamp: number; }; }; tx?: { timestamp: number; }; } | - |
opts.request.log | { tx?: { timestamp: number; }; } | - |
opts.request.log.tx? | { timestamp: number; } | Optional reference to the containing transaction. |
opts.request.log.tx.timestamp | number | Unix timestamp of the block. |
opts.request.tx? | { timestamp: number; } | Transaction that emitted the request. |
opts.request.tx.timestamp | number | Unix timestamp of the block. |
Returns
Promise<true>
true when the transaction is finalized
Throws
CCIPTransactionNotFinalizedError if the transaction is not included (e.g., due to a reorg)
Example
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')
}
}