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

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