Skip to main content
Version: 1.6.2

Class: AptosChain

Defined in: aptos/index.ts:85

Aptos chain implementation supporting Aptos networks.

Extends​

Indexable​

[key: symbol]: () => string

Constructors​

Constructor​

new AptosChain(provider: Aptos, network: NetworkInfo, ctx?: ChainContext): AptosChain

Defined in: aptos/index.ts:107

Creates a new AptosChain instance.

Parameters​

ParameterTypeDescription
providerAptosAptos SDK provider instance.
networkNetworkInfoNetwork information for this chain.
ctx?ChainContext-

Returns​

AptosChain

Overrides​

Chain<typeof ChainFamily.Aptos>.constructor

Properties​

abort​

readonly abort: AbortSignal

Defined in: chain.ts:581

Abort signal from ChainContext; fires when the chain should tear down.

Inherited from​

Chain.abort


apiClient​

readonly apiClient: CCIPAPIClient | null

Defined in: chain.ts:577

CCIP API client (null if opted out)

Inherited from​

Chain.apiClient


apiRetryConfig​

readonly apiRetryConfig: Required<ApiRetryConfig> | null

Defined in: chain.ts:579

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

Inherited from​

Chain.apiRetryConfig


destroy​

destroy: (reason?: unknown) => void

Defined in: chain.ts:620

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

Parameters​

ParameterType
reason?unknown

Returns​

void

Inherited from​

Chain.destroy


getTokenInfo​

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

Defined in: aptos/index.ts:98

Retrieves token information for a given token address.

Parameters​

ParameterType
tokenstring

Returns​

Promise<TokenInfo>

Overrides​

Chain.getTokenInfo


logger​

logger: Logger

Defined in: chain.ts:575

Inherited from​

Chain.logger


network​

readonly network: NetworkInfo<"APTOS">

Defined in: chain.ts:574

Inherited from​

Chain.network


provider​

provider: Aptos

Defined in: aptos/index.ts:95

The Aptos SDK provider for blockchain interactions.


decimals​

readonly static decimals: 8 = 8

Defined in: aptos/index.ts:92

Native token decimals (8 for APT).


family​

readonly static family: "APTOS" = ChainFamily.Aptos

Defined in: aptos/index.ts:90

Chain family identifier for Aptos networks.

Methods​

estimateReceiveExecution()?​

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

Defined in: chain.ts:1859

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

Parameters​

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

Returns​

Promise<number>

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

Inherited from​

Chain.estimateReceiveExecution


execute()​

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

Defined in: aptos/index.ts:583

Execute messages in report in an offRamp.

Parameters​

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

Returns​

Promise<CCIPExecution>

Promise resolving to transaction of the execution.

Throws​

CCIPAptosWalletInvalidError if wallet is not a valid Aptos account

Overrides​

Chain.execute


generateUnsignedExecute()​

generateUnsignedExecute(__namedParameters: ExecuteOpts & { payer: string; }): Promise<UnsignedAptosTx>

Defined in: aptos/index.ts:553

Generate unsigned tx to manuallyExecute a message.

Parameters​

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

Returns​

Promise<UnsignedAptosTx>

Promise resolving to chain-family specific unsigned txs

Throws​

CCIPAptosExtraArgsV2RequiredError if message missing EVMExtraArgsV2 fields

Overrides​

Chain.generateUnsignedExecute


generateUnsignedSendMessage()​

generateUnsignedSendMessage(opts: SendMessageOpts & { sender: string; }): Promise<UnsignedAptosTx>

Defined in: aptos/index.ts:491

Generate unsigned txs for ccipSend'ing a message.

Parameters​

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

Returns​

Promise<UnsignedAptosTx>

Promise resolving to chain-family specific unsigned txs

Overrides​

Chain.generateUnsignedSendMessage


getBalance()​

getBalance(opts: GetBalanceOpts): Promise<bigint>

Defined in: aptos/index.ts:321

Query token balance for an address.

Parameters​

ParameterTypeDescription
optsGetBalanceOptsBalance query options

Returns​

