@shapeshiftoss/swapper 5.10.1 → 5.12.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.
Files changed (29) hide show
  1. package/dist/swappers/cow/CowSwapper.d.ts +6 -1
  2. package/dist/swappers/cow/CowSwapper.js +6 -3
  3. package/dist/swappers/cow/types.d.ts +4 -0
  4. package/dist/swappers/cow/types.js +2 -0
  5. package/dist/swappers/cow/utils/cowService.d.ts +1 -0
  6. package/dist/swappers/cow/utils/cowService.js +15 -0
  7. package/dist/swappers/cow/utils/helpers/helpers.d.ts +3 -0
  8. package/dist/swappers/cow/utils/helpers/helpers.js +43 -0
  9. package/dist/swappers/thorchain/ThorchainSwapper.d.ts +1 -0
  10. package/dist/swappers/thorchain/ThorchainSwapper.js +5 -1
  11. package/dist/swappers/thorchain/types.d.ts +1 -1
  12. package/dist/swappers/thorchain/utils/estimateTradeFee/estimateTradeFee.d.ts +3 -0
  13. package/dist/swappers/thorchain/utils/estimateTradeFee/estimateTradeFee.js +56 -0
  14. package/dist/swappers/thorchain/utils/ethereum/makeTradeTx.js +1 -1
  15. package/dist/swappers/thorchain/utils/getPriceRatio/getPriceRatio.js +1 -1
  16. package/dist/swappers/thorchain/utils/test-data/midgardResponse.d.ts +6 -5
  17. package/dist/swappers/thorchain/utils/test-data/midgardResponse.js +54 -2
  18. package/dist/swappers/{zrx/utils → utils}/bignumber.d.ts +0 -0
  19. package/dist/swappers/{zrx/utils → utils}/bignumber.js +0 -0
  20. package/dist/swappers/{zrx/utils → utils}/test-data/assets.d.ts +2 -0
  21. package/dist/swappers/{zrx/utils → utils}/test-data/assets.js +29 -1
  22. package/dist/swappers/zrx/ZrxApprovalNeeded/ZrxApprovalNeeded.js +1 -1
  23. package/dist/swappers/zrx/getZrxMinMax/getZrxMinMax.js +1 -1
  24. package/dist/swappers/zrx/getZrxTradeQuote/getZrxTradeQuote.js +1 -1
  25. package/dist/swappers/zrx/utils/helpers/helpers.js +1 -1
  26. package/dist/swappers/zrx/utils/test-data/setupSwapQuote.js +1 -1
  27. package/dist/swappers/zrx/zrxBuildTrade/zrxBuildTrade.js +1 -1
  28. package/dist/swappers/zrx/zrxExecuteTrade/zrxExecuteTrade.js +1 -1
  29. package/package.json +1 -1
@@ -1,13 +1,18 @@
1
1
  import { AssetId } from '@shapeshiftoss/caip';
2
2
  import { Asset, SupportedChainIds } from '@shapeshiftoss/types';
3
3
  import { ApprovalNeededInput, ApprovalNeededOutput, ApproveInfiniteInput, BuildTradeInput, BuyAssetBySellIdInput, ExecuteTradeInput, GetTradeQuoteInput, Swapper, SwapperType, Trade, TradeQuote, TradeResult, TradeTxs } from '../../api';
