@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.
@@ -15,7 +15,7 @@ export const SUPPORT_CHAINS = [
15
15
  CHAINS_ENUM.KLAY,
16
16
  CHAINS_ENUM.GNOSIS,
17
17
  CHAINS_ENUM.BASE,
18
- // CHAINS_ENUM.ERA,
18
+ CHAINS_ENUM.ERA,
19
19
  CHAINS_ENUM.AURORA,
20
20
  ];
21
21
  export const getQuote = generateGetQuote({
@@ -27,7 +27,7 @@ export const SUPPORT_CHAINS = [
27
27
  // CHAINS_ENUM.LINEA,
28
28
  // CHAINS_ENUM.BTT,
29
29
  CHAINS_ENUM.BASE,
30
- // CHAINS_ENUM.ERA,
30
+ CHAINS_ENUM.ERA,
31
31
  // CHAINS_ENUM.PZE,
32
32
  // CHAINS_ENUM.ROSE,
33
33
  ];
package/dist/quote.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface QuoteParams {
12
12
  feeAddress?: string;
13
13
  gasPrice?: number;
14
14
  chain: CHAINS_ENUM;
15
+ fee?: boolean;
15
16
  }
16
17
  export interface Tx {
17
18
  from: string;
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 data = yield api.getSwapQuote({
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-swap",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {