@shapeshiftoss/swapper 8.0.1 → 8.1.0

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/api.d.ts CHANGED
@@ -160,6 +160,8 @@ export declare enum SwapErrorTypes {
160
160
  POOL_NOT_FOUND = "POOL_NOT_FOUND"
161
161
  }
162
162
  export interface Swapper<T extends ChainId> {
163
+ /** Human readable swapper name */
164
+ readonly name: string;
163
165
  /** perform any necessary async initialization */
164
166
  initialize?(): Promise<void>;
165
167
  /** Returns the swapper type */
@@ -14,7 +14,7 @@ export declare type CowSwapperDeps = {
14
14
  feeAsset: Asset;
15
15
  };
16
16
  export declare class CowSwapper implements Swapper<KnownChainIds.EthereumMainnet> {
17
- static swapperName: string;
17
+ readonly name = "CowSwap";
18
18
  deps: CowSwapperDeps;
19
19
  constructor(deps: CowSwapperDeps);
20
20
  getType(): SwapperType;
@@ -9,6 +9,7 @@ const blacklist_1 = require("./utils/blacklist");
9
9
  const helpers_1 = require("./utils/helpers/helpers");
10
10
  class CowSwapper {
11
11
  constructor(deps) {
12
+ this.name = 'CowSwap';
12
13
  this.deps = deps;
13
14
  }
14
15
  getType() {
@@ -51,4 +52,3 @@ class CowSwapper {
51
52
  }
52
53
  }
53
54
  exports.CowSwapper = CowSwapper;
54
- CowSwapper.swapperName = 'CowSwapper';
@@ -6,6 +6,7 @@ import { ApprovalNeededOutput, BuyAssetBySellIdInput, Swapper, SwapperType, Trad
6
6
  * Meant for local testing only
7
7
  */
8
8
  export declare class TestSwapper implements Swapper<ChainId> {
9
+ readonly name = "Test";
9
10
  supportAssets: string[];
10
11
  initialize(): Promise<void>;
11
12
  getType(): SwapperType;
@@ -8,6 +8,7 @@ const api_1 = require("../../api");
8
8
  */
9
9
  class TestSwapper {
10
10
  constructor() {
11
+ this.name = 'Test';
11
12
  this.supportAssets = [
12
13
  'bip122:000000000019d6689c085ae165831e93/slip44:0',
13
14
  'cosmos:cosmoshub-4/slip44:118',
@@ -4,6 +4,7 @@ import { KnownChainIds } from '@shapeshiftoss/types';
4
4
  import { ApprovalNeededInput, ApprovalNeededOutput, ApproveInfiniteInput, BuyAssetBySellIdInput, ExecuteTradeInput, GetTradeQuoteInput, Swapper, SwapperType, Trade, TradeQuote, TradeResult, TradeTxs } from '../../api';
5
5
  import { ThorchainSwapperDeps } from './types';
6
6
  export declare class ThorchainSwapper implements Swapper<ChainId> {
7
+ readonly name = "Thorchain";
7
8
  private swapSupportedChainIds;
8
9
  private supportedAssetIds;
9
10
  deps: ThorchainSwapperDeps;
@@ -11,6 +11,7 @@ const getUsdRate_1 = require("./utils/getUsdRate/getUsdRate");
11
11
  const thorService_1 = require("./utils/thorService");
12
12
  class ThorchainSwapper {
13
13
  constructor(deps) {
14
+ this.name = 'Thorchain';
14
15
  this.swapSupportedChainIds = {
15
16
  'eip155:1': true,
16
17
  'bip122:000000000019d6689c085ae165831e93': true
@@ -3,7 +3,7 @@ import { Asset } from '@shapeshiftoss/types';
3
3
  import { ApprovalNeededInput, ApprovalNeededOutput, ApproveInfiniteInput, BuildTradeInput, BuyAssetBySellIdInput, EvmSupportedChainIds, GetEvmTradeQuoteInput, Swapper, SwapperType, TradeQuote, TradeResult, TradeTxs } from '../../api';
4
4
  import { ZrxExecuteTradeInput, ZrxSwapperDeps, ZrxTrade } from './types';
5
5
  export declare class ZrxSwapper<T extends EvmSupportedChainIds> implements Swapper<T> {
6
- static swapperName: string;
6
+ readonly name = "0x";
7
7
  deps: ZrxSwapperDeps;
8
8
  chainId: ChainId;
9
9
  constructor(deps: ZrxSwapperDeps);
@@ -12,6 +12,7 @@ const zrxBuildTrade_1 = require("./zrxBuildTrade/zrxBuildTrade");
12
12
  const zrxExecuteTrade_1 = require("./zrxExecuteTrade/zrxExecuteTrade");
13
13
  class ZrxSwapper {
14
14
  constructor(deps) {
15
+ this.name = '0x';
15
16
  this.deps = deps;
16
17
  this.chainId = deps.adapter.getChainId();
17
18
  }
@@ -62,4 +63,3 @@ class ZrxSwapper {
62
63
  }
63
64
  }
64
65
  exports.ZrxSwapper = ZrxSwapper;
65
- ZrxSwapper.swapperName = 'ZrxSwapper';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "An interface and implementations to trade coins via various protocols",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",