@circle-fin/app-kit 1.13.0 → 1.14.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.
@@ -558,6 +558,19 @@ interface GatewayV1Contracts {
558
558
  * @example "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48"
559
559
  */
560
560
  depositForHandler?: string;
561
+ /**
562
+ * The address of the `GenericExecutor` contract.
563
+ *
564
+ * @description Optional. The contract that acts as `mintRecipient` and
565
+ * `destinationCaller` for the CCTP v2 prepaid FORWARD path. It receives the
566
+ * CCTP mint and calls {@link GatewayV1Contracts.depositForHandler} to
567
+ * complete the fast deposit into the {@link GatewayV1Contracts.wallet}.
568
+ * Present only on chains that are fast-deposit destinations; other Gateway
569
+ * chains omit it.
570
+ *
571
+ * @example "0xFa7be2f04F3Ad4ca969260729c6d45B5625984A7"
572
+ */
573
+ genericExecutor?: string;
561
574
  }
562
575
  /**
563
576
  * Versioned map of Gateway contract configurations.
@@ -746,6 +759,134 @@ declare enum Blockchain {
746
759
  ZKSync_Era = "ZKSync_Era",
747
760
  ZKSync_Sepolia = "ZKSync_Sepolia"
748
761
  }
762
+ /**
763
+ * Enumeration of blockchains that support cross-chain bridging via CCTPv2.
764
+ *
765
+ * The enum is derived from the full {@link Blockchain} enum but filtered to only
766
+ * include chains with active CCTPv2 support. When new chains gain CCTPv2 support,
767
+ * they are added to this enum.
768
+ *
769
+ * @enum
770
+ * @category Enums
771
+ *
772
+ * @remarks
773
+ * - This enum is the **canonical source** of bridging-supported chains.
774
+ * - Use this enum (or its string literals) in `kit.bridge()` calls for type safety.
775
+ * - Attempting to use a chain not in this enum will produce a TypeScript compile error.
776
+ *
777
+ * @example
778
+ * ```typescript
779
+ * import { BridgeKit, BridgeChain } from '@circle-fin/bridge-kit'
780
+ *
781
+ * const kit = new BridgeKit()
782
+ *
783
+ * // ✅ Valid - autocomplete suggests only supported chains
784
+ * await kit.bridge({
785
+ * from: { adapter, chain: BridgeChain.Ethereum },
786
+ * to: { adapter, chain: BridgeChain.Base },
787
+ * amount: '100'
788
+ * })
789
+ *
790
+ * // ✅ Also valid - string literals work with autocomplete
791
+ * await kit.bridge({
792
+ * from: { adapter, chain: 'Ethereum_Sepolia' },
793
+ * to: { adapter, chain: 'Base_Sepolia' },
794
+ * amount: '100'
795
+ * })
796
+ *
797
+ * // ❌ Compile error - Algorand is not in BridgeChain
798
+ * await kit.bridge({
799
+ * from: { adapter, chain: 'Algorand' }, // TypeScript error!
800
+ * to: { adapter, chain: 'Base' },
801
+ * amount: '100'
802
+ * })
803
+ * ```
804
+ *
805
+ * @see {@link Blockchain} for the complete list of all known blockchains.
806
+ * @see {@link BridgeChainIdentifier} for the type that accepts these values.
807
+ */
808
+ declare enum BridgeChain {
809
+ Arbitrum = "Arbitrum",
810
+ Avalanche = "Avalanche",
811
+ Base = "Base",
812
+ Codex = "Codex",
813
+ Cronos = "Cronos",
814
+ Edge = "Edge",
815
+ Ethereum = "Ethereum",
816
+ HyperEVM = "HyperEVM",
817
+ Injective = "Injective",
818
+ Ink = "Ink",
819
+ Linea = "Linea",
820
+ Monad = "Monad",
821
+ Morph = "Morph",
822
+ Optimism = "Optimism",
823
+ Pharos = "Pharos",
824
+ Plasma = "Plasma",
825
+ Plume = "Plume",
826
+ Polygon = "Polygon",
827
+ Sei = "Sei",
828
+ Solana = "Solana",
829
+ Sonic = "Sonic",
830
+ Unichain = "Unichain",
831
+ World_Chain = "World_Chain",
832
+ XDC = "XDC",
833
+ X_Layer = "X_Layer",
834
+ Arc_Testnet = "Arc_Testnet",
835
+ Arbitrum_Sepolia = "Arbitrum_Sepolia",
836
+ Avalanche_Fuji = "Avalanche_Fuji",
837
+ Base_Sepolia = "Base_Sepolia",
838
+ Codex_Testnet = "Codex_Testnet",
839
+ Cronos_Testnet = "Cronos_Testnet",
840
+ Edge_Testnet = "Edge_Testnet",
841
+ Ethereum_Sepolia = "Ethereum_Sepolia",
842
+ HyperEVM_Testnet = "HyperEVM_Testnet",
843
+ Injective_Testnet = "Injective_Testnet",
844
+ Ink_Testnet = "Ink_Testnet",
845
+ Linea_Sepolia = "Linea_Sepolia",
846
+ Monad_Testnet = "Monad_Testnet",
847
+ Morph_Testnet = "Morph_Testnet",
848
+ Optimism_Sepolia = "Optimism_Sepolia",
849
+ Pharos_Testnet = "Pharos_Testnet",
850
+ Plasma_Testnet = "Plasma_Testnet",
851
+ Plume_Testnet = "Plume_Testnet",
852
+ Polygon_Amoy_Testnet = "Polygon_Amoy_Testnet",
853
+ Sei_Testnet = "Sei_Testnet",
854
+ Solana_Devnet = "Solana_Devnet",
855
+ Sonic_Testnet = "Sonic_Testnet",
856
+ Unichain_Sepolia = "Unichain_Sepolia",
857
+ World_Chain_Sepolia = "World_Chain_Sepolia",
858
+ XDC_Apothem = "XDC_Apothem",
859
+ X_Layer_Testnet = "X_Layer_Testnet"
860
+ }
861
+ /**
862
+ * Type representing valid bridge chain identifiers.
863
+ *
864
+ * This type constrains chain parameters to only accept chains that support CCTPv2 bridging
865
+ *
866
+ * Accepts:
867
+ * - A {@link BridgeChain} enum value (e.g., `BridgeChain.Ethereum`)
868
+ * - A string literal matching a BridgeChain value (e.g., `'Ethereum'`)
869
+ * - A {@link ChainDefinition} object for a supported chain
870
+ *
871
+ * @example
872
+ * ```typescript
873
+ * import type { BridgeChainIdentifier } from '@circle-fin/bridge-kit'
874
+ * import { BridgeChain } from '@circle-fin/bridge-kit'
875
+ * import { Solana } from '@circle-fin/bridge-kit/chains'
876
+ *
877
+ * // All of these are valid BridgeChainIdentifier values:
878
+ * const chain1: BridgeChainIdentifier = BridgeChain.Ethereum
879
+ * const chain2: BridgeChainIdentifier = 'Base_Sepolia'
880
+ * const chain3: BridgeChainIdentifier = Solana // ChainDefinition
881
+ *
882
+ * // This will cause a TypeScript error:
883
+ * const chain4: BridgeChainIdentifier = 'Algorand' // Error!
884
+ * ```
885
+ *
886
+ * @see {@link BridgeChain} for the enum of supported chains.
887
+ * @see {@link ChainIdentifier} for the less restrictive type accepting all chains.
888
+ */
889
+ type BridgeChainIdentifier = ChainDefinition | BridgeChain | `${BridgeChain}`;
749
890
  /**
750
891
  * Enumeration of blockchains that support Gateway V1 operations
751
892
  * (deposit, spend, balance, delegate, removeFund).
@@ -4407,6 +4548,83 @@ interface DepositResult$1 {
4407
4548
  explorerUrl?: string;
4408
4549
  }
4409
4550
 
4551
+ /**
4552
+ * Fee category describing the origin of a fee line item.
4553
+ *
4554
+ * - `'provider'` — Fee charged by the cross-chain provider (e.g. protocol fee).
4555
+ * - `'gasFee'` — On-chain gas cost denominated in the transfer token (e.g. USDC).
4556
+ * - `'kit'` — Fee charged by the kit / developer integration.
4557
+ * - `'forwarder'` — Fee charged by Circle's Forwarding Service for automatic mint.
4558
+ */
4559
+ type FeeType = 'provider' | 'gasFee' | 'kit' | 'forwarder';
4560
+ /**
4561
+ * Per-chain breakdown of a fee amount.
4562
+ *
4563
+ * @example
4564
+ * ```typescript
4565
+ * import type { FeeAllocation } from '@core/types'
4566
+ * import { Blockchain } from '@core/chains'
4567
+ *
4568
+ * const allocation: FeeAllocation = {
4569
+ * chain: Blockchain.Ethereum,
4570
+ * amount: '0.00005',
4571
+ * }
4572
+ * ```
4573
+ */
4574
+ interface FeeAllocation {
4575
+ /** The chain to which this portion of the fee applies. */
4576
+ chain: Blockchain;
4577
+ /** The fee amount on this chain (human-readable decimal string). */
4578
+ amount: string;
4579
+ }
4580
+ /**
4581
+ * A single fee line item within an estimate.
4582
+ *
4583
+ * @remarks
4584
+ * Each entry describes a fee category (`type`), the token it is
4585
+ * denominated in, the aggregate `amount`, and an optional per-chain
4586
+ * `allocations` breakdown.
4587
+ *
4588
+ * @example
4589
+ * ```typescript
4590
+ * import type { FeeEntry } from '@core/types'
4591
+ * import { Blockchain } from '@core/chains'
4592
+ *
4593
+ * // Fee with per-chain allocation breakdown
4594
+ * const providerFee: FeeEntry = {
4595
+ * type: 'provider',
4596
+ * token: 'USDC',
4597
+ * amount: '0.00011',
4598
+ * allocations: [
4599
+ * { chain: Blockchain.Ethereum, amount: '0.00005' },
4600
+ * { chain: Blockchain.Polygon, amount: '0.00006' },
4601
+ * ],
4602
+ * }
4603
+ *
4604
+ * // Flat fee without allocations (e.g. forwarder)
4605
+ * const forwarderFee: FeeEntry = {
4606
+ * type: 'forwarder',
4607
+ * token: 'USDC',
4608
+ * amount: '0.005',
4609
+ * }
4610
+ * ```
4611
+ */
4612
+ interface FeeEntry {
4613
+ /** The category of this fee. */
4614
+ type: FeeType;
4615
+ /** The token in which this fee is denominated (e.g. `'USDC'`, `'ETH'`). */
4616
+ token: string;
4617
+ /** Aggregate fee amount (human-readable decimal string). */
4618
+ amount: string;
4619
+ /** Per-chain breakdown of the fee. Omitted for flat fees (e.g. forwarder). */
4620
+ allocations?: FeeAllocation[];
4621
+ /**
4622
+ * When `type === 'kit'`, the address that receives the kit fee.
4623
+ * Omitted for other fee types.
4624
+ */
4625
+ recipientAddress?: string;
4626
+ }
4627
+
4410
4628
  /**
4411
4629
  * Data payload for a single step in a spend operation.
4412
4630
  *
@@ -4766,7 +4984,7 @@ interface SpendResult$1 {
4766
4984
  * executed spend. Same shape as {@link EstimateSpendResult.fees}.
4767
4985
  * Omitted when using `config.retry` (no estimate was run).
4768
4986
  */
