@circle-fin/app-kit 1.8.1 → 1.10.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 (48) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +3 -3
  3. package/bridge.cjs +1102 -260
  4. package/bridge.d.cts +161 -10
  5. package/bridge.d.mts +161 -10
  6. package/bridge.d.ts +161 -10
  7. package/bridge.mjs +1102 -260
  8. package/chains.cjs +102 -2
  9. package/chains.d.cts +3 -0
  10. package/chains.d.mts +3 -0
  11. package/chains.d.ts +3 -0
  12. package/chains.mjs +102 -2
  13. package/context.cjs +1 -0
  14. package/context.d.cts +166 -12
  15. package/context.d.mts +166 -12
  16. package/context.d.ts +166 -12
  17. package/context.mjs +1 -0
  18. package/earn.cjs +1074 -454
  19. package/earn.d.cts +546 -99
  20. package/earn.d.mts +546 -99
  21. package/earn.d.ts +546 -99
  22. package/earn.mjs +1074 -455
  23. package/estimateBridge.cjs +1102 -260
  24. package/estimateBridge.d.cts +161 -10
  25. package/estimateBridge.d.mts +161 -10
  26. package/estimateBridge.d.ts +161 -10
  27. package/estimateBridge.mjs +1102 -260
  28. package/estimateSwap.cjs +915 -96
  29. package/estimateSwap.d.cts +161 -10
  30. package/estimateSwap.d.mts +161 -10
  31. package/estimateSwap.d.ts +161 -10
  32. package/estimateSwap.mjs +915 -96
  33. package/index.cjs +3029 -862
  34. package/index.d.cts +1277 -143
  35. package/index.d.mts +1277 -143
  36. package/index.d.ts +1277 -143
  37. package/index.mjs +3029 -862
  38. package/package.json +12 -6
  39. package/swap.cjs +915 -96
  40. package/swap.d.cts +161 -10
  41. package/swap.d.mts +161 -10
  42. package/swap.d.ts +161 -10
  43. package/swap.mjs +915 -96
  44. package/unifiedBalance.cjs +822 -115
  45. package/unifiedBalance.d.cts +224 -4
  46. package/unifiedBalance.d.mts +224 -4
  47. package/unifiedBalance.d.ts +224 -4
  48. package/unifiedBalance.mjs +822 -115
