Class: SolanaChain
Defined in: solana/index.ts:200
Solana chain implementation supporting Solana networks.
Provides methods for sending CCIP cross-chain messages, querying message status, fetching fee quotes, and manually executing pending messages on Solana networks.
Remarks
Solana uses CCIP v1.6+ protocol only.
Examples
import { SolanaChain } from '@chainlink/ccip-sdk'
const chain = await SolanaChain.fromUrl('https://api.devnet.solana.com')
console.log(`Connected to: ${chain.network.name}`)
const requests = await chain.getMessagesInTx('5abc123...')
for (const req of requests) {
console.log(`Message ID: ${req.message.messageId}`)
}
Extends
Indexable
[
key:symbol]: () =>string
Constructors
Constructor
new SolanaChain(
connection:Connection,network:NetworkInfo,ctx?:ChainContext):SolanaChain
Defined in: solana/index.ts:217
Creates a new SolanaChain instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
connection | Connection | Solana connection instance. |
network | NetworkInfo | Network information for this chain. |
ctx? | ChainContext | - |
Returns
SolanaChain
Overrides
Chain<typeof ChainFamily.Solana>.constructor
Properties
apiClient
readonlyapiClient:CCIPAPIClient|null
Defined in: chain.ts:504
CCIP API client (null if opted out)
Inherited from
apiRetryConfig
readonlyapiRetryConfig:Required<ApiRetryConfig> |null
Defined in: chain.ts:506
Retry configuration for API fallback operations (null if API client is disabled)
Inherited from
commitment
commitment:
Commitment='confirmed'
Defined in: solana/index.ts:209
connection
connection:
Connection
Defined in: solana/index.ts:208
destroy$
readonlydestroy$:Promise<void>
Defined in: solana/index.ts:210
logger
logger:
Logger
Defined in: chain.ts:502
Inherited from
network
readonlynetwork:NetworkInfo<"SVM">
Defined in: chain.ts:501
Inherited from
decimals
readonlystaticdecimals:9=9
Defined in: solana/index.ts:206
family
readonlystaticfamily:"SVM"=ChainFamily.Solana
Defined in: solana/index.ts:205
Methods
_fetchTokenMetadata()
_fetchTokenMetadata(
mintPublicKey:PublicKey):Promise<{name:string;symbol:string; } |null>
Defined in: solana/index.ts:707
Fetches token metadata from Metaplex.
Parameters
| Parameter | Type | Description |
|---|---|---|
mintPublicKey | PublicKey | Token mint public key. |
Returns
Promise<{ name: string; symbol: string; } | null>
Token name and symbol, or null if not found.
_getRouterConfig()
_getRouterConfig(
router:string):Promise<DecodeStruct<{fields: [{name:"version";type:"u8"; }, {name:"defaultCodeVersion";type: {defined:"CodeVersion"; }; }, {name:"svmChainSelector";type:"u64"; }, {name:"owner";type:"publicKey"; }, {name:"proposedOwner";type:"publicKey"; }, {name:"feeQuoter";type:"publicKey"; }, {name:"rmnRemote";type:"publicKey"; }, {name:"linkTokenMint";type:"publicKey"; }, {name:"feeAggregator";type:"publicKey"; }];kind:"struct"; },RecursiveDepth4<[{name:"RampMessageHeader";type: {fields: [{name:"messageId";type: {array: ["u8",32]; }; }, {name:"sourceChainSelector";type:"u64"; }, {name:"destChainSelector";type:"u64"; }, {name:"sequenceNumber";type:"u64"; }, {name:"nonce";type:"u64"; }];kind:"struct"; }; }, {name:"SVM2AnyRampMessage";type: {fields: [{name:"header";type: {defined:"RampMessageHeader"; }; }, {name:"sender";type:"publicKey"; }, {name:"data";type:"bytes"; }, {name:"receiver";type:"bytes"; }, {name:"extraArgs";type:"bytes"; }, {name:"feeToken";type:"publicKey"; }, {name:"tokenAmounts";type: {vec: {defined:"SVM2AnyTokenTransfer"; }; }; }, {name:"feeTokenAmount";type: {defined:"CrossChainAmount"; }; }, {name:"feeValueJuels";type: {defined:"CrossChainAmount"; }; }];kind:"struct"; }; }, {name:"SVM2AnyTokenTransfer";type: {fields: [{name:"sourcePoolAddress";type:"publicKey"; }, {name:"destTokenAddress";type:"bytes"; }, {name:"extraData";type:"bytes"; }, {name:"amount";type: {defined:"CrossChainAmount"; }; }, {name:"destExecData";type:"bytes"; }];kind:"struct"; }; }],DecodedHelper<[{name:"RampMessageHeader";type: {fields: [{name:"messageId";type: {array: [..., ...]; }; }, {name:"sourceChainSelector";type:"u64"; }, {name:"destChainSelector";type:"u64"; }, {name:"sequenceNumber";type:"u64"; }, {name:"nonce";type:"u64"; }];kind:"struct"; }; }, {name:"SVM2AnyRampMessage";type: {fields: [{name:"header";type: {defined:"RampMessageHeader"; }; }, {name:"sender";type:"publicKey"; }, {name:"data";type:"bytes"; }, {name:"receiver";type:"bytes"; }, {name:"extraArgs";type:"bytes"; }, {name:"feeToken";type:"publicKey"; }, {name:"tokenAmounts";type: {vec: {defined: ...; }; }; }, {name:"feeTokenAmount";type: {defined:"CrossChainAmount"; }; }, {name:"feeValueJuels";type: {defined:"CrossChainAmount"; }; }];kind:"struct"; }; }, {name:"SVM2AnyTokenTransfer";type: {fields: [{name:"sourcePoolAddress";type:"publicKey"; }, {name:"destTokenAddress";type:"bytes"; }, {name:"extraData";type:"bytes"; }, {name:"amount";type: {defined:"CrossChainAmount"; }; }, {name:"destExecData";type:"bytes"; }];kind:"struct"; }; }],DecodedHelper<[{name:"RampMessageHeader";type: {fields: [{name:"messageId";type: {array: ...; }; }, {name:"sourceChainSelector";type:"u64"; }, {name:"destChainSelector";type:"u64"; }, {name:"sequenceNumber";type:"u64"; }, {name:"nonce";type:"u64"; }];kind:"struct"; }; }, {name:"SVM2AnyRampMessage";type: {fields: [{name:"header";type: {defined: ...; }; }, {name:"sender";type:"publicKey"; }, {name:"data";type:"bytes"; }, {name:"receiver";type:"bytes"; }, {name:"extraArgs";type:"bytes"; }, {name:"feeToken";type:"publicKey"; }, {name:"tokenAmounts";type: {vec: ...; }; }, {name:"feeTokenAmount";type: {defined: ...; }; }, {name:"feeValueJuels";type: {defined: ...; }; }];kind:"struct"; }; }, {name:"SVM2AnyTokenTransfer";type: {fields: [{name:"sourcePoolAddress";type:"publicKey"; }, {name:"destTokenAddress";type:"bytes"; }, {name:"extraData";type:"bytes"; }, {name:"amount";type: {defined: ...; }; }, {name:"destExecData";type:"bytes"; }];kind:"struct"; }; }],DecodedHelper<[{name:"RampMessageHeader";type: {fields: [{name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }];kind:"struct"; }; }, {name:"SVM2AnyRampMessage";type: {fields: [{name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }];kind:"struct"; }; }, {name:"SVM2AnyTokenTransfer";type: {fields: [{name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }, {name: ...;type: ...; }];kind:"struct"; }; }],EmptyDefined>>>>>>
Defined in: solana/index.ts:1614
Gets the router configuration from the Config PDA.
Parameters
| Parameter | Type | Description |
|---|---|---|
router | string | Router program address. |
Returns
Promise<DecodeStruct<{ fields: [{ name: "version"; type: "u8"; }, { name: "defaultCodeVersion"; type: { defined: "CodeVersion"; }; }, { name: "svmChainSelector"; type: "u64"; }, { name: "owner"; type: "publicKey"; }, { name: "proposedOwner"; type: "publicKey"; }, { name: "feeQuoter"; type: "publicKey"; }, { name: "rmnRemote"; type: "publicKey"; }, { name: "linkTokenMint"; type: "publicKey"; }, { name: "feeAggregator"; type: "publicKey"; }]; kind: "struct"; }, RecursiveDepth4<[{ name: "RampMessageHeader"; type: { fields: [{ name: "messageId"; type: { array: ["u8", 32]; }; }, { name: "sourceChainSelector"; type: "u64"; }, { name: "destChainSelector"; type: "u64"; }, { name: "sequenceNumber"; type: "u64"; }, { name: "nonce"; type: "u64"; }]; kind: "struct"; }; }, { name: "SVM2AnyRampMessage"; type: { fields: [{ name: "header"; type: { defined: "RampMessageHeader"; }; }, { name: "sender"; type: "publicKey"; }, { name: "data"; type: "bytes"; }, { name: "receiver"; type: "bytes"; }, { name: "extraArgs"; type: "bytes"; }, { name: "feeToken"; type: "publicKey"; }, { name: "tokenAmounts"; type: { vec: { defined: "SVM2AnyTokenTransfer"; }; }; }, { name: "feeTokenAmount"; type: { defined: "CrossChainAmount"; }; }, { name: "feeValueJuels"; type: { defined: "CrossChainAmount"; }; }]; kind: "struct"; }; }, { name: "SVM2AnyTokenTransfer"; type: { fields: [{ name: "sourcePoolAddress"; type: "publicKey"; }, { name: "destTokenAddress"; type: "bytes"; }, { name: "extraData"; type: "bytes"; }, { name: "amount"; type: { defined: "CrossChainAmount"; }; }, { name: "destExecData"; type: "bytes"; }]; kind: "struct"; }; }], DecodedHelper<[{ name: "RampMessageHeader"; type: { fields: [{ name: "messageId"; type: { array: [..., ...]; }; }, { name: "sourceChainSelector"; type: "u64"; }, { name: "destChainSelector"; type: "u64"; }, { name: "sequenceNumber"; type: "u64"; }, { name: "nonce"; type: "u64"; }]; kind: "struct"; }; }, { name: "SVM2AnyRampMessage"; type: { fields: [{ name: "header"; type: { defined: "RampMessageHeader"; }; }, { name: "sender"; type: "publicKey"; }, { name: "data"; type: "bytes"; }, { name: "receiver"; type: "bytes"; }, { name: "extraArgs"; type: "bytes"; }, { name: "feeToken"; type: "publicKey"; }, { name: "tokenAmounts"; type: { vec: { defined: ...; }; }; }, { name: "feeTokenAmount"; type: { defined: "CrossChainAmount"; }; }, { name: "feeValueJuels"; type: { defined: "CrossChainAmount"; }; }]; kind: "struct"; }; }, { name: "SVM2AnyTokenTransfer"; type: { fields: [{ name: "sourcePoolAddress"; type: "publicKey"; }, { name: "destTokenAddress"; type: "bytes"; }, { name: "extraData"; type: "bytes"; }, { name: "amount"; type: { defined: "CrossChainAmount"; }; }, { name: "destExecData"; type: "bytes"; }]; kind: "struct"; }; }], DecodedHelper<[{ name: "RampMessageHeader"; type: { fields: [{ name: "messageId"; type: { array: ...; }; }, { name: "sourceChainSelector"; type: "u64"; }, { name: "destChainSelector"; type: "u64"; }, { name: "sequenceNumber"; type: "u64"; }, { name: "nonce"; type: "u64"; }]; kind: "struct"; }; }, { name: "SVM2AnyRampMessage"; type: { fields: [{ name: "header"; type: { defined: ...; }; }, { name: "sender"; type: "publicKey"; }, { name: "data"; type: "bytes"; }, { name: "receiver"; type: "bytes"; }, { name: "extraArgs"; type: "bytes"; }, { name: "feeToken"; type: "publicKey"; }, { name: "tokenAmounts"; type: { vec: ...; }; }, { name: "feeTokenAmount"; type: { defined: ...; }; }, { name: "feeValueJuels"; type: { defined: ...; }; }]; kind: "struct"; }; }, { name: "SVM2AnyTokenTransfer"; type: { fields: [{ name: "sourcePoolAddress"; type: "publicKey"; }, { name: "destTokenAddress"; type: "bytes"; }, { name: "extraData"; type: "bytes"; }, { name: "amount"; type: { defined: ...; }; }, { name: "destExecData"; type: "bytes"; }]; kind: "struct"; }; }], DecodedHelper<[{ name: "RampMessageHeader"; type: { fields: [{ name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }]; kind: "struct"; }; }, { name: "SVM2AnyRampMessage"; type: { fields: [{ name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }]; kind: "struct"; }; }, { name: "SVM2AnyTokenTransfer"; type: { fields: [{ name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }, { name: ...; type: ...; }]; kind: "struct"; }; }], EmptyDefined>>>>>>
Router configuration including feeQuoter.
cleanUpBuffers()
cleanUpBuffers(
opts: {waitDeactivation?:boolean;wallet:unknown; }):Promise<void>
Defined in: solana/index.ts:1192
Clean up and recycle buffers and address lookup tables owned by wallet
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { waitDeactivation?: boolean; wallet: unknown; } | cleanUp options - wallet - wallet instance to sign txs - waitDeactivation - Whether to wait for lookup table deactivation cool down period (513 slots) to pass before closing; by default, we deactivate (if needed) and move on, to close other ready ALTs |
opts.waitDeactivation? | boolean | - |
opts.wallet | unknown | - |
Returns
Promise<void>
Throws
CCIPWalletInvalidError if wallet is not a valid Solana wallet
destroy()?
optionaldestroy():void|Promise<void>
Defined in: chain.ts:540
Cleanup method to release resources (e.g., close connections).
Returns
void | Promise<void>
Inherited from
estimateReceiveExecution()?
optionalestimateReceiveExecution(opts: {message: {data?:BytesLike;destTokenAmounts?: readonly {token:string; } | {destTokenAddress:string;extraData?:string; } & {amount:bigint; }[];messageId:string;receiver:string;sender?:string;sourceChainSelector:bigint; };offRamp:string; } | {messageId:string; }):Promise<number>
Defined in: chain.ts:1704
Estimate ccipReceive execution cost (gas, computeUnits) for this destination chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { message: { data?: BytesLike; destTokenAmounts?: readonly { token: string; } | { destTokenAddress: string; extraData?: string; } & { amount: bigint; }[]; messageId: string; receiver: string; sender?: string; sourceChainSelector: bigint; }; offRamp: string; } | { messageId: string; } | Either: - { offRamp, message } — estimate from message fields directly. message must include sourceChainSelector, messageId, receiver, and optionally sender, data, destTokenAmounts. - { messageId } — fetch the message from the CCIP API via getMessageById, resolve the offRamp from the message metadata or getExecutionInput, then estimate. Requires apiClient to be available. |
Returns
Promise<number>
Estimated execution cost (gas for EVM, compute units for Solana)
Inherited from
Chain.estimateReceiveExecution
execute()
execute(
opts: ExecuteOpts & { wallet: unknown; } & {waitDeactivation?:boolean; }):Promise<CCIPExecution>
Defined in: solana/index.ts:1142
Execute messages in report in an offRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | ExecuteOpts & { wallet: unknown; } & { waitDeactivation?: boolean; } | ExecuteOpts with chain-specific wallet to sign and send tx. |
Returns
Promise<CCIPExecution>
Promise resolving to transaction of the execution.
Throws
CCIPWalletInvalidError if wallet is not a valid Solana wallet
Overrides
generateUnsignedExecute()
generateUnsignedExecute(
__namedParameters:ExecuteOpts& {payer:string; }):Promise<UnsignedSolanaTx>
Defined in: solana/index.ts:1120
Generate unsigned tx to manuallyExecute a message.
Parameters
| Parameter | Type | Description |
|---|---|---|
__namedParameters | ExecuteOpts & { payer: string; } | ExecuteOpts with payer address which will send the exec tx |
Returns
Promise<UnsignedSolanaTx>
Promise resolving to chain-family specific unsigned txs
Throws
CCIPExecutionReportChainMismatchError if message is not a Solana message
Overrides
generateUnsignedSendMessage()
generateUnsignedSendMessage(
opts:SendMessageOpts& {sender:string; }):Promise<UnsignedSolanaTx>
Defined in: solana/index.ts:1074
Generate unsigned txs for ccipSend'ing a message.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | SendMessageOpts & { sender: string; } | SendMessageOpts with sender address |
Returns
Promise<UnsignedSolanaTx>
Promise resolving to chain-family specific unsigned txs
Overrides
Chain.generateUnsignedSendMessage
getBalance()
getBalance(
opts:GetBalanceOpts):Promise<bigint>
Defined in: solana/index.ts:681
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
CCIPTokenAccountNotFoundError if token account not found
Overrides
getBlockTimestamp()
getBlockTimestamp(
block:number|"latest"|"finalized"):Promise<number>
Defined in: solana/index.ts:337
Fetch the timestamp of a given block.
Parameters
| Parameter | Type | Description |
|---|---|---|
block | number | "latest" | "finalized" | Positive block number, negative finality depth, or 'finalized' tag |
Returns
Promise<number>
Promise resolving to timestamp of the block, in seconds
Throws
CCIPBlockTimeNotFoundError if block time cannot be retrieved
Overrides
getExecutionInput()
getExecutionInput(
opts: {request:CCIPRequest;verifications:CCIPVerifications; } &Pick<LogFilter,"page">):Promise<ExecutionInput>
Defined in: chain.ts:794
Fetch input data needed for executing messages Should be called on the source instance
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { request: CCIPRequest; verifications: CCIPVerifications; } & Pick<LogFilter, "page"> | getExecutionInput options containing request and verifications |
Returns
Promise<ExecutionInput>
input payload to be passed to execute
See
execute - method to execute a message
Inherited from
getExecutionReceipts()
getExecutionReceipts(
opts: {messageId?:string;offRamp:string;sourceChainSelector?:bigint;verifications?:CCIPVerifications; } &Pick<LogFilter,"startBlock"|"startTime"|"watch"|"page">):AsyncIterableIterator<CCIPExecution>
Defined in: solana/index.ts:1286
Default/generic implementation of getExecutionReceipts. Yields execution receipts for a given offRamp.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { messageId?: string; offRamp: string; sourceChainSelector?: bigint; verifications?: CCIPVerifications; } & Pick<LogFilter, "startBlock" | "startTime" | "watch" | "page"> | getExecutionReceipts options |
Returns
AsyncIterableIterator<CCIPExecution>
Async generator of CCIPExecution receipts
Overrides
getFee()
getFee(
__namedParameters:Omit<SendMessageOpts,"approveMax">):Promise<bigint>
Defined in: solana/index.ts:1063
Fetch the current fee for a given intended message.
Parameters
| Parameter | Type | Description |
|---|---|---|
__namedParameters | 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: solana/index.ts:1548
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:1327
Retrieve features for a lane (router/destChainSelector/token triplet).
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | { destChainSelector: bigint; router: string; token?: string; } | Options containing router address, destChainSelector, and optional token address (the token to be transferred in a hypothetical message on this lane) |
_opts.destChainSelector | bigint | - |
_opts.router | string | - |
_opts.token? | string | - |
Returns
Promise<Partial<LaneFeatures>>
Promise resolving to partial lane features record
Throws
CCIPNotImplementedError if not implemented for this chain family
Example
const features = await chain.getLaneFeatures({
router: '0x...',
destChainSelector: 4949039107694359620n,
})
// MIN_BLOCK_CONFIRMATIONS has three states:
// - undefined: FTF is not supported on this lane (pre-v2.0)
// - 0: the lane supports FTF, but it is not enabled for this token
// - > 0: FTF is enabled with this many block confirmations
const ftf = features.MIN_BLOCK_CONFIRMATIONS
if (ftf != null && ftf > 0) {
console.log(`FTF enabled with ${ftf} confirmations`)
} else if (ftf === 0) {
console.log('FTF supported on this lane but not enabled for this token')
}
Inherited from
getLaneLatency()
getLaneLatency(
destChainSelector:bigint,numberOfBlocks?:number):Promise<LaneLatencyResponse>
Defined in: chain.ts:1286
Fetches estimated lane latency to a destination chain. Uses this chain's selector as the source.
Parameters
| Parameter | Type | Description |
|---|---|---|
destChainSelector | bigint | Destination CCIP chain selector (bigint) |
numberOfBlocks? | number | Optional number of block confirmations to use for latency calculation. When omitted or 0, uses the lane's default finality. When provided as a positive integer, the API returns latency for that custom finality value. |
Returns
Promise<LaneLatencyResponse>
Promise resolving to LaneLatencyResponse containing:
totalMs- Estimated delivery time in milliseconds
Throws
CCIPApiClientNotAvailableError if apiClient was disabled (set to null)
Throws
CCIPHttpError if API request fails (network error, 4xx, 5xx status)
Remarks
Each call makes a fresh API request. Consider caching results if making frequent calls for the same lane.
Examples
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
try {
const latency = await chain.getLaneLatency(4949039107694359620n) // Arbitrum
console.log(`Estimated delivery: ${Math.round(latency.totalMs / 60000)} minutes`)
} catch (err) {
if (err instanceof CCIPHttpError) {
console.error(`API error: ${err.context.apiErrorCode}`)
}
}
const latency = await chain.getLaneLatency(4949039107694359620n, 10)
console.log(`Latency with 10 confirmations: ${Math.round(latency.totalMs / 60000)} minutes`)
Inherited from
getLogs()
getLogs(
opts:LogFilter& {programs?:true|string[]; }):AsyncGenerator<Pick<Log,"address"|"blockNumber"|"index"|"topics"|"transactionHash"> & {data:Record<string,unknown> |BytesLike;tx?: {blockNumber:number;error?:unknown;from:string;hash:string;logs?: readonlyChainLog[];timestamp:number; }; } & {tx:SolanaTransaction; }>
Defined in: solana/index.ts:438
Retrieves logs from Solana transactions with enhanced chronological ordering.
Behavior:
-
If opts.startBlock or opts.startTime is provided:
- Fetches ALL signatures for the address going back in time
- Continues fetching until finding signatures older than the start target
- Filters out signatures older than start criteria
- Returns logs in chronological order (oldest first)
-
If opts.startBlock and opts.startTime are omitted:
- Fetches signatures in reverse chronological order (newest first)
- Returns logs in reverse chronological order (newest first)
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | LogFilter & { programs?: true | string[]; } | Log filter options containing: - startBlock: Starting slot number (inclusive) - startTime: Starting Unix timestamp (inclusive) - endBlock: Ending slot number (inclusive) - endBefore: Fetch signatures before this transaction - address: Program address to filter logs by (required for Solana) - topics: Array of topics to filter logs by (optional); either 0x-8B discriminants or event names - watch: Watch for new logs - programs: Special option to allow querying by address of interest, but yielding matching logs from specific (string address) program or any (true) |
Returns
AsyncGenerator<Pick<Log, "address" | "blockNumber" | "index" | "topics" | "transactionHash"> & { data: Record<string, unknown> | BytesLike; tx?: { blockNumber: number; error?: unknown; from: string; hash: string; logs?: readonly ChainLog[]; timestamp: number; }; } & { tx: SolanaTransaction; }>
AsyncIterableIterator of parsed ChainLog objects.
Throws
CCIPLogsAddressRequiredError if address is not provided
Throws
CCIPTopicsInvalidError if topics contain invalid values
Overrides
getMessageById()
getMessageById(
messageId:string,_opts?: {onRamp?:string;page?:number; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: chain.ts:746
Fetch a CCIP message by its unique message ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
messageId | string | The unique message ID (0x + 64 hex chars) |
_opts? | { onRamp?: string; page?: number; } | Optional: onRamp hint for non-EVM chains |
_opts.onRamp? | string | - |
_opts.page? | number | - |
Returns
Promise<CCIPRequest<CCIPVersion>>
CCIPRequest with metadata populated from API
Remarks
Uses the CCIP API to retrieve message details. The returned request includes
a metadata field with API-specific information.
Example
const request = await chain.getMessageById(messageId)
console.log(`Sender: ${request.message.sender}`)
if (request.metadata) {
console.log(`Status: ${request.metadata.status}`)
if (request.metadata.deliveryTime) {
console.log(`Delivered in ${request.metadata.deliveryTime}ms`)
}
}
Throws
CCIPApiClientNotAvailableError if API disabled
Throws
CCIPMessageIdNotFoundError if message not found
Throws
CCIPOnRampRequiredError if onRamp is required but not provided
Throws
CCIPHttpError if API request fails
Inherited from
getMessagesInBatch()
getMessagesInBatch<
R>(request:R,range:Pick<CommitReport,"minSeqNr"|"maxSeqNr">,opts?:Pick<LogFilter,"page">):Promise<R["message"][]>
Defined in: solana/index.ts:481
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 | Description |
|---|---|
R extends { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; log: { }; message: { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; } | { sequenceNumber: bigint; }; } |
Parameters
| Parameter | Type | Description |
|---|---|---|
request | R | CCIPRequest to fetch batch for |
range | Pick<CommitReport, "minSeqNr" | "maxSeqNr"> | batch range { minSeqnr, maxSeqNr }, e.g. from CommitReport |
opts? | Pick<LogFilter, "page"> | Optional parameters (e.g., page for pagination width) |
Returns
Promise<R["message"][]>
Array of messages in the batch
Overrides
getMessagesInTx()
getMessagesInTx(
tx:string|ChainTransaction):Promise<CCIPRequest<CCIPVersion>[]>
Defined in: chain.ts:690
Fetch all CCIP requests in a transaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
tx | string | ChainTransaction | ChainTransaction or txHash to fetch requests from |
Returns
Promise<CCIPRequest<CCIPVersion>[]>
Promise resolving to CCIP messages in the transaction (at least one)
Throws
CCIPTransactionNotFoundError if transaction does not exist
Throws
CCIPMessageNotFoundInTxError if no CCIPSendRequested events in tx
Example
const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
const requests = await chain.getMessagesInTx('0xabc123...')
for (const req of requests) {
console.log(`Message ID: ${req.message.messageId}`)
}
Inherited from
getNativeTokenForRouter()
getNativeTokenForRouter(
_router:string):Promise<string>
Defined in: solana/index.ts:554
Get the native token address for a Router.
Parameters
| Parameter | Type | Description |
|---|---|---|
_router | string | Router contract address |
Returns
Promise<string>
Promise resolving to native token address (usually wrapped)
Overrides
getOffchainTokenData()
getOffchainTokenData(
request: {message: {data:string;feeToken:string;feeTokenAmount:bigint;gasLimit:bigint;messageId:string;nonce:bigint;receiver:string;sender:string;sequenceNumber:bigint;sourceChainSelector:bigint;sourceTokenData: readonlystring[];strict:boolean;tokenAmounts: readonly {amount:bigint;token:string; }[]; } | {data:string;feeToken:string;feeTokenAmount:bigint;gasLimit:bigint;messageId:string;nonce:bigint;receiver:string;sender:string;sequenceNumber:bigint;sourceChainSelector:bigint;sourceTokenData: readonlystring[];strict:boolean;tokenAmounts: readonly {amount:bigint;destGasAmount:bigint;destTokenAddress:string;extraData:string;sourcePoolAddress:string;token:string; }[]; } | {allowOutOfOrderExecution:boolean;data:string;destChainSelector:bigint;extraArgs:string;feeToken:string;feeTokenAmount:bigint;feeValueJuels:bigint;gasLimit:bigint;messageId:string;nonce:bigint;receiver:string;sender:string;sequenceNumber:bigint;sourceChainSelector:bigint;tokenAmounts: readonly {amount:bigint;destExecData:string;destGasAmount:bigint;destTokenAddress:string;extraData:string;sourcePoolAddress:string; }[]; } | {accountIsWritableBitmap:bigint;accounts:string[];allowOutOfOrderExecution:boolean;computeUnits:bigint;data:string;destChainSelector:bigint;extraArgs:string;feeToken:string;feeTokenAmount:bigint;feeValueJuels:bigint;messageId:string;nonce:bigint;receiver:string;sender:string;sequenceNumber:bigint;sourceChainSelector:bigint;tokenAmounts: readonly {amount:bigint;destExecData:string;destGasAmount:bigint;destTokenAddress:string;extraData:string;sourcePoolAddress:string; }[];tokenReceiver:string; } | {allowOutOfOrderExecution:boolean;data:string;destChainSelector:bigint;extraArgs:string;feeToken:string;feeTokenAmount:bigint;feeValueJuels:bigint;gasLimit:bigint;messageId:string;nonce:bigint;receiver:string;receiverObjectIds:string[];sender:string;sequenceNumber:bigint;sourceChainSelector:bigint;tokenAmounts: readonly {amount:bigint;destExecData:string;destGasAmount:bigint;destTokenAddress:string;extraData:string;sourcePoolAddress:string; }[];tokenReceiver:string; } | {ccipReceiveGasLimit:number;ccvAndExecutorHash:string;data:string;destBlob:string;destChainSelector:bigint;encodedMessage:string;executionGasLimit:number;feeToken:string;feeTokenAmount:bigint;finality:number;messageId:string;messageNumber:bigint;offRampAddress:string;onRampAddress:string;receipts: readonly {destBytesOverhead:bigint;destGasLimit:bigint;extraArgs:string;feeTokenAmount:bigint;issuer:string; }[];receiver:string;sender:string;sequenceNumber:bigint;sourceChainSelector:bigint;tokenAmountBeforeTokenPoolFees:bigint;tokenAmounts: readonly {amount:bigint;destTokenAddress:string;extraData:string;sourcePoolAddress:string;sourceTokenAddress:string;tokenReceiver:string; }[];verifierBlobs: readonlystring[]; };tx: {hash:string; }; }):Promise<OffchainTokenData[]>
Defined in: chain.ts:1091
Fetch supported offchain token data for a request from this network. It logs but doesn't throw in case it can't fetch attestation, as the transfers may not be from the expected attestation providers. It returns default offchainData=undefined for those.
Parameters
| Parameter | Type | Description |
|---|---|---|
request | { message: { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; token: string; }[]; } | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; token: string; }[]; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; } | { accountIsWritableBitmap: bigint; accounts: string[]; allowOutOfOrderExecution: boolean; computeUnits: bigint; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; receiverObjectIds: string[]; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; } | { ccipReceiveGasLimit: number; ccvAndExecutorHash: string; data: string; destBlob: string; destChainSelector: bigint; encodedMessage: string; executionGasLimit: number; feeToken: string; feeTokenAmount: bigint; finality: number; messageId: string; messageNumber: bigint; offRampAddress: string; onRampAddress: string; receipts: readonly { destBytesOverhead: bigint; destGasLimit: bigint; extraArgs: string; feeTokenAmount: bigint; issuer: string; }[]; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmountBeforeTokenPoolFees: bigint; tokenAmounts: readonly { amount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; sourceTokenAddress: string; tokenReceiver: string; }[]; verifierBlobs: readonly string[]; }; tx: { hash: string; }; } | CCIP request, with tx.hash and message |
request.message | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; token: string; }[]; } | { data: string; feeToken: string; feeTokenAmount: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; sourceTokenData: readonly string[]; strict: boolean; tokenAmounts: readonly { amount: bigint; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; token: string; }[]; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; } | { accountIsWritableBitmap: bigint; accounts: string[]; allowOutOfOrderExecution: boolean; computeUnits: bigint; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; messageId: string; nonce: bigint; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; } | { allowOutOfOrderExecution: boolean; data: string; destChainSelector: bigint; extraArgs: string; feeToken: string; feeTokenAmount: bigint; feeValueJuels: bigint; gasLimit: bigint; messageId: string; nonce: bigint; receiver: string; receiverObjectIds: string[]; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmounts: readonly { amount: bigint; destExecData: string; destGasAmount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; }[]; tokenReceiver: string; } | { ccipReceiveGasLimit: number; ccvAndExecutorHash: string; data: string; destBlob: string; destChainSelector: bigint; encodedMessage: string; executionGasLimit: number; feeToken: string; feeTokenAmount: bigint; finality: number; messageId: string; messageNumber: bigint; offRampAddress: string; onRampAddress: string; receipts: readonly { destBytesOverhead: bigint; destGasLimit: bigint; extraArgs: string; feeTokenAmount: bigint; issuer: string; }[]; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmountBeforeTokenPoolFees: bigint; tokenAmounts: readonly { amount: bigint; destTokenAddress: string; extraData: string; sourcePoolAddress: string; sourceTokenAddress: string; tokenReceiver: string; }[]; verifierBlobs: readonly string[]; } | - |
request.tx | { hash: string; } | Transaction that emitted the request. |
request.tx.hash | string | Transaction hash. |
Returns
Promise<OffchainTokenData[]>
Promise resolving to array with one offchain token data for each token transfer
Example
const offchainData = await source.getOffchainTokenData(request)
// Use in execution report
Inherited from
getOffRampsForRouter()
getOffRampsForRouter(
router:string,sourceChainSelector:bigint):Promise<string[]>
Defined in: solana/index.ts:562
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
Throws
CCIPSolanaOffRampEventsNotFoundError if no OffRamp events found
Overrides
getOnRampForRouter()
getOnRampForRouter(
router:string,_destChainSelector:bigint):Promise<string>
Defined in: solana/index.ts:583
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
getOnRampsForOffRamp()
getOnRampsForOffRamp(
offRamp:string,sourceChainSelector:bigint):Promise<string[]>
Defined in: solana/index.ts:588
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
Overrides
getRegistryTokenConfig()
getRegistryTokenConfig(
registry:string,token:string):Promise<{administrator:string;pendingAdministrator?:string;tokenPool?:string; }>
Defined in: solana/index.ts:1315
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.
Throws
CCIPTokenNotConfiguredError if token is not configured in registry
Overrides
getRouterForOffRamp()
getRouterForOffRamp(
offRamp:string,_sourceChainSelector:bigint):Promise<string>
Defined in: solana/index.ts:532
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
CCIPSolanaRefAddressesNotFoundError if reference addresses PDA not found
Overrides
getRouterForOnRamp()
getRouterForOnRamp(
onRamp:string,_destChainSelector:bigint):Promise<string>
Defined in: solana/index.ts:524
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(
router:string):Promise<string[]>
Defined in: solana/index.ts:1520
List tokens supported by given TokenAdminRegistry contract.
Parameters
| Parameter | Type | Description |
|---|---|---|
router | 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: solana/index.ts:1055
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
Throws
CCIPContractNotRouterError if address is not a Router
Overrides
Chain.getTokenAdminRegistryFor
getTokenForTokenPool()
getTokenForTokenPool(
tokenPool:string):Promise<string>
Defined in: solana/index.ts:614
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
CCIPTokenPoolInfoNotFoundError if token pool info not found
Overrides
getTokenInfo()
getTokenInfo(
token:string):Promise<TokenInfo>
Defined in: solana/index.ts:629
Fetch token metadata.
Parameters
| Parameter | Type | Description |
|---|---|---|
token | string | Token address |
Returns
Promise<TokenInfo>
Promise resolving to token symbol, decimals, and optionally name
Throws
CCIPSplTokenInvalidError if token is not a valid SPL token
Throws
CCIPTokenDataParseError if token data cannot be parsed
Overrides
getTokenPoolConfig()
getTokenPoolConfig(
tokenPool:string,_feeOpts?:TokenTransferFeeOpts):Promise<{router:string;token:string;tokenPoolProgram:string;typeAndVersion?:string; }>
Defined in: solana/index.ts:1372
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<{ router: string; token: string; tokenPoolProgram: string; typeAndVersion?: string; }>
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
Throws
CCIPTokenPoolStateNotFoundError if token pool state not found
Overrides
getTokenPoolRemote()
getTokenPoolRemote(
tokenPool:string,remoteChainSelector:bigint):Promise<TokenPoolRemote>
Defined in: chain.ts:1557
Fetch remote chain configuration for a token pool for a specific destination.
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenPool | string | Token pool address on the current chain. |
remoteChainSelector | bigint | Chain selector of the desired remote chain. |
Returns
Promise<TokenPoolRemote>
TokenPoolRemote config for the specified remote chain.
Remarks
Convenience wrapper around getTokenPoolRemotes that returns a single configuration instead of a Record. Use this when you need configuration for a specific destination chain.
Example
const arbitrumSelector = 4949039107694359620n
const remote = await chain.getTokenPoolRemote(poolAddress, arbitrumSelector)
console.log(`Remote token: ${remote.remoteToken}`)
console.log(`Remote pools: ${remote.remotePools.join(', ')}`)
Throws
CCIPTokenPoolChainConfigNotFoundError if no configuration found for the specified remote chain.
Inherited from
getTokenPoolRemotes()
getTokenPoolRemotes(
tokenPool:string,remoteChainSelector?:bigint):Promise<Record<string,TokenPoolRemote>>
Defined in: solana/index.ts:1412
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.
Throws
CCIPTokenPoolStateNotFoundError if token pool state not found
Throws
CCIPTokenPoolChainConfigNotFoundError if chain config not found for specified selector
Overrides
getTokenPrice()
getTokenPrice(
opts: {router:string;timestamp?:number;token:string; }):Promise<TokenPrice>
Defined in: solana/index.ts:1573
Fetch the on-chain USD price of a token from the FeeQuoter or PriceRegistry.
Parameters
| Parameter | Type | Description |
|---|---|---|
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.
Overrides
getTotalFeesEstimate()
getTotalFeesEstimate(
_opts:Omit<SendMessageOpts,"approveMax">):Promise<TotalFeesEstimate>
Defined in: chain.ts:1654
Estimate total fees for a cross-chain message.
Returns two components:
- ccipFee: from
Router.getFee(), denominated in the message'sfeeToken(native token if omitted). Includes gas, DON costs, and FeeQuoter-level token transfer overhead (all CCIP versions). - tokenTransferFee: pool-level BPS fee deducted from the transferred
token amount (v2.0+ only). The recipient receives
amount - feeDeductedon the destination chain. Absent on pre-v2.0 lanes or data-only messages.
Parameters
| Parameter | Type | Description |
|---|---|---|
_opts | Omit<SendMessageOpts, "approveMax"> | SendMessageOpts without approveMax |
Returns
Promise<TotalFeesEstimate>
Promise resolving to TotalFeesEstimate
Throws
CCIPNotImplementedError if not implemented for this chain family
Inherited from
getTransaction()
getTransaction(
hash:string):Promise<SolanaTransaction>
Defined in: solana/index.ts:360
Fetch a transaction by its hash.
Parameters
| Parameter | Type | Description |
|---|---|---|
hash | string | Transaction hash |
Returns
Promise<SolanaTransaction>
Promise resolving to generic transaction details
Throws
CCIPTransactionNotFoundError if transaction not found
Overrides
getTransactionsForAddress()
getTransactionsForAddress(
opts:Omit<LogFilter,"topics">):AsyncGenerator<SolanaTransaction>
Defined in: solana/index.ts:402
Internal method to get transactions for an address with pagination.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | Omit<LogFilter, "topics"> | Log filter options. |
Returns
AsyncGenerator<SolanaTransaction>
Async generator of Solana transactions.
getVerifications()
getVerifications(
opts: {offRamp:string;request: {lane: {destChainSelector:bigint;onRamp:string;sourceChainSelector:bigint;version:CCIPVersion; };message: {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; } | {messageId:string;sequenceNumber:bigint; };tx: {timestamp:number; }; }; } &Pick<LogFilter,"startBlock"|"watch"|"page">):Promise<CCIPVerifications>
Defined in: solana/index.ts:1230
Solana specialization: use getProgramAccounts to fetch commit reports from PDAs
Parameters
| Parameter | Type |
|---|---|
opts | { offRamp: string; request: { lane: { destChainSelector: bigint; onRamp: string; sourceChainSelector: bigint; version: CCIPVersion; }; message: { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; } | { messageId: string; sequenceNumber: bigint; }; tx: { timestamp: number; }; }; } & Pick<LogFilter, "startBlock" | "watch" | "page"> |
Returns
Promise<CCIPVerifications>
Overrides
resolveExecuteOpts()
protectedresolveExecuteOpts(opts:ExecuteOpts):Promise<{input:ExecutionInput;offRamp:string; } & {forceBuffer?:boolean;forceLookupTable?:boolean;gasLimit?:number;tokensGasLimit?:number; }>
Defined in: chain.ts:1108
Resolves ExecuteOpts that may contain a messageId (API shorthand) into the
canonical { offRamp, input } form required by generateUnsignedExecute.
When opts already contains input the method is a no-op and returns it unchanged.
When opts contains only a messageId it calls apiClient.getExecutionInput and merges
the result back with any extra opts fields (e.g. gasLimit).
If opts.gasLimit is undefined and estimateReceiveExecution is available, try to estimate gasLimitOverride
Parameters
| Parameter | Type |
|---|---|
opts | ExecuteOpts |
Returns
Promise<{ input: ExecutionInput; offRamp: string; } & { forceBuffer?: boolean; forceLookupTable?: boolean; gasLimit?: number; tokensGasLimit?: number; }>
Throws
CCIPApiClientNotAvailableError if messageId is provided but no apiClient
Inherited from
sendMessage()
sendMessage(
opts:SendMessageOpts& {wallet:unknown; }):Promise<CCIPRequest<CCIPVersion>>
Defined in: solana/index.ts:1100
Send a CCIP message through a router using provided wallet.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | SendMessageOpts & { wallet: unknown; } | SendMessageOpts with chain-specific wallet for signing |
Returns
Promise<CCIPRequest<CCIPVersion>>
Promise resolving to CCIP request with message details
Throws
CCIPWalletInvalidError if wallet is not a valid Solana wallet
Overrides
typeAndVersion()
typeAndVersion(
address:string):Promise<[string,string,string,string]>
Defined in: solana/index.ts:506
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)
Overrides
waitFinalized()
waitFinalized(
opts: {cancel$?:Promise<unknown>;finality?:number|"finalized";request: {log: {tx?: {timestamp:number; }; };tx?: {timestamp:number; }; }; }):Promise<true>
Defined in: chain.ts:606
Confirm a log tx is finalized or wait for it to be finalized.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { cancel$?: Promise<unknown>; finality?: number | "finalized"; request: { log: { tx?: { timestamp: number; }; }; tx?: { timestamp: number; }; }; } | Options containing the request, finality level, and optional cancel promise |
opts.cancel$? | Promise<unknown> | - |
opts.finality? | number | "finalized" | - |
opts.request | { log: { tx?: { timestamp: number; }; }; tx?: { timestamp: number; }; } | - |
opts.request.log | { tx?: { timestamp: number; }; } | - |
opts.request.log.tx? | { timestamp: number; } | Optional reference to the containing transaction. |
opts.request.log.tx.timestamp | number | Unix timestamp of the block. |
opts.request.tx? | { timestamp: number; } | Transaction that emitted the request. |
opts.request.tx.timestamp | number | Unix timestamp of the block. |
Returns
Promise<true>
true when the transaction is finalized
Throws
CCIPTransactionNotFinalizedError if the transaction is not included (e.g., due to a reorg)
Example
const request = await source.getMessagesInTx(txHash)
try {
await source.waitFinalized({ request: request[0] })
console.log('Transaction finalized')
} catch (err) {
if (err instanceof CCIPTransactionNotFinalizedError) {
console.log('Transaction not yet finalized')
}
}
Inherited from
_getConnection()
static_getConnection(url:string,ctx?:WithLogger):Connection
Defined in: solana/index.ts:282
Creates a Solana connection from a URL.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | RPC endpoint URL (https://, http://, wss://, or ws://). |
ctx? | WithLogger | context containing logger. |
Returns
Connection
Solana Connection instance.
Throws
CCIPDataFormatUnsupportedError if URL format is invalid
buildMessageForDest()
staticbuildMessageForDest(message:MessageInput):AnyMessage& {extraArgs:SVMExtraArgsV1; }
Defined in: solana/index.ts:1644
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: SVMExtraArgsV1; }
A message suitable for sendMessage to this destination chain family
Remarks
Solana-specific receiver/tokenReceiver handling:
- Explicit
tokenReceiverin extraArgs: bothreceiverandtokenReceiverare kept as provided. - Tokens but no explicit
tokenReceiver:receiveris set toPublicKey.defaultandtokenReceiveris set tomessage.receiver. - No tokens:
tokenReceiveris set toPublicKey.defaultandreceiverismessage.receiver.
Accepts gasLimit as an alias for computeUnits in extraArgs.
Throws
CCIPArgumentInvalidError if tokenReceiver missing when sending tokens with data
Throws
CCIPArgumentInvalidError if extraArgs contains unknown fields for SVMExtraArgsV1
Overrides
Chain.buildMessageForDest
decodeCommits()
staticdecodeCommits(log:Pick<ChainLog,"data">,lane?:Omit<Lane<CCIPVersion>,"destChainSelector">): {maxSeqNr:bigint;merkleRoot:string;minSeqNr:bigint;onRampAddress:string;sourceChainSelector:bigint; }[] |undefined
Defined in: solana/index.ts:898
Decodes commit reports from a Solana log event.
Parameters
| Parameter | Type | Description |
|---|---|---|
log | Pick<ChainLog, "data"> | Log with data field. |
lane? | Omit<Lane<CCIPVersion>, "destChainSelector"> | 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
CCIPLogDataMissingError if log data is missing
decodeExtraArgs()
staticdecodeExtraArgs(extraArgs:BytesLike):EVMExtraArgsV1& {allowOutOfOrderExecution:boolean; } & {_tag:"EVMExtraArgsV2"; } |undefined
Defined in: solana/index.ts:853
Decodes extra arguments from Solana CCIP messages.
Parameters
| Parameter | Type | Description |
|---|---|---|
extraArgs | BytesLike | Encoded extra arguments bytes. |
Returns
Decoded EVMExtraArgsV2 or undefined if unknown format.
EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; }
undefined
Throws
CCIPExtraArgsLengthInvalidError if extra args length is invalid
decodeMessage()
staticdecodeMessage(log: {data:unknown; }):CCIPMessage|undefined
Defined in: solana/index.ts:775
Decodes a CCIP message from a Solana log event.
Parameters
| Parameter | Type | Description |
|---|---|---|
log | { data: unknown; } | Log with data field. |
log.data | unknown | - |
Returns
CCIPMessage | undefined
Decoded CCIPMessage or undefined if not valid.
Throws
CCIPExtraArgsInvalidError if extra args cannot be decoded
decodeReceipt()
staticdecodeReceipt(log:Pick<ChainLog,"data"|"tx"|"index">):ExecutionReceipt|undefined
Defined in: solana/index.ts:954
Decodes an execution receipt from a Solana log event.
Parameters
| Parameter | Type | Description |
|---|---|---|
log | Pick<ChainLog, "data" | "tx" | "index"> | Log with data, tx, and index fields. |
Returns
ExecutionReceipt | undefined
ExecutionReceipt or undefined if not valid.
Throws
CCIPLogDataMissingError if log data is missing
Throws
CCIPExecutionStateInvalidError if execution state is invalid
encodeExtraArgs()
staticencodeExtraArgs(args:ExtraArgs):string
Defined in: solana/index.ts:881
Encodes extra arguments for Solana CCIP messages.
Parameters
| Parameter | Type | Description |
|---|---|---|
args | ExtraArgs | Extra arguments to encode. |
Returns
string
Encoded extra arguments as hex string.
Throws
CCIPSolanaExtraArgsEncodingError if SVMExtraArgsV1 encoding is attempted
fromConnection()
staticfromConnection(connection:Connection,ctx?:ChainContext):Promise<SolanaChain>
Defined in: solana/index.ts:305
Creates a SolanaChain instance from an existing connection.
Parameters
| Parameter | Type | Description |
|---|---|---|
connection | Connection | Solana Connection instance. |
ctx? | ChainContext | context containing logger. |
Returns
Promise<SolanaChain>
A new SolanaChain instance.
fromUrl()
staticfromUrl(url:string,ctx?:ChainContext):Promise<SolanaChain>
Defined in: solana/index.ts:327
Creates a SolanaChain instance from an RPC URL.
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | RPC endpoint URL (https://, http://, wss://, or ws://). |
ctx? | ChainContext | Optional context containing logger and API client configuration. |
Returns
Promise<SolanaChain>
A new SolanaChain instance connected to the specified network.
Throws
CCIPChainNotFoundError if chain cannot be identified from genesis hash
Example
// Create from devnet URL
const chain = await SolanaChain.fromUrl('https://api.devnet.solana.com')
// With custom logger
const chain = await SolanaChain.fromUrl(url, { logger: customLogger })
getAddress()
staticgetAddress(bytes:BytesLike):string
Defined in: solana/index.ts:1020
Converts bytes to a Solana address (Base58).
Parameters
| Parameter | Type | Description |
|---|---|---|
bytes | BytesLike | Bytes to convert. |
Returns
string
Base58-encoded Solana address.
getDestLeafHasher()
staticgetDestLeafHasher(lane:Lane,ctx?:WithLogger):LeafHasher<"1.6.0">
Defined in: solana/index.ts:1047
Gets the leaf hasher for Solana destination chains.
Parameters
| Parameter | Type | Description |
|---|---|---|
lane | Lane | Lane configuration. |
ctx? | WithLogger | - |
Returns
LeafHasher<"1.6.0">
Leaf hasher function.
isTxHash()
staticisTxHash(v:unknown):v is string
Defined in: solana/index.ts:1032
Validates a transaction hash format for Solana
Parameters
| Parameter | Type |
|---|---|
v | unknown |
Returns
v is string
parse()
staticparse(data:unknown): {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; }[]; } |CCIPMessage_V1_6_EVM|CCIPMessage_V1_6_Solana| {ccipReceiveGasLimit:number;ccvAndExecutorHash:string;data:string;destBlob:string;destChainSelector:bigint;encodedMessage:string;executionGasLimit:number;feeToken:string;feeTokenAmount:bigint;finality:number;messageId:string;messageNumber:bigint;offRampAddress:string;onRampAddress:string;receipts: readonly {destBytesOverhead:bigint;destGasLimit:bigint;extraArgs:string;feeTokenAmount:bigint;issuer:string; }[];receiver:string;sender:string;sequenceNumber:bigint;sourceChainSelector:bigint;tokenAmountBeforeTokenPoolFees:bigint;tokenAmounts: readonlyTokenTransferV1[];verifierBlobs: readonlystring[]; } | {[k:string]:string;program:string; } |EVMExtraArgsV1& {allowOutOfOrderExecution:boolean; } & {_tag:"EVMExtraArgsV2"; } | {message:unknown;program:string; } |undefined
Defined in: solana/index.ts:1203
Parses raw Solana data into typed structures.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | unknown | Raw data to parse. |
Returns
Parsed data or undefined.
Type Literal
{ 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; }[]; }
CCIPMessage_V1_6_EVM
CCIPMessage_V1_6_Solana
Type Literal
{ ccipReceiveGasLimit: number; ccvAndExecutorHash: string; data: string; destBlob: string; destChainSelector: bigint; encodedMessage: string; executionGasLimit: number; feeToken: string; feeTokenAmount: bigint; finality: number; messageId: string; messageNumber: bigint; offRampAddress: string; onRampAddress: string; receipts: readonly { destBytesOverhead: bigint; destGasLimit: bigint; extraArgs: string; feeTokenAmount: bigint; issuer: string; }[]; receiver: string; sender: string; sequenceNumber: bigint; sourceChainSelector: bigint; tokenAmountBeforeTokenPoolFees: bigint; tokenAmounts: readonly TokenTransferV1[]; verifierBlobs: readonly string[]; }
Type Literal
{[k: string]: string; program: string; }
EVMExtraArgsV1 & { allowOutOfOrderExecution: boolean; } & { _tag: "EVMExtraArgsV2"; }
Type Literal
{ message: unknown; program: string; }
undefined