@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/swap.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.
|
|
@@ -5909,12 +5968,21 @@ interface ServiceSwapConfig {
|
|
|
5909
5968
|
recipientAddress?: string;
|
|
5910
5969
|
};
|
|
5911
5970
|
/**
|
|
5912
|
-
*
|
|
5913
|
-
*
|
|
5971
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5972
|
+
*
|
|
5973
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
5974
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
5914
5975
|
*
|
|
5915
5976
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
5916
5977
|
* source, or expose it in telemetry.
|
|
5917
5978
|
*/
|
|
5979
|
+
apiKey?: string | undefined;
|
|
5980
|
+
/**
|
|
5981
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5982
|
+
*
|
|
5983
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
5984
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
5985
|
+
*/
|
|
5918
5986
|
kitKey?: string;
|
|
5919
5987
|
/**
|
|
5920
5988
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6445,12 +6513,21 @@ interface SwapConfig {
|
|
|
6445
6513
|
recipientAddress: string;
|
|
6446
6514
|
};
|
|
6447
6515
|
/**
|
|
6448
|
-
*
|
|
6449
|
-
*
|
|
6516
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6517
|
+
*
|
|
6518
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6519
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6450
6520
|
*
|
|
6451
6521
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6452
6522
|
* source, or expose it in telemetry.
|
|
6453
6523
|
*/
|
|
6524
|
+
apiKey?: string | undefined;
|
|
6525
|
+
/**
|
|
6526
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6527
|
+
*
|
|
6528
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6529
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6530
|
+
*/
|
|
6454
6531
|
kitKey?: string;
|
|
6455
6532
|
}
|
|
6456
6533
|
/**
|
|
@@ -6490,7 +6567,13 @@ interface ResolvedSwapConfig extends Omit<SwapConfig, 'customFee'> {
|
|
|
6490
6567
|
recipientAddress?: string;
|
|
6491
6568
|
};
|
|
6492
6569
|
}
|
|
6493
|
-
|
|
6570
|
+
/**
|
|
6571
|
+
* Swap config as echoed back on a result, with credentials removed.
|
|
6572
|
+
*
|
|
6573
|
+
* Both credential fields are omitted so a returned {@link SwapResult} can be
|
|
6574
|
+
* logged or serialized without leaking the secret used to authenticate it.
|
|
6575
|
+
*/
|
|
6576
|
+
type SwapResultConfig = Omit<ResolvedSwapConfig, 'apiKey' | 'kitKey'>;
|
|
6494
6577
|
/**
|
|
6495
6578
|
* Result of an executed swap operation.
|
|
6496
6579
|
*
|
|
@@ -6786,6 +6869,30 @@ interface SwapParams<TFromAdapterCapabilities extends AdapterCapabilities = Adap
|
|
|
6786
6869
|
config?: SwapConfig;
|
|
6787
6870
|
}
|
|
6788
6871
|
|
|
6872
|
+
/**
|
|
6873
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
6874
|
+
*
|
|
6875
|
+
* @remarks
|
|
6876
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
6877
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
6878
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
6879
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
6880
|
+
*
|
|
6881
|
+
* @example
|
|
6882
|
+
* ```typescript
|
|
6883
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
6884
|
+
*
|
|
6885
|
+
* const config: BridgeExecutionConfig = {
|
|
6886
|
+
* transferSpeed: 'FAST',
|
|
6887
|
+
* feePayment: 'source',
|
|
6888
|
+
* }
|
|
6889
|
+
* ```
|
|
6890
|
+
* @since 1.14.0
|
|
6891
|
+
*/
|
|
6892
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
6893
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
6894
|
+
feePayment?: 'source' | 'destination';
|
|
6895
|
+
}
|
|
6789
6896
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6790
6897
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6791
6898
|
/**
|
|
@@ -6946,7 +7053,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6946
7053
|
* Optional bridge configuration (e.g., transfer speed).
|
|
6947
7054
|
* If omitted, defaults will be used
|
|
6948
7055
|
*/
|
|
6949
|
-
config?:
|
|
7056
|
+
config?: BridgeExecutionConfig;
|
|
6950
7057
|
/**
|
|
6951
7058
|
* The token to transfer. Defaults to 'USDC'.
|
|
6952
7059
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -6973,6 +7080,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6973
7080
|
* ```
|
|
6974
7081
|
*/
|
|
6975
7082
|
invocationMeta?: InvocationMeta;
|
|
7083
|
+
/**
|
|
7084
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
7085
|
+
*
|
|
7086
|
+
* @remarks
|
|
7087
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
7088
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
7089
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
7090
|
+
* decode it.
|
|
7091
|
+
*/
|
|
7092
|
+
quote?: string;
|
|
6976
7093
|
}
|
|
6977
7094
|
|
|
6978
7095
|
/**
|
|
@@ -7017,29 +7134,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
7017
7134
|
* Configuration options for earn operations.
|
|
7018
7135
|
*
|
|
7019
7136
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
7020
|
-
* and without
|
|
7137
|
+
* and without an API key. When present, the API key enables permissioned
|
|
7021
7138
|
* features like integrator attribution tracking.
|
|
7022
7139
|
*
|
|
7023
7140
|
* @example
|
|
7024
7141
|
* ```typescript
|
|
7025
|
-
* // Permissionless (no
|
|
7142
|
+
* // Permissionless (no API key)
|
|
7026
7143
|
* const config: EarnConfig = {}
|
|
7027
7144
|
*
|
|
7028
|
-
* // Permissioned (with
|
|
7145
|
+
* // Permissioned (with API key)
|
|
7029
7146
|
* const config: EarnConfig = {
|
|
7030
|
-
*
|
|
7147
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
7031
7148
|
* }
|
|
7032
7149
|
* ```
|
|
7033
7150
|
*/
|
|
7034
7151
|
interface EarnConfig {
|
|
7035
7152
|
/**
|
|
7036
|
-
* Optional
|
|
7153
|
+
* Optional Circle API key for permissioned access.
|
|
7037
7154
|
*
|
|
7038
7155
|
* When provided, enables integrator attribution tracking and
|
|
7039
7156
|
* higher rate limits. When omitted, the SDK operates in
|
|
7040
7157
|
* permissionless mode.
|
|
7041
7158
|
*
|
|
7042
|
-
* Format:
|
|
7159
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7160
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7161
|
+
*/
|
|
7162
|
+
readonly apiKey?: string | undefined;
|
|
7163
|
+
/**
|
|
7164
|
+
* Optional Circle API key for permissioned access.
|
|
7165
|
+
*
|
|
7166
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7167
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7043
7168
|
*/
|
|
7044
7169
|
readonly kitKey?: string | undefined;
|
|
7045
7170
|
/**
|
|
@@ -7806,13 +7931,18 @@ interface AppKitContext {
|
|
|
7806
7931
|
*/
|
|
7807
7932
|
disableErrorReporting?: boolean;
|
|
7808
7933
|
/**
|
|
7809
|
-
* Custom HTTP headers forwarded with
|
|
7810
|
-
* attestation (Iris)
|
|
7934
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7935
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7936
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7937
|
+
* operations.
|
|
7811
7938
|
*
|
|
7812
7939
|
* @remarks
|
|
7813
7940
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7814
|
-
* rather than replacing them.
|
|
7815
|
-
* the SDK does not interpret it.
|
|
7941
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7942
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7943
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7944
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7945
|
+
* unified-balance kit.
|
|
7816
7946
|
*/
|
|
7817
7947
|
headers?: Record<string, string>;
|
|
7818
7948
|
}
|
package/swap.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.
|
|
@@ -5909,12 +5968,21 @@ interface ServiceSwapConfig {
|
|
|
5909
5968
|
recipientAddress?: string;
|
|
5910
5969
|
};
|
|
5911
5970
|
/**
|
|
5912
|
-
*
|
|
5913
|
-
*
|
|
5971
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5972
|
+
*
|
|
5973
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
5974
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
5914
5975
|
*
|
|
5915
5976
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
5916
5977
|
* source, or expose it in telemetry.
|
|
5917
5978
|
*/
|
|
5979
|
+
apiKey?: string | undefined;
|
|
5980
|
+
/**
|
|
5981
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
5982
|
+
*
|
|
5983
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
5984
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
5985
|
+
*/
|
|
5918
5986
|
kitKey?: string;
|
|
5919
5987
|
/**
|
|
5920
5988
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -6445,12 +6513,21 @@ interface SwapConfig {
|
|
|
6445
6513
|
recipientAddress: string;
|
|
6446
6514
|
};
|
|
6447
6515
|
/**
|
|
6448
|
-
*
|
|
6449
|
-
*
|
|
6516
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6517
|
+
*
|
|
6518
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
6519
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
6450
6520
|
*
|
|
6451
6521
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
6452
6522
|
* source, or expose it in telemetry.
|
|
6453
6523
|
*/
|
|
6524
|
+
apiKey?: string | undefined;
|
|
6525
|
+
/**
|
|
6526
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
6527
|
+
*
|
|
6528
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
6529
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6530
|
+
*/
|
|
6454
6531
|
kitKey?: string;
|
|
6455
6532
|
}
|
|
6456
6533
|
/**
|
|
@@ -6490,7 +6567,13 @@ interface ResolvedSwapConfig extends Omit<SwapConfig, 'customFee'> {
|
|
|
6490
6567
|
recipientAddress?: string;
|
|
6491
6568
|
};
|
|
6492
6569
|
}
|
|
6493
|
-
|
|
6570
|
+
/**
|
|
6571
|
+
* Swap config as echoed back on a result, with credentials removed.
|
|
6572
|
+
*
|
|
6573
|
+
* Both credential fields are omitted so a returned {@link SwapResult} can be
|
|
6574
|
+
* logged or serialized without leaking the secret used to authenticate it.
|
|
6575
|
+
*/
|
|
6576
|
+
type SwapResultConfig = Omit<ResolvedSwapConfig, 'apiKey' | 'kitKey'>;
|
|
6494
6577
|
/**
|
|
6495
6578
|
* Result of an executed swap operation.
|
|
6496
6579
|
*
|
|
@@ -6786,6 +6869,30 @@ interface SwapParams<TFromAdapterCapabilities extends AdapterCapabilities = Adap
|
|
|
6786
6869
|
config?: SwapConfig;
|
|
6787
6870
|
}
|
|
6788
6871
|
|
|
6872
|
+
/**
|
|
6873
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
6874
|
+
*
|
|
6875
|
+
* @remarks
|
|
6876
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
6877
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
6878
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
6879
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
6880
|
+
*
|
|
6881
|
+
* @example
|
|
6882
|
+
* ```typescript
|
|
6883
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
6884
|
+
*
|
|
6885
|
+
* const config: BridgeExecutionConfig = {
|
|
6886
|
+
* transferSpeed: 'FAST',
|
|
6887
|
+
* feePayment: 'source',
|
|
6888
|
+
* }
|
|
6889
|
+
* ```
|
|
6890
|
+
* @since 1.14.0
|
|
6891
|
+
*/
|
|
6892
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
6893
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
6894
|
+
feePayment?: 'source' | 'destination';
|
|
6895
|
+
}
|
|
6789
6896
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6790
6897
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
6791
6898
|
/**
|
|
@@ -6946,7 +7053,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6946
7053
|
* Optional bridge configuration (e.g., transfer speed).
|
|
6947
7054
|
* If omitted, defaults will be used
|
|
6948
7055
|
*/
|
|
6949
|
-
config?:
|
|
7056
|
+
config?: BridgeExecutionConfig;
|
|
6950
7057
|
/**
|
|
6951
7058
|
* The token to transfer. Defaults to 'USDC'.
|
|
6952
7059
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -6973,6 +7080,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
6973
7080
|
* ```
|
|
6974
7081
|
*/
|
|
6975
7082
|
invocationMeta?: InvocationMeta;
|
|
7083
|
+
/**
|
|
7084
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
7085
|
+
*
|
|
7086
|
+
* @remarks
|
|
7087
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
7088
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
7089
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
7090
|
+
* decode it.
|
|
7091
|
+
*/
|
|
7092
|
+
quote?: string;
|
|
6976
7093
|
}
|
|
6977
7094
|
|
|
6978
7095
|
/**
|
|
@@ -7017,29 +7134,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
7017
7134
|
* Configuration options for earn operations.
|
|
7018
7135
|
*
|
|
7019
7136
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
7020
|
-
* and without
|
|
7137
|
+
* and without an API key. When present, the API key enables permissioned
|
|
7021
7138
|
* features like integrator attribution tracking.
|
|
7022
7139
|
*
|
|
7023
7140
|
* @example
|
|
7024
7141
|
* ```typescript
|
|
7025
|
-
* // Permissionless (no
|
|
7142
|
+
* // Permissionless (no API key)
|
|
7026
7143
|
* const config: EarnConfig = {}
|
|
7027
7144
|
*
|
|
7028
|
-
* // Permissioned (with
|
|
7145
|
+
* // Permissioned (with API key)
|
|
7029
7146
|
* const config: EarnConfig = {
|
|
7030
|
-
*
|
|
7147
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
7031
7148
|
* }
|
|
7032
7149
|
* ```
|
|
7033
7150
|
*/
|
|
7034
7151
|
interface EarnConfig {
|
|
7035
7152
|
/**
|
|
7036
|
-
* Optional
|
|
7153
|
+
* Optional Circle API key for permissioned access.
|
|
7037
7154
|
*
|
|
7038
7155
|
* When provided, enables integrator attribution tracking and
|
|
7039
7156
|
* higher rate limits. When omitted, the SDK operates in
|
|
7040
7157
|
* permissionless mode.
|
|
7041
7158
|
*
|
|
7042
|
-
* Format:
|
|
7159
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7160
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7161
|
+
*/
|
|
7162
|
+
readonly apiKey?: string | undefined;
|
|
7163
|
+
/**
|
|
7164
|
+
* Optional Circle API key for permissioned access.
|
|
7165
|
+
*
|
|
7166
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7167
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7043
7168
|
*/
|
|
7044
7169
|
readonly kitKey?: string | undefined;
|
|
7045
7170
|
/**
|
|
@@ -7806,13 +7931,18 @@ interface AppKitContext {
|
|
|
7806
7931
|
*/
|
|
7807
7932
|
disableErrorReporting?: boolean;
|
|
7808
7933
|
/**
|
|
7809
|
-
* Custom HTTP headers forwarded with
|
|
7810
|
-
* attestation (Iris)
|
|
7934
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
7935
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
7936
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
7937
|
+
* operations.
|
|
7811
7938
|
*
|
|
7812
7939
|
* @remarks
|
|
7813
7940
|
* Headers are merged on top of the SDK defaults (such as `Content-Type`)
|
|
7814
|
-
* rather than replacing them.
|
|
7815
|
-
* the SDK does not interpret it.
|
|
7941
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
7942
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
7943
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
7944
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
7945
|
+
* unified-balance kit.
|
|
7816
7946
|
*/
|
|
7817
7947
|
headers?: Record<string, string>;
|
|
7818
7948
|
}
|