@shapeshiftoss/swapper 4.0.3 → 4.0.4

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.
@@ -45,7 +45,7 @@ async function getZrxTradeQuote(input) {
45
45
  });
46
46
  const { data } = quoteResponse;
47
47
  const estimatedGas = (0, bignumber_1.bnOrZero)(data.estimatedGas).times(1.5);
48
- const rate = useSellAmount ? data.price : (0, bignumber_1.bnOrZero)(1).div(data.price).toString();
48
+ const rate = useSellAmount ? data.price : (0, bignumber_1.bn)(1).div(data.price).toString();
49
49
  return {
50
50
  success: true,
51
51
  statusReason: '',
@@ -27,7 +27,7 @@ const getERC20Allowance = async ({ erc20AllowanceAbi, web3, tokenId, ownerAddres
27
27
  exports.getERC20Allowance = getERC20Allowance;
28
28
  const getAllowanceRequired = async ({ receiveAddress, allowanceContract, sellAsset, sellAmount, web3, erc20AllowanceAbi }) => {
29
29
  if (sellAsset.symbol === 'ETH') {
30
- return (0, bignumber_1.bnOrZero)(0);
30
+ return (0, bignumber_1.bn)(0);
31
31
  }
32
32
  const ownerAddress = receiveAddress;
33
33
  const spenderAddress = allowanceContract;
@@ -49,7 +49,7 @@ const getAllowanceRequired = async ({ receiveAddress, allowanceContract, sellAss
49
49
  throw new api_1.SwapError(`No allowance data for ${allowanceContract} to ${receiveAddress}`);
50
50
  }
51
51
  const allowanceRequired = (0, bignumber_1.bnOrZero)(sellAmount).minus(allowanceOnChain);
52
- return allowanceRequired.lt(0) ? (0, bignumber_1.bnOrZero)(0) : allowanceRequired;
52
+ return allowanceRequired.lt(0) ? (0, bignumber_1.bn)(0) : allowanceRequired;
53
53
  };
54
54
  exports.getAllowanceRequired = getAllowanceRequired;
55
55
  const getUsdRate = async (input) => {
@@ -66,7 +66,7 @@ const getUsdRate = async (input) => {
66
66
  const price = (0, bignumber_1.bnOrZero)(rateResponse.data.price);
67
67
  if (!price.gt(0))
68
68
  throw new ZrxSwapper_1.ZrxError('getUsdRate - Failed to get price data');
69
- return (0, bignumber_1.bnOrZero)(1).dividedBy(price).toString();
69
+ return (0, bignumber_1.bn)(1).dividedBy(price).toString();
70
70
  };
71
71
  exports.getUsdRate = getUsdRate;
72
72
  const grantAllowance = async ({ quote, wallet, adapter, erc20Abi, web3 }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "TODO: description",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",