4769
- fees?: FeeEntry$1[];
4987
+ fees?: FeeEntry[];
4770
4988
  /**
4771
4989
  * Gateway transfer identifier. Present when `useForwarder` is enabled
4772
4990
  * and can be used to query transfer status via `GET /v1/transfer/{id}`.
@@ -4788,80 +5006,6 @@ interface SpendResult$1 {
4788
5006
  */
4789
5007
  steps?: SpendStep[];
4790
5008
  }
4791
- /**
4792
- * Fee category describing the origin of a fee line item.
4793
- *
4794
- * - `'provider'` — Fee charged by the cross-chain provider (e.g. protocol fee).
4795
- * - `'gasFee'` — On-chain gas cost denominated in the transfer token (e.g. USDC).
4796
- * - `'kit'` — Fee charged by the kit / developer integration.
4797
- * - `'forwarder'` — Fee charged by Circle's Forwarding Service for automatic mint.
4798
- */
4799
- type FeeType$1 = 'provider' | 'gasFee' | 'kit' | 'forwarder';
4800
- /**
4801
- * Per-chain breakdown of a fee amount.
4802
- *
4803
- * @example
4804
- * ```typescript
4805
- * import type { FeeAllocation } from '@circle-fin/provider-gateway-v1'
4806
- *
4807
- * const allocation: FeeAllocation = {
4808
- * chain: 'Ethereum',
4809
- * amount: '0.00005',
4810
- * }
4811
- * ```
4812
- */
4813
- interface FeeAllocation$1 {
4814
- /** The chain to which this portion of the fee applies. */
4815
- chain: Blockchain;
4816
- /** The fee amount on this chain (human-readable decimal string). */
4817
- amount: string;
4818
- }
4819
- /**
4820
- * A single fee line item within an estimate.
4821
- *
4822
- * @remarks
4823
- * Each entry describes a fee category (`type`), the token it is
4824
- * denominated in, the aggregate `amount`, and an optional per-chain
4825
- * `allocations` breakdown.
4826
- *
4827
- * @example
4828
- * ```typescript
4829
- * import type { FeeEntry } from '@circle-fin/provider-gateway-v1'
4830
- *
4831
- * // Fee with per-chain allocation breakdown
4832
- * const providerFee: FeeEntry = {
4833
- * type: 'provider',
4834
- * token: 'USDC',
4835
- * amount: '0.00011',
4836
- * allocations: [
4837
- * { chain: 'Ethereum', amount: '0.00005' },
4838
- * { chain: 'Polygon', amount: '0.00006' },
4839
- * ],
4840
- * }
4841
- *
4842
- * // Flat fee without allocations (e.g. forwarder)
4843
- * const forwarderFee: FeeEntry = {
4844
- * type: 'forwarder',
4845
- * token: 'USDC',
4846
- * amount: '0.005',
4847
- * }
4848
- * ```
4849
- */
4850
- interface FeeEntry$1 {
4851
- /** The category of this fee. */
4852
- type: FeeType$1;
4853
- /** The token in which this fee is denominated (e.g. `'USDC'`, `'ETH'`). */
4854
- token: string;
4855
- /** Aggregate fee amount (human-readable decimal string). */
4856
- amount: string;
4857
- /** Per-chain breakdown of the fee. Omitted for flat fees (e.g. forwarder). */
4858
- allocations?: FeeAllocation$1[];
4859
- /**
4860
- * When `type === 'kit'`, the address that receives the kit fee.
4861
- * Omitted for other fee types.
4862
- */
4863
- recipientAddress?: string;
4864
- }
4865
5009
  /**
4866
5010
  * Cost estimation for a spend (mint) operation.
4867
5011
  *
@@ -4909,7 +5053,7 @@ interface FeeEntry$1 {
4909
5053
  */
