@circle-fin/app-kit 1.12.1 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/context.d.mts CHANGED
@@ -718,6 +718,8 @@ declare enum Blockchain {
718
718
  Optimism_Sepolia = "Optimism_Sepolia",
719
719
  Pharos = "Pharos",
720
720
  Pharos_Testnet = "Pharos_Testnet",
721
+ Plasma = "Plasma",
722
+ Plasma_Testnet = "Plasma_Testnet",
721
723
  Polkadot_Asset_Hub = "Polkadot_Asset_Hub",
722
724
  Polkadot_Westmint = "Polkadot_Westmint",
723
725
  Plume = "Plume",
@@ -946,6 +948,7 @@ declare enum BridgeChain {
946
948
  Morph = "Morph",
947
949
  Optimism = "Optimism",
948
950
  Pharos = "Pharos",
951
+ Plasma = "Plasma",
949
952
  Plume = "Plume",
950
953
  Polygon = "Polygon",
951
954
  Sei = "Sei",
@@ -971,6 +974,7 @@ declare enum BridgeChain {
971
974
  Morph_Testnet = "Morph_Testnet",
972
975
  Optimism_Sepolia = "Optimism_Sepolia",
973
976
  Pharos_Testnet = "Pharos_Testnet",
977
+ Plasma_Testnet = "Plasma_Testnet",
974
978
  Plume_Testnet = "Plume_Testnet",
975
979
  Polygon_Amoy_Testnet = "Polygon_Amoy_Testnet",
976
980
  Sei_Testnet = "Sei_Testnet",
@@ -2652,7 +2656,7 @@ interface ExecuteParams {
2652
2656
  * fromAddress: '0x...',
2653
2657
  * toAddress: '0x...',
2654
2658
  * amount: '1000000',
2655
- * apiKey: 'KIT_KEY:...',
2659
+ * apiKey: 'TEST_API_KEY:...',
2656
2660
  * })
2657
2661
  *
2658
2662
  * // Build token inputs with permit
@@ -2796,7 +2800,7 @@ interface ExecuteSwapEVMParams extends ActionParameters {
2796
2800
  * fromAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
2797
2801
  * toAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
2798
2802
  * amount: '1000000',
2799
- * apiKey: 'KIT_KEY:...',
2803
+ * apiKey: 'TEST_API_KEY:...',
2800
2804
  * })
2801
2805
  *
2802
2806
  * // Prepare action parameters
@@ -5796,6 +5800,30 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
5796
5800
  useForwarder?: boolean;
5797
5801
  }) | ForwarderDestination<TChainIdentifier>;
5798
5802
 
5803
+ /**
5804
+ * Configure how CCTP and forwarding fees are collected for a bridge.
5805
+ *
5806
+ * @remarks
5807
+ * Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
5808
+ * destination amount. Bridge Kit obtains a signed fee quote, collects the fee
5809
+ * in source-chain USDC, and leaves the destination mint unreduced. Omit the
5810
+ * option (or use `'destination'`) to preserve the existing max-fee behavior.
5811
+ *
5812
+ * @example
5813
+ * ```typescript
5814
+ * import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
5815
+ *
5816
+ * const config: BridgeExecutionConfig = {
5817
+ * transferSpeed: 'FAST',
5818
+ * feePayment: 'source',
5819
+ * }
5820
+ * ```
5821
+ * @since 1.14.0
5822
+ */
5823
+ interface BridgeExecutionConfig extends BridgeConfig {
5824
+ /** Select source-side signed fees or the legacy destination-side fee path. */
5825
+ feePayment?: 'source' | 'destination';
5826
+ }
5799
5827
  type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
5800
5828
  type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
5801
5829
  /**
@@ -5956,7 +5984,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
5956
5984
  * Optional bridge configuration (e.g., transfer speed).
5957
5985
  * If omitted, defaults will be used
5958
5986
  */
5959
- config?: BridgeConfig;
5987
+ config?: BridgeExecutionConfig;
5960
5988
  /**
5961
5989
  * The token to transfer. Defaults to 'USDC'.
5962
5990
  * If omitted, the provider will use 'USDC' by default.
@@ -5983,6 +6011,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
5983
6011
  * ```
5984
6012
  */
5985
6013
  invocationMeta?: InvocationMeta;
6014
+ /**
6015
+ * Reuse the opaque signed quote returned by a receive-exact estimate.
6016
+ *
6017
+ * @remarks
6018
+ * Bridge Kit validates a supplied quote against the exact transfer and fails
6019
+ * when it is invalid, mismatched, expired, or too close to expiry. Omit this
6020
+ * value to let Bridge Kit fetch a fresh quote automatically. Never log or
6021
+ * decode it.
6022
+ */
6023
+ quote?: string;
5986
6024
  }
5987
6025
 