Promise<bigint>

Token balance information including raw and formatted values

Overrides​

Chain.getBalance


getBlockTimestamp()​

getBlockTimestamp(version: number | "finalized"): Promise<number>

Defined in: aptos/index.ts:196

Fetch the timestamp of a given block.

Parameters​

ParameterTypeDescription
versionnumber | "finalized"Positive block number, negative finality depth, or 'finalized' tag

Returns​

Promise<number>

Promise resolving to timestamp of the block, in seconds

Overrides​

Chain.getBlockTimestamp


getExecutionInput()​

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

Defined in: chain.ts:911

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

Parameters​

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

Returns​

Promise<ExecutionInput>

input payload to be passed to execute

See​

execute - method to execute a message

Inherited from​

Chain.getExecutionInput


getExecutionReceipts()​

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

Defined in: chain.ts:1483

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

Parameters​

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

Returns​

AsyncIterableIterator<CCIPExecution>

Async generator of CCIPExecution receipts

Example​

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

Inherited from​

Chain.getExecutionReceipts


getFee()​

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

Defined in: aptos/index.ts:481

Fetch the current fee for a given intended message.

Parameters​

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

Returns​

Promise<bigint>

Fee amount in the feeToken's smallest units

Overrides​

Chain.getFee


getFeeTokens()​

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

Defined in: aptos/index.ts:853

Fetch list and info of supported feeTokens.

Parameters​

ParameterTypeDescription
routerstringRouter address on this chain

Returns​

Promise<Record<string, TokenInfo>>

Promise resolving to mapping of token addresses to TokenInfo objects

Overrides​

Chain.getFeeTokens


getLaneFeatures()​

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

Defined in: chain.ts:1456

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

Parameters​

ParameterTypeDescription
_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.destChainSelectorbigint-
_opts.routerstring-
_opts.token?string-

Returns​

Promise<Partial<LaneFeatures>>

Promise resolving to partial lane features record

Throws​

CCIPNotImplementedError if not implemented for this chain family

Example​

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

Inherited from​

Chain.getLaneFeatures


getLaneLatency()​

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

Defined in: chain.ts:1415

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

Parameters​

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

Returns​

Promise<LaneLatencyResponse>

Promise resolving to LaneLatencyResponse containing:

  • totalMs - Estimated delivery time in milliseconds

Throws​

CCIPApiClientNotAvailableError if apiClient was disabled (set to null)

Throws​

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​

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

Inherited from​

Chain.getLaneLatency


getLogs()​

getLogs(opts: LogFilter & { versionAsHash?: boolean; }): AsyncIterableIterator<ChainLog>

Defined in: aptos/index.ts:237

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

Parameters​

