@circle-fin/app-kit 1.9.0 → 1.11.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/bridge.d.cts CHANGED
@@ -374,6 +374,14 @@ interface CCTPSplitConfig {
374
374
  type: 'split';
375
375
  tokenMessenger: string;
376
376
  messageTransmitter: string;
377
+ /**
378
+ * Address of the `TokenMessengerWithFees` wrapper, when deployed on this chain.
379
+ *
380
+ * Optional. Present only on chains that support the prepaid FORWARD path
381
+ * (source-chain fee collection via `depositForBurnWithHookAndFees`). Resolve
382
+ * it with `resolveCCTPV2ContractAddress(chain, 'tokenMessengerWithFees')`.
383
+ */
384
+ tokenMessengerWithFees?: string;
377
385
  confirmations: number;
378
386
  }
379
387
  /**
@@ -394,6 +402,14 @@ interface CCTPSplitConfig {
394
402
  interface CCTPMergedConfig {
395
403
  type: 'merged';
396
404
  contract: string;
405
+ /**
406
+ * Address of the `TokenMessengerWithFees` wrapper, when deployed on this chain.
407
+ *
408
+ * Optional. Present only on chains that support the prepaid FORWARD path
409
+ * (source-chain fee collection via `depositForBurnWithHookAndFees`). Resolve
410
+ * it with `resolveCCTPV2ContractAddress(chain, 'tokenMessengerWithFees')`.
411
+ */
412
+ tokenMessengerWithFees?: string;
397
413
  confirmations: number;
398
414
  }
399
415
  /**
@@ -528,6 +544,21 @@ interface GatewayV1Contracts {
528
544
  * @example "0xabcdef1234567890abcdef1234567890abcdef12"
529
545
  */
530
546
  minter: string;
547
+ /**
548
+ * The address of the `DepositForHandler` contract.
549
+ *
550
+ * @description Optional. The handler the GenericExecutor calls on this chain
551
+ * to run a fast cross-chain deposit into the {@link GatewayV1Contracts.wallet}.
552
+ * Present only on chains that are fast-deposit destinations; other Gateway
553
+ * chains omit it.
554
+ *
555
+ * Address format varies by blockchain:
556
+ * - EVM chains: 40-character hexadecimal with 0x prefix (e.g., "0x1234...")
557
+ * - Solana: Base58-encoded 32-byte address (e.g., "9WzDX...")
558
+ *
559
+ * @example "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48"
560
+ */
561
+ depositForHandler?: string;
531
562
  }
532
563
  /**
533
564
  * Versioned map of Gateway contract configurations.
@@ -2177,6 +2208,110 @@ interface CCTPv2ActionMap {
2177
2208
  */
2178
2209
  hookData: string;
2179
2210
  };
