@chainlink/ccip-sdk 0.92.1 → 0.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -18
- package/dist/api/index.d.ts +103 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +141 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/types.d.ts +38 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +2 -0
- package/dist/api/types.js.map +1 -0
- package/dist/aptos/index.d.ts +20 -33
- package/dist/aptos/index.d.ts.map +1 -1
- package/dist/aptos/index.js +34 -26
- package/dist/aptos/index.js.map +1 -1
- package/dist/aptos/logs.js +1 -1
- package/dist/aptos/logs.js.map +1 -1
- package/dist/aptos/token.js.map +1 -1
- package/dist/chain.d.ts +206 -71
- package/dist/chain.d.ts.map +1 -1
- package/dist/chain.js +89 -20
- package/dist/chain.js.map +1 -1
- package/dist/commits.d.ts +2 -2
- package/dist/commits.d.ts.map +1 -1
- package/dist/commits.js +4 -4
- package/dist/commits.js.map +1 -1
- package/dist/errors/CCIPError.d.ts.map +1 -1
- package/dist/errors/CCIPError.js +3 -2
- package/dist/errors/CCIPError.js.map +1 -1
- package/dist/errors/codes.d.ts +4 -1
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/errors/codes.js +6 -1
- package/dist/errors/codes.js.map +1 -1
- package/dist/errors/index.d.ts +5 -2
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +8 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/errors/recovery.d.ts.map +1 -1
- package/dist/errors/recovery.js +4 -1
- package/dist/errors/recovery.js.map +1 -1
- package/dist/errors/specialized.d.ts +29 -4
- package/dist/errors/specialized.d.ts.map +1 -1
- package/dist/errors/specialized.js +48 -6
- package/dist/errors/specialized.js.map +1 -1
- package/dist/evm/errors.js.map +1 -1
- package/dist/evm/index.d.ts +24 -48
- package/dist/evm/index.d.ts.map +1 -1
- package/dist/evm/index.js +71 -59
- package/dist/evm/index.js.map +1 -1
- package/dist/evm/logs.js.map +1 -1
- package/dist/evm/offchain.js +3 -2
- package/dist/evm/offchain.js.map +1 -1
- package/dist/evm/viem/client-adapter.d.ts +68 -0
- package/dist/evm/viem/client-adapter.d.ts.map +1 -0
- package/dist/evm/viem/client-adapter.js +104 -0
- package/dist/evm/viem/client-adapter.js.map +1 -0
- package/dist/evm/viem/index.d.ts +29 -0
- package/dist/evm/viem/index.d.ts.map +1 -0
- package/dist/evm/viem/index.js +28 -0
- package/dist/evm/viem/index.js.map +1 -0
- package/dist/evm/viem/types.d.ts +13 -0
- package/dist/evm/viem/types.d.ts.map +1 -0
- package/dist/evm/viem/types.js +2 -0
- package/dist/evm/viem/types.js.map +1 -0
- package/dist/evm/viem/wallet-adapter.d.ts +58 -0
- package/dist/evm/viem/wallet-adapter.d.ts.map +1 -0
- package/dist/evm/viem/wallet-adapter.js +197 -0
- package/dist/evm/viem/wallet-adapter.js.map +1 -0
- package/dist/execution.d.ts +1 -1
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +2 -2
- package/dist/execution.js.map +1 -1
- package/dist/explorer.d.ts +74 -0
- package/dist/explorer.d.ts.map +1 -0
- package/dist/explorer.js +67 -0
- package/dist/explorer.js.map +1 -0
- package/dist/gas.js.map +1 -1
- package/dist/hasher/merklemulti.js.map +1 -1
- package/dist/http-status.d.ts +20 -0
- package/dist/http-status.d.ts.map +1 -0
- package/dist/http-status.js +25 -0
- package/dist/http-status.js.map +1 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/offchain.js.map +1 -1
- package/dist/requests.d.ts +4 -4
- package/dist/requests.d.ts.map +1 -1
- package/dist/requests.js +6 -6
- package/dist/requests.js.map +1 -1
- package/dist/solana/cleanup.js +2 -2
- package/dist/solana/cleanup.js.map +1 -1
- package/dist/solana/exec.js +1 -5
- package/dist/solana/exec.js.map +1 -1
- package/dist/solana/index.d.ts +28 -57
- package/dist/solana/index.d.ts.map +1 -1
- package/dist/solana/index.js +66 -70
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/logs.js +2 -2
- package/dist/solana/logs.js.map +1 -1
- package/dist/solana/offchain.js +3 -3
- package/dist/solana/offchain.js.map +1 -1
- package/dist/solana/send.js +1 -1
- package/dist/solana/send.js.map +1 -1
- package/dist/solana/utils.js +1 -1
- package/dist/solana/utils.js.map +1 -1
- package/dist/sui/discovery.d.ts.map +1 -1
- package/dist/sui/discovery.js +2 -5
- package/dist/sui/discovery.js.map +1 -1
- package/dist/sui/events.d.ts.map +1 -1
- package/dist/sui/events.js +1 -4
- package/dist/sui/events.js.map +1 -1
- package/dist/sui/index.d.ts +18 -29
- package/dist/sui/index.d.ts.map +1 -1
- package/dist/sui/index.js +24 -26
- package/dist/sui/index.js.map +1 -1
- package/dist/sui/manuallyExec/encoder.d.ts.map +1 -1
- package/dist/sui/manuallyExec/encoder.js +0 -3
- package/dist/sui/manuallyExec/encoder.js.map +1 -1
- package/dist/sui/manuallyExec/index.d.ts.map +1 -1
- package/dist/sui/manuallyExec/index.js +1 -2
- package/dist/sui/manuallyExec/index.js.map +1 -1
- package/dist/sui/objects.js +4 -4
- package/dist/sui/objects.js.map +1 -1
- package/dist/ton/exec.d.ts +2 -2
- package/dist/ton/exec.d.ts.map +1 -1
- package/dist/ton/exec.js.map +1 -1
- package/dist/ton/hasher.js +5 -5
- package/dist/ton/hasher.js.map +1 -1
- package/dist/ton/index.d.ts +54 -49
- package/dist/ton/index.d.ts.map +1 -1
- package/dist/ton/index.js +331 -236
- package/dist/ton/index.js.map +1 -1
- package/dist/ton/logs.d.ts +11 -22
- package/dist/ton/logs.d.ts.map +1 -1
- package/dist/ton/logs.js +95 -118
- package/dist/ton/logs.js.map +1 -1
- package/dist/ton/types.d.ts +9 -9
- package/dist/ton/types.d.ts.map +1 -1
- package/dist/ton/types.js +5 -9
- package/dist/ton/types.js.map +1 -1
- package/dist/ton/utils.d.ts +8 -27
- package/dist/ton/utils.d.ts.map +1 -1
- package/dist/ton/utils.js +31 -111
- package/dist/ton/utils.js.map +1 -1
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +30 -0
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +6 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +76 -52
- package/dist/utils.js.map +1 -1
- package/dist/viem.d.ts +6 -0
- package/dist/viem.d.ts.map +1 -0
- package/dist/viem.js +6 -0
- package/dist/viem.js.map +1 -0
- package/package.json +17 -2
- package/src/api/index.ts +167 -0
- package/src/api/types.ts +39 -0
- package/src/aptos/index.ts +57 -64
- package/src/aptos/logs.ts +10 -10
- package/src/aptos/token.ts +1 -1
- package/src/chain.ts +274 -97
- package/src/commits.ts +5 -5
- package/src/errors/CCIPError.ts +5 -2
- package/src/errors/codes.ts +8 -1
- package/src/errors/index.ts +15 -2
- package/src/errors/recovery.ts +9 -1
- package/src/errors/specialized.ts +61 -6
- package/src/evm/errors.ts +2 -2
- package/src/evm/index.ts +107 -120
- package/src/evm/logs.ts +4 -4
- package/src/evm/offchain.ts +5 -4
- package/src/evm/viem/client-adapter.ts +124 -0
- package/src/evm/viem/index.ts +29 -0
- package/src/evm/viem/types.ts +14 -0
- package/src/evm/viem/wallet-adapter.ts +233 -0
- package/src/execution.ts +9 -9
- package/src/explorer.ts +90 -0
- package/src/gas.ts +2 -2
- package/src/hasher/merklemulti.ts +7 -7
- package/src/http-status.ts +31 -0
- package/src/index.ts +18 -1
- package/src/offchain.ts +1 -1
- package/src/requests.ts +9 -12
- package/src/solana/cleanup.ts +4 -4
- package/src/solana/exec.ts +13 -18
- package/src/solana/index.ts +92 -117
- package/src/solana/logs.ts +8 -8
- package/src/solana/offchain.ts +3 -3
- package/src/solana/send.ts +20 -20
- package/src/solana/utils.ts +4 -4
- package/src/sui/discovery.ts +4 -10
- package/src/sui/events.ts +4 -8
- package/src/sui/index.ts +36 -48
- package/src/sui/manuallyExec/encoder.ts +0 -4
- package/src/sui/manuallyExec/index.ts +1 -3
- package/src/sui/objects.ts +14 -14
- package/src/ton/exec.ts +2 -5
- package/src/ton/hasher.ts +5 -5
- package/src/ton/index.ts +392 -316
- package/src/ton/logs.ts +122 -143
- package/src/ton/types.ts +17 -21
- package/src/ton/utils.ts +39 -145
- package/src/types.ts +36 -0
- package/src/utils.ts +96 -66
- package/src/viem.ts +5 -0
- package/tsconfig.json +3 -2
- package/dist/ton/bindings/offramp.d.ts +0 -48
- package/dist/ton/bindings/offramp.d.ts.map +0 -1
- package/dist/ton/bindings/offramp.js +0 -63
- package/dist/ton/bindings/offramp.js.map +0 -1
- package/dist/ton/bindings/onramp.d.ts +0 -40
- package/dist/ton/bindings/onramp.d.ts.map +0 -1
- package/dist/ton/bindings/onramp.js +0 -51
- package/dist/ton/bindings/onramp.js.map +0 -1
- package/dist/ton/bindings/router.d.ts +0 -47
- package/dist/ton/bindings/router.d.ts.map +0 -1
- package/dist/ton/bindings/router.js +0 -51
- package/dist/ton/bindings/router.js.map +0 -1
- package/src/ton/bindings/offramp.ts +0 -96
- package/src/ton/bindings/onramp.ts +0 -72
- package/src/ton/bindings/router.ts +0 -65
package/dist/chain.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BytesLike } from 'ethers';
|
|
2
2
|
import type { PickDeep, SetOptional } from 'type-fest';
|
|
3
|
+
import { type LaneLatencyResponse, CCIPAPIClient } from './api/index.ts';
|
|
3
4
|
import type { UnsignedAptosTx } from './aptos/types.ts';
|
|
4
5
|
import type { UnsignedEVMTx } from './evm/types.ts';
|
|
5
6
|
import type { EVMExtraArgsV1, EVMExtraArgsV2, ExtraArgs, SVMExtraArgsV1, SuiExtraArgsV1 } from './extra-args.ts';
|
|
@@ -8,6 +9,41 @@ import type { UnsignedSolanaTx } from './solana/types.ts';
|
|
|
8
9
|
import type { UnsignedTONTx } from './ton/types.ts';
|
|
9
10
|
import { type AnyMessage, type CCIPCommit, type CCIPExecution, type CCIPMessage, type CCIPRequest, type ChainFamily, type ChainTransaction, type CommitReport, type ExecutionReceipt, type ExecutionReport, type Lane, type Log_, type Logger, type NetworkInfo, type OffchainTokenData, type WithLogger } from './types.ts';
|
|
10
11
|
import { util } from './utils.ts';
|
|
12
|
+
/**
|
|
13
|
+
* Context for Chain class initialization.
|
|
14
|
+
* Extends WithLogger with optional API client configuration.
|
|
15
|
+
*
|
|
16
|
+
* @example Default behavior (auto-create API client)
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const chain = await EVMChain.fromUrl(rpcUrl, { logger })
|
|
19
|
+
* await chain.getLaneLatency(destSelector) // Works - uses production API
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example Custom API endpoint
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const api = new CCIPAPIClient('https://staging-api.example.com', { logger })
|
|
25
|
+
* const chain = await EVMChain.fromUrl(rpcUrl, { apiClient: api, logger })
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Explicit opt-out (decentralized mode)
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const chain = await EVMChain.fromUrl(rpcUrl, { apiClient: null, logger })
|
|
31
|
+
* await chain.getLaneLatency(destSelector) // Throws CCIPApiClientNotAvailableError
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export type ChainContext = WithLogger & {
|
|
35
|
+
/**
|
|
36
|
+
* CCIP API client instance for lane information queries.
|
|
37
|
+
*
|
|
38
|
+
* - `undefined` (default): Creates CCIPAPIClient with production endpoint
|
|
39
|
+
* (https://api.ccip.chain.link)
|
|
40
|
+
* - `CCIPAPIClient`: Uses provided instance (allows custom URL, fetch, etc.)
|
|
41
|
+
* - `null`: Disables API client entirely (getLaneLatency() will throw)
|
|
42
|
+
*
|
|
43
|
+
* Default: `undefined` (auto-create with production endpoint)
|
|
44
|
+
*/
|
|
45
|
+
apiClient?: CCIPAPIClient | null;
|
|
46
|
+
};
|
|
11
47
|
/**
|
|
12
48
|
* Filter options for getLogs queries across chains.
|
|
13
49
|
*/
|
|
@@ -77,6 +113,38 @@ export type UnsignedTx = {
|
|
|
77
113
|
[ChainFamily.TON]: UnsignedTONTx;
|
|
78
114
|
[ChainFamily.Sui]: never;
|
|
79
115
|
};
|
|
116
|
+
/**
|
|
117
|
+
* Common options for [[generateUnsignedSendMessage]] and [[sendMessage]] Chain methods
|
|
118
|
+
*/
|
|
119
|
+
export type SendMessageOpts = {
|
|
120
|
+
/** Router address on this chain */
|
|
121
|
+
router: string;
|
|
122
|
+
/** Destination network selector. */
|
|
123
|
+
destChainSelector: bigint;
|
|
124
|
+
/** Message to send. If `fee` is omitted, it'll be calculated */
|
|
125
|
+
message: AnyMessage & {
|
|
126
|
+
fee?: bigint;
|
|
127
|
+
};
|
|
128
|
+
/** Approve the maximum amount of tokens to transfer */
|
|
129
|
+
approveMax?: boolean;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Common options for [[generateUnsignedExecuteReport]] and [[executeReport]] Chain methods
|
|
133
|
+
*/
|
|
134
|
+
export type ExecuteReportOpts = {
|
|
135
|
+
/** address of the OffRamp contract */
|
|
136
|
+
offRamp: string;
|
|
137
|
+
/** execution report */
|
|
138
|
+
execReport: ExecutionReport;
|
|
139
|
+
/** gasLimit or computeUnits limit override for the ccipReceive call */
|
|
140
|
+
gasLimit?: number;
|
|
141
|
+
/** For EVM, overrides gasLimit on tokenPool call */
|
|
142
|
+
tokensGasLimit?: number;
|
|
143
|
+
/** For Solana, send report in chunks to OffRamp, to later execute */
|
|
144
|
+
forceBuffer?: boolean;
|
|
145
|
+
/** For Solana, create and extend addresses in a lookup table before executing */
|
|
146
|
+
forceLookupTable?: boolean;
|
|
147
|
+
};
|
|
80
148
|
/**
|
|
81
149
|
* Works like an interface for a base Chain class, but provides implementation (which can be
|
|
82
150
|
* specialized) for some basic methods
|
|
@@ -86,11 +154,14 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
|
|
|
86
154
|
[util.inspect.custom]: () => string;
|
|
87
155
|
readonly network: NetworkInfo<F>;
|
|
88
156
|
logger: Logger;
|
|
157
|
+
/** CCIP API client (null if opted out) */
|
|
158
|
+
readonly apiClient: CCIPAPIClient | null;
|
|
89
159
|
/**
|
|
90
160
|
* Base constructor for Chain class.
|
|
91
161
|
* @param network - NetworkInfo object for the Chain instance
|
|
162
|
+
* @param ctx - Optional context with logger and API client configuration
|
|
92
163
|
*/
|
|
93
|
-
constructor(network: NetworkInfo,
|
|
164
|
+
constructor(network: NetworkInfo, ctx?: ChainContext);
|
|
94
165
|
/** Cleanup method to release resources (e.g., close connections). */
|
|
95
166
|
destroy?(): void | Promise<void>;
|
|
96
167
|
/**
|
|
@@ -109,14 +180,21 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
|
|
|
109
180
|
* Confirm a log tx is finalized or wait for it to be finalized
|
|
110
181
|
* Throws if it isn't included (e.g. a reorg)
|
|
111
182
|
*/
|
|
112
|
-
waitFinalized({ log, tx
|
|
183
|
+
waitFinalized({ request: { log, tx }, finality, cancel$, }: {
|
|
184
|
+
request: SetOptional<PickDeep<CCIPRequest, `log.${'address' | 'blockNumber' | 'transactionHash' | 'topics' | 'tx.timestamp'}` | 'tx.timestamp'>, 'tx'>;
|
|
185
|
+
finality?: number | 'finalized';
|
|
186
|
+
cancel$?: Promise<unknown>;
|
|
187
|
+
}): Promise<true>;
|
|
113
188
|
/**
|
|
114
189
|
* An async generator that yields logs based on the provided options.
|
|
115
190
|
* @param opts - Options object containing:
|
|
116
191
|
* - `startBlock`: if provided, fetch and generate logs forward starting from this block;
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* - `
|
|
192
|
+
* otherwise, returns logs backwards in time from endBlock;
|
|
193
|
+
* optionally, startTime may be provided to fetch logs forward starting from this time
|
|
194
|
+
* - `startTime`: instead of a startBlock, a start timestamp may be provided;
|
|
195
|
+
* if either is provided, fetch logs forward from this starting point; otherwise, backwards
|
|
196
|
+
* - `endBlock`: if omitted, use latest block; can be a block number, 'latest', 'finalized' or
|
|
197
|
+
* negative finality block depth
|
|
120
198
|
* - `endBefore`: optional hint signature for end of iteration, instead of endBlock
|
|
121
199
|
* - `address`: if provided, fetch logs for this address only (may be required in some
|
|
122
200
|
* networks/implementations)
|
|
@@ -125,6 +203,7 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
|
|
|
125
203
|
* some networks/implementations may not be able to filter topics other than topic0s, so one may
|
|
126
204
|
* want to assume those are optimization hints, instead of hard filters, and verify results
|
|
127
205
|
* - `page`: if provided, try to use this page/range for batches
|
|
206
|
+
* - `watch`: true or cancellation promise, getLogs continuously after initial fetch
|
|
128
207
|
* @returns An async iterable iterator of logs.
|
|
129
208
|
*/
|
|
130
209
|
abstract getLogs(opts: LogFilter): AsyncIterableIterator<Log_>;
|
|
@@ -133,14 +212,14 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
|
|
|
133
212
|
* @param tx - ChainTransaction or txHash to fetch requests from
|
|
134
213
|
* @returns CCIP messages in the transaction (at least one)
|
|
135
214
|
**/
|
|
136
|
-
abstract
|
|
215
|
+
abstract getMessagesInTx(tx: string | ChainTransaction): Promise<CCIPRequest[]>;
|
|
137
216
|
/**
|
|
138
217
|
* Scan for a CCIP request by message ID
|
|
139
218
|
* @param messageId - message ID to fetch request for
|
|
140
219
|
* @param onRamp - address may be required in some implementations, and throw if missing
|
|
141
220
|
* @returns CCIPRequest
|
|
142
221
|
**/
|
|
143
|
-
|
|
222
|
+
getMessageById?(messageId: string, onRamp?: string, opts?: {
|
|
144
223
|
page?: number;
|
|
145
224
|
}): Promise<CCIPRequest>;
|
|
146
225
|
/**
|
|
@@ -149,7 +228,7 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
|
|
|
149
228
|
* @param commit - CommitReport range (min, max).
|
|
150
229
|
* @param opts - Optional parameters (e.g., `page` for pagination width).
|
|
151
230
|
*/
|
|
152
|
-
abstract
|
|
231
|
+
abstract getMessagesInBatch<R extends PickDeep<CCIPRequest, 'lane' | `log.${'topics' | 'address' | 'blockNumber'}` | 'message.sequenceNumber'>>(request: R, commit: Pick<CommitReport, 'minSeqNr' | 'maxSeqNr'>, opts?: {
|
|
153
232
|
page?: number;
|
|
154
233
|
}): Promise<R['message'][]>;
|
|
155
234
|
/**
|
|
@@ -232,99 +311,154 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
|
|
|
232
311
|
abstract getTokenAdminRegistryFor(address: string): Promise<string>;
|
|
233
312
|
/**
|
|
234
313
|
* Fetch the current fee for a given intended message
|
|
235
|
-
* @param
|
|
236
|
-
* @param destChainSelector - dest network selector
|
|
237
|
-
* @param message - message to send
|
|
314
|
+
* @param opts - {@link SendMessageOpts} without approveMax
|
|
238
315
|
*/
|
|
239
|
-
abstract getFee(
|
|
316
|
+
abstract getFee(opts: Omit<SendMessageOpts, 'approveMax'>): Promise<bigint>;
|
|
240
317
|
/**
|
|
241
318
|
* Generate unsigned txs for ccipSend'ing a message
|
|
242
|
-
* @param
|
|
243
|
-
* @param router - address of the Router contract
|
|
244
|
-
* @param destChainSelector - chainSelector of destination chain
|
|
245
|
-
* @param message - AnyMessage to send; if `fee` is not present, it'll be calculated
|
|
246
|
-
* @param approveMax - if tokens approvals are needed, opt into approving maximum allowance
|
|
319
|
+
* @param opts - {@link SendMessageOpts} with sender address
|
|
247
320
|
* @returns chain-family specific unsigned txs
|
|
248
321
|
*/
|
|
249
|
-
abstract generateUnsignedSendMessage(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
approveMax?: boolean;
|
|
322
|
+
abstract generateUnsignedSendMessage(opts: SendMessageOpts & {
|
|
323
|
+
/** Sender address (address of wallet which will send the message) */
|
|
324
|
+
sender: string;
|
|
253
325
|
}): Promise<UnsignedTx[F]>;
|
|
254
326
|
/**
|
|
255
327
|
* Send a CCIP message through a router using provided wallet.
|
|
256
|
-
* @param
|
|
257
|
-
* @
|
|
258
|
-
*
|
|
259
|
-
* @
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
328
|
+
* @param opts - {@link SendMessageOpts} with chain-specific wallet for signing
|
|
329
|
+
* @returns CCIP request
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* ```typescript
|
|
333
|
+
* const request = await chain.sendMessage({
|
|
334
|
+
* router: '0x...',
|
|
335
|
+
* destChainSelector: 4949039107694359620n,
|
|
336
|
+
* message: {
|
|
337
|
+
* receiver: '0x...',
|
|
338
|
+
* data: '0x1337',
|
|
339
|
+
* tokenAmounts: [{ token: '0x...', amount: 100n }],
|
|
340
|
+
* feeToken: '0xLinkToken',
|
|
341
|
+
* },
|
|
342
|
+
* wallet: signer,
|
|
343
|
+
* })
|
|
344
|
+
* console.log(`Message ID: ${request.message.messageId}`)
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
abstract sendMessage(opts: SendMessageOpts & {
|
|
348
|
+
/** Signer instance (chain-dependent) */
|
|
266
349
|
wallet: unknown;
|
|
267
|
-
approveMax?: boolean;
|
|
268
350
|
}): Promise<CCIPRequest>;
|
|
269
351
|
/**
|
|
270
352
|
* Fetch supported offchain token data for a request from this network
|
|
271
353
|
* @param request - CCIP request, with tx, logs and message
|
|
272
354
|
* @returns array with one offchain token data for each token transfer in request
|
|
273
355
|
*/
|
|
274
|
-
abstract
|
|
356
|
+
abstract getOffchainTokenData(request: CCIPRequest): Promise<OffchainTokenData[]>;
|
|
275
357
|
/**
|
|
276
358
|
* Generate unsigned tx to manuallyExecute a message
|
|
277
|
-
* @param
|
|
278
|
-
* @param offRamp - address of the OffRamp contract
|
|
279
|
-
* @param execReport - execution report
|
|
280
|
-
* @param gasLimit - gasLimit or computeUnits limit override for the ccipReceive call
|
|
281
|
-
* @param tokensGasLimit - For EVM, overrides gasLimit on tokenpPool call
|
|
282
|
-
* @param forceBuffer - For Solana, send report in chunks to OffRamp, to later execute
|
|
283
|
-
* @param forceLookupTable - For Solana, create and extend addresses in a lookup table before executing
|
|
359
|
+
* @param opts - {@link ExecuteReportOpts} with payer address which will send the exec tx
|
|
284
360
|
* @returns chain-family specific unsigned txs
|
|
285
361
|
*/
|
|
286
|
-
abstract generateUnsignedExecuteReport(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
forceBuffer?: boolean;
|
|
290
|
-
forceLookupTable?: boolean;
|
|
362
|
+
abstract generateUnsignedExecuteReport(opts: ExecuteReportOpts & {
|
|
363
|
+
/** address which will be used to send the report tx */
|
|
364
|
+
payer: string;
|
|
291
365
|
}): Promise<UnsignedTx[F]>;
|
|
292
366
|
/**
|
|
293
367
|
* Execute messages in report in an offRamp
|
|
294
|
-
* @param
|
|
295
|
-
* @param execReport - execution report containing messages to execute, proofs and offchainTokenData
|
|
296
|
-
* @param opts - general options for execution (see [[generateUnsignedExecuteReport]])
|
|
297
|
-
* @param wallet - chain-specific wallet or signer instance, to sign transactions
|
|
368
|
+
* @param opts - {@link ExecuteReportOpts} with chain-specific wallet to sign and send tx
|
|
298
369
|
* @returns transaction of the execution
|
|
299
|
-
|
|
300
|
-
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```typescript
|
|
373
|
+
* const execReportProof = calculateManualExecProof(
|
|
374
|
+
* messagesInBatch: await source.getMessagesInBatch(request, commit.report),
|
|
375
|
+
* request.lane,
|
|
376
|
+
* request.message.messageId,
|
|
377
|
+
* commit.report.merkleRoot,
|
|
378
|
+
* dest,
|
|
379
|
+
* )
|
|
380
|
+
* const receipt = await dest.executeReport({
|
|
381
|
+
* offRamp,
|
|
382
|
+
* execReport: {
|
|
383
|
+
* ...execReportProof,
|
|
384
|
+
* message: request.message,
|
|
385
|
+
* offchainTokenData: await source.getOffchainTokenData(request),
|
|
386
|
+
* },
|
|
387
|
+
* wallet,
|
|
388
|
+
* })
|
|
389
|
+
* console.log(`Message ID: ${request.message.messageId}`)
|
|
390
|
+
* ```
|
|
391
|
+
*/
|
|
392
|
+
abstract executeReport(opts: ExecuteReportOpts & {
|
|
301
393
|
wallet: unknown;
|
|
302
|
-
|
|
303
|
-
tokensGasLimit?: number;
|
|
304
|
-
forceBuffer?: boolean;
|
|
305
|
-
forceLookupTable?: boolean;
|
|
306
|
-
}): Promise<ChainTransaction>;
|
|
394
|
+
}): Promise<CCIPExecution>;
|
|
307
395
|
/**
|
|
308
396
|
* Look for a CommitReport at dest for given CCIP request
|
|
309
397
|
* May be specialized by some subclasses
|
|
310
|
-
*
|
|
311
|
-
* @param commitStore - Commit store address
|
|
312
|
-
* @param request - CCIPRequest to get commit info for
|
|
313
|
-
* @param hints - Additional filtering hints
|
|
398
|
+
* @param opts - getCommitReport options
|
|
314
399
|
* @returns CCIPCommit info, or reject if none found
|
|
315
400
|
**/
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
*
|
|
324
|
-
*
|
|
401
|
+
getCommitReport({ commitStore, request, ...hints }: {
|
|
402
|
+
/** address of commitStore (OffRamp in \>=v1.6) */
|
|
403
|
+
commitStore: string;
|
|
404
|
+
/** CCIPRequest subset object */
|
|
405
|
+
request: PickDeep<CCIPRequest, 'lane' | 'message.sequenceNumber' | 'tx.timestamp'>;
|
|
406
|
+
} & Pick<LogFilter, 'page' | 'watch' | 'startBlock'>): Promise<CCIPCommit>;
|
|
407
|
+
/**
|
|
408
|
+
* Fetches estimated lane latency to a destination chain.
|
|
409
|
+
* Uses this chain's selector as the source.
|
|
410
|
+
*
|
|
411
|
+
* @param destChainSelector - Destination CCIP chain selector (bigint)
|
|
412
|
+
* @returns Promise resolving to {@link LaneLatencyResponse} containing:
|
|
413
|
+
* - `lane.sourceNetworkInfo` - Source chain metadata (name, selector, chainId)
|
|
414
|
+
* - `lane.destNetworkInfo` - Destination chain metadata
|
|
415
|
+
* - `lane.routerAddress` - Router contract address on source chain
|
|
416
|
+
* - `totalMs` - Estimated delivery time in milliseconds
|
|
417
|
+
*
|
|
418
|
+
* @throws {@link CCIPApiClientNotAvailableError} if apiClient was disabled (set to `null`)
|
|
419
|
+
* @throws {@link CCIPHttpError} if API request fails (network error, 4xx, 5xx status)
|
|
420
|
+
*
|
|
421
|
+
* @remarks
|
|
422
|
+
* Each call makes a fresh API request. Consider caching results if making
|
|
423
|
+
* frequent calls for the same lane.
|
|
424
|
+
*
|
|
425
|
+
* @example Get estimated delivery time
|
|
426
|
+
* ```typescript
|
|
427
|
+
* const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
|
|
428
|
+
* try {
|
|
429
|
+
* const latency = await chain.getLaneLatency(4949039107694359620n) // Arbitrum
|
|
430
|
+
* console.log(`Estimated delivery: ${Math.round(latency.totalMs / 60000)} minutes`)
|
|
431
|
+
* console.log(`Router: ${latency.lane.routerAddress}`)
|
|
432
|
+
* } catch (err) {
|
|
433
|
+
* if (err instanceof CCIPHttpError) {
|
|
434
|
+
* console.error(`API error: ${err.context.apiErrorCode}`)
|
|
435
|
+
* }
|
|
436
|
+
* }
|
|
437
|
+
* ```
|
|
438
|
+
*/
|
|
439
|
+
getLaneLatency(destChainSelector: bigint): Promise<LaneLatencyResponse>;
|
|
440
|
+
/**
|
|
441
|
+
* Default/generic implementation of getExecutionReceipts
|
|
442
|
+
* @param opts - getExecutionReceipts options
|
|
325
443
|
* @returns Async generator of CCIPExecution receipts
|
|
326
444
|
*/
|
|
327
|
-
|
|
445
|
+
getExecutionReceipts({ offRamp, messageId, sourceChainSelector, commit, ...hints }: {
|
|
446
|
+
/** address of OffRamp contract */
|
|
447
|
+
offRamp: string;
|
|
448
|
+
/** filter: yield only executions for this message */
|
|
449
|
+
messageId?: string;
|
|
450
|
+
/** filter: yield only executions for this source chain */
|
|
451
|
+
sourceChainSelector?: bigint;
|
|
452
|
+
/** optional commit associated with the request, can be used for optimizations in some families */
|
|
453
|
+
commit?: CCIPCommit;
|
|
454
|
+
} & Pick<LogFilter, 'page' | 'watch' | 'startBlock' | 'startTime'>): AsyncIterableIterator<CCIPExecution>;
|
|
455
|
+
/**
|
|
456
|
+
* Fetch first execution receipt inside a transaction.
|
|
457
|
+
* @internal
|
|
458
|
+
* @param tx - transaction hash or transaction object
|
|
459
|
+
* @returns CCIP execution object
|
|
460
|
+
*/
|
|
461
|
+
getExecutionReceiptInTx(tx: string | ChainTransaction): Promise<CCIPExecution>;
|
|
328
462
|
/**
|
|
329
463
|
* List tokens supported by given TokenAdminRegistry contract.
|
|
330
464
|
* @param address - Usually TokenAdminRegistry, but chain may support receiving Router, OnRamp, etc.
|
|
@@ -374,8 +508,9 @@ export type ChainStatic<F extends ChainFamily = ChainFamily> = Function & {
|
|
|
374
508
|
/**
|
|
375
509
|
* async constructor: builds a Chain from a rpc endpoint url
|
|
376
510
|
* @param url - rpc endpoint url
|
|
511
|
+
* @param ctx - optional context with logger and API client configuration
|
|
377
512
|
*/
|
|
378
|
-
fromUrl(url: string, ctx?:
|
|
513
|
+
fromUrl(url: string, ctx?: ChainContext): Promise<Chain<F>>;
|
|
379
514
|
/**
|
|
380
515
|
* Try to decode a CCIP message *from* a log/event *originated* from this *source* chain,
|
|
381
516
|
* but which may *target* other dest chain families
|
package/dist/chain.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,KAAK,EA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{ getCommitReport } from "./commits.js";
|
|
3
|
+
import { CCIPApiClientNotAvailableError, CCIPChainFamilyMismatchError, CCIPExecTxRevertedError, CCIPTransactionNotFinalizedError, } from "./errors/index.js";
|
|
3
4
|
import { ExecutionState, } from "./types.js";
|
|
4
5
|
import { util } from "./utils.js";
|
|
5
6
|
/**
|
|
@@ -9,15 +10,29 @@ import { util } from "./utils.js";
|
|
|
9
10
|
export class Chain {
|
|
10
11
|
network;
|
|
11
12
|
logger;
|
|
13
|
+
/** CCIP API client (null if opted out) */
|
|
14
|
+
apiClient;
|
|
12
15
|
/**
|
|
13
16
|
* Base constructor for Chain class.
|
|
14
17
|
* @param network - NetworkInfo object for the Chain instance
|
|
18
|
+
* @param ctx - Optional context with logger and API client configuration
|
|
15
19
|
*/
|
|
16
|
-
constructor(network,
|
|
20
|
+
constructor(network, ctx) {
|
|
21
|
+
const { logger = console, apiClient } = ctx ?? {};
|
|
17
22
|
if (network.family !== this.constructor.family)
|
|
18
23
|
throw new CCIPChainFamilyMismatchError(this.constructor.name, this.constructor.family, network.family);
|
|
19
24
|
this.network = network;
|
|
20
25
|
this.logger = logger;
|
|
26
|
+
// API client initialization: default enabled, null = explicit opt-out
|
|
27
|
+
if (apiClient === null) {
|
|
28
|
+
this.apiClient = null; // Explicit opt-out
|
|
29
|
+
}
|
|
30
|
+
else if (apiClient !== undefined) {
|
|
31
|
+
this.apiClient = apiClient; // Use provided instance
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.apiClient = new CCIPAPIClient(undefined, { logger }); // Default
|
|
35
|
+
}
|
|
21
36
|
}
|
|
22
37
|
/** Custom inspector for Node.js util.inspect. */
|
|
23
38
|
[util.inspect.custom]() {
|
|
@@ -27,7 +42,7 @@ export class Chain {
|
|
|
27
42
|
* Confirm a log tx is finalized or wait for it to be finalized
|
|
28
43
|
* Throws if it isn't included (e.g. a reorg)
|
|
29
44
|
*/
|
|
30
|
-
async waitFinalized({ log, tx
|
|
45
|
+
async waitFinalized({ request: { log, tx }, finality = 'finalized', cancel$, }) {
|
|
31
46
|
const timestamp = log.tx?.timestamp ?? tx?.timestamp;
|
|
32
47
|
if (!timestamp || Date.now() / 1e3 - timestamp > 60) {
|
|
33
48
|
// only try to fetch tx if request is old enough (>60s)
|
|
@@ -57,34 +72,70 @@ export class Chain {
|
|
|
57
72
|
/**
|
|
58
73
|
* Look for a CommitReport at dest for given CCIP request
|
|
59
74
|
* May be specialized by some subclasses
|
|
60
|
-
*
|
|
61
|
-
* @param commitStore - Commit store address
|
|
62
|
-
* @param request - CCIPRequest to get commit info for
|
|
63
|
-
* @param hints - Additional filtering hints
|
|
75
|
+
* @param opts - getCommitReport options
|
|
64
76
|
* @returns CCIPCommit info, or reject if none found
|
|
65
77
|
**/
|
|
66
|
-
async
|
|
67
|
-
return
|
|
78
|
+
async getCommitReport({ commitStore, request, ...hints }) {
|
|
79
|
+
return getCommitReport(this, commitStore, request, hints);
|
|
68
80
|
}
|
|
69
81
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @param
|
|
74
|
-
* @
|
|
82
|
+
* Fetches estimated lane latency to a destination chain.
|
|
83
|
+
* Uses this chain's selector as the source.
|
|
84
|
+
*
|
|
85
|
+
* @param destChainSelector - Destination CCIP chain selector (bigint)
|
|
86
|
+
* @returns Promise resolving to {@link LaneLatencyResponse} containing:
|
|
87
|
+
* - `lane.sourceNetworkInfo` - Source chain metadata (name, selector, chainId)
|
|
88
|
+
* - `lane.destNetworkInfo` - Destination chain metadata
|
|
89
|
+
* - `lane.routerAddress` - Router contract address on source chain
|
|
90
|
+
* - `totalMs` - Estimated delivery time in milliseconds
|
|
91
|
+
*
|
|
92
|
+
* @throws {@link CCIPApiClientNotAvailableError} if apiClient was disabled (set to `null`)
|
|
93
|
+
* @throws {@link CCIPHttpError} if API request fails (network error, 4xx, 5xx status)
|
|
94
|
+
*
|
|
95
|
+
* @remarks
|
|
96
|
+
* Each call makes a fresh API request. Consider caching results if making
|
|
97
|
+
* frequent calls for the same lane.
|
|
98
|
+
*
|
|
99
|
+
* @example Get estimated delivery time
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const chain = await EVMChain.fromUrl('https://eth-mainnet.example.com')
|
|
102
|
+
* try {
|
|
103
|
+
* const latency = await chain.getLaneLatency(4949039107694359620n) // Arbitrum
|
|
104
|
+
* console.log(`Estimated delivery: ${Math.round(latency.totalMs / 60000)} minutes`)
|
|
105
|
+
* console.log(`Router: ${latency.lane.routerAddress}`)
|
|
106
|
+
* } catch (err) {
|
|
107
|
+
* if (err instanceof CCIPHttpError) {
|
|
108
|
+
* console.error(`API error: ${err.context.apiErrorCode}`)
|
|
109
|
+
* }
|
|
110
|
+
* }
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
async getLaneLatency(destChainSelector) {
|
|
114
|
+
if (!this.apiClient) {
|
|
115
|
+
throw new CCIPApiClientNotAvailableError();
|
|
116
|
+
}
|
|
117
|
+
return this.apiClient.getLaneLatency(this.network.chainSelector, destChainSelector);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Default/generic implementation of getExecutionReceipts
|
|
121
|
+
* @param opts - getExecutionReceipts options
|
|
75
122
|
* @returns Async generator of CCIPExecution receipts
|
|
76
123
|
*/
|
|
77
|
-
async *
|
|
78
|
-
|
|
124
|
+
async *getExecutionReceipts({ offRamp, messageId, sourceChainSelector, commit, ...hints }) {
|
|
125
|
+
hints.startBlock ??= commit?.log.blockNumber;
|
|
126
|
+
const onlyLast = !hints.startTime && !hints.startBlock; // backwards
|
|
79
127
|
for await (const log of this.getLogs({
|
|
80
|
-
startBlock: commit?.log.blockNumber,
|
|
81
|
-
startTime: request.tx.timestamp,
|
|
82
128
|
address: offRamp,
|
|
83
129
|
topics: ['ExecutionStateChanged'],
|
|
84
130
|
...hints,
|
|
85
131
|
})) {
|
|
86
132
|
const receipt = this.constructor.decodeReceipt(log);
|
|
87
|
-
|
|
133
|
+
// filters
|
|
134
|
+
if (!receipt ||
|
|
135
|
+
(messageId && receipt.messageId !== messageId) ||
|
|
136
|
+
(sourceChainSelector &&
|
|
137
|
+
receipt.sourceChainSelector &&
|
|
138
|
+
receipt.sourceChainSelector !== sourceChainSelector))
|
|
88
139
|
continue;
|
|
89
140
|
const timestamp = log.tx?.timestamp ?? (await this.getBlockTimestamp(log.blockNumber));
|
|
90
141
|
yield { receipt, log, timestamp };
|
|
@@ -92,5 +143,23 @@ export class Chain {
|
|
|
92
143
|
break;
|
|
93
144
|
}
|
|
94
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Fetch first execution receipt inside a transaction.
|
|
148
|
+
* @internal
|
|
149
|
+
* @param tx - transaction hash or transaction object
|
|
150
|
+
* @returns CCIP execution object
|
|
151
|
+
*/
|
|
152
|
+
async getExecutionReceiptInTx(tx) {
|
|
153
|
+
if (typeof tx === 'string')
|
|
154
|
+
tx = await this.getTransaction(tx);
|
|
155
|
+
for (const log of tx.logs) {
|
|
156
|
+
const rcpt = this.constructor.decodeReceipt(log);
|
|
157
|
+
if (!rcpt)
|
|
158
|
+
continue;
|
|
159
|
+
const timestamp = tx.timestamp;
|
|
160
|
+
return { receipt: rcpt, log, timestamp };
|
|
161
|
+
}
|
|
162
|
+
throw new CCIPExecTxRevertedError(tx.hash);
|
|
163
|
+
}
|
|
95
164
|
}
|
|
96
165
|
//# sourceMappingURL=chain.js.map
|
package/dist/chain.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4B,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EACL,8BAA8B,EAC9B,4BAA4B,EAC5B,uBAAuB,EACvB,gCAAgC,GACj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C,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;YACtF,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,CAAA;YACjC,IAAI,QAAQ,IAAI,OAAO,CAAC,KAAK,KAAK,cAAc,CAAC,OAAO;gBAAE,MAAK;QACjE,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,uBAAuB,CAAC,EAA6B;QACzD,IAAI,OAAO,EAAE,KAAK,QAAQ;YAAE,EAAE,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;QAC9D,KAAK,MAAM,GAAG,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;YAC1B,MAAM,IAAI,GAAI,IAAI,CAAC,WAA2B,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;YACjE,IAAI,CAAC,IAAI;gBAAE,SAAQ;YAEnB,MAAM,SAAS,GAAG,EAAE,CAAC,SAAS,CAAA;YAC9B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,CAAA;QAC1C,CAAC;QACD,MAAM,IAAI,uBAAuB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;CAmDF"}
|
package/dist/commits.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type CCIPCommit, type CCIPRequest } from './types.ts';
|
|
|
4
4
|
/**
|
|
5
5
|
* Look for a CommitReport at dest for given CCIPRequest
|
|
6
6
|
* Provides a basic/generic implementation, but subclasses of Chain may override with more specific
|
|
7
|
-
* logic in Chain.
|
|
7
|
+
* logic in Chain.getCommitReport method
|
|
8
8
|
*
|
|
9
9
|
* @param dest - Destination network provider
|
|
10
10
|
* @param commitStore - Commit store address
|
|
@@ -12,7 +12,7 @@ import { type CCIPCommit, type CCIPRequest } from './types.ts';
|
|
|
12
12
|
* @param hints - Additional filtering hints
|
|
13
13
|
* @returns CCIP commit info
|
|
14
14
|
**/
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function getCommitReport(dest: Chain, commitStore: string, { lane, message, tx: { timestamp: requestTimestamp }, }: PickDeep<CCIPRequest, 'lane' | 'message.sequenceNumber' | 'tx.timestamp'>, hints?: Pick<LogFilter, 'page' | 'watch'> & {
|
|
16
16
|
startBlock?: number;
|
|
17
17
|
}): Promise<CCIPCommit>;
|
|
18
18
|
//# sourceMappingURL=commits.d.ts.map
|