5988
6026
  /**
@@ -6098,12 +6136,21 @@ interface ServiceSwapConfig {
6098
6136
  recipientAddress?: string;
6099
6137
  };
6100
6138
  /**
6101
- * Stablecoin Service Kit Key used to authenticate service-backed swap
6102
- * requests.
6139
+ * Circle API key used to authenticate service-backed swap requests.
6140
+ *
6141
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
6142
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
6103
6143
  *
6104
6144
  * Treat this value as a credential. Do not log it, embed it in client-side
6105
6145
  * source, or expose it in telemetry.
6106
6146
  */
6147
+ apiKey?: string | undefined;
6148
+ /**
6149
+ * Circle API key used to authenticate service-backed swap requests.
6150
+ *
6151
+ * @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
6152
+ * when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6153
+ */
6107
6154
  kitKey?: string;
6108
6155
  /**
6109
6156
  * DEX aggregator identifier used to source the swap route.
@@ -6581,12 +6628,21 @@ interface SwapConfig {
6581
6628
  recipientAddress: string;
6582
6629
  };
6583
6630
  /**
6584
- * Stablecoin Service Kit Key used to authenticate service-backed swap
6585
- * requests.
6631
+ * Circle API key used to authenticate service-backed swap requests.
6632
+ *
6633
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
6634
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
6586
6635
  *
6587
6636
  * Treat this value as a credential. Do not log it, embed it in client-side
6588
6637
  * source, or expose it in telemetry.
6589
6638
  */
6639
+ apiKey?: string | undefined;
6640
+ /**
6641
+ * Circle API key used to authenticate service-backed swap requests.
6642
+ *
6643
+ * @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
6644
+ * `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6645
+ */
6590
6646
  kitKey?: string;
6591
6647
  }
6592
6648
  /**
@@ -6715,29 +6771,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
6715
6771
  * Configuration options for earn operations.
6716
6772
  *
6717
6773
  * EarnKit supports dual-mode authentication: operations work both with
6718
- * and without a Kit Key. When present, the Kit Key enables permissioned
6774
+ * and without an API key. When present, the API key enables permissioned
6719
6775
  * features like integrator attribution tracking.
6720
6776
  *
6721
6777
  * @example
6722
6778
  * ```typescript
6723
- * // Permissionless (no Kit Key)
6779
+ * // Permissionless (no API key)
6724
6780
  * const config: EarnConfig = {}
6725
6781
  *
6726
- * // Permissioned (with Kit Key)
6782
+ * // Permissioned (with API key)
6727
6783
  * const config: EarnConfig = {
6728
- * kitKey: 'KIT_KEY:keyId:keySecret',
6784
+ * apiKey: 'TEST_API_KEY:keyId:keySecret',
6729
6785
  * }
6730
6786
  * ```
6731
6787
  */
6732
6788
  interface EarnConfig {
6733
6789
  /**
6734
- * Optional Kit Key for permissioned access.
6790
+ * Optional Circle API key for permissioned access.
6735
6791
  *
6736
6792
  * When provided, enables integrator attribution tracking and
6737
6793
  * higher rate limits. When omitted, the SDK operates in
6738
6794
  * permissionless mode.
6739
6795
  *
6740
- * Format: `KIT_KEY:<keyId>:<keySecret>`
6796
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
6797
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
6798
+ */
6799
+ readonly apiKey?: string | undefined;
6800
+ /**
6801
+ * Optional Circle API key for permissioned access.
6802
+ *
6803
+ * @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
6804
+ * `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6741
6805
  */
6742
6806
  readonly kitKey?: string | undefined;
6743
6807
  /**
@@ -7504,13 +7568,18 @@ interface AppKitContext {
7504
7568
  */
7505
7569
  disableErrorReporting?: boolean;
7506
7570
  /**
7507
- * Custom HTTP headers forwarded with the underlying CCTP provider's
7508
- * attestation (Iris) API requests made by bridge operations.
7571
+ * Custom HTTP headers forwarded with Circle API requests made by the
7572
+ * underlying kits: the CCTP provider's attestation (Iris) requests for
7573
+ * bridge operations, and the Gateway API requests for unified-balance
7574
+ * operations.
7509
7575
  *
7510
7576
  * @remarks
7511
7577
  * Headers are merged on top of the SDK defaults (such as `Content-Type`)
7512
- * rather than replacing them. The header is forwarded as-is to Circle's API;
7513
- * the SDK does not interpret it.
7578
+ * rather than replacing them. Each header is forwarded as-is to Circle's API;
7579
+ * the SDK does not interpret it. The same map is forwarded to every relevant
7580
+ * kit, so a header a given API ignores is simply a no-op there. A
7581
+ * `unifiedBalance.headers` value, if provided, takes precedence for the
7582
+ * unified-balance kit.
7514
7583
  */
7515
7584
  headers?: Record<string, string>;
7516
7585
  }
