@swapkit/core 1.0.0-rc.41 → 1.0.0-rc.43
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/package.json +18 -18
- package/src/client/index.ts +10 -10
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-oss-team",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@swapkit/types": "1.0.0-rc.
|
|
5
|
-
"@swapkit/helpers": "1.0.0-rc.
|
|
4
|
+
"@swapkit/types": "1.0.0-rc.16",
|
|
5
|
+
"@swapkit/helpers": "1.0.0-rc.35"
|
|
6
6
|
},
|
|
7
7
|
"description": "SwapKit Lib core",
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@vitest/coverage-istanbul": "0.34.
|
|
10
|
-
"ethers": "6.
|
|
11
|
-
"vite": "4.
|
|
9
|
+
"@vitest/coverage-istanbul": "0.34.6",
|
|
10
|
+
"ethers": "6.9.0",
|
|
11
|
+
"vite": "4.5.0",
|
|
12
12
|
"vite-plugin-top-level-await": "1.3.1",
|
|
13
13
|
"vite-plugin-wasm": "3.2.2",
|
|
14
|
-
"vitest": "0.34.
|
|
15
|
-
"@internal/config": "0.0.0-rc.
|
|
16
|
-
"@swapkit/api": "1.0.0-rc.
|
|
17
|
-
"@swapkit/tokens": "1.0.0-rc.
|
|
18
|
-
"@swapkit/toolbox-cosmos": "1.0.0-rc.
|
|
19
|
-
"@swapkit/toolbox-evm": "1.0.0-rc.
|
|
20
|
-
"@swapkit/toolbox-utxo": "1.0.0-rc.
|
|
14
|
+
"vitest": "0.34.6",
|
|
15
|
+
"@internal/config": "0.0.0-rc.2",
|
|
16
|
+
"@swapkit/api": "1.0.0-rc.16",
|
|
17
|
+
"@swapkit/tokens": "1.0.0-rc.17",
|
|
18
|
+
"@swapkit/toolbox-cosmos": "1.0.0-rc.37",
|
|
19
|
+
"@swapkit/toolbox-evm": "1.0.0-rc.37",
|
|
20
|
+
"@swapkit/toolbox-utxo": "1.0.0-rc.37"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@swapkit/api": "1.0.0-rc.
|
|
24
|
-
"@swapkit/tokens": "1.0.0-rc.
|
|
25
|
-
"@swapkit/toolbox-cosmos": "1.0.0-rc.
|
|
26
|
-
"@swapkit/toolbox-evm": "1.0.0-rc.
|
|
27
|
-
"@swapkit/toolbox-utxo": "1.0.0-rc.
|
|
23
|
+
"@swapkit/api": "1.0.0-rc.16",
|
|
24
|
+
"@swapkit/tokens": "1.0.0-rc.17",
|
|
25
|
+
"@swapkit/toolbox-cosmos": "1.0.0-rc.37",
|
|
26
|
+
"@swapkit/toolbox-evm": "1.0.0-rc.37",
|
|
27
|
+
"@swapkit/toolbox-utxo": "1.0.0-rc.37"
|
|
28
28
|
},
|
|
29
29
|
"eslintConfig": {
|
|
30
30
|
"extends": "../../../internal/eslint-config"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"repository": "https://github.com/thorswap/SwapKit.git",
|
|
53
53
|
"type": "module",
|
|
54
54
|
"types": "./dist/index.d.ts",
|
|
55
|
-
"version": "1.0.0-rc.
|
|
55
|
+
"version": "1.0.0-rc.43",
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "NODE_OPTIONS=--max_old_space_size=16384 vite build",
|
|
58
58
|
"clean": "rm -rf dist vite.config.ts.* .turbo node_modules",
|
package/src/client/index.ts
CHANGED
|
@@ -79,8 +79,8 @@ export class SwapKitCore<T = ''> {
|
|
|
79
79
|
const evmChain = quoteMode.startsWith('ERC20-')
|
|
80
80
|
? Chain.Ethereum
|
|
81
81
|
: quoteMode.startsWith('ARC20-')
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
? Chain.Avalanche
|
|
83
|
+
: Chain.BinanceSmartChain;
|
|
84
84
|
|
|
85
85
|
if (!route.complete) throw new SwapKitError('core_swap_route_not_complete');
|
|
86
86
|
|
|
@@ -240,8 +240,8 @@ export class SwapKitCore<T = ''> {
|
|
|
240
240
|
chain === Chain.Avalanche
|
|
241
241
|
? TCAvalancheDepositABI
|
|
242
242
|
: chain === Chain.BinanceSmartChain
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
? TCBscDepositABI
|
|
244
|
+
: TCEthereumVaultAbi;
|
|
245
245
|
|
|
246
246
|
const response = await (
|
|
247
247
|
walletInstance as EVMWallet<typeof AVAXToolbox | typeof ETHToolbox | typeof BSCToolbox>
|
|
@@ -278,10 +278,10 @@ export class SwapKitCore<T = ''> {
|
|
|
278
278
|
const errorKey: Keys = isInsufficientFunds
|
|
279
279
|
? 'core_transaction_deposit_insufficient_funds_error'
|
|
280
280
|
: isGas
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
281
|
+
? 'core_transaction_deposit_gas_error'
|
|
282
|
+
: isServer
|
|
283
|
+
? 'core_transaction_deposit_server_error'
|
|
284
|
+
: 'core_transaction_deposit_error';
|
|
285
285
|
|
|
286
286
|
throw new SwapKitError(errorKey, error);
|
|
287
287
|
}
|
|
@@ -423,8 +423,8 @@ export class SwapKitCore<T = ''> {
|
|
|
423
423
|
to === 'rune'
|
|
424
424
|
? AssetValue.fromChainOrSignature(Chain.THORChain)
|
|
425
425
|
: (from === 'sym' && to === 'sym') || from === 'rune' || from === 'asset'
|
|
426
|
-
|
|
427
|
-
|
|
426
|
+
? undefined
|
|
427
|
+
: assetValue;
|
|
428
428
|
|
|
429
429
|
const value = getMinAmountByChain(from === 'asset' ? assetValue.chain : Chain.THORChain);
|
|
430
430
|
const memoString =
|