@shapeshiftoss/swapper 14.7.2 → 15.0.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 (42) hide show
  1. package/dist/api.d.ts +8 -8
  2. package/dist/swappercli.js +9 -11
  3. package/dist/swappers/cow/cowApprovalNeeded/cowApprovalNeeded.js +1 -1
  4. package/dist/swappers/cow/cowApprove/cowApprove.js +3 -3
  5. package/dist/swappers/cow/cowBuildTrade/cowBuildTrade.js +15 -16
  6. package/dist/swappers/cow/cowExecuteTrade/cowExecuteTrade.js +2 -2
  7. package/dist/swappers/cow/getCowSwapTradeQuote/getCowSwapTradeQuote.js +13 -15
  8. package/dist/swappers/cow/types.d.ts +2 -2
  9. package/dist/swappers/cow/utils/helpers/helpers.js +4 -4
  10. package/dist/swappers/cow/utils.js +1 -1
  11. package/dist/swappers/osmosis/OsmosisSwapper.js +16 -16
  12. package/dist/swappers/osmosis/utils/helpers.d.ts +1 -1
  13. package/dist/swappers/osmosis/utils/helpers.js +4 -4
  14. package/dist/swappers/thorchain/buildThorTrade/buildThorTrade.js +6 -6
  15. package/dist/swappers/thorchain/getThorTradeQuote/getTradeQuote.js +9 -9
  16. package/dist/swappers/thorchain/thorTradeApprovalNeeded/thorTradeApprovalNeeded.js +2 -2
  17. package/dist/swappers/thorchain/utils/bitcoin/utils/getThorTxData.d.ts +1 -1
  18. package/dist/swappers/thorchain/utils/bitcoin/utils/getThorTxData.js +2 -2
  19. package/dist/swappers/thorchain/utils/cosmos/getCosmosTxData.d.ts +1 -1
  20. package/dist/swappers/thorchain/utils/cosmos/getCosmosTxData.js +6 -6
  21. package/dist/swappers/thorchain/utils/evm/makeTradeTx.d.ts +4 -4
  22. package/dist/swappers/thorchain/utils/evm/makeTradeTx.js +6 -4
  23. package/dist/swappers/thorchain/utils/evm/utils/getThorTxData.d.ts +1 -1
  24. package/dist/swappers/thorchain/utils/evm/utils/getThorTxData.js +3 -3
  25. package/dist/swappers/thorchain/utils/getLimit/getLimit.d.ts +2 -2
  26. package/dist/swappers/thorchain/utils/getLimit/getLimit.js +3 -3
  27. package/dist/swappers/thorchain/utils/test-data/setupThorswapDeps.js +1 -1
  28. package/dist/swappers/thorchain/utils/txFeeHelpers/evmTxFees/getEvmTxFees.js +3 -3
  29. package/dist/swappers/thorchain/utils/txFeeHelpers/utxoTxFees/getUtxoTxFees.d.ts +2 -2
  30. package/dist/swappers/thorchain/utils/txFeeHelpers/utxoTxFees/getUtxoTxFees.js +3 -3
  31. package/dist/swappers/utils/helpers/helpers.d.ts +2 -2
  32. package/dist/swappers/utils/helpers/helpers.js +4 -4
  33. package/dist/swappers/utils/test-data/setupSwapQuote.d.ts +1 -1
  34. package/dist/swappers/utils/test-data/setupSwapQuote.js +5 -5
  35. package/dist/swappers/zrx/getZrxTradeQuote/getZrxTradeQuote.js +15 -15
  36. package/dist/swappers/zrx/utils/test-data/setupZrxSwapQuote.d.ts +3 -3
  37. package/dist/swappers/zrx/utils/test-data/setupZrxSwapQuote.js +3 -3
  38. package/dist/swappers/zrx/zrxApprovalNeeded/zrxApprovalNeeded.js +2 -2
  39. package/dist/swappers/zrx/zrxApprove/zrxApprove.js +1 -1
  40. package/dist/swappers/zrx/zrxBuildTrade/zrxBuildTrade.js +19 -18
  41. package/dist/swappers/zrx/zrxExecuteTrade/zrxExecuteTrade.js +4 -2
  42. package/package.json +1 -1