2211
+ /**
2212
+ * Initiate a prepaid cross-chain USDC transfer through the `TokenMessengerWithFees` wrapper.
2213
+ *
2214
+ * Burn USDC on the source chain while collecting all fees up front against a
2215
+ * signed quote. The wrapper collects the fee via `FeeManager`, then delegates
2216
+ * to the unmodified `TokenMessengerV2`. When `hookData` is provided (the
2217
+ * GenericExecutor FORWARD path) the wrapper's `depositForBurnWithHookAndFees`
2218
+ * contract method is used; otherwise `depositForBurnWithFees` is used.
2219
+ *
2220
+ * @remarks
2221
+ * SDK/contract naming: this SDK action is `depositForBurnWithFees` but, when a
2222
+ * `hookData` is present, it dispatches to the `depositForBurnWithHookAndFees`
2223
+ * contract method on `TokenMessengerWithFees` (NOT on `TokenMessengerV2`).
2224
+ *
2225
+ * Fee payment channel (must match the quote's `feeToken`):
2226
+ * - Native fee (`feeToken` is the zero address): exactly `feeTotalAmount` is
2227
+ * attached as `msg.value`.
2228
+ * - ERC-20 fee (e.g. USDC): no value is attached; the caller must first approve
2229
+ * the wrapper for `feeTotalAmount` (see the provider's fee approval helper).
2230
+ *
2231
+ * @remarks
2232
+ * Unlike `depositForBurn`, the `TokenMessengerWithFees` contract methods do NOT
2233
+ * take `maxFee` or `minFinalityThreshold` — fee and finality behavior are
2234
+ * derived from the signed quote — so those fields are omitted from this action.
2235
+ *
2236
+ * @example
2237
+ * ```typescript
2238
+ * await adapter.action('cctp.v2.depositForBurnWithFees', {
2239
+ * amount: BigInt('1000000'),
2240
+ * mintRecipient: executorAddress, // GenericExecutor (bytes32)
2241
+ * destinationCaller: executorAddress, // GenericExecutor (bytes32)
2242
+ * fromChain: ethereum,
2243
+ * toChain: arc,
2244
+ * hookData: geForwardHookData, // cctp-forward-wrapped GenericExecutor blob
2245
+ * claim: { signedQuote: '0x...', refundAddress: '0x...' },
2246
+ * feeToken: '0x0000000000000000000000000000000000000000', // native
2247
+ * feeTotalAmount: 3500000n,
2248
+ * })
2249
+ * ```
2250
+ */
2251
+ depositForBurnWithFees: Omit<CCTPv2ActionMap['depositForBurn'], 'maxFee' | 'minFinalityThreshold'> & {
2252
+ /**
2253
+ * Optional hex-encoded hook data for the GenericExecutor FORWARD path.
2254
+ *
2255
+ * When present, the `depositForBurnWithHookAndFees` contract method is used
2256
+ * and the blob must be wrapped in the `cctp-forward` envelope (the wrapper
2257
+ * rejects a FORWARD fee quote whose hook lacks it). When omitted, the plain
2258
+ * `depositForBurnWithFees` contract method is used.
2259
+ */
2260
+ hookData?: string;
2261
+ /**
2262
+ * Signed fee quote claim passed to the `TokenMessengerWithFees` wrapper.
2263
+ *
2264
+ * `signedQuote` is the `[uint8 0x01][abi.encode(Quote)]` blob returned by the
2265
+ * Fee Quote service; `refundAddress` receives any fee overpayment refund.
2266
+ */
2267
+ claim: QuoteClaim;
2268
+ /**
2269
+ * Fee token from the signed quote.
2270
+ *
2271
+ * The zero address (`0x000…0`) means the fee is paid in native currency and
2272
+ * is attached as `msg.value`. Any other address (e.g. USDC) means an ERC-20
2273
+ * fee that must be approved to the wrapper beforehand. This is independent of
2274
+ * `burnToken`, which is always USDC.
2275
+ */
2276
+ feeToken: string;
2277
+ /**
2278
+ * Total fee amount from the signed quote, in `feeToken` minor units.
2279
+ *
2280
+ * Firm only until the quote's `expiresAt`. For a native fee this is the exact
2281
+ * `msg.value`; for an ERC-20 fee this is the amount approved to the wrapper.
2282
+ */
2283
+ feeTotalAmount: bigint;
2284
+ };
2285
+ }
2286
+ /**
2287
+ * Signed fee quote claim consumed by the `TokenMessengerWithFees` wrapper.
2288
+ *
2289
+ * Mirrors the on-chain `IFeeManager.QuoteClaim` struct.
2290
+ *
2291
+ * @example
2292
+ * ```typescript
2293
+ * const claim: QuoteClaim = {
2294
+ * signedQuote: '0x01...', // [uint8 0x01][abi.encode(Quote)]
2295
+ * refundAddress: '0xUserWallet...',
2296
+ * }
2297
+ * ```
2298
+ */
2299
+ interface QuoteClaim {
2300
+ /**
2301
+ * Opaque signed quote bytes (`0x` hex) from the fee-quote service
2302
+ * (`SignedFeeQuote.signedQuote` returned by `fetchFeeQuote`). Pass verbatim;
2303
+ * do not decode.
2304
+ *
2305
+ * The quote binds the FORWARD fee item to the on-chain call via `argsHash`;
2306
+ * passing a quote that does not match the burn args reverts `QuoteArgsMismatch`.
2307
+ */
2308
+ signedQuote: string;
2309
+ /**
2310
+ * Address that receives any refund of overpaid fees.
2311
+ *
2312
+ * Typically the user wallet that authorized the burn.
2313
+ */
2314
+ refundAddress: string;
2180
2315
  }
2181
2316
 