package/index.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.
@@ -659,6 +690,8 @@ declare enum Blockchain {
659
690
  Celo_Alfajores_Testnet = "Celo_Alfajores_Testnet",
660
691
  Codex = "Codex",
661
692
  Codex_Testnet = "Codex_Testnet",
693
+ Cronos = "Cronos",
694
+ Cronos_Testnet = "Cronos_Testnet",
662
695
  Edge = "Edge",
663
696
  Edge_Testnet = "Edge_Testnet",
664
697
  Ethereum = "Ethereum",
@@ -900,6 +933,7 @@ declare enum BridgeChain {
900
933
  Avalanche = "Avalanche",
901
934
  Base = "Base",
902
935
  Codex = "Codex",
936
+ Cronos = "Cronos",
903
937
  Edge = "Edge",
904
938
  Ethereum = "Ethereum",
905
939
  HyperEVM = "HyperEVM",
@@ -923,6 +957,7 @@ declare enum BridgeChain {
923
957
  Avalanche_Fuji = "Avalanche_Fuji",
924
958
  Base_Sepolia = "Base_Sepolia",
925
959
  Codex_Testnet = "Codex_Testnet",
960
+ Cronos_Testnet = "Cronos_Testnet",
926
961
  Edge_Testnet = "Edge_Testnet",
927
962
  Ethereum_Sepolia = "Ethereum_Sepolia",
928
963
  HyperEVM_Testnet = "HyperEVM_Testnet",
@@ -1358,6 +1393,7 @@ declare const ArcTestnet: {
1358
1393
  readonly v1: {
1359
1394
  readonly wallet: "0x0077777d7EBA4688BDeF3E311b846F25870A19B9";
1360
1395
  readonly minter: "0x0022222ABE238Cc2C7Bb1f21003F0a260052475B";
1396
+ readonly depositForHandler: "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48";
1361
1397
  };
1362
1398
  };
1363
1399
  readonly forwarderSupported: {
@@ -1880,6 +1916,94 @@ declare const CodexTestnet: {
1880
1916
  };
1881
1917
  };
1882
1918
 
1919
+ /**
1920
+ * Cronos Mainnet chain definition
1921
+ * @remarks
1922
+ * This represents the official production network for the Cronos blockchain.
1923
+ * Cronos is an EVM-compatible blockchain.
1924
+ */
1925
+ declare const Cronos: {
1926
+ readonly type: "evm";
1927
+ readonly chain: Blockchain.Cronos;
1928
+ readonly name: "Cronos";
1929
+ readonly title: "Cronos Mainnet";
1930
+ readonly nativeCurrency: {
1931
+ readonly name: "Cronos";
1932
+ readonly symbol: "CRO";
1933
+ readonly decimals: 18;
1934
+ };
1935
+ readonly chainId: 25;
1936
+ readonly isTestnet: false;
1937
+ readonly explorerUrl: "https://cronoscan.com/tx/{hash}";
1938
+ readonly rpcEndpoints: readonly ["https://evm.cronos.org"];
1939
+ readonly eurcAddress: "0xA6dE01a2d62C6B5f3525d768f34d276652C554c8";
1940
+ readonly usdcAddress: "0x3D7F2C478aAfdB65542BCB44bCeeC05849999d2D";
1941
+ readonly usdtAddress: null;
1942
+ readonly cctp: {
1943
+ readonly domain: 32;
1944
+ readonly contracts: {
1945
+ readonly v2: {
1946
+ readonly type: "split";
1947
+ readonly tokenMessenger: "0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d";
1948
+ readonly messageTransmitter: "0x81D40F21F12A8F0E3252Bccb954D722d4c464B64";
1949
+ readonly confirmations: 1;
1950
+ readonly fastConfirmations: 1;
1951
+ };
1952
+ };
1953
+ readonly forwarderSupported: {
1954
+ readonly source: false;
1955
+ readonly destination: false;
1956
+ };
1957
+ };
1958
+ readonly kitContracts: {
1959
+ readonly bridge: "0xB3FA262d0fB521cc93bE83d87b322b8A23DAf3F0";
1960
+ };
1961
+ };
1962
+
1963
+ /**
1964
+ * Cronos Testnet chain definition
1965
+ * @remarks
1966
+ * This represents the official test network for the Cronos blockchain.
1967
+ * Cronos is an EVM-compatible blockchain.
1968
+ */
1969
+ declare const CronosTestnet: {
1970
+ readonly type: "evm";
1971
+ readonly chain: Blockchain.Cronos_Testnet;
1972
+ readonly name: "Cronos Testnet";
1973
+ readonly title: "Cronos Testnet";
1974
+ readonly nativeCurrency: {
1975
+ readonly name: "CRO";
1976
+ readonly symbol: "tCRO";
1977
+ readonly decimals: 18;
1978
+ };
1979
+ readonly chainId: 338;
1980
+ readonly isTestnet: true;
1981
+ readonly explorerUrl: "https://explorer.cronos.org/testnet/tx/{hash}";
1982
+ readonly rpcEndpoints: readonly ["https://evm-t3.cronos.org"];
1983
+ readonly eurcAddress: "0x31f7538adb53cF16350e6B0c89d03D91b7D12c46";
1984
+ readonly usdcAddress: "0xEb33dc5fac03833e132593659e1dE7256aB59794";
1985
+ readonly usdtAddress: null;
1986
+ readonly cctp: {
1987
+ readonly domain: 32;
1988
+ readonly contracts: {
1989
+ readonly v2: {
1990
+ readonly type: "split";
1991
+ readonly tokenMessenger: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA";
1992
+ readonly messageTransmitter: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275";
1993
+ readonly confirmations: 1;
1994
+ readonly fastConfirmations: 1;
1995
+ };
1996
+ };
1997
+ readonly forwarderSupported: {
1998
+ readonly source: false;
1999
+ readonly destination: false;
2000
+ };
2001
+ };
2002
+ readonly kitContracts: {
2003
+ readonly bridge: "0xC5567a5E3370d4DBfB0540025078e283e36A363d";
2004
+ };
2005
+ };
2006
+
1883
2007
  /**
1884
2008
  * Edge Mainnet chain definition
1885
2009
  * @remarks
@@ -4173,6 +4297,8 @@ declare const Chains_Celo: typeof Celo;
4173
4297
  declare const Chains_CeloAlfajoresTestnet: typeof CeloAlfajoresTestnet;
4174
4298
  declare const Chains_Codex: typeof Codex;
4175
4299
  declare const Chains_CodexTestnet: typeof CodexTestnet;
4300
+ declare const Chains_Cronos: typeof Cronos;
4301
+ declare const Chains_CronosTestnet: typeof CronosTestnet;
4176
4302
  declare const Chains_Edge: typeof Edge;
4177
4303
  declare const Chains_EdgeTestnet: typeof EdgeTestnet;
4178
4304
  declare const Chains_Ethereum: typeof Ethereum;
@@ -4240,6 +4366,8 @@ declare namespace Chains {
4240
4366
  Chains_CeloAlfajoresTestnet as CeloAlfajoresTestnet,
4241
4367
  Chains_Codex as Codex,
4242
4368
  Chains_CodexTestnet as CodexTestnet,
4369
+ Chains_Cronos as Cronos,
4370
+ Chains_CronosTestnet as CronosTestnet,
4243
4371
  Chains_Edge as Edge,
4244
4372
  Chains_EdgeTestnet as EdgeTestnet,
4245
4373
  Chains_Ethereum as Ethereum,
@@ -5376,6 +5504,110 @@ interface CCTPv2ActionMap {
5376
5504
  */
5377
5505
  hookData: string;
5378
5506
  };
5507
+ /**
5508
+ * Initiate a prepaid cross-chain USDC transfer through the `TokenMessengerWithFees` wrapper.
5509
+ *
5510
+ * Burn USDC on the source chain while collecting all fees up front against a
5511
+ * signed quote. The wrapper collects the fee via `FeeManager`, then delegates
5512
+ * to the unmodified `TokenMessengerV2`. When `hookData` is provided (the
5513
+ * GenericExecutor FORWARD path) the wrapper's `depositForBurnWithHookAndFees`
5514
+ * contract method is used; otherwise `depositForBurnWithFees` is used.
5515
+ *
5516
+ * @remarks
5517
+ * SDK/contract naming: this SDK action is `depositForBurnWithFees` but, when a
5518
+ * `hookData` is present, it dispatches to the `depositForBurnWithHookAndFees`
5519
+ * contract method on `TokenMessengerWithFees` (NOT on `TokenMessengerV2`).
5520
+ *
5521
+ * Fee payment channel (must match the quote's `feeToken`):
5522
+ * - Native fee (`feeToken` is the zero address): exactly `feeTotalAmount` is
5523
+ * attached as `msg.value`.
5524
+ * - ERC-20 fee (e.g. USDC): no value is attached; the caller must first approve
5525
+ * the wrapper for `feeTotalAmount` (see the provider's fee approval helper).
5526
+ *
5527
+ * @remarks
5528
+ * Unlike `depositForBurn`, the `TokenMessengerWithFees` contract methods do NOT
5529
+ * take `maxFee` or `minFinalityThreshold` — fee and finality behavior are
5530
+ * derived from the signed quote — so those fields are omitted from this action.
5531
+ *
5532
+ * @example
5533
+ * ```typescript
5534
+ * await adapter.action('cctp.v2.depositForBurnWithFees', {
5535
+ * amount: BigInt('1000000'),
5536
+ * mintRecipient: executorAddress, // GenericExecutor (bytes32)
5537
+ * destinationCaller: executorAddress, // GenericExecutor (bytes32)
5538
+ * fromChain: ethereum,
5539
+ * toChain: arc,
5540
+ * hookData: geForwardHookData, // cctp-forward-wrapped GenericExecutor blob
5541
+ * claim: { signedQuote: '0x...', refundAddress: '0x...' },
5542
+ * feeToken: '0x0000000000000000000000000000000000000000', // native
5543
+ * feeTotalAmount: 3500000n,
5544
+ * })
5545
+ * ```
5546
+ */
5547
+ depositForBurnWithFees: Omit<CCTPv2ActionMap['depositForBurn'], 'maxFee' | 'minFinalityThreshold'> & {
5548
+ /**
5549
+ * Optional hex-encoded hook data for the GenericExecutor FORWARD path.
5550
+ *
5551
+ * When present, the `depositForBurnWithHookAndFees` contract method is used
5552
+ * and the blob must be wrapped in the `cctp-forward` envelope (the wrapper
5553
+ * rejects a FORWARD fee quote whose hook lacks it). When omitted, the plain
5554
+ * `depositForBurnWithFees` contract method is used.
5555
+ */
5556
+ hookData?: string;
5557
+ /**
5558
+ * Signed fee quote claim passed to the `TokenMessengerWithFees` wrapper.
5559
+ *
5560
+ * `signedQuote` is the `[uint8 0x01][abi.encode(Quote)]` blob returned by the
5561
+ * Fee Quote service; `refundAddress` receives any fee overpayment refund.
5562
+ */
5563
+ claim: QuoteClaim;
5564
+ /**
5565
+ * Fee token from the signed quote.
5566
+ *
5567
+ * The zero address (`0x000…0`) means the fee is paid in native currency and
5568
+ * is attached as `msg.value`. Any other address (e.g. USDC) means an ERC-20
5569
+ * fee that must be approved to the wrapper beforehand. This is independent of
5570
+ * `burnToken`, which is always USDC.
5571
+ */
5572
+ feeToken: string;
5573
+ /**
5574
+ * Total fee amount from the signed quote, in `feeToken` minor units.
5575
+ *
5576
+ * Firm only until the quote's `expiresAt`. For a native fee this is the exact
5577
+ * `msg.value`; for an ERC-20 fee this is the amount approved to the wrapper.
5578
+ */
5579
+ feeTotalAmount: bigint;
5580
+ };
5581
+ }
5582
+ /**
5583
+ * Signed fee quote claim consumed by the `TokenMessengerWithFees` wrapper.
5584
+ *
5585
+ * Mirrors the on-chain `IFeeManager.QuoteClaim` struct.
5586
+ *
5587
+ * @example
5588
+ * ```typescript
5589
+ * const claim: QuoteClaim = {
5590
+ * signedQuote: '0x01...', // [uint8 0x01][abi.encode(Quote)]
5591
+ * refundAddress: '0xUserWallet...',
5592
+ * }
5593
+ * ```
5594
+ */
5595
+ interface QuoteClaim {
5596
+ /**
5597
+ * Opaque signed quote bytes (`0x` hex) from the fee-quote service
5598
+ * (`SignedFeeQuote.signedQuote` returned by `fetchFeeQuote`). Pass verbatim;
5599
+ * do not decode.
5600
+ *
5601
+ * The quote binds the FORWARD fee item to the on-chain call via `argsHash`;
5602
+ * passing a quote that does not match the burn args reverts `QuoteArgsMismatch`.
5603
+ */
5604
+ signedQuote: string;
5605
+ /**
5606
+ * Address that receives any refund of overpaid fees.
5607
+ *
5608
+ * Typically the user wallet that authorized the burn.
5609
+ */
5610
+ refundAddress: string;
5379
5611
  }
5380
5612
 
5381
5613
  /**
@@ -8373,15 +8605,15 @@ declare const ServiceError: {
8373
8605
  };
8374
8606
 
8375
8607
  /**
8376
- * Standardized error definitions for Earn/Zenith operations.
8608
+ * Standardized error definitions for Earn operations.
8377
8609
  *
8378
8610
  * These error codes provide fine-grained categorization of failures
8379
- * from the Zenith earn service, enabling SDK consumers to distinguish
8611
+ * from the Earn service, enabling SDK consumers to distinguish
8380
8612
  * between input errors (fix your request) and service errors (retry later).
8381
8613
  *
8382
8614
  * Error code ranges:
8383
- * - 1100-1105: INPUT errors — invalid inputs, unsupported configurations
8384
- * - 8100-8104: SERVICE errors — retryable backend/provider failures
8615
+ * - 1100-1106: INPUT errors — invalid, unsupported, or stale request state
8616
+ * - 8100-8105: SERVICE errors — retryable backend/provider failures
8385
8617
  *
8386
8618
  * @example
8387
8619
  * ```typescript
@@ -8440,6 +8672,15 @@ declare const EarnError: {
8440
8672
  readonly name: "EARN_UNSUPPORTED_BRIDGE_ROUTE";
8441
8673
  readonly type: ErrorType;
8442
8674
  };
8675
+ /**
8676
+ * The bridge quote expired. This is an INPUT error because the prepared
8677
+ * request is stale and must be replaced instead of retried.
8678
+ */
8679
+ readonly BRIDGE_QUOTE_EXPIRED: {
8680
+ readonly code: 1106;
8681
+ readonly name: "EARN_BRIDGE_QUOTE_EXPIRED";
8682
+ readonly type: ErrorType;
8683
+ };
8443
8684
  /** The proxy signing call failed — retryable. */
8444
8685
  readonly SIGNING_FAILED: {
8445
8686
  readonly code: 8100;
@@ -8470,6 +8711,12 @@ declare const EarnError: {
8470
8711
  readonly name: "EARN_PAUSED";
8471
8712
  readonly type: ErrorType;
8472
8713
  };
8714
+ /** Position PnL is still reconciling and can be retried. */
8715
+ readonly POSITION_PNL_PENDING: {
8716
+ readonly code: 8105;
8717
+ readonly name: "EARN_POSITION_PNL_PENDING";
8718
+ readonly type: ErrorType;
8719
+ };
8473
8720
  };
8474
8721
 
8475
8722
  /**
@@ -12015,6 +12262,38 @@ interface ICCTPV2BridgingProvider extends BridgingProvider<CCTPV2Actions> {
12015
12262
  * @returns A promise that resolves to the attestation message.
12016
12263
  */
12017
12264
  fetchAttestation<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities>(source: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>['source'], txHash: string, config?: Partial<ApiPollingConfig>): Promise<AttestationMessage>;
12265
+ /**
12266
+ * Polls attestation data until Circle's relayer mint transaction is confirmed.
12267
+ *
12268
+ * @param source - The source wallet context containing the chain definition and wallet address.
12269
+ * @param txHash - The transaction hash of the deposit for burn transaction.
12270
+ * @param config - Optional polling configuration overrides.
12271
+ * @returns A promise that resolves to the relayer mint attestation message.
12272
+ * @throws KitError If the source wallet context is invalid, the transaction hash is invalid,
12273
+ * the relayer forward fails, the response is invalid, or polling times out.
12274
+ *
12275
+ * @example
12276
+ * ```typescript
12277
+ * import { CCTPV2BridgingProvider } from '@circle-fin/provider-cctp-v2'
12278
+ * import { Chains } from '@core/chains'
12279
+ *
12280
+ * const provider = new CCTPV2BridgingProvider({
12281
+ * headers: { 'X-Partner-UUID': '00000000-0000-0000-0000-000000000000' },
12282
+ * })
12283
+ *
12284
+ * const attestation = await provider.fetchRelayerMint(
12285
+ * {
12286
+ * adapter,
12287
+ * chain: Chains.EthereumSepolia,
12288
+ * address: '0x1234...',
12289
+ * },
12290
+ * '0xabc123...',
12291
+ * )
12292
+ *
12293
+ * console.log('Relayer mint tx:', attestation.forwardTxHash)
12294
+ * ```
12295
+ */
12296
+ fetchRelayerMint<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities>(source: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>['source'], txHash: string, config?: Partial<ApiPollingConfig>): Promise<AttestationMessage>;
12018
12297
  /**
12019
12298
  * Requests a fresh attestation for an expired attestation.
12020
12299
  *
@@ -12040,16 +12319,173 @@ interface ICCTPV2BridgingProvider extends BridgingProvider<CCTPV2Actions> {
12040
12319
  mint<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities>(source: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>['source'], destination: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>['destination'], attestation: AttestationMessage): Promise<PreparedChainRequest>;
12041
12320
  }
12042
12321
 
12322
+ /**
12323
+ * An ERC-20 approval required before a prepaid-FORWARD burn.
12324
+ *
12325
+ * @example
12326
+ * ```typescript
12327
+ * const approval: FeeApproval = {
12328
+ * token: '0xUSDC...',
12329
+ * amount: 1_003_500_000n,
12330
+ * }
12331
+ * ```
12332
+ */
12333
+ interface FeeApproval {
12334
+ /**
12335
+ * Token address to approve (the burn token and/or the ERC-20 fee token).
12336
+ */
12337
+ token: string;
12338
+ /**
12339
+ * Amount to approve to the `TokenMessengerWithFees` wrapper, in token minor units.
12340
+ */
12341
+ amount: bigint;
12342
+ }
12343
+ /**
12344
+ * The resolved fee payment channel for a prepaid-FORWARD burn.
12345
+ *
12346
+ * @example
12347
+ * ```typescript
12348
+ * const plan: FeePaymentPlan = {
12349
+ * isNativeFee: false,
12350
+ * isBurnTokenFee: true,
12351
+ * nativeValue: 0n,
12352
+ * approvals: [{ token: '0xUSDC...', amount: 1_003_500_000n }],
12353
+ * }
12354
+ * ```
12355
+ */
12356
+ interface FeePaymentPlan {
12357
+ /**
12358
+ * True when the fee is paid in native currency (`feeToken` is the zero address).
12359
+ */
12360
+ isNativeFee: boolean;
12361
+ /**
12362
+ * True when the fee token is the same token being burned (both USDC).
12363
+ *
12364
+ * In this case a single, combined approval covers both the burn and the fee,
12365
+ * so the redundant second approval is skipped.
12366
+ */
12367
+ isBurnTokenFee: boolean;
12368
+ /**
12369
+ * Native value to attach as `msg.value`.
12370
+ *
12371
+ * Exactly `feeTotalAmount` for a native fee; `0n` for an ERC-20 fee.
12372
+ */
12373
+ nativeValue: bigint;
12374
+ /**
12375
+ * ERC-20 approvals required before the burn, each to the `TokenMessengerWithFees`
12376
+ * wrapper.
12377
+ *
12378
+ * - Native fee: a single approval of `amount` for the burn token.
12379
+ * - ERC-20 fee equal to the burn token: a single approval of `amount + feeTotalAmount`.
12380
+ * - ERC-20 fee different from the burn token: two approvals — `amount` for the
12381
+ * burn token and `feeTotalAmount` for the fee token.
12382
+ */
12383
+ approvals: FeeApproval[];
12384
+ }
12385
+
12043
12386
  /**
12044
12387
  * Configuration options for the CCTP v2 provider.
12045
12388
  *
12046
12389
  * @remarks
12047
12390
  * This interface defines all configurable aspects of the CCTP v2 provider:
12048
12391
  * - attestation: Settings for the attestation fetching process
12392
+ * - headers: Custom HTTP headers sent with every Circle attestation API request
12049
12393
  */
12050
12394
  interface CCTPV2Config {
12051
12395
  /** Configuration for the attestation fetching process */
12052
12396
  attestation?: Partial<ApiPollingConfig>;
12397
+ /**
12398
+ * Custom HTTP headers sent with every Circle attestation (Iris) API request
12399
+ * made by the provider (attestation fetch, re-attestation, and relayer mint
12400
+ * status polling).
12401
+ *
12402
+ * @remarks
12403
+ * Headers are merged on top of the defaults (such as `Content-Type`) without
12404
+ * removing them. The header is forwarded as-is to Circle's API; the SDK does
12405
+ * not interpret it.
12406
+ *
12407
+ * Precedence (lowest to highest): provider defaults, then these
12408
+ * `config.headers`, then any per-call `config.headers` passed to
12409
+ * {@link CCTPV2BridgingProvider.fetchAttestation},
12410
+ * {@link CCTPV2BridgingProvider.fetchRelayerMint}, or
12411
+ * {@link CCTPV2BridgingProvider.reAttest}.
12412
+ */
12413
+ headers?: Record<string, string>;
12414
+ }
12415
+ /**
12416
+ * Parameters for a prepaid-FORWARD burn via {@link CCTPV2BridgingProvider.burnWithFees}.
12417
+ *
12418
+ * @typeParam TFromAdapterCapabilities - The source adapter's capabilities.
12419
+ */
12420
+ interface BurnWithFeesParams<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> {
12421
+ /**
12422
+ * Source wallet context (adapter + CCTP v2 source chain).
12423
+ */
12424
+ source: WalletContext<TFromAdapterCapabilities, ChainDefinitionWithCCTPv2>;
12425
+ /**
12426
+ * Destination chain definition (provides the destination CCTP domain).
12427
+ */
12428
+ destinationChain: ChainDefinitionWithCCTPv2;
12429
+ /**
12430
+ * Amount of USDC to burn, in minor units.
12431
+ */
12432
+ amount: string | bigint;
12433
+ /**
12434
+ * The GenericExecutor address on the destination chain.
12435
+ *
12436
+ * Used for BOTH `mintRecipient` and `destinationCaller` (padded to bytes32 by
12437
+ * the underlying action): the executor mints to itself and is the only account
12438
+ * allowed to complete the transfer.
12439
+ */
12440
+ executor: string;
12441
+ /**
12442
+ * The `cctp-forward`-wrapped GenericExecutor hookData blob.
12443
+ *
12444
+ * Produced with `@core/utils`: wrap the bare blob from
12445
+ * `buildDepositForGenericExecutorPayload(...).hookData` with
12446
+ * `buildForwardingHookDataWithPayload(version, bareBlob)`. It must begin with
12447
+ * the `cctp-forward` frame, or the wrapper reverts `ForwardFeeWithoutHook`.
12448
+ *
12449
+ * Pass the SAME wrapped bytes here that were bound to the FORWARD fee quote
12450
+ * (`fetchFeeQuote` FORWARD `params.hookData`); mismatched bytes revert
12451
+ * `QuoteArgsMismatch`. Do not pass the bare (`circle-generic-executor`) blob.
12452
+ */
12453
+ hookData: string;
12454
+ /**
12455
+ * Signed fee quote claim (`{ signedQuote, refundAddress }`).
12456
+ */
12457
+ claim: QuoteClaim;
12458
+ /**
12459
+ * Fee token from the quote. The zero address denotes a native fee.
12460
+ */
12461
+ feeToken: string;
12462
+ /**
12463
+ * Total fee amount from the quote, in `feeToken` minor units.
12464
+ */
12465
+ feeTotalAmount: string | bigint;
12466
+ }
12467
+ /**
12468
+ * Result of {@link CCTPV2BridgingProvider.burnWithFees}.
12469
+ *
12470
+ * The prepared requests are returned unexecuted; the caller executes the
12471
+ * approvals first (in order) and then the burn.
12472
+ */
12473
+ interface BurnWithFeesResult {
12474
+ /**
12475
+ * ERC-20 approvals to the `TokenMessengerWithFees` wrapper required before the
12476
+ * burn. Always contains at least one entry: the burn-token approval. A
12477
+ * distinct fee-token approval is added only when the fee token differs from
12478
+ * the burn token and is not the native token.
12479
+ */
12480
+ approvals: PreparedChainRequest[];
12481
+ /**
12482
+ * The prepared `depositForBurnWithHookAndFees` burn transaction.
12483
+ */
12484
+ burn: PreparedChainRequest;
12485
+ /**
12486
+ * The resolved fee payment plan (native value, approvals, and flags).
12487
+ */
12488
+ feePayment: FeePaymentPlan;
12053
12489
  }
12054
12490
  /**
12055
12491
  * Concrete implementation of BridgingProvider for Circle's Cross-Chain Transfer Protocol (CCTP) version 2.
@@ -12115,6 +12551,20 @@ declare class CCTPV2BridgingProvider extends BridgingProvider<CCTPV2Actions> imp
12115
12551
  * @param config - Optional configuration overrides for the provider
12116
12552
  */
12117
12553
  constructor(config?: CCTPV2Config);
12554
+ /**
12555
+ * Resolves the effective polling configuration for an attestation request.
12556
+ *
12557
+ * Precedence (lowest to highest): provider `config.attestation`, then the
12558
+ * per-call `config`. Headers merge independently across
12559
+ * `config.attestation.headers`, the provider-level `config.headers`, and any
12560
+ * per-call `config.headers`, so a more specific header augments rather than
12561
+ * replaces the broader ones. The `headers` key is omitted entirely when no
12562
+ * headers are configured, leaving the attestation fetchers' defaults intact.
12563
+ *
12564
+ * @param config - Optional per-call polling configuration overrides
12565
+ * @returns The merged polling configuration passed to the attestation fetchers
12566
+ */
12567
+ private resolveAttestationConfig;
12118
12568
  /**
12119
12569
  * Execute a cross-chain USDC bridge operation using the CCTP v2 protocol.
12120
12570
  *
@@ -12357,6 +12807,43 @@ declare class CCTPV2BridgingProvider extends BridgingProvider<CCTPV2Actions> imp
12357
12807
  * ```
12358
12808
  */
12359
12809
  fetchAttestation<TFromAdapterCapabilities extends AdapterCapabilities>(source: WalletContext<TFromAdapterCapabilities, ChainDefinitionWithCCTPv2>, transactionHash: string, config?: Partial<ApiPollingConfig>): Promise<AttestationMessage>;
12810
+ /**
12811
+ * Polls attestation data until Circle's relayer mint transaction is confirmed.
12812
+ *
12813
+ * This method is used by forwarded transfers. It polls the same Iris
12814
+ * attestation endpoint as {@link CCTPV2BridgingProvider.fetchAttestation},
12815
+ * but waits for a completed relayer forward state and returns the attestation
12816
+ * message containing `forwardTxHash`.
12817
+ *
12818
+ * @typeParam TFromAdapterCapabilities - The type representing the capabilities of the source adapter
12819
+ * @param source - The source wallet context containing the chain definition and wallet address
12820
+ * @param transactionHash - The transaction hash of the burn operation
12821
+ * @param config - Optional polling configuration overrides for timeout, retries, delay, and headers
12822
+ * @returns A promise that resolves to the attestation message with `forwardTxHash`
12823
+ * @throws KitError If the relayer forward fails, the response is invalid, or polling times out
12824
+ *
12825
+ * @example
12826
+ * ```typescript
12827
+ * import { CCTPV2BridgingProvider } from '@circle-fin/provider-cctp-v2'
12828
+ * import { Chains } from '@core/chains'
12829
+ *
12830
+ * const provider = new CCTPV2BridgingProvider({
12831
+ * headers: { 'X-Partner-UUID': '00000000-0000-0000-0000-000000000000' },
12832
+ * })
12833
+ *
12834
+ * const attestation = await provider.fetchRelayerMint(
12835
+ * {
12836
+ * adapter,
12837
+ * chain: Chains.EthereumSepolia,
12838
+ * address: '0x1234...',
12839
+ * },
12840
+ * '0xabc123...',
12841
+ * )
12842
+ *
12843
+ * console.log('Relayer mint tx:', attestation.forwardTxHash)
12844
+ * ```
12845
+ */
12846
+ fetchRelayerMint<TFromAdapterCapabilities extends AdapterCapabilities>(source: WalletContext<TFromAdapterCapabilities, ChainDefinitionWithCCTPv2>, transactionHash: string, config?: Partial<ApiPollingConfig>): Promise<AttestationMessage>;
12360
12847
  /**
12361
12848
  * Requests a fresh attestation for an expired attestation.
12362
12849
  *
@@ -12508,6 +12995,57 @@ declare class CCTPV2BridgingProvider extends BridgingProvider<CCTPV2Actions> imp
12508
12995
  * ```
12509
12996
  */
12510
12997
  burn<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities>(params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>): Promise<PreparedChainRequest>;
12998
+ /**
12999
+ * Prepare a prepaid-FORWARD burn through the `TokenMessengerWithFees` wrapper.
13000
+ *
13001
+ * Builds the source-chain `depositForBurnWithHookAndFees` call for the
13002
+ * GenericExecutor FORWARD path: fees are collected up front on the source chain
13003
+ * against a signed quote, `mintRecipient` and `destinationCaller` are both set to
13004
+ * the GenericExecutor, and the GE `hookData` is passed through unchanged.
13005
+ *
13006
+ * This is the low-level on-chain primitive behind the UBK `fastCrossChainDeposit`
13007
+ * and Bridge Kit `bridge({ deposit })` flows. The `hookData` and signed-quote
13008
+ * `claim` are produced elsewhere and passed in here:
13009
+ * - `hookData`: `buildForwardingHookDataWithPayload(version,
13010
+ * buildDepositForGenericExecutorPayload(...).hookData)` from `@core/utils`.
13011
+ * - `claim.signedQuote` / `feeToken` / `feeTotalAmount`: from `fetchFeeQuote`
13012
+ * (`@circle-fin/provider-fee-v1`), whose FORWARD item must be bound to the
13013
+ * SAME `hookData` and executor `destinationCaller` used here.
13014
+ *
13015
+ * The returned approvals and burn are NOT executed — the caller executes the
13016
+ * approvals first (in order) and then the burn. The fee payment channel matches
13017
+ * the quote's `feeToken`:
13018
+ * - Native fee: exactly `feeTotalAmount` is attached as the burn's `msg.value`;
13019
+ * only the burn amount is approved.
13020
+ * - USDC fee (same token as the burn): a single combined `amount + feeTotalAmount`
13021
+ * approval covers both; the redundant second approval is skipped.
13022
+ *
13023
+ * @typeParam TFromAdapterCapabilities - The source adapter's capabilities.
13024
+ * @param params - The burn amount, executor, hookData, signed-quote claim, and fee.
13025
+ * @returns The prepared approvals, the prepared burn, and the resolved fee plan.
13026
+ * @throws {KitError} If the wallet context is invalid, `destinationChain` does not
13027
+ * support CCTP v2, the executor is missing, `amount` or `feeTotalAmount` is not
13028
+ * a bigint or a numeric string coercible to bigint, the hookData lacks a
13029
+ * `cctp-forward` frame (guaranteed `ForwardFeeWithoutHook`), or the operation
13030
+ * context cannot be resolved.
13031
+ *
13032
+ * @example
13033
+ * ```typescript
13034
+ * const { approvals, burn } = await provider.burnWithFees({
13035
+ * source,
13036
+ * destinationChain: Arc,
13037
+ * amount: 1_000_000n,
13038
+ * executor: genericExecutorAddress,
13039
+ * hookData: geForwardHookData,
13040
+ * claim: { signedQuote: '0x01...', refundAddress: userAddress },
13041
+ * feeToken: '0x0000000000000000000000000000000000000000', // native
13042
+ * feeTotalAmount: 3_500_000n,
13043
+ * })
13044
+ * for (const approval of approvals) await approval.execute()
13045
+ * const txHash = await burn.execute()
13046
+ * ```
13047
+ */
13048
+ burnWithFees<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities>(params: BurnWithFeesParams<TFromAdapterCapabilities>): Promise<BurnWithFeesResult>;
12511
13049
  /**
12512
13050
  * Waits for a transaction to be mined and confirmed on the blockchain.
12513
13051
  *
@@ -12532,11 +13070,24 @@ declare class CCTPV2BridgingProvider extends BridgingProvider<CCTPV2Actions> imp
12532
13070
  waitForTransaction(adapter: Adapter, txHash: string, chain: ChainDefinition, config?: WaitForTransactionConfig): Promise<WaitForTransactionResponse>;
12533
13071
  }
12534
13072
 
13073
+ /**
13074
+ * Configuration forwarded to the default bridging providers.
13075
+ */
13076
+ interface DefaultProvidersConfig {
13077
+ /**
13078
+ * Custom HTTP headers forwarded with the CCTP provider's attestation (Iris)
13079
+ * API requests. See {@link BridgeKitConfig.headers}.
13080
+ */
13081
+ headers?: Record<string, string>;
13082
+ }
12535
13083
  /**
12536
13084
  * The default providers that will be used in addition to the providers provided
12537
13085
  * to the BridgeKit constructor.
13086
+ *
13087
+ * @param config - Optional configuration forwarded to the default providers
13088
+ * @returns The default bridging providers
12538
13089
  */
12539
- declare const getDefaultProviders$1: () => readonly [CCTPV2BridgingProvider];
13090
+ declare const getDefaultProviders$1: (config?: DefaultProvidersConfig) => readonly [CCTPV2BridgingProvider];
12540
13091
 
12541
13092
  /**
12542
13093
  * Configuration options for initializing a BridgeKit instance.
@@ -12593,6 +13144,23 @@ interface BridgeKitConfig<TExtraProviders extends FlexibleBridgingProvider[] = [
12593
13144
  * @defaultValue false
12594
13145
  */
12595
13146
  disableErrorReporting?: boolean;
13147
+ /**
13148
+ * Custom HTTP headers forwarded with the default CCTP provider's attestation
13149
+ * (Iris) API requests.
13150
+ *
13151
+ * @remarks
13152
+ * Headers are merged on top of the SDK defaults (such as `Content-Type`)
13153
+ * rather than replacing them. The header is forwarded as-is to Circle's API;
13154
+ * the SDK does not interpret it.
13155
+ *
13156
+ * @example
13157
+ * ```typescript
13158
+ * const kit = new BridgeKit({
13159
+ * headers: { 'X-Access-Key': '00000000-0000-0000-0000-000000000000' },
13160
+ * })
13161
+ * ```
13162
+ */
13163
+ headers?: Record<string, string>;
12596
13164
  }
