@ring-protocol/universal-router-sdk 0.1.27 → 0.1.28

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.
@@ -969,9 +969,7 @@ function addRingV2Swap(planner, _ref, tradeType, options, payerIsUser, routerMus
969
969
  return token.wrapped.address;
970
970
  }), payerIsUser]);
971
971
  }
972
- console.log('before fewOutputToken 375', trade.outputAmount.currency.wrapped, trade.outputAmount.currency.chainId);
973
972
  var fewOutputToken = fewV2Sdk.getFewTokenFromOriginalToken(trade.outputAmount.currency.wrapped, trade.outputAmount.currency.chainId);
974
- console.log('after fewOutputToken380', fewOutputToken, trade.outputAmount.currency.wrapped, trade.outputAmount.currency.chainId);
975
973
  var fwWETH = FEW_WRAPPED_NATIVE_CURRENCY[trade.inputAmount.currency.wrapped.chainId];
976
974
  if (outputAmount.currency.isNative) {
977
975
  planner.addCommand(exports.CommandType.UNWRAP_FEW_TOKEN, [fwWETH.address, ROUTER_AS_RECIPIENT, trade.minimumAmountOut(options.slippageTolerance).quotient.toString()]);
@@ -1012,9 +1010,7 @@ function addV2Swap(planner, _ref2, tradeType, options, payerIsUser, routerMustCu
1012
1010
  return token.wrapped.address;
1013
1011
  }), payerIsUser]);
1014
1012
  }
1015
- console.log('before fewOutputToken 460', trade.outputAmount.currency.wrapped, trade.outputAmount.currency.chainId);
1016
1013
  var fewOutputToken = fewV2Sdk.getFewTokenFromOriginalToken(trade.outputAmount.currency.wrapped, trade.outputAmount.currency.chainId);
1017
- console.log('after fewOutputToken465', fewOutputToken, trade.outputAmount.currency.wrapped, trade.outputAmount.currency.chainId);
1018
1014
  if (fewV2Sdk.isFewToken(pathInput.wrapped) && fewV2Sdk.isFewToken(pathOutput.wrapped)) {
1019
1015
  if (outputAmount.currency.isNative) {
1020
1016
  planner.addCommand(exports.CommandType.UNWRAP_FEW_TOKEN, [fewOutputToken.address, ROUTER_AS_RECIPIENT, trade.minimumAmountOut(options.slippageTolerance).quotient.toString()]);
@@ -1100,6 +1096,8 @@ function addV4Swap(swaps, planner, _ref4, tradeType, options, payerIsUser, route
1100
1096
  outputAmount = _ref4.outputAmount,
1101
1097
  route = _ref4.route;
1102
1098
  // create a deep copy of pools since v4Planner encoding tampers with array
1099
+ var fewCurrencyIn = fewV2Sdk.getFewTokenFromOriginalToken(inputAmount.currency.wrapped, inputAmount.currency.chainId);
1100
+ var fewCurrencyOut = fewV2Sdk.getFewTokenFromOriginalToken(outputAmount.currency.wrapped, outputAmount.currency.chainId);
1103
1101
  var firstSwap = swaps[0];
1104
1102
  var lastSwap = swaps[swaps.length - 1];
1105
1103
  var pathInput = route.path[0];
@@ -1110,9 +1108,6 @@ function addV4Swap(swaps, planner, _ref4, tradeType, options, payerIsUser, route
1110
1108
  var v4Route = new v4Sdk.Route(pools, inputAmount.currency, outputAmount.currency);
1111
1109
  if (fewV2Sdk.isFewToken(route.pools[0].token0.wrapped) && fewV2Sdk.isFewToken(route.pools[0].token1.wrapped)) {
1112
1110
  var _options$recipient;
1113
- console.log('isFewToken v4 633', fewV2Sdk.isFewToken(route.pools[0].token0.wrapped), fewV2Sdk.isFewToken(route.pools[0].token1.wrapped));
1114
- var fewCurrencyIn = fewV2Sdk.getFewTokenFromOriginalToken(inputAmount.currency.wrapped, inputAmount.currency.chainId);
1115
- var fewCurrencyOut = fewV2Sdk.getFewTokenFromOriginalToken(outputAmount.currency.wrapped, outputAmount.currency.chainId);
1116
1111
  var fewV4Route = new v4Sdk.Route(pools, fewCurrencyIn, fewCurrencyOut);
1117
1112
  var fewTrade = v4Sdk.Trade.createUncheckedTrade({
1118
1113
  route: fewV4Route,
@@ -1149,7 +1144,6 @@ function addV4Swap(swaps, planner, _ref4, tradeType, options, payerIsUser, route
1149
1144
  }
1150
1145
  } else {
1151
1146
  var _options$recipient2;
1152
- console.log('isFewToken v4 701', fewV2Sdk.isFewToken(route.pools[0].token0.wrapped), fewV2Sdk.isFewToken(route.pools[0].token1.wrapped));
1153
1147
  var trade = v4Sdk.Trade.createUncheckedTrade({
1154
1148
  route: v4Route,
1155
1149
  inputAmount: inputAmount,