package/dist/api.d.ts CHANGED
@@ -28,14 +28,14 @@ export declare const SwapError: {
28
28
  declare type ChainSpecificQuoteFeeData<T extends ChainId> = ChainSpecific<T, {
29
29
  [KnownChainIds.EthereumMainnet]: {
30
30
  estimatedGas?: string;
31
- gasPrice?: string;
32
- approvalFee?: string;
31
+ gasPriceCryptoBaseUnit?: string;
32
+ approvalFeeCryptoBaseUnit?: string;
33
33
  totalFee?: string;
34
34
  };
35
35
  [KnownChainIds.AvalancheMainnet]: {
36
36
  estimatedGas?: string;
37
- gasPrice?: string;
38
- approvalFee?: string;
37
+ gasPriceCryptoBaseUnit?: string;
38
+ approvalFeeCryptoBaseUnit?: string;
39
39
  totalFee?: string;
40
40
  };
41
41
  [KnownChainIds.BitcoinMainnet]: {
@@ -59,7 +59,7 @@ declare type ChainSpecificQuoteFeeData<T extends ChainId> = ChainSpecific<T, {
59
59
  };
60
60
  }>;
61
61
  export declare type QuoteFeeData<T extends ChainId> = {
62
- networkFee: string;
62
+ networkFeeCryptoBaseUnit: string;
63
63
  buyAssetTradeFeeUsd: string;
64
64
  sellAssetTradeFeeUsd?: string;
65
65
  } & ChainSpecificQuoteFeeData<T>;
@@ -77,7 +77,7 @@ export declare type SupportedSellAssetsInput = {
77
77
  declare type CommonTradeInput = {
78
78
  sellAsset: Asset;
79
79
  buyAsset: Asset;
80
- sellAmountCryptoPrecision: string;
80
+ sellAmountBeforeFeesCryptoBaseUnit: string;
81
81
  sendMax: boolean;
82
82
  receiveAddress: string;
83
83
  bip44Params: BIP44Params;
@@ -105,8 +105,8 @@ export declare type BuildTradeInput = GetTradeQuoteInput & {
105
105
  wallet: HDWallet;
106
106
  };
107
107
  interface TradeBase<C extends ChainId> {
108
- buyAmountCryptoPrecision: string;
109
- sellAmountCryptoPrecision: string;
108
+ buyAmountCryptoBaseUnit: string;
109
+ sellAmountBeforeFeesCryptoBaseUnit: string;
110
110
  feeData: QuoteFeeData<C>;
111
111
  rate: string;
112
112
  sources: SwapSource[];
@@ -14,6 +14,7 @@ const web3_1 = __importDefault(require("web3"));
14
14
  const adapters_1 = require("./adapters");
15
15
  const manager_1 = require("./manager");
16
16
  const swappers_1 = require("./swappers");
17
+ const bignumber_1 = require("./swappers/utils/bignumber");
17
18
  dotenv_1.default.config();
18
19
  const { ETH_NODE_URL = 'http://localhost:3000', MIDGARD_URL = 'https://dev-indexer.thorchain.shapeshift.com/v2', DEVICE_ID = 'device123', MNEMONIC = 'all all all all all all all all all all all all', } = process.env;
19
20
  const toBaseUnit = (amount, precision) => {
@@ -21,9 +22,6 @@ const toBaseUnit = (amount, precision) => {
21
22
  .multipliedBy(new bignumber_js_1.default(10).exponentiatedBy(new bignumber_js_1.default(precision)))
22
23
  .toString();
23
24
  };
24
- const fromBaseUnit = (amount, precision) => {
25
- return new bignumber_js_1.default(amount).times(new bignumber_js_1.default(10).exponentiatedBy(precision * -1)).toString();
26
- };
27
25
  const getWallet = async () => {
28
26
  if (!MNEMONIC) {
29
27
  throw new Error('Cannot init native wallet without mnemonic');
@@ -38,9 +36,9 @@ const getWallet = async () => {
38
36
  };
39
37
  const main = async () => {
40
38
  const [, , ...args] = process.argv;
41
- const [sellSymbol, buySymbol, sellAmount] = args;
42
- console.info(`sell ${sellAmount} of ${sellSymbol} to ${buySymbol}`);
43
- if (!sellAmount || !sellSymbol || !buySymbol) {
39
+ const [sellSymbol, buySymbol, sellAmountBeforeFeesCryptoPrecision] = args;
40
+ console.info(`sell ${sellAmountBeforeFeesCryptoPrecision} of ${sellSymbol} to ${buySymbol}`);
41
+ if (!sellAmountBeforeFeesCryptoPrecision || !sellSymbol || !buySymbol) {
44
42
  console.error(`
45
43
  Usage:
46
44
  swapcli [sellSymbol] [buySymbol] [sellAmount](denominated in sell asset, not wei)
@@ -129,7 +127,7 @@ const main = async () => {
129
127
  }
130
128
  publicKey = await sellAdapter.getPublicKey(wallet, bip44Params, utxoAccountType);
131
129
  }
132
- const sellAmountBase = toBaseUnit(sellAmount, sellAsset.precision);
130
+ const sellAmountBeforeFeesCryptoBaseUnit = toBaseUnit(sellAmountBeforeFeesCryptoPrecision, sellAsset.precision);
133
131
  const buyAssetReceiveAddr = await buyAdapter.getAddress({
134
132
  wallet,
135
133
  accountType: utxoAccountType,
@@ -142,7 +140,7 @@ const main = async () => {
142
140
  chainId: sellAsset.chainId,
143
141
  sellAsset,
144
142
  buyAsset,
145
- sellAmountCryptoPrecision: sellAmountBase,
143
+ sellAmountBeforeFeesCryptoBaseUnit,
146
144
  sendMax: false,
147
145
  accountType: utxoAccountType || chain_adapters_1.bitcoin.ChainAdapter.defaultUtxoAccountType,
148
146
  bip44Params,
@@ -158,15 +156,15 @@ const main = async () => {
158
156
  console.warn('no quote returned');
159
157
  return;
160
158
  }
161
- const buyAmount = fromBaseUnit(quote.buyAmountCryptoPrecision || '0', buyAsset.precision);
162
- const answer = readline_sync_1.default.question(`Swap ${sellAmount} ${sellAsset.symbol} for ${buyAmount} ${buyAsset.symbol} on ${swapper.getType()}? (y/n): `);
159
+ const buyAmountCryptoPrecision = (0, bignumber_1.fromBaseUnit)(quote.buyAmountCryptoBaseUnit || '0', buyAsset.precision);
160
+ const answer = readline_sync_1.default.question(`Swap ${sellAmountBeforeFeesCryptoPrecision} ${sellAsset.symbol} for ${buyAmountCryptoPrecision} ${buyAsset.symbol} on ${swapper.getType()}? (y/n): `);
163
161
  if (answer === 'y') {
164
162
  const trade = await swapper.buildTrade({
165
163
  chainId: sellAsset.chainId,
166
164
  wallet,
167
165
  buyAsset,
168
166
  sendMax: false,
169
- sellAmountCryptoPrecision: sellAmountBase,
167
+ sellAmountBeforeFeesCryptoBaseUnit,
170
168
  sellAsset,
171
169
  receiveAddress: buyAssetReceiveAddr,
172
170
  accountType: utxoAccountType || chain_adapters_1.bitcoin.ChainAdapter.defaultUtxoAccountType,
@@ -27,7 +27,7 @@ async function cowApprovalNeeded({ adapter, web3 }, { quote, wallet }) {
27
27
  });
28
28
  const allowanceOnChain = (0, bignumber_1.bnOrZero)(allowanceResult);
29
29
  return {
30
- approvalNeeded: allowanceOnChain.lt((0, bignumber_1.bnOrZero)(quote.sellAmountCryptoPrecision)),
30
+ approvalNeeded: allowanceOnChain.lt((0, bignumber_1.bnOrZero)(quote.sellAmountBeforeFeesCryptoBaseUnit)),
31
31
  };
32
32
  }
33
33
  catch (e) {
@@ -10,7 +10,7 @@ async function cowApproveInfinite({ adapter, web3 }, { quote, wallet }) {
10
10
  const allowanceGrantRequired = await (0, helpers_1.grantAllowance)({
11
11
  quote: {
12
12
  ...quote,
13
- sellAmountCryptoPrecision: constants_1.MAX_ALLOWANCE,
13
+ sellAmountBeforeFeesCryptoBaseUnit: constants_1.MAX_ALLOWANCE,
14
14
  },
15
15
  wallet,
16
16
  adapter,
@@ -31,11 +31,11 @@ async function cowApproveInfinite({ adapter, web3 }, { quote, wallet }) {
31
31
  exports.cowApproveInfinite = cowApproveInfinite;
32
32
  async function cowApproveAmount({ adapter, web3 }, { quote, wallet, amount }) {
33
33
  try {
34
- const approvalAmount = amount !== null && amount !== void 0 ? amount : quote.sellAmountCryptoPrecision;
34
+ const approvalAmount = amount !== null && amount !== void 0 ? amount : quote.sellAmountBeforeFeesCryptoBaseUnit;
35
35
  const allowanceGrantRequired = await (0, helpers_1.grantAllowance)({
36
36
  quote: {
37
37
  ...quote,
38
- sellAmountCryptoPrecision: approvalAmount,
38
+ sellAmountBeforeFeesCryptoBaseUnit: approvalAmount,
39
39
  },
40
40
  wallet,
41
41
  adapter,
@@ -12,7 +12,7 @@ const cowService_1 = require("../utils/cowService");
12
12
  const helpers_2 = require("../utils/helpers/helpers");
13
13
  async function cowBuildTrade(deps, input) {
14
14
  try {
15
- const { sellAsset, buyAsset, sellAmountCryptoPrecision, bip44Params, wallet } = input;
15
+ const { sellAsset, buyAsset, sellAmountBeforeFeesCryptoBaseUnit: sellAmountExcludeFeeCryptoBaseUnit, bip44Params, wallet, } = input;
16
16
  const { adapter, web3 } = deps;
17
17
  const { assetReference: sellAssetErc20Address, assetNamespace: sellAssetNamespace } = (0, caip_1.fromAssetId)(sellAsset.assetId);
18
18
  const { assetReference: buyAssetErc20Address, chainId: buyAssetChainId } = (0, caip_1.fromAssetId)(buyAsset.assetId);
@@ -30,7 +30,6 @@ async function cowBuildTrade(deps, input) {
30
30
  }
31
31
  const buyToken = buyAsset.assetId !== caip_1.ethAssetId ? buyAssetErc20Address : constants_1.COW_SWAP_ETH_MARKER_ADDRESS;
32
32
  const receiveAddress = await adapter.getAddress({ wallet, bip44Params });
33
- const normalizedSellAmount = (0, helpers_1.normalizeAmount)(sellAmountCryptoPrecision);
34
33
  /**
35
34
  * /v1/quote
36
35
  * params: {
@@ -54,17 +53,17 @@ async function cowBuildTrade(deps, input) {
54
53
  partiallyFillable: false,
55
54
  from: receiveAddress,
56
55
  kind: constants_1.ORDER_KIND_SELL,
57
- sellAmountBeforeFee: normalizedSellAmount,
56
+ sellAmountBeforeFee: sellAmountExcludeFeeCryptoBaseUnit,
58
57
  });
59
- const { data: { quote }, } = quoteResponse;
58
+ const { data: { quote: { buyAmount: buyAmountCryptoBaseUnit, sellAmount: quoteSellAmountExcludeFeeCryptoBaseUnit, feeAmount: feeAmountInSellTokenCryptoBaseUnit, }, }, } = quoteResponse;
60
59
  const sellAssetUsdRate = await (0, helpers_2.getUsdRate)(deps, sellAsset);
61
- const sellAssetTradeFeeUsd = (0, bignumber_1.bnOrZero)(quote.feeAmount)
60
+ const sellAssetTradeFeeUsd = (0, bignumber_1.bnOrZero)(feeAmountInSellTokenCryptoBaseUnit)
62
61
  .div((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision))
63
62
  .multipliedBy((0, bignumber_1.bnOrZero)(sellAssetUsdRate))
64
63
  .toString();
65
- const buyCryptoAmount = (0, bignumber_1.bn)(quote.buyAmount).div((0, bignumber_1.bn)(10).exponentiatedBy(buyAsset.precision));
66
- const sellCryptoAmount = (0, bignumber_1.bn)(quote.sellAmount).div((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision));
67
- const rate = buyCryptoAmount.div(sellCryptoAmount).toString();
64
+ const buyAmountCryptoPrecision = (0, bignumber_1.bn)(buyAmountCryptoBaseUnit).div((0, bignumber_1.bn)(10).exponentiatedBy(buyAsset.precision));
65
+ const quoteSellAmountCryptoPrecision = (0, bignumber_1.bn)(quoteSellAmountExcludeFeeCryptoBaseUnit).div((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision));
66
+ const rate = buyAmountCryptoPrecision.div(quoteSellAmountCryptoPrecision).toString();
68
67
  const data = (0, helpers_1.getApproveContractData)({
69
68
  web3,
70
69
  spenderAddress: constants_1.COW_SWAP_VAULT_RELAYER_ADDRESS,
@@ -79,35 +78,35 @@ async function cowBuildTrade(deps, input) {
79
78
  const trade = {
80
79
  rate,
81
80
  feeData: {
82
- networkFee: '0',
81
+ networkFeeCryptoBaseUnit: '0',
83
82
  chainSpecific: {
84
83
  estimatedGas: feeData.chainSpecific.gasLimit,
85
- gasPrice: feeData.chainSpecific.gasPrice,
84
+ gasPriceCryptoBaseUnit: feeData.chainSpecific.gasPrice,
86
85
  },
87
86
  buyAssetTradeFeeUsd: '0',
88
87
  sellAssetTradeFeeUsd,
89
88
  },
90
- sellAmountCryptoPrecision: normalizedSellAmount,
91
- buyAmountCryptoPrecision: quote.buyAmount,
89
+ sellAmountBeforeFeesCryptoBaseUnit: sellAmountExcludeFeeCryptoBaseUnit,
90
+ buyAmountCryptoBaseUnit,
92
91
  sources: constants_1.DEFAULT_SOURCE,
93
92
  buyAsset,
94
93
  sellAsset,
95
94
  bip44Params,
96
95
  receiveAddress,
97
- feeAmountInSellToken: quote.feeAmount,
98
- sellAmountWithoutFee: quote.sellAmount,
96
+ feeAmountInSellTokenCryptoBaseUnit,
97
+ sellAmountDeductFeeCryptoBaseUnit: quoteSellAmountExcludeFeeCryptoBaseUnit,
99
98
  };
100
99
  const approvalRequired = await (0, helpers_1.isApprovalRequired)({
101
100
  adapter,
102
101
  sellAsset,
103
102
  allowanceContract: constants_1.COW_SWAP_VAULT_RELAYER_ADDRESS,
104
103
  receiveAddress,
105
- sellAmount: quote.sellAmount,
104
+ sellAmountExcludeFeeCryptoBaseUnit,
106
105
  web3: deps.web3,
107
106
  erc20AllowanceAbi: erc20Allowance_abi_1.erc20AllowanceAbi,
108
107
  });
109
108
  if (approvalRequired) {
110
- trade.feeData.chainSpecific.approvalFee = (0, bignumber_1.bnOrZero)(feeData.chainSpecific.gasLimit)
109
+ trade.feeData.chainSpecific.approvalFeeCryptoBaseUnit = (0, bignumber_1.bnOrZero)(feeData.chainSpecific.gasLimit)
111
110
  .multipliedBy((0, bignumber_1.bnOrZero)(feeData.chainSpecific.gasPrice))
112
111
  .toString();
113
112
  }
@@ -11,7 +11,7 @@ const cowService_1 = require("../utils/cowService");
11
11
  const helpers_1 = require("../utils/helpers/helpers");
12
12
  async function cowExecuteTrade({ apiUrl, adapter }, { trade, wallet }) {
13
13
  const cowTrade = trade;
14
- const { sellAsset, buyAsset, feeAmountInSellToken, sellAmountWithoutFee } = cowTrade;
14
+ const { sellAsset, buyAsset, feeAmountInSellTokenCryptoBaseUnit: feeAmountInSellToken, sellAmountDeductFeeCryptoBaseUnit: sellAmountWithoutFee, } = cowTrade;
15
15
  const { assetReference: sellAssetErc20Address, assetNamespace: sellAssetNamespace } = (0, caip_1.fromAssetId)(sellAsset.assetId);
16
16
  const { assetReference: buyAssetErc20Address, chainId: buyAssetChainId } = (0, caip_1.fromAssetId)(buyAsset.assetId);
17
17
  if (sellAssetNamespace !== 'erc20') {
@@ -32,7 +32,7 @@ async function cowExecuteTrade({ apiUrl, adapter }, { trade, wallet }) {
32
32
  sellToken: sellAssetErc20Address,
33
33
  buyToken,
34
34
  sellAmount: sellAmountWithoutFee,
35
- buyAmount: trade.buyAmountCryptoPrecision,
35
+ buyAmount: trade.buyAmountCryptoBaseUnit,
36
36
  validTo: (0, helpers_1.getNowPlusThirtyMinutesTimestamp)(),
37
37
  appData: constants_1.DEFAULT_APP_DATA,
38
38
  feeAmount: feeAmountInSellToken,
@@ -17,7 +17,7 @@ const helpers_2 = require("../utils/helpers/helpers");
17
17
  async function getCowSwapTradeQuote(deps, input) {
18
18
  var _a, _b;
19
19
  try {
20
- const { sellAsset, buyAsset, sellAmountCryptoPrecision, bip44Params, receiveAddress } = input;
20
+ const { sellAsset, buyAsset, sellAmountBeforeFeesCryptoBaseUnit, bip44Params, receiveAddress } = input;
21
21
  const { adapter, web3 } = deps;
22
22
  const { assetReference: sellAssetErc20Address, assetNamespace: sellAssetNamespace } = (0, caip_1.fromAssetId)(sellAsset.assetId);
23
23
  const { assetReference: buyAssetErc20Address, chainId: buyAssetChainId } = (0, caip_1.fromAssetId)(buyAsset.assetId);
@@ -37,9 +37,9 @@ async function getCowSwapTradeQuote(deps, input) {
37
37
  const { minimum, maximum } = await (0, getCowSwapMinMax_1.getCowSwapMinMax)(deps, sellAsset, buyAsset);
38
38
  const minQuoteSellAmount = (0, bignumber_1.bnOrZero)(minimum).times((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision));
39
39
  // making sure we do not have decimals for cowswap api (can happen at least from minQuoteSellAmount)
40
- const normalizedSellAmount = (0, helpers_1.normalizeIntegerAmount)((0, bignumber_1.bnOrZero)(sellAmountCryptoPrecision).lt(minQuoteSellAmount)
40
+ const normalizedSellAmount = (0, helpers_1.normalizeIntegerAmount)((0, bignumber_1.bnOrZero)(sellAmountBeforeFeesCryptoBaseUnit).lt(minQuoteSellAmount)
41
41
  ? minQuoteSellAmount
42
- : sellAmountCryptoPrecision);
42
+ : sellAmountBeforeFeesCryptoBaseUnit);
43
43
  const apiInput = {
44
44
  sellToken: sellAssetErc20Address,
45
45
  buyToken,
@@ -66,10 +66,8 @@ async function getCowSwapTradeQuote(deps, input) {
66
66
  * }
67
67
  */
68
68
  const quoteResponse = await cowService_1.cowService.post(`${deps.apiUrl}/v1/quote/`, apiInput);
69
- const { data: { quote }, } = quoteResponse;
70
- const buyCryptoAmount = (0, bignumber_1.bn)(quote.buyAmount).div((0, bignumber_1.bn)(10).exponentiatedBy(buyAsset.precision));
71
- const sellCryptoAmount = (0, bignumber_1.bn)(quote.sellAmount).div((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision));
72
- const rate = buyCryptoAmount.div(sellCryptoAmount).toString();
69
+ const { data: { quote: { buyAmount: buyAmountCryptoBaseUnit, sellAmount: sellAmountCryptoBaseUnit, feeAmount: feeAmountInSellTokenCryptoBaseUnit, }, }, } = quoteResponse;
70
+ const rate = (0, bignumber_1.bn)(buyAmountCryptoBaseUnit).div(sellAmountCryptoBaseUnit).toString();
73
71
  const data = (0, helpers_1.getApproveContractData)({
74
72
  web3,
75
73
  spenderAddress: constants_1.COW_SWAP_VAULT_RELAYER_ADDRESS,
@@ -83,34 +81,34 @@ async function getCowSwapTradeQuote(deps, input) {
83
81
  }),
84
82
  (0, helpers_2.getUsdRate)(deps, sellAsset),
85
83
  ]);
86
- const sellAssetTradeFeeUsd = (0, bignumber_1.bnOrZero)(quote.feeAmount)
84
+ const sellAssetTradeFeeUsd = (0, bignumber_1.bnOrZero)(feeAmountInSellTokenCryptoBaseUnit)
87
85
  .div((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision))
88
86
  .multipliedBy((0, bignumber_1.bnOrZero)(sellAssetUsdRate))
89
87
  .toString();
90
88
  const feeData = feeDataOptions['fast'];
91
89
  // If original sellAmount is < minQuoteSellAmount, we don't want to replace it with normalizedSellAmount
92
90
  // The purpose of this was to get a quote from CowSwap even with small amounts
93
- const quoteSellAmount = (0, bignumber_1.bnOrZero)(sellAmountCryptoPrecision).lt(minQuoteSellAmount)
94
- ? sellAmountCryptoPrecision
91
+ const quoteSellAmount = (0, bignumber_1.bnOrZero)(sellAmountCryptoBaseUnit).lt(minQuoteSellAmount)
92
+ ? sellAmountBeforeFeesCryptoBaseUnit
95
93
  : normalizedSellAmount;
96
94
  return {
97
95
  rate,
98
96
  minimumCryptoHuman: minimum,
99
97
  maximum,
100
98
  feeData: {
101
- networkFee: '0',
99
+ networkFeeCryptoBaseUnit: '0',
102
100
  chainSpecific: {
103
101
  estimatedGas: feeData.chainSpecific.gasLimit,
104
- gasPrice: feeData.chainSpecific.gasPrice,
105
- approvalFee: (0, bignumber_1.bnOrZero)(feeData.chainSpecific.gasLimit)
102
+ gasPriceCryptoBaseUnit: feeData.chainSpecific.gasPrice,
103
+ approvalFeeCryptoBaseUnit: (0, bignumber_1.bnOrZero)(feeData.chainSpecific.gasLimit)
106
104
  .multipliedBy((0, bignumber_1.bnOrZero)(feeData.chainSpecific.gasPrice))
107
105
  .toString(),
108
106
  },
109
107
  buyAssetTradeFeeUsd: '0',
110
108
  sellAssetTradeFeeUsd,
111
109
  },
112
- sellAmountCryptoPrecision: quoteSellAmount,
113
- buyAmountCryptoPrecision: quote.buyAmount,
110
+ sellAmountBeforeFeesCryptoBaseUnit: quoteSellAmount,
111
+ buyAmountCryptoBaseUnit,
114
112
  sources: constants_1.DEFAULT_SOURCE,
115
113
  allowanceContract: constants_1.COW_SWAP_VAULT_RELAYER_ADDRESS,
116
114
  buyAsset,
@@ -24,6 +24,6 @@ export declare type CowSwapGetTradesElement = {
24
24
  };
25
25
  export declare type CowSwapGetTradesResponse = CowSwapGetTradesElement[];
26
26
  export interface CowTrade<C extends ChainId> extends Trade<C> {
27
- feeAmountInSellToken: string;
28
- sellAmountWithoutFee: string;
27
+ feeAmountInSellTokenCryptoBaseUnit: string;
28
+ sellAmountDeductFeeCryptoBaseUnit: string;
29
29
  }
@@ -75,14 +75,14 @@ const getUsdRate = async ({ apiUrl }, input) => {
75
75
  * }
76
76
  */
77
77
  const quoteResponse = await cowService_1.cowService.post(`${apiUrl}/v1/quote/`, apiInput);
78
- const { data: { quote }, } = quoteResponse;
79
- const sellCryptoAmount = (0, bignumber_1.bn)(quote.sellAmount).div((0, bignumber_1.bn)(10).exponentiatedBy(asset.precision));
80
- if (!sellCryptoAmount.gt(0))
78
+ const { data: { quote: { sellAmount: sellAmountCryptoBaseUnit }, }, } = quoteResponse;
79
+ const sellAmountCryptoPrecision = (0, bignumber_1.bn)(sellAmountCryptoBaseUnit).div((0, bignumber_1.bn)(10).exponentiatedBy(asset.precision));
80
+ if (!sellAmountCryptoPrecision.gt(0))
81
81
  throw new api_1.SwapError('[getUsdRate] - Failed to get sell token amount', {
82
82
  code: api_1.SwapErrorTypes.RESPONSE_ERROR,
83
83
  });
84
84
  // dividing $1000 by amount of sell token received
85
- return (0, bignumber_1.bn)(buyAmountInDollars).div(sellCryptoAmount).toString();
85
+ return (0, bignumber_1.bn)(buyAmountInDollars).div(sellAmountCryptoPrecision).toString();
86
86
  }
87
87
  catch (e) {
88
88
  if (e instanceof api_1.SwapError)
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isCowTrade = void 0;
4
- const isCowTrade = (trade) => Boolean(trade.feeAmountInSellToken);
4
+ const isCowTrade = (trade) => Boolean(trade.feeAmountInSellTokenCryptoBaseUnit);
5
5
  exports.isCowTrade = isCowTrade;
@@ -87,15 +87,15 @@ class OsmosisSwapper {
87
87
  return this.supportedAssetIds;
88
88
  }
89
89
  async buildTrade(args) {
90
- const { sellAsset, buyAsset, sellAmountCryptoPrecision, receiveAddress, bip44Params } = args;
91
- if (!sellAmountCryptoPrecision) {
90
+ const { sellAsset, buyAsset, sellAmountBeforeFeesCryptoBaseUnit: sellAmountCryptoBaseUnit, receiveAddress, bip44Params, } = args;
91
+ if (!sellAmountCryptoBaseUnit) {
92
92
  throw new api_1.SwapError('sellAmountCryptoPrecision is required', {
93
93
  code: api_1.SwapErrorTypes.BUILD_TRADE_FAILED,
94
94
  });
95
95
  }
96
- const { buyAssetTradeFeeUsd, rate, buyAmount } = await (0, helpers_1.getRateInfo)(sellAsset.symbol, buyAsset.symbol, sellAmountCryptoPrecision !== '0' ? sellAmountCryptoPrecision : '1', this.deps.osmoUrl);
96
+ const { buyAssetTradeFeeUsd, rate, buyAmountCryptoBaseUnit } = await (0, helpers_1.getRateInfo)(sellAsset.symbol, buyAsset.symbol, sellAmountCryptoBaseUnit !== '0' ? sellAmountCryptoBaseUnit : '1', this.deps.osmoUrl);
97
97
  //convert amount to base
98
- const sellAmountCryptoBase = String((0, bignumber_1.bnOrZero)(sellAmountCryptoPrecision).dp(0));
98
+ const sellAmountCryptoBase = String((0, bignumber_1.bnOrZero)(sellAmountCryptoBaseUnit).dp(0));
99
99
  const osmosisAdapter = this.deps.adapterManager.get(caip_1.osmosisChainId);
100
100
  if (!osmosisAdapter)
101
101
  throw new api_1.SwapError('Failed to get Osmosis adapter', {
@@ -104,29 +104,29 @@ class OsmosisSwapper {
104
104
  const feeData = await osmosisAdapter.getFeeData({});
105
105
  const fee = feeData.fast.txFee;
106
106
  return {
107
- buyAmountCryptoPrecision: buyAmount,
107
+ buyAmountCryptoBaseUnit,
108
108
  buyAsset,
109
109
  feeData: {
110
- networkFee: fee,
110
+ networkFeeCryptoBaseUnit: fee,
111
111
  sellAssetTradeFeeUsd: '0',
112
112
  buyAssetTradeFeeUsd,
113
113
  },
114
114
  rate,
115
115
  receiveAddress,
116
- sellAmountCryptoPrecision: sellAmountCryptoBase,
116
+ sellAmountBeforeFeesCryptoBaseUnit: sellAmountCryptoBase,
117
117
  sellAsset,
118
118
  bip44Params,
119
119
  sources: [{ name: api_1.SwapperName.Osmosis, proportion: '100' }],
120
120
  };
121
121
  }
122
122
  async getTradeQuote(input) {
123
- const { bip44Params, sellAsset, buyAsset, sellAmountCryptoPrecision } = input;
124
- if (!sellAmountCryptoPrecision) {
123
+ const { bip44Params, sellAsset, buyAsset, sellAmountBeforeFeesCryptoBaseUnit: sellAmountCryptoBaseUnit, } = input;
124
+ if (!sellAmountCryptoBaseUnit) {
125
125
  throw new api_1.SwapError('sellAmount is required', {
126
126
  code: api_1.SwapErrorTypes.RESPONSE_ERROR,
127
127
  });
128
128
  }
129
- const { buyAssetTradeFeeUsd, rate, buyAmount } = await (0, helpers_1.getRateInfo)(sellAsset.symbol, buyAsset.symbol, sellAmountCryptoPrecision !== '0' ? sellAmountCryptoPrecision : '1', this.deps.osmoUrl);
129
+ const { buyAssetTradeFeeUsd, rate, buyAmountCryptoBaseUnit } = await (0, helpers_1.getRateInfo)(sellAsset.symbol, buyAsset.symbol, sellAmountCryptoBaseUnit !== '0' ? sellAmountCryptoBaseUnit : '1', this.deps.osmoUrl);
130
130
  const { minimum, maximum } = await this.getMinMax(input);
131
131
  const osmosisAdapter = this.deps.adapterManager.get(caip_1.osmosisChainId);
132
132
  if (!osmosisAdapter)
@@ -138,7 +138,7 @@ class OsmosisSwapper {
138
138
  return {
139
139
  buyAsset,
140
140
  feeData: {
141
- networkFee: fee,
141
+ networkFeeCryptoBaseUnit: fee,
142
142
  sellAssetTradeFeeUsd: '0',
143
143
  buyAssetTradeFeeUsd,
144
144
  },
@@ -147,14 +147,14 @@ class OsmosisSwapper {
147
147
  bip44Params,
148
148
  rate,
149
149
  sellAsset,
150
- sellAmountCryptoPrecision,
151
- buyAmountCryptoPrecision: buyAmount,
150
+ sellAmountBeforeFeesCryptoBaseUnit: sellAmountCryptoBaseUnit,
151
+ buyAmountCryptoBaseUnit,
152
152
  sources: constants_1.DEFAULT_SOURCE,
153
153
  allowanceContract: '',
154
154
  };
155
155
  }
156
156
  async executeTrade({ trade, wallet }) {
157
- const { sellAsset, buyAsset, sellAmountCryptoPrecision, bip44Params, receiveAddress } = trade;
157
+ const { sellAsset, buyAsset, sellAmountBeforeFeesCryptoBaseUnit: sellAmountCryptoBaseUnit, bip44Params, receiveAddress, } = trade;
158
158
  const isFromOsmo = sellAsset.assetId === caip_1.osmosisAssetId;
159
159
  const sellAssetDenom = helpers_1.symbolDenomMapping[sellAsset.symbol];
160
160
  const buyAssetDenom = helpers_1.symbolDenomMapping[buyAsset.symbol];
@@ -179,7 +179,7 @@ class OsmosisSwapper {
179
179
  const transfer = {
180
180
  sender: sellAddress,
181
181
  receiver: receiveAddress,
182
- amount: sellAmountCryptoPrecision,
182
+ amount: sellAmountCryptoBaseUnit,
183
183
  };
184
184
  const responseAccount = await cosmosAdapter.getAccount(sellAddress);
185
185
  const accountNumber = responseAccount.chainSpecific.accountNumber || '0';
@@ -211,7 +211,7 @@ class OsmosisSwapper {
211
211
  adapter: osmosisAdapter,
212
212
  buyAssetDenom,
213
213
  sellAssetDenom,
214
- sellAmount: ibcSellAmount !== null && ibcSellAmount !== void 0 ? ibcSellAmount : sellAmountCryptoPrecision,
214
+ sellAmount: ibcSellAmount !== null && ibcSellAmount !== void 0 ? ibcSellAmount : sellAmountCryptoBaseUnit,
215
215
  gas,
216
216
  wallet,
217
217
  });
@@ -19,7 +19,7 @@ export declare const getRateInfo: (sellAsset: string, buyAsset: string, sellAmou
19
19
  rate: string;
20
20
  priceImpact: string;
21
21
  buyAssetTradeFeeUsd: string;
22
- buyAmount: string;
22
+ buyAmountCryptoBaseUnit: string;
23
23
  }>;
24
24
  export declare const performIbcTransfer: (input: IbcTransferInput, adapter: CosmosSdkSupportedChainAdapters, wallet: HDWallet, blockBaseUrl: string, denom: string, sourceChannel: string, feeAmount: string, accountNumber: string, sequence: string, gas: string, feeDenom: string) => Promise<TradeResult>;
25
25
  export declare const buildTradeTx: ({ osmoAddress, adapter, buyAssetDenom, sellAssetDenom, sellAmount, gas, wallet, }: {
@@ -141,10 +141,10 @@ const getInfoFromPool = (sellAmount, pool, sellAssetIndex, buyAssetIndex) => {
141
141
  const sellAssetFinalPoolSize = sellAssetInitialPoolSize.plus(sellAmount);
142
142
  const buyAssetFinalPoolSize = constantProduct.dividedBy(sellAssetFinalPoolSize);
143
143
  const finalMarketPrice = sellAssetFinalPoolSize.dividedBy(buyAssetFinalPoolSize);
144
- const buyAmount = buyAssetInitialPoolSize.minus(buyAssetFinalPoolSize).toString();
145
- const rate = (0, bignumber_1.bnOrZero)(buyAmount).dividedBy(sellAmount).toString();
144
+ const buyAmountCryptoBaseUnit = buyAssetInitialPoolSize.minus(buyAssetFinalPoolSize).toString();
145
+ const rate = (0, bignumber_1.bnOrZero)(buyAmountCryptoBaseUnit).dividedBy(sellAmount).toString();
146
146
  const priceImpact = (0, bignumber_1.bn)(1).minus(initialMarketPrice.dividedBy(finalMarketPrice)).abs().toString();
147
- const tradeFeeBase = (0, bignumber_1.bnOrZero)(buyAmount).times((0, bignumber_1.bnOrZero)(pool.pool_params.swap_fee));
147
+ const tradeFeeBase = (0, bignumber_1.bnOrZero)(buyAmountCryptoBaseUnit).times((0, bignumber_1.bnOrZero)(pool.pool_params.swap_fee));
148
148
  const buyAssetTradeFeeUsd = tradeFeeBase
149
149
  .dividedBy((0, bignumber_1.bn)(10).exponentiatedBy(constants_1.OSMOSIS_PRECISION))
150
150
  .toString();
@@ -152,7 +152,7 @@ const getInfoFromPool = (sellAmount, pool, sellAssetIndex, buyAssetIndex) => {
152
152
  rate,
153
153
  priceImpact,
154
154
  buyAssetTradeFeeUsd,
155
- buyAmount,
155
+ buyAmountCryptoBaseUnit,
156
156
  };
157
157
  };
158
158
  const getRateInfo = async (sellAsset, buyAsset, sellAmount, osmoUrl) => {
@@ -12,7 +12,7 @@ const makeTradeTx_1 = require("../utils/evm/makeTradeTx");
12
12
  const buildTrade = async ({ deps, input }) => {
13
13
  var _a, _b, _c, _d;
14
14
  try {
15
- const { buyAsset, receiveAddress: destinationAddress, sellAmountCryptoPrecision, sellAsset, bip44Params, slippage: slippageTolerance = constants_1.DEFAULT_SLIPPAGE, wallet, sendMax, } = input;
15
+ const { buyAsset, receiveAddress: destinationAddress, sellAmountBeforeFeesCryptoBaseUnit: sellAmountCryptoBaseUnit, sellAsset, bip44Params, slippage: slippageTolerance = constants_1.DEFAULT_SLIPPAGE, wallet, sendMax, } = input;
16
16
  const quote = await (0, getTradeQuote_1.getThorTradeQuote)({ deps, input });
17
17
  const sellAdapter = deps.adapterManager.get(sellAsset.chainId);
18
18
  if (!sellAdapter)
@@ -30,10 +30,10 @@ const buildTrade = async ({ deps, input }) => {
30
30
  sellAsset,
31
31
  buyAsset,
32
32
  adapter: sellAdapter,
33
- sellAmountCryptoPrecision,
33
+ sellAmountCryptoBaseUnit,
34
34
  destinationAddress,
35
35
  deps,
36
- gasPrice: (_b = (_a = quote.feeData.chainSpecific) === null || _a === void 0 ? void 0 : _a.gasPrice) !== null && _b !== void 0 ? _b : '0',
36
+ gasPriceCryptoBaseUnit: (_b = (_a = quote.feeData.chainSpecific) === null || _a === void 0 ? void 0 : _a.gasPriceCryptoBaseUnit) !== null && _b !== void 0 ? _b : '0',
37
37
  gasLimit: (_d = (_c = quote.feeData.chainSpecific) === null || _c === void 0 ? void 0 : _c.estimatedGas) !== null && _d !== void 0 ? _d : '0',
38
38
  buyAssetTradeFeeUsd: quote.feeData.buyAssetTradeFeeUsd,
39
39
  });
@@ -49,14 +49,14 @@ const buildTrade = async ({ deps, input }) => {
49
49
  deps,
50
50
  sellAsset,
51
51
  buyAsset,
52
- sellAmountCryptoPrecision,
52
+ sellAmountCryptoBaseUnit,
53
53
  slippageTolerance,
54
54
  destinationAddress,
55
55
  xpub: input.xpub,
56
56
  buyAssetTradeFeeUsd: quote.feeData.buyAssetTradeFeeUsd,
57
57
  });
58
58
  const buildTxResponse = await sellAdapter.buildSendTransaction({
59
- value: sellAmountCryptoPrecision,
59
+ value: sellAmountCryptoBaseUnit,
60
60
  wallet,
61
61
  to: vault,
62
62
  bip44Params: input.bip44Params,
@@ -83,7 +83,7 @@ const buildTrade = async ({ deps, input }) => {
83
83
  bip44Params,
84
84
  deps,
85
85
  sellAdapter: sellAdapter,
86
- sellAmountCryptoPrecision,
86
+ sellAmountCryptoBaseUnit,
87
87
  sellAsset,
88
88
  slippageTolerance,
89
89
  chainId: input.chainId,
@@ -16,7 +16,7 @@ const getEvmTxFees_1 = require("../utils/txFeeHelpers/evmTxFees/getEvmTxFees");
16
16
  const getUtxoTxFees_1 = require("../utils/txFeeHelpers/utxoTxFees/getUtxoTxFees");
17
17
  const getSlippage_1 = require("./getSlippage");
18
18
  const getThorTradeQuote = async ({ deps, input }) => {
19
- const { sellAsset, buyAsset, sellAmountCryptoPrecision, bip44Params, chainId, receiveAddress, sendMax, } = input;
19
+ const { sellAsset, buyAsset, sellAmountBeforeFeesCryptoBaseUnit: sellAmountCryptoBaseUnit, bip44Params, chainId, receiveAddress, sendMax, } = input;
20
20
  if (!bip44Params) {
21
21
  throw new Error('bip44Params required in getThorTradeQuote');
22
22
  }
@@ -30,10 +30,10 @@ const getThorTradeQuote = async ({ deps, input }) => {
30
30
  code: api_1.SwapErrorTypes.UNSUPPORTED_CHAIN,
31
31
  details: { sellAssetChainId: chainId, buyAssetChainId },
32
32
  });
33
- const rate = await (0, getTradeRate_1.getTradeRate)(sellAsset, buyAsset.assetId, sellAmountCryptoPrecision, deps);
34
- const buyAmountCryptoPrecision = (0, bignumber_1.toBaseUnit)((0, bignumber_1.bnOrZero)((0, bignumber_1.fromBaseUnit)(sellAmountCryptoPrecision, sellAsset.precision)).times(rate), buyAsset.precision);
33
+ const rate = await (0, getTradeRate_1.getTradeRate)(sellAsset, buyAsset.assetId, sellAmountCryptoBaseUnit, deps);
34
+ const buyAmountCryptoBaseUnit = (0, bignumber_1.toBaseUnit)((0, bignumber_1.bnOrZero)((0, bignumber_1.fromBaseUnit)(sellAmountCryptoBaseUnit, sellAsset.precision)).times(rate), buyAsset.precision);
35
35
  const buyAssetAddressData = await (0, getInboundAddressDataForChain_1.getInboundAddressDataForChain)(deps.daemonUrl, buyAsset.assetId);
36
- const sellAmountThorPrecision = (0, bignumber_1.toBaseUnit)((0, bignumber_1.fromBaseUnit)(sellAmountCryptoPrecision, sellAsset.precision), constants_3.THORCHAIN_FIXED_PRECISION);
36
+ const sellAmountThorPrecision = (0, bignumber_1.toBaseUnit)((0, bignumber_1.fromBaseUnit)(sellAmountCryptoBaseUnit, sellAsset.precision), constants_3.THORCHAIN_FIXED_PRECISION);
37
37
  const recommendedSlippage = await (0, getSlippage_1.getSlippage)({
38
38
  inputAmountThorPrecision: (0, bignumber_1.bn)(sellAmountThorPrecision),
39
39
  daemonUrl: deps.daemonUrl,
@@ -60,8 +60,8 @@ const getThorTradeQuote = async ({ deps, input }) => {
60
60
  const commonQuoteFields = {
61
61
  rate,
62
62
  maximum: constants_3.MAX_THORCHAIN_TRADE,
63
- sellAmountCryptoPrecision,
64
- buyAmountCryptoPrecision,
63
+ sellAmountBeforeFeesCryptoBaseUnit: sellAmountCryptoBaseUnit,
64
+ buyAmountCryptoBaseUnit,
65
65
  sources: [{ name: api_1.SwapperName.Thorchain, proportion: '1' }],
66
66
  buyAsset,
67
67
  sellAsset,
@@ -95,14 +95,14 @@ const getThorTradeQuote = async ({ deps, input }) => {
95
95
  deps,
96
96
  sellAsset,
97
97
  buyAsset,
98
- sellAmountCryptoPrecision,
98
+ sellAmountCryptoBaseUnit,
99
99
  slippageTolerance: constants_1.DEFAULT_SLIPPAGE,
100
100
  destinationAddress: receiveAddress,
101
101
  xpub: input.xpub,
102
102
  buyAssetTradeFeeUsd,
103
103
  });
104
104
  const feeData = await (0, getUtxoTxFees_1.getUtxoTxFees)({
105
- sellAmountCryptoPrecision,
105
+ sellAmountCryptoBaseUnit,
106
106
  vault,
107
107
  opReturnData,
108
108
  pubkey,
@@ -123,7 +123,7 @@ const getThorTradeQuote = async ({ deps, input }) => {
123
123
  ...commonQuoteFields,
124
124
  allowanceContract: '0x0',
125
125
  feeData: {
126
- networkFee: feeData.fast.txFee,
126
+ networkFeeCryptoBaseUnit: feeData.fast.txFee,
127
127
  buyAssetTradeFeeUsd,
128
128
  sellAssetTradeFeeUsd: '0',
129
129
  chainSpecific: { estimatedGas: feeData.fast.chainSpecific.gasLimit },
@@ -41,13 +41,13 @@ const thorTradeApprovalNeeded = async ({ deps, input, }) => {
41
41
  ownerAddress: receiveAddress,
42
42
  });
43
43
  const allowanceOnChain = (0, bignumber_1.bnOrZero)(allowanceResult);
44
- if (!((_a = quote.feeData.chainSpecific) === null || _a === void 0 ? void 0 : _a.gasPrice))
44
+ if (!((_a = quote.feeData.chainSpecific) === null || _a === void 0 ? void 0 : _a.gasPriceCryptoBaseUnit))
45
45
  throw new api_1.SwapError('[thorTradeApprovalNeeded] - no gas price with quote', {
46
46
  code: api_1.SwapErrorTypes.RESPONSE_ERROR,
47
47
  details: { feeData: quote.feeData },
48
48
  });
49
49
  return {
50
- approvalNeeded: allowanceOnChain.lt((0, bignumber_1.bnOrZero)(quote.sellAmountCryptoPrecision)),
50
+ approvalNeeded: allowanceOnChain.lt((0, bignumber_1.bnOrZero)(quote.sellAmountBeforeFeesCryptoBaseUnit)),
51
51
  };
52
52
  }
53
53
  catch (e) {
@@ -4,7 +4,7 @@ declare type GetBtcThorTxInfoArgs = {
4
4
  deps: ThorchainSwapperDeps;
5
5
  sellAsset: Asset;
6
6
  buyAsset: Asset;
7
- sellAmountCryptoPrecision: string;
7
+ sellAmountCryptoBaseUnit: string;
8
8
  slippageTolerance: string;
9
9
  destinationAddress: string;
10
10
  xpub: string;