@circle-fin/app-kit 1.16.0 → 1.17.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 +38 -0
- package/borrow.cjs +148 -30
- package/borrow.d.cts +35 -6
- package/borrow.d.mts +35 -6
- package/borrow.d.ts +35 -6
- package/borrow.mjs +148 -30
- package/bridge.cjs +187 -40
- package/bridge.d.cts +35 -6
- package/bridge.d.mts +35 -6
- package/bridge.d.ts +35 -6
- package/bridge.mjs +187 -40
- package/chains.cjs +8 -4
- package/chains.mjs +8 -4
- package/context.d.cts +35 -6
- package/context.d.mts +35 -6
- package/context.d.ts +35 -6
- package/earn.cjs +470 -34
- package/earn.d.cts +35 -6
- package/earn.d.mts +35 -6
- package/earn.d.ts +35 -6
- package/earn.mjs +470 -34
- package/estimateBridge.cjs +187 -40
- package/estimateBridge.d.cts +35 -6
- package/estimateBridge.d.mts +35 -6
- package/estimateBridge.d.ts +35 -6
- package/estimateBridge.mjs +187 -40
- package/estimateSwap.cjs +263 -43
- package/estimateSwap.d.cts +83 -6
- package/estimateSwap.d.mts +83 -6
- package/estimateSwap.d.ts +83 -6
- package/estimateSwap.mjs +263 -43
- package/index.cjs +468 -53
- package/index.d.cts +331 -202
- package/index.d.mts +331 -202
- package/index.d.ts +331 -202
- package/index.mjs +468 -53
- package/package.json +8 -8
- package/server.cjs +33 -7
- package/server.d.cts +29 -10
- package/server.d.mts +29 -10
- package/server.d.ts +29 -10
- package/server.mjs +33 -7
- package/swap.cjs +263 -43
- package/swap.d.cts +83 -6
- package/swap.d.mts +83 -6
- package/swap.d.ts +83 -6
- package/swap.mjs +263 -43
- package/unifiedBalance.cjs +73 -12
- package/unifiedBalance.mjs +73 -12
package/estimateSwap.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.
|
|
@@ -6207,6 +6209,44 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
|
|
|
6207
6209
|
useForwarder?: boolean;
|
|
6208
6210
|
}) | ForwarderDestination<TChainIdentifier>;
|
|
6209
6211
|
|
|
6212
|
+
/** Token metadata for one side of a swap route step. */
|
|
6213
|
+
interface SwapRouteToken {
|
|
6214
|
+
readonly symbol: string;
|
|
6215
|
+
readonly address: string;
|
|
6216
|
+
readonly decimals: number;
|
|
6217
|
+
}
|
|
6218
|
+
/** Amount estimates for a swap route step, expressed in base units. */
|
|
6219
|
+
interface SwapRouteStepEstimate {
|
|
6220
|
+
readonly fromAmount: string;
|
|
6221
|
+
readonly toAmount: string;
|
|
6222
|
+
readonly gasCostUSD?: string;
|
|
6223
|
+
}
|
|
6224
|
+
/** A single swap or bridge hop selected by the route provider. */
|
|
6225
|
+
interface SwapRouteStep {
|
|
6226
|
+
/** Hop kind, for example `swap` or `bridge`. */
|
|
6227
|
+
readonly type: string;
|
|
6228
|
+
/** Protocol identifier, for example `cctp-v2`. */
|
|
6229
|
+
readonly tool: string;
|
|
6230
|
+
/** Display name for {@link SwapRouteStep.tool}. */
|
|
6231
|
+
readonly toolName: string;
|
|
6232
|
+
readonly fromToken: SwapRouteToken;
|
|
6233
|
+
readonly toToken: SwapRouteToken;
|
|
6234
|
+
readonly estimate: SwapRouteStepEstimate;
|
|
6235
|
+
/** Provider-specific details that are not part of the stable step shape. */
|
|
6236
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
6237
|
+
}
|
|
6238
|
+
/** Provider and executable hops selected for a swap. */
|
|
6239
|
+
interface SwapRoute {
|
|
6240
|
+
/**
|
|
6241
|
+
* Provider that routed the swap, for example `lifi` or `circle`. Treat as
|
|
6242
|
+
* an opaque identifier; new providers can appear without an SDK release.
|
|
6243
|
+
*/
|
|
6244
|
+
readonly provider: string;
|
|
6245
|
+
readonly steps: readonly SwapRouteStep[];
|
|
6246
|
+
/** Provider-specific details that are not part of the stable route shape. */
|
|
6247
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
6248
|
+
}
|
|
6249
|
+
|
|
6210
6250
|
/**
|
|
6211
6251
|
* Represents a token amount with its symbol and value.
|
|
6212
6252
|
*
|
|
@@ -6405,7 +6445,7 @@ interface ServiceSwapConfig {
|
|
|
6405
6445
|
*
|
|
6406
6446
|
* @defaultValue true
|
|
6407
6447
|
*/
|
|
6408
|
-
batchTransactions?: boolean;
|
|
6448
|
+
batchTransactions?: boolean | undefined;
|
|
6409
6449
|
}
|
|
6410
6450
|
/**
|
|
6411
6451
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -6558,6 +6598,14 @@ interface ServiceSwapFee {
|
|
|
6558
6598
|
* addresses are not available from the proxy response.
|
|
6559
6599
|
*/
|
|
6560
6600
|
readonly recipientAddress?: string;
|
|
6601
|
+
/** Provider-defined fee component (for example `FORWARD`). */
|
|
6602
|
+
readonly component?: string;
|
|
6603
|
+
/**
|
|
6604
|
+
* Chain on which the fee is charged, as reported by the service
|
|
6605
|
+
* (a `Blockchain` value such as `'Ethereum'`). Not validated
|
|
6606
|
+
* against the `Blockchain` enum.
|
|
6607
|
+
*/
|
|
6608
|
+
readonly chain?: string;
|
|
6561
6609
|
}
|
|
6562
6610
|
|
|
6563
6611
|
/**
|
|
@@ -6922,6 +6970,33 @@ interface SwapConfig {
|
|
|
6922
6970
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6923
6971
|
*/
|
|
6924
6972
|
kitKey?: string;
|
|
6973
|
+
/**
|
|
6974
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
6975
|
+
*
|
|
6976
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
6977
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
6978
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
6979
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
6980
|
+
* approve-then-swap flow.
|
|
6981
|
+
*
|
|
6982
|
+
* @remarks
|
|
6983
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
6984
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
6985
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
6986
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
6987
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
6988
|
+
* rejects batched calls.
|
|
6989
|
+
*
|
|
6990
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
6991
|
+
*
|
|
6992
|
+
* @example
|
|
6993
|
+
* ```typescript
|
|
6994
|
+
* const config: SwapConfig = {
|
|
6995
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
6996
|
+
* }
|
|
6997
|
+
* ```
|
|
6998
|
+
*/
|
|
6999
|
+
batchTransactions?: boolean | undefined;
|
|
6925
7000
|
}
|
|
6926
7001
|
/**
|
|
6927
7002
|
* Estimation result for a swap operation.
|
|
@@ -7034,6 +7109,8 @@ interface SwapEstimate {
|
|
|
7034
7109
|
* and kit fees (if configured). Amounts are in decimal format for display.
|
|
7035
7110
|
*/
|
|
7036
7111
|
readonly fees?: readonly ServiceSwapFee[];
|
|
7112
|
+
/** Provider and executable hops selected for the swap. */
|
|
7113
|
+
readonly route?: SwapRoute;
|
|
7037
7114
|
}
|
|
7038
7115
|
/**
|
|
7039
7116
|
* Resolved parameters for swap operations after validation and normalization.
|
package/estimateSwap.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.
|
|
@@ -6207,6 +6209,44 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
|
|
|
6207
6209
|
useForwarder?: boolean;
|
|
6208
6210
|
}) | ForwarderDestination<TChainIdentifier>;
|
|
6209
6211
|
|
|
6212
|
+
/** Token metadata for one side of a swap route step. */
|
|
6213
|
+
interface SwapRouteToken {
|
|
6214
|
+
readonly symbol: string;
|
|
6215
|
+
readonly address: string;
|
|
6216
|
+
readonly decimals: number;
|
|
6217
|
+
}
|
|
6218
|
+
/** Amount estimates for a swap route step, expressed in base units. */
|
|
6219
|
+
interface SwapRouteStepEstimate {
|
|
6220
|
+
readonly fromAmount: string;
|
|
6221
|
+
readonly toAmount: string;
|
|
6222
|
+
readonly gasCostUSD?: string;
|
|
6223
|
+
}
|
|
6224
|
+
/** A single swap or bridge hop selected by the route provider. */
|
|
6225
|
+
interface SwapRouteStep {
|
|
6226
|
+
/** Hop kind, for example `swap` or `bridge`. */
|
|
6227
|
+
readonly type: string;
|
|
6228
|
+
/** Protocol identifier, for example `cctp-v2`. */
|
|
6229
|
+
readonly tool: string;
|
|
6230
|
+
/** Display name for {@link SwapRouteStep.tool}. */
|
|
6231
|
+
readonly toolName: string;
|
|
6232
|
+
readonly fromToken: SwapRouteToken;
|
|
6233
|
+
readonly toToken: SwapRouteToken;
|
|
6234
|
+
readonly estimate: SwapRouteStepEstimate;
|
|
6235
|
+
/** Provider-specific details that are not part of the stable step shape. */
|
|
6236
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
6237
|
+
}
|
|
6238
|
+
/** Provider and executable hops selected for a swap. */
|
|
6239
|
+
interface SwapRoute {
|
|
6240
|
+
/**
|
|
6241
|
+
* Provider that routed the swap, for example `lifi` or `circle`. Treat as
|
|
6242
|
+
* an opaque identifier; new providers can appear without an SDK release.
|
|
6243
|
+
*/
|
|
6244
|
+
readonly provider: string;
|
|
6245
|
+
readonly steps: readonly SwapRouteStep[];
|
|
6246
|
+
/** Provider-specific details that are not part of the stable route shape. */
|
|
6247
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
6248
|
+
}
|
|
6249
|
+
|
|
6210
6250
|
/**
|
|
6211
6251
|
* Represents a token amount with its symbol and value.
|
|
6212
6252
|
*
|
|
@@ -6405,7 +6445,7 @@ interface ServiceSwapConfig {
|
|
|
6405
6445
|
*
|
|
6406
6446
|
* @defaultValue true
|
|
6407
6447
|
*/
|
|
6408
|
-
batchTransactions?: boolean;
|
|
6448
|
+
batchTransactions?: boolean | undefined;
|
|
6409
6449
|
}
|
|
6410
6450
|
/**
|
|
6411
6451
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -6558,6 +6598,14 @@ interface ServiceSwapFee {
|
|
|
6558
6598
|
* addresses are not available from the proxy response.
|
|
6559
6599
|
*/
|
|
6560
6600
|
readonly recipientAddress?: string;
|
|
6601
|
+
/** Provider-defined fee component (for example `FORWARD`). */
|
|
6602
|
+
readonly component?: string;
|
|
6603
|
+
/**
|
|
6604
|
+
* Chain on which the fee is charged, as reported by the service
|
|
6605
|
+
* (a `Blockchain` value such as `'Ethereum'`). Not validated
|
|
6606
|
+
* against the `Blockchain` enum.
|
|
6607
|
+
*/
|
|
6608
|
+
readonly chain?: string;
|
|
6561
6609
|
}
|
|
6562
6610
|
|
|
6563
6611
|
/**
|
|
@@ -6922,6 +6970,33 @@ interface SwapConfig {
|
|
|
6922
6970
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6923
6971
|
*/
|
|
6924
6972
|
kitKey?: string;
|
|
6973
|
+
/**
|
|
6974
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
6975
|
+
*
|
|
6976
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
6977
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
6978
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
6979
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
6980
|
+
* approve-then-swap flow.
|
|
6981
|
+
*
|
|
6982
|
+
* @remarks
|
|
6983
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
6984
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
6985
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
6986
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
6987
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
6988
|
+
* rejects batched calls.
|
|
6989
|
+
*
|
|
6990
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
6991
|
+
*
|
|
6992
|
+
* @example
|
|
6993
|
+
* ```typescript
|
|
6994
|
+
* const config: SwapConfig = {
|
|
6995
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
6996
|
+
* }
|
|
6997
|
+
* ```
|
|
6998
|
+
*/
|
|
6999
|
+
batchTransactions?: boolean | undefined;
|
|
6925
7000
|
}
|
|
6926
7001
|
/**
|
|
6927
7002
|
* Estimation result for a swap operation.
|
|
@@ -7034,6 +7109,8 @@ interface SwapEstimate {
|
|
|
7034
7109
|
* and kit fees (if configured). Amounts are in decimal format for display.
|
|
7035
7110
|
*/
|
|
7036
7111
|
readonly fees?: readonly ServiceSwapFee[];
|
|
7112
|
+
/** Provider and executable hops selected for the swap. */
|
|
7113
|
+
readonly route?: SwapRoute;
|
|
7037
7114
|
}
|
|
7038
7115
|
/**
|
|
7039
7116
|
* Resolved parameters for swap operations after validation and normalization.
|
package/estimateSwap.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.
|
|
@@ -6207,6 +6209,44 @@ type BridgeDestination<TAdapterCapabilities extends AdapterCapabilities = Adapte
|
|
|
6207
6209
|
useForwarder?: boolean;
|
|
6208
6210
|
}) | ForwarderDestination<TChainIdentifier>;
|
|
6209
6211
|
|
|
6212
|
+
/** Token metadata for one side of a swap route step. */
|
|
6213
|
+
interface SwapRouteToken {
|
|
6214
|
+
readonly symbol: string;
|
|
6215
|
+
readonly address: string;
|
|
6216
|
+
readonly decimals: number;
|
|
6217
|
+
}
|
|
6218
|
+
/** Amount estimates for a swap route step, expressed in base units. */
|
|
6219
|
+
interface SwapRouteStepEstimate {
|
|
6220
|
+
readonly fromAmount: string;
|
|
6221
|
+
readonly toAmount: string;
|
|
6222
|
+
readonly gasCostUSD?: string;
|
|
6223
|
+
}
|
|
6224
|
+
/** A single swap or bridge hop selected by the route provider. */
|
|
6225
|
+
interface SwapRouteStep {
|
|
6226
|
+
/** Hop kind, for example `swap` or `bridge`. */
|
|
6227
|
+
readonly type: string;
|
|
6228
|
+
/** Protocol identifier, for example `cctp-v2`. */
|
|
6229
|
+
readonly tool: string;
|
|
6230
|
+
/** Display name for {@link SwapRouteStep.tool}. */
|
|
6231
|
+
readonly toolName: string;
|
|
6232
|
+
readonly fromToken: SwapRouteToken;
|
|
6233
|
+
readonly toToken: SwapRouteToken;
|
|
6234
|
+
readonly estimate: SwapRouteStepEstimate;
|
|
6235
|
+
/** Provider-specific details that are not part of the stable step shape. */
|
|
6236
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
6237
|
+
}
|
|
6238
|
+
/** Provider and executable hops selected for a swap. */
|
|
6239
|
+
interface SwapRoute {
|
|
6240
|
+
/**
|
|
6241
|
+
* Provider that routed the swap, for example `lifi` or `circle`. Treat as
|
|
6242
|
+
* an opaque identifier; new providers can appear without an SDK release.
|
|
6243
|
+
*/
|
|
6244
|
+
readonly provider: string;
|
|
6245
|
+
readonly steps: readonly SwapRouteStep[];
|
|
6246
|
+
/** Provider-specific details that are not part of the stable route shape. */
|
|
6247
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
6248
|
+
}
|
|
6249
|
+
|
|
6210
6250
|
/**
|
|
6211
6251
|
* Represents a token amount with its symbol and value.
|
|
6212
6252
|
*
|
|
@@ -6405,7 +6445,7 @@ interface ServiceSwapConfig {
|
|
|
6405
6445
|
*
|
|
6406
6446
|
* @defaultValue true
|
|
6407
6447
|
*/
|
|
6408
|
-
batchTransactions?: boolean;
|
|
6448
|
+
batchTransactions?: boolean | undefined;
|
|
6409
6449
|
}
|
|
6410
6450
|
/**
|
|
6411
6451
|
* Parameters for initiating a swap operation through the Stablecoin Service.
|
|
@@ -6558,6 +6598,14 @@ interface ServiceSwapFee {
|
|
|
6558
6598
|
* addresses are not available from the proxy response.
|
|
6559
6599
|
*/
|
|
6560
6600
|
readonly recipientAddress?: string;
|
|
6601
|
+
/** Provider-defined fee component (for example `FORWARD`). */
|
|
6602
|
+
readonly component?: string;
|
|
6603
|
+
/**
|
|
6604
|
+
* Chain on which the fee is charged, as reported by the service
|
|
6605
|
+
* (a `Blockchain` value such as `'Ethereum'`). Not validated
|
|
6606
|
+
* against the `Blockchain` enum.
|
|
6607
|
+
*/
|
|
6608
|
+
readonly chain?: string;
|
|
6561
6609
|
}
|
|
6562
6610
|
|
|
6563
6611
|
/**
|
|
@@ -6922,6 +6970,33 @@ interface SwapConfig {
|
|
|
6922
6970
|
* `apiKey` is omitted, and `apiKey` takes precedence when both are set.
|
|
6923
6971
|
*/
|
|
6924
6972
|
kitKey?: string;
|
|
6973
|
+
/**
|
|
6974
|
+
* Enable or disable atomic batched execution of the approval and swap.
|
|
6975
|
+
*
|
|
6976
|
+
* When `true` (or omitted), an EVM swap that needs an on-chain ERC-20
|
|
6977
|
+
* approval submits the approval and the swap as one atomic batch if the
|
|
6978
|
+
* connected wallet supports it (EIP-5792, or a signing strategy that
|
|
6979
|
+
* declares atomic batching). Set to `false` to force the sequential
|
|
6980
|
+
* approve-then-swap flow.
|
|
6981
|
+
*
|
|
6982
|
+
* @remarks
|
|
6983
|
+
* Has no effect on the gasless permit path, native-token swaps, or Solana,
|
|
6984
|
+
* which already execute as a single transaction. USDT input always uses the
|
|
6985
|
+
* sequential path because its allowance must be reset to zero first. The
|
|
6986
|
+
* batched path relies on the wallet's own gas estimation for the swap call;
|
|
6987
|
+
* set `false` if your wallet under-estimates gas for complex routes or
|
|
6988
|
+
* rejects batched calls.
|
|
6989
|
+
*
|
|
6990
|
+
* @defaultValue `undefined` (batching attempted when the wallet supports it)
|
|
6991
|
+
*
|
|
6992
|
+
* @example
|
|
6993
|
+
* ```typescript
|
|
6994
|
+
* const config: SwapConfig = {
|
|
6995
|
+
* batchTransactions: false, // force sequential approve → swap
|
|
6996
|
+
* }
|
|
6997
|
+
* ```
|
|
6998
|
+
*/
|
|
6999
|
+
batchTransactions?: boolean | undefined;
|
|
6925
7000
|
}
|
|
6926
7001
|
/**
|
|
6927
7002
|
* Estimation result for a swap operation.
|
|
@@ -7034,6 +7109,8 @@ interface SwapEstimate {
|
|
|
7034
7109
|
* and kit fees (if configured). Amounts are in decimal format for display.
|
|
7035
7110
|
*/
|
|
7036
7111
|
readonly fees?: readonly ServiceSwapFee[];
|
|
7112
|
+
/** Provider and executable hops selected for the swap. */
|
|
7113
|
+
readonly route?: SwapRoute;
|
|
7037
7114
|
}
|
|
7038
7115
|
/**
|
|
7039
7116
|
* Resolved parameters for swap operations after validation and normalization.
|