@rabby-wallet/rabby-swap 0.0.36 → 0.0.37
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/dexs/1inch.js +1 -1
- package/dist/dexs/wrapToken.js +1 -1
- package/dist/quote.d.ts +1 -0
- package/dist/utils.js +6 -2
- package/package.json +1 -1
package/dist/dexs/1inch.js
CHANGED
package/dist/dexs/wrapToken.js
CHANGED
package/dist/quote.d.ts
CHANGED
package/dist/utils.js
CHANGED
|
@@ -19,7 +19,7 @@ export const generateGetQuote = ({ SUPPORT_CHAINS, id, dex, }) => (options, api)
|
|
|
19
19
|
if (!SUPPORT_CHAINS.includes(options.chain)) {
|
|
20
20
|
throw new Error(`${CHAINS[options.chain]} is not support on ${dex}`);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const params = {
|
|
23
23
|
id: options.userAddress,
|
|
24
24
|
chain_id: CHAINS[options.chain].serverId,
|
|
25
25
|
dex_id: options.chain === CHAINS_ENUM.ETH
|
|
@@ -29,7 +29,11 @@ export const generateGetQuote = ({ SUPPORT_CHAINS, id, dex, }) => (options, api)
|
|
|
29
29
|
pay_token_raw_amount: options.amount,
|
|
30
30
|
receive_token_id: options.toToken,
|
|
31
31
|
slippage: options.slippage / 100,
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
|
+
if (options.fee) {
|
|
34
|
+
params.fee = true;
|
|
35
|
+
}
|
|
36
|
+
const data = yield api.getSwapQuote(params);
|
|
33
37
|
const isNativeToken = isSameAddress(data.pay_token.id, CHAINS[options.chain].nativeTokenAddress);
|
|
34
38
|
return {
|
|
35
39
|
tx: {
|