@depay/widgets 7.5.0 → 7.5.1

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.
package/dist/esm/index.js CHANGED
@@ -20115,9 +20115,9 @@ var PaymentValueProvider = (function (props) {
20115
20115
 
20116
20116
  Promise.all([route({
20117
20117
  blockchain: payment.route.blockchain,
20118
- tokenIn: payment.route.toToken.address,
20118
+ tokenIn: payment.route.fromToken.address,
20119
20119
  tokenOut: CONSTANTS[payment.route.blockchain].USD,
20120
- amountIn: payment.route.toAmount,
20120
+ amountIn: payment.route.fromAmount,
20121
20121
  fromAddress: account,
20122
20122
  toAddress: account
20123
20123
  }), !payment.route.directTransfer ? route({
@@ -20132,11 +20132,11 @@ var PaymentValueProvider = (function (props) {
20132
20132
  address: CONSTANTS[payment.route.blockchain].USD
20133
20133
  }).decimals()]).then(function (_ref2) {
20134
20134
  var _ref3 = _slicedToArray(_ref2, 3),
20135
- toTokenUSDExchangeRoutes = _ref3[0],
20135
+ fromTokenUSDExchangeRoutes = _ref3[0],
20136
20136
  reverseRoutes = _ref3[1],
20137
20137
  USDDecimals = _ref3[2];
20138
20138
 
20139
- var toTokenUSDRoute = toTokenUSDExchangeRoutes[0];
20139
+ var fromTokenUSDRoute = fromTokenUSDExchangeRoutes[0];
20140
20140
  var reverseRoute = reverseRoutes[0];
20141
20141
 
20142
20142
  if (reverseRoute) {
@@ -20151,20 +20151,20 @@ var PaymentValueProvider = (function (props) {
20151
20151
  }
20152
20152
  }
20153
20153
 
20154
- var toTokenUSDAmount;
20154
+ var fromTokenUSDAmount;
20155
20155
 
20156
- if (payment.route.toToken.address.toLowerCase() == CONSTANTS[payment.route.blockchain].USD.toLowerCase()) {
20157
- toTokenUSDAmount = payment.route.toAmount.toString();
20158
- } else if (toTokenUSDRoute == undefined) {
20156
+ if (payment.route.fromToken.address.toLowerCase() == CONSTANTS[payment.route.blockchain].USD.toLowerCase()) {
20157
+ fromTokenUSDAmount = payment.route.fromAmount.toString();
20158
+ } else if (fromTokenUSDRoute == undefined) {
20159
20159
  setPaymentValue('');
20160
20160
  return;
20161
20161
  } else {
20162
- toTokenUSDAmount = toTokenUSDRoute.amountOut.toString();
20162
+ fromTokenUSDAmount = fromTokenUSDRoute.amountOut.toString();
20163
20163
  }
20164
20164
 
20165
- var toTokenUSDValue = ethers.utils.formatUnits(toTokenUSDAmount, USDDecimals);
20165
+ var fromTokenUSDValue = ethers.utils.formatUnits(fromTokenUSDAmount, USDDecimals);
20166
20166
  Currency.fromUSD({
20167
- amount: toTokenUSDValue,
20167
+ amount: fromTokenUSDValue,
20168
20168
  code: currency
20169
20169
  }).then(setPaymentValue);
20170
20170
  })["catch"](setError);
@@ -20767,12 +20767,12 @@ var Footer = (function () {
20767
20767
 
20768
20768
  if (amount && configuredAmount && configuredAmount.currency && configuredAmount.fix) {
20769
20769
  displayedAmount = paymentValue.toString();
20770
- } else if (amount && (configuredAmount == undefined || configuredAmount.token != true)) {
20770
+ } else if (amount && (configuredAmount == undefined || (configuredAmount === null || configuredAmount === void 0 ? void 0 : configuredAmount.token) != true)) {
20771
20771
  displayedAmount = new Currency({
20772
20772
  amount: amount.toFixed(2),
20773
20773
  code: currencyCode
20774
20774
  }).toString();
20775
- } else if (paymentValue && paymentValue.toString().length) {
20775
+ } else if (paymentValue && paymentValue.toString().length && (configuredAmount === null || configuredAmount === void 0 ? void 0 : configuredAmount.token) != true) {
20776
20776
  displayedAmount = paymentValue.toString();
20777
20777
  } else {
20778
20778
  displayedAmount = "".concat(payment.symbol, " ").concat(payment.amount);