@chainlink/ccip-sdk 0.95.0 → 0.96.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.
Files changed (115) hide show
  1. package/README.md +2 -2
  2. package/dist/all-chains.d.ts +23 -0
  3. package/dist/all-chains.d.ts.map +1 -0
  4. package/dist/all-chains.js +24 -0
  5. package/dist/all-chains.js.map +1 -0
  6. package/dist/api/index.d.ts +15 -12
  7. package/dist/api/index.d.ts.map +1 -1
  8. package/dist/api/index.js +20 -16
  9. package/dist/api/index.js.map +1 -1
  10. package/dist/api/types.d.ts +25 -29
  11. package/dist/api/types.d.ts.map +1 -1
  12. package/dist/aptos/index.d.ts +33 -8
  13. package/dist/aptos/index.d.ts.map +1 -1
  14. package/dist/aptos/index.js +74 -41
  15. package/dist/aptos/index.js.map +1 -1
  16. package/dist/chain.d.ts +220 -41
  17. package/dist/chain.d.ts.map +1 -1
  18. package/dist/chain.js +105 -15
  19. package/dist/chain.js.map +1 -1
  20. package/dist/errors/codes.d.ts +2 -0
  21. package/dist/errors/codes.d.ts.map +1 -1
  22. package/dist/errors/codes.js +2 -0
  23. package/dist/errors/codes.js.map +1 -1
  24. package/dist/errors/index.d.ts +1 -1
  25. package/dist/errors/index.d.ts.map +1 -1
  26. package/dist/errors/index.js +1 -1
  27. package/dist/errors/index.js.map +1 -1
  28. package/dist/errors/recovery.d.ts.map +1 -1
  29. package/dist/errors/recovery.js +2 -0
  30. package/dist/errors/recovery.js.map +1 -1
  31. package/dist/errors/specialized.d.ts +12 -6
  32. package/dist/errors/specialized.d.ts.map +1 -1
  33. package/dist/errors/specialized.js +19 -7
  34. package/dist/errors/specialized.js.map +1 -1
  35. package/dist/evm/extra-args.d.ts +25 -0
  36. package/dist/evm/extra-args.d.ts.map +1 -0
  37. package/dist/evm/extra-args.js +328 -0
  38. package/dist/evm/extra-args.js.map +1 -0
  39. package/dist/evm/gas.d.ts.map +1 -1
  40. package/dist/evm/gas.js +7 -12
  41. package/dist/evm/gas.js.map +1 -1
  42. package/dist/evm/index.d.ts +70 -24
  43. package/dist/evm/index.d.ts.map +1 -1
  44. package/dist/evm/index.js +72 -91
  45. package/dist/evm/index.js.map +1 -1
  46. package/dist/execution.d.ts.map +1 -1
  47. package/dist/execution.js +16 -2
  48. package/dist/execution.js.map +1 -1
  49. package/dist/extra-args.d.ts +103 -4
  50. package/dist/extra-args.d.ts.map +1 -1
  51. package/dist/extra-args.js +28 -3
  52. package/dist/extra-args.js.map +1 -1
  53. package/dist/gas.d.ts +6 -3
  54. package/dist/gas.d.ts.map +1 -1
  55. package/dist/gas.js +14 -6
  56. package/dist/gas.js.map +1 -1
  57. package/dist/index.d.ts +10 -9
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/index.js +8 -8
  60. package/dist/index.js.map +1 -1
  61. package/dist/requests.d.ts +17 -9
  62. package/dist/requests.d.ts.map +1 -1
  63. package/dist/requests.js +17 -9
  64. package/dist/requests.js.map +1 -1
  65. package/dist/selectors.d.ts.map +1 -1
  66. package/dist/selectors.js +12 -0
  67. package/dist/selectors.js.map +1 -1
  68. package/dist/solana/index.d.ts +70 -15
  69. package/dist/solana/index.d.ts.map +1 -1
  70. package/dist/solana/index.js +72 -16
  71. package/dist/solana/index.js.map +1 -1
  72. package/dist/sui/index.d.ts +37 -9
  73. package/dist/sui/index.d.ts.map +1 -1
  74. package/dist/sui/index.js +40 -11
  75. package/dist/sui/index.js.map +1 -1
  76. package/dist/ton/index.d.ts +65 -19
  77. package/dist/ton/index.d.ts.map +1 -1
  78. package/dist/ton/index.js +155 -25
  79. package/dist/ton/index.js.map +1 -1
  80. package/dist/ton/send.d.ts +52 -0
  81. package/dist/ton/send.d.ts.map +1 -0
  82. package/dist/ton/send.js +166 -0
  83. package/dist/ton/send.js.map +1 -0
  84. package/dist/types.d.ts +102 -1
  85. package/dist/types.d.ts.map +1 -1
  86. package/dist/types.js.map +1 -1
  87. package/dist/utils.d.ts +15 -3
  88. package/dist/utils.d.ts.map +1 -1
  89. package/dist/utils.js +19 -6
  90. package/dist/utils.js.map +1 -1
  91. package/package.json +12 -7
  92. package/src/all-chains.ts +26 -0
  93. package/src/api/index.ts +26 -25
  94. package/src/api/types.ts +25 -30
  95. package/src/aptos/index.ts +79 -43
  96. package/src/chain.ts +274 -46
  97. package/src/errors/codes.ts +2 -0
  98. package/src/errors/index.ts +1 -1
  99. package/src/errors/recovery.ts +2 -0
  100. package/src/errors/specialized.ts +24 -7
  101. package/src/evm/extra-args.ts +377 -0
  102. package/src/evm/gas.ts +14 -13
  103. package/src/evm/index.ts +76 -125
  104. package/src/execution.ts +18 -2
  105. package/src/extra-args.ts +108 -4
  106. package/src/gas.ts +16 -9
  107. package/src/index.ts +12 -9
  108. package/src/requests.ts +17 -9
  109. package/src/selectors.ts +12 -0
  110. package/src/solana/index.ts +72 -16
  111. package/src/sui/index.ts +40 -11
  112. package/src/ton/index.ts +192 -27
  113. package/src/ton/send.ts +222 -0
  114. package/src/types.ts +103 -1
  115. package/src/utils.ts +19 -6
