@circle-fin/app-kit 1.16.0 → 1.18.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 +79 -0
- package/borrow.cjs +150 -32
- package/borrow.d.cts +38 -9
- package/borrow.d.mts +38 -9
- package/borrow.d.ts +38 -9
- package/borrow.mjs +150 -32
- package/bridge.cjs +454 -53
- package/bridge.d.cts +38 -9
- package/bridge.d.mts +38 -9
- package/bridge.d.ts +38 -9
- package/bridge.mjs +454 -53
- package/chains.cjs +10 -6
- package/chains.d.cts +1 -1
- package/chains.d.mts +1 -1
- package/chains.d.ts +1 -1
- package/chains.mjs +10 -6
- package/context.d.cts +38 -9
- package/context.d.mts +38 -9
- package/context.d.ts +38 -9
- package/earn.cjs +830 -43
- package/earn.d.cts +38 -9
- package/earn.d.mts +38 -9
- package/earn.d.ts +38 -9
- package/earn.mjs +830 -43
- package/estimateBridge.cjs +454 -53
- package/estimateBridge.d.cts +38 -9
- package/estimateBridge.d.mts +38 -9
- package/estimateBridge.d.ts +38 -9
- package/estimateBridge.mjs +454 -53
- package/estimateSwap.cjs +265 -45
- package/estimateSwap.d.cts +86 -9
- package/estimateSwap.d.mts +86 -9
- package/estimateSwap.d.ts +86 -9
- package/estimateSwap.mjs +265 -45
- package/index.cjs +1019 -73
- package/index.d.cts +373 -210
- package/index.d.mts +373 -210
- package/index.d.ts +373 -210
- package/index.mjs +1019 -73
- package/package.json +8 -8
- package/server.cjs +35 -9
- package/server.d.cts +29 -10
- package/server.d.mts +29 -10
- package/server.d.ts +29 -10
- package/server.mjs +35 -9
- package/swap.cjs +265 -45
- package/swap.d.cts +86 -9
- package/swap.d.mts +86 -9
- package/swap.d.ts +86 -9
- package/swap.mjs +265 -45
- package/unifiedBalance.cjs +139 -20
- package/unifiedBalance.mjs +139 -20
package/estimateBridge.d.cts
CHANGED
|
@@ -899,10 +899,10 @@ declare enum Blockchain {
|
|
|
899
899
|
*
|
|
900
900
|
* Unlike the full {@link Blockchain} enum, SwapChain includes mainnet
|
|
901
901
|
* networks and explicitly whitelisted testnets (e.g., {@link Arc_Testnet})
|
|
902
|
-
* where
|
|
902
|
+
* where Adapter contracts are deployed.
|
|
903
903
|
*
|
|
904
904
|
* Dynamic validation via {@link isSwapSupportedChain} ensures chains
|
|
905
|
-
* automatically work when
|
|
905
|
+
* automatically work when Adapter contracts and supported tokens are deployed.
|
|
906
906
|
*
|
|
907
907
|
* @example
|
|
908
908
|
* ```typescript
|
|
@@ -942,20 +942,22 @@ declare enum SwapChain {
|
|
|
942
942
|
HyperEVM = "HyperEVM",
|
|
943
943
|
Monad = "Monad",
|
|
944
944
|
Arc = "Arc",
|
|
945
|
+
Cronos = "Cronos",
|
|
946
|
+
Morph = "Morph",
|
|
945
947
|
Arc_Testnet = "Arc_Testnet"
|
|
946
948
|
}
|
|
947
949
|
/**
|
|
948
950
|
* Chain definition that supports swap operations.
|
|
949
951
|
*
|
|
950
952
|
* @remarks
|
|
951
|
-
* Expanded from 4 to
|
|
952
|
-
* -
|
|
953
|
+
* Expanded from 4 to supported mainnets and whitelisted testnets based on:
|
|
954
|
+
* - A deployed Adapter contract, configured directly or through CCTP v2
|
|
953
955
|
* - Mainnet chains plus whitelisted testnets (e.g., Arc Testnet)
|
|
954
956
|
*
|
|
955
957
|
* Use `isSwapSupportedChain()` for runtime validation.
|
|
956
958
|
*/
|
|
957
959
|
type SwapChainDefinition = ChainDefinition & {
|
|
958
|
-
chain: Blockchain.Ethereum | Blockchain.Base | Blockchain.Polygon | Blockchain.Solana | Blockchain.Arbitrum | Blockchain.Optimism | Blockchain.Avalanche | Blockchain.Linea | Blockchain.Ink | Blockchain.World_Chain | Blockchain.Unichain | Blockchain.Plume | Blockchain.Sei | Blockchain.Sonic | Blockchain.XDC | Blockchain.HyperEVM | Blockchain.Monad | Blockchain.Arc | Blockchain.Arc_Testnet;
|
|
960
|
+
chain: Blockchain.Ethereum | Blockchain.Base | Blockchain.Polygon | Blockchain.Solana | Blockchain.Arbitrum | Blockchain.Optimism | Blockchain.Avalanche | Blockchain.Linea | Blockchain.Ink | Blockchain.World_Chain | Blockchain.Unichain | Blockchain.Plume | Blockchain.Sei | Blockchain.Sonic | Blockchain.XDC | Blockchain.HyperEVM | Blockchain.Monad | Blockchain.Arc | Blockchain.Cronos | Blockchain.Morph | Blockchain.Arc_Testnet;
|
|
959
961
|
};
|
|
960
962
|
/**
|
|
961
963
|
* Chain identifier accepted by swap operations.
|
|
@@ -6998,7 +7000,7 @@ interface ServiceSwapConfig {
|
|
|
6998
7000
|
*
|
|
6999
7001
|
* @defaultValue true
|
|
7000
7002
|
*/
|
|
7001
|
-
batchTransactions?: boolean;
|
|
7003
|
+
batchTransactions?: boolean | undefined;
|
|
7002
7004
|
}
|
|
7003
7005
|
/**
|
|
7004
7006
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -7462,6 +7464,33 @@ interface SwapConfig {
|
|
|
7462
7464
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7463
7465
|
*/
|
|
7464
7466
|
kitKey?: string;
|
|
7467
|
+
/**
|
|
7468
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
7469
|
+
*
|
|
7470
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
7471
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
7472
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
7473
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
7474
|
+
* approve-then-swap flow.
|
|
7475
|
+
*
|
|
7476
|
+
* @remarks
|
|
7477
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
7478
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
7479
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
7480
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
7481
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
7482
|
+
* rejects batched calls.
|
|
7483
|
+
*
|
|
7484
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
7485
|
+
*
|
|
7486
|
+
* @example
|
|
7487
|
+
* ```typescript
|
|
7488
|
+
* const config: SwapConfig = {
|
|
7489
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
7490
|
+
* }
|
|
7491
|
+
* ```
|
|
7492
|
+
*/
|
|
7493
|
+
batchTransactions?: boolean | undefined;
|
|
7465
7494
|
}
|
|
7466
7495
|
/**
|
|
7467
7496
|
* Resolved parameters for swap operations after validation and normalization.
|
|
@@ -8448,11 +8477,11 @@ interface AppKitContext {
|
|
|
8448
8477
|
*/
|
|
8449
8478
|
actions: Record<'bridge' | 'earn' | 'borrow', Record<string, ((payload: unknown) => void)[]>>;
|
|
8450
8479
|
/**
|
|
8451
|
-
* Disable success analytics for the underlying EarnKit, SwapKit,
|
|
8480
|
+
* Disable success analytics for the underlying BridgeKit, EarnKit, SwapKit,
|
|
8452
8481
|
* BorrowKit, and UnifiedBalanceKit.
|
|
8453
8482
|
*
|
|
8454
|
-
* When `true`, completed earn, swap, borrow, and unified balance
|
|
8455
|
-
* will not POST analytics events. This does not disable error reporting; use
|
|
8483
|
+
* When `true`, completed bridge, earn, swap, borrow, and unified balance
|
|
8484
|
+
* operations will not POST analytics events. This does not disable error reporting; use
|
|
8456
8485
|
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
8457
8486
|
*
|
|
8458
8487
|
* @defaultValue false
|
package/estimateBridge.d.mts
CHANGED
|
@@ -899,10 +899,10 @@ declare enum Blockchain {
|
|
|
899
899
|
*
|
|
900
900
|
* Unlike the full {@link Blockchain} enum, SwapChain includes mainnet
|
|
901
901
|
* networks and explicitly whitelisted testnets (e.g., {@link Arc_Testnet})
|
|
902
|
-
* where
|
|
902
|
+
* where Adapter contracts are deployed.
|
|
903
903
|
*
|
|
904
904
|
* Dynamic validation via {@link isSwapSupportedChain} ensures chains
|
|
905
|
-
* automatically work when
|
|
905
|
+
* automatically work when Adapter contracts and supported tokens are deployed.
|
|
906
906
|
*
|
|
907
907
|
* @example
|
|
908
908
|
* ```typescript
|
|
@@ -942,20 +942,22 @@ declare enum SwapChain {
|
|
|
942
942
|
HyperEVM = "HyperEVM",
|
|
943
943
|
Monad = "Monad",
|
|
944
944
|
Arc = "Arc",
|
|
945
|
+
Cronos = "Cronos",
|
|
946
|
+
Morph = "Morph",
|
|
945
947
|
Arc_Testnet = "Arc_Testnet"
|
|
946
948
|
}
|
|
947
949
|
/**
|
|
948
950
|
* Chain definition that supports swap operations.
|
|
949
951
|
*
|
|
950
952
|
* @remarks
|
|
951
|
-
* Expanded from 4 to
|
|
952
|
-
* -
|
|
953
|
+
* Expanded from 4 to supported mainnets and whitelisted testnets based on:
|
|
954
|
+
* - A deployed Adapter contract, configured directly or through CCTP v2
|
|
953
955
|
* - Mainnet chains plus whitelisted testnets (e.g., Arc Testnet)
|
|
954
956
|
*
|
|
955
957
|
* Use `isSwapSupportedChain()` for runtime validation.
|
|
956
958
|
*/
|
|
957
959
|
type SwapChainDefinition = ChainDefinition & {
|
|
958
|
-
chain: Blockchain.Ethereum | Blockchain.Base | Blockchain.Polygon | Blockchain.Solana | Blockchain.Arbitrum | Blockchain.Optimism | Blockchain.Avalanche | Blockchain.Linea | Blockchain.Ink | Blockchain.World_Chain | Blockchain.Unichain | Blockchain.Plume | Blockchain.Sei | Blockchain.Sonic | Blockchain.XDC | Blockchain.HyperEVM | Blockchain.Monad | Blockchain.Arc | Blockchain.Arc_Testnet;
|
|
960
|
+
chain: Blockchain.Ethereum | Blockchain.Base | Blockchain.Polygon | Blockchain.Solana | Blockchain.Arbitrum | Blockchain.Optimism | Blockchain.Avalanche | Blockchain.Linea | Blockchain.Ink | Blockchain.World_Chain | Blockchain.Unichain | Blockchain.Plume | Blockchain.Sei | Blockchain.Sonic | Blockchain.XDC | Blockchain.HyperEVM | Blockchain.Monad | Blockchain.Arc | Blockchain.Cronos | Blockchain.Morph | Blockchain.Arc_Testnet;
|
|
959
961
|
};
|
|
960
962
|
/**
|
|
961
963
|
* Chain identifier accepted by swap operations.
|
|
@@ -6998,7 +7000,7 @@ interface ServiceSwapConfig {
|
|
|
6998
7000
|
*
|
|
6999
7001
|
* @defaultValue true
|
|
7000
7002
|
*/
|
|
7001
|
-
batchTransactions?: boolean;
|
|
7003
|
+
batchTransactions?: boolean | undefined;
|
|
7002
7004
|
}
|
|
7003
7005
|
/**
|
|
7004
7006
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -7462,6 +7464,33 @@ interface SwapConfig {
|
|
|
7462
7464
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7463
7465
|
*/
|
|
7464
7466
|
kitKey?: string;
|
|
7467
|
+
/**
|
|
7468
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
7469
|
+
*
|
|
7470
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
7471
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
7472
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
7473
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
7474
|
+
* approve-then-swap flow.
|
|
7475
|
+
*
|
|
7476
|
+
* @remarks
|
|
7477
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
7478
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
7479
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
7480
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
7481
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
7482
|
+
* rejects batched calls.
|
|
7483
|
+
*
|
|
7484
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
7485
|
+
*
|
|
7486
|
+
* @example
|
|
7487
|
+
* ```typescript
|
|
7488
|
+
* const config: SwapConfig = {
|
|
7489
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
7490
|
+
* }
|
|
7491
|
+
* ```
|
|
7492
|
+
*/
|
|
7493
|
+
batchTransactions?: boolean | undefined;
|
|
7465
7494
|
}
|
|
7466
7495
|
/**
|
|
7467
7496
|
* Resolved parameters for swap operations after validation and normalization.
|
|
@@ -8448,11 +8477,11 @@ interface AppKitContext {
|
|
|
8448
8477
|
*/
|
|
8449
8478
|
actions: Record<'bridge' | 'earn' | 'borrow', Record<string, ((payload: unknown) => void)[]>>;
|
|
8450
8479
|
/**
|
|
8451
|
-
* Disable success analytics for the underlying EarnKit, SwapKit,
|
|
8480
|
+
* Disable success analytics for the underlying BridgeKit, EarnKit, SwapKit,
|
|
8452
8481
|
* BorrowKit, and UnifiedBalanceKit.
|
|
8453
8482
|
*
|
|
8454
|
-
* When `true`, completed earn, swap, borrow, and unified balance
|
|
8455
|
-
* will not POST analytics events. This does not disable error reporting; use
|
|
8483
|
+
* When `true`, completed bridge, earn, swap, borrow, and unified balance
|
|
8484
|
+
* operations will not POST analytics events. This does not disable error reporting; use
|
|
8456
8485
|
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
8457
8486
|
*
|
|
8458
8487
|
* @defaultValue false
|
package/estimateBridge.d.ts
CHANGED
|
@@ -899,10 +899,10 @@ declare enum Blockchain {
|
|
|
899
899
|
*
|
|
900
900
|
* Unlike the full {@link Blockchain} enum, SwapChain includes mainnet
|
|
901
901
|
* networks and explicitly whitelisted testnets (e.g., {@link Arc_Testnet})
|
|
902
|
-
* where
|
|
902
|
+
* where Adapter contracts are deployed.
|
|
903
903
|
*
|
|
904
904
|
* Dynamic validation via {@link isSwapSupportedChain} ensures chains
|
|
905
|
-
* automatically work when
|
|
905
|
+
* automatically work when Adapter contracts and supported tokens are deployed.
|
|
906
906
|
*
|
|
907
907
|
* @example
|
|
908
908
|
* ```typescript
|
|
@@ -942,20 +942,22 @@ declare enum SwapChain {
|
|
|
942
942
|
HyperEVM = "HyperEVM",
|
|
943
943
|
Monad = "Monad",
|
|
944
944
|
Arc = "Arc",
|
|
945
|
+
Cronos = "Cronos",
|
|
946
|
+
Morph = "Morph",
|
|
945
947
|
Arc_Testnet = "Arc_Testnet"
|
|
946
948
|
}
|
|
947
949
|
/**
|
|
948
950
|
* Chain definition that supports swap operations.
|
|
949
951
|
*
|
|
950
952
|
* @remarks
|
|
951
|
-
* Expanded from 4 to
|
|
952
|
-
* -
|
|
953
|
+
* Expanded from 4 to supported mainnets and whitelisted testnets based on:
|
|
954
|
+
* - A deployed Adapter contract, configured directly or through CCTP v2
|
|
953
955
|
* - Mainnet chains plus whitelisted testnets (e.g., Arc Testnet)
|
|
954
956
|
*
|
|
955
957
|
* Use `isSwapSupportedChain()` for runtime validation.
|
|
956
958
|
*/
|
|
957
959
|
type SwapChainDefinition = ChainDefinition & {
|
|
958
|
-
chain: Blockchain.Ethereum | Blockchain.Base | Blockchain.Polygon | Blockchain.Solana | Blockchain.Arbitrum | Blockchain.Optimism | Blockchain.Avalanche | Blockchain.Linea | Blockchain.Ink | Blockchain.World_Chain | Blockchain.Unichain | Blockchain.Plume | Blockchain.Sei | Blockchain.Sonic | Blockchain.XDC | Blockchain.HyperEVM | Blockchain.Monad | Blockchain.Arc | Blockchain.Arc_Testnet;
|
|
960
|
+
chain: Blockchain.Ethereum | Blockchain.Base | Blockchain.Polygon | Blockchain.Solana | Blockchain.Arbitrum | Blockchain.Optimism | Blockchain.Avalanche | Blockchain.Linea | Blockchain.Ink | Blockchain.World_Chain | Blockchain.Unichain | Blockchain.Plume | Blockchain.Sei | Blockchain.Sonic | Blockchain.XDC | Blockchain.HyperEVM | Blockchain.Monad | Blockchain.Arc | Blockchain.Cronos | Blockchain.Morph | Blockchain.Arc_Testnet;
|
|
959
961
|
};
|
|
960
962
|
/**
|
|
961
963
|
* Chain identifier accepted by swap operations.
|
|
@@ -6998,7 +7000,7 @@ interface ServiceSwapConfig {
|
|
|
6998
7000
|
*
|
|
6999
7001
|
* @defaultValue true
|
|
7000
7002
|
*/
|
|
7001
|
-
batchTransactions?: boolean;
|
|
7003
|
+
batchTransactions?: boolean | undefined;
|
|
7002
7004
|
}
|
|
7003
7005
|
/**
|
|
7004
7006
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -7462,6 +7464,33 @@ interface SwapConfig {
|
|
|
7462
7464
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7463
7465
|
*/
|
|
7464
7466
|
kitKey?: string;
|
|
7467
|
+
/**
|
|
7468
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
7469
|
+
*
|
|
7470
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
7471
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
7472
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
7473
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
7474
|
+
* approve-then-swap flow.
|
|
7475
|
+
*
|
|
7476
|
+
* @remarks
|
|
7477
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
7478
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
7479
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
7480
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
7481
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
7482
|
+
* rejects batched calls.
|
|
7483
|
+
*
|
|
7484
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
7485
|
+
*
|
|
7486
|
+
* @example
|
|
7487
|
+
* ```typescript
|
|
7488
|
+
* const config: SwapConfig = {
|
|
7489
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
7490
|
+
* }
|
|
7491
|
+
* ```
|
|
7492
|
+
*/
|
|
7493
|
+
batchTransactions?: boolean | undefined;
|
|
7465
7494
|
}
|
|
7466
7495
|
/**
|
|
7467
7496
|
* Resolved parameters for swap operations after validation and normalization.
|
|
@@ -8448,11 +8477,11 @@ interface AppKitContext {
|
|
|
8448
8477
|
*/
|
|
8449
8478
|
actions: Record<'bridge' | 'earn' | 'borrow', Record<string, ((payload: unknown) => void)[]>>;
|
|
8450
8479
|
/**
|
|
8451
|
-
* Disable success analytics for the underlying EarnKit, SwapKit,
|
|
8480
|
+
* Disable success analytics for the underlying BridgeKit, EarnKit, SwapKit,
|
|
8452
8481
|
* BorrowKit, and UnifiedBalanceKit.
|
|
8453
8482
|
*
|
|
8454
|
-
* When `true`, completed earn, swap, borrow, and unified balance
|
|
8455
|
-
* will not POST analytics events. This does not disable error reporting; use
|
|
8483
|
+
* When `true`, completed bridge, earn, swap, borrow, and unified balance
|
|
8484
|
+
* operations will not POST analytics events. This does not disable error reporting; use
|
|
8456
8485
|
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
8457
8486
|
*
|
|
8458
8487
|
* @defaultValue false
|