@circle-fin/app-kit 1.11.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/swap.d.cts CHANGED
@@ -740,6 +740,8 @@ declare enum Blockchain {
740
740
  World_Chain_Sepolia = "World_Chain_Sepolia",
741
741
  XDC = "XDC",
742
742
  XDC_Apothem = "XDC_Apothem",
743
+ X_Layer = "X_Layer",
744
+ X_Layer_Testnet = "X_Layer_Testnet",
743
745
  ZKSync_Era = "ZKSync_Era",
744
746
  ZKSync_Sepolia = "ZKSync_Sepolia"
745
747
  }
@@ -952,6 +954,7 @@ declare enum BridgeChain {
952
954
  Unichain = "Unichain",
953
955
  World_Chain = "World_Chain",
954
956
  XDC = "XDC",
957
+ X_Layer = "X_Layer",
955
958
  Arc_Testnet = "Arc_Testnet",
956
959
  Arbitrum_Sepolia = "Arbitrum_Sepolia",
957
960
  Avalanche_Fuji = "Avalanche_Fuji",
@@ -975,7 +978,8 @@ declare enum BridgeChain {
975
978
  Sonic_Testnet = "Sonic_Testnet",
976
979
  Unichain_Sepolia = "Unichain_Sepolia",
977
980
  World_Chain_Sepolia = "World_Chain_Sepolia",
978
- XDC_Apothem = "XDC_Apothem"
981
+ XDC_Apothem = "XDC_Apothem",
982
+ X_Layer_Testnet = "X_Layer_Testnet"
979
983
  }
980
984
  /**
981
985
  * Type representing valid bridge chain identifiers.
@@ -2953,6 +2957,18 @@ interface TokenActionMap {
2953
2957
  */
2954
2958
  walletAddress?: string | undefined;
2955
2959
  };
2960
+ /**
2961
+ * Get the on-chain name of the token contract.
2962
+ *
2963
+ * This is a read-only operation. For USDC the value is also the EIP-712
2964
+ * domain name, which permit and authorize signing flows need.
2965
+ */
2966
+ name: ActionParameters & {
2967
+ /**
2968
+ * The contract address of the token.
2969
+ */
2970
+ tokenAddress: string;
2971
+ };
2956
2972
  }
2957
2973
 
2958
2974
  /**
@@ -3782,6 +3798,30 @@ declare class ActionRegistry {
3782
3798
  executeAction<TActionKey extends ActionKeys>(action: TActionKey, params: ActionPayload<TActionKey>, context: ResolvedOperationContext): Promise<PreparedChainRequest>;
3783
3799
  }
3784
3800
 
3801
+ /**
3802
+ * Canonical list of actions that do not prepare or submit transactions.
3803
+ *
3804
+ * @internal
3805
+ */
3806
+ declare const READ_ACTION_KEYS: readonly ["token.allowance", "token.balanceOf", "token.name", "native.balanceOf", "usdc.allowance", "usdc.balanceOf", "usdc.name", "gateway.v1.isDelegate", "gateway.v1.withdrawingBalance", "gateway.v1.withdrawalBlock", "gateway.v1.signBurnIntents"];
3807
+ /**
3808
+ * Action keys that execute without preparing or submitting a transaction.
3809
+ *
3810
+ * @remarks
3811
+ * Derive this type from the canonical runtime list so compile-time and runtime
3812
+ * classification cannot drift. `gateway.v1.signBurnIntents` is included
3813
+ * because the action system models off-chain signing as a read action: it does
3814
+ * not prepare a chain request.
3815
+ *
3816
+ * @example
3817
+ * ```typescript
3818
+ * import type { ReadActionKey } from '@core/adapter'
3819
+ *
3820
+ * const action: ReadActionKey = 'token.allowance'
3821
+ * ```
3822
+ */
3823
+ type ReadActionKey = (typeof READ_ACTION_KEYS)[number];
3824
+
3785
3825
  /**
3786
3826
  * Defines the capabilities of an adapter, including address handling patterns and supported chains.
3787
3827
  *
@@ -3950,6 +3990,69 @@ declare abstract class Adapter<TAdapterCapabilities extends AdapterCapabilities
3950
3990
  * ```
3951
3991
  */
3952
3992
  prepareAction<TActionKey extends ActionKeys>(action: TActionKey, params: ActionPayload<TActionKey>, ctx: OperationContext<TAdapterCapabilities>): Promise<PreparedChainRequest>;
3993
+ /**
3994
+ * Execute a non-transaction action without routing through transaction preparation.
3995
+ *
3996
+ * @remarks
3997
+ * Use this seam for balance, allowance, contract-state, and other actions
3998
+ * classified as reads. It never calls {@link Adapter.prepareAction}, so
3999
+ * transaction authorization wrappers only observe actions that can produce a
4000
+ * signable chain request.
4001
+ *
4002
+ * @typeParam TActionKey - The read action key.
4003
+ * @param action - The read action to execute.
4004
+ * @param params - The parameters for the read action.
4005
+ * @param ctx - The operation context.
4006
+ * @returns The raw action response.
4007
+ * @throws {KitError} When the key is not a read action or no handler is registered.
4008
+ * @throws Error When the operation context or action handler fails.
4009
+ *
4010
+ * @example
4011
+ * ```typescript
4012
+ * import { Ethereum } from '@core/chains'
4013
+ *
4014
+ * const balance = await adapter.readAction(
4015
+ * 'token.balanceOf',
4016
+ * { tokenAddress, walletAddress },
4017
+ * { chain: Ethereum },
4018
+ * )
4019
+ * ```
4020
+ *
4021
+ * @internal
4022
+ */
4023
+ readAction<TActionKey extends ReadActionKey>(action: TActionKey, params: ActionPayload<TActionKey>, ctx: OperationContext<TAdapterCapabilities>): Promise<unknown>;
4024
+ /**
4025
+ * Read the current token allowance a delegate holds over an owner's tokens.
4026
+ *
4027
+ * @remarks
4028
+ * Perform a network read through {@link Adapter.readAction}. This method
4029
+ * never routes through {@link Adapter.prepareAction}. On chains without an
4030
+ * allowance model, such as Solana, return the maximum uint256 value.
4031
+ *
4032
+ * @param params - The token to query and the delegate whose allowance is being read.
4033
+ * @param ctx - Operation context with compile-time validated address requirements.
4034
+ * @returns A promise resolving to the current allowance in the token's base units.
4035
+ * @throws {KitError} When the adapter does not register a `token.allowance` handler.
4036
+ * @throws Error When the operation context or action handler fails.
4037
+ *
4038
+ * @example
4039
+ * ```typescript
4040
+ * import type { Adapter } from '@core/adapter'
4041
+ * import { Ethereum } from '@core/chains'
4042
+ *
4043
+ * declare const adapter: Adapter
4044
+ *
4045
+ * const allowance = await adapter.getTokenAllowance(
4046
+ * {
4047
+ * tokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
4048
+ * delegate: '0x1111111111111111111111111111111111111111',
4049
+ * },
4050
+ * { chain: Ethereum },
4051
+ * )
4052
+ * console.log(allowance) // 1000000n
4053
+ * ```
4054
+ */
4055
+ getTokenAllowance(params: ActionPayload<'token.allowance'>, ctx: OperationContext<TAdapterCapabilities>): Promise<bigint>;
3953
4056
  /**
3954
4057
  * Prepares a transaction for future gas estimation and execution.
3955
4058
  *
@@ -5260,6 +5363,132 @@ declare enum TransferSpeed {
5260
5363
  /** Standard burn mode - normal transfer time with standard fees */