package/context.d.ts CHANGED
@@ -718,6 +718,8 @@ declare enum Blockchain {
718
718
  Optimism_Sepolia = "Optimism_Sepolia",
719
719
  Pharos = "Pharos",
720
720
  Pharos_Testnet = "Pharos_Testnet",
721
+ Plasma = "Plasma",
722
+ Plasma_Testnet = "Plasma_Testnet",
721
723
  Polkadot_Asset_Hub = "Polkadot_Asset_Hub",
722
724
  Polkadot_Westmint = "Polkadot_Westmint",
723
725
  Plume = "Plume",
@@ -946,6 +948,7 @@ declare enum BridgeChain {
946
948
  Morph = "Morph",
947
949
  Optimism = "Optimism",
948
950
  Pharos = "Pharos",
951
+ Plasma = "Plasma",
949
952
  Plume = "Plume",
950
953
  Polygon = "Polygon",
951
954
  Sei = "Sei",
@@ -971,6 +974,7 @@ declare enum BridgeChain {
971
974
  Morph_Testnet = "Morph_Testnet",
972
975
  Optimism_Sepolia = "Optimism_Sepolia",
973
976
  Pharos_Testnet = "Pharos_Testnet",
977
+ Plasma_Testnet = "Plasma_Testnet",
974
978
  Plume_Testnet = "Plume_Testnet",
975
979
  Polygon_Amoy_Testnet = "Polygon_Amoy_Testnet",
976
980
  Sei_Testnet = "Sei_Testnet",
@@ -2652,7 +2656,7 @@ interface ExecuteParams {
2652
2656
  * fromAddress: '0x...',
2653
2657
  * toAddress: '0x...',
2654
2658
  * amount: '1000000',
2655
- * apiKey: 'KIT_KEY:...',
2659
+ * apiKey: 'TEST_API_KEY:...',
2656
2660
  * })
2657
2661
  *
2658
2662
  * // Build token inputs with permit
@@ -2796,7 +2800,7 @@ interface ExecuteSwapEVMParams extends ActionParameters {
2796
2800
  * fromAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
2797
2801
  * toAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
2798
2802
  * amount: '1000000',
2799
- * apiKey: 'KIT_KEY:...',
2803
+ * apiKey: 'TEST_API_KEY:...',
2800
2804
  * })
2801
2805
  *
2802
2806
  * // Prepare action parameters
@@ -5796,6 +5800,30 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
5796
5800
  useForwarder?: boolean;
5797
5801
  }) | ForwarderDestination<TChainIdentifier>;
5798
5802
 
5803
+ /**
5804
+ * Configure how CCTP and forwarding fees are collected for a bridge.
5805
+ *
5806
+ * @remarks
5807
+ * Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
5808
+ * destination amount. Bridge Kit obtains a signed fee quote, collects the fee
5809
+ * in source-chain USDC, and leaves the destination mint unreduced. Omit the
5810
+ * option (or use `'destination'`) to preserve the existing max-fee behavior.
5811
+ *
5812
+ * @example
5813
+ * ```typescript
5814
+ * import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
5815
+ *
5816
+ * const config: BridgeExecutionConfig = {
5817
+ * transferSpeed: 'FAST',
5818
+ * feePayment: 'source',
5819
+ * }
5820
+ * ```
5821
+ * @since 1.14.0
5822
+ */
5823
+ interface BridgeExecutionConfig extends BridgeConfig {
5824
+ /** Select source-side signed fees or the legacy destination-side fee path. */
5825
+ feePayment?: 'source' | 'destination';
5826
+ }
5799
5827
  type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
5800
5828
  type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
5801
5829
  /**
@@ -5956,7 +5984,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
5956
5984
  * Optional bridge configuration (e.g., transfer speed).
5957
5985
  * If omitted, defaults will be used
5958
5986
  */
5959
- config?: BridgeConfig;
5987
+ config?: BridgeExecutionConfig;
5960
5988
  /**
5961
5989
  * The token to transfer. Defaults to 'USDC'.
5962
5990
  * If omitted, the provider will use 'USDC' by default.
@@ -5983,6 +6011,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
5983
6011
  * ```
5984
6012
  */
5985
6013
  invocationMeta?: InvocationMeta;
6014
+ /**
6015
+ * Reuse the opaque signed quote returned by a receive-exact estimate.
6016
+ *
6017
+ * @remarks
6018
+ * Bridge Kit validates a supplied quote against the exact transfer and fails
6019
+ * when it is invalid, mismatched, expired, or too close to expiry. Omit this
6020
+ * value to let Bridge Kit fetch a fresh quote automatically. Never log or
6021
+ * decode it.
6022
+ */
6023
+ quote?: string;
5986
6024
  }
5987
6025
 