2182
2317
  /**
@@ -6534,30 +6669,43 @@ interface AppKitContext {
6534
6669
  * Event handlers registered for AppKit operations.
6535
6670
  *
6536
6671
  * This property stores event handlers that are registered via the AppKit's
6537
- * `on()` method. Handlers are grouped by operation type. The current runtime
6538
- * bucket is `bridge`, and the context can add more operation buckets as AppKit
6539
- * wires action handlers for additional kits.
6672
+ * `on()` method. Handlers are grouped by operation type. The runtime buckets
6673
+ * are `bridge` and `earn`; the context can add more operation buckets as
6674
+ * AppKit wires action handlers for additional kits.
6540
6675
  *
6541
- * Within each operation bucket, handlers are keyed by action name (for example,
6542
- * `bridge.approve`) or `*` for wildcard handlers. Each action can have multiple
6543
- * handlers registered, allowing multiple subscribers to listen to the same event.
6676
+ * Within each operation bucket, handlers are keyed by action name (for
6677
+ * example, `bridge.approve` or `earn.deposit`) or `*` for wildcard handlers.
6678
+ * Each action can have multiple handlers registered, allowing multiple
6679
+ * subscribers to listen to the same event.
6544
6680
  *
6545
6681
  * The handlers are stored in the context to allow deferred registration with
6546
- * underlying operation kits, enabling a clean separation between event registration
6547
- * and operation execution.
6682
+ * underlying operation kits, enabling a clean separation between event
6683
+ * registration and operation execution.
6548
6684
  *
6549
6685
  * @example
6550
6686
  * ```typescript
6551
6687
  * const context = createContext()
6552
6688
  * // Handlers registered via kit.on() are stored by operation type
6553
- * // Bridge handlers are registered with BridgeKit when bridge() is executed
6689
+ * // Bridge handlers are registered with BridgeKit when bridge() runs
6690
+ * // Earn handlers are registered with EarnKit when earn operations run
6554
6691
  * ```
6555
6692
  */
6556
- actions: Record<'bridge', Record<string, ((payload: unknown) => void)[]>>;
6693
+ actions: Record<'bridge' | 'earn', Record<string, ((payload: unknown) => void)[]>>;
6694
+ /**
6695
+ * Disable success analytics for the underlying EarnKit, SwapKit, and
6696
+ * UnifiedBalanceKit.
6697
+ *
6698
+ * When `true`, completed earn, swap, and unified balance operations will not
6699
+ * POST analytics events. This does not disable error reporting; use
6700
+ * {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
6701
+ *
6702
+ * @defaultValue false
6703
+ */
6704
+ disableAnalytics?: boolean;
6557
6705
  /**
6558
6706
  * Disable error telemetry for all sub-kits.
6559
6707
  *
6560
- * When `true`, none of the underlying kits (BridgeKit, SwapKit,
6708
+ * When `true`, none of the underlying kits (BridgeKit, SwapKit, EarnKit,
6561
6709
  * UnifiedBalanceKit) will POST error details to the telemetry
6562
6710
  * endpoint when operations throw. Defaults to `false` (enabled).
6563
6711
  *
package/bridge.d.mts CHANGED
@@ -374,6 +374,14 @@ interface CCTPSplitConfig {
374
374
  type: 'split';
375
375
  tokenMessenger: string;
376
376
  messageTransmitter: string;
377
+ /**
378
+ * Address of the `TokenMessengerWithFees` wrapper, when deployed on this chain.
379
+ *
380
+ * Optional. Present only on chains that support the prepaid FORWARD path
381
+ * (source-chain fee collection via `depositForBurnWithHookAndFees`). Resolve
382
+ * it with `resolveCCTPV2ContractAddress(chain, 'tokenMessengerWithFees')`.
383
+ */
384
+ tokenMessengerWithFees?: string;
377
385
  confirmations: number;
378
386
  }
379
387
  /**
@@ -394,6 +402,14 @@ interface CCTPSplitConfig {
394
402
  interface CCTPMergedConfig {
395
403
  type: 'merged';
396
404
  contract: string;
405
+ /**
406
+ * Address of the `TokenMessengerWithFees` wrapper, when deployed on this chain.
407
+ *
408
+ * Optional. Present only on chains that support the prepaid FORWARD path
409
+ * (source-chain fee collection via `depositForBurnWithHookAndFees`). Resolve
410
+ * it with `resolveCCTPV2ContractAddress(chain, 'tokenMessengerWithFees')`.
411
+ */
412
+ tokenMessengerWithFees?: string;
397
413
  confirmations: number;