4910
5054
  interface EstimateSpendResult$1 {
4911
5055
  /** Itemised fee breakdown for the spend operation. */
4912
- fees: FeeEntry$1[];
5056
+ fees: FeeEntry[];
4913
5057
  }
4914
5058
 
4915
5059
  /**
@@ -6296,80 +6440,7 @@ type FeeRecipientChainType = 'evm' | 'solana';
6296
6440
  * ```
6297
6441
  */
6298
6442
  type FeeRecipientsConfig = Partial<Record<FeeRecipientChainType, string>>;
6299
- /**
6300
- * Fee category describing the origin of a fee line item.
6301
- *
6302
- * - `'provider'` — Fee charged by the cross-chain provider (e.g. protocol fee).
6303
- * - `'gasFee'` — On-chain gas cost denominated in the transfer token (e.g. USDC).
6304
- * - `'kit'` — Fee charged by the kit / developer integration.
6305
- * - `'forwarder'` — Fee charged by Circle's Forwarding Service for automatic mint.
6306
- */
6307
- type FeeType = 'provider' | 'gasFee' | 'kit' | 'forwarder';
6308
- /**
6309
- * Per-chain breakdown of a fee amount.
6310
- *
6311
- * @example
6312
- * ```typescript
6313
- * import type { FeeAllocation } from '@circle-fin/unified-balance-kit'
6314
- *
6315
- * const allocation: FeeAllocation = {
6316
- * chain: 'Ethereum',
6317
- * amount: '0.00005',
6318
- * }
6319
- * ```
6320
- */
6321
- interface FeeAllocation {
6322
- /** The chain to which this portion of the fee applies. */
6323
- chain: Blockchain;
6324
- /** The fee amount on this chain (human-readable decimal string). */
6325
- amount: string;
6326
- }
6327
- /**
6328
- * A single fee line item within an estimate.
6329
- *
6330
- * @remarks
6331
- * Each entry describes a fee category (`type`), the token it is
6332
- * denominated in, the aggregate `amount`, and an optional per-chain
6333
- * `allocations` breakdown.
6334
- *
6335
- * @example
6336
- * ```typescript
6337
- * import type { FeeEntry } from '@circle-fin/unified-balance-kit'
6338
- *
6339
- * // Fee with per-chain allocation breakdown
6340
- * const providerFee: FeeEntry = {
6341
- * type: 'provider',
6342
- * token: 'USDC',
6343
- * amount: '0.00011',
6344
- * allocations: [
6345
- * { chain: 'Ethereum', amount: '0.00005' },
6346
- * { chain: 'Polygon', amount: '0.00006' },
6347
- * ],
6348
- * }
6349
- *
6350
- * // Flat fee without allocations (e.g. forwarder)
6351
- * const forwarderFee: FeeEntry = {
6352
- * type: 'forwarder',
6353
- * token: 'USDC',
6354
- * amount: '0.005',
6355
- * }
6356
- * ```
6357
- */
6358
- interface FeeEntry {
6359
- /** The category of this fee. */
6360
- type: FeeType;
6361
- /** The token in which this fee is denominated (e.g. `'USDC'`, `'ETH'`). */
6362
- token: string;
6363
- /** Aggregate fee amount (human-readable decimal string). */
6364
- amount: string;
6365
- /** Per-chain breakdown of the fee. Omitted for flat fees (e.g. forwarder). */
6366
- allocations?: FeeAllocation[];
6367
- /**
6368
- * When `type === 'kit'`, the address that receives the kit fee.
6369
- * Omitted for other fee types.
6370
- */
6371
- recipientAddress?: string;
6372
- }
6443
+
6373
6444
  /**
6374
6445
  * Cost estimation for a spend (mint) operation.
6375
6446
  *
@@ -6570,6 +6641,21 @@ interface UnifiedBalanceKitConfig<TExtraProviders extends FlexibleGatewayProvide
6570
6641
  headers?: Record<string, string>;
6571
6642
  }
6572
6643
 
6644
+ /**
6645
+ * USD exchange-rate metadata.
6646
+ *
6647
+ * Non-binding, useful for USD-denominated fee estimates. `feeTokenUsd` prices
6648
+ * the source-chain fee token (the token `feeTotalAmount` is denominated in).
6649
+ *
6650
+ * @internal
6651
+ */
6652
+ interface FeeQuoteExchangeRates {
6653
+ /** USD price of the fee token, as a decimal string. */
6654
+ readonly feeTokenUsd: string;
6655
+ /** USD price of the destination token, as a decimal string. */
6656
+ readonly destinationTokenUsd: string;
6657
+ }
6658
+
6573
6659
  /**
6574
6660
  * Token allowance strategy used to authorize a Gateway deposit.
6575
6661
  *
@@ -6609,7 +6695,7 @@ type AllowanceStrategy = 'approve' | 'permit' | 'authorize';
6609
6695
  * }
6610
6696
  * ```
6611
6697
  */
