@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/chains.cjs
CHANGED
|
@@ -154,6 +154,8 @@ var SwapChain;
|
|
|
154
154
|
SwapChain["HyperEVM"] = "HyperEVM";
|
|
155
155
|
SwapChain["Monad"] = "Monad";
|
|
156
156
|
SwapChain["Arc"] = "Arc";
|
|
157
|
+
SwapChain["Cronos"] = "Cronos";
|
|
158
|
+
SwapChain["Morph"] = "Morph";
|
|
157
159
|
// Testnet chains with swap support
|
|
158
160
|
SwapChain["Arc_Testnet"] = "Arc_Testnet";
|
|
159
161
|
})(SwapChain || (SwapChain = {}));
|
|
@@ -834,14 +836,14 @@ var BorrowChain;
|
|
|
834
836
|
symbol: 'USDC',
|
|
835
837
|
// Arc uses native USDC with 18 decimals for gas payments (EVM standard).
|
|
836
838
|
// Note: The ERC-20 USDC contract at usdcAddress uses 6 decimals.
|
|
837
|
-
// See: https://docs.arc.
|
|
839
|
+
// See: https://docs.arc.io/arc/references/contract-addresses
|
|
838
840
|
decimals: 18
|
|
839
841
|
},
|
|
840
842
|
chainId: 5042002,
|
|
841
843
|
isTestnet: true,
|
|
842
844
|
explorerUrl: 'https://testnet.arcscan.app/tx/{hash}',
|
|
843
845
|
rpcEndpoints: [
|
|
844
|
-
'https://rpc.testnet.arc.
|
|
846
|
+
'https://rpc.testnet.arc.io'
|
|
845
847
|
],
|
|
846
848
|
eurcAddress: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',
|
|
847
849
|
usdcAddress: '0x3600000000000000000000000000000000000000',
|
|
@@ -1486,7 +1488,8 @@ var BorrowChain;
|
|
|
1486
1488
|
}
|
|
1487
1489
|
},
|
|
1488
1490
|
kitContracts: {
|
|
1489
|
-
bridge: BRIDGE_CONTRACT_EVM_MAINNET
|
|
1491
|
+
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
1492
|
+
adapter: ADAPTER_CONTRACT_EVM_MAINNET
|
|
1490
1493
|
}
|
|
1491
1494
|
});
|
|
1492
1495
|
|
|
@@ -2355,7 +2358,8 @@ var BorrowChain;
|
|
|
2355
2358
|
}
|
|
2356
2359
|
},
|
|
2357
2360
|
kitContracts: {
|
|
2358
|
-
bridge: BRIDGE_CONTRACT_EVM_MAINNET
|
|
2361
|
+
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
2362
|
+
adapter: ADAPTER_CONTRACT_EVM_MAINNET
|
|
2359
2363
|
}
|
|
2360
2364
|
});
|
|
2361
2365
|
|
|
@@ -4401,8 +4405,8 @@ var BorrowChain;
|
|
|
4401
4405
|
* Zod schema for validating swap-specific chain identifiers.
|
|
4402
4406
|
*
|
|
4403
4407
|
* Validates chains based on:
|
|
4404
|
-
* -
|
|
4405
|
-
* - Mainnet
|
|
4408
|
+
* - Membership in the SwapChain enum
|
|
4409
|
+
* - Mainnet or explicitly allowlisted testnet
|
|
4406
4410
|
* - At least one supported token available
|
|
4407
4411
|
*
|
|
4408
4412
|
*/ zod.z.union([
|
package/chains.d.cts
CHANGED
|
@@ -192,7 +192,7 @@ declare const ArcTestnet: {
|
|
|
192
192
|
readonly chainId: 5042002;
|
|
193
193
|
readonly isTestnet: true;
|
|
194
194
|
readonly explorerUrl: "https://testnet.arcscan.app/tx/{hash}";
|
|
195
|
-
readonly rpcEndpoints: readonly ["https://rpc.testnet.arc.
|
|
195
|
+
readonly rpcEndpoints: readonly ["https://rpc.testnet.arc.io"];
|
|
196
196
|
readonly eurcAddress: "0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a";
|
|
197
197
|
readonly usdcAddress: "0x3600000000000000000000000000000000000000";
|
|
198
198
|
readonly usdtAddress: null;
|
package/chains.d.mts
CHANGED
|
@@ -192,7 +192,7 @@ declare const ArcTestnet: {
|
|
|
192
192
|
readonly chainId: 5042002;
|
|
193
193
|
readonly isTestnet: true;
|
|
194
194
|
readonly explorerUrl: "https://testnet.arcscan.app/tx/{hash}";
|
|
195
|
-
readonly rpcEndpoints: readonly ["https://rpc.testnet.arc.
|
|
195
|
+
readonly rpcEndpoints: readonly ["https://rpc.testnet.arc.io"];
|
|
196
196
|
readonly eurcAddress: "0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a";
|
|
197
197
|
readonly usdcAddress: "0x3600000000000000000000000000000000000000";
|
|
198
198
|
readonly usdtAddress: null;
|
package/chains.d.ts
CHANGED
|
@@ -192,7 +192,7 @@ declare const ArcTestnet: {
|
|
|
192
192
|
readonly chainId: 5042002;
|
|
193
193
|
readonly isTestnet: true;
|
|
194
194
|
readonly explorerUrl: "https://testnet.arcscan.app/tx/{hash}";
|
|
195
|
-
readonly rpcEndpoints: readonly ["https://rpc.testnet.arc.
|
|
195
|
+
readonly rpcEndpoints: readonly ["https://rpc.testnet.arc.io"];
|
|
196
196
|
readonly eurcAddress: "0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a";
|
|
197
197
|
readonly usdcAddress: "0x3600000000000000000000000000000000000000";
|
|
198
198
|
readonly usdtAddress: null;
|
package/chains.mjs
CHANGED
|
@@ -152,6 +152,8 @@ var SwapChain;
|
|
|
152
152
|
SwapChain["HyperEVM"] = "HyperEVM";
|
|
153
153
|
SwapChain["Monad"] = "Monad";
|
|
154
154
|
SwapChain["Arc"] = "Arc";
|
|
155
|
+
SwapChain["Cronos"] = "Cronos";
|
|
156
|
+
SwapChain["Morph"] = "Morph";
|
|
155
157
|
// Testnet chains with swap support
|
|
156
158
|
SwapChain["Arc_Testnet"] = "Arc_Testnet";
|
|
157
159
|
})(SwapChain || (SwapChain = {}));
|
|
@@ -832,14 +834,14 @@ var BorrowChain;
|
|
|
832
834
|
symbol: 'USDC',
|
|
833
835
|
// Arc uses native USDC with 18 decimals for gas payments (EVM standard).
|
|
834
836
|
// Note: The ERC-20 USDC contract at usdcAddress uses 6 decimals.
|
|
835
|
-
// See: https://docs.arc.
|
|
837
|
+
// See: https://docs.arc.io/arc/references/contract-addresses
|
|
836
838
|
decimals: 18
|
|
837
839
|
},
|
|
838
840
|
chainId: 5042002,
|
|
839
841
|
isTestnet: true,
|
|
840
842
|
explorerUrl: 'https://testnet.arcscan.app/tx/{hash}',
|
|
841
843
|
rpcEndpoints: [
|
|
842
|
-
'https://rpc.testnet.arc.
|
|
844
|
+
'https://rpc.testnet.arc.io'
|
|
843
845
|
],
|
|
844
846
|
eurcAddress: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',
|
|
845
847
|
usdcAddress: '0x3600000000000000000000000000000000000000',
|
|
@@ -1484,7 +1486,8 @@ var BorrowChain;
|
|
|
1484
1486
|
}
|
|
1485
1487
|
},
|
|
1486
1488
|
kitContracts: {
|
|
1487
|
-
bridge: BRIDGE_CONTRACT_EVM_MAINNET
|
|
1489
|
+
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
1490
|
+
adapter: ADAPTER_CONTRACT_EVM_MAINNET
|
|
1488
1491
|
}
|
|
1489
1492
|
});
|
|
1490
1493
|
|
|
@@ -2353,7 +2356,8 @@ var BorrowChain;
|
|
|
2353
2356
|
}
|
|
2354
2357
|
},
|
|
2355
2358
|
kitContracts: {
|
|
2356
|
-
bridge: BRIDGE_CONTRACT_EVM_MAINNET
|
|
2359
|
+
bridge: BRIDGE_CONTRACT_EVM_MAINNET,
|
|
2360
|
+
adapter: ADAPTER_CONTRACT_EVM_MAINNET
|
|
2357
2361
|
}
|
|
2358
2362
|
});
|
|
2359
2363
|
|
|
@@ -4399,8 +4403,8 @@ var BorrowChain;
|
|
|
4399
4403
|
* Zod schema for validating swap-specific chain identifiers.
|
|
4400
4404
|
*
|
|
4401
4405
|
* Validates chains based on:
|
|
4402
|
-
* -
|
|
4403
|
-
* - Mainnet
|
|
4406
|
+
* - Membership in the SwapChain enum
|
|
4407
|
+
* - Mainnet or explicitly allowlisted testnet
|
|
4404
4408
|
* - At least one supported token available
|
|
4405
4409
|
*
|
|
4406
4410
|
*/ z.union([
|
package/context.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.
|
|
@@ -6733,7 +6735,7 @@ interface ServiceSwapConfig {
|
|
|
6733
6735
|
*
|
|
6734
6736
|
* @defaultValue true
|
|
6735
6737
|
*/
|
|
6736
|
-
batchTransactions?: boolean;
|
|
6738
|
+
batchTransactions?: boolean | undefined;
|
|
6737
6739
|
}
|
|
6738
6740
|
/**
|
|
6739
6741
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -7197,6 +7199,33 @@ interface SwapConfig {
|
|
|
7197
7199
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7198
7200
|
*/
|
|
7199
7201
|
kitKey?: string;
|
|
7202
|
+
/**
|
|
7203
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
7204
|
+
*
|
|
7205
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
7206
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
7207
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
7208
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
7209
|
+
* approve-then-swap flow.
|
|
7210
|
+
*
|
|
7211
|
+
* @remarks
|
|
7212
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
7213
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
7214
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
7215
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
7216
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
7217
|
+
* rejects batched calls.
|
|
7218
|
+
*
|
|
7219
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
7220
|
+
*
|
|
7221
|
+
* @example
|
|
7222
|
+
* ```typescript
|
|
7223
|
+
* const config: SwapConfig = {
|
|
7224
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
7225
|
+
* }
|
|
7226
|
+
* ```
|
|
7227
|
+
*/
|
|
7228
|
+
batchTransactions?: boolean | undefined;
|
|
7200
7229
|
}
|
|
7201
7230
|
/**
|
|
7202
7231
|
* Resolved parameters for swap operations after validation and normalization.
|
|
@@ -8183,11 +8212,11 @@ interface AppKitContext {
|
|
|
8183
8212
|
*/
|
|
8184
8213
|
actions: Record<'bridge' | 'earn' | 'borrow', Record<string, ((payload: unknown) => void)[]>>;
|
|
8185
8214
|
/**
|
|
8186
|
-
* Disable success analytics for the underlying EarnKit, SwapKit,
|
|
8215
|
+
* Disable success analytics for the underlying BridgeKit, EarnKit, SwapKit,
|
|
8187
8216
|
* BorrowKit, and UnifiedBalanceKit.
|
|
8188
8217
|
*
|
|
8189
|
-
* When `true`, completed earn, swap, borrow, and unified balance
|
|
8190
|
-
* will not POST analytics events. This does not disable error reporting; use
|
|
8218
|
+
* When `true`, completed bridge, earn, swap, borrow, and unified balance
|
|
8219
|
+
* operations will not POST analytics events. This does not disable error reporting; use
|
|
8191
8220
|
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
8192
8221
|
*
|
|
8193
8222
|
* @defaultValue false
|
package/context.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.
|
|
@@ -6733,7 +6735,7 @@ interface ServiceSwapConfig {
|
|
|
6733
6735
|
*
|
|
6734
6736
|
* @defaultValue true
|
|
6735
6737
|
*/
|
|
6736
|
-
batchTransactions?: boolean;
|
|
6738
|
+
batchTransactions?: boolean | undefined;
|
|
6737
6739
|
}
|
|
6738
6740
|
/**
|
|
6739
6741
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -7197,6 +7199,33 @@ interface SwapConfig {
|
|
|
7197
7199
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7198
7200
|
*/
|
|
7199
7201
|
kitKey?: string;
|
|
7202
|
+
/**
|
|
7203
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
7204
|
+
*
|
|
7205
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
7206
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
7207
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
7208
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
7209
|
+
* approve-then-swap flow.
|
|
7210
|
+
*
|
|
7211
|
+
* @remarks
|
|
7212
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
7213
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
7214
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
7215
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
7216
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
7217
|
+
* rejects batched calls.
|
|
7218
|
+
*
|
|
7219
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
7220
|
+
*
|
|
7221
|
+
* @example
|
|
7222
|
+
* ```typescript
|
|
7223
|
+
* const config: SwapConfig = {
|
|
7224
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
7225
|
+
* }
|
|
7226
|
+
* ```
|
|
7227
|
+
*/
|
|
7228
|
+
batchTransactions?: boolean | undefined;
|
|
7200
7229
|
}
|
|
7201
7230
|
/**
|
|
7202
7231
|
* Resolved parameters for swap operations after validation and normalization.
|
|
@@ -8183,11 +8212,11 @@ interface AppKitContext {
|
|
|
8183
8212
|
*/
|
|
8184
8213
|
actions: Record<'bridge' | 'earn' | 'borrow', Record<string, ((payload: unknown) => void)[]>>;
|
|
8185
8214
|
/**
|
|
8186
|
-
* Disable success analytics for the underlying EarnKit, SwapKit,
|
|
8215
|
+
* Disable success analytics for the underlying BridgeKit, EarnKit, SwapKit,
|
|
8187
8216
|
* BorrowKit, and UnifiedBalanceKit.
|
|
8188
8217
|
*
|
|
8189
|
-
* When `true`, completed earn, swap, borrow, and unified balance
|
|
8190
|
-
* will not POST analytics events. This does not disable error reporting; use
|
|
8218
|
+
* When `true`, completed bridge, earn, swap, borrow, and unified balance
|
|
8219
|
+
* operations will not POST analytics events. This does not disable error reporting; use
|
|
8191
8220
|
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
8192
8221
|
*
|
|
8193
8222
|
* @defaultValue false
|
package/context.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.
|
|
@@ -6733,7 +6735,7 @@ interface ServiceSwapConfig {
|
|
|
6733
6735
|
*
|
|
6734
6736
|
* @defaultValue true
|
|
6735
6737
|
*/
|
|
6736
|
-
batchTransactions?: boolean;
|
|
6738
|
+
batchTransactions?: boolean | undefined;
|
|
6737
6739
|
}
|
|
6738
6740
|
/**
|
|
6739
6741
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -7197,6 +7199,33 @@ interface SwapConfig {
|
|
|
7197
7199
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
7198
7200
|
*/
|
|
7199
7201
|
kitKey?: string;
|
|
7202
|
+
/**
|
|
7203
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
7204
|
+
*
|
|
7205
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
7206
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
7207
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
7208
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
7209
|
+
* approve-then-swap flow.
|
|
7210
|
+
*
|
|
7211
|
+
* @remarks
|
|
7212
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
7213
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
7214
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
7215
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
7216
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
7217
|
+
* rejects batched calls.
|
|
7218
|
+
*
|
|
7219
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
7220
|
+
*
|
|
7221
|
+
* @example
|
|
7222
|
+
* ```typescript
|
|
7223
|
+
* const config: SwapConfig = {
|
|
7224
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
7225
|
+
* }
|
|
7226
|
+
* ```
|
|
7227
|
+
*/
|
|
7228
|
+
batchTransactions?: boolean | undefined;
|
|
7200
7229
|
}
|
|
7201
7230
|
/**
|
|
7202
7231
|
* Resolved parameters for swap operations after validation and normalization.
|
|
@@ -8183,11 +8212,11 @@ interface AppKitContext {
|
|
|
8183
8212
|
*/
|
|
8184
8213
|
actions: Record<'bridge' | 'earn' | 'borrow', Record<string, ((payload: unknown) => void)[]>>;
|
|
8185
8214
|
/**
|
|
8186
|
-
* Disable success analytics for the underlying EarnKit, SwapKit,
|
|
8215
|
+
* Disable success analytics for the underlying BridgeKit, EarnKit, SwapKit,
|
|
8187
8216
|
* BorrowKit, and UnifiedBalanceKit.
|
|
8188
8217
|
*
|
|
8189
|
-
* When `true`, completed earn, swap, borrow, and unified balance
|
|
8190
|
-
* will not POST analytics events. This does not disable error reporting; use
|
|
8218
|
+
* When `true`, completed bridge, earn, swap, borrow, and unified balance
|
|
8219
|
+
* operations will not POST analytics events. This does not disable error reporting; use
|
|
8191
8220
|
* {@link AppKitContext.disableErrorReporting} for that. Defaults to `false`.
|
|
8192
8221
|
*
|
|
8193
8222
|
* @defaultValue false
|