398
414
  }
399
415
  /**
@@ -528,6 +544,21 @@ interface GatewayV1Contracts {
528
544
  * @example "0xabcdef1234567890abcdef1234567890abcdef12"
529
545
  */
530
546
  minter: string;
547
+ /**
548
+ * The address of the `DepositForHandler` contract.
549
+ *
550
+ * @description Optional. The handler the GenericExecutor calls on this chain
551
+ * to run a fast cross-chain deposit into the {@link GatewayV1Contracts.wallet}.
552
+ * Present only on chains that are fast-deposit destinations; other Gateway
553
+ * chains omit it.
554
+ *
555
+ * Address format varies by blockchain:
556
+ * - EVM chains: 40-character hexadecimal with 0x prefix (e.g., "0x1234...")
557
+ * - Solana: Base58-encoded 32-byte address (e.g., "9WzDX...")
558
+ *
559
+ * @example "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48"
560
+ */
561
+ depositForHandler?: string;
531
562
  }
532
563
  /**
533
564
  * Versioned map of Gateway contract configurations.
@@ -2177,6 +2208,110 @@ interface CCTPv2ActionMap {
2177
2208
  */
2178
2209
  hookData: string;
2179
2210
  };
2211
+ /**
2212
+ * Initiate a prepaid cross-chain USDC transfer through the `TokenMessengerWithFees` wrapper.
2213
+ *
2214
+ * Burn USDC on the source chain while collecting all fees up front against a
2215
+ * signed quote. The wrapper collects the fee via `FeeManager`, then delegates
2216
+ * to the unmodified `TokenMessengerV2`. When `hookData` is provided (the
2217
+ * GenericExecutor FORWARD path) the wrapper's `depositForBurnWithHookAndFees`
2218
+ * contract method is used; otherwise `depositForBurnWithFees` is used.
2219
+ *
2220
+ * @remarks
2221
+ * SDK/contract naming: this SDK action is `depositForBurnWithFees` but, when a
2222
+ * `hookData` is present, it dispatches to the `depositForBurnWithHookAndFees`
2223
+ * contract method on `TokenMessengerWithFees` (NOT on `TokenMessengerV2`).
2224
+ *
2225
+ * Fee payment channel (must match the quote's `feeToken`):
2226
+ * - Native fee (`feeToken` is the zero address): exactly `feeTotalAmount` is
2227
+ * attached as `msg.value`.
2228
+ * - ERC-20 fee (e.g. USDC): no value is attached; the caller must first approve
2229
+ * the wrapper for `feeTotalAmount` (see the provider's fee approval helper).
2230
+ *
2231
+ * @remarks
2232
+ * Unlike `depositForBurn`, the `TokenMessengerWithFees` contract methods do NOT
2233
+ * take `maxFee` or `minFinalityThreshold` — fee and finality behavior are
2234
+ * derived from the signed quote — so those fields are omitted from this action.
2235
+ *
2236
+ * @example
2237
+ * ```typescript
2238
+ * await adapter.action('cctp.v2.depositForBurnWithFees', {
2239
+ * amount: BigInt('1000000'),
2240
+ * mintRecipient: executorAddress, // GenericExecutor (bytes32)
2241
+ * destinationCaller: executorAddress, // GenericExecutor (bytes32)
2242
+ * fromChain: ethereum,
2243
+ * toChain: arc,
2244
+ * hookData: geForwardHookData, // cctp-forward-wrapped GenericExecutor blob
2245
+ * claim: { signedQuote: '0x...', refundAddress: '0x...' },
2246
+ * feeToken: '0x0000000000000000000000000000000000000000', // native
2247
+ * feeTotalAmount: 3500000n,
2248
+ * })
2249
+ * ```
2250
+ */
2251
+ depositForBurnWithFees: Omit<CCTPv2ActionMap['depositForBurn'], 'maxFee' | 'minFinalityThreshold'> & {
2252
+ /**
2253
+ * Optional hex-encoded hook data for the GenericExecutor FORWARD path.
2254
+ *
2255
+ * When present, the `depositForBurnWithHookAndFees` contract method is used
2256
+ * and the blob must be wrapped in the `cctp-forward` envelope (the wrapper
2257
+ * rejects a FORWARD fee quote whose hook lacks it). When omitted, the plain
2258
+ * `depositForBurnWithFees` contract method is used.
2259
+ */
2260
+ hookData?: string;
2261
+ /**
2262
+ * Signed fee quote claim passed to the `TokenMessengerWithFees` wrapper.
2263
+ *
2264
+ * `signedQuote` is the `[uint8 0x01][abi.encode(Quote)]` blob returned by the
2265
+ * Fee Quote service; `refundAddress` receives any fee overpayment refund.
2266
+ */
2267
+ claim: QuoteClaim;
2268
+ /**
2269
+ * Fee token from the signed quote.
2270
+ *
2271
+ * The zero address (`0x000…0`) means the fee is paid in native currency and
2272
+ * is attached as `msg.value`. Any other address (e.g. USDC) means an ERC-20
2273
+ * fee that must be approved to the wrapper beforehand. This is independent of
2274
+ * `burnToken`, which is always USDC.
2275
+ */
2276
+ feeToken: string;
2277
+ /**
2278
+ * Total fee amount from the signed quote, in `feeToken` minor units.
2279
+ *
2280
+ * Firm only until the quote's `expiresAt`. For a native fee this is the exact
2281
+ * `msg.value`; for an ERC-20 fee this is the amount approved to the wrapper.
2282
+ */
2283
+ feeTotalAmount: bigint;
2284
+ };
2285
+ }
2286
+ /**
2287
+ * Signed fee quote claim consumed by the `TokenMessengerWithFees` wrapper.
2288
+ *
2289
+ * Mirrors the on-chain `IFeeManager.QuoteClaim` struct.
2290
+ *
2291
+ * @example
2292
+ * ```typescript
2293
+ * const claim: QuoteClaim = {
2294
+ * signedQuote: '0x01...', // [uint8 0x01][abi.encode(Quote)]
2295
+ * refundAddress: '0xUserWallet...',
2296
+ * }
2297
+ * ```
2298
+ */
2299
+ interface QuoteClaim {
2300
+ /**
2301
+ * Opaque signed quote bytes (`0x` hex) from the fee-quote service
2302
+ * (`SignedFeeQuote.signedQuote` returned by `fetchFeeQuote`). Pass verbatim;
2303
+ * do not decode.
2304
+ *
2305
+ * The quote binds the FORWARD fee item to the on-chain call via `argsHash`;
2306
+ * passing a quote that does not match the burn args reverts `QuoteArgsMismatch`.
2307
+ */
2308
+ signedQuote: string;
2309
+ /**
2310
+ * Address that receives any refund of overpaid fees.
2311
+ *
2312
+ * Typically the user wallet that authorized the burn.
2313
+ */
2314
+ refundAddress: string;
2180
2315
  }
