@depay/widgets 7.5.0 → 7.6.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/README.md +1 -1
- package/dist/esm/index.bundle.js +1 -1
- package/dist/esm/index.js +20 -15
- package/dist/umd/index.bundle.js +1 -1
- package/dist/umd/index.js +20 -15
- package/package.json +1 -1
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.
|
|
20118
|
+
tokenIn: payment.route.fromToken.address,
|
|
20119
20119
|
tokenOut: CONSTANTS[payment.route.blockchain].USD,
|
|
20120
|
-
amountIn: payment.route.
|
|
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
|
-
|
|
20135
|
+
fromTokenUSDExchangeRoutes = _ref3[0],
|
|
20136
20136
|
reverseRoutes = _ref3[1],
|
|
20137
20137
|
USDDecimals = _ref3[2];
|
|
20138
20138
|
|
|
20139
|
-
var
|
|
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
|
|
20154
|
+
var fromTokenUSDAmount;
|
|
20155
20155
|
|
|
20156
|
-
if (payment.route.
|
|
20157
|
-
|
|
20158
|
-
} else if (
|
|
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
|
-
|
|
20162
|
+
fromTokenUSDAmount = fromTokenUSDRoute.amountOut.toString();
|
|
20163
20163
|
}
|
|
20164
20164
|
|
|
20165
|
-
var
|
|
20165
|
+
var fromTokenUSDValue = ethers.utils.formatUnits(fromTokenUSDAmount, USDDecimals);
|
|
20166
20166
|
Currency.fromUSD({
|
|
20167
|
-
amount:
|
|
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);
|
|
@@ -21251,7 +21251,11 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
21251
21251
|
setTimeout(function () {
|
|
21252
21252
|
props.document.location.href = data.forward_to;
|
|
21253
21253
|
}, 100);
|
|
21254
|
+
} else {
|
|
21255
|
+
setClosable(true);
|
|
21254
21256
|
}
|
|
21257
|
+
})["catch"](function () {
|
|
21258
|
+
setClosable(true);
|
|
21255
21259
|
});
|
|
21256
21260
|
clearInterval(pollingInterval);
|
|
21257
21261
|
setRelease(true);
|
|
@@ -21608,12 +21612,12 @@ var preflight$2 = /*#__PURE__*/function () {
|
|
|
21608
21612
|
|
|
21609
21613
|
var Donation = /*#__PURE__*/function () {
|
|
21610
21614
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
21611
|
-
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, fee, closable, integration, container, document, unmount;
|
|
21615
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, track, fee, closable, integration, container, document, unmount;
|
|
21612
21616
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
21613
21617
|
while (1) {
|
|
21614
21618
|
switch (_context2.prev = _context2.next) {
|
|
21615
21619
|
case 0:
|
|
21616
|
-
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, fee = _ref3.fee, closable = _ref3.closable, integration = _ref3.integration, container = _ref3.container, document = _ref3.document;
|
|
21620
|
+
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, confirmed = _ref3.confirmed, failed = _ref3.failed, error = _ref3.error, critical = _ref3.critical, style = _ref3.style, blacklist = _ref3.blacklist, providers = _ref3.providers, currency = _ref3.currency, connected = _ref3.connected, closed = _ref3.closed, track = _ref3.track, fee = _ref3.fee, closable = _ref3.closable, integration = _ref3.integration, container = _ref3.container, document = _ref3.document;
|
|
21617
21621
|
requireReactVersion();
|
|
21618
21622
|
_context2.prev = 2;
|
|
21619
21623
|
_context2.next = 5;
|
|
@@ -21640,6 +21644,7 @@ var Donation = /*#__PURE__*/function () {
|
|
|
21640
21644
|
accept: accept,
|
|
21641
21645
|
currency: currency,
|
|
21642
21646
|
event: event,
|
|
21647
|
+
track: track,
|
|
21643
21648
|
fee: fee,
|
|
21644
21649
|
sent: sent,
|
|
21645
21650
|
confirmed: confirmed,
|