@shapeshiftoss/swapper 2.2.0 → 2.2.1

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.
@@ -1,4 +1,4 @@
1
- import { GetQuoteInput, SwapperType } from '@shapeshiftoss/types';
1
+ import { SwapperType } from '@shapeshiftoss/types';
2
2
  import { BuyAssetBySellIdInput, ByPairInput, SupportedSellAssetsInput, Swapper } from '..';
3
3
  export declare class SwapperError extends Error {
4
4
  constructor(message: string);
@@ -25,7 +25,7 @@ export declare class SwapperManager {
25
25
  * @returns {SwapperManager}
26
26
  */
27
27
  removeSwapper(swapperType: SwapperType): this;
28
- getBestSwapper(quoteParams: GetQuoteInput): Promise<SwapperType>;
28
+ getBestSwapper(args: ByPairInput): Promise<Swapper>;
29
29
  /**
30
30
  *
31
31
  * @param pair type {GetQuoteInput}
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SwapperManager = exports.SwapperError = void 0;
7
- const types_1 = require("@shapeshiftoss/types");
8
7
  const uniq_1 = __importDefault(require("lodash/uniq"));
9
8
  class SwapperError extends Error {
10
9
  constructor(message) {
@@ -59,9 +58,10 @@ class SwapperManager {
59
58
  this.swappers.delete(swapperType);
60
59
  return this;
61
60
  }
62
- async getBestSwapper(quoteParams) {
63
- quoteParams; // noop to shut up linter
64
- return types_1.SwapperType.Zrx; // TODO: implement getBestSwapper
61
+ async getBestSwapper(args) {
62
+ // TODO: This will eventually have logic to determine the best swapper.
63
+ // For now we return the first swapper we get from getSwappersByPair
64
+ return this.getSwappersByPair(args)[0];
65
65
  }
66
66
  /**
67
67
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "TODO: description",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",