2181
2316
 
2182
2317
  /**
@@ -6534,30 +6669,43 @@ interface AppKitContext {
6534
6669
  * Event handlers registered for AppKit operations.
6535
6670
  *
6536
6671
  * This property stores event handlers that are registered via the AppKit's
6537
- * `on()` method. Handlers are grouped by operation type. The current runtime
6538
- * bucket is `bridge`, and the context can add more operation buckets as AppKit
6539
- * wires action handlers for additional kits.
6672
+ * `on()` method. Handlers are grouped by operation type. The runtime buckets
6673
+ * are `bridge` and `earn`; the context can add more operation buckets as
6674
+ * AppKit wires action handlers for additional kits.
6540
6675
  *
6541
- * Within each operation bucket, handlers are keyed by action name (for example,
6542
- * `bridge.approve`) or `*` for wildcard handlers. Each action can have multiple
6543
- * handlers registered, allowing multiple subscribers to listen to the same event.
6676
+ * Within each operation bucket, handlers are keyed by action name (for
6677
+ * example, `bridge.approve` or `earn.deposit`) or `*` for wildcard handlers.
6678
+ * Each action can have multiple handlers registered, allowing multiple
6679
+ * subscribers to listen to the same event.
6544
6680
  *
6545
6681
  * The handlers are stored in the context to allow deferred registration with
6546
- * underlying operation kits, enabling a clean separation between event registration
6547
- * and operation execution.
6682
+ * underlying operation kits, enabling a clean separation between event
6683
+ * registration and operation execution.
6548
6684
  *
6549
6685
  * @example
6550
6686
  * ```typescript
6551
6687
  * const context = createContext()
6552
6688
  * // Handlers registered via kit.on() are stored by operation type
6553
- * // Bridge handlers are registered with BridgeKit when bridge() is executed
6689
+ * // Bridge handlers are registered with BridgeKit when bridge() runs
6690
+ * // Earn handlers are registered with EarnKit when earn operations run
6554
6691
  * ```
6555
6692
  */