package/dist/chain.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { PickDeep, SetOptional } from 'type-fest';
3
3
  import { type LaneLatencyResponse, CCIPAPIClient } from './api/index.ts';
4
4
  import type { UnsignedAptosTx } from './aptos/types.ts';
5
5
  import type { UnsignedEVMTx } from './evm/types.ts';
6
- import type { EVMExtraArgsV1, EVMExtraArgsV2, ExtraArgs, SVMExtraArgsV1, SuiExtraArgsV1 } from './extra-args.ts';
6
+ import type { EVMExtraArgsV1, EVMExtraArgsV2, ExtraArgs, GenericExtraArgsV3, SVMExtraArgsV1, SuiExtraArgsV1 } from './extra-args.ts';
7
7
  import type { LeafHasher } from './hasher/common.ts';
8
8
  import type { UnsignedSolanaTx } from './solana/types.ts';
9
9
  import type { UnsignedTONTx } from './ton/types.ts';
@@ -35,8 +35,7 @@ export type ChainContext = WithLogger & {
35
35
  /**
36
36
  * CCIP API client instance for lane information queries.
37
37
  *
38
- * - `undefined` (default): Creates CCIPAPIClient with production endpoint
39
- * (https://api.ccip.chain.link)
38
+ * - `undefined` (default): Creates CCIPAPIClient with {@link DEFAULT_API_BASE_URL}
40
39
  * - `CCIPAPIClient`: Uses provided instance (allows custom URL, fetch, etc.)
41
40
  * - `null`: Disables API client entirely (getLaneLatency() will throw)
42
41
  *
@@ -111,29 +110,91 @@ export type GetBalanceOpts = {
111
110
  };
112
111
  /**
113
112
  * Rate limiter state for token pool configurations.
114
- * Null if rate limiting is disabled.
113
+ *
114
+ * @remarks
115
+ * - Returns the rate limiter bucket state when rate limiting is **enabled**
116
+ * - Returns `null` when rate limiting is **disabled** (unlimited throughput)
117
+ *
118
+ * @example Handling nullable state
119
+ * ```typescript
120
+ * const remote = await chain.getTokenPoolRemotes(poolAddress)
121
+ * const state = remote['ethereum-mainnet'].inboundRateLimiterState
122
+ *
123
+ * if (state === null) {
124
+ * console.log('Rate limiting disabled - unlimited throughput')
125
+ * } else {
126
+ * console.log(`Capacity: ${state.capacity}, Available: ${state.tokens}`)
127
+ * }
128
+ * ```
115
129
  */
116
130
  export type RateLimiterState = {
117
131
  /** Current token balance in the rate limiter bucket. */
118
132
  tokens: bigint;
119
133
  /** Maximum capacity of the rate limiter bucket. */
120
134
  capacity: bigint;
121
- /** Rate at which tokens are replenished. */
135
+ /** Rate at which tokens are replenished (tokens per second). */
122
136
  rate: bigint;
123
137
  } | null;
124
138
  /**
125
- * Remote token pool configuration for a specific chain.
139
+ * Remote token pool configuration for a specific destination chain.
140
+ *
141
+ * @remarks
142
+ * Each entry represents the configuration needed to transfer tokens
143
+ * from the current chain to a specific destination chain.
126
144
  */
127
145
  export type TokenPoolRemote = {
128
146
  /** Address of the remote token on the destination chain. */
129
147
  remoteToken: string;
130
- /** Addresses of remote token pools. */
148
+ /**
149
+ * Addresses of remote token pools on the destination chain.
150
+ *
151
+ * @remarks
152
+ * Multiple pools may exist for:
153
+ * - Redundancy (failover if one pool is unavailable)
154
+ * - Capacity aggregation across pools
155
+ * - Version management (different pool implementations)
156
+ */
131
157
  remotePools: string[];
132
158
  /** Inbound rate limiter state for tokens coming into this chain. */
133
159
  inboundRateLimiterState: RateLimiterState;
134
160
  /** Outbound rate limiter state for tokens leaving this chain. */
135
161
  outboundRateLimiterState: RateLimiterState;
136
162
  };
163
+ /**
164
+ * Token pool configuration returned by {@link Chain.getTokenPoolConfig}.
165
+ *
166
+ * @remarks
167
+ * Contains the core configuration of a token pool including the token it manages,
168
+ * the router it's registered with, and optionally its version identifier.
169
+ */
170
+ export type TokenPoolConfig = {
171
+ /** Address of the token managed by this pool. */
172
+ token: string;
173
+ /** Address of the CCIP router this pool is registered with. */
174
+ router: string;
175
+ /**
176
+ * Version identifier string (e.g., "BurnMintTokenPool 1.5.1").
177
+ *
178
+ * @remarks
179
+ * May be undefined for older pool implementations that don't expose this method.
180
+ */
181
+ typeAndVersion?: string;
182
+ };
183
+ /**
184
+ * Token configuration from a TokenAdminRegistry, returned by {@link Chain.getRegistryTokenConfig}.
185
+ *
186
+ * @remarks
187
+ * The TokenAdminRegistry tracks which administrator controls each token
188
+ * and which pool is authorized to handle transfers.
189
+ */
190
+ export type RegistryTokenConfig = {
191
+ /** Address of the current administrator for this token. */
192
+ administrator: string;
193
+ /** Address of pending administrator (if ownership transfer is in progress). */
194
+ pendingAdministrator?: string;
195
+ /** Address of the token pool authorized to handle this token's transfers. */
196
+ tokenPool?: string;
197
+ };
137
198
  /**
138
199
  * Maps chain family to respective unsigned transaction type.
139
200
  */
@@ -146,7 +207,7 @@ export type UnsignedTx = {
146
207
  [ChainFamily.Unknown]: never;
147
208
  };
148
209
  /**
149
- * Common options for [[getFee]], [[generateUnsignedSendMessage]] and [[sendMessage]] Chain methods
210
+ * Common options for {@link Chain.getFee}, {@link Chain.generateUnsignedSendMessage} and {@link Chain.sendMessage} methods.
150
211
  */
151
212
  export type SendMessageOpts = {
152
213
  /** Router address on this chain */
@@ -159,7 +220,7 @@ export type SendMessageOpts = {
159
220
  approveMax?: boolean;
160
221
  };
161
222
  /**
162
- * Common options for [[generateUnsignedExecuteReport]] and [[executeReport]] Chain methods
223
+ * Common options for {@link Chain.generateUnsignedExecuteReport} and {@link Chain.executeReport} methods.
163
224
  */
164
225
  export type ExecuteReportOpts = {
165
226
  /** address of the OffRamp contract */
@@ -192,6 +253,7 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
192
253
  * Base constructor for Chain class.
193
254
  * @param network - NetworkInfo object for the Chain instance
194
255
  * @param ctx - Optional context with logger and API client configuration
256
+ * @throws {@link CCIPChainFamilyMismatchError} if network family doesn't match the Chain subclass
195
257
  */
196
258
  constructor(network: NetworkInfo, ctx?: ChainContext);
197
259
  /** Cleanup method to release resources (e.g., close connections). */
@@ -200,17 +262,21 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
200
262
  * Fetch the timestamp of a given block
201
263
  * @param block - positive block number, negative finality depth or 'finalized' tag
202
264
  * @returns timestamp of the block, in seconds
265
+ * @throws {@link CCIPBlockNotFoundError} if block does not exist
203
266
  */
204
267
  abstract getBlockTimestamp(block: number | 'finalized'): Promise<number>;
205
268
  /**
206
269
  * Fetch a transaction by its hash
207
270
  * @param hash - transaction hash
208
271
  * @returns generic transaction details
272
+ * @throws {@link CCIPTransactionNotFoundError} if transaction not found
209
273
  */
210
274
  abstract getTransaction(hash: string): Promise<ChainTransaction>;
211
275
  /**
212
- * Confirm a log tx is finalized or wait for it to be finalized
213
- * Throws if it isn't included (e.g. a reorg)
276
+ * Confirm a log tx is finalized or wait for it to be finalized.
277
+ * @param opts - Options containing the request, finality level, and optional cancel promise
278
+ * @returns true when the transaction is finalized
279
+ * @throws {@link CCIPTransactionNotFinalizedError} if the transaction is not included (e.g., due to a reorg)
214
280
  */
215
281
  waitFinalized({ request: { log, tx }, finality, cancel$, }: {
216
282
  request: SetOptional<PickDeep<CCIPRequest, `log.${'address' | 'blockNumber' | 'transactionHash' | 'topics' | 'tx.timestamp'}` | 'tx.timestamp'>, 'tx'>;
@@ -237,21 +303,44 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
237
303
  * - `page`: if provided, try to use this page/range for batches
238
304
  * - `watch`: true or cancellation promise, getLogs continuously after initial fetch
239
305
  * @returns An async iterable iterator of logs.
306
+ * @throws {@link CCIPLogsWatchRequiresFinalityError} if watch mode is used without a finality endBlock tag
307
+ * @throws {@link CCIPLogsWatchRequiresStartError} if watch mode is used without startBlock or startTime
308
+ * @throws {@link CCIPLogsAddressRequiredError} if address is required but not provided (chain-specific)
240
309
  */
241
310
  abstract getLogs(opts: LogFilter): AsyncIterableIterator<Log_>;
242
311
  /**
243
312
  * Fetch all CCIP requests in a transaction
244
313
  * @param tx - ChainTransaction or txHash to fetch requests from
245
314
  * @returns CCIP messages in the transaction (at least one)
246
- **/
315
+ * @throws {@link CCIPMessageNotFoundInTxError} if no CCIP messages found in transaction
316
+ */
247
317
  getMessagesInTx(tx: string | ChainTransaction): Promise<CCIPRequest[]>;
248
318
  /**
249
- * Fetch a message by ID.
250
- * Default implementation just tries API.
251
- * Children may override to fetch from chain as fallback
252
- * @param messageId - message ID to fetch request for
253
- * @param _opts - onRamp may be required in some implementations, and throw if missing
254
- * @returns CCIPRequest
319
+ * Fetch a CCIP message by its unique message ID.
320
+ *
321
+ * @remarks
322
+ * Uses the CCIP API to retrieve message details. The returned request includes
323
+ * a `metadata` field with API-specific information.
324
+ *
325
+ * @example
326
+ * ```typescript
327
+ * const request = await chain.getMessageById(messageId)
328
+ * console.log(`Sender: ${request.message.sender}`)
329
+ *
330
+ * if (request.metadata) {
331
+ * console.log(`Status: ${request.metadata.status}`)
332
+ * if (request.metadata.deliveryTime) {
333
+ * console.log(`Delivered in ${request.metadata.deliveryTime}ms`)
334
+ * }
335
+ * }
336
+ * ```
337
+ *
338
+ * @param messageId - The unique message ID (0x + 64 hex chars)
339
+ * @param _opts - Optional: `onRamp` hint for non-EVM chains
340
+ * @returns CCIPRequest with `metadata` populated from API
341
+ * @throws {@link CCIPApiClientNotAvailableError} if API disabled
342
+ * @throws {@link CCIPMessageIdNotFoundError} if message not found
343
+ * @throws {@link CCIPHttpError} if API request fails
255
344
  **/
256
345
  getMessageById(messageId: string, _opts?: {
257
346
  page?: number;
@@ -262,6 +351,8 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
262
351
  * @param request - CCIPRequest to fetch batch for.
263
352
  * @param commit - CommitReport range (min, max).
264
353
  * @param opts - Optional parameters (e.g., `page` for pagination width).
354
+ * @returns Array of messages in the batch.
355
+ * @throws {@link CCIPMessageBatchIncompleteError} if not all messages in range could be fetched
265
356
  */
266
357
  abstract getMessagesInBatch<R extends PickDeep<CCIPRequest, 'lane' | `log.${'topics' | 'address' | 'blockNumber'}` | 'message.sequenceNumber'>>(request: R, commit: Pick<CommitReport, 'minSeqNr' | 'maxSeqNr'>, opts?: {
267
358
  page?: number;
@@ -273,6 +364,7 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
273
364
  * @returns version - parsed version of the contract, e.g. `1.6.0`
274
365
  * @returns typeAndVersion - original (unparsed) typeAndVersion() string
275
366
  * @returns suffix - suffix of the version, if any (e.g. `-dev`)
367
+ * @throws {@link CCIPTypeVersionInvalidError} if contract doesn't have valid typeAndVersion
276
368
  */
277
369
  abstract typeAndVersion(address: string): Promise<[type: string, version: string, typeAndVersion: string, suffix?: string]>;
278
370
  /**
@@ -364,12 +456,14 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
364
456
  /**
365
457
  * Fetch TokenAdminRegistry configured in a given OnRamp, Router, etc
366
458
  * Needed to map a source token to its dest counterparts
367
- * @param onRamp - Some contract for which we can fetch a TokenAdminRegistry
459
+ * @param address - Some contract for which we can fetch a TokenAdminRegistry (OnRamp, Router, etc.)
460
+ * @returns TokenAdminRegistry address
368
461
  */
369
462
  abstract getTokenAdminRegistryFor(address: string): Promise<string>;
370
463
  /**
371
464
  * Fetch the current fee for a given intended message
372
465
  * @param opts - {@link SendMessageOpts} without approveMax
466
+ * @returns Fee amount in the feeToken's smallest units
373
467
  */
374
468
  abstract getFee(opts: Omit<SendMessageOpts, 'approveMax'>): Promise<bigint>;
375
469
  /**
@@ -385,6 +479,7 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
385
479
  * Send a CCIP message through a router using provided wallet.
386
480
  * @param opts - {@link SendMessageOpts} with chain-specific wallet for signing
387
481
  * @returns CCIP request
482
+ * @throws {@link CCIPWalletNotSignerError} if wallet cannot sign transactions
388
483
  *
389
484
  * @example
390
485
  * ```typescript
@@ -446,6 +541,8 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
446
541
  * })
447
542
  * console.log(`Message ID: ${request.message.messageId}`)
448
543
  * ```
544
+ * @throws {@link CCIPWalletNotSignerError} if wallet cannot sign transactions
545
+ * @throws {@link CCIPExecTxNotConfirmedError} if execution transaction fails to confirm
449
546
  */
450
547
  abstract executeReport(opts: ExecuteReportOpts & {
451
548
  wallet: unknown;
@@ -454,8 +551,9 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
454
551
  * Look for a CommitReport at dest for given CCIP request
455
552
  * May be specialized by some subclasses
456
553
  * @param opts - getCommitReport options
457
- * @returns CCIPCommit info, or reject if none found
458
- **/
554
+ * @returns CCIPCommit info
555
+ * @throws {@link CCIPCommitNotFoundError} if no commit found for the request
556
+ */
459
557
  getCommitReport({ commitStore, request, ...hints }: {
460
558
  /** address of commitStore (OffRamp in \>=v1.6) */
461
559
  commitStore: string;
@@ -515,6 +613,7 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
515
613
  * @internal
516
614
  * @param tx - transaction hash or transaction object
517
615
  * @returns CCIP execution object
616
+ * @throws {@link CCIPExecTxRevertedError} if no execution receipt found in transaction
518
617
  */
519
618
  getExecutionReceiptInTx(tx: string | ChainTransaction): Promise<CCIPExecution>;
520
619
  /**
@@ -527,31 +626,109 @@ export declare abstract class Chain<F extends ChainFamily = ChainFamily> {
527
626
  page?: number;
528
627
  }): Promise<string[]>;
529
628
  /**
530
- * Get TokenConfig for a given token address in a TokenAdminRegistry
531
- * @param address - TokenAdminRegistry contract address
532
- * @param token - Token address
629
+ * Fetch token configuration from a TokenAdminRegistry.
630
+ *
631
+ * @remarks
632
+ * The TokenAdminRegistry is a contract that tracks token administrators and their
633
+ * associated pools. Each token has an administrator who can update pool configurations.
634
+ *
635
+ * @example Query a token's registry configuration
636
+ * ```typescript
637
+ * const config = await chain.getRegistryTokenConfig(registryAddress, tokenAddress)
638
+ * console.log(`Administrator: ${config.administrator}`)
639
+ * if (config.tokenPool) {
640
+ * console.log(`Pool: ${config.tokenPool}`)
641
+ * }
642
+ * ```
643
+ *
644
+ * @param registry - TokenAdminRegistry contract address.
645
+ * @param token - Token address to query.
646
+ * @returns {@link RegistryTokenConfig} containing administrator and pool information.
647
+ * @throws {@link CCIPTokenNotInRegistryError} if token is not registered.
533
648
  */
534
- abstract getRegistryTokenConfig(registry: string, token: string): Promise<{
535
- administrator: string;
536
- pendingAdministrator?: string;
537
- tokenPool?: string;
538
- }>;
649
+ abstract getRegistryTokenConfig(registry: string, token: string): Promise<RegistryTokenConfig>;
539
650
  /**
540
- * Get TokenPool state and configurations
541
- * @param tokenPool - Token pool address
651
+ * Fetch configuration of a token pool.
652
+ *
653
+ * @remarks
654
+ * Returns the core configuration of a token pool including which token it manages
655
+ * and which router it's registered with.
656
+ *
657
+ * @example Query pool configuration
658
+ * ```typescript
659
+ * const config = await chain.getTokenPoolConfig(poolAddress)
660
+ * console.log(`Manages token: ${config.token}`)
661
+ * console.log(`Router: ${config.router}`)
662
+ * if (config.typeAndVersion) {
663
+ * console.log(`Version: ${config.typeAndVersion}`)
664
+ * }
665
+ * ```
666
+ *
667
+ * @param tokenPool - Token pool contract address.
668
+ * @returns {@link TokenPoolConfig} containing token, router, and version info.
542
669
  */
543
- abstract getTokenPoolConfigs(tokenPool: string): Promise<{
544
- token: string;
545
- router: string;
546
- typeAndVersion?: string;
547
- }>;
670
+ abstract getTokenPoolConfig(tokenPool: string): Promise<TokenPoolConfig>;
548
671
  /**
549
- * Get TokenPool remote configurations.
550
- * @param tokenPool - Token pool address.
551
- * @param remoteChainSelector - If provided, only return remotes for the specified chain (may error if remote not supported).
552
- * @returns Record of network names and remote configurations (remoteToken, remotePools, rateLimitStates).
672
+ * Fetch remote chain configurations for a token pool.
673
+ *
674
+ * @remarks
675
+ * A token pool maintains configurations for each destination chain it supports.
676
+ * The returned Record maps chain names to their respective configurations.
677
+ *
678
+ * @example Get all supported destinations
679
+ * ```typescript
680
+ * const remotes = await chain.getTokenPoolRemotes(poolAddress)
681
+ * // Returns: {
682
+ * // "ethereum-mainnet": { remoteToken: "0x...", remotePools: [...], ... },
683
+ * // "ethereum-mainnet-arbitrum-1": { remoteToken: "0x...", remotePools: [...], ... },
684
+ * // "solana-mainnet": { remoteToken: "...", remotePools: [...], ... }
685
+ * // }
686
+ *
687
+ * // Access a specific chain's config
688
+ * const arbConfig = remotes['ethereum-mainnet']
689
+ * console.log(`Remote token: ${arbConfig.remoteToken}`)
690
+ * ```
691
+ *
692
+ * @example Filter to a specific destination
693
+ * ```typescript
694
+ * import { networkInfo } from '@chainlink/ccip-sdk'
695
+ *
696
+ * const arbitrumSelector = 4949039107694359620n
697
+ * const remotes = await chain.getTokenPoolRemotes(poolAddress, arbitrumSelector)
698
+ * // Returns only: { "arbitrum-mainnet": { ... } }
699
+ *
700
+ * const chainName = networkInfo(arbitrumSelector).name
701
+ * const config = remotes[chainName]
702
+ * ```
703
+ *
704
+ * @param tokenPool - Token pool address on the current chain.
705
+ * @param remoteChainSelector - Optional chain selector to filter results to a single destination.
706
+ * @returns Record where keys are chain names (e.g., "ethereum-mainnet") and values are {@link TokenPoolRemote} configs.
707
+ * @throws {@link CCIPTokenPoolChainConfigNotFoundError} if remoteChainSelector is specified but not configured.
553
708
  */
554
709
  abstract getTokenPoolRemotes(tokenPool: string, remoteChainSelector?: bigint): Promise<Record<string, TokenPoolRemote>>;
710
+ /**
711
+ * Fetch remote chain configuration for a token pool for a specific destination.
712
+ *
713
+ * @remarks
714
+ * Convenience wrapper around {@link getTokenPoolRemotes} that returns a single
715
+ * configuration instead of a Record. Use this when you need configuration for
716
+ * a specific destination chain.
717
+ *
718
+ * @example
719
+ * ```typescript
720
+ * const arbitrumSelector = 4949039107694359620n
721
+ * const remote = await chain.getTokenPoolRemote(poolAddress, arbitrumSelector)
722
+ * console.log(`Remote token: ${remote.remoteToken}`)
723
+ * console.log(`Remote pools: ${remote.remotePools.join(', ')}`)
724
+ * ```
725
+ *
726
+ * @param tokenPool - Token pool address on the current chain.
727
+ * @param remoteChainSelector - Chain selector of the desired remote chain.
728
+ * @returns TokenPoolRemote config for the specified remote chain.
729
+ * @throws {@link CCIPTokenPoolChainConfigNotFoundError} if no configuration found for the specified remote chain.
730
+ */
731
+ getTokenPoolRemote(tokenPool: string, remoteChainSelector: bigint): Promise<TokenPoolRemote>;
555
732
  /**
556
733
  * Fetch list and info of supported feeTokens.
557
734
  * @param router - Router address on this chain.
@@ -608,6 +785,8 @@ export type ChainStatic<F extends ChainFamily = ChainFamily> = Function & {
608
785
  _tag: 'EVMExtraArgsV1';
609
786
  }) | (EVMExtraArgsV2 & {
610
787
  _tag: 'EVMExtraArgsV2';
788
+ }) | (GenericExtraArgsV3 & {
789
+ _tag: 'GenericExtraArgsV3';
611
790
  }) | (SVMExtraArgsV1 & {
612
791
  _tag: 'SVMExtraArgsV1';
613
792
  }) | (SuiExtraArgsV1 & {
@@ -622,7 +801,7 @@ export type ChainStatic<F extends ChainFamily = ChainFamily> = Function & {
622
801
  */
623
802
  decodeCommits(log: Pick<Log_, 'data'>, lane?: Lane): CommitReport[] | undefined;
624
803
  /**
625
- * Decode a receipt (ExecutioStateChanged) event
804
+ * Decode a receipt (ExecutionStateChanged) event
626
805
  * @param log - Chain generic log
627
806
  * @returns ExecutionReceipt or undefined if not a recognized receipt
628
807
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":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aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,YAAY,EAAE,GAAG,SAAS,CAAA;IAC/E;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,gBAAgB,GAAG,SAAS,CAAA;IACpE;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAA;IACpC;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAAA;IACjC;;;;;OAKG;IACH,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;IACvC;;;;OAIG;IACH,YAAY,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACnC;;;;;OAKG;IACH,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;IAC3D;;;;OAIG;IACH,KAAK,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAAA;IACjE;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,UAAU,CAAA;CACvD,CAAA;AAED,2EAA2E;AAC3E,MAAM,MAAM,WAAW,GAAG,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAAA"}
package/dist/chain.js CHANGED
@@ -1,11 +1,27 @@
1
1
  import { dataLength } from 'ethers';
2
2
  import { CCIPAPIClient } from "./api/index.js";
3
3
  import { getCommitReport } from "./commits.js";
4
- import { CCIPApiClientNotAvailableError, CCIPChainFamilyMismatchError, CCIPExecTxRevertedError, CCIPTransactionNotFinalizedError, } from "./errors/index.js";
4
+ import { CCIPApiClientNotAvailableError, CCIPChainFamilyMismatchError, CCIPExecTxRevertedError, CCIPTokenPoolChainConfigNotFoundError, CCIPTransactionNotFinalizedError, } from "./errors/index.js";
5
5
  import { DEFAULT_GAS_LIMIT } from "./evm/const.js";
6
6
  import { getMessagesInTx } from "./requests.js";
7
7
  import { ExecutionState, } from "./types.js";
8
- import { util, withRetry } from "./utils.js";
8
+ import { networkInfo, util, withRetry } from "./utils.js";
9
+ /** Field names unique to GenericExtraArgsV3 (not present in V2). */
10
+ const V3_ONLY_FIELDS = [
11
+ 'blockConfirmations',
12
+ 'ccvs',
13
+ 'ccvArgs',
14
+ 'executor',
15
+ 'executorArgs',
16
+ 'tokenReceiver',
17
+ 'tokenArgs',
18
+ ];
19
+ /** Check if extraArgs contains any V3-only fields. */
20
+ function hasV3ExtraArgs(extraArgs) {
21
+ if (!extraArgs)
22
+ return false;
23
+ return V3_ONLY_FIELDS.some((field) => field in extraArgs);
24
+ }
9
25
  export const DEFAULT_API_RETRY_CONFIG = {
10
26
  maxRetries: 3,
11
27
  initialDelayMs: 1000,
@@ -28,6 +44,7 @@ export class Chain {
28
44
  * Base constructor for Chain class.
29
45
  * @param network - NetworkInfo object for the Chain instance
30
46
  * @param ctx - Optional context with logger and API client configuration
47
+ * @throws {@link CCIPChainFamilyMismatchError} if network family doesn't match the Chain subclass
31
48
  */
32
49
  constructor(network, ctx) {
33
50
  const { logger = console, apiClient, apiRetryConfig } = ctx ?? {};
@@ -54,8 +71,10 @@ export class Chain {
54
71
  return `${this.constructor.name} { ${this.network.name} }`;
55
72
  }
56
73
  /**
57
- * Confirm a log tx is finalized or wait for it to be finalized
58
- * Throws if it isn't included (e.g. a reorg)
74
+ * Confirm a log tx is finalized or wait for it to be finalized.
75
+ * @param opts - Options containing the request, finality level, and optional cancel promise
76
+ * @returns true when the transaction is finalized
77
+ * @throws {@link CCIPTransactionNotFinalizedError} if the transaction is not included (e.g., due to a reorg)
59
78
  */
60
79
  async waitFinalized({ request: { log, tx }, finality = 'finalized', cancel$, }) {
61
80
  const timestamp = log.tx?.timestamp ?? tx?.timestamp;
@@ -88,7 +107,8 @@ export class Chain {
88
107
  * Fetch all CCIP requests in a transaction
89
108
  * @param tx - ChainTransaction or txHash to fetch requests from
90
109
  * @returns CCIP messages in the transaction (at least one)
91
- **/
110
+ * @throws {@link CCIPMessageNotFoundInTxError} if no CCIP messages found in transaction
111
+ */
92
112
  async getMessagesInTx(tx) {
93
113
  const txHash = typeof tx === 'string' ? tx : tx.hash;
94
114
  try {
@@ -116,12 +136,31 @@ export class Chain {
116
136
  }
117
137
  }
118
138
  /**
119
- * Fetch a message by ID.
120
- * Default implementation just tries API.
121
- * Children may override to fetch from chain as fallback
122
- * @param messageId - message ID to fetch request for
123
- * @param _opts - onRamp may be required in some implementations, and throw if missing
124
- * @returns CCIPRequest
139
+ * Fetch a CCIP message by its unique message ID.
140
+ *
141
+ * @remarks
142
+ * Uses the CCIP API to retrieve message details. The returned request includes
143
+ * a `metadata` field with API-specific information.
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * const request = await chain.getMessageById(messageId)
148
+ * console.log(`Sender: ${request.message.sender}`)
149
+ *
150
+ * if (request.metadata) {
151
+ * console.log(`Status: ${request.metadata.status}`)
152
+ * if (request.metadata.deliveryTime) {
153
+ * console.log(`Delivered in ${request.metadata.deliveryTime}ms`)
154
+ * }
155
+ * }
156
+ * ```
157
+ *
158
+ * @param messageId - The unique message ID (0x + 64 hex chars)
159
+ * @param _opts - Optional: `onRamp` hint for non-EVM chains
160
+ * @returns CCIPRequest with `metadata` populated from API
161
+ * @throws {@link CCIPApiClientNotAvailableError} if API disabled
162
+ * @throws {@link CCIPMessageIdNotFoundError} if message not found
163
+ * @throws {@link CCIPHttpError} if API request fails
125
164
  **/
126
165
  async getMessageById(messageId, _opts) {
127
166
  if (!this.apiClient)
@@ -136,8 +175,9 @@ export class Chain {
136
175
  * Look for a CommitReport at dest for given CCIP request
137
176
  * May be specialized by some subclasses
138
177
  * @param opts - getCommitReport options
139
- * @returns CCIPCommit info, or reject if none found
140
- **/
178
+ * @returns CCIPCommit info
179
+ * @throws {@link CCIPCommitNotFoundError} if no commit found for the request
180
+ */
141
181
  async getCommitReport({ commitStore, request, ...hints }) {
142
182
  return getCommitReport(this, commitStore, request, hints);
143
183
  }
@@ -211,6 +251,7 @@ export class Chain {
211
251
  * @internal
212
252
  * @param tx - transaction hash or transaction object
213
253
  * @returns CCIP execution object
254
+ * @throws {@link CCIPExecTxRevertedError} if no execution receipt found in transaction
214
255
  */
215
256
  async getExecutionReceiptInTx(tx) {
216
257
  if (typeof tx === 'string')
@@ -224,13 +265,62 @@ export class Chain {
224
265
  }
225
266
  throw new CCIPExecTxRevertedError(tx.hash);
226
267
  }
268
+ /**
269
+ * Fetch remote chain configuration for a token pool for a specific destination.
270
+ *
271
+ * @remarks
272
+ * Convenience wrapper around {@link getTokenPoolRemotes} that returns a single
273
+ * configuration instead of a Record. Use this when you need configuration for
274
+ * a specific destination chain.
275
+ *
276
+ * @example
277
+ * ```typescript
278
+ * const arbitrumSelector = 4949039107694359620n
279
+ * const remote = await chain.getTokenPoolRemote(poolAddress, arbitrumSelector)
280
+ * console.log(`Remote token: ${remote.remoteToken}`)
281
+ * console.log(`Remote pools: ${remote.remotePools.join(', ')}`)
282
+ * ```
283
+ *
284
+ * @param tokenPool - Token pool address on the current chain.
285
+ * @param remoteChainSelector - Chain selector of the desired remote chain.
286
+ * @returns TokenPoolRemote config for the specified remote chain.
287
+ * @throws {@link CCIPTokenPoolChainConfigNotFoundError} if no configuration found for the specified remote chain.
288
+ */
289
+ async getTokenPoolRemote(tokenPool, remoteChainSelector) {
290
+ const remotes = await this.getTokenPoolRemotes(tokenPool, remoteChainSelector);
291
+ const network = networkInfo(remoteChainSelector);
292
+ const remoteConfig = remotes[network.name];
293
+ if (!remoteConfig) {
294
+ throw new CCIPTokenPoolChainConfigNotFoundError(tokenPool, tokenPool, network.name);
295
+ }
296
+ return remoteConfig;
297
+ }
227
298
  /** {@inheritDoc ChainStatic.buildMessageForDest} */
228
299
  static buildMessageForDest(message) {
229
- // default to GenericExtraArgsV2, aka EVMExtraArgsV2
300
+ const gasLimit = message.data && dataLength(message.data) ? DEFAULT_GAS_LIMIT : 0n;
301
+ // Detect if user wants V3 by checking for any V3-only field
302
+ if (hasV3ExtraArgs(message.extraArgs)) {
303
+ // V3 defaults (GenericExtraArgsV3)
304
+ return {
305
+ ...message,
306
+ extraArgs: {
307
+ gasLimit,
308
+ blockConfirmations: 0,
309
+ ccvs: [],
310
+ ccvArgs: [],
311
+ executor: '',
312
+ executorArgs: '0x',
313
+ tokenReceiver: '',
314
+ tokenArgs: '0x',
315
+ ...message.extraArgs,
316
+ },
317
+ };
318
+ }
319
+ // Default to V2 (GenericExtraArgsV2, aka EVMExtraArgsV2)
230
320
  return {
231
321
  ...message,
232
322
  extraArgs: {
233
- gasLimit: message.data && dataLength(message.data) ? DEFAULT_GAS_LIMIT : 0n,
323
+ gasLimit,
234
324
  allowOutOfOrderExecution: true,
235
325
  ...message.extraArgs,
236
326
  },