@circle-fin/app-kit 1.12.1 → 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.
package/bridge.d.ts CHANGED
@@ -559,6 +559,19 @@ interface GatewayV1Contracts {
559
559
  * @example "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48"
560
560
  */
561
561
  depositForHandler?: string;
562
+ /**
563
+ * The address of the `GenericExecutor` contract.
564
+ *
565
+ * @description Optional. The contract that acts as `mintRecipient` and
566
+ * `destinationCaller` for the CCTP v2 prepaid FORWARD path. It receives the
567
+ * CCTP mint and calls {@link GatewayV1Contracts.depositForHandler} to
568
+ * complete the fast deposit into the {@link GatewayV1Contracts.wallet}.
569
+ * Present only on chains that are fast-deposit destinations; other Gateway
570
+ * chains omit it.
571
+ *
572
+ * @example "0xFa7be2f04F3Ad4ca969260729c6d45B5625984A7"
573
+ */
574
+ genericExecutor?: string;
562
575
  }
563
576
  /**
564
577
  * Versioned map of Gateway contract configurations.
@@ -718,6 +731,8 @@ declare enum Blockchain {
718
731
  Optimism_Sepolia = "Optimism_Sepolia",
719
732
  Pharos = "Pharos",
720
733
  Pharos_Testnet = "Pharos_Testnet",
734
+ Plasma = "Plasma",
735
+ Plasma_Testnet = "Plasma_Testnet",
721
736
  Polkadot_Asset_Hub = "Polkadot_Asset_Hub",
722
737
  Polkadot_Westmint = "Polkadot_Westmint",
723
738
  Plume = "Plume",
@@ -946,6 +961,7 @@ declare enum BridgeChain {
946
961
  Morph = "Morph",
947
962
  Optimism = "Optimism",
948
963
  Pharos = "Pharos",
964
+ Plasma = "Plasma",
949
965
  Plume = "Plume",
950
966
  Polygon = "Polygon",
951
967
  Sei = "Sei",
@@ -971,6 +987,7 @@ declare enum BridgeChain {
971
987
  Morph_Testnet = "Morph_Testnet",
972
988
  Optimism_Sepolia = "Optimism_Sepolia",
973
989
  Pharos_Testnet = "Pharos_Testnet",
990
+ Plasma_Testnet = "Plasma_Testnet",
974
991
  Plume_Testnet = "Plume_Testnet",
975
992
  Polygon_Amoy_Testnet = "Polygon_Amoy_Testnet",
976
993
  Sei_Testnet = "Sei_Testnet",
@@ -2652,7 +2669,7 @@ interface ExecuteParams {
2652
2669
  * fromAddress: '0x...',
2653
2670
  * toAddress: '0x...',
2654
2671
  * amount: '1000000',
2655
- * apiKey: 'KIT_KEY:...',
2672
+ * apiKey: 'TEST_API_KEY:...',
2656
2673
  * })
2657
2674
  *
2658
2675
  * // Build token inputs with permit
@@ -2796,7 +2813,7 @@ interface ExecuteSwapEVMParams extends ActionParameters {
2796
2813
  * fromAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
2797
2814
  * toAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
2798
2815
  * amount: '1000000',
2799
- * apiKey: 'KIT_KEY:...',
2816
+ * apiKey: 'TEST_API_KEY:...',
2800
2817
  * })
2801
2818
  *
2802
2819
  * // Prepare action parameters
@@ -5459,6 +5476,48 @@ TChainDefinition extends ChainDefinition = ChainDefinition> extends WalletContex
5459
5476
  * Must be a valid address format for the specified blockchain.
5460
5477
  */
5461
5478
  recipientAddress?: string;