6556
- actions: Record<'bridge', Record<string, ((payload: unknown) => void)[]>>;
6693
+ actions: Record<'bridge' | 'earn', Record<string, ((payload: unknown) => void)[]>>;
6694
+ /**
6695
+ * Disable success analytics for the underlying EarnKit, SwapKit, and
6696
+ * UnifiedBalanceKit.
6697
+ *
6698
+ * When `true`, completed earn, swap, and unified balance operations will not
6699
+ * POST analytics events. This does not disable error reporting; use
6700
+ * {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
6701
+ *
6702
+ * @defaultValue false
6703
+ */
6704
+ disableAnalytics?: boolean;
6557
6705
  /**
6558
6706
  * Disable error telemetry for all sub-kits.
6559
6707
  *
6560
- * When `true`, none of the underlying kits (BridgeKit, SwapKit,
6708
+ * When `true`, none of the underlying kits (BridgeKit, SwapKit, EarnKit,
6561
6709
  * UnifiedBalanceKit) will POST error details to the telemetry
6562
6710
  * endpoint when operations throw. Defaults to `false` (enabled).
6563
6711
  *
package/bridge.d.ts CHANGED
@@ -374,6 +374,14 @@ interface CCTPSplitConfig {
374
374
  type: 'split';
375
375
  tokenMessenger: string;
376
376
  messageTransmitter: string;
377
+ /**
378
+ * Address of the `TokenMessengerWithFees` wrapper, when deployed on this chain.
379
+ *
380
+ * Optional. Present only on chains that support the prepaid FORWARD path
381
+ * (source-chain fee collection via `depositForBurnWithHookAndFees`). Resolve
382
+ * it with `resolveCCTPV2ContractAddress(chain, 'tokenMessengerWithFees')`.
383
+ */
384
+ tokenMessengerWithFees?: string;
377
385
  confirmations: number;
378
386
  }
379
387
  /**
@@ -394,6 +402,14 @@ interface CCTPSplitConfig {
394
402
  interface CCTPMergedConfig {
395
403
  type: 'merged';
396
404
  contract: string;
405
+ /**
406
+ * Address of the `TokenMessengerWithFees` wrapper, when deployed on this chain.
407
+ *
408
+ * Optional. Present only on chains that support the prepaid FORWARD path
409
+ * (source-chain fee collection via `depositForBurnWithHookAndFees`). Resolve
410
+ * it with `resolveCCTPV2ContractAddress(chain, 'tokenMessengerWithFees')`.
411
+ */
412
+ tokenMessengerWithFees?: string;
397
413
  confirmations: number;
398
414
  }
399
415
  /**
@@ -528,6 +544,21 @@ interface GatewayV1Contracts {
528
544
  * @example "0xabcdef1234567890abcdef1234567890abcdef12"
529
545
  */
530
546
  minter: string;
547
+ /**
548
+ * The address of the `DepositForHandler` contract.
549
+ *
550
+ * @description Optional. The handler the GenericExecutor calls on this chain
551
+ * to run a fast cross-chain deposit into the {@link GatewayV1Contracts.wallet}.
552
+ * Present only on chains that are fast-deposit destinations; other Gateway
553
+ * chains omit it.
554
+ *
555
+ * Address format varies by blockchain:
556
+ * - EVM chains: 40-character hexadecimal with 0x prefix (e.g., "0x1234...")
557
+ * - Solana: Base58-encoded 32-byte address (e.g., "9WzDX...")
558
+ *
559
+ * @example "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48"
560
+ */
561
+ depositForHandler?: string;
531
562
  }
532
563
  /**
533
564
  * Versioned map of Gateway contract configurations.
@@ -2177,6 +2208,110 @@ interface CCTPv2ActionMap {
2177
2208
  */
2178
2209
  hookData: string;
2179
2210
  };