ParameterTypeDescription
optsLogFilter & { 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​

AsyncIterableIterator<ChainLog>

An async iterable iterator of logs.

Overrides​

Chain.getLogs


getMessageById()​

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

Defined in: chain.ts:859

Fetch a CCIP message by its unique message ID.

Parameters​

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

Returns​

Promise<CCIPRequest<CCIPVersion>>

CCIPRequest with metadata populated from API

Remarks​

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

Example​

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

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

Throws​

CCIPApiClientNotAvailableError if API disabled

Throws​

CCIPMessageIdNotFoundError if message not found

Throws​

CCIPOnRampRequiredError if onRamp is required but not provided

Throws​

CCIPHttpError if API request fails

Inherited from​

Chain.getMessageById


getMessagesInBatch()​

getMessagesInBatch<R>(request: R, range: Pick<CommitReport, "minSeqNr" | "maxSeqNr">, opts?: { page?: number; }): Promise<R["message"][]>

Defined in: chain.ts:889

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

Type Parameters​

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

Parameters​

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

Returns​

Promise<R["message"][]>

Array of messages in the batch

Throws​

CCIPMessageBatchIncompleteError if not all messages in range could be fetched

Example​

TypeScript
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​

Chain.getMessagesInBatch


getMessagesInRange()​

getMessagesInRange(opts: LogFilter): AsyncIterableIterator<CCIPRequest<CCIPVersion>>

Defined in: chain.ts:825

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

Parameters​

ParameterTypeDescription
optsLogFilterLogFilter options (startBlock, endBlock, address, topics, page)

Returns​

AsyncIterableIterator<CCIPRequest<CCIPVersion>>

Async iterator of CCIPRequest objects in native log order

Remarks​

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

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

Throws​

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

Throws​

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

See​

Example​

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

Inherited from​

Chain.getMessagesInRange


getMessagesInTx()​

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

Defined in: chain.ts:766

Fetch all CCIP requests in a transaction.

Parameters​

ParameterTypeDescription
txstring | ChainTransactionChainTransaction or txHash to fetch requests from

Returns​

Promise<CCIPRequest<CCIPVersion>[]>

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

Throws​

CCIPTransactionNotFoundError if transaction does not exist

Throws​

CCIPMessageNotFoundInTxError if no CCIPSendRequested events in tx

Example​

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

Inherited from​

Chain.getMessagesInTx


getNativeTokenForRouter()​

getNativeTokenForRouter(_router: string): Promise<string>

Defined in: aptos/index.ts:273

Get the native token address for a Router.

Parameters​

ParameterTypeDescription
_routerstringRouter contract address

Returns​

Promise<string>

Promise resolving to native token address (usually wrapped)

Overrides​

Chain.getNativeTokenForRouter


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: 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; }; tx: { hash: string; }; }): Promise<OffchainTokenData[]>

Defined in: chain.ts:1208

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

Parameters​

ParameterTypeDescription
request{ 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; }; 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; 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; }-
request.tx{ hash: string; }Transaction that emitted the request.
request.tx.hashstringTransaction hash.

Returns​

Promise<OffchainTokenData[]>

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

Example​

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

Inherited from​

Chain.getOffchainTokenData


getOffRampsForRouter()​

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

Defined in: aptos/index.ts:278

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

Parameters​

ParameterTypeDescription
routerstringRouter contract address
_sourceChainSelectorbigintSource chain selector

Returns​

Promise<string[]>

Promise resolving to array of OffRamp addresses

Overrides​

Chain.getOffRampsForRouter


getOnRampForRouter()​

getOnRampForRouter(router: string, _destChainSelector: bigint): Promise<string>

Defined in: aptos/index.ts:283

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

Parameters​

ParameterTypeDescription
routerstringRouter contract address
_destChainSelectorbigintDestination chain selector

Returns​

Promise<string>

Promise resolving to OnRamp address

Overrides​

Chain.getOnRampForRouter


getOnRampsForOffRamp()​

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

Defined in: aptos/index.ts:288

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

Parameters​

ParameterTypeDescription
offRampstringOffRamp contract address
sourceChainSelectorbigintSource chain selector

Returns​

Promise<string[]>

Promise resolving to OnRamps addresses

Overrides​

Chain.getOnRampsForOffRamp


getRegistryTokenConfig()​

getRegistryTokenConfig(registry: string, token: string): Promise<{ administrator: string; pendingAdministrator?: string; tokenPool?: string; }>

Defined in: aptos/index.ts:649

Fetch token configuration from a TokenAdminRegistry.

Parameters​

ParameterTypeDescription
registrystringTokenAdminRegistry contract address.
tokenstringToken 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.

Throws​

CCIPAptosTokenNotRegisteredError if token is not registered

Overrides​

Chain.getRegistryTokenConfig


getRouterForOffRamp()​

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

Defined in: aptos/index.ts:268

Fetch the Router address set in OffRamp config.

Parameters​

ParameterTypeDescription
offRampstringOffRamp contract address
_sourceChainSelectorbigintSource chain selector

Returns​

Promise<string>

Promise resolving to Router address

Overrides​

Chain.getRouterForOffRamp


getRouterForOnRamp()​

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

Defined in: aptos/index.ts:262

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

Parameters​

ParameterTypeDescription
onRampstringOnRamp contract address
_destChainSelectorbigintDestination chain selector

Returns​

Promise<string>

Promise resolving to Router address