5479
+ /**
5480
+ * Optional destination dApp deposit action for a fast cross-chain transfer.
5481
+ *
5482
+ * When set, the burned USDC is minted to Circle's GenericExecutor on the
5483
+ * destination chain, which calls the registered dApp (for example, a Gateway
5484
+ * `depositFor`) in the same relayed flow. Consumed by the CCTP v2 provider's
5485
+ * executor-deposit path; requires `useForwarder: true`.
5486
+ *
5487
+ * @see {@link BridgeDepositAction}
5488
+ */
5489
+ deposit?: BridgeDepositAction;
5490
+ }
5491
+ /**
5492
+ * Destination dApp deposit action for a fast cross-chain transfer.
5493
+ *
5494
+ * When present on a bridge destination, the CCTP v2 provider routes the
5495
+ * transfer through Circle's GenericExecutor: the burned USDC is minted to the
5496
+ * executor on the destination chain, which then calls the registered dApp (for
5497
+ * example, a Gateway `depositFor`) in the same relayed flow. Encoded into
5498
+ * executor hookData via `buildDepositForGenericExecutorPayload`.
5499
+ *
5500
+ * @example
5501
+ * ```typescript
5502
+ * import type { BridgeDepositAction } from '@core/provider'
5503
+ *
5504
+ * const deposit: BridgeDepositAction = {
5505
+ * dappId: 'gateway_deposit',
5506
+ * params: ['0xTokenMessengerWithFees', '0xDepositAccount', 0n],
5507
+ * }
5508
+ * ```
5509
+ */
5510
+ interface BridgeDepositAction {
5511
+ /**
5512
+ * Registered dApp identifier the GenericExecutor invokes on the destination
5513
+ * chain (for example, `'gateway_deposit'`).
5514
+ */
5515
+ dappId: string;
5516
+ /**
5517
+ * Positional arguments for the dApp function, in ABI order. Dynamic amount
5518
+ * slots are filled in by the executor from the minted amount.
5519
+ */
5520
+ params: readonly unknown[];
5462
5521
  }
5463
5522
  /**
5464
5523
  * Parameters for executing a cross-chain bridge operation.
@@ -5982,6 +6041,30 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
5982
6041
  useForwarder?: boolean;
5983
6042
  }) | ForwarderDestination<TChainIdentifier>;
5984
6043
 
6044
+ /**
6045
+ * Configure how CCTP and forwarding fees are collected for a bridge.
6046
+ *
6047
+ * @remarks
6048
+ * Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
6049
+ * destination amount. Bridge Kit obtains a signed fee quote, collects the fee
6050
+ * in source-chain USDC, and leaves the destination mint unreduced. Omit the
6051
+ * option (or use `'destination'`) to preserve the existing max-fee behavior.
6052
+ *
6053
+ * @example
6054
+ * ```typescript
6055
+ * import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
6056
+ *
6057
+ * const config: BridgeExecutionConfig = {
6058
+ * transferSpeed: 'FAST',
6059
+ * feePayment: 'source',
6060
+ * }
6061
+ * ```
6062
+ * @since 1.14.0
6063
+ */
6064
+ interface BridgeExecutionConfig extends BridgeConfig {
6065
+ /** Select source-side signed fees or the legacy destination-side fee path. */
6066
+ feePayment?: 'source' | 'destination';
6067
+ }
5985
6068
  type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
5986
6069
  type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
5987
6070
  /**
@@ -6142,7 +6225,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
6142
6225
  * Optional bridge configuration (e.g., transfer speed).
6143
6226
  * If omitted, defaults will be used
6144
6227
  */
6145
- config?: BridgeConfig;
6228
+ config?: BridgeExecutionConfig;
6146
6229
  /**
6147
6230
  * The token to transfer. Defaults to 'USDC'.
6148
6231
  * If omitted, the provider will use 'USDC' by default.
@@ -6169,6 +6252,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
6169
6252
  * ```
6170
6253
  */
6171
6254
  invocationMeta?: InvocationMeta;
6255
+ /**
6256
+ * Reuse the opaque signed quote returned by a receive-exact estimate.
6257
+ *
6258
+ * @remarks
6259
+ * Bridge Kit validates a supplied quote against the exact transfer and fails
6260
+ * when it is invalid, mismatched, expired, or too close to expiry. Omit this
6261
+ * value to let Bridge Kit fetch a fresh quote automatically. Never log or
6262
+ * decode it.
6263
+ */
6264
+ quote?: string;
6172
6265
  }
6173
6266
 
6174
6267
  /**
@@ -6284,12 +6377,21 @@ interface ServiceSwapConfig {
6284
6377
  recipientAddress?: string;
6285
6378
  };
6286
6379
  /**
6287
- * Stablecoin Service Kit Key used to authenticate service-backed swap
6288
- * requests.
6380
+ * Circle API key used to authenticate service-backed swap requests.
6381
+ *
6382
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
6383
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
6289
6384
  *
6290
6385
  * Treat this value as a credential. Do not log it, embed it in client-side
6291
6386
  * source, or expose it in telemetry.
6292
6387
  */
