Class: SuiChain
Defined in: sui/index.ts:84
Sui chain implementation supporting Sui networks. Note: This implementation is currently a placeholder.
Extends
Indexable
[key: symbol]: () => string
Constructors
Constructor
new SuiChain(
client:SuiJsonRpcClient,network:NetworkInfo<"SUI">,ctx?:ChainContext):SuiChain
Defined in: sui/index.ts:100
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
apiClient
readonlyapiClient:CCIPAPIClient|null
Defined in: chain.ts:326
CCIP API client (null if opted out)
Inherited from
apiRetryConfig
readonlyapiRetryConfig:Required<ApiRetryConfig> |null
Defined in: chain.ts:328
Retry configuration for API fallback operations (null if API client is disabled)
Inherited from
client
readonlyclient:SuiJsonRpcClient
Defined in: sui/index.ts:92
graphqlClient
readonlygraphqlClient:SuiGraphQLClient
Defined in: sui/index.ts:93
logger
logger:
Logger
Defined in: chain.ts:324
Inherited from
network
readonlynetwork:NetworkInfo<"SUI">
Defined in: sui/index.ts:91
Overrides
decimals
readonlystaticdecimals:9=9
Defined in: sui/index.ts:89
family
readonlystaticfamily:"SUI"=ChainFamily.Sui
Defined in: sui/index.ts:88
Methods
destroy()?
optionaldestroy():void|Promise<void>
Defined in: chain.ts:362
Cleanup method to release resources (e.g., close connections).
Returns
void | Promise<void>
Inherited from
estimateReceiveExecution()?
optionalestimateReceiveExecution(opts: {message: {data?:BytesLike;destTokenAmounts?: readonly {amount:bigint;token:string; }[];messageId:string;sender?:string;sourceChainSelector:bigint; };offRamp:string;receiver:string; }):Promise<number>
Defined in: chain.ts:1308
Estimate ccipReceive execution cost (gas, computeUnits) for this dest
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { message: { data?: BytesLike; destTokenAmounts?: readonly { amount: bigint; token: string; }[]; messageId: string; sender?: string; sourceChainSelector: bigint; }; offRamp: string; receiver: string; } | estimation options |
opts.message | { data?: BytesLike; destTokenAmounts?: readonly { amount: bigint; token: string; }[]; messageId: string; sender?: string; sourceChainSelector: bigint; } | - |
opts.message.data? | BytesLike | - |
opts.message.destTokenAmounts? | readonly { amount: bigint; token: string; }[] | - |
opts.message.messageId | string | - |
opts.message.sender? | string | - |
opts.message.sourceChainSelector | bigint | - |
opts.offRamp | string | - |
opts.receiver | string | - |
Returns
Promise<number>
estimated execution cost (gas or computeUnits)
Inherited from
Chain.estimateReceiveExecution
executeReport()
executeReport(
opts:ExecuteReportOpts& {wallet:unknown; } & {receiverObjectIds?:string[]; }):Promise<CCIPExecution>
Defined in: sui/index.ts:755
Execute messages in report in an offRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | ExecuteReportOpts & { wallet: unknown; } & { receiverObjectIds?: string[]; } | ExecuteReportOpts 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
generateUnsignedExecuteReport()
generateUnsignedExecuteReport(
_opts:ExecuteReportOpts& {payer:string; }):Promise<never>
Defined in: sui/index.ts:744
Generate unsigned tx to manuallyExecute a message.
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | ExecuteReportOpts & { payer: string; } | ExecuteReportOpts with payer address which will send the exec tx |
Returns
Promise<never>
Promise resolving to chain-family specific unsigned txs
Overrides
Chain.generateUnsignedExecuteReport
generateUnsignedSendMessage()
generateUnsignedSendMessage(
_opts:SendMessageOpts& {sender:string; }):Promise<never>
Defined in: sui/index.ts:726
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:569
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
Overrides
getBlockTimestamp()
getBlockTimestamp(
block:number|"finalized"):Promise<number>
Defined in: sui/index.ts:162
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
Overrides
getCommitReport()
getCommitReport(
opts: {commitStore:string;request: {lane:Lane<CCIPVersion>;message: {sequenceNumber:bigint; } | {sequenceNumber:bigint; } | {sequenceNumber:bigint; } | {sequenceNumber:bigint; } | {sequenceNumber:bigint; };tx: {timestamp:number; }; }; } &Pick<LogFilter,"startBlock"|"watch"|"page">):Promise<CCIPCommit>
Defined in: chain.ts:968
Look for a CommitReport at dest for given CCIP request. May be specialized by some subclasses.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { commitStore: string; request: { lane: Lane<CCIPVersion>; message: { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; }; tx: { timestamp: number; }; }; } & Pick<LogFilter, "startBlock" | "watch" | "page"> | getCommitReport options |
Returns
Promise<CCIPCommit>
CCIPCommit info
Throws
CCIPCommitNotFoundError if no commit found for the request (transient)
Example
const commit = await dest.getCommitReport({
commitStore: offRampAddress, // v1.6+
request,
})
console.log(`Committed at block: ${commit.log.blockNumber}`)
Inherited from
getCommitStoreForOffRamp()
getCommitStoreForOffRamp(
offRamp:string):Promise<string>
Defined in: sui/index.ts:397
Fetch the CommitStore set in OffRamp config (CCIP v1.5 and earlier). For CCIP v1.6 and later, it should return the offRamp address.
Parameters
| Parameter | Type | Description |
|---|---|---|
offRamp | string | OffRamp contract address |
Returns
Promise<string>
Promise resolving to CommitStore address
Overrides
Chain.getCommitStoreForOffRamp
getExecutionReceipts()
getExecutionReceipts(
opts: {commit?:CCIPCommit;messageId?:string;offRamp:string;sourceChainSelector?:bigint; } &Pick<LogFilter,"startBlock"|"startTime"|"watch"|"page">):AsyncIterableIterator<CCIPExecution>
Defined in: chain.ts:1039
Default/generic implementation of getExecutionReceipts. Yields execution receipts for a given offRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { commit?: CCIPCommit; messageId?: string; offRamp: string; sourceChainSelector?: bigint; } & 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
}
Inherited from
getFee()
getFee(
_opts:Omit<SendMessageOpts,"approveMax">):Promise<bigint>
Defined in: sui/index.ts:721
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<never>
Defined in: sui/index.ts:880
Fetch list and info of supported feeTokens.
Parameters
| Parameter | Type | Description |
|---|---|---|
_router | string | Router address on this chain |
Returns
Promise<never>
Promise resolving to mapping of token addresses to TokenInfo objects
Overrides
getLaneLatency()
getLaneLatency(
destChainSelector:bigint):Promise<LaneLatencyResponse>
Defined in: chain.ts:1013
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) |
Returns
Promise<LaneLatencyResponse>
Promise resolving to LaneLatencyResponse containing:
lane.sourceNetworkInfo- Source chain metadata (name, selector, chainId)lane.destNetworkInfo- Destination chain metadatalane.routerAddress- Router contract address on source chaintotalMs- 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.
Example
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`)
console.log(`Router: ${latency.lane.routerAddress}`)
} catch (err) {
if (err instanceof CCIPHttpError) {
console.error(`API error: ${err.context.apiErrorCode}`)
}
}
Inherited from
getLogs()
getLogs(
opts:LogFilter& {versionAsHash?:boolean; }):AsyncGenerator<{address:string;blockNumber:number;data:Record<string,unknown>;index:number;topics:string[];transactionHash:string; },void,unknown>
Defined in: sui/index.ts:218
An async generator that yields logs based on the provided options.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | LogFilter & { versionAsHash?: boolean; } | 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
AsyncGenerator<{ address: string; blockNumber: 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
Overrides
getMessageById()
getMessageById(
messageId:string,_opts?: {onRamp?:string;page?:number; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: chain.ts:568
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,commit:Pick<CommitReport,"minSeqNr"|"maxSeqNr">,opts?: {page?:number; }):Promise<R["message"][]>
Defined in: sui/index.ts:242
Fetches all CCIP messages contained in a given commit batch.
Type Parameters
| Type Parameter | Description |
|---|---|
R extends { lane: Lane<CCIPVersion>; log: { } & { } & { }; message: { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; }; } |
Parameters
| Parameter | Type | Description |
|---|---|---|
request | R | CCIPRequest to fetch batch for |
commit | Pick<CommitReport, "minSeqNr" | "maxSeqNr"> | CommitReport range (min, max) |
opts? | { page?: number; } | Optional parameters (e.g., page for pagination width) |
opts.page? | number | - |
Returns
Promise<R["message"][]>
Array of messages in the batch
Overrides
getMessagesInTx()
getMessagesInTx(
tx:string|ChainTransaction):Promise<CCIPRequest<CCIPVersion>[]>
Defined in: chain.ts:512
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}`)
}
Inherited from
getNativeTokenForRouter()
getNativeTokenForRouter():
Promise<string>
Defined in: sui/index.ts:301
Get the native token address for a Router.
Returns
Promise<string>
Promise resolving to native token address (usually wrapped)
Overrides
getOffchainTokenData()
getOffchainTokenData(
request:CCIPRequest):Promise<OffchainTokenData[]>
Defined in: sui/index.ts:738
Fetch supported offchain token data for a request from this network.
Parameters
| Parameter | Type | Description |
|---|---|---|
request | CCIPRequest | CCIP request, with tx, logs and message |
Returns
Promise<OffchainTokenData[]>
Promise resolving to array with one offchain token data for each token transfer
Overrides
getOffRampsForRouter()
getOffRampsForRouter(
router:string,_sourceChainSelector:bigint):Promise<string[]>
Defined in: sui/index.ts:307
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
getOnRampForOffRamp()
getOnRampForOffRamp(
offRamp:string,sourceChainSelector:bigint):Promise<string>
Defined in: sui/index.ts:324
Fetch the OnRamp address 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 OnRamp address
Throws
CCIPDataFormatUnsupportedError if view call fails
Overrides
getOnRampForRouter()
getOnRampForRouter(
router:string,_destChainSelector:bigint):Promise<string>
Defined in: sui/index.ts:315
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
Overrides
getRegistryTokenConfig()
getRegistryTokenConfig(
_address:string,_tokenName:string):Promise<never>
Defined in: sui/index.ts:865
Fetch token configuration from a TokenAdminRegistry.
Parameters
| Parameter | Type | Description |
|---|---|---|
_address | string | TokenAdminRegistry contract address. |
_tokenName | string | Token address to query. |
Returns
Promise<never>
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
getRouterForOffRamp()
getRouterForOffRamp(
offRamp:string,_sourceChainSelector:bigint):Promise<string>
Defined in: sui/index.ts:296
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
CCIPContractNotRouterError always (Sui architecture doesn't have separate router)
Overrides
getRouterForOnRamp()
getRouterForOnRamp(
onRamp:string,_destChainSelector:bigint):Promise<string>
Defined in: sui/index.ts:287
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
Overrides
getSupportedTokens()
getSupportedTokens(
_address:string):Promise<string[]>
Defined in: sui/index.ts:860
List tokens supported by given TokenAdminRegistry contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
_address | 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):Promise<string>
Defined in: sui/index.ts:574
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
Overrides
Chain.getTokenAdminRegistryFor
getTokenForTokenPool()
getTokenForTokenPool(
tokenPool:string):Promise<string>
Defined in: sui/index.ts:406
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:507
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):Promise<never>
Defined in: sui/index.ts:870
Fetch configuration of a token pool.
Parameters
| Parameter | Type | Description |
|---|---|---|
_tokenPool | string | Token pool contract address. |
Returns
Promise<never>
TokenPoolConfig containing token, router, and version info.
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:1238
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):Promise<never>
Defined in: sui/index.ts:875
Fetch remote chain configurations for a token pool.
Parameters
| Parameter | Type | Description |
|---|---|---|
_tokenPool | string | Token pool address on the current chain. |
Returns
Promise<never>
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
getTransaction()
getTransaction(
hash:string|number):Promise<ChainTransaction>
Defined in: sui/index.ts:171
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
sendMessage()
sendMessage(
_opts:SendMessageOpts& {wallet:unknown; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: sui/index.ts:733
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
Overrides
typeAndVersion()
typeAndVersion(
address:string):Promise<[string,string,string,string]>
Defined in: sui/index.ts:259
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: {cancel$?:Promise<unknown>;finality?:number|"finalized";request: {log: { } & { } & { } & { } & {tx?: {timestamp:number; }; };tx?: {timestamp:number; }; }; }):Promise<true>
Defined in: chain.ts:428
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; }; } | Log event from the OnRamp. |
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')
}
}
Inherited from
buildMessageForDest()
staticbuildMessageForDest(message:MessageInput):AnyMessage& {extraArgs:SuiExtraArgsV1; }
Defined in: sui/index.ts:885
ChainStatic.buildMessageForDest
Parameters
| Parameter | Type |
|---|---|
message | MessageInput |
Returns
AnyMessage & { extraArgs: 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:630
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):EVMExtraArgsV1& {allowOutOfOrderExecution:boolean; } & {_tag:"EVMExtraArgsV2"; } |SVMExtraArgsV1& {_tag:"SVMExtraArgsV1"; } |undefined
Defined in: sui/index.ts:605
Decodes extra arguments from Sui CCIP messages.
Parameters
| Parameter | Type | Description |
|---|---|---|
extraArgs | BytesLike | Encoded extra arguments bytes. |
Returns
EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; }
SVMExtraArgsV1 & { _tag: "SVMExtraArgsV1"; }
undefined
Decoded extra arguments or undefined if unknown format.
decodeMessage()
staticdecodeMessage(log:Log_):CCIPMessage|undefined
Defined in: sui/index.ts:585
Decodes a CCIP message from a Sui log event.
Parameters
| Parameter | Type | Description |
|---|---|---|
log | Log_ | 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:664
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(_extraArgs:ExtraArgs):string
Defined in: sui/index.ts:620
Encodes extra arguments for CCIP messages.
Parameters
| Parameter | Type | Description |
|---|---|---|
_extraArgs | ExtraArgs | Extra arguments to encode. |
Returns
string
Encoded extra arguments as a hex string.
Throws
CCIPNotImplementedError always (not yet implemented)
fromUrl()
staticfromUrl(url:string,ctx?:ChainContext):Promise<SuiChain>
Defined in: sui/index.ts:131
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:BytesLike| readonlynumber[]):string
Defined in: sui/index.ts:698
Converts bytes to a Sui address.
Parameters
| Parameter | Type | Description |
|---|---|---|
bytes | BytesLike | readonly number[] | Bytes to convert. |
Returns
string
Sui address.
getDestLeafHasher()
staticgetDestLeafHasher(lane:Lane,_ctx?:WithLogger):LeafHasher
Defined in: sui/index.ts:716
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:705
Validates a transaction hash format for Sui
Parameters
| Parameter | Type |
|---|---|
v | unknown |
Returns
v is string
parse()
staticparse(data:unknown):EVMExtraArgsV1& {allowOutOfOrderExecution:boolean; } & {_tag:"EVMExtraArgsV2"; } |SVMExtraArgsV1& {_tag:"SVMExtraArgsV1"; } |undefined
Defined in: sui/index.ts:852
Parses raw Sui data into typed structures.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | unknown | Raw data to parse. |
Returns
EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; }
SVMExtraArgsV1 & { _tag: "SVMExtraArgsV1"; }
undefined
Parsed data or undefined.