@lifi/sdk 2.0.0-beta.2 → 2.0.0-beta.3

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.
@@ -3,7 +3,7 @@ import { ChainId, ChainKey, ExtendedChain, PossibilitiesRequest, PossibilitiesRe
3
3
  declare const _default: {
4
4
  getChains: (options?: RequestOptions | undefined) => Promise<ExtendedChain[]>;
5
5
  getContractCallQuote: (requestConfig: ContractCallQuoteRequest, options?: RequestOptions | undefined) => Promise<Step>;
6
- getGasRecommendation: ({ chainId, fromChain, fromToken }: GasRecommendationRequest, options?: RequestOptions | undefined) => Promise<GasRecommendationResponse>;
6
+ getGasRecommendation: (requestConfig: GasRecommendationRequest, options?: RequestOptions | undefined) => Promise<GasRecommendationResponse>;
7
7
  getPossibilities: (requestConfig?: PossibilitiesRequest | undefined, options?: RequestOptions | undefined) => Promise<PossibilitiesResponse>;
8
8
  getQuote: (requestConfig: QuoteRequest, options?: RequestOptions | undefined) => Promise<Step>;
9
9
  getRoutes: (requestConfig: RoutesRequest, options?: RequestOptions | undefined) => Promise<RoutesResponse>;
@@ -277,15 +277,17 @@ const getTokens = async (requestConfig, options) => {
277
277
  });
278
278
  return response;
279
279
  };
280
- const getGasRecommendation = async ({ chainId, fromChain, fromToken }, options) => {
280
+ const getGasRecommendation = async (requestConfig, options) => {
281
281
  const config = ConfigService_1.default.getInstance().getConfig();
282
- if (!chainId) {
282
+ Object.keys(requestConfig).forEach((key) => !requestConfig[key] &&
283
+ delete requestConfig[key]);
284
+ if (!requestConfig.chainId) {
283
285
  throw new errors_1.ValidationError('Required parameter "chainId" is missing.');
284
286
  }
285
287
  try {
286
- const response = await (0, helpers_1.request)(`${config.apiUrl}/gas/suggestion/${chainId}?${new URLSearchParams({
287
- fromChain,
288
- fromToken,
288
+ const response = await (0, helpers_1.request)(`${config.apiUrl}/gas/suggestion/${requestConfig.chainId}?${new URLSearchParams({
289
+ fromChain: requestConfig.fromChain,
290
+ fromToken: requestConfig.fromToken,
289
291
  })}`, {
290
292
  signal: options?.signal,
291
293
  });
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/sdk";
2
- export declare const version = "2.0.0-beta.2";
2
+ export declare const version = "2.0.0-beta.3";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/sdk';
5
- exports.version = '2.0.0-beta.2';
5
+ exports.version = '2.0.0-beta.3';
@@ -3,7 +3,7 @@ import { ChainId, ChainKey, ExtendedChain, PossibilitiesRequest, PossibilitiesRe
3
3
  declare const _default: {
4
4
  getChains: (options?: RequestOptions | undefined) => Promise<ExtendedChain[]>;
5
5
  getContractCallQuote: (requestConfig: ContractCallQuoteRequest, options?: RequestOptions | undefined) => Promise<Step>;
6
- getGasRecommendation: ({ chainId, fromChain, fromToken }: GasRecommendationRequest, options?: RequestOptions | undefined) => Promise<GasRecommendationResponse>;
6
+ getGasRecommendation: (requestConfig: GasRecommendationRequest, options?: RequestOptions | undefined) => Promise<GasRecommendationResponse>;
7
7
  getPossibilities: (requestConfig?: PossibilitiesRequest | undefined, options?: RequestOptions | undefined) => Promise<PossibilitiesResponse>;
8
8
  getQuote: (requestConfig: QuoteRequest, options?: RequestOptions | undefined) => Promise<Step>;
9
9
  getRoutes: (requestConfig: RoutesRequest, options?: RequestOptions | undefined) => Promise<RoutesResponse>;
@@ -272,15 +272,17 @@ const getTokens = async (requestConfig, options) => {
272
272
  });
273
273
  return response;
274
274
  };
275
- const getGasRecommendation = async ({ chainId, fromChain, fromToken }, options) => {
275
+ const getGasRecommendation = async (requestConfig, options) => {
276
276
  const config = ConfigService.getInstance().getConfig();
277
- if (!chainId) {
277
+ Object.keys(requestConfig).forEach((key) => !requestConfig[key] &&
278
+ delete requestConfig[key]);
279
+ if (!requestConfig.chainId) {
278
280
  throw new ValidationError('Required parameter "chainId" is missing.');
279
281
  }
280
282
  try {
281
- const response = await request(`${config.apiUrl}/gas/suggestion/${chainId}?${new URLSearchParams({
282
- fromChain,
283
- fromToken,
283
+ const response = await request(`${config.apiUrl}/gas/suggestion/${requestConfig.chainId}?${new URLSearchParams({
284
+ fromChain: requestConfig.fromChain,
285
+ fromToken: requestConfig.fromToken,
284
286
  })}`, {
285
287
  signal: options?.signal,
286
288
  });
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/sdk";
2
- export declare const version = "2.0.0-beta.2";
2
+ export declare const version = "2.0.0-beta.3";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/sdk';
2
- export const version = '2.0.0-beta.2';
2
+ export const version = '2.0.0-beta.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/sdk",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "description": "LI.FI Any-to-Any Cross-Chain-Swap SDK",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/index.js",