6388
+ apiKey?: string | undefined;
6389
+ /**
6390
+ * Circle API key used to authenticate service-backed swap requests.
6391
+ *
6392
+ * @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
6393
+ * when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6394
+ */
6293
6395
  kitKey?: string;
6294
6396
  /**
6295
6397
  * DEX aggregator identifier used to source the swap route.
@@ -6767,12 +6869,21 @@ interface SwapConfig {
6767
6869
  recipientAddress: string;
6768
6870
  };
6769
6871
  /**
6770
- * Stablecoin Service Kit Key used to authenticate service-backed swap
6771
- * requests.
6872
+ * Circle API key used to authenticate service-backed swap requests.
6873
+ *
6874
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
6875
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
6772
6876
  *
6773
6877
  * Treat this value as a credential. Do not log it, embed it in client-side
6774
6878
  * source, or expose it in telemetry.
6775
6879
  */
6880
+ apiKey?: string | undefined;
6881
+ /**
6882
+ * Circle API key used to authenticate service-backed swap requests.
6883
+ *
6884
+ * @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
6885
+ * `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6886
+ */
6776
6887
  kitKey?: string;
6777
6888
  }
6778
6889
  /**
@@ -6901,29 +7012,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
6901
7012
  * Configuration options for earn operations.
6902
7013
  *
6903
7014
  * EarnKit supports dual-mode authentication: operations work both with
6904
- * and without a Kit Key. When present, the Kit Key enables permissioned
7015
+ * and without an API key. When present, the API key enables permissioned
6905
7016
  * features like integrator attribution tracking.
6906
7017
  *
6907
7018
  * @example
6908
7019
  * ```typescript
6909
- * // Permissionless (no Kit Key)
7020
+ * // Permissionless (no API key)
6910
7021
  * const config: EarnConfig = {}
6911
7022
  *
6912
- * // Permissioned (with Kit Key)
7023
+ * // Permissioned (with API key)
6913
7024
  * const config: EarnConfig = {
6914
- * kitKey: 'KIT_KEY:keyId:keySecret',
7025
+ * apiKey: 'TEST_API_KEY:keyId:keySecret',
6915
7026
  * }
6916
7027
  * ```
6917
7028
  */
6918
7029
  interface EarnConfig {
6919
7030
  /**
6920
- * Optional Kit Key for permissioned access.
7031
+ * Optional Circle API key for permissioned access.
6921
7032
  *
6922
7033
  * When provided, enables integrator attribution tracking and
6923
7034
  * higher rate limits. When omitted, the SDK operates in
6924
7035
  * permissionless mode.
6925
7036
  *
6926
- * Format: `KIT_KEY:<keyId>:<keySecret>`
7037
+ * Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
7038
+ * `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
7039
+ */
7040
+ readonly apiKey?: string | undefined;
7041
+ /**
7042
+ * Optional Circle API key for permissioned access.
7043
+ *
7044
+ * @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
7045
+ * `apiKey` is omitted, and `apiKey` takes precedence when both are set.
6927
7046
  */
6928
7047
  readonly kitKey?: string | undefined;
6929
7048
  /**
@@ -7690,13 +7809,18 @@ interface AppKitContext {
7690
7809
  */
7691
7810
  disableErrorReporting?: boolean;
7692
7811
  /**
7693
- * Custom HTTP headers forwarded with the underlying CCTP provider's
7694
- * attestation (Iris) API requests made by bridge operations.
7812
+ * Custom HTTP headers forwarded with Circle API requests made by the
7813
+ * underlying kits: the CCTP provider's attestation (Iris) requests for
7814
+ * bridge operations, and the Gateway API requests for unified-balance
7815
+ * operations.
7695
7816
  *
7696
7817
  * @remarks
7697
7818
  * Headers are merged on top of the SDK defaults (such as `Content-Type`)
7698
- * rather than replacing them. The header is forwarded as-is to Circle's API;
7699
- * the SDK does not interpret it.
7819
+ * rather than replacing them. Each header is forwarded as-is to Circle's API;
7820
+ * the SDK does not interpret it. The same map is forwarded to every relevant
7821
+ * kit, so a header a given API ignores is simply a no-op there. A
7822
+ * `unifiedBalance.headers` value, if provided, takes precedence for the
7823
+ * unified-balance kit.
7700
7824
  */
7701
7825
  headers?: Record<string, string>;
7702
7826
  }