@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/CHANGELOG.md +59 -0
- package/README.md +31 -12
- package/bridge.cjs +2214 -186
- package/bridge.d.cts +86 -17
- package/bridge.d.mts +86 -17
- package/bridge.d.ts +86 -17
- package/bridge.mjs +2216 -188
- package/chains.cjs +134 -0
- package/chains.d.cts +126 -1
- package/chains.d.mts +126 -1
- package/chains.d.ts +126 -1
- package/chains.mjs +133 -1
- package/context.d.cts +86 -17
- package/context.d.mts +86 -17
- package/context.d.ts +86 -17
- package/earn.cjs +467 -48
- package/earn.d.cts +86 -17
- package/earn.d.mts +86 -17
- package/earn.d.ts +86 -17
- package/earn.mjs +467 -48
- package/estimateBridge.cjs +2214 -186
- package/estimateBridge.d.cts +196 -18
- package/estimateBridge.d.mts +196 -18
- package/estimateBridge.d.ts +196 -18
- package/estimateBridge.mjs +2216 -188
- package/estimateSwap.cjs +571 -131
- package/estimateSwap.d.cts +86 -17
- package/estimateSwap.d.mts +86 -17
- package/estimateSwap.d.ts +86 -17
- package/estimateSwap.mjs +571 -131
- package/index.cjs +2101 -434
- package/index.d.cts +949 -147
- package/index.d.mts +949 -147
- package/index.d.ts +949 -147
- package/index.mjs +2103 -436
- package/package.json +6 -6
- package/swap.cjs +571 -131
- package/swap.d.cts +93 -18
- package/swap.d.mts +93 -18
- package/swap.d.ts +93 -18
- package/swap.mjs +571 -131
- package/unifiedBalance.cjs +384 -67
- package/unifiedBalance.d.cts +76 -2
- package/unifiedBalance.d.mts +76 -2
- package/unifiedBalance.d.ts +76 -2
- package/unifiedBalance.mjs +384 -67
package/estimateSwap.d.cts
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: '
|
|
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: '
|
|
2803
|
+
* apiKey: 'TEST_API_KEY:...',
|
|
2800
2804
|
* })
|
|
2801
2805
|
*
|
|
2802
2806
|
* // Prepare action parameters
|
|
@@ -5950,12 +5954,21 @@ interface ServiceSwapConfig {
|
|
|
5950
5954
|
recipientAddress?: string;
|
|
5951
5955
|
};
|
|
5952
5956
|
/**
|
|
5953
|
-
*
|
|
5954
|
-
*
|
|
5957
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5958
|
+
*
|
|
5959
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
5960
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
5955
5961
|
*
|
|
5956
5962
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
5957
5963
|
* source, or expose it in telemetry.
|
|
5958
5964
|
*/
|
|
5965
|
+
apiKey?: string | undefined;
|
|
5966
|
+
/**
|
|
5967
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5968
|
+
*
|
|
5969
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
5970
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
5971
|
+
*/
|
|
5959
5972
|
kitKey?: string;
|
|
5960
5973
|
/**
|
|
5961
5974
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6486,12 +6499,21 @@ interface SwapConfig {
|
|
|
6486
6499
|
recipientAddress: string;
|
|
6487
6500
|
};
|
|
6488
6501
|
/**
|
|
6489
|
-
*
|
|
6490
|
-
*
|
|
6502
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6503
|
+
*
|
|
6504
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6505
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6491
6506
|
*
|
|
6492
6507
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6493
6508
|
* source, or expose it in telemetry.
|
|
6494
6509
|
*/
|
|
6510
|
+
apiKey?: string | undefined;
|
|
6511
|
+
/**
|
|
6512
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6513
|
+
*
|
|
6514
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6515
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6516
|
+
*/
|
|
6495
6517
|
kitKey?: string;
|
|
6496
6518
|
}
|
|
6497
6519
|
/**
|
|
@@ -6690,6 +6712,30 @@ interface SwapParams<TFromAdapterCapabilities extends AdapterCapabilities = Adap
|
|
|
6690
6712
|
config?: SwapConfig;
|
|
6691
6713
|
}
|
|
6692
6714
|
|
|
6715
|
+
/**
|
|
6716
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
6717
|
+
*
|
|
6718
|
+
* @remarks
|
|
6719
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
6720
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
6721
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
6722
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
6723
|
+
*
|
|
6724
|
+
* @example
|
|
6725
|
+
* ```typescript
|
|
6726
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
6727
|
+
*
|
|
6728
|
+
* const config: BridgeExecutionConfig = {
|
|
6729
|
+
* transferSpeed: 'FAST',
|
|
6730
|
+
* feePayment: 'source',
|
|
6731
|
+
* }
|
|
6732
|
+
* ```
|
|
6733
|
+
* @since 1.14.0
|
|
6734
|
+
*/
|
|
6735
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
6736
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
6737
|
+
feePayment?: 'source' | 'destination';
|
|
6738
|
+
}
|
|
6693
6739
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6694
6740
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6695
6741
|
/**
|
|
@@ -6850,7 +6896,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6850
6896
|
* Optional bridge configuration (e.g., transfer speed).
|
|
6851
6897
|
* If omitted, defaults will be used
|
|
6852
6898
|
*/
|
|
6853
|
-
config?:
|
|
6899
|
+
config?: BridgeExecutionConfig;
|
|
6854
6900
|
/**
|
|
6855
6901
|
* The token to transfer. Defaults to 'USDC'.
|
|
6856
6902
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -6877,6 +6923,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6877
6923
|
* ```
|
|
6878
6924
|
*/
|
|
6879
6925
|
invocationMeta?: InvocationMeta;
|
|
6926
|
+
/**
|
|
6927
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
6928
|
+
*
|
|
6929
|
+
* @remarks
|
|
6930
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
6931
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
6932
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
6933
|
+
* decode it.
|
|
6934
|
+
*/
|
|
6935
|
+
quote?: string;
|
|
6880
6936
|
}
|
|
6881
6937
|
|
|
6882
6938
|
/**
|
|
@@ -6921,29 +6977,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
6921
6977
|
* Configuration options for earn operations.
|
|
6922
6978
|
*
|
|
6923
6979
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
6924
|
-
* and without
|
|
6980
|
+
* and without an API key. When present, the API key enables permissioned
|
|
6925
6981
|
* features like integrator attribution tracking.
|
|
6926
6982
|
*
|
|
6927
6983
|
* @example
|
|
6928
6984
|
* ```typescript
|
|
6929
|
-
* // Permissionless (no
|
|
6985
|
+
* // Permissionless (no API key)
|
|
6930
6986
|
* const config: EarnConfig = {}
|
|
6931
6987
|
*
|
|
6932
|
-
* // Permissioned (with
|
|
6988
|
+
* // Permissioned (with API key)
|
|
6933
6989
|
* const config: EarnConfig = {
|
|
6934
|
-
*
|
|
6990
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
6935
6991
|
* }
|
|
6936
6992
|
* ```
|
|
6937
6993
|
*/
|
|
6938
6994
|
interface EarnConfig {
|
|
6939
6995
|
/**
|
|
6940
|
-
* Optional
|
|
6996
|
+
* Optional Circle API key for permissioned access.
|
|
6941
6997
|
*
|
|
6942
6998
|
* When provided, enables integrator attribution tracking and
|
|
6943
6999
|
* higher rate limits. When omitted, the SDK operates in
|
|
6944
7000
|
* permissionless mode.
|
|
6945
7001
|
*
|
|
6946
|
-
* Format:
|
|
7002
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7003
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7004
|
+
*/
|
|
7005
|
+
readonly apiKey?: string | undefined;
|
|
7006
|
+
/**
|
|
7007
|
+
* Optional Circle API key for permissioned access.
|
|
7008
|
+
*
|
|
7009
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7010
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6947
7011
|
*/
|
|
6948
7012
|
readonly kitKey?: string | undefined;
|
|
6949
7013
|
/**
|
|
@@ -7710,13 +7774,18 @@ interface AppKitContext {
|
|
|
7710
7774
|
*/
|
|
7711
7775
|
disableErrorReporting?: boolean;
|
|
7712
7776
|
/**
|
|
7713
|
-
* Custom HTTP headers forwarded with
|
|
7714
|
-
* attestation (Iris)
|
|
7777
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7778
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7779
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7780
|
+
* operations.
|
|
7715
7781
|
*
|
|
7716
7782
|
* @remarks
|
|
7717
7783
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7718
|
-
* rather than replacing them.
|
|
7719
|
-
* the SDK does not interpret it.
|
|
7784
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7785
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7786
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7787
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7788
|
+
* unified-balance kit.
|
|
7720
7789
|
*/
|
|
7721
7790
|
headers?: Record<string, string>;
|
|
7722
7791
|
}
|
package/estimateSwap.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: '
|
|
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: '
|
|
2803
|
+
* apiKey: 'TEST_API_KEY:...',
|
|
2800
2804
|
* })
|
|
2801
2805
|
*
|
|
2802
2806
|
* // Prepare action parameters
|
|
@@ -5950,12 +5954,21 @@ interface ServiceSwapConfig {
|
|
|
5950
5954
|
recipientAddress?: string;
|
|
5951
5955
|
};
|
|
5952
5956
|
/**
|
|
5953
|
-
*
|
|
5954
|
-
*
|
|
5957
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5958
|
+
*
|
|
5959
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
5960
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
5955
5961
|
*
|
|
5956
5962
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
5957
5963
|
* source, or expose it in telemetry.
|
|
5958
5964
|
*/
|
|
5965
|
+
apiKey?: string | undefined;
|
|
5966
|
+
/**
|
|
5967
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5968
|
+
*
|
|
5969
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
5970
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
5971
|
+
*/
|
|
5959
5972
|
kitKey?: string;
|
|
5960
5973
|
/**
|
|
5961
5974
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6486,12 +6499,21 @@ interface SwapConfig {
|
|
|
6486
6499
|
recipientAddress: string;
|
|
6487
6500
|
};
|
|
6488
6501
|
/**
|
|
6489
|
-
*
|
|
6490
|
-
*
|
|
6502
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6503
|
+
*
|
|
6504
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6505
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6491
6506
|
*
|
|
6492
6507
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6493
6508
|
* source, or expose it in telemetry.
|
|
6494
6509
|
*/
|
|
6510
|
+
apiKey?: string | undefined;
|
|
6511
|
+
/**
|
|
6512
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6513
|
+
*
|
|
6514
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6515
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6516
|
+
*/
|
|
6495
6517
|
kitKey?: string;
|
|
6496
6518
|
}
|
|
6497
6519
|
/**
|
|
@@ -6690,6 +6712,30 @@ interface SwapParams<TFromAdapterCapabilities extends AdapterCapabilities = Adap
|
|
|
6690
6712
|
config?: SwapConfig;
|
|
6691
6713
|
}
|
|
6692
6714
|
|
|
6715
|
+
/**
|
|
6716
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
6717
|
+
*
|
|
6718
|
+
* @remarks
|
|
6719
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
6720
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
6721
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
6722
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
6723
|
+
*
|
|
6724
|
+
* @example
|
|
6725
|
+
* ```typescript
|
|
6726
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
6727
|
+
*
|
|
6728
|
+
* const config: BridgeExecutionConfig = {
|
|
6729
|
+
* transferSpeed: 'FAST',
|
|
6730
|
+
* feePayment: 'source',
|
|
6731
|
+
* }
|
|
6732
|
+
* ```
|
|
6733
|
+
* @since 1.14.0
|
|
6734
|
+
*/
|
|
6735
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
6736
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
6737
|
+
feePayment?: 'source' | 'destination';
|
|
6738
|
+
}
|
|
6693
6739
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6694
6740
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6695
6741
|
/**
|
|
@@ -6850,7 +6896,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6850
6896
|
* Optional bridge configuration (e.g., transfer speed).
|
|
6851
6897
|
* If omitted, defaults will be used
|
|
6852
6898
|
*/
|
|
6853
|
-
config?:
|
|
6899
|
+
config?: BridgeExecutionConfig;
|
|
6854
6900
|
/**
|
|
6855
6901
|
* The token to transfer. Defaults to 'USDC'.
|
|
6856
6902
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -6877,6 +6923,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6877
6923
|
* ```
|
|
6878
6924
|
*/
|
|
6879
6925
|
invocationMeta?: InvocationMeta;
|
|
6926
|
+
/**
|
|
6927
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
6928
|
+
*
|
|
6929
|
+
* @remarks
|
|
6930
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
6931
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
6932
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
6933
|
+
* decode it.
|
|
6934
|
+
*/
|
|
6935
|
+
quote?: string;
|
|
6880
6936
|
}
|
|
6881
6937
|
|
|
6882
6938
|
/**
|
|
@@ -6921,29 +6977,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
6921
6977
|
* Configuration options for earn operations.
|
|
6922
6978
|
*
|
|
6923
6979
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
6924
|
-
* and without
|
|
6980
|
+
* and without an API key. When present, the API key enables permissioned
|
|
6925
6981
|
* features like integrator attribution tracking.
|
|
6926
6982
|
*
|
|
6927
6983
|
* @example
|
|
6928
6984
|
* ```typescript
|
|
6929
|
-
* // Permissionless (no
|
|
6985
|
+
* // Permissionless (no API key)
|
|
6930
6986
|
* const config: EarnConfig = {}
|
|
6931
6987
|
*
|
|
6932
|
-
* // Permissioned (with
|
|
6988
|
+
* // Permissioned (with API key)
|
|
6933
6989
|
* const config: EarnConfig = {
|
|
6934
|
-
*
|
|
6990
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
6935
6991
|
* }
|
|
6936
6992
|
* ```
|
|
6937
6993
|
*/
|
|
6938
6994
|
interface EarnConfig {
|
|
6939
6995
|
/**
|
|
6940
|
-
* Optional
|
|
6996
|
+
* Optional Circle API key for permissioned access.
|
|
6941
6997
|
*
|
|
6942
6998
|
* When provided, enables integrator attribution tracking and
|
|
6943
6999
|
* higher rate limits. When omitted, the SDK operates in
|
|
6944
7000
|
* permissionless mode.
|
|
6945
7001
|
*
|
|
6946
|
-
* Format:
|
|
7002
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7003
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7004
|
+
*/
|
|
7005
|
+
readonly apiKey?: string | undefined;
|
|
7006
|
+
/**
|
|
7007
|
+
* Optional Circle API key for permissioned access.
|
|
7008
|
+
*
|
|
7009
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7010
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6947
7011
|
*/
|
|
6948
7012
|
readonly kitKey?: string | undefined;
|
|
6949
7013
|
/**
|
|
@@ -7710,13 +7774,18 @@ interface AppKitContext {
|
|
|
7710
7774
|
*/
|
|
7711
7775
|
disableErrorReporting?: boolean;
|
|
7712
7776
|
/**
|
|
7713
|
-
* Custom HTTP headers forwarded with
|
|
7714
|
-
* attestation (Iris)
|
|
7777
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7778
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7779
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7780
|
+
* operations.
|
|
7715
7781
|
*
|
|
7716
7782
|
* @remarks
|
|
7717
7783
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7718
|
-
* rather than replacing them.
|
|
7719
|
-
* the SDK does not interpret it.
|
|
7784
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7785
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7786
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7787
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7788
|
+
* unified-balance kit.
|
|
7720
7789
|
*/
|
|
7721
7790
|
headers?: Record<string, string>;
|
|
7722
7791
|
}
|
package/estimateSwap.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: '
|
|
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: '
|
|
2803
|
+
* apiKey: 'TEST_API_KEY:...',
|
|
2800
2804
|
* })
|
|
2801
2805
|
*
|
|
2802
2806
|
* // Prepare action parameters
|
|
@@ -5950,12 +5954,21 @@ interface ServiceSwapConfig {
|
|
|
5950
5954
|
recipientAddress?: string;
|
|
5951
5955
|
};
|
|
5952
5956
|
/**
|
|
5953
|
-
*
|
|
5954
|
-
*
|
|
5957
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5958
|
+
*
|
|
5959
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
5960
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
5955
5961
|
*
|
|
5956
5962
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
5957
5963
|
* source, or expose it in telemetry.
|
|
5958
5964
|
*/
|
|
5965
|
+
apiKey?: string | undefined;
|
|
5966
|
+
/**
|
|
5967
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5968
|
+
*
|
|
5969
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
5970
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
5971
|
+
*/
|
|
5959
5972
|
kitKey?: string;
|
|
5960
5973
|
/**
|
|
5961
5974
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6486,12 +6499,21 @@ interface SwapConfig {
|
|
|
6486
6499
|
recipientAddress: string;
|
|
6487
6500
|
};
|
|
6488
6501
|
/**
|
|
6489
|
-
*
|
|
6490
|
-
*
|
|
6502
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6503
|
+
*
|
|
6504
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6505
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6491
6506
|
*
|
|
6492
6507
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6493
6508
|
* source, or expose it in telemetry.
|
|
6494
6509
|
*/
|
|
6510
|
+
apiKey?: string | undefined;
|
|
6511
|
+
/**
|
|
6512
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6513
|
+
*
|
|
6514
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6515
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6516
|
+
*/
|
|
6495
6517
|
kitKey?: string;
|
|
6496
6518
|
}
|
|
6497
6519
|
/**
|
|
@@ -6690,6 +6712,30 @@ interface SwapParams<TFromAdapterCapabilities extends AdapterCapabilities = Adap
|
|
|
6690
6712
|
config?: SwapConfig;
|
|
6691
6713
|
}
|
|
6692
6714
|
|
|
6715
|
+
/**
|
|
6716
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
6717
|
+
*
|
|
6718
|
+
* @remarks
|
|
6719
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
6720
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
6721
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
6722
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
6723
|
+
*
|
|
6724
|
+
* @example
|
|
6725
|
+
* ```typescript
|
|
6726
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
6727
|
+
*
|
|
6728
|
+
* const config: BridgeExecutionConfig = {
|
|
6729
|
+
* transferSpeed: 'FAST',
|
|
6730
|
+
* feePayment: 'source',
|
|
6731
|
+
* }
|
|
6732
|
+
* ```
|
|
6733
|
+
* @since 1.14.0
|
|
6734
|
+
*/
|
|
6735
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
6736
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
6737
|
+
feePayment?: 'source' | 'destination';
|
|
6738
|
+
}
|
|
6693
6739
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6694
6740
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6695
6741
|
/**
|
|
@@ -6850,7 +6896,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6850
6896
|
* Optional bridge configuration (e.g., transfer speed).
|
|
6851
6897
|
* If omitted, defaults will be used
|
|
6852
6898
|
*/
|
|
6853
|
-
config?:
|
|
6899
|
+
config?: BridgeExecutionConfig;
|
|
6854
6900
|
/**
|
|
6855
6901
|
* The token to transfer. Defaults to 'USDC'.
|
|
6856
6902
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -6877,6 +6923,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6877
6923
|
* ```
|
|
6878
6924
|
*/
|
|
6879
6925
|
invocationMeta?: InvocationMeta;
|
|
6926
|
+
/**
|
|
6927
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
6928
|
+
*
|
|
6929
|
+
* @remarks
|
|
6930
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
6931
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
6932
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
6933
|
+
* decode it.
|
|
6934
|
+
*/
|
|
6935
|
+
quote?: string;
|
|
6880
6936
|
}
|
|
6881
6937
|
|
|
6882
6938
|
/**
|
|
@@ -6921,29 +6977,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
6921
6977
|
* Configuration options for earn operations.
|
|
6922
6978
|
*
|
|
6923
6979
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
6924
|
-
* and without
|
|
6980
|
+
* and without an API key. When present, the API key enables permissioned
|
|
6925
6981
|
* features like integrator attribution tracking.
|
|
6926
6982
|
*
|
|
6927
6983
|
* @example
|
|
6928
6984
|
* ```typescript
|
|
6929
|
-
* // Permissionless (no
|
|
6985
|
+
* // Permissionless (no API key)
|
|
6930
6986
|
* const config: EarnConfig = {}
|
|
6931
6987
|
*
|
|
6932
|
-
* // Permissioned (with
|
|
6988
|
+
* // Permissioned (with API key)
|
|
6933
6989
|
* const config: EarnConfig = {
|
|
6934
|
-
*
|
|
6990
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
6935
6991
|
* }
|
|
6936
6992
|
* ```
|
|
6937
6993
|
*/
|
|
6938
6994
|
interface EarnConfig {
|
|
6939
6995
|
/**
|
|
6940
|
-
* Optional
|
|
6996
|
+
* Optional Circle API key for permissioned access.
|
|
6941
6997
|
*
|
|
6942
6998
|
* When provided, enables integrator attribution tracking and
|
|
6943
6999
|
* higher rate limits. When omitted, the SDK operates in
|
|
6944
7000
|
* permissionless mode.
|
|
6945
7001
|
*
|
|
6946
|
-
* Format:
|
|
7002
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7003
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7004
|
+
*/
|
|
7005
|
+
readonly apiKey?: string | undefined;
|
|
7006
|
+
/**
|
|
7007
|
+
* Optional Circle API key for permissioned access.
|
|
7008
|
+
*
|
|
7009
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7010
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6947
7011
|
*/
|
|
6948
7012
|
readonly kitKey?: string | undefined;
|
|
6949
7013
|
/**
|
|
@@ -7710,13 +7774,18 @@ interface AppKitContext {
|
|
|
7710
7774
|
*/
|
|
7711
7775
|
disableErrorReporting?: boolean;
|
|
7712
7776
|
/**
|
|
7713
|
-
* Custom HTTP headers forwarded with
|
|
7714
|
-
* attestation (Iris)
|
|
7777
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7778
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7779
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7780
|
+
* operations.
|
|
7715
7781
|
*
|
|
7716
7782
|
* @remarks
|
|
7717
7783
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7718
|
-
* rather than replacing them.
|
|
7719
|
-
* the SDK does not interpret it.
|
|
7784
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7785
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7786
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7787
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7788
|
+
* unified-balance kit.
|
|
7720
7789
|
*/
|
|
7721
7790
|
headers?: Record<string, string>;
|
|
7722
7791
|
}
|