4
+ export declare type CowSwapperDeps = {
5
+ apiUrl: string;
6
+ };
4
7
  export declare class CowSwapper implements Swapper {
5
8
  static swapperName: string;
9
+ deps: CowSwapperDeps;
10
+ constructor(deps: CowSwapperDeps);
6
11
  initialize(): Promise<void>;
7
12
  getType(): SwapperType;
8
13
  buildTrade(args: BuildTradeInput): Promise<Trade<SupportedChainIds>>;
9
14
  getTradeQuote(input: GetTradeQuoteInput): Promise<TradeQuote<SupportedChainIds>>;
10
- getUsdRate(input: Pick<Asset, 'symbol' | 'assetId'>): Promise<string>;
15
+ getUsdRate(input: Asset): Promise<string>;
11
16
  executeTrade(args: ExecuteTradeInput<SupportedChainIds>): Promise<TradeResult>;
12
17
  approvalNeeded(args: ApprovalNeededInput<SupportedChainIds>): Promise<ApprovalNeededOutput>;
13
18
  approveInfinite(args: ApproveInfiniteInput<SupportedChainIds>): Promise<string>;
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CowSwapper = void 0;
4
4
  const api_1 = require("../../api");
5
+ const helpers_1 = require("./utils/helpers/helpers");
5
6
  class CowSwapper {
7
+ constructor(deps) {
8
+ this.deps = deps;
9
+ }
6
10
  // eslint-disable-next-line @typescript-eslint/no-empty-function
7
11
  async initialize() { }
8
12
  getType() {
@@ -16,9 +20,8 @@ class CowSwapper {
16
20
  console.info(input);
17
21
  throw new Error('CowSwapper: getTradeQuote unimplemented');
18
22
  }
19
- getUsdRate(input) {
20
- console.info(input);
21
- throw new Error('CowSwapper: getUsdRate unimplemented');
23
+ async getUsdRate(input) {
24
+ return (0, helpers_1.getUsdRate)(this.deps, input);
22
25
  }
23
26
  async executeTrade(args) {
24
27
  console.info(args);
@@ -0,0 +1,4 @@
1
+ export declare type CowSwapPriceResponse = {
2
+ amount: string;
3
+ token: string;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export declare const cowService: import("axios").AxiosInstance;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.cowService = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const axiosConfig = {
9
+ timeout: 10000,
10
+ headers: {
11
+ Accept: 'application/json',
12
+ 'Content-Type': 'application/json'
13
+ }
14
+ };
15
+ exports.cowService = axios_1.default.create(axiosConfig);
@@ -0,0 +1,3 @@
1
+ import { Asset } from '@shapeshiftoss/types';
2
+ import { CowSwapperDeps } from '../../CowSwapper';
3
+ export declare const getUsdRate: ({ apiUrl }: CowSwapperDeps, input: Asset) => Promise<string>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUsdRate = void 0;
4
+ const caip_1 = require("@shapeshiftoss/caip");
5
+ const api_1 = require("../../../../api");
6
+ const bignumber_1 = require("../../../utils/bignumber");
7
+ const cowService_1 = require("../cowService");
8
+ const USDC_CONTRACT_ADDRESS = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48';
9
+ const USDC_ASSET_PRECISION = 6;
10
+ const getUsdRate = async ({ apiUrl }, input) => {
11
+ const asset = input;
12
+ const { assetReference: erc20Address, assetNamespace } = (0, caip_1.fromAssetId)(asset.assetId);
13
+ if (assetNamespace !== 'erc20') {
14
+ throw new api_1.SwapError('[getUsdRate] - unsupported asset namespace', {
15
+ code: api_1.SwapErrorTypes.USD_RATE_FAILED,
16
+ details: { assetNamespace }
17
+ });
18
+ }
19
+ const buyAmountInDollars = 1000;
20
+ const buyAmount = (0, bignumber_1.bn)(buyAmountInDollars).times((0, bignumber_1.bn)(10).exponentiatedBy(USDC_ASSET_PRECISION));
21
+ try {
22
+ // rate is imprecise for low $ values, hence asking for $1000
23
+ // cowSwap api used : markets/{baseToken}-{quoteToken}/{kind}/{amount}
24
+ // It returns the estimated amount in quoteToken for either buying or selling amount of baseToken.
25
+ const rateResponse = await cowService_1.cowService.get(`${apiUrl}/v1/markets/${USDC_CONTRACT_ADDRESS}-${erc20Address}/buy/${buyAmount}`);
26
+ const tokenAmount = (0, bignumber_1.bnOrZero)(rateResponse.data.amount).div((0, bignumber_1.bn)(10).exponentiatedBy(asset.precision));
27
+ if (!tokenAmount.gt(0))
28
+ throw new api_1.SwapError('[getUsdRate] - Failed to get token amount', {
29
+ code: api_1.SwapErrorTypes.RESPONSE_ERROR
30
+ });
31
+ // dividing $1000 by amount of token received
32
+ return (0, bignumber_1.bn)(buyAmountInDollars).dividedBy(tokenAmount).toString();
33
+ }
34
+ catch (e) {
35
+ if (e instanceof api_1.SwapError)
36
+ throw e;
37
+ throw new api_1.SwapError('[getUsdRate]', {
38
+ cause: e,
39
+ code: api_1.SwapErrorTypes.USD_RATE_FAILED
40
+ });
41
+ }
42
+ };
43
+ exports.getUsdRate = getUsdRate;
@@ -3,6 +3,7 @@ import { Asset, SupportedChainIds } from '@shapeshiftoss/types';
3
3
  import { ApprovalNeededOutput, BuyAssetBySellIdInput, Swapper, SwapperType, Trade, TradeQuote, TradeResult, TradeTxs } from '../../api';
4
4
  import { ThorchainSwapperDeps } from './types';
5
5
  export declare class ThorchainSwapper implements Swapper {
6
+ private swapSupportedChainIds;
6
7
  private supportedAssetIds;
7
8
  deps: ThorchainSwapperDeps;
8
9
  constructor(deps: ThorchainSwapperDeps);
@@ -7,6 +7,10 @@ const getUsdRate_1 = require("./utils/getUsdRate/getUsdRate");
7
7
  const thorService_1 = require("./utils/thorService");
8
8
  class ThorchainSwapper {
9
9
  constructor(deps) {
10
+ this.swapSupportedChainIds = {
11
+ 'eip155:1': true,
12
+ 'bip122:000000000019d6689c085ae165831e93': true
13
+ };
10
14
  this.supportedAssetIds = [];
11
15
  this.deps = deps;
12
16
  }
@@ -15,7 +19,7 @@ class ThorchainSwapper {
15
19
  const { data: responseData } = await thorService_1.thorService.get(`${this.deps.midgardUrl}/pools`);
16
20
  const supportedAssetIds = responseData.reduce((acc, midgardPool) => {
17
21
  const assetId = caip_1.adapters.poolAssetIdToAssetId(midgardPool.asset);
18
- if (!assetId)
22
+ if (!assetId || !this.swapSupportedChainIds[(0, caip_1.fromAssetId)(assetId).chainId])
19
23
  return acc;
20
24
  acc.push(assetId);
21
25
  return acc;
@@ -1,5 +1,5 @@
1
1
  import { ChainAdapterManager } from '@shapeshiftoss/chain-adapters';
2
- export declare type MidgardResponse = {
2
+ export declare type PoolResponse = {
3
3
  asset: string;
4
4
  assetDepth: string;
5
5
  assetPrice: string;
@@ -0,0 +1,3 @@
1
+ import { AssetId } from '@shapeshiftoss/caip';
2
+ import { ThorchainSwapperDeps } from '../../types';
3
+ export declare const estimateTradeFee: (deps: ThorchainSwapperDeps, buyAssetId: AssetId) => Promise<string>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.estimateTradeFee = void 0;
4
+ const caip_1 = require("@shapeshiftoss/caip");
5
+ const api_1 = require("../../../../api");
6
+ const bignumber_1 = require("../../../utils/bignumber");
7
+ const thorService_1 = require("../thorService");
8
+ const gweiGasPrecision = 9;
9
+ // https://docs.thorchain.org/how-it-works/fees#outbound-fee
10
+ // estimatedTradeFee = `3 * estimatedFeeOutboundFee`
11
+ // eth txs from thorchain use approx 38383 gas
12
+ const ethEstimate = (gasRate) => (0, bignumber_1.bnOrZero)(gasRate).times(38383).times(3).times((0, bignumber_1.bn)(10).exponentiatedBy(gweiGasPrecision)).toString();
13
+ // erc20 txs from thorchain use approx 70996 gas
14
+ const erc20Estimate = (gasRate) => (0, bignumber_1.bnOrZero)(gasRate).times(70996).times(3).times((0, bignumber_1.bn)(10).exponentiatedBy(gweiGasPrecision)).toString();
15
+ // BTC utxo transactions from thorchain are approx 303 bytes long
16
+ const btcEstimate = (gasRate) => (0, bignumber_1.bnOrZero)(gasRate).times(303).times(3).toString();
17
+ const estimateTradeFee = async (deps, buyAssetId) => {
18
+ const thorId = caip_1.adapters.assetIdToPoolAssetId({ assetId: buyAssetId });
19
+ if (!thorId)
20
+ throw new api_1.SwapError('[estimateTradeFee] - undefined thorId for given buyAssetId', {
21
+ code: api_1.SwapErrorTypes.VALIDATION_FAILED,
22
+ details: { buyAssetId }
23
+ });
24
+ const thorPoolChainId = thorId.slice(0, thorId.indexOf('.'));
25
+ const { data: inboundAddresses } = await thorService_1.thorService.get(`${deps.midgardUrl}/thorchain/inbound_addresses`);
26
+ const inboundInfo = inboundAddresses.find((inbound) => inbound.chain === thorPoolChainId);
27
+ if (!inboundInfo)
28
+ throw new api_1.SwapError('[estimateTradeFee] - unable to locate inbound pool info', {
29
+ code: api_1.SwapErrorTypes.VALIDATION_FAILED,
30
+ details: { thorPoolChainId }
31
+ });
32
+ const gasRate = inboundInfo.gas_rate;
33
+ const { chainId, assetNamespace } = (0, caip_1.fromAssetId)(buyAssetId);
34
+ switch (chainId) {
35
+ case 'bip122:000000000019d6689c085ae165831e93':
36
+ return btcEstimate(gasRate);
37
+ case 'eip155:1':
38
+ switch (assetNamespace) {
39
+ case 'slip44':
40
+ return ethEstimate(gasRate);
41
+ case 'erc20':
42
+ return erc20Estimate(gasRate);
43
+ default:
44
+ throw new api_1.SwapError('[estimateTradeFee] - unsupported asset namespace', {
45
+ code: api_1.SwapErrorTypes.VALIDATION_FAILED,
46
+ details: { assetNamespace }
47
+ });
48
+ }
49
+ default:
50
+ throw new api_1.SwapError('[estimateTradeFee] - unsupported chain id', {
51
+ code: api_1.SwapErrorTypes.VALIDATION_FAILED,
52
+ details: { chainId }
53
+ });
54
+ }
55
+ };
56
+ exports.estimateTradeFee = estimateTradeFee;
@@ -7,7 +7,7 @@ exports.makeTradeTx = exports.toBaseUnit = exports.fromBaseUnit = void 0;
7
7
  const caip_1 = require("@shapeshiftoss/caip");
8
8
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
9
9
  const api_1 = require("../../../../api");
10
- const bignumber_1 = require("../../../zrx/utils/bignumber");
10
+ const bignumber_1 = require("../../../utils/bignumber");
11
11
  const getPriceRatio_1 = require("../getPriceRatio/getPriceRatio");
12
12
  const makeSwapMemo_1 = require("../makeSwapMemo/makeSwapMemo");
13
13
  const thorService_1 = require("../thorService");
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPriceRatio = void 0;
4
4
  const caip_1 = require("@shapeshiftoss/caip");
5
5
  const api_1 = require("../../../../api");
6
- const bignumber_1 = require("../../../zrx/utils/bignumber");
6
+ const bignumber_1 = require("../../../utils/bignumber");
7
7
  const thorService_1 = require("../thorService");
8
8
  const getPriceRatio = async (deps, input) => {
9
9
  var _a, _b;
@@ -1,5 +1,6 @@
1
- import { MidgardResponse } from '../../types';
2
- export declare const btcMidgardPool: MidgardResponse;
3
- export declare const ethMidgardPool: MidgardResponse;
4
- export declare const foxMidgardPool: MidgardResponse;
5
- export declare const midgardResponse: MidgardResponse[];
1
+ import { InboundResponse, PoolResponse } from '../../types';
2
+ export declare const btcMidgardPool: PoolResponse;
3
+ export declare const ethMidgardPool: PoolResponse;
4
+ export declare const foxMidgardPool: PoolResponse;
5
+ export declare const mockInboundAdresses: InboundResponse[];
6
+ export declare const poolResponse: PoolResponse[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.midgardResponse = exports.foxMidgardPool = exports.ethMidgardPool = exports.btcMidgardPool = void 0;
3
+ exports.poolResponse = exports.mockInboundAdresses = exports.foxMidgardPool = exports.ethMidgardPool = exports.btcMidgardPool = void 0;
4
4
  exports.btcMidgardPool = {
5
5
  asset: 'BTC.BTC',
6
6
  assetDepth: '91027798705',
@@ -43,4 +43,56 @@ exports.foxMidgardPool = {
43
43
  units: '10568061707512',
44
44
  volume24h: '251596933033'
45
45
  };
46
- exports.midgardResponse = [exports.btcMidgardPool, exports.ethMidgardPool, exports.foxMidgardPool];
46
+ exports.mockInboundAdresses = [
47
+ {
48
+ chain: 'BCH',
49
+ pub_key: 'thorpub1addwnpepqfyppkehky2hn2gy26y8jqyj9fz0rnvau2r7yueawzvc662w0x9s7n4ypra',
50
+ address: 'qp5a6rn8zmamgmsyspqsl0p6ktk4hrheggdjdvntv0',
51
+ halted: false,
52
+ gas_rate: '3'
53
+ },
54
+ {
55
+ chain: 'BNB',
56
+ pub_key: 'thorpub1addwnpepqfyppkehky2hn2gy26y8jqyj9fz0rnvau2r7yueawzvc662w0x9s7n4ypra',
57
+ address: 'bnb1d8wsuecklw6xupyqgy8mcw4ja4dca72z7nvqzw',
58
+ halted: false,
59
+ gas_rate: '11250'
60
+ },
61
+ {
62
+ chain: 'BTC',
63
+ pub_key: 'thorpub1addwnpepqfyppkehky2hn2gy26y8jqyj9fz0rnvau2r7yueawzvc662w0x9s7n4ypra',
64
+ address: 'bc1qd8wsuecklw6xupyqgy8mcw4ja4dca72z2dd88d',
65
+ halted: false,
66
+ gas_rate: '18'
67
+ },
68
+ {
69
+ chain: 'DOGE',
70
+ pub_key: 'thorpub1addwnpepqfyppkehky2hn2gy26y8jqyj9fz0rnvau2r7yueawzvc662w0x9s7n4ypra',
71
+ address: 'DEnrJfAjC4KMsLsGtoTGSmYaFZLPunWw9q',
72
+ halted: false,
73
+ gas_rate: '550384'
74
+ },
75
+ {
76
+ chain: 'ETH',
77
+ pub_key: 'thorpub1addwnpepqfyppkehky2hn2gy26y8jqyj9fz0rnvau2r7yueawzvc662w0x9s7n4ypra',
78
+ address: '0x78e4e10dcacb0a8261eb3d5e57ffb98ae8d4dff1',
79
+ router: '0x3624525075b88B24ecc29CE226b0CEc1fFcB6976',
80
+ halted: false,
81
+ gas_rate: '280'
82
+ },
83
+ {
84
+ chain: 'LTC',
85
+ pub_key: 'thorpub1addwnpepqfyppkehky2hn2gy26y8jqyj9fz0rnvau2r7yueawzvc662w0x9s7n4ypra',
86
+ address: 'ltc1qd8wsuecklw6xupyqgy8mcw4ja4dca72zw3hrla',
87
+ halted: false,
88
+ gas_rate: '60'
89
+ },
90
+ {
91
+ chain: 'TERRA',
92
+ pub_key: 'thorpub1addwnpepqfyppkehky2hn2gy26y8jqyj9fz0rnvau2r7yueawzvc662w0x9s7n4ypra',
93
+ address: 'terra1d8wsuecklw6xupyqgy8mcw4ja4dca72z6nfvpq',
94
+ halted: true,
95
+ gas_rate: '182523800'
96
+ }
97
+ ];
98
+ exports.poolResponse = [exports.btcMidgardPool, exports.ethMidgardPool, exports.foxMidgardPool];
File without changes
@@ -2,3 +2,5 @@ import { Asset } from '@shapeshiftoss/types';
2
2
  export declare const BTC: Asset;
3
3
  export declare const WETH: Asset;
4
4
  export declare const FOX: Asset;
5
+ export declare const WBTC: Asset;
6
+ export declare const ETH: Asset;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FOX = exports.WETH = exports.BTC = void 0;
3
+ exports.ETH = exports.WBTC = exports.FOX = exports.WETH = exports.BTC = void 0;
4
4
  const types_1 = require("@shapeshiftoss/types");
5
5
  exports.BTC = {
6
6
  assetId: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
@@ -44,3 +44,31 @@ exports.FOX = {
44
44
  explorerAddressLink: 'https://etherscan.io/address/',
45
45
  symbol: 'FOX'
46
46
  };
47
+ exports.WBTC = {
48
+ assetId: 'eip155:1/erc20:0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
49
+ chainId: 'eip155:1',
50
+ color: '#FFFFFF',
51
+ chain: types_1.ChainTypes.Ethereum,
52
+ explorer: 'https://etherscan.io',
53
+ explorerAddressLink: 'https://etherscan.io/address/',
54
+ explorerTxLink: 'https://etherscan.io/tx/',
55
+ icon: 'https://rawcdn.githack.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png',
56
+ name: 'Wrapped Bitcoin',
57
+ network: types_1.NetworkTypes.MAINNET,
58
+ precision: 8,
59
+ symbol: 'WBTC'
60
+ };
61
+ exports.ETH = {
62
+ assetId: 'eip155:1/slip44:60',
63
+ chainId: 'eip155:1',
64
+ chain: types_1.ChainTypes.Ethereum,
65
+ network: types_1.NetworkTypes.MAINNET,
66
+ symbol: 'ETH',
67
+ name: 'Ethereum',
68
+ precision: 18,
69
+ color: '#FFFFFF',
70
+ icon: 'https://assets.coincap.io/assets/icons/eth@2x.png',
71
+ explorer: 'https://etherscan.io',
72
+ explorerTxLink: 'https://etherscan.io/tx/',
73
+ explorerAddressLink: 'https://etherscan.io/address/'
74
+ };
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZrxApprovalNeeded = void 0;
4
4
  const caip_1 = require("@shapeshiftoss/caip");
5
5
  const api_1 = require("../../../api");
6
+ const bignumber_1 = require("../../utils/bignumber");
6
7
  const erc20Allowance_abi_1 = require("../utils/abi/erc20Allowance-abi");
7
- const bignumber_1 = require("../utils/bignumber");
8
8
  const helpers_1 = require("../utils/helpers/helpers");
9
9
  async function ZrxApprovalNeeded({ adapterManager, web3 }, { quote, wallet }) {
10
10
  var _a;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getZrxMinMax = void 0;
4
4
  const api_1 = require("../../../api");
5
- const bignumber_1 = require("../utils/bignumber");
5
+ const bignumber_1 = require("../../utils/bignumber");
6
6
  const constants_1 = require("../utils/constants");
7
7
  const helpers_1 = require("../utils/helpers/helpers");
8
8
  const getZrxMinMax = async (sellAsset, buyAsset) => {
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getZrxTradeQuote = void 0;
4
4
  const caip_1 = require("@shapeshiftoss/caip");
5
5
  const api_1 = require("../../../api");
6
+ const bignumber_1 = require("../../utils/bignumber");
6
7
  const getZrxMinMax_1 = require("../getZrxMinMax/getZrxMinMax");
7
- const bignumber_1 = require("../utils/bignumber");
8
8
  const constants_1 = require("../utils/constants");
9
9
  const helpers_1 = require("../utils/helpers/helpers");
10
10
  const zrxService_1 = require("../utils/zrxService");
@@ -4,7 +4,7 @@ exports.grantAllowance = exports.getUsdRate = exports.getAllowanceRequired = exp
4
4
  const caip_1 = require("@shapeshiftoss/caip");
5
5
  const web3_utils_1 = require("web3-utils");
6
6
  const api_1 = require("../../../../api");
7
- const bignumber_1 = require("../bignumber");
7
+ const bignumber_1 = require("../../../utils/bignumber");
8
8
  const zrxService_1 = require("../zrxService");
9
9
  /**
10
10
  * Very large amounts like those found in ERC20s with a precision of 18 get converted
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setupExecuteTrade = exports.setupBuildTrade = exports.setupZrxTradeQuoteResponse = exports.setupQuote = void 0;
4
- const assets_1 = require("./assets");
4
+ const assets_1 = require("../../../utils/test-data/assets");
5
5
  const setupQuote = () => {
6
6
  const sellAsset = { ...assets_1.FOX };
7
7
  const buyAsset = { ...assets_1.WETH };
@@ -27,9 +27,9 @@ exports.zrxBuildTrade = void 0;
27
27
  const caip_1 = require("@shapeshiftoss/caip");
28
28
  const rax = __importStar(require("retry-axios"));
29
29
  const __1 = require("../../..");
30
+ const bignumber_1 = require("../../utils/bignumber");
30
31
  const erc20Allowance_abi_1 = require("../utils/abi/erc20Allowance-abi");
31
32
  const applyAxiosRetry_1 = require("../utils/applyAxiosRetry");
32
- const bignumber_1 = require("../utils/bignumber");
33
33
  const constants_1 = require("../utils/constants");
34
34
  const helpers_1 = require("../utils/helpers/helpers");
35
35
  const zrxService_1 = require("../utils/zrxService");
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.zrxExecuteTrade = void 0;
4
4
  const web3_utils_1 = require("web3-utils");
5
5
  const api_1 = require("../../../api");
6
- const bignumber_1 = require("../utils/bignumber");
6
+ const bignumber_1 = require("../../utils/bignumber");
7
7
  async function zrxExecuteTrade({ adapterManager }, { trade, wallet }) {
8
8
  var _a, _b, _c, _d, _e, _f;
9
9
  const zrxTrade = trade;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "5.10.1",
3
+ "version": "5.12.0",
4
4
  "description": "TODO: description",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",