Overrides​

Chain.getRouterForOnRamp


getSupportedTokens()​

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

Defined in: aptos/index.ts:627

List tokens supported by given TokenAdminRegistry contract.

Parameters​

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

Returns​

Promise<string[]>

Promise resolving to array of supported token addresses

Overrides​

Chain.getSupportedTokens


getTokenAdminRegistryFor()​

getTokenAdminRegistryFor(address: string): Promise<string>

Defined in: aptos/index.ts:336

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

Parameters​

ParameterTypeDescription
addressstringContract address (OnRamp, Router, etc.)

Returns​

Promise<string>

Promise resolving to TokenAdminRegistry address

Throws​

CCIPAptosRegistryTypeInvalidError if registry type is invalid

Overrides​

Chain.getTokenAdminRegistryFor


getTokenForTokenPool()​

getTokenForTokenPool(tokenPool: string): Promise<string>

Defined in: aptos/index.ts:300

Fetch the TokenPool's token/mint.

Parameters​

ParameterTypeDescription
tokenPoolstringTokenPool address

Returns​

Promise<string>

Promise resolving to token or mint address

Overrides​

Chain.getTokenForTokenPool


getTokenPoolConfig()​

getTokenPoolConfig(tokenPool: string, _feeOpts?: TokenTransferFeeOpts): Promise<{ router: string; token: string; typeAndVersion?: string; }>

Defined in: aptos/index.ts:675

Fetch configuration of a token pool.

Parameters​

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

Returns​

Promise<{ router: string; token: string; typeAndVersion?: string; }>

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

Remarks​

Return type varies by chain:

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

Overrides​

Chain.getTokenPoolConfig


getTokenPoolRemote()​

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

Defined in: chain.ts:1684

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

Parameters​

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

Returns​

Promise<TokenPoolRemote>

TokenPoolRemote config for the specified remote chain.

Remarks​

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

Example​

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

Throws​

CCIPTokenPoolChainConfigNotFoundError if no configuration found for the specified remote chain.

Inherited from​

Chain.getTokenPoolRemote


getTokenPoolRemotes()​

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

Defined in: aptos/index.ts:717

Fetch remote chain configurations for a token pool.

Parameters​

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

Returns​

Promise<Record<string, TokenPoolRemote>>

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

Remarks​

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

Overrides​

Chain.getTokenPoolRemotes


getTokenPrice()​

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

Defined in: aptos/index.ts:823

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

Parameters​

ParameterTypeDescription
opts{ router: string; timestamp?: number; token: string; }-
opts.routerstring-
opts.timestamp?number-
opts.tokenstring-

Returns​

Promise<TokenPrice>

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

Remarks​

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

Overrides​

Chain.getTokenPrice


getTotalFeesEstimate()​

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

Defined in: chain.ts:1809

Estimate total fees for a cross-chain message.

Returns two components:

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

Parameters​

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

Returns​

Promise<TotalFeesEstimate>

Promise resolving to TotalFeesEstimate

Throws​

CCIPNotImplementedError if not implemented for this chain family

Inherited from​

Chain.getTotalFeesEstimate


getTransaction()​

getTransaction(hashOrVersion: string | number): Promise<ChainTransaction>

Defined in: aptos/index.ts:205

Fetch a transaction by its hash.

Parameters​

ParameterTypeDescription
hashOrVersionstring | numberTransaction hash

Returns​

Promise<ChainTransaction>

Promise resolving to generic transaction details

Throws​

CCIPAptosTransactionInvalidError if hash/version format is invalid

Throws​

CCIPAptosTransactionTypeInvalidError if transaction is not a user transaction

Overrides​

Chain.getTransaction


getVerifications()​

