@circle-fin/app-kit 1.12.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +115 -0
- package/README.md +31 -12
- package/bridge.cjs +3231 -340
- package/bridge.d.cts +141 -17
- package/bridge.d.mts +141 -17
- package/bridge.d.ts +141 -17
- package/bridge.mjs +3233 -342
- package/chains.cjs +261 -8
- package/chains.d.cts +135 -1
- package/chains.d.mts +135 -1
- package/chains.d.ts +135 -1
- package/chains.mjs +260 -9
- package/context.d.cts +141 -17
- package/context.d.mts +141 -17
- package/context.d.ts +141 -17
- package/earn.cjs +887 -63
- package/earn.d.cts +141 -17
- package/earn.d.mts +141 -17
- package/earn.d.ts +141 -17
- package/earn.mjs +883 -63
- package/estimateBridge.cjs +3231 -340
- package/estimateBridge.d.cts +257 -18
- package/estimateBridge.d.mts +257 -18
- package/estimateBridge.d.ts +257 -18
- package/estimateBridge.mjs +3233 -342
- package/estimateSwap.cjs +988 -146
- package/estimateSwap.d.cts +141 -17
- package/estimateSwap.d.mts +141 -17
- package/estimateSwap.d.ts +141 -17
- package/estimateSwap.mjs +987 -146
- package/index.cjs +6828 -894
- package/index.d.cts +1621 -258
- package/index.d.mts +1621 -258
- package/index.d.ts +1621 -258
- package/index.mjs +6830 -896
- package/package.json +6 -6
- package/swap.cjs +988 -146
- package/swap.d.cts +148 -18
- package/swap.d.mts +148 -18
- package/swap.d.ts +148 -18
- package/swap.mjs +987 -146
- package/unifiedBalance.cjs +22219 -9689
- package/unifiedBalance.d.cts +620 -162
- package/unifiedBalance.d.mts +620 -162
- package/unifiedBalance.d.ts +620 -162
- package/unifiedBalance.mjs +22348 -9819
package/context.d.cts
CHANGED
|
@@ -559,6 +559,19 @@ interface GatewayV1Contracts {
|
|
|
559
559
|
* @example "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48"
|
|
560
560
|
*/
|
|
561
561
|
depositForHandler?: string;
|
|
562
|
+
/**
|
|
563
|
+
* The address of the `GenericExecutor` contract.
|
|
564
|
+
*
|
|
565
|
+
* @description Optional. The contract that acts as `mintRecipient` and
|
|
566
|
+
* `destinationCaller` for the CCTP v2 prepaid FORWARD path. It receives the
|
|
567
|
+
* CCTP mint and calls {@link GatewayV1Contracts.depositForHandler} to
|
|
568
|
+
* complete the fast deposit into the {@link GatewayV1Contracts.wallet}.
|
|
569
|
+
* Present only on chains that are fast-deposit destinations; other Gateway
|
|
570
|
+
* chains omit it.
|
|
571
|
+
*
|
|
572
|
+
* @example "0xFa7be2f04F3Ad4ca969260729c6d45B5625984A7"
|
|
573
|
+
*/
|
|
574
|
+
genericExecutor?: string;
|
|
562
575
|
}
|
|
563
576
|
/**
|
|
564
577
|
* Versioned map of Gateway contract configurations.
|
|
@@ -718,6 +731,8 @@ declare enum Blockchain {
|
|
|
718
731
|
Optimism_Sepolia = "Optimism_Sepolia",
|
|
719
732
|
Pharos = "Pharos",
|
|
720
733
|
Pharos_Testnet = "Pharos_Testnet",
|
|
734
|
+
Plasma = "Plasma",
|
|
735
|
+
Plasma_Testnet = "Plasma_Testnet",
|
|
721
736
|
Polkadot_Asset_Hub = "Polkadot_Asset_Hub",
|
|
722
737
|
Polkadot_Westmint = "Polkadot_Westmint",
|
|
723
738
|
Plume = "Plume",
|
|
@@ -946,6 +961,7 @@ declare enum BridgeChain {
|
|
|
946
961
|
Morph = "Morph",
|
|
947
962
|
Optimism = "Optimism",
|
|
948
963
|
Pharos = "Pharos",
|
|
964
|
+
Plasma = "Plasma",
|
|
949
965
|
Plume = "Plume",
|
|
950
966
|
Polygon = "Polygon",
|
|
951
967
|
Sei = "Sei",
|
|
@@ -971,6 +987,7 @@ declare enum BridgeChain {
|
|
|
971
987
|
Morph_Testnet = "Morph_Testnet",
|
|
972
988
|
Optimism_Sepolia = "Optimism_Sepolia",
|
|
973
989
|
Pharos_Testnet = "Pharos_Testnet",
|
|
990
|
+
Plasma_Testnet = "Plasma_Testnet",
|
|
974
991
|
Plume_Testnet = "Plume_Testnet",
|
|
975
992
|
Polygon_Amoy_Testnet = "Polygon_Amoy_Testnet",
|
|
976
993
|
Sei_Testnet = "Sei_Testnet",
|
|
@@ -2652,7 +2669,7 @@ interface ExecuteParams {
|
|
|
2652
2669
|
* fromAddress: '0x...',
|
|
2653
2670
|
* toAddress: '0x...',
|
|
2654
2671
|
* amount: '1000000',
|
|
2655
|
-
* apiKey: '
|
|
2672
|
+
* apiKey: 'TEST_API_KEY:...',
|
|
2656
2673
|
* })
|
|
2657
2674
|
*
|
|
2658
2675
|
* // Build token inputs with permit
|
|
@@ -2796,7 +2813,7 @@ interface ExecuteSwapEVMParams extends ActionParameters {
|
|
|
2796
2813
|
* fromAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
|
|
2797
2814
|
* toAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
|
|
2798
2815
|
* amount: '1000000',
|
|
2799
|
-
* apiKey: '
|
|
2816
|
+
* apiKey: 'TEST_API_KEY:...',
|
|
2800
2817
|
* })
|
|
2801
2818
|
*
|
|
2802
2819
|
* // Prepare action parameters
|
|
@@ -5459,6 +5476,48 @@ TChainDefinition extends ChainDefinition = ChainDefinition> extends WalletContex
|
|
|
5459
5476
|
* Must be a valid address format for the specified blockchain.
|
|
5460
5477
|
*/
|
|
5461
5478
|
recipientAddress?: string;
|
|
5479
|
+
/**
|
|
5480
|
+
* Optional destination dApp deposit action for a fast cross-chain transfer.
|
|
5481
|
+
*
|
|
5482
|
+
* When set, the burned USDC is minted to Circle's GenericExecutor on the
|
|
5483
|
+
* destination chain, which calls the registered dApp (for example, a Gateway
|
|
5484
|
+
* `depositFor`) in the same relayed flow. Consumed by the CCTP v2 provider's
|
|
5485
|
+
* executor-deposit path; requires `useForwarder: true`.
|
|
5486
|
+
*
|
|
5487
|
+
* @see {@link BridgeDepositAction}
|
|
5488
|
+
*/
|
|
5489
|
+
deposit?: BridgeDepositAction;
|
|
5490
|
+
}
|
|
5491
|
+
/**
|
|
5492
|
+
* Destination dApp deposit action for a fast cross-chain transfer.
|
|
5493
|
+
*
|
|
5494
|
+
* When present on a bridge destination, the CCTP v2 provider routes the
|
|
5495
|
+
* transfer through Circle's GenericExecutor: the burned USDC is minted to the
|
|
5496
|
+
* executor on the destination chain, which then calls the registered dApp (for
|
|
5497
|
+
* example, a Gateway `depositFor`) in the same relayed flow. Encoded into
|
|
5498
|
+
* executor hookData via `buildDepositForGenericExecutorPayload`.
|
|
5499
|
+
*
|
|
5500
|
+
* @example
|
|
5501
|
+
* ```typescript
|
|
5502
|
+
* import type { BridgeDepositAction } from '@core/provider'
|
|
5503
|
+
*
|
|
5504
|
+
* const deposit: BridgeDepositAction = {
|
|
5505
|
+
* dappId: 'gateway_deposit',
|
|
5506
|
+
* params: ['0xTokenMessengerWithFees', '0xDepositAccount', 0n],
|
|
5507
|
+
* }
|
|
5508
|
+
* ```
|
|
5509
|
+
*/
|
|
5510
|
+
interface BridgeDepositAction {
|
|
5511
|
+
/**
|
|
5512
|
+
* Registered dApp identifier the GenericExecutor invokes on the destination
|
|
5513
|
+
* chain (for example, `'gateway_deposit'`).
|
|
5514
|
+
*/
|
|
5515
|
+
dappId: string;
|
|
5516
|
+
/**
|
|
5517
|
+
* Positional arguments for the dApp function, in ABI order. Dynamic amount
|
|
5518
|
+
* slots are filled in by the executor from the minted amount.
|
|
5519
|
+
*/
|
|
5520
|
+
params: readonly unknown[];
|
|
5462
5521
|
}
|
|
5463
5522
|
/**
|
|
5464
5523
|
* Parameters for executing a cross-chain bridge operation.
|
|
@@ -5796,6 +5855,30 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
|
|
|
5796
5855
|
useForwarder?: boolean;
|
|
5797
5856
|
}) | ForwarderDestination<TChainIdentifier>;
|
|
5798
5857
|
|
|
5858
|
+
/**
|
|
5859
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
5860
|
+
*
|
|
5861
|
+
* @remarks
|
|
5862
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
5863
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
5864
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
5865
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
5866
|
+
*
|
|
5867
|
+
* @example
|
|
5868
|
+
* ```typescript
|
|
5869
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
5870
|
+
*
|
|
5871
|
+
* const config: BridgeExecutionConfig = {
|
|
5872
|
+
* transferSpeed: 'FAST',
|
|
5873
|
+
* feePayment: 'source',
|
|
5874
|
+
* }
|
|
5875
|
+
* ```
|
|
5876
|
+
* @since 1.14.0
|
|
5877
|
+
*/
|
|
5878
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
5879
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
5880
|
+
feePayment?: 'source' | 'destination';
|
|
5881
|
+
}
|
|
5799
5882
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5800
5883
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5801
5884
|
/**
|
|
@@ -5956,7 +6039,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
5956
6039
|
* Optional bridge configuration (e.g., transfer speed).
|
|
5957
6040
|
* If omitted, defaults will be used
|
|
5958
6041
|
*/
|
|
5959
|
-
config?:
|
|
6042
|
+
config?: BridgeExecutionConfig;
|
|
5960
6043
|
/**
|
|
5961
6044
|
* The token to transfer. Defaults to 'USDC'.
|
|
5962
6045
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -5983,6 +6066,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
5983
6066
|
* ```
|
|
5984
6067
|
*/
|
|
5985
6068
|
invocationMeta?: InvocationMeta;
|
|
6069
|
+
/**
|
|
6070
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
6071
|
+
*
|
|
6072
|
+
* @remarks
|
|
6073
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
6074
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
6075
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
6076
|
+
* decode it.
|
|
6077
|
+
*/
|
|
6078
|
+
quote?: string;
|
|
5986
6079
|
}
|
|
5987
6080
|
|
|
5988
6081
|
/**
|
|
@@ -6098,12 +6191,21 @@ interface ServiceSwapConfig {
|
|
|
6098
6191
|
recipientAddress?: string;
|
|
6099
6192
|
};
|
|
6100
6193
|
/**
|
|
6101
|
-
*
|
|
6102
|
-
*
|
|
6194
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6195
|
+
*
|
|
6196
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6197
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6103
6198
|
*
|
|
6104
6199
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6105
6200
|
* source, or expose it in telemetry.
|
|
6106
6201
|
*/
|
|
6202
|
+
apiKey?: string | undefined;
|
|
6203
|
+
/**
|
|
6204
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6205
|
+
*
|
|
6206
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
6207
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6208
|
+
*/
|
|
6107
6209
|
kitKey?: string;
|
|
6108
6210
|
/**
|
|
6109
6211
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6581,12 +6683,21 @@ interface SwapConfig {
|
|
|
6581
6683
|
recipientAddress: string;
|
|
6582
6684
|
};
|
|
6583
6685
|
/**
|
|
6584
|
-
*
|
|
6585
|
-
*
|
|
6686
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6687
|
+
*
|
|
6688
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6689
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6586
6690
|
*
|
|
6587
6691
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6588
6692
|
* source, or expose it in telemetry.
|
|
6589
6693
|
*/
|
|
6694
|
+
apiKey?: string | undefined;
|
|
6695
|
+
/**
|
|
6696
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6697
|
+
*
|
|
6698
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6699
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6700
|
+
*/
|
|
6590
6701
|
kitKey?: string;
|
|
6591
6702
|
}
|
|
6592
6703
|
/**
|
|
@@ -6715,29 +6826,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
6715
6826
|
* Configuration options for earn operations.
|
|
6716
6827
|
*
|
|
6717
6828
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
6718
|
-
* and without
|
|
6829
|
+
* and without an API key. When present, the API key enables permissioned
|
|
6719
6830
|
* features like integrator attribution tracking.
|
|
6720
6831
|
*
|
|
6721
6832
|
* @example
|
|
6722
6833
|
* ```typescript
|
|
6723
|
-
* // Permissionless (no
|
|
6834
|
+
* // Permissionless (no API key)
|
|
6724
6835
|
* const config: EarnConfig = {}
|
|
6725
6836
|
*
|
|
6726
|
-
* // Permissioned (with
|
|
6837
|
+
* // Permissioned (with API key)
|
|
6727
6838
|
* const config: EarnConfig = {
|
|
6728
|
-
*
|
|
6839
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
6729
6840
|
* }
|
|
6730
6841
|
* ```
|
|
6731
6842
|
*/
|
|
6732
6843
|
interface EarnConfig {
|
|
6733
6844
|
/**
|
|
6734
|
-
* Optional
|
|
6845
|
+
* Optional Circle API key for permissioned access.
|
|
6735
6846
|
*
|
|
6736
6847
|
* When provided, enables integrator attribution tracking and
|
|
6737
6848
|
* higher rate limits. When omitted, the SDK operates in
|
|
6738
6849
|
* permissionless mode.
|
|
6739
6850
|
*
|
|
6740
|
-
* Format:
|
|
6851
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6852
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6853
|
+
*/
|
|
6854
|
+
readonly apiKey?: string | undefined;
|
|
6855
|
+
/**
|
|
6856
|
+
* Optional Circle API key for permissioned access.
|
|
6857
|
+
*
|
|
6858
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
6859
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6741
6860
|
*/
|
|
6742
6861
|
readonly kitKey?: string | undefined;
|
|
6743
6862
|
/**
|
|
@@ -7504,13 +7623,18 @@ interface AppKitContext {
|
|
|
7504
7623
|
*/
|
|
7505
7624
|
disableErrorReporting?: boolean;
|
|
7506
7625
|
/**
|
|
7507
|
-
* Custom HTTP headers forwarded with
|
|
7508
|
-
* attestation (Iris)
|
|
7626
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7627
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7628
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7629
|
+
* operations.
|
|
7509
7630
|
*
|
|
7510
7631
|
* @remarks
|
|
7511
7632
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7512
|
-
* rather than replacing them.
|
|
7513
|
-
* the SDK does not interpret it.
|
|
7633
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7634
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7635
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7636
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7637
|
+
* unified-balance kit.
|
|
7514
7638
|
*/
|
|
7515
7639
|
headers?: Record<string, string>;
|
|
7516
7640
|
}
|
package/context.d.mts
CHANGED
|
@@ -559,6 +559,19 @@ interface GatewayV1Contracts {
|
|
|
559
559
|
* @example "0xD05E7D2E7d30b92c5F17d7d0fC575fce231F1A48"
|
|
560
560
|
*/
|
|
561
561
|
depositForHandler?: string;
|
|
562
|
+
/**
|
|
563
|
+
* The address of the `GenericExecutor` contract.
|
|
564
|
+
*
|
|
565
|
+
* @description Optional. The contract that acts as `mintRecipient` and
|
|
566
|
+
* `destinationCaller` for the CCTP v2 prepaid FORWARD path. It receives the
|
|
567
|
+
* CCTP mint and calls {@link GatewayV1Contracts.depositForHandler} to
|
|
568
|
+
* complete the fast deposit into the {@link GatewayV1Contracts.wallet}.
|
|
569
|
+
* Present only on chains that are fast-deposit destinations; other Gateway
|
|
570
|
+
* chains omit it.
|
|
571
|
+
*
|
|
572
|
+
* @example "0xFa7be2f04F3Ad4ca969260729c6d45B5625984A7"
|
|
573
|
+
*/
|
|
574
|
+
genericExecutor?: string;
|
|
562
575
|
}
|
|
563
576
|
/**
|
|
564
577
|
* Versioned map of Gateway contract configurations.
|
|
@@ -718,6 +731,8 @@ declare enum Blockchain {
|
|
|
718
731
|
Optimism_Sepolia = "Optimism_Sepolia",
|
|
719
732
|
Pharos = "Pharos",
|
|
720
733
|
Pharos_Testnet = "Pharos_Testnet",
|
|
734
|
+
Plasma = "Plasma",
|
|
735
|
+
Plasma_Testnet = "Plasma_Testnet",
|
|
721
736
|
Polkadot_Asset_Hub = "Polkadot_Asset_Hub",
|
|
722
737
|
Polkadot_Westmint = "Polkadot_Westmint",
|
|
723
738
|
Plume = "Plume",
|
|
@@ -946,6 +961,7 @@ declare enum BridgeChain {
|
|
|
946
961
|
Morph = "Morph",
|
|
947
962
|
Optimism = "Optimism",
|
|
948
963
|
Pharos = "Pharos",
|
|
964
|
+
Plasma = "Plasma",
|
|
949
965
|
Plume = "Plume",
|
|
950
966
|
Polygon = "Polygon",
|
|
951
967
|
Sei = "Sei",
|
|
@@ -971,6 +987,7 @@ declare enum BridgeChain {
|
|
|
971
987
|
Morph_Testnet = "Morph_Testnet",
|
|
972
988
|
Optimism_Sepolia = "Optimism_Sepolia",
|
|
973
989
|
Pharos_Testnet = "Pharos_Testnet",
|
|
990
|
+
Plasma_Testnet = "Plasma_Testnet",
|
|
974
991
|
Plume_Testnet = "Plume_Testnet",
|
|
975
992
|
Polygon_Amoy_Testnet = "Polygon_Amoy_Testnet",
|
|
976
993
|
Sei_Testnet = "Sei_Testnet",
|
|
@@ -2652,7 +2669,7 @@ interface ExecuteParams {
|
|
|
2652
2669
|
* fromAddress: '0x...',
|
|
2653
2670
|
* toAddress: '0x...',
|
|
2654
2671
|
* amount: '1000000',
|
|
2655
|
-
* apiKey: '
|
|
2672
|
+
* apiKey: 'TEST_API_KEY:...',
|
|
2656
2673
|
* })
|
|
2657
2674
|
*
|
|
2658
2675
|
* // Build token inputs with permit
|
|
@@ -2796,7 +2813,7 @@ interface ExecuteSwapEVMParams extends ActionParameters {
|
|
|
2796
2813
|
* fromAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
|
|
2797
2814
|
* toAddress: 'YubQzu18FDqJRyNfG8JqHmsdbxhnoQqcKUHBdUkN6tP',
|
|
2798
2815
|
* amount: '1000000',
|
|
2799
|
-
* apiKey: '
|
|
2816
|
+
* apiKey: 'TEST_API_KEY:...',
|
|
2800
2817
|
* })
|
|
2801
2818
|
*
|
|
2802
2819
|
* // Prepare action parameters
|
|
@@ -5459,6 +5476,48 @@ TChainDefinition extends ChainDefinition = ChainDefinition> extends WalletContex
|
|
|
5459
5476
|
* Must be a valid address format for the specified blockchain.
|
|
5460
5477
|
*/
|
|
5461
5478
|
recipientAddress?: string;
|
|
5479
|
+
/**
|
|
5480
|
+
* Optional destination dApp deposit action for a fast cross-chain transfer.
|
|
5481
|
+
*
|
|
5482
|
+
* When set, the burned USDC is minted to Circle's GenericExecutor on the
|
|
5483
|
+
* destination chain, which calls the registered dApp (for example, a Gateway
|
|
5484
|
+
* `depositFor`) in the same relayed flow. Consumed by the CCTP v2 provider's
|
|
5485
|
+
* executor-deposit path; requires `useForwarder: true`.
|
|
5486
|
+
*
|
|
5487
|
+
* @see {@link BridgeDepositAction}
|
|
5488
|
+
*/
|
|
5489
|
+
deposit?: BridgeDepositAction;
|
|
5490
|
+
}
|
|
5491
|
+
/**
|
|
5492
|
+
* Destination dApp deposit action for a fast cross-chain transfer.
|
|
5493
|
+
*
|
|
5494
|
+
* When present on a bridge destination, the CCTP v2 provider routes the
|
|
5495
|
+
* transfer through Circle's GenericExecutor: the burned USDC is minted to the
|
|
5496
|
+
* executor on the destination chain, which then calls the registered dApp (for
|
|
5497
|
+
* example, a Gateway `depositFor`) in the same relayed flow. Encoded into
|
|
5498
|
+
* executor hookData via `buildDepositForGenericExecutorPayload`.
|
|
5499
|
+
*
|
|
5500
|
+
* @example
|
|
5501
|
+
* ```typescript
|
|
5502
|
+
* import type { BridgeDepositAction } from '@core/provider'
|
|
5503
|
+
*
|
|
5504
|
+
* const deposit: BridgeDepositAction = {
|
|
5505
|
+
* dappId: 'gateway_deposit',
|
|
5506
|
+
* params: ['0xTokenMessengerWithFees', '0xDepositAccount', 0n],
|
|
5507
|
+
* }
|
|
5508
|
+
* ```
|
|
5509
|
+
*/
|
|
5510
|
+
interface BridgeDepositAction {
|
|
5511
|
+
/**
|
|
5512
|
+
* Registered dApp identifier the GenericExecutor invokes on the destination
|
|
5513
|
+
* chain (for example, `'gateway_deposit'`).
|
|
5514
|
+
*/
|
|
5515
|
+
dappId: string;
|
|
5516
|
+
/**
|
|
5517
|
+
* Positional arguments for the dApp function, in ABI order. Dynamic amount
|
|
5518
|
+
* slots are filled in by the executor from the minted amount.
|
|
5519
|
+
*/
|
|
5520
|
+
params: readonly unknown[];
|
|
5462
5521
|
}
|
|
5463
5522
|
/**
|
|
5464
5523
|
* Parameters for executing a cross-chain bridge operation.
|
|
@@ -5796,6 +5855,30 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
|
|
|
5796
5855
|
useForwarder?: boolean;
|
|
5797
5856
|
}) | ForwarderDestination<TChainIdentifier>;
|
|
5798
5857
|
|
|
5858
|
+
/**
|
|
5859
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
5860
|
+
*
|
|
5861
|
+
* @remarks
|
|
5862
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
5863
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
5864
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
5865
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
5866
|
+
*
|
|
5867
|
+
* @example
|
|
5868
|
+
* ```typescript
|
|
5869
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
5870
|
+
*
|
|
5871
|
+
* const config: BridgeExecutionConfig = {
|
|
5872
|
+
* transferSpeed: 'FAST',
|
|
5873
|
+
* feePayment: 'source',
|
|
5874
|
+
* }
|
|
5875
|
+
* ```
|
|
5876
|
+
* @since 1.14.0
|
|
5877
|
+
*/
|
|
5878
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
5879
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
5880
|
+
feePayment?: 'source' | 'destination';
|
|
5881
|
+
}
|
|
5799
5882
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5800
5883
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
5801
5884
|
/**
|
|
@@ -5956,7 +6039,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
5956
6039
|
* Optional bridge configuration (e.g., transfer speed).
|
|
5957
6040
|
* If omitted, defaults will be used
|
|
5958
6041
|
*/
|
|
5959
|
-
config?:
|
|
6042
|
+
config?: BridgeExecutionConfig;
|
|
5960
6043
|
/**
|
|
5961
6044
|
* The token to transfer. Defaults to 'USDC'.
|
|
5962
6045
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -5983,6 +6066,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
5983
6066
|
* ```
|
|
5984
6067
|
*/
|
|
5985
6068
|
invocationMeta?: InvocationMeta;
|
|
6069
|
+
/**
|
|
6070
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
6071
|
+
*
|
|
6072
|
+
* @remarks
|
|
6073
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
6074
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
6075
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
6076
|
+
* decode it.
|
|
6077
|
+
*/
|
|
6078
|
+
quote?: string;
|
|
5986
6079
|
}
|
|
5987
6080
|
|
|
5988
6081
|
/**
|
|
@@ -6098,12 +6191,21 @@ interface ServiceSwapConfig {
|
|
|
6098
6191
|
recipientAddress?: string;
|
|
6099
6192
|
};
|
|
6100
6193
|
/**
|
|
6101
|
-
*
|
|
6102
|
-
*
|
|
6194
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6195
|
+
*
|
|
6196
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6197
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6103
6198
|
*
|
|
6104
6199
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6105
6200
|
* source, or expose it in telemetry.
|
|
6106
6201
|
*/
|
|
6202
|
+
apiKey?: string | undefined;
|
|
6203
|
+
/**
|
|
6204
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6205
|
+
*
|
|
6206
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
6207
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6208
|
+
*/
|
|
6107
6209
|
kitKey?: string;
|
|
6108
6210
|
/**
|
|
6109
6211
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6581,12 +6683,21 @@ interface SwapConfig {
|
|
|
6581
6683
|
recipientAddress: string;
|
|
6582
6684
|
};
|
|
6583
6685
|
/**
|
|
6584
|
-
*
|
|
6585
|
-
*
|
|
6686
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6687
|
+
*
|
|
6688
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6689
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6586
6690
|
*
|
|
6587
6691
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6588
6692
|
* source, or expose it in telemetry.
|
|
6589
6693
|
*/
|
|
6694
|
+
apiKey?: string | undefined;
|
|
6695
|
+
/**
|
|
6696
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6697
|
+
*
|
|
6698
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6699
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6700
|
+
*/
|
|
6590
6701
|
kitKey?: string;
|
|
6591
6702
|
}
|
|
6592
6703
|
/**
|
|
@@ -6715,29 +6826,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
6715
6826
|
* Configuration options for earn operations.
|
|
6716
6827
|
*
|
|
6717
6828
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
6718
|
-
* and without
|
|
6829
|
+
* and without an API key. When present, the API key enables permissioned
|
|
6719
6830
|
* features like integrator attribution tracking.
|
|
6720
6831
|
*
|
|
6721
6832
|
* @example
|
|
6722
6833
|
* ```typescript
|
|
6723
|
-
* // Permissionless (no
|
|
6834
|
+
* // Permissionless (no API key)
|
|
6724
6835
|
* const config: EarnConfig = {}
|
|
6725
6836
|
*
|
|
6726
|
-
* // Permissioned (with
|
|
6837
|
+
* // Permissioned (with API key)
|
|
6727
6838
|
* const config: EarnConfig = {
|
|
6728
|
-
*
|
|
6839
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
6729
6840
|
* }
|
|
6730
6841
|
* ```
|
|
6731
6842
|
*/
|
|
6732
6843
|
interface EarnConfig {
|
|
6733
6844
|
/**
|
|
6734
|
-
* Optional
|
|
6845
|
+
* Optional Circle API key for permissioned access.
|
|
6735
6846
|
*
|
|
6736
6847
|
* When provided, enables integrator attribution tracking and
|
|
6737
6848
|
* higher rate limits. When omitted, the SDK operates in
|
|
6738
6849
|
* permissionless mode.
|
|
6739
6850
|
*
|
|
6740
|
-
* Format:
|
|
6851
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6852
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6853
|
+
*/
|
|
6854
|
+
readonly apiKey?: string | undefined;
|
|
6855
|
+
/**
|
|
6856
|
+
* Optional Circle API key for permissioned access.
|
|
6857
|
+
*
|
|
6858
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
6859
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6741
6860
|
*/
|
|
6742
6861
|
readonly kitKey?: string | undefined;
|
|
6743
6862
|
/**
|
|
@@ -7504,13 +7623,18 @@ interface AppKitContext {
|
|
|
7504
7623
|
*/
|
|
7505
7624
|
disableErrorReporting?: boolean;
|
|
7506
7625
|
/**
|
|
7507
|
-
* Custom HTTP headers forwarded with
|
|
7508
|
-
* attestation (Iris)
|
|
7626
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7627
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7628
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7629
|
+
* operations.
|
|
7509
7630
|
*
|
|
7510
7631
|
* @remarks
|
|
7511
7632
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7512
|
-
* rather than replacing them.
|
|
7513
|
-
* the SDK does not interpret it.
|
|
7633
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7634
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7635
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7636
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7637
|
+
* unified-balance kit.
|
|
7514
7638
|
*/
|
|
7515
7639
|
headers?: Record<string, string>;
|
|
7516
7640
|
}
|