6612
- interface DepositParams<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities, TChainIdentifier extends UnifiedBalanceChainIdentifier = UnifiedBalanceChainIdentifier> {
6698
+ interface DepositParams<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities, TChainIdentifier extends BridgeChainIdentifier = BridgeChainIdentifier> {
6613
6699
  /**
6614
6700
  * The adapter context identifying the depositor and chain.
6615
6701
  */
@@ -6622,7 +6708,7 @@ interface DepositParams<TAdapterCapabilities extends AdapterCapabilities = Adapt
6622
6708
  amount: string;
6623
6709
  /**
6624
6710
  * The token to deposit.
6625
- * Accepts any case (e.g. `'usdc'`, `'Usdc'`); normalised to uppercase internally.
6711
+ * Accepts any case (e.g. `'usdc'`, `'Usdc'`); normalized to uppercase internally.
6626
6712
  *
6627
6713
  * @defaultValue 'USDC'
6628
6714
  */
@@ -6630,9 +6716,40 @@ interface DepositParams<TAdapterCapabilities extends AdapterCapabilities = Adapt
6630
6716
  /**
6631
6717
  * The token allowance strategy to authorize the deposit.
6632
6718
  *
6719
+ * Only valid for same-chain (STANDARD) deposits. Must not be set when
6720
+ * `to` is provided (FAST cross-chain deposits do not use an allowance
6721
+ * strategy).
6722
+ *
6633
6723
  * @defaultValue 'authorize'
6634
6724
  */
6635
6725
  allowanceStrategy?: AllowanceStrategy;
6726
+ /**
6727
+ * Destination chain for a FAST cross-chain deposit.
6728
+ *
6729
+ * When set, the deposit follows the prepaid-FORWARD CCTP v2 path:
6730
+ * the burned USDC is minted to the GenericExecutor on the destination
6731
+ * chain, which then calls Gateway `deposit` in a single relayed flow.
6732
+ *
6733
+ * Must not be set when `config.transferSpeed` is `'STANDARD'`.
6734
+ */
6735
+ to?: {
6736
+ chain: UnifiedBalanceChainIdentifier;
6737
+ };
6738
+ /**
6739
+ * Transfer configuration for the deposit.
6740
+ *
6741
+ * @defaultValue `{ transferSpeed: 'STANDARD' }`. Set `transferSpeed: 'FAST'`
6742
+ * explicitly for cross-chain deposits (when `to` is provided).
6743
+ */
6744
+ config?: DepositConfig;
6745
+ /**
6746
+ * Opaque signed fee-quote bytes from the Quote API.
6747
+ *
6748
+ * Pass this to commit to the fee price returned by a previous
6749
+ * {@link estimateDeposit} call (see {@link EstimateDepositResult.quote}).
6750
+ * When omitted a fresh quote is fetched automatically (FAST path only).
6751
+ */
6752
+ quote?: string;
6636
6753
  }
6637
6754
  /**
6638
6755
  * Parameters for depositing tokens into *another* Gateway account.
@@ -6659,7 +6776,7 @@ interface DepositParams<TAdapterCapabilities extends AdapterCapabilities = Adapt
6659
6776
  * }
6660
6777
  * ```
6661
6778
  */
6662
- interface DepositForParams<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities, TChainIdentifier extends UnifiedBalanceChainIdentifier = UnifiedBalanceChainIdentifier> extends Omit<DepositParams<TAdapterCapabilities, TChainIdentifier>, 'allowanceStrategy'> {
6779
+ interface DepositForParams<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities, TChainIdentifier extends BridgeChainIdentifier = BridgeChainIdentifier> extends Omit<DepositParams<TAdapterCapabilities, TChainIdentifier>, 'allowanceStrategy'> {
6663
6780
  /**
6664
6781
  * The Gateway account address to credit with the deposit.
6665
6782
  *
@@ -6668,6 +6785,34 @@ interface DepositForParams<TAdapterCapabilities extends AdapterCapabilities = Ad
6668
6785
  */
6669
6786
  depositAccount: string;
6670
6787
  }
6788
+ /**
6789
+ * Relay progress for a cross-chain (FAST) deposit.
6790
+ *
6791
+ * Set after `depositFastCrossChain` completes the ~60-second relay wait.
6792
+ * Always present on the FAST path; absent on same-chain STANDARD deposits.
6793
+ *
6794
+ * @example
6795
+ * ```typescript
6796
+ * if (result.progress?.status === 'DONE') {
6797
+ * console.log('Minted on destination:', result.txHash)
6798
+ * } else if (result.progress?.status === 'PENDING') {
6799
+ * console.log('Relay still in progress — poll getDepositStatus later')
6800
+ * } else if (result.progress?.status === 'FAILED') {
6801
+ * console.log('Relay failed — manual mint may be required')
6802
+ * }
6803
+ * ```
6804
+ */
6805
+ interface DepositProgress {
6806
+ /**
6807
+ * Relay outcome after the burn is confirmed on the source chain.
6808
+ *
6809
+ * - `'DONE'` — Circle's relayer minted USDC on the destination chain.
6810
+ * - `'PENDING'` — Relay timed out (~60 s); the mint may still complete.
6811
+ * - `'FAILED'` — Relayer reported a permanent failure; manual mint may
6812
+ * be required.
6813
+ */
6814
+ status: 'DONE' | 'PENDING' | 'FAILED';
6815
+ }
6671
6816
  /**
6672
6817
  * Result returned after a successful deposit operation.
6673
6818
  *
@@ -6697,22 +6842,232 @@ interface DepositResult {
6697
6842
  depositedTo: string;
6698
6843
  /** The address that signed and funded the deposit. */
6699
6844
  depositedBy: string;
6700
- /** The chain on which the deposit occurred. */
6845
+ /**
6846
+ * The chain where the deposit balance lands.
6847
+ *
6848
+ * @remarks For cross-chain (FAST) deposits this is the destination chain
6849
+ * where the minted USDC is credited. For same-chain (STANDARD) deposits it
6850
+ * is the chain the deposit occurred on. Prefer `sourceChain` /
6851
+ * `destinationChain` for cross-chain flows.
6852
+ */
6701
6853
  chain: Blockchain;
6702
6854
  /**
6703
- * Unique identifier returned by the blockchain once the
6704
- * transaction is mined.
6855
+ * Transaction hash of the completed deposit.
6856
+ *
6857
+ * @remarks
6858
+ * For same-chain (STANDARD) deposits this is the on-chain deposit
6859
+ * transaction. For cross-chain (FAST) deposits with
6860
+ * `progress.status === 'DONE'` this is the Circle-relayed mint on the
6861
+ * destination chain; when the relay is still pending or has failed it
6862
+ * falls back to the source-chain burn hash.
6705
6863
  */
6706
6864
  txHash: string;
6707
6865
  /**
6708
- * Link to view the transaction details on the appropriate
6709
- * blockchain explorer.
6866
+ * Link to view the transaction on a block explorer.
6710
6867
  *
6711
6868
  * @remarks
6712
- * May be `undefined` when the explorer URL cannot be resolved
6713
- * for the chain.
6869
+ * Follows the same chain as {@link txHash}: points to the destination-chain
6870
+ * mint for a completed FAST deposit, or the source-chain burn otherwise.
6871
+ * May be `undefined` when the chain has no configured explorer URL.
6714
6872
  */
6715
6873
  explorerUrl?: string;
6874
+ /**
6875
+ * Source chain of the cross-chain deposit (FAST path only).
6876
+ *
6877
+ * Present when `to` was specified in the deposit params.
6878
+ */
6879
+ sourceChain?: Blockchain;
6880
+ /**
6881
+ * Destination chain of the cross-chain deposit (FAST path only).
6882
+ *
6883
+ * Present when `to` was specified in the deposit params.
6884
+ */
6885
+ destinationChain?: Blockchain;
6886
+ /**
6887
+ * Itemised fee breakdown for the cross-chain deposit (FAST path only).
6888
+ *
6889
+ * Contains at least a `gasFee` entry and a `forwarder` entry (Circle
6890
+ * FORWARD fee). The `gasFee` covers the source-chain burn gas; when a
6891
+ * `usdc.approve` was required it also includes the actual on-chain approve
6892
+ * gas derived from the transaction receipt.
6893
+ */
6894
+ fees?: FeeEntry[];
6895
+ /**
6896
+ * Relay progress after the source-chain burn (FAST path only).
6897
+ *
6898
+ * Present on every FAST deposit result. Use this to determine whether
6899
+ * the destination-chain mint completed within the ~60-second relay window.
6900
+ */
6901
+ progress?: DepositProgress;
6902
+ }
6903
+ /**
6904
+ * Transfer-speed configuration for a deposit operation.
6905
+ *
6906
+ * @example
6907
+ * ```typescript
6908
+ * import type { DepositConfig } from '@circle-fin/unified-balance-kit'
6909
+ *
6910
+ * const config: DepositConfig = { transferSpeed: 'FAST' }
6911
+ * ```
6912
+ */
6913
+ interface DepositConfig {
6914
+ /**
6915
+ * Requested transfer speed for a cross-chain fast deposit.
6916
+ *
6917
+ * @defaultValue `'STANDARD'`
6918
+ */
6919
+ transferSpeed?: 'FAST' | 'STANDARD';
6920
+ }
6921
+ /**
6922
+ * Parameters for estimating the fees of a fast cross-chain deposit.
6923
+ *
6924
+ * The result is plain, serializable data — no live adapter reference is
6925
+ * included. Pass the result (plus `from`) directly to
6926
+ * {@link DepositParams} or {@link DepositForParams} for execution:
6927
+ *
6928
+ * ```typescript
6929
+ * const estimate = await kit.estimateDeposit({ from, amount, token, to })
6930
+ * const result = await kit.deposit({ ...estimate, from })
6931
+ * ```
6932
+ *
6933
+ * @typeParam TAdapterCapabilities - Adapter capability constraints.
6934
+ * @typeParam TChainIdentifier - Accepted chain identifier type.
6935
+ *
6936
+ * @example
6937
+ * ```typescript
6938
+ * import type { EstimateDepositParams } from '@circle-fin/unified-balance-kit'
6939
+ *
6940
+ * const params: EstimateDepositParams = {
6941
+ * from: { adapter: evmAdapter, chain: 'Ethereum' },
6942
+ * amount: '100',
6943
+ * to: { chain: 'Arc_Testnet' },
6944
+ * config: { transferSpeed: 'FAST' },
6945
+ * }
6946
+ * ```
6947
+ */
6948
+ interface EstimateDepositParams<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities, TChainIdentifier extends BridgeChainIdentifier = BridgeChainIdentifier> {
6949
+ /**
6950
+ * The adapter context identifying the depositor and source chain.
6951
+ * The adapter is used for source-chain gas estimation.
6952
+ */
6953
+ from: AdapterContext<TAdapterCapabilities, TChainIdentifier>;
6954
+ /**
6955
+ * The amount of tokens to deposit (human-readable decimal string).
6956
+ *
6957
+ * @example "100", "0.5"
6958
+ */
6959
+ amount: string;
6960
+ /**
6961
+ * The token to deposit.
6962
+ *
6963
+ * @defaultValue 'USDC'
6964
+ */
6965
+ token?: SupportedTokenInput;
6966
+ /**
6967
+ * Destination chain for a FAST cross-chain deposit.
6968
+ *
6969
+ * Required when `config.transferSpeed` is `'FAST'`.
6970
+ * Must not be set when `config.transferSpeed` is `'STANDARD'` (the default).
6971
+ */
6972
+ to?: {
6973
+ chain: UnifiedBalanceChainIdentifier;
6974
+ };
6975
+ /**
6976
+ * Transfer configuration.
6977
+ *
6978
+ * @defaultValue `{ transferSpeed: 'STANDARD' }`
6979
+ */
6980
+ config?: DepositConfig;
6981
+ /**
6982
+ * Gateway account address to credit (for a `depositFor` round-trip).
6983
+ *
6984
+ * When provided, this value is echoed on the result so
6985
+ * `kit.depositFor({ ...estimate, from })` works without re-specifying it.
6986
+ */
6987
+ depositAccount?: string;
6988
+ /**
6989
+ * Allowance strategy echoed to the result for round-trip convenience.
6990
+ */
6991
+ allowanceStrategy?: AllowanceStrategy;
6992
+ }
6993
+ /**
6994
+ * Fee-preview result returned by `estimateDeposit`.
6995
+ *
6996
+ * Plain, serializable data — no live adapter reference. Pass the result
6997
+ * directly to `deposit` or `depositFor` (re-attaching only `from`):
6998
+ *
6999
+ * ```typescript
7000
+ * const estimate = await kit.estimateDeposit({ from, amount, token, to })
7001
+ * const result = await kit.deposit({ ...estimate, from })
7002
+ * ```
7003
+ *
7004
+ * @example
7005
+ * ```typescript
7006
+ * import type { EstimateDepositResult } from '@circle-fin/unified-balance-kit'
7007
+ *
7008
+ * const result: EstimateDepositResult = {
7009
+ * amount: '100',
7010
+ * token: 'USDC',
7011
+ * to: { chain: 'Arc_Testnet' },
7012
+ * config: { transferSpeed: 'FAST' },
7013
+ * fees: [
7014
+ * { type: 'gasFee', token: 'ETH', amount: '0.0002' },
7015
+ * { type: 'forwarder', token: 'USDC', amount: '0.12' },
7016
+ * ],
7017
+ * quote: '0x…',
7018
+ * }
7019
+ * ```
7020
+ */
7021
+ interface EstimateDepositResult {
7022
+ /** Deposit amount (human-readable decimal string). */
7023
+ amount: string;
7024
+ /** Normalized token to deposit. */
7025
+ token: SupportedToken;
7026
+ /**
7027
+ * Destination chain (echoed from input).
7028
+ *
7029
+ * Present for FAST transfers; absent for STANDARD.
7030
+ */
7031
+ to?: {
7032
+ chain: UnifiedBalanceChainIdentifier;
7033
+ };
7034
+ /** Transfer configuration (echoed with defaults applied). */
7035
+ config: Required<DepositConfig>;
7036
+ /**
7037
+ * Itemized fee breakdown.
7038
+ *
7039
+ * Always contains at least a `gasFee` entry. For FAST transfers the gas
7040
+ * cost includes the source-chain burn; when the current USDC allowance is
7041
+ * insufficient it also includes the `usdc.approve` transaction. For
7042
+ * STANDARD deposits on EVM with `allowanceStrategy: 'approve'`, or any
7043
+ * `depositFor` on EVM, the gas cost includes both the
7044
+ * `usdc.increaseAllowance` and the deposit transaction. A `forwarder`
7045
+ * entry is always present for FAST cross-chain transfers.
7046
+ */
7047
+ fees: FeeEntry[];
7048
+ /**
7049
+ * Opaque signed fee-quote bytes from the Quote API.
7050
+ *
7051
+ * Present for FAST cross-chain deposits; absent for STANDARD or
7052
+ * same-chain. Pass this to {@link deposit} or {@link depositFor} to
7053
+ * commit to the quoted price.
7054
+ */
7055
+ quote?: string;
7056
+ /**
7057
+ * Gateway account to credit (echoed from input for `depositFor` round-trip).
7058
+ */
7059
+ depositAccount?: string;
7060
+ /**
7061
+ * Allowance strategy (echoed from input for `deposit` round-trip).
7062
+ */
7063
+ allowanceStrategy?: AllowanceStrategy;
7064
+ /**
7065
+ * Optional USD exchange-rate metadata from the Quote API.
7066
+ *
7067
+ * Present when the Quote API returns exchange rates for the fee token
7068
+ * and destination token. Non-binding; useful for USD-denominated display.
7069
+ */
7070
+ exchangeRates?: FeeQuoteExchangeRates;
6716
7071
  }
6717
7072
 
6718
7073
  /**
@@ -7460,6 +7815,35 @@ declare class AppKitUnifiedBalance {
7460
7815
  * ```
7461
7816
  */
7462
7817
  depositFor(params: DepositForParams): Promise<DepositResult>;
7818
+ /**
7819
+ * Estimate the fees for a deposit without executing it.
7820
+ *
7821
+ * Return plain, serializable data that can be spread directly into
7822
+ * {@link AppKitUnifiedBalance.deposit} or
7823
+ * {@link AppKitUnifiedBalance.depositFor}.
7824
+ *
7825
+ * @param params - Estimate details including the depositor context, amount,
7826
+ * destination chain, and optional transfer speed.
7827
+ * @returns Promise resolving to the itemised fee estimate.
7828
+ * @throws {KitError} If the estimate parameters are invalid or the route is
7829
+ * unsupported.
7830
+ *
7831
+ * @example
7832
+ * ```typescript
7833
+ * const estimate = await kit.unifiedBalance.estimateDeposit({
7834
+ * from: { adapter, chain: 'Ethereum' },
7835
+ * amount: '100',
7836
+ * to: { chain: 'Polygon' },
7837
+ * config: { transferSpeed: 'FAST' },
7838
+ * })
7839
+ *
7840
+ * const result = await kit.unifiedBalance.deposit({
7841
+ * ...estimate,
7842
+ * from: { adapter, chain: 'Ethereum' },
7843
+ * })
7844
+ * ```
7845
+ */
7846
+ estimateDeposit(params: EstimateDepositParams): Promise<EstimateDepositResult>;
7463
7847
  /**
7464
7848
  * Spend (mint) USDC on a destination chain by pulling funds from one or
7465
7849
  * more account sources.