12597
13165
  /**
12598
13166
  * Merges action types from multiple bridging providers into a unified action map.
@@ -13320,6 +13888,29 @@ interface ServiceSwapConfig {
13320
13888
  * @example 'lifi', 'paraswap'
13321
13889
  */
13322
13890
  provider?: string;
13891
+ /**
13892
+ * Whether to fuse the ERC-20 approval and the swap into a single atomic
13893
+ * batch when the adapter supports it (EIP-5792, or a signing strategy that
13894
+ * declares atomic batching).
13895
+ *
13896
+ * @remarks
13897
+ * Defaults to `true`. When batching is available this collapses the two
13898
+ * sequential transactions of the on-chain approval path into one atomic
13899
+ * submission — a single signing challenge for a smart-contract wallet. Set
13900
+ * to `false` to force the sequential approve-then-swap path. Has no effect on
13901
+ * the gasless permit path (already a single transaction) or on native-token
13902
+ * swaps (no approval needed).
13903
+ *
13904
+ * The batch path relies on the wallet's own gas estimation for the swap call:
13905
+ * the service-provided gas floor and pre-flight simulation that the sequential
13906
+ * path applies are not conveyed through the batch. For a complex/multi-hop
13907
+ * swap whose wallet-side estimate under-shoots, this can out-of-gas-revert the
13908
+ * atomic batch where the sequential path would succeed — set `false` to fall
13909
+ * back to the service-floored sequential path if you hit this.
13910
+ *
13911
+ * @defaultValue true
13912
+ */
13913
+ batchTransactions?: boolean;
13323
13914
  }
13324
13915
  /**
13325
13916
  * Parameters for initiating a swap operation through the Stablecoin Service.
@@ -14754,9 +15345,10 @@ interface SwapDestinationLeg {
14754
15345
  * Parameters for {@link SwapKit.getSwapStatus}.
14755
15346
  *
14756
15347
  * @remarks
14757
- * Only `txHash`, `chainIn`, and `kitKey` are required. Supply `chainOut`
14758
- * when the original swap was cross-chain (source chain ≠ destination
14759
- * chain).
15348
+ * Only `txHash` and `chainIn` are required; `chainOut` and `kitKey` are
15349
+ * optional. Supply `chainOut` when the original swap was cross-chain
15350
+ * (source chain ≠ destination chain); omit `kitKey` to call in
15351
+ * permissionless mode.
14760
15352
  *
14761
15353
  * The field names mirror {@link SwapResult.chainIn} / {@link
14762
15354
  * SwapResult.chainOut} so consumers can pipe a `SwapResult` straight into
@@ -14771,11 +15363,11 @@ interface SwapDestinationLeg {
14771
15363
  * ```typescript
14772
15364
  * const result = await kit.swap(params)
14773
15365
  *
15366
+ * // Permissionless — no kit key needed. Pass `kitKey` to authenticate.
14774
15367
  * let status = await kit.getSwapStatus({
14775
15368
  * txHash: result.txHash,
14776
15369
  * chainIn: result.chainIn,
14777
15370
  * chainOut: result.chainOut,
14778
- * kitKey: process.env.KIT_KEY ?? '',
14779
15371
  * })
14780
15372
  * while (status.progress.status === 'PENDING') {
14781
15373
  * await new Promise((r) => setTimeout(r, 3_000))
@@ -14783,7 +15375,6 @@ interface SwapDestinationLeg {
14783
15375
  * txHash: result.txHash,
14784
15376
  * chainIn: result.chainIn,
14785
15377
  * chainOut: result.chainOut,
14786
- * kitKey: process.env.KIT_KEY ?? '',
14787
15378
  * })
14788
15379
  * }
14789
15380
  * ```
@@ -14811,8 +15402,11 @@ interface GetSwapStatusParams {
14811
15402
  /**
14812
15403
  * Stablecoin Service Kit Key used as a bearer credential for the status
14813
15404
  * request. Treat this value as a secret and do not log it.
15405
+ *
15406
+ * Optional — when omitted, the request is made without an `Authorization`
15407
+ * header (permissionless mode).
14814
15408
  */
14815
- kitKey: string;
15409
+ kitKey?: string;
14816
15410
  }
14817
15411
  /**
14818
15412
  * Result of a swap status lookup — a single snapshot of the swap's state at
@@ -14860,8 +15454,11 @@ interface WaitForSwapCommonParams {
14860
15454
  /**
14861
15455
  * Stablecoin Service Kit Key used as a bearer credential. Treat as a
14862
15456
  * secret and do not log it.
15457
+ *
15458
+ * Optional — when omitted, the request is made without an `Authorization`
15459
+ * header (permissionless mode).
14863
15460
  */
14864
- readonly kitKey: string;
15461
+ readonly kitKey?: string;
14865
15462
  /**
14866
15463
  * Overall wait budget, in milliseconds. The promise rejects with a
14867
15464
  * RETRYABLE {@link KitError} when this elapses without a terminal
@@ -15022,8 +15619,11 @@ interface GetTokenRatesParams {
15022
15619
  /**
15023
15620
  * Stablecoin Service Kit Key used as a bearer credential for the rates
15024
15621
  * request. Treat this value as a secret and do not log it.
15622
+ *
15623
+ * Optional — when omitted, the request is made without an `Authorization`
15624
+ * header (permissionless mode).
15025
15625
  */
15026
- kitKey: string;
15626
+ kitKey?: string;
15027
15627
  }
15028
15628
  /**
15029
15629
  * Result of a token rates lookup.
@@ -15198,6 +15798,30 @@ interface SwapKitConfig<TExtraProviders extends FlexibleSwappingProvider[] = []>
15198
15798
  disableErrorReporting?: boolean;
15199
15799
  }
15200
15800
 
15801
+ /** @internal */
15802
+ declare const bridgeQuoteExpirySchema: z.ZodCatch<z.ZodOptional<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
15803
+ mode: z.ZodLiteral<"TIMESTAMP">;
15804
+ expiresAt: z.ZodString;
15805
+ }, "strip", z.ZodTypeAny, {
15806
+ mode: "TIMESTAMP";
15807
+ expiresAt: string;
15808
+ }, {
15809
+ mode: "TIMESTAMP";
15810
+ expiresAt: string;
15811
+ }>, z.ZodObject<{
15812
+ mode: z.ZodLiteral<"BLOCK_NUMBER">;
15813
+ expiresAtBlock: z.ZodNumber;
15814
+ blockEstimatedAt: z.ZodOptional<z.ZodString>;
15815
+ }, "strip", z.ZodTypeAny, {
15816
+ mode: "BLOCK_NUMBER";
15817
+ expiresAtBlock: number;
15818
+ blockEstimatedAt?: string | undefined;
15819
+ }, {
15820
+ mode: "BLOCK_NUMBER";
15821
+ expiresAtBlock: number;
15822
+ blockEstimatedAt?: string | undefined;
15823
+ }>]>>>;
15824
+
15201
15825
  /**
15202
15826
  * Configuration options for the Earn Service provider.
15203
15827
  *
@@ -15271,6 +15895,7 @@ interface VaultRewardInfo {
15271
15895
  * assetAddress: '0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf',
15272
15896
  * lltv: 0.86,
15273
15897
  * supplyUsd: 50000000.25,
15898
+ * allocationPct: 0.6,
15274
15899
  * }
15275
15900
  * ```
15276
15901
  */
@@ -15283,6 +15908,17 @@ interface CollateralInfo {
15283
15908
  readonly lltv: number;
15284
15909
  /** Approximate supplied value in USD, e.g. 50000000.25 for $50,000,000.25. */
15285
15910
  readonly supplyUsd: number;
15911
+ /**
15912
+ * Share of the vault's supply allocated to this collateral market
15913
+ * (e.g., 0.6 = 60%).
15914
+ *
15915
+ * Populated for Morpho V1 vaults; `null` when the underlying product
15916
+ * exposes no per-market allocation (e.g. Morpho V2). Optional for now — a
15917
+ * backend that predates this field omits it entirely, matching the other
15918
+ * optional facets on {@link EarnOpportunityBase}; a future release makes it
15919
+ * required once every backend emits it.
15920
+ */
15921
+ readonly allocationPct?: number | null | undefined;
15286
15922
  }
15287
15923
  /**
15288
15924
  * Vault warning from the underlying earn protocol.
@@ -15302,65 +15938,253 @@ interface VaultWarning {
15302
15938
  readonly level: 'YELLOW' | 'RED';
15303
15939
  }
15304
15940
  /**
15305
- * Describe a yield-bearing vault available through the earn service.
15941
+ * Manager (e.g., curator) responsible for a yield opportunity.
15942
+ *
15943
+ * Generalizes Morpho's "curator". `null` on the opportunity when the
15944
+ * underlying product has no per-opportunity manager (e.g., a pooled
15945
+ * lending market).
15306
15946
  *
15307
15947
  * @example
15308
15948
  * ```typescript
15309
- * const vault: VaultInfo = {
15310
- * vaultAddress: '0xAabbeF1D3971c710276ed41eC791BbE14CdB8E88',
15311
- * chain: 'Arc_Testnet',
15312
- * name: 'Steakhouse USDC',
15313
- * protocol: 'MORPHO',
15314
- * asset: 'USDC',
15315
- * assetAddress: '0x3600000000000000000000000000000000000000',
15316
- * currentApy: 0.0425,
15317
- * nativeApy: 0.035,
15318
- * vaultFee: 0.05,
15319
- * rewards: [{ token: 'MORPHO', tokenAddress: '0x...', apy: 0.0075 }],
15320
- * collateral: [{ asset: 'cbBTC', assetAddress: '0x...', lltv: 0.86, supplyUsd: 50000000.25 }],
15321
- * totalDeposits: Amount.fromJSON({ raw: '15000000000000', decimals: 6 }),
15322
- * liquidity: Amount.fromJSON({ raw: '5000000000000', decimals: 6 }),
15949
+ * const manager: ManagerInfo = {
15950
+ * name: 'Steakhouse',
15951
+ * address: '0x...',
15952
+ * type: 'curator',
15953
+ * }
15954
+ * ```
15955
+ */
15956
+ interface ManagerInfo {
15957
+ /** Human-readable manager name. */
15958
+ readonly name: string;
15959
+ /** On-chain manager address, when the product exposes one. */
15960
+ readonly address?: string | undefined;
15961
+ /**
15962
+ * Manager role within the product. Only `'curator'` is emitted today
15963
+ * (Morpho V1/V2); additional roles are added as the providers that emit
15964
+ * them land.
15965
+ */
15966
+ readonly type: 'curator';
15967
+ }
15968
+ /**
15969
+ * Yield profile for an opportunity, including trailing averages.
15970
+ *
15971
+ * `current` is always present; trailing and native values are `null` when
15972
+ * unavailable for this instance (e.g., a vault younger than the lookback
15973
+ * window). `source`/`asOf` carry provenance for derived/staleness-prone
15974
+ * values.
15975
+ *
15976
+ * @example
15977
+ * ```typescript
15978
+ * const apyProfile: ApyProfile = {
15979
+ * current: 0.085,
15980
+ * native: 0.071,
15981
+ * d7: 0.082,
15982
+ * d30: 0.079,
15983
+ * d90: 0.081,
15984
+ * rewardShare: 0.16,
15985
+ * source: 'morpho:avgNetApy',
15986
+ * asOf: '2026-06-23T18:00:00Z',
15987
+ * }
15988
+ * ```
15989
+ */
15990
+ interface ApyProfile {
15991
+ /** Current total APY including rewards. */
15992
+ readonly current: number;
15993
+ /** Native APY excluding reward incentives; `null` when unavailable. */
15994
+ readonly native: number | null;
15995
+ /** Trailing 7-day average net APY; `null` when unavailable. */
15996
+ readonly d7: number | null;
15997
+ /** Trailing 30-day average net APY; `null` when unavailable. */
15998
+ readonly d30: number | null;
15999
+ /** Trailing 90-day average net APY; `null` when unavailable. */
16000
+ readonly d90: number | null;
16001
+ /** Share of current APY attributable to rewards; `null` when unavailable. */
16002
+ readonly rewardShare: number | null;
16003
+ /** Provenance of the trailing values (`native` or `circle:<source>`). */
16004
+ readonly source?: string | undefined;
16005
+ /** RFC3339 timestamp of the newest input used for the trailing values. */
16006
+ readonly asOf?: string | undefined;
16007
+ }
16008
+ /**
16009
+ * Fee split for an opportunity.
16010
+ *
16011
+ * Each component is `null` when the product does not levy it (e.g., Morpho
16012
+ * V1 vaults have no management fee).
16013
+ *
16014
+ * @example
16015
+ * ```typescript
16016
+ * const fee: FeeInfo = { performance: 0.1, management: null }
16017
+ * ```
16018
+ */
16019
+ interface FeeInfo {
16020
+ /** Performance fee as a decimal (e.g., 0.1 = 10%); `null` when unavailable. */
16021
+ readonly performance: number | null;
16022
+ /** Management fee as a decimal; `null` when unavailable. */
16023
+ readonly management: number | null;
16024
+ }
16025
+ /**
16026
+ * Liquidity profile for an opportunity.
16027
+ *
16028
+ * @example
16029
+ * ```typescript
16030
+ * const liquidityProfile: LiquidityProfile = {
16031
+ * totalDeposits: Amount.fromJSON({ raw: '45000000000000', decimals: 6 }),
16032
+ * available: Amount.fromJSON({ raw: '5200000000000', decimals: 6 }),
16033
+ * totalSupply: Amount.fromJSON({ raw: '44900000000000000000', decimals: 18 }),
15323
16034
  * status: 'active',
15324
- * circleGuarded: false,
15325
16035
  * }
15326
16036
  * ```
15327
16037
  */
