@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/umd/index.js
CHANGED
|
@@ -20110,9 +20110,9 @@
|
|
|
20110
20110
|
|
|
20111
20111
|
Promise.all([web3Exchanges.route({
|
|
20112
20112
|
blockchain: payment.route.blockchain,
|
|
20113
|
-
tokenIn: payment.route.
|
|
20113
|
+
tokenIn: payment.route.fromToken.address,
|
|
20114
20114
|
tokenOut: web3Constants.CONSTANTS[payment.route.blockchain].USD,
|
|
20115
|
-
amountIn: payment.route.
|
|
20115
|
+
amountIn: payment.route.fromAmount,
|
|
20116
20116
|
fromAddress: account,
|
|
20117
20117
|
toAddress: account
|
|
20118
20118
|
}), !payment.route.directTransfer ? web3Exchanges.route({
|
|
@@ -20127,11 +20127,11 @@
|
|
|
20127
20127
|
address: web3Constants.CONSTANTS[payment.route.blockchain].USD
|
|
20128
20128
|
}).decimals()]).then(function (_ref2) {
|
|
20129
20129
|
var _ref3 = _slicedToArray(_ref2, 3),
|
|
20130
|
-
|
|
20130
|
+
fromTokenUSDExchangeRoutes = _ref3[0],
|
|
20131
20131
|
reverseRoutes = _ref3[1],
|
|
20132
20132
|
USDDecimals = _ref3[2];
|
|
20133
20133
|
|
|
20134
|
-
var
|
|
20134
|
+
var fromTokenUSDRoute = fromTokenUSDExchangeRoutes[0];
|
|
20135
20135
|
var reverseRoute = reverseRoutes[0];
|
|
20136
20136
|
|
|
20137
20137
|
if (reverseRoute) {
|
|
@@ -20146,20 +20146,20 @@
|
|
|
20146
20146
|
}
|
|
20147
20147
|
}
|
|
20148
20148
|
|
|
20149
|
-
var
|
|
20149
|
+
var fromTokenUSDAmount;
|
|
20150
20150
|
|
|
20151
|
-
if (payment.route.
|
|
20152
|
-
|
|
20153
|
-
} else if (
|
|
20151
|
+
if (payment.route.fromToken.address.toLowerCase() == web3Constants.CONSTANTS[payment.route.blockchain].USD.toLowerCase()) {
|
|
20152
|
+
fromTokenUSDAmount = payment.route.fromAmount.toString();
|
|
20153
|
+
} else if (fromTokenUSDRoute == undefined) {
|
|
20154
20154
|
setPaymentValue('');
|
|
20155
20155
|
return;
|
|
20156
20156
|
} else {
|
|
20157
|
-
|
|
20157
|
+
fromTokenUSDAmount = fromTokenUSDRoute.amountOut.toString();
|
|
20158
20158
|
}
|
|
20159
20159
|
|
|
20160
|
-
var
|
|
20160
|
+
var fromTokenUSDValue = ethers.ethers.utils.formatUnits(fromTokenUSDAmount, USDDecimals);
|
|
20161
20161
|
localCurrency.Currency.fromUSD({
|
|
20162
|
-
amount:
|
|
20162
|
+
amount: fromTokenUSDValue,
|
|
20163
20163
|
code: currency
|
|
20164
20164
|
}).then(setPaymentValue);
|
|
20165
20165
|
})["catch"](setError);
|
|
@@ -20762,12 +20762,12 @@
|
|
|
20762
20762
|
|
|
20763
20763
|
if (amount && configuredAmount && configuredAmount.currency && configuredAmount.fix) {
|
|
20764
20764
|
displayedAmount = paymentValue.toString();
|
|
20765
|
-
} else if (amount && (configuredAmount == undefined || configuredAmount.token != true)) {
|
|
20765
|
+
} else if (amount && (configuredAmount == undefined || (configuredAmount === null || configuredAmount === void 0 ? void 0 : configuredAmount.token) != true)) {
|
|
20766
20766
|
displayedAmount = new localCurrency.Currency({
|
|
20767
20767
|
amount: amount.toFixed(2),
|
|
20768
20768
|
code: currencyCode
|
|
20769
20769
|
}).toString();
|
|
20770
|
-
} else if (paymentValue && paymentValue.toString().length) {
|
|
20770
|
+
} else if (paymentValue && paymentValue.toString().length && (configuredAmount === null || configuredAmount === void 0 ? void 0 : configuredAmount.token) != true) {
|
|
20771
20771
|
displayedAmount = paymentValue.toString();
|
|
20772
20772
|
} else {
|
|
20773
20773
|
displayedAmount = "".concat(payment.symbol, " ").concat(payment.amount);
|
|
@@ -21246,7 +21246,11 @@
|
|
|
21246
21246
|
setTimeout(function () {
|
|
21247
21247
|
props.document.location.href = data.forward_to;
|
|
21248
21248
|
}, 100);
|
|
21249
|
+
} else {
|
|
21250
|
+
setClosable(true);
|
|
21249
21251
|
}
|
|
21252
|
+
})["catch"](function () {
|
|
21253
|
+
setClosable(true);
|
|
21250
21254
|
});
|
|
21251
21255
|
clearInterval(pollingInterval);
|
|
21252
21256
|
setRelease(true);
|
|
@@ -21603,12 +21607,12 @@
|
|
|
21603
21607
|
|
|
21604
21608
|
var Donation = /*#__PURE__*/function () {
|
|
21605
21609
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
21606
|
-
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, fee, closable, integration, container, document, unmount;
|
|
21610
|
+
var amount, accept, event, sent, confirmed, failed, error, critical, style, blacklist, providers, currency, connected, closed, track, fee, closable, integration, container, document, unmount;
|
|
21607
21611
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
21608
21612
|
while (1) {
|
|
21609
21613
|
switch (_context2.prev = _context2.next) {
|
|
21610
21614
|
case 0:
|
|
21611
|
-
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;
|
|
21615
|
+
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;
|
|
21612
21616
|
requireReactVersion();
|
|
21613
21617
|
_context2.prev = 2;
|
|
21614
21618
|
_context2.next = 5;
|
|
@@ -21635,6 +21639,7 @@
|
|
|
21635
21639
|
accept: accept,
|
|
21636
21640
|
currency: currency,
|
|
21637
21641
|
event: event,
|
|
21642
|
+
track: track,
|
|
21638
21643
|
fee: fee,
|
|
21639
21644
|
sent: sent,
|
|
21640
21645
|
confirmed: confirmed,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/widgets",
|
|
3
3
|
"moduleName": "DePayWidgets",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.6.0",
|
|
5
5
|
"description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
|
|
6
6
|
"main": "./dist/umd/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|