@uniswap/router-sdk 2.0.2 → 2.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.
@@ -8,11 +8,11 @@ var sdkCore = require('@uniswap/sdk-core');
8
8
  var JSBI = _interopDefault(require('jsbi'));
9
9
  var abi = require('@ethersproject/abi');
10
10
  var invariant = _interopDefault(require('tiny-invariant'));
11
- var IApproveAndCall_json = require('@uniswap/swap-router-contracts/artifacts/contracts/interfaces/IApproveAndCall.sol/IApproveAndCall.json');
11
+ var IApproveAndCall = _interopDefault(require('@uniswap/swap-router-contracts/artifacts/contracts/interfaces/IApproveAndCall.sol/IApproveAndCall.json'));
12
12
  var v3Sdk = require('@uniswap/v3-sdk');
13
- var IMulticallExtended_json = require('@uniswap/swap-router-contracts/artifacts/contracts/interfaces/IMulticallExtended.sol/IMulticallExtended.json');
14
- var IPeripheryPaymentsWithFeeExtended_json = require('@uniswap/swap-router-contracts/artifacts/contracts/interfaces/IPeripheryPaymentsWithFeeExtended.sol/IPeripheryPaymentsWithFeeExtended.json');
15
- var ISwapRouter02_json = require('@uniswap/swap-router-contracts/artifacts/contracts/interfaces/ISwapRouter02.sol/ISwapRouter02.json');
13
+ var IMulticallExtended = _interopDefault(require('@uniswap/swap-router-contracts/artifacts/contracts/interfaces/IMulticallExtended.sol/IMulticallExtended.json'));
14
+ var IPeripheryPaymentsWithFeeExtended = _interopDefault(require('@uniswap/swap-router-contracts/artifacts/contracts/interfaces/IPeripheryPaymentsWithFeeExtended.sol/IPeripheryPaymentsWithFeeExtended.json'));
15
+ var ISwapRouter02 = _interopDefault(require('@uniswap/swap-router-contracts/artifacts/contracts/interfaces/ISwapRouter02.sol/ISwapRouter02.json'));
16
16
  var v2Sdk = require('@uniswap/v2-sdk');
17
17
  var v4Sdk = require('@uniswap/v4-sdk');
18
18
  var solidity = require('@ethersproject/solidity');
@@ -129,7 +129,7 @@ var ApproveAndCall = /*#__PURE__*/function () {
129
129
  };
130
130
  return ApproveAndCall;
131
131
  }();
132
- ApproveAndCall.INTERFACE = /*#__PURE__*/new abi.Interface(IApproveAndCall_json.abi);
132
+ ApproveAndCall.INTERFACE = /*#__PURE__*/new abi.Interface(IApproveAndCall.abi);
133
133
 
134
134
  function validateAndParseBytes32(bytes32) {
135
135
  if (!bytes32.match(/^0x[0-9a-fA-F]{64}$/)) {
@@ -162,7 +162,7 @@ var MulticallExtended = /*#__PURE__*/function () {
162
162
  };
163
163
  return MulticallExtended;
164
164
  }();
165
- MulticallExtended.INTERFACE = /*#__PURE__*/new abi.Interface(IMulticallExtended_json.abi);
165
+ MulticallExtended.INTERFACE = /*#__PURE__*/new abi.Interface(IMulticallExtended.abi);
166
166
 
167
167
  function encodeFeeBips(fee) {
168
168
  return v3Sdk.toHex(fee.multiply(10000).quotient);
@@ -206,7 +206,7 @@ var PaymentsExtended = /*#__PURE__*/function () {
206
206
  };
207
207
  return PaymentsExtended;
208
208
  }();
209
- PaymentsExtended.INTERFACE = /*#__PURE__*/new abi.Interface(IPeripheryPaymentsWithFeeExtended_json.abi);
209
+ PaymentsExtended.INTERFACE = /*#__PURE__*/new abi.Interface(IPeripheryPaymentsWithFeeExtended.abi);
210
210
 
211
211
  function _arrayLikeToArray(r, a) {
212
212
  (null == a || a > r.length) && (a = r.length);
@@ -1875,10 +1875,11 @@ var Trade = /*#__PURE__*/function () {
1875
1875
  * Converts a route to a hex encoded path
1876
1876
  * @notice only supports exactIn route encodings
1877
1877
  * @param route the mixed path to convert to an encoded path
1878
+ * @param useMixedRouterQuoteV2 if true, uses the Mixed Quoter V2 encoding for v4 pools. By default, we do not set it. This is only used in SOR for explicit setting during onchain quoting.
1878
1879
  * @returns the exactIn encoded path
1879
1880
  */
1880
- function encodeMixedRouteToPath(route) {
1881
- var containsV4Pool = route.pools.some(function (pool) {
1881
+ function encodeMixedRouteToPath(route, useMixedRouterQuoteV2) {
1882
+ var containsV4Pool = useMixedRouterQuoteV2 != null ? useMixedRouterQuoteV2 : route.pools.some(function (pool) {
1882
1883
  return pool instanceof v4Sdk.Pool;
1883
1884
  });
1884
1885
  var path;
@@ -2425,7 +2426,7 @@ var SwapRouter = /*#__PURE__*/function () {
2425
2426
  };
2426
2427
  return SwapRouter;
2427
2428
  }();
2428
- SwapRouter.INTERFACE = /*#__PURE__*/new abi.Interface(ISwapRouter02_json.abi);
2429
+ SwapRouter.INTERFACE = /*#__PURE__*/new abi.Interface(ISwapRouter02.abi);
2429
2430
 
2430
2431
  exports.ADDRESS_THIS = ADDRESS_THIS;
2431
2432
  exports.ADDRESS_ZERO = ADDRESS_ZERO;