5988
6026
  /**
@@ -6098,12 +6136,21 @@ interface ServiceSwapConfig {
6098
6136
  recipientAddress?: string;
6099
6137
  };
6100
6138
  /**
6101
- * Stablecoin Service Kit Key used to authenticate service-backed swap
6102
- * requests.
6139
+ * Circle API key used to authenticate service-backed swap requests.
6140
+ *
6141
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
6142
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
6103
6143
  *
6104
6144
  * Treat this value as a credential. Do not log it, embed it in client-side
6105
6145
  * source, or expose it in telemetry.
6106
6146
  */
6147
+ apiKey?: string | undefined;
6148
+ /**
6149
+ * Circle API key used to authenticate service-backed swap requests.
6150
+ *
6151
+ * @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
6152
+ * when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6153
+ */
6107
6154
  kitKey?: string;
6108
6155
  /**
6109
6156
  * DEX aggregator identifier used to source the swap route.
@@ -6581,12 +6628,21 @@ interface SwapConfig {
6581
6628
  recipientAddress: string;
6582
6629
  };
6583
6630
  /**
6584
- * Stablecoin Service Kit Key used to authenticate service-backed swap
6585
- * requests.
6631
+ * Circle API key used to authenticate service-backed swap requests.
6632
+ *
6633
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
6634
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
6586
6635
  *
6587
6636
  * Treat this value as a credential. Do not log it, embed it in client-side
6588
6637
  * source, or expose it in telemetry.
6589
6638
  */
6639
+ apiKey?: string | undefined;
6640
+ /**
6641
+ * Circle API key used to authenticate service-backed swap requests.
6642
+ *
6643
+ * @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
6644
+ * `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6645
+ */
6590
6646
  kitKey?: string;
6591
6647
  }
6592
6648
  /**
@@ -6715,29 +6771,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
6715
6771
  * Configuration options for earn operations.
6716
6772
  *
6717
6773
  * EarnKit supports dual-mode authentication: operations work both with
6718
- * and without a Kit Key. When present, the Kit Key enables permissioned
6774
+ * and without an API key. When present, the API key enables permissioned
6719
6775
  * features like integrator attribution tracking.
6720
6776
  *
6721
6777
  * @example
6722
6778
  * ```typescript
6723
- * // Permissionless (no Kit Key)
6779
+ * // Permissionless (no API key)
6724
6780
  * const config: EarnConfig = {}
6725
6781
  *
6726
- * // Permissioned (with Kit Key)
6782
+ * // Permissioned (with API key)
6727
6783
  * const config: EarnConfig = {
6728
- * kitKey: 'KIT_KEY:keyId:keySecret',
6784
+ * apiKey: 'TEST_API_KEY:keyId:keySecret',
6729
6785
  * }
6730
6786
  * ```
6731
6787
  */
6732
6788
  interface EarnConfig {
6733
6789
  /**
6734
- * Optional Kit Key for permissioned access.
6790
+ * Optional Circle API key for permissioned access.
6735
6791
  *
6736
6792
  * When provided, enables integrator attribution tracking and
6737
6793
  * higher rate limits. When omitted, the SDK operates in
6738
6794
  * permissionless mode.
6739
6795
  *
6740
- * Format: `KIT_KEY:<keyId>:<keySecret>`
6796
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
6797
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
6798
+ */
6799
+ readonly apiKey?: string | undefined;
6800
+ /**
6801
+ * Optional Circle API key for permissioned access.
6802
+ *
6803
+ * @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
6804
+ * `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6741
6805
  */
6742
6806
  readonly kitKey?: string | undefined;
6743
6807
  /**
@@ -7504,13 +7568,18 @@ interface AppKitContext {
7504
7568
  */
7505
7569
  disableErrorReporting?: boolean;
7506
7570
  /**
7507
- * Custom HTTP headers forwarded with the underlying CCTP provider's
7508
- * attestation (Iris) API requests made by bridge operations.
7571
+ * Custom HTTP headers forwarded with Circle API requests made by the
7572
+ * underlying kits: the CCTP provider's attestation (Iris) requests for
7573
+ * bridge operations, and the Gateway API requests for unified-balance
7574
+ * operations.
7509
7575
  *
7510
7576
  * @remarks
7511
7577
  * Headers are merged on top of the SDK defaults (such as `Content-Type`)
7512
- * rather than replacing them. The header is forwarded as-is to Circle's API;
7513
- * the SDK does not interpret it.
7578
+ * rather than replacing them. Each header is forwarded as-is to Circle's API;
7579
+ * the SDK does not interpret it. The same map is forwarded to every relevant
7580
+ * kit, so a header a given API ignores is simply a no-op there. A
7581
+ * `unifiedBalance.headers` value, if provided, takes precedence for the
7582
+ * unified-balance kit.
7514
7583
  */
7515
7584
  headers?: Record<string, string>;
7516
7585
  }