15328
- interface VaultInfo {
15329
- /** On-chain vault contract address. */
15330
- readonly vaultAddress: string;
15331
- /** Blockchain where the vault is deployed. */
16038
+ interface LiquidityProfile {
16039
+ /** Total value deposited in base-unit amount form. */
16040
+ readonly totalDeposits: Amount;
16041
+ /** Available liquidity in base-unit amount form. */
16042
+ readonly available: Amount;
16043
+ /** Outstanding vault share tokens (ERC4626 totalSupply) in base-unit form. */
16044
+ readonly totalSupply: Amount;
16045
+ /** Current liquidity status. */
16046
+ readonly status: 'active' | 'low_liquidity';
16047
+ }
16048
+ /**
16049
+ * Risk signals for an opportunity.
16050
+ *
16051
+ * @example
16052
+ * ```typescript
16053
+ * const riskSignals: RiskSignals = {
16054
+ * circleSentinel: true,
16055
+ * warnings: [],
16056
+ * earnKitWarnings: [],
16057
+ * }
16058
+ * ```
16059
+ */
16060
+ interface RiskSignals {
16061
+ /** Whether the opportunity is covered by Circle Sentinel. */
16062
+ readonly circleSentinel: boolean;
16063
+ /** Protocol warnings for this opportunity. */
16064
+ readonly warnings?: readonly VaultWarning[] | undefined;
16065
+ /** Circle-specific warnings (e.g., unsupported reward protocol). */
16066
+ readonly earnKitWarnings?: readonly string[] | undefined;
16067
+ }
16068
+ /**
16069
+ * Facets common to every earn opportunity, plus the deprecated flat
16070
+ * fields retained for backward compatibility.
16071
+ *
16072
+ * The flat aliases are emitted by the backend alongside the nested facets
16073
+ * and mapped straight through, so existing consumers keep reading them until
16074
+ * they are removed in a future major release. Narrow on
16075
+ * {@link EarnOpportunity.productType} to access product-specific fields.
16076
+ */
16077
+ interface EarnOpportunityBase {
16078
+ /** Blockchain where the opportunity is deployed. */
15332
16079
  readonly chain: `${EarnChain}`;
15333
- /** Human-readable vault name. */
16080
+ /** Human-readable opportunity name. */
15334
16081
  readonly name: string;
15335
- /** Vault protocol identifier. */
16082
+ /** Protocol identifier. */
15336
16083
  readonly protocol: string;
15337
16084
  /** Underlying deposit asset symbol (e.g., 'USDC'). */
15338
16085
  readonly asset: string;
15339
16086
  /** Underlying deposit asset contract address. */
15340
16087
  readonly assetAddress: string;
15341
- /** Total annualized percentage yield including rewards. */
16088
+ /** Reward tokens distributed by this opportunity. */
16089
+ readonly rewards: readonly VaultRewardInfo[];
16090
+ /** Primary on-chain address (protocol-neutral; replaces vaultAddress). */
16091
+ readonly address?: string | undefined;
16092
+ /** RFC3339 freshness timestamp: provider state ts, else cache sync time. */
16093
+ readonly asOf?: string | undefined;
16094
+ /** Manager/curator identity; `null` when the product has no manager. */
16095
+ readonly manager?: ManagerInfo | null | undefined;
16096
+ /** Yield profile including trailing averages. */
16097
+ readonly apyProfile?: ApyProfile | undefined;
16098
+ /** Fee split. */
16099
+ readonly fee?: FeeInfo | undefined;
16100
+ /** Liquidity profile. */
16101
+ readonly liquidityProfile?: LiquidityProfile | undefined;
16102
+ /** Risk signals. */
16103
+ readonly riskSignals?: RiskSignals | undefined;
16104
+ /** @deprecated use {@link EarnOpportunityBase.address} */
16105
+ readonly vaultAddress: string;
16106
+ /** @deprecated use {@link ApyProfile.current} via apyProfile */
15342
16107
  readonly currentApy: number;
15343
- /** Native APY excluding reward incentives. */
16108
+ /** @deprecated use {@link ApyProfile.native} via apyProfile */
15344
16109
  readonly nativeApy: number;
15345
- /** Vault fee as a decimal (e.g., 0.05 = 5%). */
16110
+ /** @deprecated use {@link FeeInfo.performance} via fee */
15346
16111
  readonly vaultFee: number;
15347
- /** Reward tokens distributed by this vault. */
15348
- readonly rewards: readonly VaultRewardInfo[];
15349
- /** Collateral markets backing this vault. */
15350
- readonly collateral: readonly CollateralInfo[];
15351
- /** Total value deposited in base-unit amount form. */
16112
+ /** @deprecated use {@link LiquidityProfile.totalDeposits} via liquidityProfile */
15352
16113
  readonly totalDeposits: Amount;
15353
- /** Available liquidity in the vault. */
16114
+ /** @deprecated use {@link LiquidityProfile.available} via liquidityProfile */
15354
16115
  readonly liquidity: Amount;
15355
- /** Current vault status. */
16116
+ /** @deprecated use {@link LiquidityProfile.status} via liquidityProfile */
15356
16117
  readonly status: 'active' | 'low_liquidity';
15357
- /** Whether the vault is on Circle's curated Circle-guarded list. */
16118
+ /** @deprecated use {@link RiskSignals.circleSentinel} via riskSignals */
15358
16119
  readonly circleGuarded: boolean;
15359
- /** Morpho protocol warnings for this vault. */
16120
+ /** @deprecated use {@link RiskSignals.warnings} via riskSignals */
15360
16121
  readonly warnings?: readonly VaultWarning[] | undefined;
15361
- /** Circle-specific warnings (e.g., unsupported reward protocol). */
16122
+ /** @deprecated use {@link RiskSignals.earnKitWarnings} via riskSignals */
15362
16123
  readonly earnKitWarnings?: readonly string[] | undefined;
15363
16124
  }
16125
+ /**
16126
+ * A yield-bearing vault opportunity (`productType: 'vault'`).
16127
+ *
16128
+ * Carries the universal {@link EarnOpportunityBase} facets plus the
16129
+ * vault-specific `collateral` markets.
16130
+ *
16131
+ * @example
16132
+ * ```typescript
16133
+ * const vault: VaultOpportunity = {
16134
+ * productType: 'vault',
16135
+ * address: '0x8eB67A509616cd6A7c1B3c8C21D48FF57df3d458',
16136
+ * chain: 'Arc_Testnet',
16137
+ * name: 'Steakhouse USDC',
16138
+ * protocol: 'MORPHO',
16139
+ * asset: 'USDC',
16140
+ * assetAddress: '0x3600000000000000000000000000000000000000',
16141
+ * asOf: '2026-06-23T18:00:00Z',
16142
+ * manager: { name: 'Steakhouse', address: '0x...', type: 'curator' },
16143
+ * apyProfile: { current: 0.085, native: 0.071, d7: 0.082, d30: 0.079, d90: 0.081, rewardShare: 0.16 },
16144
+ * fee: { performance: 0.1, management: null },
16145
+ * liquidityProfile: {
16146
+ * totalDeposits: Amount.fromJSON({ raw: '15000000000000', decimals: 6 }),
16147
+ * available: Amount.fromJSON({ raw: '5000000000000', decimals: 6 }),
16148
+ * totalSupply: Amount.fromJSON({ raw: '14950000000000000000', decimals: 18 }),
16149
+ * status: 'active',
16150
+ * },
16151
+ * riskSignals: { circleSentinel: true, warnings: [], earnKitWarnings: [] },
16152
+ * rewards: [{ token: 'MORPHO', tokenAddress: '0x...', apy: 0.0075 }],
16153
+ * collateral: [{ asset: 'cbBTC', assetAddress: '0x...', lltv: 0.86, supplyUsd: 50000000.25, allocationPct: 0.6 }],
16154
+ * // deprecated flat aliases (dual-emitted during migration)
16155
+ * vaultAddress: '0x8eB67A509616cd6A7c1B3c8C21D48FF57df3d458',
16156
+ * currentApy: 0.085,
16157
+ * nativeApy: 0.071,
16158
+ * vaultFee: 0.1,
16159
+ * totalDeposits: Amount.fromJSON({ raw: '15000000000000', decimals: 6 }),
16160
+ * liquidity: Amount.fromJSON({ raw: '5000000000000', decimals: 6 }),
16161
+ * status: 'active',
16162
+ * circleGuarded: true,
16163
+ * }
16164
+ * ```
16165
+ */
16166
+ interface VaultOpportunity extends EarnOpportunityBase {
16167
+ /**
16168
+ * Universal discriminator identifying the opportunity shape.
16169
+ *
16170
+ * Optional for now — a backend that predates the field omits it, matching
16171
+ * the other optional facets — so this release stays source-compatible for
16172
+ * code that constructs the type. A future release makes it required once
16173
+ * every backend emits it. Always present on responses from an emitting
16174
+ * backend; narrow on it before reading product-specific fields.
16175
+ */
16176
+ readonly productType?: 'vault';
16177
+ /** Collateral markets backing this vault. */
16178
+ readonly collateral: readonly CollateralInfo[];
16179
+ }
16180
+ /**
16181
+ * A yield opportunity available through the earn service.
16182
+ *
16183
+ * Modeled as a discriminated union on `productType` over a shared base.
16184
+ * Only the `vault` variant ships today; additional product types (e.g.
16185
+ * `lending_market`, `rwa_token`) are added as additive union members.
16186
+ */
16187
+ type EarnOpportunity = VaultOpportunity;
15364
16188
  /**
15365
16189
  * Per-vault error from a batch vault lookup.
15366
16190
  *
@@ -15526,10 +16350,11 @@ interface AssetAmount {
15526
16350
  /**
15527
16351
  * Optional category tag for the amount.
15528
16352
  *
15529
- * Present on fee entries to identify the kind of fee for cross-chain
15530
- * deposit quotes this is the source-fee item type (e.g. `'FORWARD'`,
15531
- * `'PRE_FINALITY'`). Omitted when the amount has no meaningful category
15532
- * (plain deposit/withdrawal/share/reward amounts).
16353
+ * Present on fee entries to identify the kind of fee. For cross-chain deposit
16354
+ * quotes this is the source-fee item type (e.g. `'FORWARD'`,
16355
+ * `'PRE_FINALITY'`), and for withdrawal quotes this can identify Circle fees
16356
+ * (e.g. `'circle'`). Omitted when the amount has no meaningful
16357
+ * category (plain deposit/withdrawal/share/reward amounts).
15533
16358
  */
15534
16359
  readonly type?: string | undefined;
15535
16360
  /**
@@ -15539,6 +16364,14 @@ interface AssetAmount {
15539
16364
  */
15540
16365
  readonly status?: string | undefined;
15541
16366
  }
16367
+ /**
16368
+ * Source-fee quote expiry metadata returned by bridge prepare.
16369
+ *
16370
+ * `TIMESTAMP` expiries use an ISO-8601 UTC `expiresAt`; `BLOCK_NUMBER`
16371
+ * expiries use a source-chain `expiresAtBlock`, with an optional ISO-8601 UTC
16372
+ * `blockEstimatedAt` for when that block estimate was produced.
16373
+ */
16374
+ type EarnBridgeQuoteExpiry = Readonly<Exclude<z.infer<typeof bridgeQuoteExpirySchema>, undefined>>;
15542
16375
  /**
15543
16376
  * Result of a deposit operation returned by
15544
16377
  * {@link EarningProvider.deposit}.
@@ -15639,6 +16472,13 @@ interface EarnCrossChainDepositResult {
15639
16472
  * @example '2026-05-19T00:00:00Z'
15640
16473
  */
15641
16474
  readonly expiresAt: string;
16475
+ /** ISO-8601 UTC timestamp at which the source-fee quote was issued. */
16476
+ readonly quoteIssuedAt?: string | undefined;
16477
+ /**
16478
+ * Optional source-fee quote expiry metadata for display and refresh UX.
16479
+ * This deadline is independent of the prepared-bundle `expiresAt` above.
16480
+ */
16481
+ readonly quoteExpiry?: EarnBridgeQuoteExpiry | undefined;
15642
16482
  }
15643
16483
  /**
15644
16484
  * Status of one hop (source relay or destination mint) of a cross-chain
@@ -16115,27 +16955,21 @@ interface DepositQuoteInfo {
16115
16955
  */
16116
16956
  readonly fees: readonly AssetAmount[];
16117
16957
  /**
16118
- * Estimated native gas fees for the transactions needed to deposit
16119
- * (e.g. token approval and the deposit itself).
16958
+ * Estimated native gas fees for the transactions needed to deposit (e.g.
16959
+ * token approval and the deposit itself).
16120
16960
  *
16121
16961
  * Optional so that custom {@link EarningProvider} implementations are not
16122
16962
  * required to produce gas estimates. The bundled Earn Service provider
16123
- * always populates this with one entry per transaction in the flow. When an
16124
- * individual estimate cannot be produced, that entry is still present with
16125
- * `fees` set to `null` and `error` describing why — so a non-empty array
16126
- * does not imply every estimate succeeded; inspect each entry's `fees`.
16127
- *
16128
- * The number of entries depends on where estimation stopped: when the flow
16129
- * fails before the approval step is examined, a single entry named after
16130
- * the main action is returned. Look entries up by `name`, not by index.
16131
- *
16132
- * Each estimate simulates the transaction against current chain state.
16133
- * When a token approval is still pending (typically a first-time deposit),
16134
- * the deposit simulation reverts because the allowance is not yet in
16135
- * place, so the deposit entry resolves with `fees: null` while the
16136
- * approval entry still carries a real estimate. Render a fallback (e.g.
16137
- * "available after approval") for that case rather than treating it as an
16138
- * error.
16963
+ * populates this from the server-side estimate returned on the quote, with
16964
+ * one entry per action. Empty for cross-chain quotes, which resolve no
16965
+ * single source chain.
16966
+ *
16967
+ * Each entry is the Earn Service's estimate for that action, so a pending
16968
+ * token approval no longer causes the deposit entry to fail. An entry may
16969
+ * still carry `fees: null` with an `error` when the service could not
16970
+ * estimate it, so a non-empty array does not imply every estimate
16971
+ * succeeded — inspect each entry's `fees` and look entries up by `name`,
16972
+ * not by index.
16139
16973
  */
16140
16974
  readonly gasFees?: readonly EarnGasFeeEstimate$1[] | undefined;
16141
16975
  }
@@ -16168,29 +17002,29 @@ interface WithdrawalQuoteInfo {
16168
17002
  * available balance and quoted withdrawal in a single round-trip.
16169
17003
  */
16170
17004
  readonly maxWithdrawable: AssetAmount;
16171
- /** Fees applied to the withdrawal. */
17005
+ /**
17006
+ * Fees applied to the withdrawal.
17007
+ *
17008
+ * Circle fees are returned with `type: 'circle'` so callers can distinguish
17009
+ * them from untyped plain fees and native gas estimates.
17010
+ */
16172
17011
  readonly fees: readonly AssetAmount[];
16173
17012
  /**
16174
- * Estimated native gas fees for the transactions needed to withdraw.
17013
+ * Estimated native gas fees for the transactions needed to withdraw (e.g.
17014
+ * vault-share approval and the withdrawal itself).
16175
17015
  *
16176
17016
  * Optional so that custom {@link EarningProvider} implementations are not
16177
17017
  * required to produce gas estimates. The bundled Earn Service provider
16178
- * always populates this with one entry per transaction in the flow. When an
16179
- * individual estimate cannot be produced, that entry is still present with
16180
- * `fees` set to `null` and `error` describing why — so a non-empty array
16181
- * does not imply every estimate succeeded; inspect each entry's `fees`.
16182
- *
16183
- * The number of entries depends on where estimation stopped: when the flow
16184
- * fails before the approval step is examined, a single entry named after
16185
- * the main action is returned. Look entries up by `name`, not by index.
16186
- *
16187
- * Each estimate simulates the transaction against current chain state.
16188
- * When a vault-share approval is still pending (typically the first
16189
- * withdrawal from a vault), the withdrawal simulation reverts because the
16190
- * allowance is not yet in place, so the withdrawal entry resolves with
16191
- * `fees: null` while the approval entry still carries a real estimate.
16192
- * Render a fallback (e.g. "available after approval") for that case
16193
- * rather than treating it as an error.
17018
+ * populates this from the server-side estimate returned on the quote, with
17019
+ * one entry per action. Empty for cross-chain quotes, which resolve no
17020
+ * single source chain.
17021
+ *
17022
+ * Each entry is the Earn Service's estimate for that action, so a pending
17023
+ * vault-share approval no longer causes the withdrawal entry to fail. An
17024
+ * entry may still carry `fees: null` with an `error` when the service could
17025
+ * not estimate it, so a non-empty array does not imply every estimate
17026
+ * succeeded — inspect each entry's `fees` and look entries up by `name`,
17027
+ * not by index.
16194
17028
  */
16195
17029
  readonly gasFees?: readonly EarnGasFeeEstimate$1[] | undefined;
16196
17030
  /**
@@ -16223,16 +17057,13 @@ interface ClaimRewardsQuoteInfo {
16223
17057
  /** Reward tokens available for claiming. */
16224
17058
  readonly rewards: readonly AssetAmount[];
16225
17059
  /**
16226
- * Estimated native gas fees for claiming rewards. Empty when there are no
16227
- * rewards to claim.
17060
+ * Estimated native gas fees for claiming rewards.
16228
17061
  *
16229
17062
  * Optional so that custom {@link EarningProvider} implementations are not
16230
- * required to produce gas estimates. Otherwise the bundled Earn Service
16231
- * provider populates this with one entry per claim transaction; when an
16232
- * estimate cannot be produced, that entry is still present with `fees` set
16233
- * to `null` and `error` describing why — so a non-empty array does not imply
16234
- * every estimate succeeded; inspect each entry's `fees`. Look entries up by
16235
- * `name`, not by index.
17063
+ * required to produce gas estimates. The bundled Earn Service provider does
17064
+ * not return a gas estimate for claim-rewards quotes, so this is always
17065
+ * empty (`[]`); it is retained for API symmetry with the deposit and
17066
+ * withdrawal quotes.
16236
17067
  */
16237
17068
  readonly gasFees?: readonly EarnGasFeeEstimate$1[] | undefined;
16238
17069
  }