5261
5364
  SLOW = "SLOW"
5262
5365
  }
5366
+ /**
5367
+ * Context object representing a wallet and signing authority on a specific blockchain network.
5368
+ *
5369
+ * Combines a wallet or contract address, the blockchain it resides on, and the adapter (signer)
5370
+ * responsible for authorizing transactions. Used to specify the source or destination in cross-chain
5371
+ * transfer operations.
5372
+ *
5373
+ * @remarks
5374
+ * The `adapter` (signer) and `address` do not always have to belong to the same entity. For example,
5375
+ * in minting or withdrawal scenarios, the signing adapter may authorize a transaction that credits
5376
+ * funds to a different recipient address. This context is essential for cross-chain operations,
5377
+ * ensuring that both the address and the associated adapter are correctly paired with the intended
5378
+ * blockchain, but not necessarily with each other.
5379
+ *
5380
+ * @example
5381
+ * ```typescript
5382
+ * import type { WalletContext } from '@core/provider'
5383
+ * import { adapter, blockchain } from './setup'
5384
+ *
5385
+ * const wallet: WalletContext = {
5386
+ * adapter,
5387
+ * address: '0x1234...abcd',
5388
+ * chain: blockchain,
5389
+ * }
5390
+ * ```
5391
+ */
5392
+ interface WalletContext<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities,
5393
+ /**
5394
+ * The chain definition type to use for the wallet context.
5395
+ *
5396
+ * @defaultValue ChainDefinition
5397
+ */
5398
+ TChainDefinition extends ChainDefinition = ChainDefinition> {
5399
+ /**
5400
+ * The adapter (signer) for the wallet on the specified chain.
5401
+ *
5402
+ * Responsible for authorizing transactions and signing messages on behalf of the wallet or
5403
+ * for a different recipient, depending on the use case.
5404
+ */
5405
+ adapter: Adapter<TAdapterCapabilities>;
5406
+ /**
5407
+ * The wallet or contract address.
5408
+ *
5409
+ * Must be a valid address format for the specified blockchain. May differ from the adapter's
5410
+ * own address in scenarios such as relayed transactions or third-party minting.
5411
+ */
5412
+ address: string;
5413
+ /**
5414
+ * The blockchain network where the wallet or contract address resides.
5415
+ *
5416
+ * Determines the context and format for the address and adapter.
5417
+ */
5418
+ chain: TChainDefinition;
5419
+ }
5420
+ /**
5421
+ * Wallet context for bridge destinations with optional custom recipient.
5422
+ *
5423
+ * Extends WalletContext to support scenarios where the recipient address
5424
+ * differs from the signer address (e.g., bridging to a third-party wallet).
5425
+ * The signer address is used for transaction authorization, while the
5426
+ * recipient address specifies where the minted funds should be sent.
5427
+ *
5428
+ * @typeParam TAdapterCapabilities - The adapter capabilities type to use for the wallet context.
5429
+ * @typeParam TChainDefinition - The chain definition type to use for the wallet context.
5430
+ *
5431
+ * @example
5432
+ * ```typescript
5433
+ * import type { DestinationWalletContext } from '@core/provider'
5434
+ * import { adapter, blockchain } from './setup'
5435
+ *
5436
+ * // Bridge to a custom recipient address
5437
+ * const destination: DestinationWalletContext = {
5438
+ * adapter,
5439
+ * address: '0x1234...abcd', // Signer address
5440
+ * chain: blockchain,
5441
+ * recipientAddress: '0x9876...fedc' // Custom recipient
5442
+ * }
5443
+ * ```
5444
+ */
5445
+ interface DestinationWalletContext<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities,
5446
+ /**
5447
+ * The chain definition type to use for the wallet context.
5448
+ *
5449
+ * @defaultValue ChainDefinition
5450
+ */
5451
+ TChainDefinition extends ChainDefinition = ChainDefinition> extends WalletContext<TAdapterCapabilities, TChainDefinition> {
5452
+ /**
5453
+ * Optional custom recipient address for minted funds.
5454
+ *
5455
+ * When provided, minted tokens will be sent to this address instead of
5456
+ * the address specified in the wallet context. The wallet context address
5457
+ * is still used for transaction signing and authorization.
5458
+ *
5459
+ * Must be a valid address format for the specified blockchain.
5460
+ */
5461
+ recipientAddress?: string;
5462
+ }
5463
+ /**
5464
+ * Parameters for executing a cross-chain bridge operation.
5465
+ */
5466
+ interface BridgeParams$1<TFromCapabilities extends AdapterCapabilities = AdapterCapabilities, TToCapabilities extends AdapterCapabilities = AdapterCapabilities,
5467
+ /**
5468
+ * The chain definition type to use for the wallet context.
5469
+ *
5470
+ * @defaultValue ChainDefinition
5471
+ */
5472
+ TChainDefinition extends ChainDefinition = ChainDefinition> {
5473
+ /** The source adapter containing wallet and chain information */
5474
+ source: WalletContext<TFromCapabilities, TChainDefinition>;
5475
+ /** The destination adapter containing wallet and chain information */
5476
+ destination: DestinationWalletContext<TToCapabilities, TChainDefinition>;
5477
+ /** The amount to transfer (as a string to avoid precision issues) */
5478
+ amount: string;
5479
+ /** The token to transfer (currently only USDC is supported) */
5480
+ token: 'USDC';
5481
+ /** Bridge configuration (e.g., fast burn settings) */
5482
+ config: BridgeConfig;
5483
+ /**
5484
+ * Optional invocation metadata for tracing and correlation.
5485
+ *
5486
+ * When provided, the `traceId` is used to correlate all events emitted during
5487
+ * the bridge operation. If not provided, an OpenTelemetry-compatible traceId
5488
+ * will be auto-generated.
5489
+ */
5490
+ invocationMeta?: InvocationMeta;
5491
+ }
5263
5492
  /**
5264
5493
  * Configuration options for customizing bridge behavior.
5265
5494
  *
@@ -5567,6 +5796,255 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
5567
5796
  useForwarder?: boolean;
5568
5797
  }) | ForwarderDestination<TChainIdentifier>;
5569
5798
 
5799
+ /**
5800
+ * Allowance strategy for token approvals during swap operations.
5801
+ *
5802
+ * Defines how token allowances should be granted to the swap contract:
5803
+ * - `permit`: Use EIP-2612 permit signature (gas-efficient, no approval transaction)
5804
+ * - `approve`: Traditional approval transaction
5805
+ *
5806
+ * The default strategy is `permit` with fallback to `approve` if permit is not supported.
5807
+ */
5808
+ type AllowanceStrategy$1 = 'permit' | 'approve';
5809
+ /**
5810
+ * Configuration options for swap operations.
5811
+ *
5812
+ * Controls swap behavior including allowance strategy, slippage tolerance,
5813
+ * minimum output amounts, custom fees, and kit identification.
5814
+ *
5815
+ * @example
5816
+ * ```typescript
5817
+ * import type { ServiceSwapConfig } from '@circle-fin/provider-stablecoin-service-swap'
5818
+ *
5819
+ * // Percentage-based fee
5820
+ * const config: ServiceSwapConfig = {
5821
+ * allowanceStrategy: 'permit',
5822
+ * slippageBps: 300, // 3%
5823
+ * stopLimit: '950000', // Minimum 0.95 USDC output
5824
+ * customFee: {
5825
+ * percentageBps: 1000, // 10% fee
5826
+ * recipientAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
5827
+ * }
5828
+ * }
5829
+ * ```
5830
+ *
5831
+ * @example
5832
+ * ```typescript
5833
+ * // Absolute amount fee (from callback)
5834
+ * const config: ServiceSwapConfig = {
5835
+ * allowanceStrategy: 'permit',
5836
+ * customFee: {
5837
+ * amount: '10000', // 0.01 USDC fee (absolute)
5838
+ * recipientAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
5839
+ * }
5840
+ * }
5841
+ * ```
5842
+ */
5843
+ interface ServiceSwapConfig {
5844
+ /**
5845
+ * Strategy for granting token allowances to the swap contract.
5846
+ *
5847
+ * Defaults to 'permit' with fallback to 'approve'.
5848
+ */
5849
+ allowanceStrategy?: AllowanceStrategy$1;
5850
+ /**
5851
+ * Maximum acceptable slippage in basis points (BPS).
5852
+ *
5853
+ * 1 BPS = 0.01%, so 300 BPS = 3% slippage.
5854
+ * Defaults to 300 BPS (3%).
5855
+ */
5856
+ slippageBps?: number;
5857
+ /**
5858
+ * Minimum acceptable output amount in smallest units (stop-limit).
5859
+ *
5860
+ * If the estimated output falls below this value, the swap will fail.
5861
+ * Expressed as a string to avoid precision issues.
5862
+ */
5863
+ stopLimit?: string;
5864
+ /**
5865
+ * Custom fee configuration for this swap.
5866
+ *
5867
+ * Supports two mutually exclusive approaches:
5868
+ * 1. Percentage-based: Use `percentageBps` field (simple)
5869
+ * 2. Absolute amount: Use `amount` field (from callback)
5870
+ *
5871
+ * If both are set, validation will fail. Transaction-level percentage
5872
+ * takes precedence over kit-level callback policy.
5873
+ */
5874
+ customFee?: {
5875
+ /**
5876
+ * Fee percentage in basis points (NEW).
5877
+ *
5878
+ * 100 bps = 1%, 1000 bps = 10%, 10000 bps = 100%
5879
+ *
5880
+ * Service calculates fee using `estimatedAmount` for same-chain output fees
5881
+ * and the input amount for cross-chain swaps.
5882
+ * Must be greater than 0 and less than or equal to 10000 (maximum 100%).
5883
+ * Mutually exclusive with `amount`.
5884
+ *
5885
+ * @example 1000 // 10% fee
5886
+ */
5887
+ percentageBps?: number;
5888
+ /**
5889
+ * Fee amount in smallest units (for callback results).
5890
+ *
5891
+ * Absolute fee amount calculated by callback function.
5892
+ * Mutually exclusive with `percentageBps`.
5893
+ *
5894
+ * @example '10000' // 0.01 USDC (6 decimals)
5895
+ */
5896
+ amount?: string;
5897
+ /**
5898
+ * Address that will receive the developer's 90% fee share.
5899
+ *
5900
+ * Required whenever a custom fee is submitted to the provider. Optional at
5901
+ * the type level so SDK callback flows can represent partial fee state
5902
+ * before final validation.
5903
+ *
5904
+ * Must be valid on the fee payout chain: source chain for input-side fees
5905
+ * and cross-chain swaps, destination chain for same-chain output-side fees.
5906
+ *
5907
+ * @example '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
5908
+ */
5909
+ recipientAddress?: string;
5910
+ };
5911
+ /**
5912
+ * Stablecoin Service Kit Key used to authenticate service-backed swap
5913
+ * requests.
5914
+ *
5915
+ * Treat this value as a credential. Do not log it, embed it in client-side
5916
+ * source, or expose it in telemetry.
5917
+ */
5918
+ kitKey?: string;
5919
+ /**
5920
+ * DEX aggregator identifier used to source the swap route.
5921
+ *
5922
+ * @example 'lifi', 'paraswap'
5923
+ */
5924
+ provider?: string;
5925
+ /**
5926
+ * Whether to fuse the ERC-20 approval and the swap into a single atomic
5927
+ * batch when the adapter supports it (EIP-5792, or a signing strategy that
5928
+ * declares atomic batching).
5929
+ *
5930
+ * @remarks
5931
+ * Defaults to `true`. When batching is available this collapses the two
5932
+ * sequential transactions of the on-chain approval path into one atomic
5933
+ * submission — a single signing challenge for a smart-contract wallet. Set
5934
+ * to `false` to force the sequential approve-then-swap path. Has no effect on
5935
+ * the gasless permit path (already a single transaction) or on native-token
5936
+ * swaps (no approval needed).
5937
+ *
5938
+ * The batch path relies on the wallet's own gas estimation for the swap call:
5939
+ * the service-provided gas floor and pre-flight simulation that the sequential
5940
+ * path applies are not conveyed through the batch. For a complex/multi-hop
5941
+ * swap whose wallet-side estimate under-shoots, this can out-of-gas-revert the
5942
+ * atomic batch where the sequential path would succeed — set `false` to fall
5943
+ * back to the service-floored sequential path if you hit this.
5944
+ *
5945
+ * @defaultValue true
5946
+ */
5947
+ batchTransactions?: boolean;
5948
+ }
5949
+ /**
5950
+ * Parameters for initiating a swap operation through the Stablecoin Service.
5951
+ *
5952
+ * This type is used as the primary input to provider swap operations, allowing users to specify
5953
+ * the source context, input/output tokens, swap amount, destination address, and optional configuration.
5954
+ *
5955
+ * @typeParam TFromAdapterCapabilities - The adapter capabilities type for the source adapter.
5956
+ *
5957
+ * @example
5958
+ * ```typescript
5959
+ * import type { ServiceSwapParams } from '@circle-fin/provider-stablecoin-service-swap'
5960
+ * import { createAdapterFromPrivateKey } from '@circle-fin/adapter-viem-v2'
5961
+ * import { Ethereum } from '@core/chains'
5962
+ *
5963
+ * const adapter = createAdapterFromPrivateKey({
5964
+ * privateKey: process.env.PRIVATE_KEY,
5965
+ * })
5966
+ *
5967
+ * const params: ServiceSwapParams = {
5968
+ * from: { adapter, chain: Ethereum },
5969
+ * tokenIn: 'USDC', // Alias resolves to chain-specific address
5970
+ * tokenOut: 'USDT', // Alias resolves to chain-specific address
5971
+ * amountIn: '100500000', // 100.50 USDC in base units
5972
+ * to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
5973
+ * config: {
5974
+ * slippageBps: 300, // 3% slippage
5975
+ * allowanceStrategy: 'permit'
5976
+ * }
5977
+ * }
5978
+ * ```
5979
+ */
5980
+ interface ServiceSwapParams<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities,
5981
+ /**
5982
+ * The chain definition type to use for the wallet context.
5983
+ *
5984
+ * @defaultValue ChainDefinition
5985
+ */
5986
+ TChainDefinition extends ChainDefinition = ChainDefinition> {
5987
+ /**
5988
+ * The source adapter context (wallet and chain) for the swap.
5989
+ */
5990
+ from: WalletContext<TFromAdapterCapabilities, TChainDefinition>;
5991
+ /**
5992
+ * The input token address or alias to swap from.
5993
+ *
5994
+ * **Supported formats:**
5995
+ * - Token alias: `"USDC"`, `"USDT"`, `"NATIVE"` (case-insensitive)
5996
+ * - EVM address: `'0x'` prefixed hex (e.g., `'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'`)
5997
+ * - Solana address: Base58-encoded (e.g., `'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'`)
5998
+ *
5999
+ * Token aliases are automatically resolved to the chain-specific contract address.
6000
+ *
6001
+ * @example 'USDC' // Recommended: use alias
6002
+ * @example '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' // Or full address
6003
+ */
6004
+ tokenIn: string;
6005
+ /**
6006
+ * The output token address or alias to swap to.
6007
+ *
6008
+ * **Supported formats:**
6009
+ * - Token alias: `"USDC"`, `"USDT"`, `"NATIVE"` (case-insensitive)
6010
+ * - EVM address: `'0x'` prefixed hex (e.g., `'0xdAC17F958D2ee523a2206206994597C13D831ec7'`)
6011
+ * - Solana address: Base58-encoded (e.g., `'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'`)
6012
+ *
6013
+ * Token aliases are automatically resolved to the chain-specific contract address.
6014
+ *
6015
+ * @example 'USDT' // Recommended: use alias
6016
+ * @example '0xdAC17F958D2ee523a2206206994597C13D831ec7' // Or full address
6017
+ */
6018
+ tokenOut: string;
6019
+ /**
6020
+ * The amount of input token to swap in base units.
6021
+ *
6022
+ * SwapKit converts human-readable amounts to base units before passing to the provider.
6023
+ *
6024
+ * @example '100500000' for 100.50 USDC (6 decimals)
6025
+ */
6026
+ amountIn: string;
6027
+ /**
6028
+ * The destination address where the swapped tokens will be sent.
6029
+ *
6030
+ * @example '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
6031
+ */
6032
+ to: string;
6033
+ /**
6034
+ * Optional destination chain for cross-chain swaps.
6035
+ *
6036
+ * Defaults to `from.chain` for same-chain swaps.
6037
+ */
6038
+ toChain?: TChainDefinition;
6039
+ /**
6040
+ * Optional configuration for swap behavior.
6041
+ *
6042
+ * If omitted, defaults will be used:
6043
+ * - allowanceStrategy: 'permit' (fallback to 'approve')
6044
+ * - slippageBps: 300 (3%)
6045
+ */
6046
+ config?: ServiceSwapConfig;
6047
+ }
5570
6048
  /**
5571
6049
  * Individual fee entry in the swap operation.
5572
6050
  *
@@ -5621,6 +6099,213 @@ interface ServiceSwapFee {
5621
6099
  readonly recipientAddress?: string;
5622
6100
  }
5623
6101
 
6102
+ /**
6103
+ * Fee context when fee is taken from INPUT token.
6104
+ *
6105
+ * Used for swaps where the fee is collected from the input token, including
6106
+ * all cross-chain swaps.
6107
+ * Extends the resolved swap parameters with a discriminator to indicate input fee scenario.
6108
+ *
6109
+ * @typeParam TFromAdapterCapabilities - The adapter capabilities type for the source adapter
6110
+ *
6111
+ * @example
6112
+ * ```typescript
6113
+ * // USDC → RandomToken swap (fee from input)
6114
+ * const context: SwapInputFeeContext = {
6115
+ * type: 'input',
6116
+ * from: {
6117
+ * adapter: viemAdapter,
6118
+ * chain: Ethereum,
6119
+ * address: '0x...'
6120
+ * },
6121
+ * tokenIn: 'USDC',
6122
+ * tokenOut: 'RandomToken',
6123
+ * amountIn: '100000000', // 100 USDC in base units
6124
+ * to: '0x...'
6125
+ * }
6126
+ * ```
6127
+ */
6128
+ interface SwapInputFeeContext<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> extends ResolvedSwapParams<TFromAdapterCapabilities> {
6129
+ /**
6130
+ * Fee source discriminator - input token.
6131
+ */
6132
+ type: 'input';
6133
+ }
6134
+ /**
6135
+ * Fee context when fee is taken from OUTPUT token.
6136
+ *
6137
+ * Used for swaps where the output token is supported for fee collection.
6138
+ * Extends the resolved swap parameters with output amounts and discriminator.
6139
+ *
6140
+ * @typeParam TFromAdapterCapabilities - The adapter capabilities type for the source adapter
6141
+ *
6142
+ * @remarks
6143
+ * If using `estimatedAmount` in callback and quote cache expires,
6144
+ * calculated fee may not match fresh quote. Use `minAmount` for
6145
+ * predictability at the cost of potentially lower fees.
6146
+ *
6147
+ * @example
6148
+ * ```typescript
6149
+ * // RandomToken → USDC swap (fee from output)
6150
+ * const context: SwapOutputFeeContext = {
6151
+ * type: 'output',
6152
+ * from: {
6153
+ * adapter: viemAdapter,
6154
+ * chain: Ethereum,
6155
+ * address: '0x...'
6156
+ * },
6157
+ * tokenIn: 'RandomToken',
6158
+ * tokenOut: 'USDC',
6159
+ * amountIn: '100000000',
6160
+ * to: '0x...',
6161
+ * minAmount: '50000000', // 50 USDC guaranteed minimum
6162
+ * estimatedAmount: '55000000' // 55 USDC expected output
6163
+ * }
6164
+ * ```
6165
+ */
6166
+ interface SwapOutputFeeContext<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> extends ResolvedSwapParams<TFromAdapterCapabilities> {
6167
+ /**
6168
+ * Fee source discriminator - output token.
6169
+ */
6170
+ type: 'output';
6171
+ /**
6172
+ * Guaranteed minimum output amount in base units.
6173
+ *
6174
+ * More stable but lower than estimatedAmount. Use this for
6175
+ * predictable fee calculations.
6176
+ */
6177
+ minAmount: string;
6178
+ /**
6179
+ * Estimated output amount in base units.
6180
+ *
6181
+ * Expected output based on current market conditions. May be
6182
+ * higher than minAmount. Subject to change if quote expires.
6183
+ */
6184
+ estimatedAmount: string;
6185
+ }
6186
+ /**
6187
+ * Discriminated union for swap fee contexts.
6188
+ *
6189
+ * Provides different context based on whether fee is from input or output token.
6190
+ * Discriminated by the `type` field: 'input' for fees from input token, 'output' for output token.
6191
+ *
6192
+ * Includes full swap parameters (adapter, chain, tokens, amounts) for maximum flexibility
6193
+ * in fee calculation logic.
6194
+ *
6195
+ * @typeParam TFromAdapterCapabilities - The adapter capabilities type for the source adapter
6196
+ */
6197
+ type SwapFeeContext<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> = SwapInputFeeContext<TFromAdapterCapabilities> | SwapOutputFeeContext<TFromAdapterCapabilities>;
6198
+ /**
6199
+ * Custom fee policy for SwapKit (callback-based approach).
6200
+ *
6201
+ * Provides hooks to calculate an absolute fee amount and resolve the fee
6202
+ * recipient address. The callback receives a discriminated context with
6203
+ * different fields based on operation type (bridge vs swap) and fee source
6204
+ * (input vs output).
6205
+ *
6206
+ * @remarks
6207
+ * This is mutually exclusive with transaction-level percentage fees.
6208
+ * If both are set, the transaction-level percentage takes precedence.
6209
+ *
6210
+ * The callback approach makes two API calls for same-chain output fees:
6211
+ * 1. GET /quote - retrieve fee context and quote
6212
+ * 2. POST /swap - execute with calculated fee
6213
+ *
6214
+ * Cross-chain swaps always use input fees on the source chain, so callbacks
6215
+ * receive `type: 'input'` for those routes.
6216
+ *
6217
+ * @example
6218
+ * ```typescript
6219
+ * import type { CustomFeePolicy } from '@circle-fin/swap-kit'
6220
+ *
6221
+ * const policy: CustomFeePolicy = {
6222
+ * computeFee: async (ctx) => {
6223
+ * // Discriminate by fee source (input vs output)
6224
+ * if (ctx.type === 'input') {
6225
+ * // Simple percentage for input fees
6226
+ * return (parseFloat(ctx.amountIn) * 0.1).toString()
6227
+ * } else {
6228
+ * // Complex logic for output fees (VIP tiers, etc.)
6229
+ * const user = await database.getUser(...)
6230
+ * if (user.isVIP) {
6231
+ * return (parseFloat(ctx.minAmount) * 0.05).toString()
6232
+ * }
6233
+ * return (parseFloat(ctx.estimatedAmount) * 0.1).toString()
6234
+ * }
6235
+ * },
6236
+ * resolveFeeRecipientAddress: (chain) => {
6237
+ * return chain.type === 'solana'
6238
+ * ? 'SolanaAddress...'
6239
+ * : '0xEVMAddress...'
6240
+ * },
6241
+ * }
6242
+ * ```
6243
+ */
6244
+ interface CustomFeePolicy$2 {
6245
+ /**
6246
+ * Calculate custom fee amount based on swap context.
6247
+ *
6248
+ * Receives full swap parameters including adapter, chain, tokens, and amounts.
6249
+ * Context is discriminated by `type` field:
6250
+ * - 'input': Fee from input token (OK → Any swaps and all cross-chain swaps)
6251
+ * - 'output': Fee from output token (same-chain Any → OK swaps), includes minAmount and estimatedAmount
6252
+ *
6253
+ * The wrapper automatically converts amounts to/from base units, so your
6254
+ * callback works with human-readable numbers (e.g., '0.1' for 0.1 USDC).
6255
+ *
6256
+ * @typeParam TFromAdapterCapabilities - The adapter capabilities type for the source adapter
6257
+ * @param context - Discriminated swap fee context with full swap parameters
6258
+ * @returns Absolute fee amount as string in human-readable format
6259
+ *
6260
+ * @example
6261
+ * ```typescript
6262
+ * computeFee: async (ctx) => {
6263
+ * if (ctx.type === 'output') {
6264
+ * // Output fee scenario
6265
+ * // Use estimatedAmount or minAmount for calculation
6266
+ * return (parseFloat(ctx.estimatedAmount) * 0.01).toString()
6267
+ * }
6268
+ * // Input fee scenario
6269
+ * return (parseFloat(ctx.amountIn) * 0.01).toString()
6270
+ * }
6271
+ * ```
6272
+ *
6273
+ * @example
6274
+ * ```typescript
6275
+ * computeFee: async (ctx) => {
6276
+ * if (ctx.type === 'output') {
6277
+ * // Use minAmount for predictable fees
6278
+ * return (parseFloat(ctx.minAmount) * 0.01).toString()
6279
+ * }
6280
+ * return (parseFloat(ctx.amountIn) * 0.01).toString()
6281
+ * }
6282
+ * ```
6283
+ */
6284
+ computeFee: <TFromAdapterCapabilities extends AdapterCapabilities>(context: SwapFeeContext<TFromAdapterCapabilities>) => Promise<string> | string;
6285
+ /**
6286
+ * Resolve fee recipient address for the chain where fee is collected.
6287
+ *
6288
+ * Called with the chain where fee will be paid. For cross-chain swaps this
6289
+ * is always the source chain. Must return a valid address format for that
6290
+ * chain type (EVM or Solana).
6291
+ *
6292
+ * @param feePayoutChain - Chain definition where fee is collected
6293
+ * @param context - The swap fee context with full parameters
6294
+ * @returns Fee recipient address for the chain
6295
+ *
6296
+ * @example
6297
+ * ```typescript
6298
+ * resolveFeeRecipientAddress: (chain, ctx) => {
6299
+ * // Chain-based routing
6300
+ * if (chain.type === 'solana') {
6301
+ * return 'SolanaAddress...'
6302
+ * }
6303
+ * return '0xEVMAddress...'
6304
+ * }
6305
+ * ```
6306
+ */
6307
+ resolveFeeRecipientAddress: <TFromAdapterCapabilities extends AdapterCapabilities>(feePayoutChain: ChainDefinition, context: SwapFeeContext<TFromAdapterCapabilities>) => Promise<string> | string;
6308
+ }
5624
6309
  /**
5625
6310
  * Adapter context constrained to swap-supported chains.
5626
6311
  */