2211
+ /**
2212
+ * Initiate a prepaid cross-chain USDC transfer through the `TokenMessengerWithFees` wrapper.
2213
+ *
2214
+ * Burn USDC on the source chain while collecting all fees up front against a
2215
+ * signed quote. The wrapper collects the fee via `FeeManager`, then delegates
2216
+ * to the unmodified `TokenMessengerV2`. When `hookData` is provided (the
2217
+ * GenericExecutor FORWARD path) the wrapper's `depositForBurnWithHookAndFees`
2218
+ * contract method is used; otherwise `depositForBurnWithFees` is used.
2219
+ *
2220
+ * @remarks
2221
+ * SDK/contract naming: this SDK action is `depositForBurnWithFees` but, when a
2222
+ * `hookData` is present, it dispatches to the `depositForBurnWithHookAndFees`
2223
+ * contract method on `TokenMessengerWithFees` (NOT on `TokenMessengerV2`).
2224
+ *
2225
+ * Fee payment channel (must match the quote's `feeToken`):
2226
+ * - Native fee (`feeToken` is the zero address): exactly `feeTotalAmount` is
2227
+ * attached as `msg.value`.
2228
+ * - ERC-20 fee (e.g. USDC): no value is attached; the caller must first approve
2229
+ * the wrapper for `feeTotalAmount` (see the provider's fee approval helper).
2230
+ *
2231
+ * @remarks
2232
+ * Unlike `depositForBurn`, the `TokenMessengerWithFees` contract methods do NOT
2233
+ * take `maxFee` or `minFinalityThreshold` — fee and finality behavior are
2234
+ * derived from the signed quote — so those fields are omitted from this action.
2235
+ *
2236
+ * @example
2237
+ * ```typescript
2238
+ * await adapter.action('cctp.v2.depositForBurnWithFees', {
2239
+ * amount: BigInt('1000000'),
2240
+ * mintRecipient: executorAddress, // GenericExecutor (bytes32)
2241
+ * destinationCaller: executorAddress, // GenericExecutor (bytes32)
2242
+ * fromChain: ethereum,
2243
+ * toChain: arc,
2244
+ * hookData: geForwardHookData, // cctp-forward-wrapped GenericExecutor blob
2245
+ * claim: { signedQuote: '0x...', refundAddress: '0x...' },
2246
+ * feeToken: '0x0000000000000000000000000000000000000000', // native
2247
+ * feeTotalAmount: 3500000n,
2248
+ * })
2249
+ * ```
2250
+ */
2251
+ depositForBurnWithFees: Omit<CCTPv2ActionMap['depositForBurn'], 'maxFee' | 'minFinalityThreshold'> & {
2252
+ /**
2253
+ * Optional hex-encoded hook data for the GenericExecutor FORWARD path.
2254
+ *
2255
+ * When present, the `depositForBurnWithHookAndFees` contract method is used
2256
+ * and the blob must be wrapped in the `cctp-forward` envelope (the wrapper
2257
+ * rejects a FORWARD fee quote whose hook lacks it). When omitted, the plain
2258
+ * `depositForBurnWithFees` contract method is used.
2259
+ */
2260
+ hookData?: string;
2261
+ /**
2262
+ * Signed fee quote claim passed to the `TokenMessengerWithFees` wrapper.
2263
+ *
2264
+ * `signedQuote` is the `[uint8 0x01][abi.encode(Quote)]` blob returned by the
2265
+ * Fee Quote service; `refundAddress` receives any fee overpayment refund.
2266
+ */
2267
+ claim: QuoteClaim;
2268
+ /**
2269
+ * Fee token from the signed quote.
2270
+ *
2271
+ * The zero address (`0x000…0`) means the fee is paid in native currency and
2272
+ * is attached as `msg.value`. Any other address (e.g. USDC) means an ERC-20
2273
+ * fee that must be approved to the wrapper beforehand. This is independent of
2274
+ * `burnToken`, which is always USDC.
2275
+ */
2276
+ feeToken: string;
2277
+ /**
2278
+ * Total fee amount from the signed quote, in `feeToken` minor units.
2279
+ *
2280
+ * Firm only until the quote's `expiresAt`. For a native fee this is the exact
2281
+ * `msg.value`; for an ERC-20 fee this is the amount approved to the wrapper.
2282
+ */
2283
+ feeTotalAmount: bigint;
2284
+ };
2285
+ }
2286
+ /**
2287
+ * Signed fee quote claim consumed by the `TokenMessengerWithFees` wrapper.
2288
+ *
2289
+ * Mirrors the on-chain `IFeeManager.QuoteClaim` struct.
2290
+ *
2291
+ * @example
2292
+ * ```typescript
2293
+ * const claim: QuoteClaim = {
2294
+ * signedQuote: '0x01...', // [uint8 0x01][abi.encode(Quote)]
2295
+ * refundAddress: '0xUserWallet...',
2296
+ * }
2297
+ * ```
2298
+ */
2299
+ interface QuoteClaim {
2300
+ /**
2301
+ * Opaque signed quote bytes (`0x` hex) from the fee-quote service
2302
+ * (`SignedFeeQuote.signedQuote` returned by `fetchFeeQuote`). Pass verbatim;
2303
+ * do not decode.
2304
+ *
2305
+ * The quote binds the FORWARD fee item to the on-chain call via `argsHash`;
2306
+ * passing a quote that does not match the burn args reverts `QuoteArgsMismatch`.
2307
+ */
2308
+ signedQuote: string;
2309
+ /**
2310
+ * Address that receives any refund of overpaid fees.
2311
+ *
2312
+ * Typically the user wallet that authorized the burn.
2313
+ */
2314
+ refundAddress: string;
2180
2315
  }