getVerifications(opts: { 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:1362

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

Parameters​

ParameterTypeDescription
opts{ 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​

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

Inherited from​

Chain.getVerifications


resolveExecuteOpts()​

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

Defined in: chain.ts:1225

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

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

Parameters​

ParameterType
optsExecuteOpts

Returns​

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

Throws​

CCIPApiClientNotAvailableError if messageId is provided but no apiClient

Inherited from​

Chain.resolveExecuteOpts


sendMessage()​

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

Defined in: aptos/index.ts:521

Send a CCIP message through a router using provided wallet.

Parameters​

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

Returns​

Promise<CCIPRequest<CCIPVersion>>

Promise resolving to CCIP request with message details

Throws​

CCIPAptosWalletInvalidError if wallet is not a valid Aptos account

Overrides​

Chain.sendMessage


typeAndVersion()​

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

Defined in: aptos/index.ts:251

Fetch typeAndVersion for a given CCIP contract address.

Parameters​

ParameterTypeDescription
addressstringCCIP contract address

Returns​

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

Promise resolving to tuple:

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

Overrides​

Chain.typeAndVersion


waitFinalized()​

waitFinalized(opts: { abort?: AbortSignal; finality?: number | "finalized"; request: { log: { blockTimestamp: number; }; }; }): Promise<true>

Defined in: chain.ts:686

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

Parameters​

ParameterTypeDescription
opts{ abort?: AbortSignal; finality?: number | "finalized"; request: { log: { blockTimestamp: number; }; }; }Options containing the request, finality level, and optional cancel promise
opts.abort?AbortSignal-
opts.finality?number | "finalized"-
opts.request{ log: { blockTimestamp: number; }; }-
opts.request.log{ blockTimestamp: number; }-
opts.request.log.blockTimestampnumber-

Returns​

Promise<true>

true when the transaction is finalized

Throws​

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

Example​

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

Inherited from​

Chain.waitFinalized


buildMessageForDest()​

static buildMessageForDest(this: ChainStatic, message: MessageInput): AnyMessage

Defined in: chain.ts:1727

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​

ParameterTypeDescription
thisChainStatic-
messageMessageInputAnyMessage (from source), containing at least receiver.

Returns​

AnyMessage

A message suitable for sendMessage to this destination chain family.

Remarks​

V3 (GenericExtraArgsV3) is auto-detected when any V3-only field is present (e.g. finality, ccvs, ccvArgs, executor, executorArgs, tokenReceiver, tokenArgs). Otherwise defaults to V2 (EVMExtraArgsV2).

Throws​

CCIPArgumentInvalidError if extraArgs contains unknown fields for the detected version.

Inherited from​

Chain.buildMessageForDest


decodeCommits()​

static decodeCommits(log: Pick<ChainLog, "data">, lane?: Lane<CCIPVersion>): { maxSeqNr: bigint; merkleRoot: string; minSeqNr: bigint; onRampAddress: string; sourceChainSelector: bigint; }[] | undefined

Defined in: aptos/index.ts:411

Decodes commit reports from an Aptos log event.

Parameters​

ParameterTypeDescription
logPick<ChainLog, "data">Log with data field.
lane?Lane<CCIPVersion>Lane info for filtering.

Returns​

{ maxSeqNr: bigint; merkleRoot: string; minSeqNr: bigint; onRampAddress: string; sourceChainSelector: bigint; }[] | undefined

Array of CommitReport or undefined if not valid.

Throws​

CCIPAptosLogInvalidError if log data format is invalid


decodeExtraArgs()​

static decodeExtraArgs(extraArgs: BytesLike): SVMExtraArgsV1 & { _tag: "SVMExtraArgsV1"; } | EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; } | undefined

Defined in: aptos/index.ts:373

Decodes extra arguments from Aptos CCIP messages.

Parameters​

ParameterTypeDescription
extraArgsBytesLikeEncoded extra arguments bytes.

Returns​

Decoded extra arguments or undefined if unknown format.

SVMExtraArgsV1 & { _tag: "SVMExtraArgsV1"; }


EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; }


undefined


decodeMessage()​

static decodeMessage(log: { data: Record<string, unknown> | BytesLike; }): CCIPMessage | undefined

Defined in: aptos/index.ts:351

Decodes a CCIP message from an Aptos log event.

Parameters​

ParameterTypeDescription
log{ data: Record<string, unknown> | BytesLike; }Log with data field.
log.dataRecord<string, unknown> | BytesLike-

Returns​

CCIPMessage | undefined

Decoded CCIPMessage or undefined if not valid.

Throws​

CCIPAptosLogInvalidError if log data format is invalid


decodeReceipt()​

static decodeReceipt(log: Pick<ChainLog, "data">): ExecutionReceipt | undefined

Defined in: aptos/index.ts:445

Decodes an execution receipt from an Aptos log event.

Parameters​

ParameterTypeDescription
logPick<ChainLog, "data">Log with data field.

Returns​

ExecutionReceipt | undefined

ExecutionReceipt or undefined if not valid.

Throws​

CCIPAptosLogInvalidError if log data format is invalid


encodeExtraArgs()​

static encodeExtraArgs(extraArgs: ExtraArgs): string

Defined in: aptos/index.ts:388

Encodes extra arguments for Aptos CCIP messages.

Parameters​

ParameterTypeDescription
extraArgsExtraArgsExtra arguments to encode.

Returns​

string

Encoded extra arguments as hex string.

Throws​

CCIPAptosExtraArgsEncodingError if extra args format is not supported


fromAptosConfig()​

static fromAptosConfig(config: AptosConfig, ctx?: WithLogger): Promise<AptosChain>

Defined in: aptos/index.ts:163

Creates an AptosChain instance from an Aptos configuration.

Parameters​

ParameterTypeDescription
configAptosConfigAptos configuration object.
ctx?WithLoggercontext containing logger.

Returns​

Promise<AptosChain>

A new AptosChain instance.


fromProvider()​

static fromProvider(provider: Aptos, ctx?: WithLogger): Promise<AptosChain>

Defined in: aptos/index.ts:153

Creates an AptosChain instance from an existing Aptos provider.

Parameters​

ParameterTypeDescription
providerAptosAptos SDK provider instance.
ctx?WithLoggercontext containing logger.

Returns​

Promise<AptosChain>

A new AptosChain instance.


fromUrl()​

static fromUrl(url: string | readonly [string, Network], ctx?: ChainContext): Promise<AptosChain>

Defined in: aptos/index.ts:175

Creates an AptosChain instance from a URL or network identifier.

Parameters​

ParameterTypeDescription
urlstring | readonly [string, Network]RPC URL, Aptos Network enum value or [fullNodeUrl, Network] tuple.
ctx?ChainContextcontext containing logger

Returns​

Promise<AptosChain>

A new AptosChain instance.

Throws​

CCIPAptosNetworkUnknownError if network cannot be determined from URL


getAddress()​

static getAddress(bytes: readonly number[] | BytesLike): string

Defined in: aptos/index.ts:460

Converts bytes to an Aptos address.

Parameters​

ParameterTypeDescription
bytesreadonly number[] | BytesLikeBytes to convert.

Returns​

string

Aptos address (0x-prefixed hex, 32 bytes padded).

Throws​

CCIPDataFormatUnsupportedError if bytes length exceeds 32


getDestLeafHasher()​

static getDestLeafHasher(lane: Lane, _ctx?: WithLogger): LeafHasher

Defined in: aptos/index.ts:476

Gets the leaf hasher for Aptos destination chains.

Parameters​

ParameterTypeDescription
laneLaneLane configuration.
_ctx?WithLogger-

Returns​

LeafHasher

Leaf hasher function.


isTxHash()​

static isTxHash(v: unknown): v is `0x${string}`

Defined in: aptos/index.ts:467

Validates a transaction hash format for Aptos

Parameters​

ParameterType
vunknown

Returns​

v is `0x${string}`


parse()​

static parse(data: unknown): SVMExtraArgsV1 & { _tag: "SVMExtraArgsV1"; } | EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; } | undefined

Defined in: aptos/index.ts:615

Parses raw Aptos data into typed structures.

Parameters​

ParameterTypeDescription
dataunknownRaw data to parse.

Returns​

Parsed data or undefined.

SVMExtraArgsV1 & { _tag: "SVMExtraArgsV1"; }


EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; }


undefined