@swapkit/core 1.0.0-rc.80 → 1.0.0-rc.82
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/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +470 -481
- package/dist/index.es.js.map +1 -1
- package/package.json +8 -8
- package/src/client/index.ts +23 -22
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-oss-team",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@swapkit/helpers": "1.0.0-rc.
|
|
4
|
+
"@swapkit/helpers": "1.0.0-rc.60",
|
|
5
5
|
"@swapkit/types": "1.0.0-rc.31"
|
|
6
6
|
},
|
|
7
7
|
"description": "SwapKit Lib core",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"@internal/config": "null-rc.0",
|
|
13
13
|
"@swapkit/api": "1.0.0-rc.32",
|
|
14
14
|
"@swapkit/tokens": "1.0.0-rc.32",
|
|
15
|
-
"@swapkit/toolbox-cosmos": "1.0.0-rc.
|
|
16
|
-
"@swapkit/toolbox-evm": "1.0.0-rc.
|
|
17
|
-
"@swapkit/toolbox-utxo": "1.0.0-rc.
|
|
15
|
+
"@swapkit/toolbox-cosmos": "1.0.0-rc.67",
|
|
16
|
+
"@swapkit/toolbox-evm": "1.0.0-rc.65",
|
|
17
|
+
"@swapkit/toolbox-utxo": "1.0.0-rc.63"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@swapkit/api": "1.0.0-rc.32",
|
|
21
21
|
"@swapkit/tokens": "1.0.0-rc.32",
|
|
22
|
-
"@swapkit/toolbox-cosmos": "1.0.0-rc.
|
|
23
|
-
"@swapkit/toolbox-evm": "1.0.0-rc.
|
|
24
|
-
"@swapkit/toolbox-utxo": "1.0.0-rc.
|
|
22
|
+
"@swapkit/toolbox-cosmos": "1.0.0-rc.67",
|
|
23
|
+
"@swapkit/toolbox-evm": "1.0.0-rc.65",
|
|
24
|
+
"@swapkit/toolbox-utxo": "1.0.0-rc.63"
|
|
25
25
|
},
|
|
26
26
|
"eslintConfig": {
|
|
27
27
|
"extends": "../../../internal/eslint-config"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"type": "module",
|
|
51
51
|
"types": "./dist/index.d.ts",
|
|
52
|
-
"version": "1.0.0-rc.
|
|
52
|
+
"version": "1.0.0-rc.82",
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "NODE_OPTIONS=--max_old_space_size=16384 vite build",
|
|
55
55
|
"clean": "rm -rf dist vite.config.ts.* .turbo node_modules",
|
package/src/client/index.ts
CHANGED
|
@@ -89,7 +89,7 @@ export class SwapKitCore<T = ''> {
|
|
|
89
89
|
swap = async ({ streamSwap, recipient, route, feeOptionKey }: SwapParams) => {
|
|
90
90
|
const {
|
|
91
91
|
meta: { quoteMode },
|
|
92
|
-
evmTransactionDetails: contractCallParams,
|
|
92
|
+
// evmTransactionDetails: contractCallParams,
|
|
93
93
|
} = route;
|
|
94
94
|
const evmChain = quoteMode.startsWith('ERC20-')
|
|
95
95
|
? Chain.Ethereum
|
|
@@ -102,27 +102,28 @@ export class SwapKitCore<T = ''> {
|
|
|
102
102
|
if (!route.complete) throw new SwapKitError('core_swap_route_not_complete');
|
|
103
103
|
|
|
104
104
|
try {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
105
|
+
// TODO enable when BE is ready
|
|
106
|
+
// if (contractCallParams && evmChain) {
|
|
107
|
+
// const walletMethods = this.connectedWallets[evmChain];
|
|
108
|
+
|
|
109
|
+
// if (!walletMethods?.call) {
|
|
110
|
+
// throw new SwapKitError('core_wallet_connection_not_found');
|
|
111
|
+
// }
|
|
112
|
+
|
|
113
|
+
// const { contractAddress, contractMethod, contractParams, contractParamsStreaming } =
|
|
114
|
+
// contractCallParams;
|
|
115
|
+
|
|
116
|
+
// if (!(streamSwap ? contractParamsStreaming : contractParams)) {
|
|
117
|
+
// throw new SwapKitError('core_swap_route_transaction_not_found');
|
|
118
|
+
// }
|
|
119
|
+
|
|
120
|
+
// return await walletMethods.call<string>({
|
|
121
|
+
// contractAddress,
|
|
122
|
+
// abi: lowercasedContractAbiMapping[contractAddress.toLowerCase()],
|
|
123
|
+
// funcName: contractMethod,
|
|
124
|
+
// funcParams: streamSwap ? contractParamsStreaming : contractParams,
|
|
125
|
+
// });
|
|
126
|
+
// }
|
|
126
127
|
|
|
127
128
|
if (AGG_SWAP.includes(quoteMode) && evmChain) {
|
|
128
129
|
const walletMethods = this.connectedWallets[evmChain];
|