@depay/widgets 6.9.0 → 6.11.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.
package/dist/esm/index.js CHANGED
@@ -1678,7 +1678,7 @@ var ButtonPrimaryStyle = (function (style) {
1678
1678
  });
1679
1679
 
1680
1680
  var CardStyle = (function (style) {
1681
- return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n .Card.Row {\n border-radius: 0;\n margin-bottom: 0;\n box-shadow: none;\n min-height: 4.3rem;\n padding: 0.4rem 1.3rem;\n border-top: 1px solid rgba(0,0,0,0.05);\n }\n\n .Card.Row .CardText {\n font-size: 1.2rem;\n }\n\n .CardTokenSymbol {\n width: 40%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .CardTokenName {\n text-align: right;\n opacity: 0.5;\n width: 60%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n \n .Card.Row .CardTokenName .CardText {\n font-size: 1rem;\n }\n\n .Card.Row .CardImage {\n width: 2.5rem;\n }\n\n .Card.Row .CardImage img {\n height: 1.9rem;\n width: 1.9rem;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.transparent {\n background: none;\n box-shadow: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.5rem 0.5rem;\n margin: 0;\n }\n\n .CardImage.small {\n width: 1.7rem;\n }\n\n .CardImage.small img {\n height: 1.4rem;\n width: 1.4rem;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 0.4rem;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n width: 3.6rem;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 1.4rem;\n padding-left: 0.6rem;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 2.8rem;\n position: relative;\n vertical-align: middle;\n width: 2.8rem;\n }\n\n .CardImage img.transparent {\n border: none;\n background: none;\n box-shadow: none;\n }\n \n .CardImage .BlockchainLogo {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .CardTitle {\n font-size: 0.9rem;\n color: rgb(150,150,150);\n }\n \n .CardText, a .CardText {\n color: ".concat(style.colors.text, ";\n flex: 1;\n font-size: 1.3rem;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText small {\n font-size: 1.26rem;\n color: rgb(150,150,150);\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ");
1681
+ return "\n\n .Card {\n align-items: center;\n background: rgb(255,255,255);\n border-radius: 0.8rem;\n box-shadow: 0 0 8px rgba(0,0,0,0.03);\n cursor: pointer;\n display: flex;\n flex-direction: row;\n margin-bottom: 0.5rem;\n min-height: 4.78rem;\n padding: 1rem 0.6rem;\n width: 100%;\n }\n\n .Card.Row {\n border-radius: 0;\n margin-bottom: 0;\n box-shadow: none;\n min-height: 4.3rem;\n padding: 0.4rem 1.3rem;\n border-top: 1px solid rgba(0,0,0,0.05);\n }\n\n .Card.Row .CardText {\n font-size: 1.2rem;\n }\n\n .CardTokenSymbol {\n width: 40%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .CardTokenName {\n text-align: right;\n opacity: 0.5;\n width: 60%;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n \n .Card.Row .CardTokenName .CardText {\n font-size: 1rem;\n }\n\n .Card.Row .CardImage {\n width: 2.5rem;\n }\n\n .Card.Row .CardImage img {\n height: 1.9rem;\n width: 1.9rem;\n }\n\n a.Card, a.Card * {\n color: inherit;\n text-decoration: none;\n }\n\n .Card.transparent {\n background: none;\n box-shadow: none;\n }\n\n .Card.small {\n min-height: auto;\n padding: 0.5rem 0.5rem;\n margin: 0;\n }\n\n .CardImage.small {\n width: 1.7rem;\n }\n\n .CardImage.small img {\n height: 1.4rem;\n width: 1.4rem;\n }\n\n .Card.disabled {\n cursor: default;\n }\n\n .Card:hover:not(.disabled) {\n background: rgb(240,240,240);\n box-shadow: 0 0 0 rgba(0,0,0,0); \n }\n\n .Card:active:not(.disabled) {\n background: rgb(235,235,235);\n box-shadow: inset 0 0 6px rgba(0,0,0,0.02);\n color: inherit;\n }\n\n .Card:hover:not(.disabled) .CardAction {\n opacity: 0.4;\n }\n\n .CardImage, .CardBody, .CardAction, .CardInfo {\n align-items: center;\n display: flex;\n min-width: 0;\n padding: 0 0.4rem;\n }\n\n .CardImage {\n flex-basis: auto;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n position: relative;\n width: 3.6rem;\n }\n\n .CardBody {\n flex-basis: auto;\n flex-grow: 1;\n flex-shrink: 1;\n line-height: 1.4rem;\n padding-left: 0.6rem;\n text-align: left;\n }\n\n .CardBodyWrapper {\n min-width: 0;\n }\n\n .CardAction {\n flex-basis: auto;\n flex-shrink: 0;\n flex-grow: 0;\n padding-right: 0;\n margin-left: auto;\n }\n\n .Card.disabled .CardAction {\n opacity: 0; \n }\n\n .CardInfo {\n display: flex;\n flex-basis: auto;\n flex-direction: column;\n flex-grow: 0;\n flex-shrink: 1;\n justify-content: center;\n margin-left: auto; \n padding-right: 0;\n }\n\n .CardImage img {\n background: white;\n border-radius: 99rem;\n border: 1px solid white;\n box-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n height: 2.8rem;\n position: relative;\n vertical-align: middle;\n width: 2.8rem;\n }\n\n .CardImage img.transparent {\n border: none;\n background: none;\n box-shadow: none;\n }\n \n .CardImage .BlockchainLogo {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .CardTitle {\n font-size: 0.9rem;\n color: rgb(150,150,150);\n }\n \n .CardText, a .CardText {\n color: ".concat(style.colors.text, ";\n flex: 1;\n font-size: 1.3rem;\n }\n\n .CardText strong {\n font-weight: 500;\n }\n\n .CardText small {\n font-size: 1.1rem;\n color: rgb(150,150,150);\n }\n\n .CardAction {\n opacity: 0.2;\n }\n\n .Card.More {\n display: inline-block;\n text-align: center;\n }\n ");
1682
1682
  });
1683
1683
 
1684
1684
  var DialogStyle = (function (style) {
@@ -2032,7 +2032,7 @@ var ChangableAmountProvider = (function (props) {
2032
2032
  account = _useContext.account;
2033
2033
 
2034
2034
  var _useContext2 = useContext(ConfigurationContext),
2035
- configuredAmount = _useContext2.amount;
2035
+ amountConfiguration = _useContext2.amount;
2036
2036
 
2037
2037
  var _useContext3 = useContext(ConversionRateContext),
2038
2038
  conversionRate = _useContext3.conversionRate;
@@ -2045,7 +2045,7 @@ var ChangableAmountProvider = (function (props) {
2045
2045
  acceptWithAmount = _useState4[0],
2046
2046
  setAcceptWithAmount = _useState4[1];
2047
2047
 
2048
- var _useState5 = useState(amountsMissing ? _typeof(configuredAmount) == "object" && configuredAmount.start ? configuredAmount.start : 1 : null),
2048
+ var _useState5 = useState(amountsMissing ? _typeof(amountConfiguration) == "object" && amountConfiguration.start ? amountConfiguration.start : 1 : null),
2049
2049
  _useState6 = _slicedToArray(_useState5, 2),
2050
2050
  amount = _useState6[0],
2051
2051
  setAmount = _useState6[1];
@@ -2063,51 +2063,83 @@ var ChangableAmountProvider = (function (props) {
2063
2063
  useEffect(function () {
2064
2064
  setAmountsMissing(configurationsMissAmounts(props.accept));
2065
2065
  }, [props.accept]);
2066
- useEffect(function () {
2067
- if (amountsMissing && account && conversionRate) {
2068
- Promise.all(props.accept.map(function (configuration) {
2069
- return route({
2070
- blockchain: configuration.blockchain,
2071
- tokenIn: CONSTANTS[configuration.blockchain].USD,
2072
- amountIn: 1.00 / conversionRate * amount,
2073
- tokenOut: configuration.token,
2074
- fromAddress: account,
2075
- toAddress: account
2076
- });
2077
- })).then(function (routes) {
2078
- Promise.all(routes.map(function (routes, index) {
2079
- if (routes[0] == undefined) {
2080
- return;
2081
- }
2082
2066
 
2083
- return Token.readable({
2084
- blockchain: props.accept[index].blockchain,
2085
- amount: routes[0].amountOut,
2086
- address: routes[0].tokenOut
2067
+ var getAmounts = function getAmounts() {
2068
+ return new Promise(function (resolve, reject) {
2069
+ if (amountConfiguration && amountConfiguration.token) {
2070
+ resolve(props.accept.map(function () {
2071
+ return amount;
2072
+ }));
2073
+ } else {
2074
+ Promise.all(props.accept.map(function (configuration) {
2075
+ return route({
2076
+ blockchain: configuration.blockchain,
2077
+ tokenIn: CONSTANTS[configuration.blockchain].USD,
2078
+ amountIn: 1.00 / conversionRate * amount,
2079
+ tokenOut: configuration.token,
2080
+ fromAddress: account,
2081
+ toAddress: account
2087
2082
  });
2088
- })).then(function (amounts) {
2089
- setAcceptWithAmount(props.accept.map(function (configuration, index) {
2090
- if (amounts[index] == undefined) {
2083
+ })).then(function (routes) {
2084
+ Promise.all(routes.map(function (routes, index) {
2085
+ if (routes[0] == undefined) {
2091
2086
  return;
2092
2087
  }
2093
2088
 
2094
- return {
2095
- blockchain: configuration.blockchain,
2096
- amount: round(amounts[index]),
2097
- token: configuration.token,
2098
- receiver: configuration.receiver || account
2099
- };
2100
- }).filter(function (configuration) {
2101
- return !!configuration;
2102
- }));
2089
+ return Token.readable({
2090
+ blockchain: props.accept[index].blockchain,
2091
+ amount: routes[0].amountOut,
2092
+ address: routes[0].tokenOut
2093
+ });
2094
+ })).then(resolve)["catch"](setError);
2103
2095
  })["catch"](setError);
2096
+ }
2097
+ });
2098
+ };
2099
+
2100
+ useEffect(function () {
2101
+ if (amountsMissing && account && conversionRate) {
2102
+ getAmounts().then(function (amounts) {
2103
+ setAcceptWithAmount(props.accept.map(function (configuration, index) {
2104
+ if (amounts[index] == undefined) {
2105
+ return;
2106
+ }
2107
+
2108
+ return {
2109
+ blockchain: configuration.blockchain,
2110
+ amount: round(amounts[index]),
2111
+ token: configuration.token,
2112
+ receiver: configuration.receiver || account
2113
+ };
2114
+ }).filter(function (configuration) {
2115
+ return !!configuration;
2116
+ }));
2104
2117
  })["catch"](setError);
2105
2118
  }
2106
- }, [account, conversionRate, amount]);
2119
+ }, [amountsMissing, account, conversionRate, amount]);
2107
2120
  useEffect(function () {
2108
2121
  if (amountsMissing && maxRoute) {
2109
2122
  maxRoute.fromToken.readable(maxRoute.fromBalance).then(function (readableMaxAmount) {
2110
- if (maxRoute.fromToken.address == CONSTANTS[maxRoute.blockchain].USD) {
2123
+ if (amountConfiguration && amountConfiguration.token) {
2124
+ route({
2125
+ blockchain: maxRoute.blockchain,
2126
+ tokenIn: maxRoute.fromToken.address,
2127
+ tokenOut: maxRoute.toToken.address,
2128
+ amountIn: parseFloat(readableMaxAmount),
2129
+ fromAddress: account,
2130
+ toAddress: account
2131
+ }).then(function (routes) {
2132
+ Token.readable({
2133
+ amount: routes[0].amountOut,
2134
+ blockchain: maxRoute.blockchain,
2135
+ address: maxRoute.toToken.address
2136
+ }).then(function (readableMaxAmount) {
2137
+ var slippage = 1.01;
2138
+ var maxAmount = parseFloat(new Decimal(readableMaxAmount).div(slippage).mul(conversionRate).toString());
2139
+ setMaxAmount(maxAmount > 10 ? Math.round(maxAmount) : round(maxAmount));
2140
+ })["catch"](setError);
2141
+ })["catch"](setError);
2142
+ } else if (maxRoute.fromToken.address == CONSTANTS[maxRoute.blockchain].USD) {
2111
2143
  var _maxAmount = parseFloat(new Decimal(readableMaxAmount).mul(conversionRate).toString());
2112
2144
 
2113
2145
  setMaxAmount(_maxAmount > 10 ? Math.round(_maxAmount) : _maxAmount);
@@ -2505,6 +2537,7 @@ var PaymentRoutingProvider = (function (props) {
2505
2537
  whitelist: props.whitelist,
2506
2538
  blacklist: props.blacklist,
2507
2539
  event: props.event,
2540
+ fee: props.fee,
2508
2541
  apiKey: apiKey
2509
2542
  }).then(function (routes) {
2510
2543
  if (routes.length == 0) {
@@ -2779,13 +2812,14 @@ var ChangeAmountDialog = (function (props) {
2779
2812
 
2780
2813
  var _useContext5 = useContext(ConfigurationContext),
2781
2814
  currencyCode = _useContext5.currencyCode,
2782
- configuredAmount = _useContext5.amount;
2815
+ amountConfiguration = _useContext5.amount;
2783
2816
 
2784
2817
  var _useContext6 = useContext(PaymentRoutingContext);
2785
2818
  _useContext6.allRoutes;
2786
2819
 
2787
- var min = _typeof(configuredAmount) == "object" && configuredAmount.min ? configuredAmount.min : 1;
2788
- var step = _typeof(configuredAmount) == "object" && configuredAmount.step ? configuredAmount.step : 1;
2820
+ var min = _typeof(amountConfiguration) == "object" && amountConfiguration.min ? amountConfiguration.min : 1;
2821
+ var step = _typeof(amountConfiguration) == "object" && amountConfiguration.step ? amountConfiguration.step : 1;
2822
+ var displayedCurrencyCode = amountConfiguration != undefined && amountConfiguration.token ? null : currencyCode;
2789
2823
 
2790
2824
  var changeAmountAndGoBack = function changeAmountAndGoBack() {
2791
2825
  setAmount(toValidValue(parseFloat(inputAmount)));
@@ -2827,7 +2861,7 @@ var ChangeAmountDialog = (function (props) {
2827
2861
  className: "LineHeightL FontSizeL TextCenter"
2828
2862
  }, "Change Amount"), /*#__PURE__*/React.createElement("div", {
2829
2863
  className: "FontSizeL TextCenter FontWeightBold"
2830
- }, /*#__PURE__*/React.createElement("strong", null, currencyCode))),
2864
+ }, /*#__PURE__*/React.createElement("strong", null, displayedCurrencyCode))),
2831
2865
  body: /*#__PURE__*/React.createElement("div", {
2832
2866
  className: "MaxHeight PaddingTopXS"
2833
2867
  }, /*#__PURE__*/React.createElement("div", {
@@ -3130,7 +3164,8 @@ var LoadingText = (function (props) {
3130
3164
 
3131
3165
  var Footer = (function () {
3132
3166
  var _useContext = useContext(ConfigurationContext),
3133
- currencyCode = _useContext.currencyCode;
3167
+ currencyCode = _useContext.currencyCode,
3168
+ configuredAmount = _useContext.amount;
3134
3169
 
3135
3170
  var _useContext2 = useContext(ChangableAmountContext),
3136
3171
  amount = _useContext2.amount;
@@ -3284,6 +3319,19 @@ var Footer = (function () {
3284
3319
  };
3285
3320
 
3286
3321
  var mainAction = function mainAction() {
3322
+ var displayedAmount;
3323
+
3324
+ if (amount && (configuredAmount == undefined || configuredAmount.token != true)) {
3325
+ displayedAmount = new Currency({
3326
+ amount: amount.toFixed(2),
3327
+ code: currencyCode
3328
+ }).toString();
3329
+ } else if (paymentValue && paymentValue.toString().length) {
3330
+ displayedAmount = paymentValue.toString();
3331
+ } else {
3332
+ displayedAmount = "".concat(payment.symbol, " ").concat(payment.amount);
3333
+ }
3334
+
3287
3335
  if (paymentState == 'initialized' || paymentState == 'approving') {
3288
3336
  return /*#__PURE__*/React.createElement("button", {
3289
3337
  className: ["ButtonPrimary", payment.route.approvalRequired && !payment.route.directTransfer ? 'disabled' : ''].join(' '),
@@ -3296,10 +3344,7 @@ var Footer = (function () {
3296
3344
  navigate: navigate
3297
3345
  });
3298
3346
  }
3299
- }, "Pay ", amount ? new Currency({
3300
- amount: amount.toFixed(2),
3301
- code: currencyCode
3302
- }).toString() : paymentValue.toString().length ? paymentValue.toString() : "".concat(payment.amount));
3347
+ }, "Pay ", displayedAmount);
3303
3348
  } else if (paymentState == 'paying') {
3304
3349
  return /*#__PURE__*/React.createElement("a", {
3305
3350
  className: "ButtonPrimary",
@@ -3619,7 +3664,7 @@ var TrackingProvider = (function (props) {
3619
3664
  if (!!item.message.forward_to) {
3620
3665
  setTimeout(function () {
3621
3666
  props.document.location.href = item.message.forward_to;
3622
- }, 500);
3667
+ }, 200);
3623
3668
  }
3624
3669
  }
3625
3670
  };
@@ -3701,6 +3746,9 @@ var TrackingProvider = (function (props) {
3701
3746
  response.json().then(function (data) {
3702
3747
  if (data && data.forward_to) {
3703
3748
  setForwardTo(data.forward_to);
3749
+ setTimeout(function () {
3750
+ props.document.location.href = data.forward_to;
3751
+ }, 100);
3704
3752
  }
3705
3753
  });
3706
3754
  clearInterval(pollingInterval);
@@ -4126,7 +4174,8 @@ var PaymentAmountRoutingProvider = (function (props) {
4126
4174
  whitelist: props.whitelist,
4127
4175
  blacklist: props.blacklist,
4128
4176
  event: props.event,
4129
- setMaxRoute: setMaxRoute
4177
+ setMaxRoute: setMaxRoute,
4178
+ fee: props.fee
4130
4179
  }, props.children));
4131
4180
  });
4132
4181
 
@@ -4319,12 +4368,12 @@ var preflight$1 = /*#__PURE__*/function () {
4319
4368
 
4320
4369
  var Payment = /*#__PURE__*/function () {
4321
4370
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
4322
- var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, document, unmount;
4371
+ var accept, amount, event, sent, confirmed, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, fee, document, unmount;
4323
4372
  return regenerator.wrap(function _callee2$(_context2) {
4324
4373
  while (1) {
4325
4374
  switch (_context2.prev = _context2.next) {
4326
4375
  case 0:
4327
- accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, whitelist = _ref3.whitelist, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, track = _ref3.track, document = _ref3.document;
4376
+ accept = _ref3.accept, amount = _ref3.amount, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, whitelist = _ref3.whitelist, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, track = _ref3.track, fee = _ref3.fee, document = _ref3.document;
4328
4377
  _context2.prev = 1;
4329
4378
  _context2.next = 4;
4330
4379
  return preflight$1({
@@ -4354,7 +4403,8 @@ var Payment = /*#__PURE__*/function () {
4354
4403
  whitelist: whitelist,
4355
4404
  blacklist: blacklist,
4356
4405
  providers: providers,
4357
- track: track
4406
+ track: track,
4407
+ fee: fee
4358
4408
  }
4359
4409
  }, /*#__PURE__*/React.createElement(UpdatableProvider, null, /*#__PURE__*/React.createElement(ClosableProvider, {
4360
4410
  unmount: unmount
@@ -4369,7 +4419,8 @@ var Payment = /*#__PURE__*/function () {
4369
4419
  accept: accept,
4370
4420
  whitelist: whitelist,
4371
4421
  blacklist: blacklist,
4372
- event: event
4422
+ event: event,
4423
+ fee: fee
4373
4424
  }, /*#__PURE__*/React.createElement(TrackingProvider, {
4374
4425
  document: ensureDocument(document)
4375
4426
  }, /*#__PURE__*/React.createElement(PaymentProvider, {
@@ -4523,7 +4574,8 @@ var SaleOverviewDialog = (function (props) {
4523
4574
  _useContext.amount;
4524
4575
 
4525
4576
  var _useContext2 = useContext(ConfigurationContext),
4526
- tokenImage = _useContext2.tokenImage;
4577
+ tokenImage = _useContext2.tokenImage,
4578
+ amountConfiguration = _useContext2.amount;
4527
4579
 
4528
4580
  var _useContext3 = useContext(PaymentValueContext),
4529
4581
  paymentValue = _useContext3.paymentValue;
@@ -4545,7 +4597,7 @@ var SaleOverviewDialog = (function (props) {
4545
4597
  setSalePerTokenValue = _useState2[1];
4546
4598
 
4547
4599
  useEffect(function () {
4548
- if (paymentValue) {
4600
+ if (paymentValue && (amountConfiguration == undefined || amountConfiguration.token != true)) {
4549
4601
  setSalePerTokenValue(new Currency({
4550
4602
  amount: (paymentValue.amount / parseFloat(toTokenReadableAmount)).toFixed(2),
4551
4603
  code: paymentValue.code