@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/earn.d.ts
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.
|
|
@@ -7595,29 +7654,37 @@ type EarnAdapterContext<TAdapterCapabilities extends AdapterCapabilities = Adapt
|
|
|
7595
7654
|
* Configuration options for earn operations.
|
|
7596
7655
|
*
|
|
7597
7656
|
* EarnKit supports dual-mode authentication: operations work both with
|
|
7598
|
-
* and without
|
|
7657
|
+
* and without an API key. When present, the API key enables permissioned
|
|
7599
7658
|
* features like integrator attribution tracking.
|
|
7600
7659
|
*
|
|
7601
7660
|
* @example
|
|
7602
7661
|
* ```typescript
|
|
7603
|
-
* // Permissionless (no
|
|
7662
|
+
* // Permissionless (no API key)
|
|
7604
7663
|
* const config: EarnConfig = {}
|
|
7605
7664
|
*
|
|
7606
|
-
* // Permissioned (with
|
|
7665
|
+
* // Permissioned (with API key)
|
|
7607
7666
|
* const config: EarnConfig = {
|
|
7608
|
-
*
|
|
7667
|
+
* apiKey: 'TEST_API_KEY:keyId:keySecret',
|
|
7609
7668
|
* }
|
|
7610
7669
|
* ```
|
|
7611
7670
|
*/
|
|
7612
7671
|
interface EarnConfig {
|
|
7613
7672
|
/**
|
|
7614
|
-
* Optional
|
|
7673
|
+
* Optional Circle API key for permissioned access.
|
|
7615
7674
|
*
|
|
7616
7675
|
* When provided, enables integrator attribution tracking and
|
|
7617
7676
|
* higher rate limits. When omitted, the SDK operates in
|
|
7618
7677
|
* permissionless mode.
|
|
7619
7678
|
*
|
|
7620
|
-
* Format:
|
|
7679
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
7680
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
7681
|
+
*/
|
|
7682
|
+
readonly apiKey?: string | undefined;
|
|
7683
|
+
/**
|
|
7684
|
+
* Optional Circle API key for permissioned access.
|
|
7685
|
+
*
|
|
7686
|
+
* @deprecated Use {@link EarnConfig.apiKey} instead. Still honored when
|
|
7687
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7621
7688
|
*/
|
|
7622
7689
|
readonly kitKey?: string | undefined;
|
|
7623
7690
|
/**
|
|
@@ -8264,6 +8331,30 @@ type EarnClaimRewardsQuoteInfo = Omit<ClaimRewardsQuoteInfo, 'rewards'> & {
|
|
|
8264
8331
|
*/
|
|
8265
8332
|
type EarnOperationParams = AnyDepositParams | WithdrawParams | ClaimRewardsParams | GetVaultsParams | ExploreVaultsParams | ExploreVaultsIteratorParams | GetPositionParams | GetDepositQuoteParams | GetWithdrawalQuoteParams | GetClaimRewardsQuoteParams;
|
|
8266
8333
|
|
|
8334
|
+
/**
|
|
8335
|
+
* Configure how CCTP and forwarding fees are collected for a bridge.
|
|
8336
|
+
*
|
|
8337
|
+
* @remarks
|
|
8338
|
+
* Use `'source'` with `to.useForwarder: true` to treat `amount` as the exact
|
|
8339
|
+
* destination amount. Bridge Kit obtains a signed fee quote, collects the fee
|
|
8340
|
+
* in source-chain USDC, and leaves the destination mint unreduced. Omit the
|
|
8341
|
+
* option (or use `'destination'`) to preserve the existing max-fee behavior.
|
|
8342
|
+
*
|
|
8343
|
+
* @example
|
|
8344
|
+
* ```typescript
|
|
8345
|
+
* import type { BridgeExecutionConfig } from '@circle-fin/bridge-kit'
|
|
8346
|
+
*
|
|
8347
|
+
* const config: BridgeExecutionConfig = {
|
|
8348
|
+
* transferSpeed: 'FAST',
|
|
8349
|
+
* feePayment: 'source',
|
|
8350
|
+
* }
|
|
8351
|
+
* ```
|
|
8352
|
+
* @since 1.14.0
|
|
8353
|
+
*/
|
|
8354
|
+
interface BridgeExecutionConfig extends BridgeConfig {
|
|
8355
|
+
/** Select source-side signed fees or the legacy destination-side fee path. */
|
|
8356
|
+
feePayment?: 'source' | 'destination';
|
|
8357
|
+
}
|
|
8267
8358
|
type FeeFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
8268
8359
|
type FeeRecipientFunction<TFromAdapterCapabilities extends AdapterCapabilities, TToAdapterCapabilities extends AdapterCapabilities> = (feePayoutChain: ChainDefinition, params: BridgeParams$1<TFromAdapterCapabilities, TToAdapterCapabilities>) => Promise<string> | string;
|
|
8269
8360
|
/**
|
|
@@ -8424,7 +8515,7 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
8424
8515
|
* Optional bridge configuration (e.g., transfer speed).
|
|
8425
8516
|
* If omitted, defaults will be used
|
|
8426
8517
|
*/
|
|
8427
|
-
config?:
|
|
8518
|
+
config?: BridgeExecutionConfig;
|
|
8428
8519
|
/**
|
|
8429
8520
|
* The token to transfer. Defaults to 'USDC'.
|
|
8430
8521
|
* If omitted, the provider will use 'USDC' by default.
|
|
@@ -8451,6 +8542,16 @@ interface BridgeParams<TFromAdapterCapabilities extends AdapterCapabilities = Ad
|
|
|
8451
8542
|
* ```
|
|
8452
8543
|
*/
|
|
8453
8544
|
invocationMeta?: InvocationMeta;
|
|
8545
|
+
/**
|
|
8546
|
+
* Reuse the opaque signed quote returned by a receive-exact estimate.
|
|
8547
|
+
*
|
|
8548
|
+
* @remarks
|
|
8549
|
+
* Bridge Kit validates a supplied quote against the exact transfer and fails
|
|
8550
|
+
* when it is invalid, mismatched, expired, or too close to expiry. Omit this
|
|
8551
|
+
* value to let Bridge Kit fetch a fresh quote automatically. Never log or
|
|
8552
|
+
* decode it.
|
|
8553
|
+
*/
|
|
8554
|
+
quote?: string;
|
|
8454
8555
|
}
|
|
8455
8556
|
|
|
8456
8557
|
/**
|
|
@@ -8566,12 +8667,21 @@ interface ServiceSwapConfig {
|
|
|
8566
8667
|
recipientAddress?: string;
|
|
8567
8668
|
};
|
|
8568
8669
|
/**
|
|
8569
|
-
*
|
|
8570
|
-
*
|
|
8670
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
8671
|
+
*
|
|
8672
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
8673
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
8571
8674
|
*
|
|
8572
8675
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
8573
8676
|
* source, or expose it in telemetry.
|
|
8574
8677
|
*/
|
|
8678
|
+
apiKey?: string | undefined;
|
|
8679
|
+
/**
|
|
8680
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
8681
|
+
*
|
|
8682
|
+
* @deprecated Use {@link ServiceSwapConfig.apiKey} instead. Still honored
|
|
8683
|
+
* when `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
8684
|
+
*/
|
|
8575
8685
|
kitKey?: string;
|
|
8576
8686
|
/**
|
|
8577
8687
|
* DEX aggregator identifier used to source the swap route.
|
|
@@ -9049,12 +9159,21 @@ interface SwapConfig {
|
|
|
9049
9159
|
recipientAddress: string;
|
|
9050
9160
|
};
|
|
9051
9161
|
/**
|
|
9052
|
-
*
|
|
9053
|
-
*
|
|
9162
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
9163
|
+
*
|
|
9164
|
+
* Format: `<ENV>_API_KEY:<keyId>:<keySecret>`. A legacy
|
|
9165
|
+
* `KIT_KEY:<keyId>:<keySecret>` value is also accepted.
|
|
9054
9166
|
*
|
|
9055
9167
|
* Treat this value as a credential. Do not log it, embed it in client-side
|
|
9056
9168
|
* source, or expose it in telemetry.
|
|
9057
9169
|
*/
|
|
9170
|
+
apiKey?: string | undefined;
|
|
9171
|
+
/**
|
|
9172
|
+
* Circle API key used to authenticate service-backed swap requests.
|
|
9173
|
+
*
|
|
9174
|
+
* @deprecated Use {@link SwapConfig.apiKey} instead. Still honored when
|
|
9175
|
+
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
9176
|
+
*/
|
|
9058
9177
|
kitKey?: string;
|
|
9059
9178
|
}
|
|
9060
9179
|
/**
|
|
@@ -9455,13 +9574,18 @@ interface AppKitContext {
|
|
|
9455
9574
|
*/
|
|
9456
9575
|
disableErrorReporting?: boolean;
|
|
9457
9576
|
/**
|
|
9458
|
-
* Custom HTTP headers forwarded with
|
|
9459
|
-
* attestation (Iris)
|
|
9577
|
+
* Custom HTTP headers forwarded with Circle API requests made by the
|
|
9578
|
+
* underlying kits: the CCTP provider's attestation (Iris) requests for
|
|
9579
|
+
* bridge operations, and the Gateway API requests for unified-balance
|
|
9580
|
+
* operations.
|
|
9460
9581
|
*
|
|
9461
9582
|
* @remarks
|
|
9462
9583
|
* 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.
|
|
9584
|
+
* rather than replacing them. Each header is forwarded as-is to Circle's API;
|
|
9585
|
+
* the SDK does not interpret it. The same map is forwarded to every relevant
|
|
9586
|
+
* kit, so a header a given API ignores is simply a no-op there. A
|
|
9587
|
+
* `unifiedBalance.headers` value, if provided, takes precedence for the
|
|
9588
|
+
* unified-balance kit.
|
|
9465
9589
|
*/
|
|
9466
9590
|
headers?: Record<string, string>;
|
|
9467
9591
|
}
|