@@ -5921,6 +6606,45 @@ interface SwapResult {
5921
6606
  */
5922
6607
  readonly amountOut?: string;
5923
6608
  }
6609
+ /**
6610
+ * Resolved parameters for swap operations after validation and normalization.
6611
+ *
6612
+ * Internal type used by SwapKit operations after `resolveSwapParams()` has:
6613
+ * - Validated the input parameters
6614
+ * - Resolved chain identifiers to full ChainDefinition objects
6615
+ * - Extracted and validated wallet addresses
6616
+ *
6617
+ * Note: Raw user input is validated first, then `tokenIn` and `tokenOut` may
6618
+ * be canonicalized for downstream routing (for example, Arc Testnet
6619
+ * `NATIVE` → `USDC`). Address resolution is handled by the provider layer.
6620
+ *
6621
+ * This type is consumed by swap providers and internal operations but is not
6622
+ * exposed to end users. It extends ServiceSwapParams which is the format expected
6623
+ * by the StablecoinServiceSwapProvider.
6624
+ *
6625
+ * @typeParam TFromAdapterCapabilities - The adapter capabilities type for the source adapter.
6626
+ *
6627
+ * @example
6628
+ * ```typescript
6629
+ * // After resolution, SwapParams becomes ResolvedSwapParams:
6630
+ * const resolved: ResolvedSwapParams = {
6631
+ * from: {
6632
+ * adapter: viemAdapter,
6633
+ * chain: Ethereum, // Full chain definition
6634
+ * address: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
6635
+ * },
6636
+ * tokenIn: 'USDC', // Canonicalized for provider routing
6637
+ * tokenOut: 'USDT', // Canonicalized for provider routing
6638
+ * amountIn: '100500000', // Converted to base units (100.5 USDC with 6 decimals)
6639
+ * to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
6640
+ * config: {
6641
+ * slippageBps: 300,
6642
+ * allowanceStrategy: 'permit'
6643
+ * }
6644
+ * }
6645
+ * ```
6646
+ */
6647
+ type ResolvedSwapParams<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> = ServiceSwapParams<TFromAdapterCapabilities>;
5924
6648
  /**
5925
6649
  * Parameters for initiating a same-chain or cross-chain stablecoin swap.
5926
6650
  *
@@ -6062,6 +6786,91 @@ interface SwapParams<TFromAdapterCapabilities extends AdapterCapabilities = Adap
6062
6786
  config?: SwapConfig;
6063
6787
  }
6064
6788
 
6789
+ type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
6790
+ type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
6791
+ /**
6792
+ * Custom fee policy for BridgeKit.
6793
+ *
6794
+ * Provides hooks to calculate an absolute custom fee and resolve the fee recipient address
6795
+ * on the source chain. The returned fee is **added on top of the transfer amount** (the wallet signs for
6796
+ * `amount + customFee`). Once collected, the custom fee is split:
6797
+ *
6798
+ * - **10%** automatically routes to Circle.
6799
+ * - **90%** routes to your supplied `recipientAddress`.
6800
+ *
6801
+ * The entire transfer amount still flows through CCTPv2, which then charges its own protocol fee.
6802
+ *
6803
+ * Use `computeFee` (recommended) for human-readable amounts, or `calculateFee` (deprecated)
6804
+ * for smallest-unit amounts. Only one should be provided.
6805
+ *
6806
+ * @example
6807
+ * ```typescript
6808
+ * import type { CustomFeePolicy, BridgeParams } from '@circle-fin/bridge-kit'
6809
+ *
6810
+ * const policy: CustomFeePolicy = {
6811
+ * // computeFee receives human-readable amounts (e.g., '100' for 100 USDC)
6812
+ * computeFee: (params: BridgeParams) => {
6813
+ * const amount = parseFloat(params.amount)
6814
+ *
6815
+ * // 1% fee, capped between 5-50 USDC
6816
+ * const fee = Math.min(Math.max(amount * 0.01, 5), 50)
6817
+ * return fee.toFixed(6)
6818
+ * },
6819
+ * resolveFeeRecipientAddress: (feePayoutChain) =>
6820
+ * feePayoutChain.type === 'solana'
6821
+ * ? 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
6822
+ * : '0x1234567890123456789012345678901234567890',
6823
+ * }
6824
+ * ```
6825
+ */
6826
+ type CustomFeePolicy$1 = {
6827
+ /**
6828
+ * A function that returns the fee to charge for the bridge transfer.
6829
+ * The value returned from the function represents an absolute fee.
6830
+ * The returned fee is **added on top of the transfer amount**. For example, returning
6831
+ * `'5'` (5 USDC) for a 100 USDC transfer causes the wallet to debit 105 USDC total.
6832
+ * CCTPv2 still processes the full 100 USDC transfer amount, while the custom fee is split
6833
+ * 10%/90% between Circle and your fee recipient.
6834
+ *
6835
+ * @example
6836
+ * ```typescript
6837
+ * computeFee: (params) => {
6838
+ * const amount = parseFloat(params.amount)
6839
+ * return (amount * 0.01).toString() // 1% fee
6840
+ * }
6841
+ * ```
6842
+ */
6843
+ computeFee: FeeFunction<AdapterCapabilities, AdapterCapabilities>;
6844
+ calculateFee?: never;
6845
+ /**
6846
+ * A function that returns the fee recipient for a bridge transfer.
6847
+ * The value returned from the function represents the address that will receive the fee on the source chain of the bridge transfer.
6848
+ * The fee recipient address **must be a valid address for the source chain** of the bridge transfer.
6849
+ *
6850
+ * For example: if you are bridging from Ethereum to Solana you would return `'0x1234567890123456789012345678901234567890'`,
6851
+ * because the source chain of the bridge transfer is Ethereum.
6852
+ */
6853
+ resolveFeeRecipientAddress: FeeRecipientFunction<AdapterCapabilities, AdapterCapabilities>;
6854
+ } | {
6855
+ computeFee?: never;
6856
+ /**
6857
+ * Calculate the fee to charge for the bridge transfer using smallest-unit amounts.
6858
+ *
6859
+ * @deprecated Use `computeFee` instead, which receives human-readable amounts.
6860
+ *
6861
+ * The `params.amount` is in smallest units (e.g., `'100000000'` for 100 USDC).
6862
+ */
6863
+ calculateFee: FeeFunction<AdapterCapabilities, AdapterCapabilities>;
6864
+ /**
6865
+ * A function that returns the fee recipient for a bridge transfer.
6866
+ * The value returned from the function represents the address that will receive the fee on the source chain of the bridge transfer.
6867
+ * The fee recipient address **must be a valid address for the source chain** of the bridge transfer.
6868
+ *
6869
+ * For example: if you are bridging from Ethereum to Solana you would return `'0x1234567890123456789012345678901234567890'`,
6870
+ * because the source chain of the bridge transfer is Ethereum.
6871
+ */
6872
+ resolveFeeRecipientAddress: FeeRecipientFunction<AdapterCapabilities, AdapterCapabilities>;
6873
+ };
6065
6874
  /**
6066
6875
  * Parameters for initiating a cross-chain USDC bridge transfer.
6067
6876
  *
@@ -6233,6 +7042,24 @@ interface EarnConfig {
6233
7042
  * Format: `KIT_KEY:<keyId>:<keySecret>`
6234
7043
  */