@@ -16243,8 +17074,8 @@ interface ClaimRewardsQuoteInfo {
16243
17074
  * `vaults` while per-vault failures are in `errors`.
16244
17075
  */
16245
17076
  interface GetVaultsResult {
16246
- /** Successfully resolved vault information. */
16247
- readonly vaults: readonly VaultInfo[];
17077
+ /** Successfully resolved opportunities. */
17078
+ readonly vaults: readonly EarnOpportunity[];
16248
17079
  /** Per-vault errors for failed lookups. */
16249
17080
  readonly errors: readonly VaultError[];
16250
17081
  }
@@ -16297,7 +17128,7 @@ interface ExploreVaultsPagination {
16297
17128
  */
16298
17129
  interface ExploreVaultsResult {
16299
17130
  /** Vaults matching the query, in the requested sort order. */
16300
- readonly vaults: readonly VaultInfo[];
17131
+ readonly vaults: readonly EarnOpportunity[];
16301
17132
  /** Pagination metadata for the query. */
16302
17133
  readonly pagination: ExploreVaultsPagination;
16303
17134
  }
@@ -16953,10 +17784,6 @@ declare class EarnServiceProvider implements EarningProvider {
16953
17784
  supportsRetry(error: unknown): boolean;
16954
17785
  /** {@inheritdoc} */
16955
17786
  retry(error: unknown): Promise<EarnDepositOutcome | EarnWithdrawResult | ClaimRewardsResult>;
16956
- private gasEstimateFailure;
16957
- private estimateDepositQuoteGasFees;
16958
- private estimateWithdrawalQuoteGasFees;
16959
- private estimateClaimRewardsQuoteGasFees;
16960
17787
  /** {@inheritdoc} */
16961
17788
  getDepositQuote<T extends AdapterCapabilities>(params: GetDepositQuoteServiceParams<T>): Promise<DepositQuoteInfo>;
16962
17789
  /** {@inheritdoc} */
@@ -17547,12 +18374,42 @@ type EarnAssetAmount = Omit<AssetAmount, 'amount'> & {
17547
18374
  /** Token amount in human-readable decimal format. */
17548
18375
  readonly amount: string;
17549
18376
  };
17550
- /** Vault information returned by the SDK. */
17551
- type EarnVaultInfo = Omit<VaultInfo, 'totalDeposits' | 'liquidity'> & {
18377
+ /**
18378
+ * Distributive `Omit` over a union.
18379
+ *
18380
+ * A plain `Omit<Union, K>` is not distributive: `keyof (A | B)` collapses to
18381
+ * the shared keys, dropping every variant-specific field and the discriminant
18382
+ * narrowing. Distributing over each member preserves the union.
18383
+ */
18384
+ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
18385
+ /** Liquidity profile returned by the SDK with amounts as decimal strings. */
18386
+ type EarnLiquidityProfile = Omit<LiquidityProfile, 'totalDeposits' | 'available' | 'totalSupply'> & {
18387
+ /** Total value deposited in human-readable decimal format. */
18388
+ readonly totalDeposits: string;
18389
+ /** Available liquidity in human-readable decimal format. */
18390
+ readonly available: string;
18391
+ /** Outstanding vault share tokens (ERC4626 totalSupply) in decimal format. */
18392
+ readonly totalSupply: string;
18393
+ };
18394
+ /**
18395
+ * Vault information returned by the SDK.
18396
+ *
18397
+ * Derived with a distributive `Omit` so each opportunity variant keeps its
18398
+ * product-specific fields and the `productType` discriminant.
18399
+ */
18400
+ type EarnVaultInfo = DistributiveOmit<EarnOpportunity, 'totalDeposits' | 'liquidity' | 'liquidityProfile'> & {
17552
18401
  /** Total value deposited in human-readable decimal format. */
17553
18402
  readonly totalDeposits: string;
17554
18403
  /** Available liquidity in the vault in human-readable decimal format. */
17555
18404
  readonly liquidity: string;
18405
+ /**
18406
+ * Liquidity profile with amounts as human-readable decimal strings.
18407
+ *
18408
+ * Optional during the expand/contract migration window: a backend that
18409
+ * predates the nested facets omits it, so it is absent until the response
18410
+ * carries it.
18411
+ */
18412
+ readonly liquidityProfile?: EarnLiquidityProfile;
17556
18413
  };
17557
18414
  /** Result of a batch vault lookup. */
17558
18415
  type EarnGetVaultsResult = Omit<GetVaultsResult, 'vaults'> & {
@@ -18755,22 +19612,27 @@ declare const getVaultsParamsSchema: z.ZodObject<{
18755
19612
  v1: z.ZodOptional<z.ZodObject<{
18756
19613
  wallet: z.ZodString;
18757
19614
  minter: z.ZodString;
19615
+ depositForHandler: z.ZodOptional<z.ZodString>;
18758
19616
  }, "strict", z.ZodTypeAny, {
18759
19617
  wallet: string;
18760
19618
  minter: string;
19619
+ depositForHandler?: string | undefined;
18761
19620
  }, {
18762
19621
  wallet: string;
18763
19622
  minter: string;
19623
+ depositForHandler?: string | undefined;
18764
19624
  }>>;
18765
19625
  }, "strict", z.ZodTypeAny, {
18766
19626
  v1?: {
18767
19627
  wallet: string;
18768
19628
  minter: string;
19629
+ depositForHandler?: string | undefined;
18769
19630
  } | undefined;
18770
19631
  }, {
18771
19632
  v1?: {
18772
19633
  wallet: string;
18773
19634
  minter: string;
19635
+ depositForHandler?: string | undefined;
18774
19636
  } | undefined;
18775
19637
  }>;
18776
19638
  forwarderSupported: z.ZodObject<{
@@ -18789,6 +19651,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
18789
19651
  v1?: {
18790
19652
  wallet: string;
18791
19653
  minter: string;
19654
+ depositForHandler?: string | undefined;
18792
19655
  } | undefined;
18793
19656
  };
18794
19657
  forwarderSupported: {
@@ -18801,6 +19664,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
18801
19664
  v1?: {
18802
19665
  wallet: string;
18803
19666
  minter: string;
19667
+ depositForHandler?: string | undefined;
18804
19668
  } | undefined;
18805
19669
  };
18806
19670
  forwarderSupported: {
@@ -18839,6 +19703,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
18839
19703
  v1?: {
18840
19704
  wallet: string;
18841
19705
  minter: string;
19706
+ depositForHandler?: string | undefined;
18842
19707
  } | undefined;
18843
19708
  };
18844
19709
  forwarderSupported: {
@@ -18874,6 +19739,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
18874
19739
  v1?: {
18875
19740
  wallet: string;
18876
19741
  minter: string;
19742
+ depositForHandler?: string | undefined;
18877
19743
  } | undefined;
18878
19744
  };
18879
19745
  forwarderSupported: {
@@ -18921,22 +19787,27 @@ declare const getVaultsParamsSchema: z.ZodObject<{
18921
19787
  v1: z.ZodOptional<z.ZodObject<{
18922
19788
  wallet: z.ZodString;
18923
19789
  minter: z.ZodString;
19790
+ depositForHandler: z.ZodOptional<z.ZodString>;
18924
19791
  }, "strict", z.ZodTypeAny, {
18925
19792
  wallet: string;
18926
19793
  minter: string;
19794
+ depositForHandler?: string | undefined;
18927
19795
  }, {
18928
19796
  wallet: string;
18929
19797
  minter: string;
19798
+ depositForHandler?: string | undefined;
18930
19799
  }>>;
18931
19800
  }, "strict", z.ZodTypeAny, {
18932
19801
  v1?: {
18933
19802
  wallet: string;
18934
19803
  minter: string;
19804
+ depositForHandler?: string | undefined;
18935
19805
  } | undefined;
18936
19806
  }, {
18937
19807
  v1?: {
18938
19808
  wallet: string;
18939
19809
  minter: string;
19810
+ depositForHandler?: string | undefined;
18940
19811
  } | undefined;
18941
19812
  }>;
18942
19813
  forwarderSupported: z.ZodObject<{
@@ -18955,6 +19826,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
18955
19826
  v1?: {
18956
19827
  wallet: string;
18957
19828
  minter: string;
19829
+ depositForHandler?: string | undefined;
18958
19830
  } | undefined;
18959
19831
  };
18960
19832
  forwarderSupported: {
@@ -18967,6 +19839,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
18967
19839
  v1?: {
18968
19840
  wallet: string;
18969
19841
  minter: string;
19842
+ depositForHandler?: string | undefined;
18970
19843
  } | undefined;
18971
19844
  };
18972
19845
  forwarderSupported: {
@@ -19003,6 +19876,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19003
19876
  v1?: {
19004
19877
  wallet: string;
19005
19878
  minter: string;
19879
+ depositForHandler?: string | undefined;
19006
19880
  } | undefined;
19007
19881
  };
19008
19882
  forwarderSupported: {
@@ -19037,6 +19911,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19037
19911
  v1?: {
19038
19912
  wallet: string;
19039
19913
  minter: string;
19914
+ depositForHandler?: string | undefined;
19040
19915
  } | undefined;
19041
19916
  };
19042
19917
  forwarderSupported: {
@@ -19072,6 +19947,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19072
19947
  v1?: {
19073
19948
  wallet: string;
19074
19949
  minter: string;
19950
+ depositForHandler?: string | undefined;
19075
19951
  } | undefined;
19076
19952
  };
19077
19953
  forwarderSupported: {
@@ -19106,6 +19982,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19106
19982
  v1?: {
19107
19983
  wallet: string;
19108
19984
  minter: string;
19985
+ depositForHandler?: string | undefined;
19109
19986
  } | undefined;
19110
19987
  };
19111
19988
  forwarderSupported: {
@@ -19141,6 +20018,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19141
20018
  v1?: {
19142
20019
  wallet: string;
19143
20020
  minter: string;
20021
+ depositForHandler?: string | undefined;
19144
20022
  } | undefined;
19145
20023
  };
19146
20024
  forwarderSupported: {
@@ -19175,6 +20053,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19175
20053
  v1?: {
19176
20054
  wallet: string;
19177
20055
  minter: string;
20056
+ depositForHandler?: string | undefined;
19178
20057
  } | undefined;
19179
20058
  };
19180
20059
  forwarderSupported: {
@@ -19213,6 +20092,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19213
20092
  v1?: {
19214
20093
  wallet: string;
19215
20094
  minter: string;
20095
+ depositForHandler?: string | undefined;
19216
20096
  } | undefined;
19217
20097
  };
19218
20098
  forwarderSupported: {
@@ -19247,6 +20127,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19247
20127
  v1?: {
19248
20128
  wallet: string;
19249
20129
  minter: string;
20130
+ depositForHandler?: string | undefined;
19250
20131
  } | undefined;
19251
20132
  };
19252
20133
  forwarderSupported: {
@@ -19285,6 +20166,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19285
20166
  v1?: {
19286
20167
  wallet: string;
19287
20168
  minter: string;
20169
+ depositForHandler?: string | undefined;
19288
20170
  } | undefined;
19289
20171
  };
19290
20172
  forwarderSupported: {
@@ -19319,6 +20201,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19319
20201
  v1?: {
19320
20202
  wallet: string;
19321
20203
  minter: string;
20204
+ depositForHandler?: string | undefined;
19322
20205
  } | undefined;
19323
20206
  };
19324
20207
  forwarderSupported: {
@@ -19366,6 +20249,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19366
20249
  v1?: {
19367
20250
  wallet: string;
19368
20251
  minter: string;
20252
+ depositForHandler?: string | undefined;
19369
20253
  } | undefined;
19370
20254
  };
19371
20255
  forwarderSupported: {
@@ -19400,6 +20284,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19400
20284
  v1?: {
19401
20285
  wallet: string;
19402
20286
  minter: string;
20287
+ depositForHandler?: string | undefined;
19403
20288
  } | undefined;
19404
20289
  };
19405
20290
  forwarderSupported: {
@@ -19443,6 +20328,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19443
20328
  v1?: {
19444
20329
  wallet: string;
19445
20330
  minter: string;
20331
+ depositForHandler?: string | undefined;
19446
20332
  } | undefined;
19447
20333
  };
19448
20334
  forwarderSupported: {
@@ -19477,6 +20363,7 @@ declare const getVaultsParamsSchema: z.ZodObject<{
19477
20363
  v1?: {
19478
20364
  wallet: string;
19479
20365
  minter: string;
20366
+ depositForHandler?: string | undefined;
19480
20367
  } | undefined;
19481
20368
  };
19482
20369
  forwarderSupported: {
@@ -19546,22 +20433,27 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19546
20433
  v1: z.ZodOptional<z.ZodObject<{
19547
20434
  wallet: z.ZodString;
19548
20435
  minter: z.ZodString;
20436
+ depositForHandler: z.ZodOptional<z.ZodString>;
19549
20437
  }, "strict", z.ZodTypeAny, {
19550
20438
  wallet: string;
19551
20439
  minter: string;
20440
+ depositForHandler?: string | undefined;
19552
20441
  }, {
19553
20442
  wallet: string;
19554
20443
  minter: string;
20444
+ depositForHandler?: string | undefined;
19555
20445
  }>>;
19556
20446
  }, "strict", z.ZodTypeAny, {
19557
20447
  v1?: {
19558
20448
  wallet: string;
19559
20449
  minter: string;
20450
+ depositForHandler?: string | undefined;
19560
20451
  } | undefined;
19561
20452
  }, {
19562
20453
  v1?: {
19563
20454
  wallet: string;
19564
20455
  minter: string;
20456
+ depositForHandler?: string | undefined;
19565
20457
  } | undefined;
19566
20458
  }>;
19567
20459
  forwarderSupported: z.ZodObject<{
@@ -19580,6 +20472,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19580
20472
  v1?: {
19581
20473
  wallet: string;
19582
20474
  minter: string;
20475
+ depositForHandler?: string | undefined;
19583
20476
  } | undefined;
19584
20477
  };
19585
20478
  forwarderSupported: {
@@ -19592,6 +20485,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19592
20485
  v1?: {
19593
20486
  wallet: string;
19594
20487
  minter: string;
20488
+ depositForHandler?: string | undefined;
19595
20489
  } | undefined;
19596
20490
  };
19597
20491
  forwarderSupported: {
@@ -19630,6 +20524,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19630
20524
  v1?: {
19631
20525
  wallet: string;
19632
20526
  minter: string;
20527
+ depositForHandler?: string | undefined;
19633
20528
  } | undefined;
19634
20529
  };
19635
20530
  forwarderSupported: {
@@ -19665,6 +20560,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19665
20560
  v1?: {
19666
20561
  wallet: string;
19667
20562
  minter: string;
20563
+ depositForHandler?: string | undefined;
19668
20564
  } | undefined;
19669
20565
  };
19670
20566
  forwarderSupported: {
@@ -19712,22 +20608,27 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19712
20608
  v1: z.ZodOptional<z.ZodObject<{
19713
20609
  wallet: z.ZodString;
19714
20610
  minter: z.ZodString;
20611
+ depositForHandler: z.ZodOptional<z.ZodString>;
19715
20612
  }, "strict", z.ZodTypeAny, {
19716
20613
  wallet: string;
19717
20614
  minter: string;
20615
+ depositForHandler?: string | undefined;
19718
20616
  }, {
19719
20617
  wallet: string;
19720
20618
  minter: string;
20619
+ depositForHandler?: string | undefined;
19721
20620
  }>>;
19722
20621
  }, "strict", z.ZodTypeAny, {
19723
20622
  v1?: {
19724
20623
  wallet: string;
19725
20624
  minter: string;
20625
+ depositForHandler?: string | undefined;
19726
20626
  } | undefined;
19727
20627
  }, {
19728
20628
  v1?: {
19729
20629
  wallet: string;
19730
20630
  minter: string;
20631
+ depositForHandler?: string | undefined;
19731
20632
  } | undefined;
19732
20633
  }>;
19733
20634
  forwarderSupported: z.ZodObject<{
@@ -19746,6 +20647,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19746
20647
  v1?: {
19747
20648
  wallet: string;
19748
20649
  minter: string;
20650
+ depositForHandler?: string | undefined;
19749
20651
  } | undefined;
19750
20652
  };
19751
20653
  forwarderSupported: {
@@ -19758,6 +20660,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19758
20660
  v1?: {
19759
20661
  wallet: string;
19760
20662
  minter: string;
20663
+ depositForHandler?: string | undefined;
19761
20664
  } | undefined;
19762
20665
  };
19763
20666
  forwarderSupported: {
@@ -19794,6 +20697,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19794
20697
  v1?: {
19795
20698
  wallet: string;
19796
20699
  minter: string;
20700
+ depositForHandler?: string | undefined;
19797
20701
  } | undefined;
19798
20702
  };
19799
20703
  forwarderSupported: {
@@ -19828,6 +20732,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19828
20732
  v1?: {
19829
20733
  wallet: string;
19830
20734
  minter: string;
20735
+ depositForHandler?: string | undefined;
19831
20736
  } | undefined;
19832
20737
  };
19833
20738
  forwarderSupported: {
@@ -19863,6 +20768,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19863
20768
  v1?: {
19864
20769
  wallet: string;
19865
20770
  minter: string;
20771
+ depositForHandler?: string | undefined;
19866
20772
  } | undefined;
19867
20773
  };
19868
20774
  forwarderSupported: {
@@ -19897,6 +20803,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19897
20803
  v1?: {
19898
20804
  wallet: string;
19899
20805
  minter: string;
20806
+ depositForHandler?: string | undefined;
19900
20807
  } | undefined;
19901
20808
  };
19902
20809
  forwarderSupported: {
@@ -19932,6 +20839,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19932
20839
  v1?: {
19933
20840
  wallet: string;
19934
20841
  minter: string;
20842
+ depositForHandler?: string | undefined;
19935
20843
  } | undefined;
19936
20844
  };
19937
20845
  forwarderSupported: {
@@ -19966,6 +20874,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
19966
20874
  v1?: {
19967
20875
  wallet: string;
19968
20876
  minter: string;
20877
+ depositForHandler?: string | undefined;
19969
20878
  } | undefined;
19970
20879
  };
19971
20880
  forwarderSupported: {
@@ -20017,6 +20926,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
20017
20926
  v1?: {
20018
20927
  wallet: string;
20019
20928
  minter: string;
20929
+ depositForHandler?: string | undefined;
20020
20930
  } | undefined;
20021
20931
  };
20022
20932
  forwarderSupported: {
@@ -20051,6 +20961,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
20051
20961
  v1?: {
20052
20962
  wallet: string;
20053
20963
  minter: string;
20964
+ depositForHandler?: string | undefined;
20054
20965
  } | undefined;
20055
20966
  };
20056
20967
  forwarderSupported: {
@@ -20098,6 +21009,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
20098
21009
  v1?: {
20099
21010
  wallet: string;
20100
21011
  minter: string;
21012
+ depositForHandler?: string | undefined;
20101
21013
  } | undefined;
20102
21014
  };
20103
21015
  forwarderSupported: {
@@ -20132,6 +21044,7 @@ declare const exploreVaultsParamsSchema: z.ZodObject<{
20132
21044
  v1?: {
20133
21045
  wallet: string;
20134
21046
  minter: string;
21047
+ depositForHandler?: string | undefined;
20135
21048
  } | undefined;
20136
21049
  };
20137
21050
  forwarderSupported: {
@@ -20208,22 +21121,27 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20208
21121
  v1: z.ZodOptional<z.ZodObject<{
20209
21122
  wallet: z.ZodString;
20210
21123
  minter: z.ZodString;
21124
+ depositForHandler: z.ZodOptional<z.ZodString>;
20211
21125
  }, "strict", z.ZodTypeAny, {
20212
21126
  wallet: string;
20213
21127
  minter: string;
21128
+ depositForHandler?: string | undefined;
20214
21129
  }, {
20215
21130
  wallet: string;
20216
21131
  minter: string;
21132
+ depositForHandler?: string | undefined;
20217
21133
  }>>;
20218
21134
  }, "strict", z.ZodTypeAny, {
20219
21135
  v1?: {
20220
21136
  wallet: string;
20221
21137
  minter: string;
21138
+ depositForHandler?: string | undefined;
20222
21139
  } | undefined;
20223
21140
  }, {
20224
21141
  v1?: {
20225
21142
  wallet: string;
20226
21143
  minter: string;
21144
+ depositForHandler?: string | undefined;
20227
21145
  } | undefined;
20228
21146
  }>;
20229
21147
  forwarderSupported: z.ZodObject<{
@@ -20242,6 +21160,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20242
21160
  v1?: {
20243
21161
  wallet: string;
20244
21162
  minter: string;
21163
+ depositForHandler?: string | undefined;
20245
21164
  } | undefined;
20246
21165
  };
20247
21166
  forwarderSupported: {
@@ -20254,6 +21173,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20254
21173
  v1?: {
20255
21174
  wallet: string;
20256
21175
  minter: string;
21176
+ depositForHandler?: string | undefined;
20257
21177
  } | undefined;
20258
21178
  };
20259
21179
  forwarderSupported: {
@@ -20292,6 +21212,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20292
21212
  v1?: {
20293
21213
  wallet: string;
20294
21214
  minter: string;
21215
+ depositForHandler?: string | undefined;
20295
21216
  } | undefined;
20296
21217
  };
20297
21218
  forwarderSupported: {
@@ -20327,6 +21248,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20327
21248
  v1?: {
20328
21249
  wallet: string;
20329
21250
  minter: string;
21251
+ depositForHandler?: string | undefined;
20330
21252
  } | undefined;
20331
21253
  };
20332
21254
  forwarderSupported: {
@@ -20374,22 +21296,27 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20374
21296
  v1: z.ZodOptional<z.ZodObject<{
20375
21297
  wallet: z.ZodString;
20376
21298
  minter: z.ZodString;
21299
+ depositForHandler: z.ZodOptional<z.ZodString>;
20377
21300
  }, "strict", z.ZodTypeAny, {
20378
21301
  wallet: string;
20379
21302
  minter: string;
21303
+ depositForHandler?: string | undefined;
20380
21304
  }, {
20381
21305
  wallet: string;
20382
21306
  minter: string;
21307
+ depositForHandler?: string | undefined;
20383
21308
  }>>;
20384
21309
  }, "strict", z.ZodTypeAny, {
20385
21310
  v1?: {
20386
21311
  wallet: string;
20387
21312
  minter: string;
21313
+ depositForHandler?: string | undefined;
20388
21314
  } | undefined;
20389
21315
  }, {
20390
21316
  v1?: {
20391
21317
  wallet: string;
20392
21318
  minter: string;
21319
+ depositForHandler?: string | undefined;
20393
21320
  } | undefined;
20394
21321
  }>;
20395
21322
  forwarderSupported: z.ZodObject<{
@@ -20408,6 +21335,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20408
21335
  v1?: {
20409
21336
  wallet: string;
20410
21337
  minter: string;
21338
+ depositForHandler?: string | undefined;
20411
21339
  } | undefined;
20412
21340
  };
20413
21341
  forwarderSupported: {
@@ -20420,6 +21348,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20420
21348
  v1?: {
20421
21349
  wallet: string;
20422
21350
  minter: string;
21351
+ depositForHandler?: string | undefined;
20423
21352
  } | undefined;
20424
21353
  };
20425
21354
  forwarderSupported: {
@@ -20456,6 +21385,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20456
21385
  v1?: {
20457
21386
  wallet: string;
20458
21387
  minter: string;
21388
+ depositForHandler?: string | undefined;
20459
21389
  } | undefined;
20460
21390
  };
20461
21391
  forwarderSupported: {
@@ -20490,6 +21420,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20490
21420
  v1?: {
20491
21421
  wallet: string;
20492
21422
  minter: string;
21423
+ depositForHandler?: string | undefined;
20493
21424
  } | undefined;
20494
21425
  };
20495
21426
  forwarderSupported: {
@@ -20525,6 +21456,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20525
21456
  v1?: {
20526
21457
  wallet: string;
20527
21458
  minter: string;
21459
+ depositForHandler?: string | undefined;
20528
21460
  } | undefined;
20529
21461
  };
20530
21462
  forwarderSupported: {
@@ -20559,6 +21491,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20559
21491
  v1?: {
20560
21492
  wallet: string;
20561
21493
  minter: string;
21494
+ depositForHandler?: string | undefined;
20562
21495
  } | undefined;
20563
21496
  };
20564
21497
  forwarderSupported: {
@@ -20594,6 +21527,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20594
21527
  v1?: {
20595
21528
  wallet: string;
20596
21529
  minter: string;
21530
+ depositForHandler?: string | undefined;
20597
21531
  } | undefined;
20598
21532
  };
20599
21533
  forwarderSupported: {
@@ -20628,6 +21562,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20628
21562
  v1?: {
20629
21563
  wallet: string;
20630
21564
  minter: string;
21565
+ depositForHandler?: string | undefined;
20631
21566
  } | undefined;
20632
21567
  };
20633
21568
  forwarderSupported: {
@@ -20679,6 +21614,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20679
21614
  v1?: {
20680
21615
  wallet: string;
20681
21616
  minter: string;
21617
+ depositForHandler?: string | undefined;
20682
21618
  } | undefined;
20683
21619
  };
20684
21620
  forwarderSupported: {
@@ -20713,6 +21649,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20713
21649
  v1?: {
20714
21650
  wallet: string;
20715
21651
  minter: string;
21652
+ depositForHandler?: string | undefined;
20716
21653
  } | undefined;
20717
21654
  };
20718
21655
  forwarderSupported: {
@@ -20759,6 +21696,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20759
21696
  v1?: {
20760
21697
  wallet: string;
20761
21698
  minter: string;
21699
+ depositForHandler?: string | undefined;
20762
21700
  } | undefined;
20763
21701
  };
20764
21702
  forwarderSupported: {
@@ -20793,6 +21731,7 @@ declare const exploreVaultsIteratorParamsSchema: z.ZodObject<Omit<{
20793
21731
  v1?: {
20794
21732
  wallet: string;
20795
21733
  minter: string;
21734
+ depositForHandler?: string | undefined;
20796
21735
  } | undefined;
20797
21736
  };
20798
21737
  forwarderSupported: {
@@ -20914,22 +21853,27 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
20914
21853
  v1: z.ZodOptional<z.ZodObject<{
20915
21854
  wallet: z.ZodString;
20916
21855
  minter: z.ZodString;
21856
+ depositForHandler: z.ZodOptional<z.ZodString>;
20917
21857
  }, "strict", z.ZodTypeAny, {
20918
21858
  wallet: string;
20919
21859
  minter: string;
21860
+ depositForHandler?: string | undefined;
20920
21861
  }, {
20921
21862
  wallet: string;
20922
21863
  minter: string;
21864
+ depositForHandler?: string | undefined;
20923
21865
  }>>;
20924
21866
  }, "strict", z.ZodTypeAny, {
20925
21867
  v1?: {
20926
21868
  wallet: string;
20927
21869
  minter: string;
21870
+ depositForHandler?: string | undefined;
20928
21871
  } | undefined;
20929
21872
  }, {
20930
21873
  v1?: {
20931
21874
  wallet: string;
20932
21875
  minter: string;
21876
+ depositForHandler?: string | undefined;
20933
21877
  } | undefined;
20934
21878
  }>;
20935
21879
  forwarderSupported: z.ZodObject<{
@@ -20948,6 +21892,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
20948
21892
  v1?: {
20949
21893
  wallet: string;
20950
21894
  minter: string;
21895
+ depositForHandler?: string | undefined;
20951
21896
  } | undefined;
20952
21897
  };
20953
21898
  forwarderSupported: {
@@ -20960,6 +21905,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
20960
21905
  v1?: {
20961
21906
  wallet: string;
20962
21907
  minter: string;
21908
+ depositForHandler?: string | undefined;
20963
21909
  } | undefined;
20964
21910
  };
20965
21911
  forwarderSupported: {
@@ -20998,6 +21944,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
20998
21944
  v1?: {
20999
21945
  wallet: string;
21000
21946
  minter: string;
21947
+ depositForHandler?: string | undefined;
21001
21948
  } | undefined;
21002
21949
  };
21003
21950
  forwarderSupported: {
@@ -21033,6 +21980,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21033
21980
  v1?: {
21034
21981
  wallet: string;
21035
21982
  minter: string;
21983
+ depositForHandler?: string | undefined;
21036
21984
  } | undefined;
21037
21985
  };
21038
21986
  forwarderSupported: {
@@ -21080,22 +22028,27 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21080
22028
  v1: z.ZodOptional<z.ZodObject<{
21081
22029
  wallet: z.ZodString;
21082
22030
  minter: z.ZodString;
22031
+ depositForHandler: z.ZodOptional<z.ZodString>;
21083
22032
  }, "strict", z.ZodTypeAny, {
21084
22033
  wallet: string;
21085
22034
  minter: string;
22035
+ depositForHandler?: string | undefined;
21086
22036
  }, {
21087
22037
  wallet: string;
21088
22038
  minter: string;
22039
+ depositForHandler?: string | undefined;
21089
22040
  }>>;
21090
22041
  }, "strict", z.ZodTypeAny, {
21091
22042
  v1?: {
21092
22043
  wallet: string;
21093
22044
  minter: string;
22045
+ depositForHandler?: string | undefined;
21094
22046
  } | undefined;
21095
22047
  }, {
21096
22048
  v1?: {
21097
22049
  wallet: string;
21098
22050
  minter: string;
22051
+ depositForHandler?: string | undefined;
21099
22052
  } | undefined;
21100
22053
  }>;
21101
22054
  forwarderSupported: z.ZodObject<{
@@ -21114,6 +22067,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21114
22067
  v1?: {
21115
22068
  wallet: string;
21116
22069
  minter: string;
22070
+ depositForHandler?: string | undefined;
21117
22071
  } | undefined;
21118
22072
  };
21119
22073
  forwarderSupported: {
@@ -21126,6 +22080,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21126
22080
  v1?: {
21127
22081
  wallet: string;
21128
22082
  minter: string;
22083
+ depositForHandler?: string | undefined;
21129
22084
  } | undefined;
21130
22085
  };
21131
22086
  forwarderSupported: {
@@ -21162,6 +22117,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21162
22117
  v1?: {
21163
22118
  wallet: string;
21164
22119
  minter: string;
22120
+ depositForHandler?: string | undefined;
21165
22121
  } | undefined;
21166
22122
  };
21167
22123
  forwarderSupported: {
@@ -21196,6 +22152,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21196
22152
  v1?: {
21197
22153
  wallet: string;
21198
22154
  minter: string;
22155
+ depositForHandler?: string | undefined;
21199
22156
  } | undefined;
21200
22157
  };
21201
22158
  forwarderSupported: {
@@ -21231,6 +22188,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21231
22188
  v1?: {
21232
22189
  wallet: string;
21233
22190
  minter: string;
22191
+ depositForHandler?: string | undefined;
21234
22192
  } | undefined;
21235
22193
  };
21236
22194
  forwarderSupported: {
@@ -21265,6 +22223,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21265
22223
  v1?: {
21266
22224
  wallet: string;
21267
22225
  minter: string;
22226
+ depositForHandler?: string | undefined;
21268
22227
  } | undefined;
21269
22228
  };
21270
22229
  forwarderSupported: {
@@ -21300,6 +22259,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21300
22259
  v1?: {
21301
22260
  wallet: string;
21302
22261
  minter: string;
22262
+ depositForHandler?: string | undefined;
21303
22263
  } | undefined;
21304
22264
  };
21305
22265
  forwarderSupported: {
@@ -21334,6 +22294,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21334
22294
  v1?: {
21335
22295
  wallet: string;
21336
22296
  minter: string;
22297
+ depositForHandler?: string | undefined;
21337
22298
  } | undefined;
21338
22299
  };
21339
22300
  forwarderSupported: {
@@ -21372,6 +22333,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21372
22333
  v1?: {
21373
22334
  wallet: string;
21374
22335
  minter: string;
22336
+ depositForHandler?: string | undefined;
21375
22337
  } | undefined;
21376
22338
  };
21377
22339
  forwarderSupported: {
@@ -21406,6 +22368,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21406
22368
  v1?: {
21407
22369
  wallet: string;
21408
22370
  minter: string;
22371
+ depositForHandler?: string | undefined;
21409
22372
  } | undefined;
21410
22373
  };
21411
22374
  forwarderSupported: {
@@ -21444,6 +22407,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21444
22407
  v1?: {
21445
22408
  wallet: string;
21446
22409
  minter: string;
22410
+ depositForHandler?: string | undefined;
21447
22411
  } | undefined;
21448
22412
  };
21449
22413
  forwarderSupported: {
@@ -21478,6 +22442,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21478
22442
  v1?: {
21479
22443
  wallet: string;
21480
22444
  minter: string;
22445
+ depositForHandler?: string | undefined;
21481
22446
  } | undefined;
21482
22447
  };
21483
22448
  forwarderSupported: {
@@ -21530,6 +22495,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21530
22495
  v1?: {
21531
22496
  wallet: string;
21532
22497
  minter: string;
22498
+ depositForHandler?: string | undefined;
21533
22499
  } | undefined;
21534
22500
  };
21535
22501
  forwarderSupported: {
@@ -21564,6 +22530,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21564
22530
  v1?: {
21565
22531
  wallet: string;
21566
22532
  minter: string;
22533
+ depositForHandler?: string | undefined;
21567
22534
  } | undefined;
21568
22535
  };
21569
22536
  forwarderSupported: {
@@ -21612,6 +22579,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21612
22579
  v1?: {
21613
22580
  wallet: string;
21614
22581
  minter: string;
22582
+ depositForHandler?: string | undefined;
21615
22583
  } | undefined;
21616
22584
  };
21617
22585
  forwarderSupported: {
@@ -21646,6 +22614,7 @@ declare const anyDepositParamsSchema: z.ZodUnion<[z.ZodObject<{
21646
22614
  v1?: {
21647
22615
  wallet: string;
21648
22616
  minter: string;
22617
+ depositForHandler?: string | undefined;
21649
22618
  } | undefined;
21650
22619
  };
21651
22620
  forwarderSupported: {
@@ -23609,14 +24578,17 @@ type TokenAddress = string & {
23609
24578
  /**
23610
24579
  * Known token aliases supported by AppKit.
23611
24580
  *
23612
- * These aliases map to chain-specific token addresses and have dedicated
23613
- * transfer actions in the adapter layer.
24581
+ * These aliases map to chain-specific token addresses. `USDC`, `USDT`, and
24582
+ * `NATIVE` have dedicated transfer actions in the adapter layer. `EURC` has no
24583
+ * dedicated action — it resolves to the chain's `eurcAddress` and is sent via
24584
+ * the generic token transfer action, so it is only supported on chains where
24585
+ * `eurcAddress` is set.
23614
24586
  *
23615
24587
  * @remarks
23616
24588
  * For swap operations, see {@link SupportedToken} in SwapKit which supports
23617
- * additional tokens (EURC, DAI, USDE, PYUSD).
24589
+ * additional tokens (DAI, USDE, PYUSD).
23618
24590
  */
23619
- type TokenAlias = 'USDC' | 'USDT' | 'NATIVE';
24591
+ type TokenAlias = 'USDC' | 'USDT' | 'NATIVE' | 'EURC';
23620
24592
  /**
23621
24593
  * Operation types that support the `getFee`/`getFeeRecipient` hooks.
23622
24594
  */
@@ -23745,26 +24717,28 @@ interface AppKitContext {
23745
24717
  * Event handlers registered for AppKit operations.
23746
24718
  *
23747
24719
  * This property stores event handlers that are registered via the AppKit's
23748
- * `on()` method. Handlers are grouped by operation type. The current runtime
23749
- * bucket is `bridge`, and the context can add more operation buckets as AppKit
23750
- * wires action handlers for additional kits.
24720
+ * `on()` method. Handlers are grouped by operation type. The runtime buckets
24721
+ * are `bridge` and `earn`; the context can add more operation buckets as
24722
+ * AppKit wires action handlers for additional kits.
23751
24723
  *
23752
- * Within each operation bucket, handlers are keyed by action name (for example,
23753
- * `bridge.approve`) or `*` for wildcard handlers. Each action can have multiple
23754
- * handlers registered, allowing multiple subscribers to listen to the same event.
24724
+ * Within each operation bucket, handlers are keyed by action name (for
24725
+ * example, `bridge.approve` or `earn.deposit`) or `*` for wildcard handlers.
24726
+ * Each action can have multiple handlers registered, allowing multiple
24727
+ * subscribers to listen to the same event.
23755
24728
  *
23756
24729
  * The handlers are stored in the context to allow deferred registration with
23757
- * underlying operation kits, enabling a clean separation between event registration
23758
- * and operation execution.
24730
+ * underlying operation kits, enabling a clean separation between event
24731
+ * registration and operation execution.
23759
24732
  *
23760
24733
  * @example
23761
24734
  * ```typescript
23762
24735
  * const context = createContext()
23763
24736
  * // Handlers registered via kit.on() are stored by operation type
23764
- * // Bridge handlers are registered with BridgeKit when bridge() is executed
24737
+ * // Bridge handlers are registered with BridgeKit when bridge() runs
24738
+ * // Earn handlers are registered with EarnKit when earn operations run
23765
24739
  * ```
23766
24740
  */
23767
- actions: Record<'bridge', Record<string, ((payload: unknown) => void)[]>>;
24741
+ actions: Record<'bridge' | 'earn', Record<string, ((payload: unknown) => void)[]>>;
23768
24742
  /**
23769
24743
  * Disable error telemetry for all sub-kits.
23770
24744
  *
@@ -23775,11 +24749,22 @@ interface AppKitContext {
23775
24749
  * @defaultValue false
23776
24750
  */
23777
24751
  disableErrorReporting?: boolean;
24752
+ /**
24753
+ * Custom HTTP headers forwarded with the underlying CCTP provider's
24754
+ * attestation (Iris) API requests made by bridge operations.
24755
+ *
24756
+ * @remarks
24757
+ * Headers are merged on top of the SDK defaults (such as `Content-Type`)
24758
+ * rather than replacing them. The header is forwarded as-is to Circle's API;
24759
+ * the SDK does not interpret it.
24760
+ */
24761
+ headers?: Record<string, string>;
23778
24762
  }
23779
24763
  /**
23780
24764
  * Earn operation namespace exposed as `kit.earn`.
23781
24765
  *
23782
24766
  * Mirrors the operations currently available from `@circle-fin/earn-kit`.
24767
+ * Step events use the AppKit event API (`kit.on('earn.*')` / `kit.on('*')`).
23783
24768
  *
23784
24769
  * @example
23785
24770
  * ```typescript
@@ -24027,6 +25012,40 @@ interface AppKitEarnOperations {
24027
25012
  * @internal
24028
25013
  */
24029
25014
  getClaimRewardsQuote<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities>(params: GetClaimRewardsQuoteParams<TFromAdapterCapabilities>): Promise<EarnClaimRewardsQuoteInfo>;
25015
+ /**
25016
+ * Resume a multi-phase earn operation that previously failed.
25017
+ *
25018
+ * Pass the {@link KitError} caught from `deposit`, `withdraw`, or
25019
+ * `claimRewards`. The error carries the original inputs and step
25020
+ * progress, so completed phases (for example a successful token
25021
+ * approval) can be skipped. Call `isRetryableError(error)` first.
25022
+ *
25023
+ * @remarks
25024
+ * Retry re-fetches execution params and may re-submit the execute
25025
+ * transaction. Treat this as best-effort recovery: if a prior attempt
25026
+ * broadcast execute but failed before observing the receipt, that
25027
+ * transaction may still be in flight.
25028
+ *
25029
+ * @param error - The error caught from a previous multi-phase earn operation
25030
+ * @returns Promise resolving to the result of the resumed operation
25031
+ * @throws If the error is not retryable or lacks earn retry context
25032
+ *
25033
+ * @example
25034
+ * ```typescript
25035
+ * import { AppKit, isRetryableError } from '@circle-fin/app-kit'
25036
+ *
25037
+ * const kit = new AppKit()
25038
+ *
25039
+ * try {
25040
+ * await kit.earn.deposit(params)
25041
+ * } catch (error) {
25042
+ * if (isRetryableError(error)) {
25043
+ * const result = await kit.earn.retry(error)
25044
+ * }
25045
+ * }
25046
+ * ```
25047
+ */
25048
+ retry(error: unknown): Promise<EarnDepositOutcome | EarnWithdrawResult | EarnClaimRewardsResult>;
24030
25049
  }
24031
25050
  /**
24032
25051
  * Type for event handler functions that can be registered with the AppKit.
@@ -24073,7 +25092,7 @@ type ActionHandler<T extends {
24073
25092
  * When `to` is a `string`, the address must be a valid address. When `to` is an
24074
25093
  * {@link Adapter}, the recipient is derived from the adapter's active account.
24075
25094
  *
24076
- * The `token` field accepts both supported token aliases ('USDC', 'USDT', 'NATIVE') and custom token
25095
+ * The `token` field accepts both supported token aliases ('USDC', 'USDT', 'NATIVE', 'EURC') and custom token
24077
25096
  * contract addresses.
24078
25097
  *
24079
25098
  * @example
@@ -24113,7 +25132,8 @@ interface SendParams {
24113
25132
  * If omitted, the provider will use 'USDC' by default.
24114
25133
  *
24115
25134
  * Supports both known aliases and custom token contract addresses:
24116
- * - Known aliases: 'USDC', 'USDT', 'NATIVE'
25135
+ * - Known aliases: 'USDC', 'USDT', 'NATIVE', 'EURC' ('EURC' requires the
25136
+ * chain to have an `eurcAddress` configured)
24117
25137
  * - Custom token addresses: EVM addresses or Solana SPL token mint addresses
24118
25138
  *
24119
25139
  * @example
@@ -24173,21 +25193,31 @@ type AppKitBridgeActions = PrefixActions<'bridge', DefaultBridgeKitActions>;
24173
25193
  * to namespace them within the AppKit event system.
24174
25194
  */
24175
25195
  type AppKitUnifiedBalanceActions = PrefixActions<'unifiedBalance', GatewayV1Actions>;
25196
+ /**
25197
+ * Prefixed earn actions for AppKit.
25198
+ *
25199
+ * Earn step events are exposed under the `earn.` namespace (for example
25200
+ * `earn.deposit`, `earn.approve`, `earn.withdraw`) so they can be
25201
+ * subscribed to via `kit.on()` alongside bridge and unified balance
25202
+ * events.
25203
+ */
25204
+ type AppKitEarnActions = PrefixActions<'earn', EarnActions>;
24176
25205
  /**
24177
25206
  * Union of all AppKit action names.
24178
25207
  */
24179
- type AppKitActionName = keyof AppKitBridgeActions | keyof AppKitUnifiedBalanceActions;
25208
+ type AppKitActionName = keyof AppKitBridgeActions | keyof AppKitUnifiedBalanceActions | keyof AppKitEarnActions;
24180
25209
  /**
24181
25210
  * All actions available in AppKit.
24182
25211
  */
24183
- type AppKitActions = AppKitBridgeActions & AppKitUnifiedBalanceActions;
25212
+ type AppKitActions = AppKitBridgeActions & AppKitUnifiedBalanceActions & AppKitEarnActions;
24184
25213
 
24185
25214
  /**
24186
25215
  * Parameters for creating a AppKit context.
24187
25216
  *
24188
25217
  * This type allows partial customization of the context while ensuring
24189
25218
  * that all required properties have sensible defaults. Users can override
24190
- * specific methods while keeping the rest intact.
25219
+ * specific methods while keeping the rest intact. Action handler buckets
25220
+ * may also be supplied partially; missing buckets default to empty maps.
24191
25221
  *
24192
25222
  * @example
24193
25223
  * ```typescript
@@ -24199,7 +25229,9 @@ type AppKitActions = AppKitBridgeActions & AppKitUnifiedBalanceActions;
24199
25229
  * })
24200
25230
  * ```
24201
25231
  */
24202
- type CreateContextParams = Partial<AppKitContext>;
25232
+ type CreateContextParams = Omit<Partial<AppKitContext>, 'actions'> & {
25233
+ actions?: Partial<AppKitContext['actions']>;
25234
+ };
24203
25235
 
24204
25236
  /**
24205
25237
  * Destination for a Gateway spend (mint) operation.
@@ -24577,10 +25609,13 @@ interface ResolvedSpendParams<TFromAdapterCapabilities extends AdapterCapabiliti
24577
25609
  */
24578
25610
  type SpendFeeFunction = (params: ResolvedSpendParams) => Promise<string> | string;
24579
25611
  /**
24580
- * Function that resolves the fee recipient address for a given source chain.
24581
- * Called once per source chain in a multi-chain spend.
25612
+ * Function that resolves the fee recipient address for a spend.
25613
+ * Called once per spend, against the resolved **destination** chain
25614
+ * every fee burn intent in a spend mints to that single chain
25615
+ * regardless of which source chain(s) funded it, so only one
25616
+ * recipient address (valid on the destination chain) is ever needed.
24582
25617
  */
24583
- type SpendFeeRecipientFunction = (feePayoutChain: ChainDefinition, params: ResolvedSpendParams) => Promise<string> | string;
25618
+ type SpendFeeRecipientFunction = (destinationChain: ChainDefinition, params: ResolvedSpendParams) => Promise<string> | string;
24584
25619
  /**
24585
25620
  * Policy for computing and routing custom developer fees.
24586
25621
  *
@@ -24590,11 +25625,54 @@ type SpendFeeRecipientFunction = (feePayoutChain: ChainDefinition, params: Resol
24590
25625
  * Fields that only exist after resolution (e.g. per-source allocations)
24591
25626
  * may be `undefined`. Implementations should only rely on top-level
24592
25627
  * fields such as `to`, `token`, and `amount`.
25628
+ *
25629
+ * @remarks
25630
+ * `resolveFeeRecipientAddress` is optional when you configure
25631
+ * {@link UnifiedBalanceKit.setFeeRecipients} instead — the declarative
25632
+ * map takes priority over this callback when both are present. Provide
25633
+ * exactly one of the two; a policy with neither throws at spend time.
24593
25634
  */
24594
25635
  interface CustomFeePolicy {
24595
25636
  computeFee: SpendFeeFunction;
24596
- resolveFeeRecipientAddress: SpendFeeRecipientFunction;
25637
+ resolveFeeRecipientAddress?: SpendFeeRecipientFunction;
24597
25638
  }
25639
+ /**
25640
+ * Chain type group used to key {@link FeeRecipientsConfig}.
25641
+ *
25642
+ * @remarks
25643
+ * Only `'evm'` and `'solana'` are live today (the only chain types the
25644
+ * kit's provider currently supports). This is deliberately a narrow
25645
+ * subset of `@core/chains`' broader `ChainType` union rather than a
25646
+ * hardcoded two-field struct, so that support for additional non-EVM
25647
+ * chain types (e.g. Stellar, Starknet) can be added later by adding
25648
+ * new union members here — no restructuring of `FeeRecipientsConfig`
25649
+ * or its consumers required.
25650
+ */
25651
+ type FeeRecipientChainType = 'evm' | 'solana';
25652
+ /**
25653
+ * Declarative map of fee recipient addresses, keyed by chain type.
25654
+ *
25655
+ * @remarks
25656
+ * Set via {@link UnifiedBalanceKit.setFeeRecipients}. At spend time the
25657
+ * kit resolves the spend's destination chain to its
25658
+ * {@link FeeRecipientChainType} and looks up the matching entry —
25659
+ * exactly one recipient is used per spend (see
25660
+ * {@link SpendFeeRecipientFunction}). Provide entries for every chain
25661
+ * type you expect to spend to; a spend to a destination chain type
25662
+ * with no matching entry throws before any fee collection is
25663
+ * attempted.
25664
+ *
25665
+ * @example
25666
+ * ```typescript
25667
+ * import type { FeeRecipientsConfig } from '@circle-fin/unified-balance-kit'
25668
+ *
25669
+ * const feeRecipients: FeeRecipientsConfig = {
25670
+ * evm: '0x1234567890123456789012345678901234567890',
25671
+ * solana: '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
25672
+ * }
25673
+ * ```
25674
+ */
25675
+ type FeeRecipientsConfig = Partial<Record<FeeRecipientChainType, string>>;
24598
25676
  /**
24599
25677
  * Fee category describing the origin of a fee line item.
24600
25678
  *
@@ -25908,6 +26986,43 @@ declare class AppKitUnifiedBalance {
25908
26986
  * ```
25909
26987
  */
25910
26988
  removeCustomFeePolicy(): void;
26989
+ /**
26990
+ * Set a declarative fee recipient map, keyed by chain type.
26991
+ *
26992
+ * Once set, `spend()`/`estimateSpend()` resolve the fee recipient by
26993
+ * looking up the spend's destination chain type in this map — taking
26994
+ * priority over `customFeePolicy`'s `resolveFeeRecipientAddress`
26995
+ * callback.
26996
+ *
26997
+ * @remarks
26998
+ * This only controls which address a fee is sent to — it does not by
26999
+ * itself cause any fee to be charged. You still need
27000
+ * `setCustomFeePolicy`'s `computeFee` to determine the fee amount;
27001
+ * calling `setFeeRecipients` without ever calling `setCustomFeePolicy`
27002
+ * throws at spend time (there is no `computeFee` to determine an
27003
+ * amount).
27004
+ *
27005
+ * @param config - Fee recipient addresses keyed by chain type (e.g.
27006
+ * `{ evm: '0x...', solana: 'Sol...' }`).
27007
+ *
27008
+ * @example
27009
+ * ```typescript
27010
+ * kit.unifiedBalance.setFeeRecipients({
27011
+ * evm: '0x1234567890123456789012345678901234567890',
27012
+ * solana: '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
27013
+ * })
27014
+ * ```
27015
+ */
27016
+ setFeeRecipients(config: FeeRecipientsConfig): void;
27017
+ /**
27018
+ * Remove the declarative fee recipient map.
27019
+ *
27020
+ * @example
27021
+ * ```typescript
27022
+ * kit.unifiedBalance.removeFeeRecipients()
27023
+ * ```
27024
+ */
27025
+ removeFeeRecipients(): void;
25911
27026
  }
25912
27027
 
25913
27028
  interface DeveloperFeeHooks {
@@ -26306,7 +27421,8 @@ declare class AppKit {
26306
27421
  * or `'NOT_FOUND'`). Use {@link AppKit.waitForSwap} if you'd rather
26307
27422
  * not write the polling loop yourself.
26308
27423
  *
26309
- * @param params - `txHash`, `chainIn`, optional `chainOut`, and `kitKey`.
27424
+ * @param params - `txHash` and `chainIn`, plus optional `chainOut` and
27425
+ * `kitKey`.
26310
27426
  * @returns A snapshot of the swap's status at the time of the call.
26311
27427
  * @throws \{KitError\} If `chainIn` or `chainOut` is malformed.
26312
27428
  *
@@ -26418,7 +27534,7 @@ declare class AppKit {
26418
27534
  * translates to the chain's native sentinel address — `0xEee…` for EVM,
26419
27535
  * `1111…` for Solana — before querying the service.
26420
27536
  *
26421
- * @param params - `chain`, optional `tokens`, and `kitKey`.
27537
+ * @param params - `chain`, plus optional `tokens` and `kitKey`.
26422
27538
  * @returns A nested map of `[chain][address] → { priceUSD, fetchedAt }`.
26423
27539
  * @throws \{KitError\} If `chain` is malformed, `tokens` exceeds 100
26424
27540
  * entries, or any entry is neither a registered symbol nor a
@@ -26472,17 +27588,16 @@ declare class AppKit {
26472
27588
  /**
26473
27589
  * Register an event handler for a specific AppKit action.
26474
27590
  *
26475
- * Subscribe to events emitted during bridge or unified balance operations.
26476
- * Bridge events are prefixed with 'bridge.' and unified balance events
26477
- * with 'unifiedBalance.' to namespace them within the AppKit event system.
27591
+ * Subscribe to step events from bridge, earn, or unified balance
27592
+ * operations. Action names are namespaced: `bridge.*`, `earn.*`, and
27593
+ * `unifiedBalance.*`. Use `'*'` to receive every action.
26478
27594
  *
26479
- * Handlers receive strongly-typed payloads based on the action name. Multiple
26480
- * handlers can be registered for the same action, and all will be invoked when
26481
- * the action occurs. Use the wildcard '*' to listen to all actions.
27595
+ * Handlers receive strongly-typed payloads for the chosen action.
27596
+ * Multiple handlers may be registered for the same action.
26482
27597
  *
26483
27598
  * @typeParam K - The action name to listen for
26484
27599
  * @param action - The namespaced action name or '*' for all actions
26485
- * @param handler - Callback function to invoke when the action occurs
27600
+ * @param handler - Callback invoked when the action occurs
26486
27601
  *
26487
27602
  * @example
26488
27603
  * ```typescript
@@ -26495,6 +27610,11 @@ declare class AppKit {
26495
27610
  * console.log('Approval transaction:', payload.values.txHash)
26496
27611
  * })
26497
27612
  *
27613
+ * // Listen to earn deposit steps
27614
+ * kit.on('earn.deposit', (payload) => {
27615
+ * console.log('Earn deposit step:', payload.values.state)
27616
+ * })
27617
+ *
26498
27618
  * // Listen to unified balance action
26499
27619
  * kit.on('unifiedBalance.gateway.spend.succeeded', (payload) => {
26500
27620
  * console.log('Spend succeeded:', payload.data)
@@ -26539,6 +27659,16 @@ declare class AppKit {
26539
27659
  */
26540
27660
  off<K extends AppKitActionName>(action: K, handler: (payload: AppKitActions[K]) => void): void;
26541
27661
  off(action: '*', handler: (payload: AppKitActions[keyof AppKitActions]) => void): void;
27662
+ /**
27663
+ * Remove one handler from a deferred AppKit action bucket.
27664
+ *
27665
+ * Deletes the action key when its handler list becomes empty.
27666
+ *
27667
+ * @param handlers - Action bucket to update (`bridge` or `earn`)
27668
+ * @param action - Stored action key, including namespace or `*`
27669
+ * @param handler - Handler reference previously passed to {@link on}
27670
+ */
27671
+ private removeStoredActionHandler;
26542
27672
  }
26543
27673
 
26544
27674
  /**
@@ -26551,7 +27681,11 @@ declare class AppKit {
26551
27681
  * The type annotation `readonly TokenAlias[]` ensures this array stays in sync
26552
27682
  * with the TokenAlias type definition - TypeScript will enforce any changes.
26553
27683
  *
26554
- * For swap operations, additional tokens (EURC, DAI, USDE, PYUSD) are supported
27684
+ * `USDC`, `USDT`, and `NATIVE` map to dedicated adapter transfer actions.
27685
+ * `EURC` has no dedicated action — it resolves to the chain's `eurcAddress`
27686
+ * and uses the generic token transfer action (see {@link prepareSend}).
27687
+ *
27688
+ * For swap operations, additional tokens (DAI, USDE, PYUSD) are supported
26555
27689
  * via SwapKit's SupportedToken type.
26556
27690
  */
26557
27691
  declare const TOKEN_ALIASES: readonly TokenAlias[];
@@ -26562,7 +27696,7 @@ declare const TOKEN_ALIASES: readonly TokenAlias[];
26562
27696
  * or neither.
26563
27697
  */
26564
27698
  interface TokenValidationResult {
26565
- /** True if the token is a known alias (USDC, USDT, NATIVE) */
27699
+ /** True if the token is a known alias (USDC, USDT, NATIVE, EURC) */
26566
27700
  isAlias: boolean;
26567
27701
  /** True if the token is a valid address for the chain */
26568
27702
  isAddress: boolean;
@@ -26593,7 +27727,7 @@ declare function isTokenAlias(token: string): token is TokenAlias;
26593
27727
  * Type guard to check if a string is a valid token address for a chain.
26594
27728
  *
26595
27729
  * This function verifies that a token string is:
26596
- * 1. Not a known alias ('USDC', 'USDT', 'NATIVE')
27730
+ * 1. Not a known alias ('USDC', 'USDT', 'NATIVE', 'EURC')
26597
27731
  * 2. A valid address format for the specified chain
26598
27732
  *
26599
27733
  * Use this to narrow the type to `TokenAddress` in TypeScript.
@@ -26622,7 +27756,7 @@ declare function isTokenAddress(token: string, chain: ChainDefinition): token is
26622
27756
  * Validate and classify a token identifier.
26623
27757
  *
26624
27758
  * This function determines whether a token string is:
26625
- * 1. A known alias ('USDC', 'USDT', or 'NATIVE')
27759
+ * 1. A known alias ('USDC', 'USDT', 'NATIVE', or 'EURC')
26626
27760
  * 2. A valid token address for the given chain
26627
27761
  * 3. An invalid/unrecognized token identifier
26628
27762
  *
@@ -26654,4 +27788,4 @@ declare function isTokenAddress(token: string, chain: ChainDefinition): token is
26654
27788
  declare function validateToken(token: string, chain: ChainDefinition): TokenValidationResult;
26655
27789
 
26656
27790
  export { AppKit, AppKitUnifiedBalance, BalanceError, Blockchain, BridgeChain, EarnChain, EarnError, EarnKit, InputError, KitError, NetworkError, OnchainError, RateLimitError, RpcError, ServiceError, SwapChain, TOKEN_ALIASES, TransferSpeed, UnifiedBalanceChain, anyDepositParamsSchema, claimRewardsParamsSchema, createEarnKitContext, depositParamsSchema, claimRewards as earnClaimRewards, deposit as earnDeposit, exploreVaults as earnExploreVaults, exploreVaultsIterator as earnExploreVaultsIterator, getClaimRewardsQuote as earnGetClaimRewardsQuote, getCrossChainDepositStatus as earnGetCrossChainDepositStatus, getCrossChainDepositStatusOutcome as earnGetCrossChainDepositStatusOutcome, getDepositQuote as earnGetDepositQuote, getPosition as earnGetPosition, getSupportedChains as earnGetSupportedChains, getVaults as earnGetVaults, getWithdrawalQuote as earnGetWithdrawalQuote, waitForCrossChainDeposit as earnWaitForCrossChainDeposit, withdraw as earnWithdraw, exploreVaultsIteratorParamsSchema, exploreVaultsParamsSchema, getClaimRewardsQuoteParamsSchema, getCrossChainDepositStatusParamsSchema, getDepositQuoteParamsSchema, getErrorCode, getErrorMessage, getPositionParamsSchema, getTokenDecimals, getVaultsParamsSchema, getWithdrawalQuoteParamsSchema, isBalanceError, isFatalError, isInputError, isKitError, isNetworkError, isOnchainError, isRateLimitError, isRetryableError, isRpcError, isServiceError, isTerminalCrossChainDepositStatus as isTerminalEarnCrossChainDepositStatus, isTokenAddress, isTokenAlias, isUserCancellationError, setExternalPrefix, validateToken, waitForCrossChainDepositParamsSchema, withdrawParamsSchema };
26657
- export type { ActionHandler, AdapterContext, AllowanceStrategy$2 as AllowanceStrategy, AppKitActionName, AppKitActions, AppKitBridgeActions, AppKitConfig, AppKitContext, AppKitEarnOperations, AppKitUnifiedBalanceActions, BaseChainDefinition, BridgeConfig, CustomFeePolicy$2 as BridgeCustomFeePolicy, BridgeParams, BridgeResult, BridgeStep, CCTPConfig, CCTPMergedConfig, CCTPSplitConfig, ChainDefinition, Currency, DelegateStatus, DepositForParams, DepositParams, DepositResult, DeveloperFeeHooks, EVMChainDefinition, EarnAccruedRewardInfo, EarnAdapterContext, AnyDepositParams as EarnAnyDepositParams, EarnAssetAmount, EarnBridgeCctpStatus, EarnBridgeHopStatus, ClaimRewardsParams as EarnClaimRewardsParams, EarnClaimRewardsQuoteInfo, EarnClaimRewardsResult, EarnClaimedAmount, EarnClaimedRewardsResult, EarnConfig, EarnCrossChainDepositDestination, CrossChainDepositParams as EarnCrossChainDepositParams, EarnCrossChainDepositResult, EarnCrossChainDepositStatus, EarnCrossChainDepositWaitOutcome, EarnCrossChainDepositWaitResult, CrossChainGetDepositQuoteParams as EarnCrossChainGetDepositQuoteParams, EarnDepositOutcome, DepositParams$2 as EarnDepositParams, EarnDepositQuoteInfo, EarnDepositResult, ExploreVaultsIteratorParams as EarnExploreVaultsIteratorParams, ExploreVaultsPagination as EarnExploreVaultsPagination, ExploreVaultsParams as EarnExploreVaultsParams, EarnExploreVaultsResult, ExploreVaultsSortBy as EarnExploreVaultsSortBy, EarnGasFeeEstimate, EarnGasFeeEstimateBase, GetClaimRewardsQuoteParams as EarnGetClaimRewardsQuoteParams, GetCrossChainDepositStatusParams as EarnGetCrossChainDepositStatusParams, GetDepositQuoteParams as EarnGetDepositQuoteParams, GetPositionParams as EarnGetPositionParams, GetVaultsParams as EarnGetVaultsParams, EarnGetVaultsResult, GetWithdrawalQuoteParams as EarnGetWithdrawalQuoteParams, EarnKitConfig, EarnKitContext, EarnOperationParams, EarnPositionInfo, EarnPositionPnLInfo, EarningProvider as EarnProvider, SameChainDepositParams as EarnSameChainDepositParams, EarnSameChainDepositResult, SameChainGetDepositQuoteParams as EarnSameChainGetDepositQuoteParams, EarnServiceConfig, EarnVaultInfo, VaultQuery as EarnVaultQuery, WaitForCrossChainDepositParams as EarnWaitForCrossChainDepositParams, WithdrawParams as EarnWithdrawParams, EarnWithdrawResult, EarnWithdrawalQuoteInfo, ErrorDetails, EstimateResult$1 as EstimateResult, EstimateSpendResult, EstimatedGas, FeeOperationType, GetBalancesParams, GetBalancesResult, GetDelegateStatusParams, GetSupportedChainsOptions, GetSwapStatusParams, GetTokenRatesParams, GetTokenRatesResult, InitiateRemoveFundParams, InitiateRemoveFundResult, KitContractType, NonEVMChainDefinition, OperationParamsMap, OperationType, Recoverability, RemoveFundParams, RemoveFundResult, RetryContext, SendParams, SpendDestination, SpendParams, SpendResult, SwapConfig, CustomFeePolicy$1 as SwapCustomFeePolicy, SwapDestinationLeg, SwapEstimate, SwapFeeContext, SwapKitConfig, SwapKitContext, SwapParams, SwapProgress, SwapResult, SwapSourceLeg, SwapStatus, SwapStatusResult, SwapTerminalStatus, TokenInfo, TokenRate, UnifiedBalanceChainIdentifier, CustomFeePolicy as UnifiedBalanceCustomFeePolicy, UnifiedBalanceKitConfig, SupportedToken as UnifiedBalanceSupportedToken, UpdateDelegateParams, UpdateDelegateResult, VersionConfig, WaitForSwapDiscreteParams, WaitForSwapParams, WaitForSwapResultParams };
27791
+ export type { ActionHandler, AdapterContext, AllowanceStrategy$2 as AllowanceStrategy, AppKitActionName, AppKitActions, AppKitBridgeActions, AppKitConfig, AppKitContext, AppKitEarnActions, AppKitEarnOperations, AppKitUnifiedBalanceActions, BaseChainDefinition, BridgeConfig, CustomFeePolicy$2 as BridgeCustomFeePolicy, BridgeParams, BridgeResult, BridgeStep, CCTPConfig, CCTPMergedConfig, CCTPSplitConfig, ChainDefinition, Currency, DelegateStatus, DepositForParams, DepositParams, DepositResult, DeveloperFeeHooks, EVMChainDefinition, EarnAccruedRewardInfo, EarnAdapterContext, AnyDepositParams as EarnAnyDepositParams, EarnAssetAmount, EarnBridgeCctpStatus, EarnBridgeHopStatus, EarnBridgeQuoteExpiry, ClaimRewardsParams as EarnClaimRewardsParams, EarnClaimRewardsQuoteInfo, EarnClaimRewardsResult, EarnClaimedAmount, EarnClaimedRewardsResult, EarnConfig, EarnCrossChainDepositDestination, CrossChainDepositParams as EarnCrossChainDepositParams, EarnCrossChainDepositResult, EarnCrossChainDepositStatus, EarnCrossChainDepositWaitOutcome, EarnCrossChainDepositWaitResult, CrossChainGetDepositQuoteParams as EarnCrossChainGetDepositQuoteParams, EarnDepositOutcome, DepositParams$2 as EarnDepositParams, EarnDepositQuoteInfo, EarnDepositResult, ExploreVaultsIteratorParams as EarnExploreVaultsIteratorParams, ExploreVaultsPagination as EarnExploreVaultsPagination, ExploreVaultsParams as EarnExploreVaultsParams, EarnExploreVaultsResult, ExploreVaultsSortBy as EarnExploreVaultsSortBy, EarnGasFeeEstimate, EarnGasFeeEstimateBase, GetClaimRewardsQuoteParams as EarnGetClaimRewardsQuoteParams, GetCrossChainDepositStatusParams as EarnGetCrossChainDepositStatusParams, GetDepositQuoteParams as EarnGetDepositQuoteParams, GetPositionParams as EarnGetPositionParams, GetVaultsParams as EarnGetVaultsParams, EarnGetVaultsResult, GetWithdrawalQuoteParams as EarnGetWithdrawalQuoteParams, EarnKitConfig, EarnKitContext, EarnOperationParams, EarnPositionInfo, EarnPositionPnLInfo, EarningProvider as EarnProvider, SameChainDepositParams as EarnSameChainDepositParams, EarnSameChainDepositResult, SameChainGetDepositQuoteParams as EarnSameChainGetDepositQuoteParams, EarnServiceConfig, EarnVaultInfo, VaultQuery as EarnVaultQuery, WaitForCrossChainDepositParams as EarnWaitForCrossChainDepositParams, WithdrawParams as EarnWithdrawParams, EarnWithdrawResult, EarnWithdrawalQuoteInfo, ErrorDetails, EstimateResult$1 as EstimateResult, EstimateSpendResult, EstimatedGas, FeeOperationType, GetBalancesParams, GetBalancesResult, GetDelegateStatusParams, GetSupportedChainsOptions, GetSwapStatusParams, GetTokenRatesParams, GetTokenRatesResult, InitiateRemoveFundParams, InitiateRemoveFundResult, KitContractType, NonEVMChainDefinition, OperationParamsMap, OperationType, Recoverability, RemoveFundParams, RemoveFundResult, RetryContext, SendParams, SpendDestination, SpendParams, SpendResult, SwapConfig, CustomFeePolicy$1 as SwapCustomFeePolicy, SwapDestinationLeg, SwapEstimate, SwapFeeContext, SwapKitConfig, SwapKitContext, SwapParams, SwapProgress, SwapResult, SwapSourceLeg, SwapStatus, SwapStatusResult, SwapTerminalStatus, TokenInfo, TokenRate, UnifiedBalanceChainIdentifier, CustomFeePolicy as UnifiedBalanceCustomFeePolicy, FeeRecipientsConfig as UnifiedBalanceFeeRecipientsConfig, UnifiedBalanceKitConfig, SupportedToken as UnifiedBalanceSupportedToken, UpdateDelegateParams, UpdateDelegateResult, VersionConfig, WaitForSwapDiscreteParams, WaitForSwapParams, WaitForSwapResultParams };