2181
2316
 
2182
2317
  /**
@@ -6534,30 +6669,43 @@ interface AppKitContext {
6534
6669
  * Event handlers registered for AppKit operations.
6535
6670
  *
6536
6671
  * This property stores event handlers that are registered via the AppKit's
6537
- * `on()` method. Handlers are grouped by operation type. The current runtime
6538
- * bucket is `bridge`, and the context can add more operation buckets as AppKit
6539
- * wires action handlers for additional kits.
6672
+ * `on()` method. Handlers are grouped by operation type. The runtime buckets
6673
+ * are `bridge` and `earn`; the context can add more operation buckets as
6674
+ * AppKit wires action handlers for additional kits.
6540
6675
  *
6541
- * Within each operation bucket, handlers are keyed by action name (for example,
6542
- * `bridge.approve`) or `*` for wildcard handlers. Each action can have multiple
6543
- * handlers registered, allowing multiple subscribers to listen to the same event.
6676
+ * Within each operation bucket, handlers are keyed by action name (for
6677
+ * example, `bridge.approve` or `earn.deposit`) or `*` for wildcard handlers.
6678
+ * Each action can have multiple handlers registered, allowing multiple
6679
+ * subscribers to listen to the same event.
6544
6680
  *
6545
6681
  * The handlers are stored in the context to allow deferred registration with
6546
- * underlying operation kits, enabling a clean separation between event registration
6547
- * and operation execution.
6682
+ * underlying operation kits, enabling a clean separation between event
6683
+ * registration and operation execution.
6548
6684
  *
6549
6685
  * @example
6550
6686
  * ```typescript
6551
6687
  * const context = createContext()
6552
6688
  * // Handlers registered via kit.on() are stored by operation type
6553
- * // Bridge handlers are registered with BridgeKit when bridge() is executed
6689
+ * // Bridge handlers are registered with BridgeKit when bridge() runs
6690
+ * // Earn handlers are registered with EarnKit when earn operations run
6554
6691
  * ```
6555
6692
  */
6556
- actions: Record<'bridge', Record<string, ((payload: unknown) => void)[]>>;
6693
+ actions: Record<'bridge' | 'earn', Record<string, ((payload: unknown) => void)[]>>;
6694
+ /**
6695
+ * Disable success analytics for the underlying EarnKit, SwapKit, and
6696
+ * UnifiedBalanceKit.
6697
+ *
6698
+ * When `true`, completed earn, swap, and unified balance operations will not
6699
+ * POST analytics events. This does not disable error reporting; use
6700
+ * {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
6701
+ *
6702
+ * @defaultValue false
6703
+ */
6704
+ disableAnalytics?: boolean;
6557
6705
  /**
6558
6706
  * Disable error telemetry for all sub-kits.
6559
6707
  *
6560
- * When `true`, none of the underlying kits (BridgeKit, SwapKit,
6708
+ * When `true`, none of the underlying kits (BridgeKit, SwapKit, EarnKit,
6561
6709
  * UnifiedBalanceKit) will POST error details to the telemetry
6562
6710
  * endpoint when operations throw. Defaults to `false` (enabled).
6563
6711
  *