6235
7044
  readonly kitKey?: string | undefined;
7045
+ /**
7046
+ * Optional base URL override for the Earn Service API.
7047
+ *
7048
+ * Defaults to `https://api.circle.com` when omitted. Override for testing
7049
+ * against staging or local environments.
7050
+ */
7051
+ readonly baseUrl?: string | undefined;
7052
+ /**
7053
+ * Enable or disable atomic batched transaction execution.
7054
+ *
7055
+ * When `true` (or `undefined` / omitted), same-chain deposit and withdraw
7056
+ * bundle the approve and execute calls into one adapter-native atomic batch
7057
+ * when the connected wallet supports it. Set to `false` to force the
7058
+ * sequential approve → execute flow.
7059
+ *
7060
+ * @defaultValue `undefined` (batching attempted when the wallet supports it)
7061
+ */
7062
+ readonly batchTransactions?: boolean | undefined;
6236
7063
  }
6237
7064
  /**
6238
7065
  * Parameters for fetching vault information.
@@ -6665,6 +7492,122 @@ interface GetClaimRewardsQuoteParams<TFromAdapterCapabilities extends AdapterCap
6665
7492
  */
6666
7493
  type EarnOperationParams = AnyDepositParams | WithdrawParams | ClaimRewardsParams | GetVaultsParams | ExploreVaultsParams | ExploreVaultsIteratorParams | GetPositionParams | GetDepositQuoteParams | GetWithdrawalQuoteParams | GetClaimRewardsQuoteParams;
