@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/bridge.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
|
|
@@ -5982,6 +5986,30 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
|
|
|
5982
5986
|
useForwarder?: boolean;
|
|
5983
5987
|
}) | ForwarderDestination<TChainIdentifier>;
|
|
5984
5988
|
|
|
5989
|
+
/**
|
|
5990
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
5991
|
+
*
|
|
5992
|
+
* @remarks
|
|
5993
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
5994
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
5995
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
5996
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
5997
|
+
*
|
|
5998
|
+
* @example
|
|
5999
|
+
* ```typescript
|
|
6000
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
6001
|
+
*
|
|
6002
|
+
* const config: BridgeExecutionConfig = {
|
|
6003
|
+
* transferSpeed: 'FAST',
|
|
6004
|
+
* feePayment: 'source',
|
|
6005
|
+
* }
|
|
6006
|
+
* ```
|
|
6007
|
+
* @since 1.14.0
|
|
6008
|
+
*/
|
|
6009
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
6010
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
6011
|
+
feePayment?: 'source' | 'destination';
|
|
6012
|
+
}
|
|
5985
6013
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5986
6014
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5987
6015
|
/**
|
|
@@ -6142,7 +6170,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6142
6170
|
* Optional bridge configuration (e.g., transfer speed).
|
|
6143
6171
|
* If omitted, defaults will be used
|
|
6144
6172
|
*/
|
|
6145
|
-
config?:
|
|
6173
|
+
config?: BridgeExecutionConfig;
|
|
6146
6174
|
/**
|
|
6147
6175
|
* The token to transfer. Defaults to 'USDC'.
|
|
6148
6176
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -6169,6 +6197,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6169
6197
|
* ```
|
|
6170
6198
|
*/
|
|
6171
6199
|
invocationMeta?: InvocationMeta;
|
|
6200
|
+
/**
|
|
6201
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
6202
|
+
*
|
|
6203
|
+
* @remarks
|
|
6204
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
6205
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
6206
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
6207
|
+
* decode it.
|
|
6208
|
+
*/
|
|
6209
|
+
quote?: string;
|
|
6172
6210
|
}
|
|
6173
6211
|
|
|
6174
6212
|
/**
|
|
@@ -6284,12 +6322,21 @@ interface ServiceSwapConfig {
|
|
|
6284
6322
|
recipientAddress?: string;
|
|
6285
6323
|
};
|
|
6286
6324
|
/**
|
|
6287
|
-
*
|
|
6288
|
-
*
|
|
6325
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6326
|
+
*
|
|
6327
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6328
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6289
6329
|
*
|
|
6290
6330
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6291
6331
|
* source, or expose it in telemetry.
|
|
6292
6332
|
*/
|
|
6333
|
+
apiKey?: string | undefined;
|
|
6334
|
+
/**
|
|
6335
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6336
|
+
*
|
|
6337
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
6338
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6339
|
+
*/
|
|
6293
6340
|
kitKey?: string;
|
|
6294
6341
|
/**
|
|
6295
6342
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6767,12 +6814,21 @@ interface SwapConfig {
|
|
|
6767
6814
|
recipientAddress: string;
|
|
6768
6815
|
};
|
|
6769
6816
|
/**
|
|
6770
|
-
*
|
|
6771
|
-
*
|
|
6817
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6818
|
+
*
|
|
6819
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6820
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6772
6821
|
*
|
|
6773
6822
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6774
6823
|
* source, or expose it in telemetry.
|
|
6775
6824
|
*/
|
|
6825
|
+
apiKey?: string | undefined;
|
|
6826
|
+
/**
|
|
6827
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6828
|
+
*
|
|
6829
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6830
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6831
|
+
*/
|
|
6776
6832
|
kitKey?: string;
|
|
6777
6833
|
}
|
|
6778
6834
|
/**
|
|
@@ -6901,29 +6957,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
6901
6957
|
* Configuration options for earn operations.
|
|
6902
6958
|
*
|
|
6903
6959
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
6904
|
-
* and without
|
|
6960
|
+
* and without an API key. When present, the API key enables permissioned
|
|
6905
6961
|
* features like integrator attribution tracking.
|
|
6906
6962
|
*
|
|
6907
6963
|
* @example
|
|
6908
6964
|
* ```typescript
|
|
6909
|
-
* // Permissionless (no
|
|
6965
|
+
* // Permissionless (no API key)
|
|
6910
6966
|
* const config: EarnConfig = {}
|
|
6911
6967
|
*
|
|
6912
|
-
* // Permissioned (with
|
|
6968
|
+
* // Permissioned (with API key)
|
|
6913
6969
|
* const config: EarnConfig = {
|
|
6914
|
-
*
|
|
6970
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
6915
6971
|
* }
|
|
6916
6972
|
* ```
|
|
6917
6973
|
*/
|
|
6918
6974
|
interface EarnConfig {
|
|
6919
6975
|
/**
|
|
6920
|
-
* Optional
|
|
6976
|
+
* Optional Circle API key for permissioned access.
|
|
6921
6977
|
*
|
|
6922
6978
|
* When provided, enables integrator attribution tracking and
|
|
6923
6979
|
* higher rate limits. When omitted, the SDK operates in
|
|
6924
6980
|
* permissionless mode.
|
|
6925
6981
|
*
|
|
6926
|
-
* Format:
|
|
6982
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6983
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6984
|
+
*/
|
|
6985
|
+
readonly apiKey?: string | undefined;
|
|
6986
|
+
/**
|
|
6987
|
+
* Optional Circle API key for permissioned access.
|
|
6988
|
+
*
|
|
6989
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
6990
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6927
6991
|
*/
|
|
6928
6992
|
readonly kitKey?: string | undefined;
|
|
6929
6993
|
/**
|
|
@@ -7690,13 +7754,18 @@ interface AppKitContext {
|
|
|
7690
7754
|
*/
|
|
7691
7755
|
disableErrorReporting?: boolean;
|
|
7692
7756
|
/**
|
|
7693
|
-
* Custom HTTP headers forwarded with
|
|
7694
|
-
* attestation (Iris)
|
|
7757
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7758
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7759
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7760
|
+
* operations.
|
|
7695
7761
|
*
|
|
7696
7762
|
* @remarks
|
|
7697
7763
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7698
|
-
* rather than replacing them.
|
|
7699
|
-
* the SDK does not interpret it.
|
|
7764
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7765
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7766
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7767
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7768
|
+
* unified-balance kit.
|
|
7700
7769
|
*/
|
|
7701
7770
|
headers?: Record<string, string>;
|
|
7702
7771
|
}
|
package/bridge.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
|
|
@@ -5982,6 +5986,30 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
|
|
|
5982
5986
|
useForwarder?: boolean;
|
|
5983
5987
|
}) | ForwarderDestination<TChainIdentifier>;
|
|
5984
5988
|
|
|
5989
|
+
/**
|
|
5990
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
5991
|
+
*
|
|
5992
|
+
* @remarks
|
|
5993
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
5994
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
5995
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
5996
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
5997
|
+
*
|
|
5998
|
+
* @example
|
|
5999
|
+
* ```typescript
|
|
6000
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
6001
|
+
*
|
|
6002
|
+
* const config: BridgeExecutionConfig = {
|
|
6003
|
+
* transferSpeed: 'FAST',
|
|
6004
|
+
* feePayment: 'source',
|
|
6005
|
+
* }
|
|
6006
|
+
* ```
|
|
6007
|
+
* @since 1.14.0
|
|
6008
|
+
*/
|
|
6009
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
6010
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
6011
|
+
feePayment?: 'source' | 'destination';
|
|
6012
|
+
}
|
|
5985
6013
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5986
6014
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5987
6015
|
/**
|
|
@@ -6142,7 +6170,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6142
6170
|
* Optional bridge configuration (e.g., transfer speed).
|
|
6143
6171
|
* If omitted, defaults will be used
|
|
6144
6172
|
*/
|
|
6145
|
-
config?:
|
|
6173
|
+
config?: BridgeExecutionConfig;
|
|
6146
6174
|
/**
|
|
6147
6175
|
* The token to transfer. Defaults to 'USDC'.
|
|
6148
6176
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -6169,6 +6197,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6169
6197
|
* ```
|
|
6170
6198
|
*/
|
|
6171
6199
|
invocationMeta?: InvocationMeta;
|
|
6200
|
+
/**
|
|
6201
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
6202
|
+
*
|
|
6203
|
+
* @remarks
|
|
6204
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
6205
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
6206
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
6207
|
+
* decode it.
|
|
6208
|
+
*/
|
|
6209
|
+
quote?: string;
|
|
6172
6210
|
}
|
|
6173
6211
|
|
|
6174
6212
|
/**
|
|
@@ -6284,12 +6322,21 @@ interface ServiceSwapConfig {
|
|
|
6284
6322
|
recipientAddress?: string;
|
|
6285
6323
|
};
|
|
6286
6324
|
/**
|
|
6287
|
-
*
|
|
6288
|
-
*
|
|
6325
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6326
|
+
*
|
|
6327
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6328
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6289
6329
|
*
|
|
6290
6330
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6291
6331
|
* source, or expose it in telemetry.
|
|
6292
6332
|
*/
|
|
6333
|
+
apiKey?: string | undefined;
|
|
6334
|
+
/**
|
|
6335
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6336
|
+
*
|
|
6337
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
6338
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6339
|
+
*/
|
|
6293
6340
|
kitKey?: string;
|
|
6294
6341
|
/**
|
|
6295
6342
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6767,12 +6814,21 @@ interface SwapConfig {
|
|
|
6767
6814
|
recipientAddress: string;
|
|
6768
6815
|
};
|
|
6769
6816
|
/**
|
|
6770
|
-
*
|
|
6771
|
-
*
|
|
6817
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6818
|
+
*
|
|
6819
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6820
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6772
6821
|
*
|
|
6773
6822
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6774
6823
|
* source, or expose it in telemetry.
|
|
6775
6824
|
*/
|
|
6825
|
+
apiKey?: string | undefined;
|
|
6826
|
+
/**
|
|
6827
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6828
|
+
*
|
|
6829
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6830
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6831
|
+
*/
|
|
6776
6832
|
kitKey?: string;
|
|
6777
6833
|
}
|
|
6778
6834
|
/**
|
|
@@ -6901,29 +6957,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
6901
6957
|
* Configuration options for earn operations.
|
|
6902
6958
|
*
|
|
6903
6959
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
6904
|
-
* and without
|
|
6960
|
+
* and without an API key. When present, the API key enables permissioned
|
|
6905
6961
|
* features like integrator attribution tracking.
|
|
6906
6962
|
*
|
|
6907
6963
|
* @example
|
|
6908
6964
|
* ```typescript
|
|
6909
|
-
* // Permissionless (no
|
|
6965
|
+
* // Permissionless (no API key)
|
|
6910
6966
|
* const config: EarnConfig = {}
|
|
6911
6967
|
*
|
|
6912
|
-
* // Permissioned (with
|
|
6968
|
+
* // Permissioned (with API key)
|
|
6913
6969
|
* const config: EarnConfig = {
|
|
6914
|
-
*
|
|
6970
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
6915
6971
|
* }
|
|
6916
6972
|
* ```
|
|
6917
6973
|
*/
|
|
6918
6974
|
interface EarnConfig {
|
|
6919
6975
|
/**
|
|
6920
|
-
* Optional
|
|
6976
|
+
* Optional Circle API key for permissioned access.
|
|
6921
6977
|
*
|
|
6922
6978
|
* When provided, enables integrator attribution tracking and
|
|
6923
6979
|
* higher rate limits. When omitted, the SDK operates in
|
|
6924
6980
|
* permissionless mode.
|
|
6925
6981
|
*
|
|
6926
|
-
* Format:
|
|
6982
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6983
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6984
|
+
*/
|
|
6985
|
+
readonly apiKey?: string | undefined;
|
|
6986
|
+
/**
|
|
6987
|
+
* Optional Circle API key for permissioned access.
|
|
6988
|
+
*
|
|
6989
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
6990
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6927
6991
|
*/
|
|
6928
6992
|
readonly kitKey?: string | undefined;
|
|
6929
6993
|
/**
|
|
@@ -7690,13 +7754,18 @@ interface AppKitContext {
|
|
|
7690
7754
|
*/
|
|
7691
7755
|
disableErrorReporting?: boolean;
|
|
7692
7756
|
/**
|
|
7693
|
-
* Custom HTTP headers forwarded with
|
|
7694
|
-
* attestation (Iris)
|
|
7757
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7758
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7759
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7760
|
+
* operations.
|
|
7695
7761
|
*
|
|
7696
7762
|
* @remarks
|
|
7697
7763
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7698
|
-
* rather than replacing them.
|
|
7699
|
-
* the SDK does not interpret it.
|
|
7764
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7765
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7766
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7767
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7768
|
+
* unified-balance kit.
|
|
7700
7769
|
*/
|
|
7701
7770
|
headers?: Record<string, string>;
|
|
7702
7771
|
}
|
package/bridge.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
|
|
@@ -5982,6 +5986,30 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
|
|
|
5982
5986
|
useForwarder?: boolean;
|
|
5983
5987
|
}) | ForwarderDestination<TChainIdentifier>;
|
|
5984
5988
|
|
|
5989
|
+
/**
|
|
5990
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
5991
|
+
*
|
|
5992
|
+
* @remarks
|
|
5993
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
5994
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
5995
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
5996
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
5997
|
+
*
|
|
5998
|
+
* @example
|
|
5999
|
+
* ```typescript
|
|
6000
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
6001
|
+
*
|
|
6002
|
+
* const config: BridgeExecutionConfig = {
|
|
6003
|
+
* transferSpeed: 'FAST',
|
|
6004
|
+
* feePayment: 'source',
|
|
6005
|
+
* }
|
|
6006
|
+
* ```
|
|
6007
|
+
* @since 1.14.0
|
|
6008
|
+
*/
|
|
6009
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
6010
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
6011
|
+
feePayment?: 'source' | 'destination';
|
|
6012
|
+
}
|
|
5985
6013
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5986
6014
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5987
6015
|
/**
|
|
@@ -6142,7 +6170,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6142
6170
|
* Optional bridge configuration (e.g., transfer speed).
|
|
6143
6171
|
* If omitted, defaults will be used
|
|
6144
6172
|
*/
|
|
6145
|
-
config?:
|
|
6173
|
+
config?: BridgeExecutionConfig;
|
|
6146
6174
|
/**
|
|
6147
6175
|
* The token to transfer. Defaults to 'USDC'.
|
|
6148
6176
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -6169,6 +6197,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6169
6197
|
* ```
|
|
6170
6198
|
*/
|
|
6171
6199
|
invocationMeta?: InvocationMeta;
|
|
6200
|
+
/**
|
|
6201
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
6202
|
+
*
|
|
6203
|
+
* @remarks
|
|
6204
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
6205
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
6206
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
6207
|
+
* decode it.
|
|
6208
|
+
*/
|
|
6209
|
+
quote?: string;
|
|
6172
6210
|
}
|
|
6173
6211
|
|
|
6174
6212
|
/**
|
|
@@ -6284,12 +6322,21 @@ interface ServiceSwapConfig {
|
|
|
6284
6322
|
recipientAddress?: string;
|
|
6285
6323
|
};
|
|
6286
6324
|
/**
|
|
6287
|
-
*
|
|
6288
|
-
*
|
|
6325
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6326
|
+
*
|
|
6327
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6328
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6289
6329
|
*
|
|
6290
6330
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6291
6331
|
* source, or expose it in telemetry.
|
|
6292
6332
|
*/
|
|
6333
|
+
apiKey?: string | undefined;
|
|
6334
|
+
/**
|
|
6335
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6336
|
+
*
|
|
6337
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
6338
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6339
|
+
*/
|
|
6293
6340
|
kitKey?: string;
|
|
6294
6341
|
/**
|
|
6295
6342
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6767,12 +6814,21 @@ interface SwapConfig {
|
|
|
6767
6814
|
recipientAddress: string;
|
|
6768
6815
|
};
|
|
6769
6816
|
/**
|
|
6770
|
-
*
|
|
6771
|
-
*
|
|
6817
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6818
|
+
*
|
|
6819
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6820
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6772
6821
|
*
|
|
6773
6822
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6774
6823
|
* source, or expose it in telemetry.
|
|
6775
6824
|
*/
|
|
6825
|
+
apiKey?: string | undefined;
|
|
6826
|
+
/**
|
|
6827
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6828
|
+
*
|
|
6829
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6830
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6831
|
+
*/
|
|
6776
6832
|
kitKey?: string;
|
|
6777
6833
|
}
|
|
6778
6834
|
/**
|
|
@@ -6901,29 +6957,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
6901
6957
|
* Configuration options for earn operations.
|
|
6902
6958
|
*
|
|
6903
6959
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
6904
|
-
* and without
|
|
6960
|
+
* and without an API key. When present, the API key enables permissioned
|
|
6905
6961
|
* features like integrator attribution tracking.
|
|
6906
6962
|
*
|
|
6907
6963
|
* @example
|
|
6908
6964
|
* ```typescript
|
|
6909
|
-
* // Permissionless (no
|
|
6965
|
+
* // Permissionless (no API key)
|
|
6910
6966
|
* const config: EarnConfig = {}
|
|
6911
6967
|
*
|
|
6912
|
-
* // Permissioned (with
|
|
6968
|
+
* // Permissioned (with API key)
|
|
6913
6969
|
* const config: EarnConfig = {
|
|
6914
|
-
*
|
|
6970
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
6915
6971
|
* }
|
|
6916
6972
|
* ```
|
|
6917
6973
|
*/
|
|
6918
6974
|
interface EarnConfig {
|
|
6919
6975
|
/**
|
|
6920
|
-
* Optional
|
|
6976
|
+
* Optional Circle API key for permissioned access.
|
|
6921
6977
|
*
|
|
6922
6978
|
* When provided, enables integrator attribution tracking and
|
|
6923
6979
|
* higher rate limits. When omitted, the SDK operates in
|
|
6924
6980
|
* permissionless mode.
|
|
6925
6981
|
*
|
|
6926
|
-
* Format:
|
|
6982
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6983
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6984
|
+
*/
|
|
6985
|
+
readonly apiKey?: string | undefined;
|
|
6986
|
+
/**
|
|
6987
|
+
* Optional Circle API key for permissioned access.
|
|
6988
|
+
*
|
|
6989
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
6990
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6927
6991
|
*/
|
|
6928
6992
|
readonly kitKey?: string | undefined;
|
|
6929
6993
|
/**
|
|
@@ -7690,13 +7754,18 @@ interface AppKitContext {
|
|
|
7690
7754
|
*/
|
|
7691
7755
|
disableErrorReporting?: boolean;
|
|
7692
7756
|
/**
|
|
7693
|
-
* Custom HTTP headers forwarded with
|
|
7694
|
-
* attestation (Iris)
|
|
7757
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7758
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7759
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7760
|
+
* operations.
|
|
7695
7761
|
*
|
|
7696
7762
|
* @remarks
|
|
7697
7763
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7698
|
-
* rather than replacing them.
|
|
7699
|
-
* the SDK does not interpret it.
|
|
7764
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7765
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7766
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7767
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7768
|
+
* unified-balance kit.
|
|
7700
7769
|
*/
|
|
7701
7770
|
headers?: Record<string, string>;
|
|
7702
7771
|
}
|