@shapeshiftoss/swapper 14.5.0 → 14.5.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.
package/dist/api.d.ts CHANGED
@@ -145,7 +145,7 @@ export declare type ApprovalNeededInput<C extends ChainId> = {
145
145
  wallet: HDWallet;
146
146
  };
147
147
  export declare type SwapSource = {
148
- name: string;
148
+ name: SwapperName;
149
149
  proportion: string;
150
150
  };
151
151
  export interface MinMaxOutput {
@@ -203,7 +203,7 @@ export declare enum SwapErrorTypes {
203
203
  }
204
204
  export interface Swapper<T extends ChainId> {
205
205
  /** Human-readable swapper name */
206
- readonly name: string;
206
+ readonly name: SwapperName;
207
207
  /** perform any necessary async initialization */
208
208
  initialize?(): Promise<void>;
209
209
  /** Returns the swapper type */
@@ -1,8 +1,9 @@
1
+ import { SwapperName } from '../../../api';
1
2
  export declare const MAX_ALLOWANCE = "100000000000000000000000000";
2
3
  export declare const MAX_COWSWAP_TRADE = "100000000000000000000000000";
3
4
  export declare const MIN_COWSWAP_VALUE_USD = 20;
4
5
  export declare const DEFAULT_SOURCE: {
5
- name: string;
6
+ name: SwapperName;
6
7
  proportion: string;
7
8
  }[];
8
9
  export declare const DEFAULT_ADDRESS = "0x0000000000000000000000000000000000000000";
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.COW_SWAP_ETH_MARKER_ADDRESS = exports.ORDER_STATUS_FULFILLED = exports.ERC20_TOKEN_BALANCE = exports.SIGNING_SCHEME = exports.ORDER_KIND_BUY = exports.ORDER_KIND_SELL = exports.WETH_ASSET_ID = exports.COW_SWAP_SETTLEMENT_ADDRESS = exports.COW_SWAP_VAULT_RELAYER_ADDRESS = exports.DEFAULT_APP_DATA = exports.DEFAULT_ADDRESS = exports.DEFAULT_SOURCE = exports.MIN_COWSWAP_VALUE_USD = exports.MAX_COWSWAP_TRADE = exports.MAX_ALLOWANCE = void 0;
4
4
  const constants_1 = require("@ethersproject/constants");
5
+ const api_1 = require("../../../api");
5
6
  exports.MAX_ALLOWANCE = '100000000000000000000000000';
6
7
  exports.MAX_COWSWAP_TRADE = '100000000000000000000000000';
7
8
  exports.MIN_COWSWAP_VALUE_USD = 20;
8
- exports.DEFAULT_SOURCE = [{ name: 'CowSwap', proportion: '1' }];
9
+ exports.DEFAULT_SOURCE = [{ name: api_1.SwapperName.CowSwap, proportion: '1' }];
9
10
  exports.DEFAULT_ADDRESS = constants_1.AddressZero;
10
11
  exports.DEFAULT_APP_DATA = '0x68a7b5781dfe48bd5d7aeb11261c17517f5c587da682e4fade9b6a00a59b8970';
11
12
  exports.COW_SWAP_VAULT_RELAYER_ADDRESS = '0xc92e8bdf79f0507f65a392b0ab4667716bfe0110';
@@ -116,7 +116,7 @@ class OsmosisSwapper {
116
116
  sellAmountCryptoPrecision: sellAmountCryptoBase,
117
117
  sellAsset,
118
118
  bip44Params,
119
- sources: [{ name: 'Osmosis', proportion: '100' }],
119
+ sources: [{ name: api_1.SwapperName.Osmosis, proportion: '100' }],
120
120
  };
121
121
  }
122
122
  async getTradeQuote(input) {
@@ -1,5 +1,6 @@
1
+ import { SwapperName } from '../../../api';
1
2
  export declare const DEFAULT_SOURCE: {
2
- name: string;
3
+ name: SwapperName;
3
4
  proportion: string;
4
5
  }[];
5
6
  export declare const MAX_SWAPPER_SELL = "100000000000000000000000000";
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OSMO_COSMO_CHANNEL = exports.COSMO_OSMO_CHANNEL = exports.OSMOSIS_PRECISION = exports.MAX_SWAPPER_SELL = exports.DEFAULT_SOURCE = void 0;
4
- exports.DEFAULT_SOURCE = [{ name: 'Osmosis', proportion: '1' }];
4
+ const api_1 = require("../../../api");
5
+ exports.DEFAULT_SOURCE = [{ name: api_1.SwapperName.Osmosis, proportion: '1' }];
5
6
  exports.MAX_SWAPPER_SELL = '100000000000000000000000000';
6
7
  exports.OSMOSIS_PRECISION = 6;
7
8
  exports.COSMO_OSMO_CHANNEL = 'channel-141';
@@ -62,7 +62,7 @@ const getThorTradeQuote = async ({ deps, input }) => {
62
62
  maximum: constants_3.MAX_THORCHAIN_TRADE,
63
63
  sellAmountCryptoPrecision,
64
64
  buyAmountCryptoPrecision,
65
- sources: [{ name: 'thorchain', proportion: '1' }],
65
+ sources: [{ name: api_1.SwapperName.Thorchain, proportion: '1' }],
66
66
  buyAsset,
67
67
  sellAsset,
68
68
  bip44Params,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "14.5.0",
3
+ "version": "14.5.1",
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",