6667
7494
 
7495
+ interface CustomFeeConfig {
7496
+ recipientAddress: string;
7497
+ value: string;
7498
+ }
7499
+ /**
7500
+ * Data needed to retry a mint that failed after the transfer was
7501
+ * already committed (funds locked).
7502
+ *
7503
+ * Obtain these values from the KitError (TRANSACTION_REVERTED) thrown when
7504
+ * the on-chain mint step fails. The attestation and signature are available
7505
+ * in `error.cause.trace`.
7506
+ */
7507
+ interface RetryMintConfig {
7508
+ /** The attestation hex string returned by the Gateway `/v1/transfer` API. */
7509
+ attestation: string;
7510
+ /** The attestation signature hex string returned by `/v1/transfer`. */
7511
+ signature: string;
7512
+ }
7513
+ interface SpendConfig {
7514
+ customFee?: CustomFeeConfig;
7515
+ /**
7516
+ * When provided, skips the estimate/sign/transfer steps and proceeds
7517
+ * directly to the on-chain mint using a previously obtained attestation.
7518
+ *
7519
+ * Use this to retry a mint that failed due to an RPC or network issue
7520
+ * after the transfer was already committed.
7521
+ *
7522
+ * @remarks
7523
+ * The `useForwarder` flag on the destination is ignored during retry
7524
+ * because the attestation was already issued — the Forwarding Service
7525
+ * is only involved in the initial transfer, not re-mints.
7526
+ */
7527
+ retry?: RetryMintConfig;
7528
+ }
7529
+ interface ResolvedAllocation {
7530
+ amount: string;
7531
+ chain: ChainDefinition;
7532
+ }
7533
+ interface ResolvedSpendSource<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> {
7534
+ adapter: Adapter<TAdapterCapabilities>;
7535
+ allocations: ResolvedAllocation[];
7536
+ address?: string;
7537
+ sourceAccount?: string;
7538
+ }
7539
+ interface ResolvedSpendDestination<TAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> {
7540
+ adapter?: Adapter<TAdapterCapabilities>;
7541
+ chain: ChainDefinition;
7542
+ recipientAddress?: string;
7543
+ address?: string;
7544
+ useForwarder?: boolean;
7545
+ }
7546
+ interface ResolvedSpendParams<TFromAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities = AdapterCapabilities> {
7547
+ from: ResolvedSpendSource<TFromAdapterCapabilities>[];
7548
+ to: ResolvedSpendDestination<TToAdapterCapabilities>;
7549
+ token: SupportedToken;
7550
+ config?: SpendConfig;
7551
+ }
7552
+ /**
7553
+ * Function that computes the fee amount (in human-readable units, e.g. "10.5")
7554
+ * given the resolved spend parameters.
7555
+ */
7556
+ type SpendFeeFunction = (params: ResolvedSpendParams) => Promise<string> | string;
7557
+ /**
7558
+ * Function that resolves the fee recipient address for a spend.
7559
+ * Called once per spend, against the resolved **destination** chain —
7560
+ * every fee burn intent in a spend mints to that single chain
7561
+ * regardless of which source chain(s) funded it, so only one
7562
+ * recipient address (valid on the destination chain) is ever needed.
7563
+ */
7564
+ type SpendFeeRecipientFunction = (destinationChain: ChainDefinition, params: ResolvedSpendParams) => Promise<string> | string;
7565
+ /**
7566
+ * Policy for computing and routing custom developer fees.
7567
+ *
7568
+ * **Important:** When the kit invokes `computeFee` and
7569
+ * `resolveFeeRecipientAddress`, the `params` argument may be the
7570
+ * **raw, unresolved** `SpendParams` (cast to `ResolvedSpendParams`).
7571
+ * Fields that only exist after resolution (e.g. per-source allocations)
7572
+ * may be `undefined`. Implementations should only rely on top-level
7573
+ * fields such as `to`, `token`, and `amount`.
7574
+ *
7575
+ * @remarks
7576
+ * `resolveFeeRecipientAddress` is optional when you configure
7577
+ * {@link UnifiedBalanceKit.setFeeRecipients} instead — the declarative
7578
+ * map takes priority over this callback when both are present. Provide
7579
+ * exactly one of the two; a policy with neither throws at spend time.
7580
+ */
7581
+ interface CustomFeePolicy {
7582
+ computeFee: SpendFeeFunction;
7583
+ resolveFeeRecipientAddress?: SpendFeeRecipientFunction;
7584
+ }
7585
+
7586
+ /**
7587
+ * Runtime array of token identifiers supported by the unified-balance-kit.
7588
+ *
7589
+ * @example
7590
+ * ```typescript
7591
+ * import { SUPPORTED_TOKENS } from '@circle-fin/unified-balance-kit'
7592
+ *
7593
+ * if (SUPPORTED_TOKENS.includes('USDC')) {
7594
+ * console.log('USDC is supported')
7595
+ * }
7596
+ * ```
7597
+ */
7598
+ declare const SUPPORTED_TOKENS: readonly ["USDC"];
7599
+ /**
7600
+ * Token identifiers supported by the unified-balance-kit.
7601
+ *
7602
+ * @example
7603
+ * ```typescript
7604
+ * import type { SupportedToken } from '@circle-fin/unified-balance-kit'
7605
+ *
7606
+ * const token: SupportedToken = 'USDC'
7607
+ * ```
7608
+ */
7609
+ type SupportedToken = (typeof SUPPORTED_TOKENS)[number];
7610
+
6668
7611
  /**
6669
7612
  * Operation types that support the `getFee`/`getFeeRecipient` hooks.
6670
7613
  */
