@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/earn.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
|
|
@@ -7595,29 +7599,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
7595
7599
|
* Configuration options for earn operations.
|
|
7596
7600
|
*
|
|
7597
7601
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
7598
|
-
* and without
|
|
7602
|
+
* and without an API key. When present, the API key enables permissioned
|
|
7599
7603
|
* features like integrator attribution tracking.
|
|
7600
7604
|
*
|
|
7601
7605
|
* @example
|
|
7602
7606
|
* ```typescript
|
|
7603
|
-
* // Permissionless (no
|
|
7607
|
+
* // Permissionless (no API key)
|
|
7604
7608
|
* const config: EarnConfig = {}
|
|
7605
7609
|
*
|
|
7606
|
-
* // Permissioned (with
|
|
7610
|
+
* // Permissioned (with API key)
|
|
7607
7611
|
* const config: EarnConfig = {
|
|
7608
|
-
*
|
|
7612
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
7609
7613
|
* }
|
|
7610
7614
|
* ```
|
|
7611
7615
|
*/
|
|
7612
7616
|
interface EarnConfig {
|
|
7613
7617
|
/**
|
|
7614
|
-
* Optional
|
|
7618
|
+
* Optional Circle API key for permissioned access.
|
|
7615
7619
|
*
|
|
7616
7620
|
* When provided, enables integrator attribution tracking and
|
|
7617
7621
|
* higher rate limits. When omitted, the SDK operates in
|
|
7618
7622
|
* permissionless mode.
|
|
7619
7623
|
*
|
|
7620
|
-
* Format:
|
|
7624
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7625
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7626
|
+
*/
|
|
7627
|
+
readonly apiKey?: string | undefined;
|
|
7628
|
+
/**
|
|
7629
|
+
* Optional Circle API key for permissioned access.
|
|
7630
|
+
*
|
|
7631
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7632
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7621
7633
|
*/
|
|
7622
7634
|
readonly kitKey?: string | undefined;
|
|
7623
7635
|
/**
|
|
@@ -8264,6 +8276,30 @@ type EarnClaimRewardsQuoteInfo = Omit<ClaimRewardsQuoteInfo, 'rewards'> & {
|
|
|
8264
8276
|
*/
|
|
8265
8277
|
type EarnOperationParams = AnyDepositParams | WithdrawParams | ClaimRewardsParams | GetVaultsParams | ExploreVaultsParams | ExploreVaultsIteratorParams | GetPositionParams | GetDepositQuoteParams | GetWithdrawalQuoteParams | GetClaimRewardsQuoteParams;
|
|
8266
8278
|
|
|
8279
|
+
/**
|
|
8280
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
8281
|
+
*
|
|
8282
|
+
* @remarks
|
|
8283
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
8284
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
8285
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
8286
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
8287
|
+
*
|
|
8288
|
+
* @example
|
|
8289
|
+
* ```typescript
|
|
8290
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
8291
|
+
*
|
|
8292
|
+
* const config: BridgeExecutionConfig = {
|
|
8293
|
+
* transferSpeed: 'FAST',
|
|
8294
|
+
* feePayment: 'source',
|
|
8295
|
+
* }
|
|
8296
|
+
* ```
|
|
8297
|
+
* @since 1.14.0
|
|
8298
|
+
*/
|
|
8299
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
8300
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
8301
|
+
feePayment?: 'source' | 'destination';
|
|
8302
|
+
}
|
|
8267
8303
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
8268
8304
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
8269
8305
|
/**
|
|
@@ -8424,7 +8460,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
8424
8460
|
* Optional bridge configuration (e.g., transfer speed).
|
|
8425
8461
|
* If omitted, defaults will be used
|
|
8426
8462
|
*/
|
|
8427
|
-
config?:
|
|
8463
|
+
config?: BridgeExecutionConfig;
|
|
8428
8464
|
/**
|
|
8429
8465
|
* The token to transfer. Defaults to 'USDC'.
|
|
8430
8466
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -8451,6 +8487,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
8451
8487
|
* ```
|
|
8452
8488
|
*/
|
|
8453
8489
|
invocationMeta?: InvocationMeta;
|
|
8490
|
+
/**
|
|
8491
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
8492
|
+
*
|
|
8493
|
+
* @remarks
|
|
8494
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
8495
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
8496
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
8497
|
+
* decode it.
|
|
8498
|
+
*/
|
|
8499
|
+
quote?: string;
|
|
8454
8500
|
}
|
|
8455
8501
|
|
|
8456
8502
|
/**
|
|
@@ -8566,12 +8612,21 @@ interface ServiceSwapConfig {
|
|
|
8566
8612
|
recipientAddress?: string;
|
|
8567
8613
|
};
|
|
8568
8614
|
/**
|
|
8569
|
-
*
|
|
8570
|
-
*
|
|
8615
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
8616
|
+
*
|
|
8617
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
8618
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
8571
8619
|
*
|
|
8572
8620
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
8573
8621
|
* source, or expose it in telemetry.
|
|
8574
8622
|
*/
|
|
8623
|
+
apiKey?: string | undefined;
|
|
8624
|
+
/**
|
|
8625
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
8626
|
+
*
|
|
8627
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
8628
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
8629
|
+
*/
|
|
8575
8630
|
kitKey?: string;
|
|
8576
8631
|
/**
|
|
8577
8632
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -9049,12 +9104,21 @@ interface SwapConfig {
|
|
|
9049
9104
|
recipientAddress: string;
|
|
9050
9105
|
};
|
|
9051
9106
|
/**
|
|
9052
|
-
*
|
|
9053
|
-
*
|
|
9107
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
9108
|
+
*
|
|
9109
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
9110
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
9054
9111
|
*
|
|
9055
9112
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
9056
9113
|
* source, or expose it in telemetry.
|
|
9057
9114
|
*/
|
|
9115
|
+
apiKey?: string | undefined;
|
|
9116
|
+
/**
|
|
9117
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
9118
|
+
*
|
|
9119
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
9120
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
9121
|
+
*/
|
|
9058
9122
|
kitKey?: string;
|
|
9059
9123
|
}
|
|
9060
9124
|
/**
|
|
@@ -9455,13 +9519,18 @@ interface AppKitContext {
|
|
|
9455
9519
|
*/
|
|
9456
9520
|
disableErrorReporting?: boolean;
|
|
9457
9521
|
/**
|
|
9458
|
-
* Custom HTTP headers forwarded with
|
|
9459
|
-
* attestation (Iris)
|
|
9522
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
9523
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
9524
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
9525
|
+
* operations.
|
|
9460
9526
|
*
|
|
9461
9527
|
* @remarks
|
|
9462
9528
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
9463
|
-
* rather than replacing them.
|
|
9464
|
-
* the SDK does not interpret it.
|
|
9529
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
9530
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
9531
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
9532
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
9533
|
+
* unified-balance kit.
|
|
9465
9534
|
*/
|
|
9466
9535
|
headers?: Record<string, string>;
|
|
9467
9536
|
}
|
package/earn.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
|
|
@@ -7595,29 +7599,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
7595
7599
|
* Configuration options for earn operations.
|
|
7596
7600
|
*
|
|
7597
7601
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
7598
|
-
* and without
|
|
7602
|
+
* and without an API key. When present, the API key enables permissioned
|
|
7599
7603
|
* features like integrator attribution tracking.
|
|
7600
7604
|
*
|
|
7601
7605
|
* @example
|
|
7602
7606
|
* ```typescript
|
|
7603
|
-
* // Permissionless (no
|
|
7607
|
+
* // Permissionless (no API key)
|
|
7604
7608
|
* const config: EarnConfig = {}
|
|
7605
7609
|
*
|
|
7606
|
-
* // Permissioned (with
|
|
7610
|
+
* // Permissioned (with API key)
|
|
7607
7611
|
* const config: EarnConfig = {
|
|
7608
|
-
*
|
|
7612
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
7609
7613
|
* }
|
|
7610
7614
|
* ```
|
|
7611
7615
|
*/
|
|
7612
7616
|
interface EarnConfig {
|
|
7613
7617
|
/**
|
|
7614
|
-
* Optional
|
|
7618
|
+
* Optional Circle API key for permissioned access.
|
|
7615
7619
|
*
|
|
7616
7620
|
* When provided, enables integrator attribution tracking and
|
|
7617
7621
|
* higher rate limits. When omitted, the SDK operates in
|
|
7618
7622
|
* permissionless mode.
|
|
7619
7623
|
*
|
|
7620
|
-
* Format:
|
|
7624
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7625
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7626
|
+
*/
|
|
7627
|
+
readonly apiKey?: string | undefined;
|
|
7628
|
+
/**
|
|
7629
|
+
* Optional Circle API key for permissioned access.
|
|
7630
|
+
*
|
|
7631
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7632
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7621
7633
|
*/
|
|
7622
7634
|
readonly kitKey?: string | undefined;
|
|
7623
7635
|
/**
|
|
@@ -8264,6 +8276,30 @@ type EarnClaimRewardsQuoteInfo = Omit<ClaimRewardsQuoteInfo, 'rewards'> & {
|
|
|
8264
8276
|
*/
|
|
8265
8277
|
type EarnOperationParams = AnyDepositParams | WithdrawParams | ClaimRewardsParams | GetVaultsParams | ExploreVaultsParams | ExploreVaultsIteratorParams | GetPositionParams | GetDepositQuoteParams | GetWithdrawalQuoteParams | GetClaimRewardsQuoteParams;
|
|
8266
8278
|
|
|
8279
|
+
/**
|
|
8280
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
8281
|
+
*
|
|
8282
|
+
* @remarks
|
|
8283
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
8284
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
8285
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
8286
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
8287
|
+
*
|
|
8288
|
+
* @example
|
|
8289
|
+
* ```typescript
|
|
8290
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
8291
|
+
*
|
|
8292
|
+
* const config: BridgeExecutionConfig = {
|
|
8293
|
+
* transferSpeed: 'FAST',
|
|
8294
|
+
* feePayment: 'source',
|
|
8295
|
+
* }
|
|
8296
|
+
* ```
|
|
8297
|
+
* @since 1.14.0
|
|
8298
|
+
*/
|
|
8299
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
8300
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
8301
|
+
feePayment?: 'source' | 'destination';
|
|
8302
|
+
}
|
|
8267
8303
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
8268
8304
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
8269
8305
|
/**
|
|
@@ -8424,7 +8460,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
8424
8460
|
* Optional bridge configuration (e.g., transfer speed).
|
|
8425
8461
|
* If omitted, defaults will be used
|
|
8426
8462
|
*/
|
|
8427
|
-
config?:
|
|
8463
|
+
config?: BridgeExecutionConfig;
|
|
8428
8464
|
/**
|
|
8429
8465
|
* The token to transfer. Defaults to 'USDC'.
|
|
8430
8466
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -8451,6 +8487,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
8451
8487
|
* ```
|
|
8452
8488
|
*/
|
|
8453
8489
|
invocationMeta?: InvocationMeta;
|
|
8490
|
+
/**
|
|
8491
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
8492
|
+
*
|
|
8493
|
+
* @remarks
|
|
8494
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
8495
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
8496
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
8497
|
+
* decode it.
|
|
8498
|
+
*/
|
|
8499
|
+
quote?: string;
|
|
8454
8500
|
}
|
|
8455
8501
|
|
|
8456
8502
|
/**
|
|
@@ -8566,12 +8612,21 @@ interface ServiceSwapConfig {
|
|
|
8566
8612
|
recipientAddress?: string;
|
|
8567
8613
|
};
|
|
8568
8614
|
/**
|
|
8569
|
-
*
|
|
8570
|
-
*
|
|
8615
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
8616
|
+
*
|
|
8617
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
8618
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
8571
8619
|
*
|
|
8572
8620
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
8573
8621
|
* source, or expose it in telemetry.
|
|
8574
8622
|
*/
|
|
8623
|
+
apiKey?: string | undefined;
|
|
8624
|
+
/**
|
|
8625
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
8626
|
+
*
|
|
8627
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
8628
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
8629
|
+
*/
|
|
8575
8630
|
kitKey?: string;
|
|
8576
8631
|
/**
|
|
8577
8632
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -9049,12 +9104,21 @@ interface SwapConfig {
|
|
|
9049
9104
|
recipientAddress: string;
|
|
9050
9105
|
};
|
|
9051
9106
|
/**
|
|
9052
|
-
*
|
|
9053
|
-
*
|
|
9107
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
9108
|
+
*
|
|
9109
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
9110
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
9054
9111
|
*
|
|
9055
9112
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
9056
9113
|
* source, or expose it in telemetry.
|
|
9057
9114
|
*/
|
|
9115
|
+
apiKey?: string | undefined;
|
|
9116
|
+
/**
|
|
9117
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
9118
|
+
*
|
|
9119
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
9120
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
9121
|
+
*/
|
|
9058
9122
|
kitKey?: string;
|
|
9059
9123
|
}
|
|
9060
9124
|
/**
|
|
@@ -9455,13 +9519,18 @@ interface AppKitContext {
|
|
|
9455
9519
|
*/
|
|
9456
9520
|
disableErrorReporting?: boolean;
|
|
9457
9521
|
/**
|
|
9458
|
-
* Custom HTTP headers forwarded with
|
|
9459
|
-
* attestation (Iris)
|
|
9522
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
9523
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
9524
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
9525
|
+
* operations.
|
|
9460
9526
|
*
|
|
9461
9527
|
* @remarks
|
|
9462
9528
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
9463
|
-
* rather than replacing them.
|
|
9464
|
-
* the SDK does not interpret it.
|
|
9529
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
9530
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
9531
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
9532
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
9533
|
+
* unified-balance kit.
|
|
9465
9534
|
*/
|
|
9466
9535
|
headers?: Record<string, string>;
|
|
9467
9536
|
}
|
package/earn.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
|
|
@@ -7595,29 +7599,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
7595
7599
|
* Configuration options for earn operations.
|
|
7596
7600
|
*
|
|
7597
7601
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
7598
|
-
* and without
|
|
7602
|
+
* and without an API key. When present, the API key enables permissioned
|
|
7599
7603
|
* features like integrator attribution tracking.
|
|
7600
7604
|
*
|
|
7601
7605
|
* @example
|
|
7602
7606
|
* ```typescript
|
|
7603
|
-
* // Permissionless (no
|
|
7607
|
+
* // Permissionless (no API key)
|
|
7604
7608
|
* const config: EarnConfig = {}
|
|
7605
7609
|
*
|
|
7606
|
-
* // Permissioned (with
|
|
7610
|
+
* // Permissioned (with API key)
|
|
7607
7611
|
* const config: EarnConfig = {
|
|
7608
|
-
*
|
|
7612
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
7609
7613
|
* }
|
|
7610
7614
|
* ```
|
|
7611
7615
|
*/
|
|
7612
7616
|
interface EarnConfig {
|
|
7613
7617
|
/**
|
|
7614
|
-
* Optional
|
|
7618
|
+
* Optional Circle API key for permissioned access.
|
|
7615
7619
|
*
|
|
7616
7620
|
* When provided, enables integrator attribution tracking and
|
|
7617
7621
|
* higher rate limits. When omitted, the SDK operates in
|
|
7618
7622
|
* permissionless mode.
|
|
7619
7623
|
*
|
|
7620
|
-
* Format:
|
|
7624
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7625
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7626
|
+
*/
|
|
7627
|
+
readonly apiKey?: string | undefined;
|
|
7628
|
+
/**
|
|
7629
|
+
* Optional Circle API key for permissioned access.
|
|
7630
|
+
*
|
|
7631
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7632
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7621
7633
|
*/
|
|
7622
7634
|
readonly kitKey?: string | undefined;
|
|
7623
7635
|
/**
|
|
@@ -8264,6 +8276,30 @@ type EarnClaimRewardsQuoteInfo = Omit<ClaimRewardsQuoteInfo, 'rewards'> & {
|
|
|
8264
8276
|
*/
|
|
8265
8277
|
type EarnOperationParams = AnyDepositParams | WithdrawParams | ClaimRewardsParams | GetVaultsParams | ExploreVaultsParams | ExploreVaultsIteratorParams | GetPositionParams | GetDepositQuoteParams | GetWithdrawalQuoteParams | GetClaimRewardsQuoteParams;
|
|
8266
8278
|
|
|
8279
|
+
/**
|
|
8280
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
8281
|
+
*
|
|
8282
|
+
* @remarks
|
|
8283
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
8284
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
8285
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
8286
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
8287
|
+
*
|
|
8288
|
+
* @example
|
|
8289
|
+
* ```typescript
|
|
8290
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
8291
|
+
*
|
|
8292
|
+
* const config: BridgeExecutionConfig = {
|
|
8293
|
+
* transferSpeed: 'FAST',
|
|
8294
|
+
* feePayment: 'source',
|
|
8295
|
+
* }
|
|
8296
|
+
* ```
|
|
8297
|
+
* @since 1.14.0
|
|
8298
|
+
*/
|
|
8299
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
8300
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
8301
|
+
feePayment?: 'source' | 'destination';
|
|
8302
|
+
}
|
|
8267
8303
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
8268
8304
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
8269
8305
|
/**
|
|
@@ -8424,7 +8460,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
8424
8460
|
* Optional bridge configuration (e.g., transfer speed).
|
|
8425
8461
|
* If omitted, defaults will be used
|
|
8426
8462
|
*/
|
|
8427
|
-
config?:
|
|
8463
|
+
config?: BridgeExecutionConfig;
|
|
8428
8464
|
/**
|
|
8429
8465
|
* The token to transfer. Defaults to 'USDC'.
|
|
8430
8466
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -8451,6 +8487,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
8451
8487
|
* ```
|
|
8452
8488
|
*/
|
|
8453
8489
|
invocationMeta?: InvocationMeta;
|
|
8490
|
+
/**
|
|
8491
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
8492
|
+
*
|
|
8493
|
+
* @remarks
|
|
8494
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
8495
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
8496
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
8497
|
+
* decode it.
|
|
8498
|
+
*/
|
|
8499
|
+
quote?: string;
|
|
8454
8500
|
}
|
|
8455
8501
|
|
|
8456
8502
|
/**
|
|
@@ -8566,12 +8612,21 @@ interface ServiceSwapConfig {
|
|
|
8566
8612
|
recipientAddress?: string;
|
|
8567
8613
|
};
|
|
8568
8614
|
/**
|
|
8569
|
-
*
|
|
8570
|
-
*
|
|
8615
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
8616
|
+
*
|
|
8617
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
8618
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
8571
8619
|
*
|
|
8572
8620
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
8573
8621
|
* source, or expose it in telemetry.
|
|
8574
8622
|
*/
|
|
8623
|
+
apiKey?: string | undefined;
|
|
8624
|
+
/**
|
|
8625
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
8626
|
+
*
|
|
8627
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
8628
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
8629
|
+
*/
|
|
8575
8630
|
kitKey?: string;
|
|
8576
8631
|
/**
|
|
8577
8632
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -9049,12 +9104,21 @@ interface SwapConfig {
|
|
|
9049
9104
|
recipientAddress: string;
|
|
9050
9105
|
};
|
|
9051
9106
|
/**
|
|
9052
|
-
*
|
|
9053
|
-
*
|
|
9107
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
9108
|
+
*
|
|
9109
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
9110
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
9054
9111
|
*
|
|
9055
9112
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
9056
9113
|
* source, or expose it in telemetry.
|
|
9057
9114
|
*/
|
|
9115
|
+
apiKey?: string | undefined;
|
|
9116
|
+
/**
|
|
9117
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
9118
|
+
*
|
|
9119
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
9120
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
9121
|
+
*/
|
|
9058
9122
|
kitKey?: string;
|
|
9059
9123
|
}
|
|
9060
9124
|
/**
|
|
@@ -9455,13 +9519,18 @@ interface AppKitContext {
|
|
|
9455
9519
|
*/
|
|
9456
9520
|
disableErrorReporting?: boolean;
|
|
9457
9521
|
/**
|
|
9458
|
-
* Custom HTTP headers forwarded with
|
|
9459
|
-
* attestation (Iris)
|
|
9522
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
9523
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
9524
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
9525
|
+
* operations.
|
|
9460
9526
|
*
|
|
9461
9527
|
* @remarks
|
|
9462
9528
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
9463
|
-
* rather than replacing them.
|
|
9464
|
-
* the SDK does not interpret it.
|
|
9529
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
9530
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
9531
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
9532
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
9533
|
+
* unified-balance kit.
|
|
9465
9534
|
*/
|
|
9466
9535
|
headers?: Record<string, string>;
|
|
9467
9536
|
}
|