Class: SuiChain
Defined in: sui/index.ts:122
Sui chain implementation supporting Sui networks.
Extends
Indexable
[
key:symbol]: () =>string
Constructors
Constructor
new SuiChain(
client:SuiJsonRpcClient,network:NetworkInfo<"SUI">,ctx?:ChainContext):SuiChain
Defined in: sui/index.ts:137
Creates a new SuiChain instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | SuiJsonRpcClient | Sui client for interacting with the Sui network. |
network | NetworkInfo<"SUI"> | Network information for this chain. |
ctx? | ChainContext | - |
Returns
SuiChain
Overrides
Chain<typeof ChainFamily.Sui>.constructor
Properties
abort
readonlyabort:AbortSignal
Defined in: chain.ts:740
Abort signal from ChainContext; fires when the chain should tear down.
Inherited from
apiClient
readonlyapiClient:CCIPAPIClient|null
Defined in: chain.ts:736
CCIP API client (null if opted out)
Inherited from
apiRetryConfig
readonlyapiRetryConfig:Required<ApiRetryConfig> |null
Defined in: chain.ts:738
Retry configuration for API fallback operations (null if API client is disabled)
Inherited from
client
readonlyclient:SuiJsonRpcClient
Defined in: sui/index.ts:130
destroy
destroy: (
reason?:unknown) =>void
Defined in: chain.ts:779
Cleanup method to release resources (e.g., close connections).
Parameters
| Parameter | Type |
|---|---|
reason? | unknown |
Returns
void
Inherited from
logger
logger:
Logger
Defined in: chain.ts:734
Inherited from
network
readonlynetwork:NetworkInfo<"SUI">
Defined in: sui/index.ts:129
Overrides
decimals
readonlystaticdecimals:9=9
Defined in: sui/index.ts:127
family
readonlystaticfamily:"SUI"=ChainFamily.Sui
Defined in: sui/index.ts:126
Methods
estimateReceiveExecution()?
optionalestimateReceiveExecution(opts: {message:Omit<EstimateMessageInput,"onRampAddress"|"offRampAddress">;offRamp:string; } | {messageId:string; }):Promise<number>
Defined in: chain.ts:2397
Estimate ccipReceive execution cost (gas, computeUnits) for this destination chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
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)
Inherited from
Chain.estimateReceiveExecution
execute()
execute(
opts: ExecuteOpts & { wallet: unknown; } & {receiverObjectIds?:string[]; }):Promise<CCIPExecution>
Defined in: sui/index.ts:1845
Execute messages in report in an offRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | ExecuteOpts & { wallet: unknown; } & { receiverObjectIds?: string[]; } | ExecuteOpts with chain-specific wallet to sign and send tx. |
Returns
Promise<CCIPExecution>
Promise resolving to transaction of the execution.
Throws
CCIPError if transaction submission fails
Throws
CCIPExecTxRevertedError if transaction reverts
Overrides
generateUnsignedExecute()
generateUnsignedExecute(
opts:ExecuteOpts& {payer:string; }):Promise<UnsignedSuiTx>
Defined in: sui/index.ts:1820
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<UnsignedSuiTx>
Promise resolving to chain-family specific unsigned txs
Throws
CCIPExecutionReportChainMismatchError if input is not a Sui v1.6 execution report
Overrides
generateUnsignedSendMessage()
generateUnsignedSendMessage(
_opts:SendMessageOpts& {sender:string; }):Promise<never>
Defined in: sui/index.ts:1379
Generate unsigned txs for ccipSend'ing a message.
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | SendMessageOpts & { sender: string; } | SendMessageOpts with sender address |
Returns
Promise<never>
Promise resolving to chain-family specific unsigned txs
Overrides
Chain.generateUnsignedSendMessage
getBalance()
getBalance(
opts:GetBalanceOpts):Promise<bigint>
Defined in: sui/index.ts:1145
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
CCIPArgumentInvalidError if holder or token is invalid
Overrides
getBlockInfo()
getBlockInfo(
block:number|"finalized"|"latest"):Promise<BlockInfo>
Defined in: sui/index.ts:323
Gets checkpoint metadata for a sequence number or tag. Sui checkpoints are finalized once committed, so 'finalized' and 'latest' both resolve to the latest checkpoint. Non-positive numbers are treated as depths relative to latest (e.g. -5 means 5 checkpoints behind latest).
Parameters
| Parameter | Type | Description |
|---|---|---|
block | number | "finalized" | "latest" | Checkpoint sequence number, depth, or tag. |
Returns
Promise<BlockInfo>
Checkpoint number and Unix timestamp (seconds).
Overrides
getBlockTimestamp()
getBlockTimestamp(
block:number|bigint|"finalized"|"latest"):Promise<number>
Defined in: chain.ts:808
Fetch the timestamp of a given block.
Parameters
| Parameter | Type | Description |
|---|---|---|
block | number | bigint | "finalized" | "latest" | Block number or finality tag |
Returns
Promise<number>
Unix timestamp in seconds
Deprecated
Use Chain.getBlockInfo instead.
Inherited from
getExecutionInput()
getExecutionInput(
opts: {request:CCIPRequest;verifications:CCIPVerifications; } &Pick<LogFilter,"page">):Promise<ExecutionInput>
Defined in: chain.ts:1074
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
Inherited from
getExecutionReceipts()
getExecutionReceipts(
opts: {messageId?:string;offRamp:string;sourceChainSelector?:bigint;verifications?:CCIPVerifications; } &Pick<LogFilter,"page"|"startBlock"|"startTime"|"watch">):AsyncIterableIterator<CCIPExecution>
Defined in: sui/index.ts:791
Yields execution receipts for an offramp (Sui override of Chain.getExecutionReceipts).
Sui fullnodes can no longer serve event queries over ranges whose txs were pruned from the event-tx linkage ("Could not find the referenced transaction events", on every provider tested); the indexer's transaction listing by the offramp's execution moves is the only queryable event source, and each listed tx carries its ExecutionStateChanged or SkippedAlreadyExecuted events.
Parameters
| Parameter | Type |
|---|---|
opts | { messageId?: string; offRamp: string; sourceChainSelector?: bigint; verifications?: CCIPVerifications; } & Pick<LogFilter, "page" | "startBlock" | "startTime" | "watch"> |
Returns
AsyncIterableIterator<CCIPExecution>
Overrides
getFee()
getFee(
opts:Omit<SendMessageOpts,"approveMax">):Promise<bigint>
Defined in: sui/index.ts:1339
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
Overrides
getFeeTokens()
getFeeTokens(
router:string):Promise<Record<string,TokenInfo>>
Defined in: sui/index.ts:2114
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
Overrides
getLaneFeatures()
getLaneFeatures(
opts: {destChainSelector:bigint;router:string;token?:string; }):Promise<Partial<LaneFeatures>>
Defined in: chain.ts:1835
Retrieve features for a lane (router/destChainSelector/token triplet).
Parameters
| Parameter | Type |
|---|---|
opts | { destChainSelector: bigint; router: string; token?: string; } |
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
Get lane features
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')
}
Inherited from
getLaneLatency()
getLaneLatency(
destChainSelector:bigint,numberOfBlocks?:number):Promise<LaneLatencyResponse>
Defined in: chain.ts:1794
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
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
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
const latency = await chain.getLaneLatency(4949039107694359620n, 10)
console.log(`Latency with 10 confirmations: ${Math.round(latency.totalMs / 60000)} minutes`)
Inherited from
getLogs()
getLogs(
opts: {address?:string;endBefore?:string;endBlock?:number|bigint|"finalized"|"latest";page?:number|bigint;startBlock?:number|bigint;startTime?:number|bigint;topics?: (string|string[] |null)[];typeAndVersions?: readonly (string|RegExp)[];watch?:boolean|AbortSignal; } & {versionAsHash?:boolean; }):AsyncGenerator<{address:string;blockNumber:number;blockTimestamp:number;data:Record<string,unknown>;index:number;topics:string[];transactionHash:string; },void,unknown>
Defined in: sui/index.ts:393
An async generator that yields logs based on the provided options.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: number | bigint; startBlock?: number | bigint; startTime?: number | bigint; topics?: (string | string[] | null)[]; typeAndVersions?: readonly (string | RegExp)[]; watch?: boolean | AbortSignal; } & { versionAsHash?: boolean; } | 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 - 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 |
Returns
AsyncGenerator<{ address: string; blockNumber: number; blockTimestamp: number; data: Record<string, unknown>; index: number; topics: string[]; transactionHash: string; }, void, unknown>
An async iterable iterator of logs.
Throws
CCIPLogsAddressRequiredError if address is not provided
Throws
CCIPTopicsInvalidError if topics format is invalid (thrown by streamSuiLogs)
Overrides
getMessageById()
getMessageById(
messageId:string,_opts?: {onRamp?:string;page?:number; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: chain.ts:1022
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
Inherited from
getMessagesInBatch()
getMessagesInBatch<
R>(request:R,range:Pick<CommitReport,"minSeqNr"|"maxSeqNr">,opts?: {page?:number; }):Promise<R["message"][]>
Defined in: chain.ts:1052
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
| 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
Get all messages in a batch
const verifications = await dest.getVerifications({ offRamp, request })
const messages = await source.getMessagesInBatch(request, verifications.report)
console.log(`Found ${messages.length} messages in batch`)
Inherited from
getMessagesInRange()
getMessagesInRange(
opts: {address?:string;endBefore?:string;endBlock?:number|bigint|"finalized"|"latest";page?: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:988
Discover and decode CCIP messages within a block/slot/checkpoint range.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { address?: string; endBefore?: string; endBlock?: number | bigint | "finalized" | "latest"; page?: 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? | string | Contract address to filter logs by. |
opts.endBefore? | string | Cursor 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 | bigint | Page size for pagination. |
opts.startBlock? | number | bigint | Starting block number (inclusive). Required unless startTime is provided; explicit 0 is allowed. |
opts.startTime? | number | bigint | Starting 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 | AbortSignal | watch 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
- getMessagesInBatch - Batch discovery by sequence number range
- getMessagesInTx - Per-transaction message discovery
Example
Scan a block range on EVM
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}`)
}
Inherited from
getMessagesInTx()
getMessagesInTx(
tx:string|ChainTransaction):Promise<CCIPRequest<CCIPVersion>[]>
Defined in: chain.ts:929
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
Get messages from transaction
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}`)
}
Inherited from
getNativeTokenForRouter()
getNativeTokenForRouter():
Promise<string>
Defined in: sui/index.ts:689
Get the native token address for a Router.
Returns
Promise<string>
Promise resolving to native token address (usually wrapped)
Overrides
getOffchainTokenData()
getOffchainTokenData(
request: {log: { };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;destGasAmount:bigint;destTokenAddress:string;extraData:string;sourcePoolAddress:string;token:string; }[]; } | {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: readonlystring[]; } | {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; }[]; } | {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:1571
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 | { log: { }; 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; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; token: string; }[]; } | { 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; }[]; } | { 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 | { 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; }[]; } | { 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; }[]; } | { 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
const offchainData = await source.getOffchainTokenData(request)
// Use in execution report
Inherited from
getOffRampConfig()
getOffRampConfig(
offRamp:string,sourceChainSelector:bigint):Promise<{chainSelector:bigint;feeQuoter:string;isEnabled:boolean;isRmnVerificationDisabled:boolean;latestPriceSequenceNumber:bigint;minSeqNr:bigint;nonceManager:string;onRamps:string[];owner:string;permissionlessExecutionThresholdSeconds:number;rmnRemote:string;rmnRemoteConfig:SuiRmnRemoteConfig|undefined;router:string;sourceChainSelector:bigint;tokenAdminRegistry:string;typeAndVersion:string; }>
Defined in: sui/index.ts:647
Fetch the full OffRamp configuration for a given source chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
offRamp | string | OffRamp contract address. |
sourceChainSelector | bigint | Source chain selector. |
Returns
Promise<{ chainSelector: bigint; feeQuoter: string; isEnabled: boolean; isRmnVerificationDisabled: boolean; latestPriceSequenceNumber: bigint; minSeqNr: bigint; nonceManager: string; onRamps: string[]; owner: string; permissionlessExecutionThresholdSeconds: number; rmnRemote: string; rmnRemoteConfig: SuiRmnRemoteConfig | undefined; router: string; sourceChainSelector: bigint; tokenAdminRegistry: string; typeAndVersion: string; }>
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[]).
Overrides
getOffRampsForRouter()
getOffRampsForRouter(
router:string,_sourceChainSelector:bigint):Promise<string[]>
Defined in: sui/index.ts:695
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
Overrides
getOnRampConfig()
getOnRampConfig(
onRamp:string,destChainSelector:bigint):Promise<{allowedSenders:string[];allowlistAdmin:string;allowlistEnabled:boolean;chainSelector:bigint;destChainSelector:bigint;destRouter:string;expectedNextSequenceNumber:bigint;feeAggregator:string;feeQuoter:string;feeQuoterConfig:SuiFeeQuoterConfig|undefined;nonceManager:string;owner:string;rmnRemote:string;rmnRemoteConfig:SuiRmnRemoteConfig|undefined;router:string;sequenceNumber:bigint;tokenAdminRegistry:string;typeAndVersion:string; }>
Defined in: sui/index.ts:584
Fetch the full OnRamp configuration for a given destination chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
onRamp | string | OnRamp contract address. |
destChainSelector | bigint | Destination chain selector. |
Returns
Promise<{ allowedSenders: string[]; allowlistAdmin: string; allowlistEnabled: boolean; chainSelector: bigint; destChainSelector: bigint; destRouter: string; expectedNextSequenceNumber: bigint; feeAggregator: string; feeQuoter: string; feeQuoterConfig: SuiFeeQuoterConfig | undefined; nonceManager: string; owner: string; rmnRemote: string; rmnRemoteConfig: SuiRmnRemoteConfig | undefined; router: string; sequenceNumber: bigint; tokenAdminRegistry: string; typeAndVersion: string; }>
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.
Overrides
getOnRampForRouter()
getOnRampForRouter(
router:string,destChainSelector:bigint):Promise<string>
Defined in: sui/index.ts:723
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
CCIPError if no onramp of the deployment serves destChainSelector
Overrides
getOnRampsForOffRamp()
getOnRampsForOffRamp(
offRamp:string,sourceChainSelector:bigint):Promise<string[]>
Defined in: chain.ts:1275
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
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
const [onRamp] = await dest.getOnRampsForOffRamp(offRampAddress, sourceSelector)
console.log(`OnRamp: ${onRamp}`)
Inherited from
getRegistryTokenConfig()
getRegistryTokenConfig(
registry:string,token:string):Promise<{administrator:string;pendingAdministrator?:string;tokenPool?:string; }>
Defined in: sui/index.ts:1920
Fetch token configuration from a TokenAdminRegistry.
Parameters
| Parameter | Type | Description |
|---|---|---|
registry | string | TokenAdminRegistry contract address. |
token | string | Token address to query. |
Returns
Promise<{ administrator: string; pendingAdministrator?: string; tokenPool?: string; }>
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.
Overrides
getRequiredCCVs()?
optionalgetRequiredCCVs(opts: {message:GetRequiredCCVsMessage;offRamp:string; }):Promise<GetRequiredCCVsResult>
Defined in: chain.ts:2415
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
| Parameter | Type | Description |
|---|---|---|
opts | { message: GetRequiredCCVsMessage; offRamp: string; } | Destination OffRamp (v2.0) address and the candidate message (GetRequiredCCVsMessage). |
opts.message | GetRequiredCCVsMessage | - |
opts.offRamp | string | - |
Returns
Promise<GetRequiredCCVsResult>
{ requiredCCVs, optionalCCVs, optionalThreshold }.
Inherited from
getRouterForOffRamp()
getRouterForOffRamp(
offRamp:string,sourceChainSelector:bigint):Promise<string>
Defined in: chain.ts:1209
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
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
const router = await chain.getRouterForOffRamp(offRampAddress, sourceSelector)
console.log(`Router: ${router}`)
Inherited from
getRouterForOnRamp()
getRouterForOnRamp(
onRamp:string,destChainSelector:bigint):Promise<string>
Defined in: chain.ts:1187
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
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
const router = await chain.getRouterForOnRamp(onRampAddress, destSelector)
console.log(`Router: ${router}`)
Inherited from
getSupportedTokens()
getSupportedTokens(
registry:string):Promise<string[]>
Defined in: sui/index.ts:1890
List tokens supported by given TokenAdminRegistry contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
registry | string | Usually TokenAdminRegistry, but chain may support receiving Router, OnRamp, etc. |
Returns
Promise<string[]>
Promise resolving to array of supported token addresses
Overrides
getTokenAdminRegistryFor()
getTokenAdminRegistryFor(
address:string,_destChainSelector?:bigint):Promise<string>
Defined in: sui/index.ts:1186
Gets the token admin registry for a ramp of this CCIP deployment.
The token admin registry is a module of the ccip package, reachable from
any ramp of the deployment through get_ccip_package_id.
Parameters
| Parameter | Type | Description |
|---|---|---|
address | string | Ramp (onramp/offramp) or router (ccip state object) address. |
_destChainSelector? | bigint | Unused on Sui (registry is global to the deployment). |
Returns
Promise<string>
Token admin registry address in package::module form.
Overrides
Chain.getTokenAdminRegistryFor
getTokenForTokenPool()
getTokenForTokenPool(
tokenPool:string):Promise<string>
Defined in: sui/index.ts:879
Fetch the TokenPool's token/mint.
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenPool | string | TokenPool address |
Returns
Promise<string>
Promise resolving to token or mint address
Throws
CCIPError if token pool type is invalid or state not found
Throws
CCIPDataFormatUnsupportedError if view call fails
Overrides
getTokenInfo()
getTokenInfo(
token:string):Promise<{decimals:number;symbol:string; }>
Defined in: sui/index.ts:1048
Fetch token metadata.
Parameters
| Parameter | Type | Description |
|---|---|---|
token | string | Token address |
Returns
Promise<{ decimals: number; symbol: string; }>
Promise resolving to token symbol, decimals, and optionally name
Throws
CCIPError if token address is invalid or metadata cannot be loaded
Overrides
getTokenPoolConfig()
getTokenPoolConfig(
tokenPool:string,_feeOpts?:TokenTransferFeeOpts):Promise<TokenPoolConfig>
Defined in: sui/index.ts:1987
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
Overrides
getTokenPoolRemote()
getTokenPoolRemote(
tokenPool:string,remoteChainSelector:bigint):Promise<TokenPoolRemote>
Defined in: chain.ts:2178
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.
Inherited from
getTokenPoolRemotes()
getTokenPoolRemotes(
tokenPool:string,remoteChainSelector?:bigint):Promise<Record<string,TokenPoolRemote>>
Defined in: sui/index.ts:2045
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.
Overrides
getTokenPrice()
getTokenPrice(
_opts: {router:string;timestamp?:number;token:string; }):Promise<TokenPrice>
Defined in: chain.ts:2337
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)}`)
Inherited from
getTotalFeesEstimate()
getTotalFeesEstimate(
_opts:Omit<SendMessageOpts,"approveMax">):Promise<TotalFeesEstimate>
Defined in: chain.ts:2303
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
Inherited from
getTransaction()
getTransaction(
hash:string|number):Promise<ChainTransaction>
Defined in: sui/index.ts:344
Fetch a transaction by its hash.
Parameters
| Parameter | Type | Description |
|---|---|---|
hash | string | number | Transaction hash |
Returns
Promise<ChainTransaction>
Promise resolving to generic transaction details
Overrides
getVerifications()
getVerifications(
opts: {indexer?: readonlystring[] |NetworkType;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; }; }; } &Pick<LogFilter,"page"|"startBlock"|"watch">):Promise<CCIPVerifications>
Defined in: chain.ts:1738
Look for a CommitReport at dest for given CCIP request. May be specialized by some subclasses.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { indexer?: readonly string[] | NetworkType; 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; }; }; } & Pick<LogFilter, "page" | "startBlock" | "watch"> | getVerifications options |
Returns
Promise<CCIPVerifications>
CCIPVerifications
Throws
CCIPCommitNotFoundError if no commit found for the request (transient)
Example
Get commit for a request
const verifications = await dest.getVerifications({
offRamp: offRampAddress,
request,
})
console.log(`Committed at block: ${verifications.log.blockNumber}`)
Inherited from
resolveExecuteOpts()
protectedresolveExecuteOpts(opts:ExecuteOpts):Promise<{input:ExecutionInput;offRamp:string; } & {forceBuffer?:boolean;forceLookupTable?:boolean;gasLimit?:number;receiver?:string;tokensGasLimit?:number;txGasLimit?:number; }>
Defined in: chain.ts:1588
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; receiver?: string; tokensGasLimit?: number; txGasLimit?: number; }>
Throws
CCIPApiClientNotAvailableError if messageId is provided but no apiClient
Inherited from
sendMessage()
sendMessage(
opts:SendMessageOpts& {txGasLimit?:number;wallet:unknown; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: sui/index.ts:1386
Send a CCIP message through a router using provided wallet.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | SendMessageOpts & { txGasLimit?: number; wallet: unknown; } | SendMessageOpts with chain-specific wallet for signing |
Returns
Promise<CCIPRequest<CCIPVersion>>
Promise resolving to CCIP request with message details
Overrides
simulateLockOrBurn()?
optionalsimulateLockOrBurn(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:2356
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
| Parameter | Type | Description |
|---|---|---|
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.amount | bigint | Amount in the source token's decimals |
opts.destChainSelector | bigint | Destination chain selector |
opts.finality? | FinalityRequested | Requested finality (v2 pools take it as the 2nd lockOrBurn argument) |
opts.onRamp | string | OnRamp registered on the source Router for the destination chain |
opts.originalSender? | string | Sender of the prospective message |
opts.receiver? | string | Receiver on the destination chain |
opts.token | string | Source token address |
opts.tokenArgs? | string | Message-level GenericExtraArgsV3.tokenArgs, passed through to IPoolV2 pools |
opts.tokenReceiver? | string | Token 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
Inherited from
typeAndVersion()
typeAndVersion(
address:string):Promise<[string,string,string,string]>
Defined in: sui/index.ts:433
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
CCIPDataFormatUnsupportedError if view call fails
Overrides
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:854
Confirm a log tx is finalized or wait for it to be finalized.
Parameters
| Parameter | Type | Description |
|---|---|---|
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
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')
}
}
Inherited from
buildMessageForDest()
staticbuildMessageForDest(message:MessageInput):AnyMessage& {extraArgs:SuiExtraArgsV1; }
Defined in: sui/index.ts:2141
Returns a copy of a message, populating missing fields like extraArgs with defaults.
It's expected to return a message suitable at least for basic token transfers.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | MessageInput | AnyMessage (from source), containing at least receiver |
Returns
AnyMessage & { extraArgs: SuiExtraArgsV1; }
A message suitable for sendMessage to this destination chain family
Throws
CCIPArgumentInvalidError if extraArgs contains unknown fields for SuiExtraArgsV1
Overrides
Chain.buildMessageForDest
decodeCommits()
staticdecodeCommits(log: {data:Record<string,unknown> |BytesLike; },lane?:Lane<CCIPVersion>): {maxSeqNr:bigint;merkleRoot:string;minSeqNr:bigint;onRampAddress:string;sourceChainSelector:bigint; }[] |undefined
Defined in: sui/index.ts:1247
Decodes commit reports from a log entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
log | { data: Record<string, unknown> | BytesLike; } | The log entry to decode. |
log.data | Record<string, unknown> | BytesLike | Log data as bytes or parsed object. |
lane? | Lane<CCIPVersion> | Optional lane information. |
Returns
{ maxSeqNr: bigint; merkleRoot: string; minSeqNr: bigint; onRampAddress: string; sourceChainSelector: bigint; }[] | undefined
Array of decoded commit reports or undefined.
decodeExtraArgs()
staticdecodeExtraArgs(extraArgs:BytesLike):SVMExtraArgsV1& {_tag:"SVMExtraArgsV1"; } |EVMExtraArgsV1& {allowOutOfOrderExecution:boolean; } & {_tag:"EVMExtraArgsV2"; } |EVMExtraArgsV1& {allowOutOfOrderExecution:boolean; } & {receiverObjectIds:string[];tokenReceiver:string; } & {_tag:"SuiExtraArgsV1"; } |undefined
Defined in: sui/index.ts:1218
Decodes extra arguments from Sui CCIP messages.
Parameters
| Parameter | Type | Description |
|---|---|---|
extraArgs | BytesLike | Encoded extra arguments bytes. |
Returns
Decoded extra arguments or undefined if unknown format.
SVMExtraArgsV1 & { _tag: "SVMExtraArgsV1"; }
EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; }
EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { receiverObjectIds: string[]; tokenReceiver: string; } & { _tag: "SuiExtraArgsV1"; }
undefined
decodeMessage()
staticdecodeMessage(log:ChainLog):CCIPMessage|undefined
Defined in: sui/index.ts:1198
Decodes a CCIP message from a Sui log event.
Parameters
| Parameter | Type | Description |
|---|---|---|
log | ChainLog | Log event data. |
Returns
CCIPMessage | undefined
Decoded CCIPMessage or undefined if not valid.
Throws
CCIPSuiLogInvalidError if log data format is invalid
decodeReceipt()
staticdecodeReceipt(log: {data:Record<string,unknown> |BytesLike; }):ExecutionReceipt|undefined
Defined in: sui/index.ts:1281
Decodes an execution receipt from a log entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
log | { data: Record<string, unknown> | BytesLike; } | The log entry to decode. |
log.data | Record<string, unknown> | BytesLike | Log data as bytes or parsed object. |
Returns
ExecutionReceipt | undefined
Decoded execution receipt or undefined.
encodeExtraArgs()
staticencodeExtraArgs(args:ExtraArgs):string
Defined in: sui/index.ts:1237
Encodes extra arguments for Sui CCIP messages in BCS format. Dispatches to the correct encoder based on the destination chain's extraArgs type:
SVMExtraArgsV1(Solana dest): BCS{computeUnits, accountIsWritableBitmap, ...}SuiExtraArgsV1(Sui dest): BCS{gasLimit, allowOutOfOrderExecution, ...}EVMExtraArgsV2/GenericExtraArgsV2(EVM dest): BCS{gasLimit: u256, ...}
Parameters
| Parameter | Type | Description |
|---|---|---|
args | ExtraArgs | Extra arguments to encode. |
Returns
string
Encoded extra arguments as a hex string.
fromUrl()
staticfromUrl(url:string,ctx?:ChainContext):Promise<SuiChain>
Defined in: sui/index.ts:276
Creates a SuiChain instance from an RPC URL.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | HTTP or WebSocket endpoint URL for the Sui network. |
ctx? | ChainContext | - |
Returns
Promise<SuiChain>
A new SuiChain instance.
Throws
CCIPDataFormatUnsupportedError if unable to fetch chain identifier
Throws
CCIPError if chain identifier is not supported
getAddress()
staticgetAddress(bytes: readonlynumber[] |BytesLike):string
Defined in: sui/index.ts:1316
Converts bytes to a Sui address.
Parameters
| Parameter | Type | Description |
|---|---|---|
bytes | readonly number[] | BytesLike | Bytes to convert. |
Returns
string
Sui address in canonical short form (0x-prefixed hex, leading zero nibbles stripped).
getDestLeafHasher()
staticgetDestLeafHasher(lane:Lane,_ctx?:WithLogger):LeafHasher
Defined in: sui/index.ts:1334
Gets the leaf hasher for Sui destination chains.
Parameters
| Parameter | Type | Description |
|---|---|---|
lane | Lane | Lane configuration. |
_ctx? | WithLogger | - |
Returns
LeafHasher
Leaf hasher function.
isTxHash()
staticisTxHash(v:unknown):v is string
Defined in: sui/index.ts:1323
Validates a transaction hash format for Sui
Parameters
| Parameter | Type |
|---|---|
v | unknown |
Returns
v is string
parse()
staticparse(data:unknown):SVMExtraArgsV1& {_tag:"SVMExtraArgsV1"; } |EVMExtraArgsV1& {allowOutOfOrderExecution:boolean; } & {_tag:"EVMExtraArgsV2"; } |EVMExtraArgsV1& {allowOutOfOrderExecution:boolean; } & {receiverObjectIds:string[];tokenReceiver:string; } & {_tag:"SuiExtraArgsV1"; } |undefined
Defined in: sui/index.ts:1882
Parses raw Sui data into typed structures.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | unknown | Raw data to parse. |
Returns
Parsed data or undefined.
SVMExtraArgsV1 & { _tag: "SVMExtraArgsV1"; }
EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; }
EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { receiverObjectIds: string[]; tokenReceiver: string; } & { _tag: "SuiExtraArgsV1"; }
undefined