@@ -6695,6 +7638,31 @@ interface OperationParamsMap {
6695
7638
  swap: SwapParams;
6696
7639
  earn: EarnOperationParams;
6697
7640
  }
7641
+ /**
7642
+ * Operation-scoped custom fee policies configured at the AppKit level.
7643
+ *
7644
+ * Each property is optional so consumers can enable custom fees only for the
7645
+ * operation they use. AppKit forwards the supplied policy to the matching
7646
+ * underlying kit when that operation runs.
7647
+ *
7648
+ * @example
7649
+ * ```typescript
7650
+ * const policy: AppKitCustomFeePolicy = {
7651
+ * bridge: {
7652
+ * computeFee: () => '1.00',
7653
+ * resolveFeeRecipientAddress: () => '0x1234567890123456789012345678901234567890',
7654
+ * },
7655
+ * }
7656
+ * ```
7657
+ */
7658
+ interface AppKitCustomFeePolicy {
7659
+ /** Custom fee policy forwarded to BridgeKit bridge operations. */
7660
+ bridge?: CustomFeePolicy$1;
7661
+ /** Custom fee policy forwarded to SwapKit swap operations. */
7662
+ swap?: CustomFeePolicy$2;
7663
+ /** Custom fee policy forwarded to UnifiedBalanceKit spend operations. */
7664
+ unifiedBalance?: CustomFeePolicy;
7665
+ }
6698
7666
  /**
6699
7667
  * Context interface for the AppKit with strongly typed getFee method.
6700
7668
  *
@@ -6782,6 +7750,14 @@ interface AppKitContext {
6782
7750
  chain: ChainDefinition;
6783
7751
  params: OperationParamsMap[T];
6784
7752
  }): Promise<string>;
7753
+ /**
7754
+ * Operation-scoped custom fee policies.
7755
+ *
7756
+ * Prefer {@link AppKit.setCustomFeePolicy} for runtime configuration. This
7757
+ * context property is read by the internal kit factories when AppKit creates
7758
+ * BridgeKit and SwapKit instances for each operation.
7759
+ */
7760
+ customFeePolicy?: AppKitCustomFeePolicy;
6785
7761
  /**
6786
7762
  * Event handlers registered for AppKit operations.
6787
7763
  *