@rabby-wallet/rabby-swap 0.0.53 → 0.0.54

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/quote.d.ts CHANGED
@@ -11,6 +11,7 @@ export interface QuoteParams {
11
11
  feeRate?: number;
12
12
  feeAddress?: string;
13
13
  gasPrice?: number;
14
+ insufficient: boolean;
14
15
  chain?: CHAINS_ENUM;
15
16
  fee?: boolean;
16
17
  chainServerId: string;
@@ -38,6 +39,8 @@ export interface QuoteResult {
38
39
  toTokenAmount: string;
39
40
  spender: string;
40
41
  dexFeeDesc?: string | null;
42
+ gasUsed?: number;
43
+ origin?: Awaited<ReturnType<OpenApiService["getSwapQuote"]>>;
41
44
  }
42
45
  export declare const getQuote: (id: DEX_ENUM, params: QuoteParams, api: OpenApiService) => Promise<QuoteResult>;
43
46
  export interface DecodeCalldataResult {
package/dist/utils.js CHANGED
@@ -33,6 +33,9 @@ export const generateGetQuote = ({ SUPPORT_CHAINS, id, dex, }) => (options, api)
33
33
  if (options.fee) {
34
34
  params.fee = true;
35
35
  }
36
+ if (options.insufficient) {
37
+ params.no_pre_exec = true;
38
+ }
36
39
  const data = yield api.getSwapQuote(params);
37
40
  const isNativeToken = isSameAddress(data.pay_token.id, options.nativeTokenAddress);
38
41
  return {
@@ -52,5 +55,7 @@ export const generateGetQuote = ({ SUPPORT_CHAINS, id, dex, }) => (options, api)
52
55
  spender: dex === DEX_ENUM.PARASWAP
53
56
  ? DEX_SPENDER_WHITELIST[DEX_ENUM.PARASWAP][options.chain]
54
57
  : data.dex_swap_to,
58
+ gasUsed: data.gas_used,
59
+ origin: data,
55
60
  };
56
61
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-swap",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {