@depay/widgets 8.1.0 → 9.0.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 +14 -18
- package/dist/esm/index.bundle.js +16 -24
- package/dist/esm/index.js +854 -703
- package/dist/umd/index.bundle.js +16 -24
- package/dist/umd/index.js +854 -703
- package/package.json +10 -9
package/dist/umd/index.js
CHANGED
|
@@ -238,9 +238,7 @@
|
|
|
238
238
|
if (!isNaN(iterable.length)) {
|
|
239
239
|
var i = -1,
|
|
240
240
|
next = function next() {
|
|
241
|
-
for (; ++i < iterable.length;)
|
|
242
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
243
|
-
}
|
|
241
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
244
242
|
return next.value = undefined, next.done = !0, next;
|
|
245
243
|
};
|
|
246
244
|
return next.next = next;
|
|
@@ -286,9 +284,7 @@
|
|
|
286
284
|
}), exports.keys = function (val) {
|
|
287
285
|
var object = Object(val),
|
|
288
286
|
keys = [];
|
|
289
|
-
for (var key in object)
|
|
290
|
-
keys.push(key);
|
|
291
|
-
}
|
|
287
|
+
for (var key in object) keys.push(key);
|
|
292
288
|
return keys.reverse(), function next() {
|
|
293
289
|
for (; keys.length;) {
|
|
294
290
|
var key = keys.pop();
|
|
@@ -299,9 +295,7 @@
|
|
|
299
295
|
}, exports.values = values, Context.prototype = {
|
|
300
296
|
constructor: Context,
|
|
301
297
|
reset: function reset(skipTempReset) {
|
|
302
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this)
|
|
303
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
304
|
-
}
|
|
298
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
305
299
|
},
|
|
306
300
|
stop: function stop() {
|
|
307
301
|
this.done = !0;
|
|
@@ -416,9 +410,7 @@
|
|
|
416
410
|
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
417
411
|
if (Object(_i) !== _i) return;
|
|
418
412
|
_n = !1;
|
|
419
|
-
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0)
|
|
420
|
-
;
|
|
421
|
-
}
|
|
413
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
422
414
|
} catch (err) {
|
|
423
415
|
_d = !0, _e = err;
|
|
424
416
|
} finally {
|
|
@@ -434,9 +426,7 @@
|
|
|
434
426
|
|
|
435
427
|
function _arrayLikeToArray(arr, len) {
|
|
436
428
|
if (len == null || len > arr.length) len = arr.length;
|
|
437
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
438
|
-
arr2[i] = arr[i];
|
|
439
|
-
}
|
|
429
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
440
430
|
return arr2;
|
|
441
431
|
}
|
|
442
432
|
|
|
@@ -660,25 +650,23 @@
|
|
|
660
650
|
_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
661
651
|
var account;
|
|
662
652
|
return regenerator.wrap(function _callee$(_context) {
|
|
663
|
-
while (1) {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
return _context.stop();
|
|
681
|
-
}
|
|
653
|
+
while (1) switch (_context.prev = _context.next) {
|
|
654
|
+
case 0:
|
|
655
|
+
if (!wallet) {
|
|
656
|
+
_context.next = 5;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
_context.next = 3;
|
|
660
|
+
return wallet.account();
|
|
661
|
+
case 3:
|
|
662
|
+
account = _context.sent;
|
|
663
|
+
if (account == undefined) {
|
|
664
|
+
navigate('ConnectingWallet');
|
|
665
|
+
props.connect(wallet);
|
|
666
|
+
}
|
|
667
|
+
case 5:
|
|
668
|
+
case "end":
|
|
669
|
+
return _context.stop();
|
|
682
670
|
}
|
|
683
671
|
}, _callee);
|
|
684
672
|
}))();
|
|
@@ -760,24 +748,22 @@
|
|
|
760
748
|
wallet.connect().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
761
749
|
var account;
|
|
762
750
|
return regenerator.wrap(function _callee$(_context) {
|
|
763
|
-
while (1) {
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
if (
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
return _context.stop();
|
|
780
|
-
}
|
|
751
|
+
while (1) switch (_context.prev = _context.next) {
|
|
752
|
+
case 0:
|
|
753
|
+
_context.next = 2;
|
|
754
|
+
return wallet.account();
|
|
755
|
+
case 2:
|
|
756
|
+
account = _context.sent;
|
|
757
|
+
if (account) {
|
|
758
|
+
if (props.autoClose) close();
|
|
759
|
+
if (props.resolve) props.resolve({
|
|
760
|
+
wallet: wallet,
|
|
761
|
+
account: account
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
case 4:
|
|
765
|
+
case "end":
|
|
766
|
+
return _context.stop();
|
|
781
767
|
}
|
|
782
768
|
}, _callee);
|
|
783
769
|
})))["catch"](function (error) {
|
|
@@ -804,27 +790,25 @@
|
|
|
804
790
|
_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
805
791
|
var account;
|
|
806
792
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
807
|
-
while (1) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
if (
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
return _context2.stop();
|
|
827
|
-
}
|
|
793
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
794
|
+
case 0:
|
|
795
|
+
if (!wallet) {
|
|
796
|
+
_context2.next = 5;
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
799
|
+
_context2.next = 3;
|
|
800
|
+
return wallet.account();
|
|
801
|
+
case 3:
|
|
802
|
+
account = _context2.sent;
|
|
803
|
+
if (account) {
|
|
804
|
+
if (props.resolve) props.resolve({
|
|
805
|
+
wallet: wallet,
|
|
806
|
+
account: account
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
case 5:
|
|
810
|
+
case "end":
|
|
811
|
+
return _context2.stop();
|
|
828
812
|
}
|
|
829
813
|
}, _callee2);
|
|
830
814
|
}))();
|
|
@@ -1411,55 +1395,53 @@
|
|
|
1411
1395
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(resolve, reject) {
|
|
1412
1396
|
var wallet, account;
|
|
1413
1397
|
return regenerator.wrap(function _callee$(_context) {
|
|
1414
|
-
while (1) {
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
return
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
return _context.stop();
|
|
1462
|
-
}
|
|
1398
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1399
|
+
case 0:
|
|
1400
|
+
wallet = web3Wallets.getWallets()[0];
|
|
1401
|
+
if (!wallet) {
|
|
1402
|
+
_context.next = 7;
|
|
1403
|
+
break;
|
|
1404
|
+
}
|
|
1405
|
+
_context.next = 4;
|
|
1406
|
+
return wallet.account();
|
|
1407
|
+
case 4:
|
|
1408
|
+
account = _context.sent;
|
|
1409
|
+
if (!account) {
|
|
1410
|
+
_context.next = 7;
|
|
1411
|
+
break;
|
|
1412
|
+
}
|
|
1413
|
+
return _context.abrupt("return", resolve({
|
|
1414
|
+
wallet: wallet,
|
|
1415
|
+
account: account
|
|
1416
|
+
}));
|
|
1417
|
+
case 7:
|
|
1418
|
+
mount({
|
|
1419
|
+
style: style,
|
|
1420
|
+
document: ensureDocument(document)
|
|
1421
|
+
}, function (unmount) {
|
|
1422
|
+
var rejectBeforeUnmount = function rejectBeforeUnmount() {
|
|
1423
|
+
reject('USER_CLOSED_DIALOG');
|
|
1424
|
+
unmount();
|
|
1425
|
+
};
|
|
1426
|
+
return function (container) {
|
|
1427
|
+
return /*#__PURE__*/React__default["default"].createElement(ErrorProvider, {
|
|
1428
|
+
errorCallback: error,
|
|
1429
|
+
container: container,
|
|
1430
|
+
unmount: unmount
|
|
1431
|
+
}, /*#__PURE__*/React__default["default"].createElement(UpdatableProvider, null, /*#__PURE__*/React__default["default"].createElement(ClosableProvider, {
|
|
1432
|
+
unmount: rejectBeforeUnmount
|
|
1433
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConnectStack, {
|
|
1434
|
+
document: document,
|
|
1435
|
+
container: container,
|
|
1436
|
+
resolve: resolve,
|
|
1437
|
+
reject: reject,
|
|
1438
|
+
autoClose: true
|
|
1439
|
+
}), /*#__PURE__*/React__default["default"].createElement(PoweredBy, null))));
|
|
1440
|
+
};
|
|
1441
|
+
});
|
|
1442
|
+
case 8:
|
|
1443
|
+
case "end":
|
|
1444
|
+
return _context.stop();
|
|
1463
1445
|
}
|
|
1464
1446
|
}, _callee);
|
|
1465
1447
|
}));
|
|
@@ -18820,7 +18802,7 @@
|
|
|
18820
18802
|
} else {
|
|
18821
18803
|
Promise.all(props.accept.map(function (configuration) {
|
|
18822
18804
|
if (fixedAmount) {
|
|
18823
|
-
if (web3Constants.CONSTANTS[configuration.blockchain].USD
|
|
18805
|
+
if (web3Constants.CONSTANTS[configuration.blockchain].USD == configuration.token) {
|
|
18824
18806
|
return 1.00 / fixedCurrencyConversionRate * fixedAmount;
|
|
18825
18807
|
} else {
|
|
18826
18808
|
return web3Exchanges.route({
|
|
@@ -18833,7 +18815,7 @@
|
|
|
18833
18815
|
});
|
|
18834
18816
|
}
|
|
18835
18817
|
} else {
|
|
18836
|
-
if (web3Constants.CONSTANTS[configuration.blockchain].USD
|
|
18818
|
+
if (web3Constants.CONSTANTS[configuration.blockchain].USD == configuration.token) {
|
|
18837
18819
|
return 1.00 / conversionRate * amount;
|
|
18838
18820
|
} else {
|
|
18839
18821
|
return web3Exchanges.route({
|
|
@@ -19107,7 +19089,8 @@
|
|
|
19107
19089
|
synchronousTracking = _useContext9.synchronousTracking,
|
|
19108
19090
|
asynchronousTracking = _useContext9.asynchronousTracking,
|
|
19109
19091
|
trackingInitialized = _useContext9.trackingInitialized,
|
|
19110
|
-
initializePaymentTracking = _useContext9.initializeTracking
|
|
19092
|
+
initializePaymentTracking = _useContext9.initializeTracking,
|
|
19093
|
+
preTrack = _useContext9.preTrack;
|
|
19111
19094
|
var _useContext10 = React.useContext(TransactionTrackingContext),
|
|
19112
19095
|
foundTransaction = _useContext10.foundTransaction,
|
|
19113
19096
|
initializeTransactionTracking = _useContext10.initializeTracking;
|
|
@@ -19150,33 +19133,34 @@
|
|
|
19150
19133
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
19151
19134
|
var stop, currentBlock;
|
|
19152
19135
|
return regenerator.wrap(function _callee$(_context) {
|
|
19153
|
-
while (1) {
|
|
19154
|
-
|
|
19155
|
-
|
|
19156
|
-
|
|
19157
|
-
|
|
19158
|
-
|
|
19159
|
-
|
|
19160
|
-
|
|
19161
|
-
|
|
19162
|
-
|
|
19163
|
-
|
|
19164
|
-
|
|
19165
|
-
|
|
19166
|
-
|
|
19167
|
-
|
|
19168
|
-
|
|
19169
|
-
|
|
19170
|
-
|
|
19171
|
-
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
|
|
19136
|
+
while (1) switch (_context.prev = _context.next) {
|
|
19137
|
+
case 0:
|
|
19138
|
+
if (!before) {
|
|
19139
|
+
_context.next = 6;
|
|
19140
|
+
break;
|
|
19141
|
+
}
|
|
19142
|
+
_context.next = 3;
|
|
19143
|
+
return before(payment.route.transaction);
|
|
19144
|
+
case 3:
|
|
19145
|
+
stop = _context.sent;
|
|
19146
|
+
if (!(stop === false)) {
|
|
19147
|
+
_context.next = 6;
|
|
19148
|
+
break;
|
|
19149
|
+
}
|
|
19150
|
+
return _context.abrupt("return");
|
|
19151
|
+
case 6:
|
|
19152
|
+
setClosable(false);
|
|
19153
|
+
setPaymentState('paying');
|
|
19154
|
+
setUpdatable(false);
|
|
19155
|
+
_context.next = 11;
|
|
19156
|
+
return web3Client.request({
|
|
19157
|
+
blockchain: payment.route.transaction.blockchain,
|
|
19158
|
+
method: 'latestBlockNumber'
|
|
19159
|
+
});
|
|
19160
|
+
case 11:
|
|
19161
|
+
currentBlock = _context.sent;
|
|
19162
|
+
_context.next = 14;
|
|
19163
|
+
return preTrack(currentBlock, payment.route).then(function () {
|
|
19180
19164
|
wallet.sendTransaction(Object.assign({}, payment.route.transaction, {
|
|
19181
19165
|
sent: function sent(transaction) {
|
|
19182
19166
|
initializeTransactionTracking(transaction, currentBlock);
|
|
@@ -19194,14 +19178,20 @@
|
|
|
19194
19178
|
setPaymentState('initialized');
|
|
19195
19179
|
setClosable(true);
|
|
19196
19180
|
setUpdatable(true);
|
|
19197
|
-
if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK') {
|
|
19181
|
+
if ((error === null || error === void 0 ? void 0 : error.code) == 'WRONG_NETWORK' || (error === null || error === void 0 ? void 0 : error.code) == 'NOT_SUPPORTED') {
|
|
19198
19182
|
navigate('WrongNetwork');
|
|
19199
19183
|
}
|
|
19200
19184
|
});
|
|
19201
|
-
|
|
19202
|
-
|
|
19203
|
-
|
|
19204
|
-
|
|
19185
|
+
})["catch"](function (e) {
|
|
19186
|
+
console.log(e);
|
|
19187
|
+
setPaymentState('initialized');
|
|
19188
|
+
setClosable(true);
|
|
19189
|
+
setUpdatable(true);
|
|
19190
|
+
navigate('PreTrackingFailed');
|
|
19191
|
+
});
|
|
19192
|
+
case 14:
|
|
19193
|
+
case "end":
|
|
19194
|
+
return _context.stop();
|
|
19205
19195
|
}
|
|
19206
19196
|
}, _callee);
|
|
19207
19197
|
}));
|
|
@@ -19272,7 +19262,7 @@
|
|
|
19272
19262
|
React.useEffect(function () {
|
|
19273
19263
|
if (foundTransaction && foundTransaction.id && foundTransaction.status) {
|
|
19274
19264
|
var newTransaction;
|
|
19275
|
-
if (foundTransaction.id
|
|
19265
|
+
if (foundTransaction.id != transaction.id) {
|
|
19276
19266
|
newTransaction = Object.assign({}, transaction, {
|
|
19277
19267
|
id: foundTransaction.id,
|
|
19278
19268
|
url: web3Blockchains.Blockchain.findByName(transaction.blockchain).explorerUrlFor({
|
|
@@ -19378,14 +19368,13 @@
|
|
|
19378
19368
|
account = _ref.account,
|
|
19379
19369
|
whitelist = _ref.whitelist,
|
|
19380
19370
|
blacklist = _ref.blacklist,
|
|
19381
|
-
event = _ref.event,
|
|
19382
19371
|
fee = _ref.fee;
|
|
19383
19372
|
return web3Payments.route({
|
|
19384
19373
|
accept: accept.map(prepareAcceptedPayments),
|
|
19385
19374
|
from: mergeFromAccounts(accept, account),
|
|
19386
19375
|
whitelist: whitelist,
|
|
19387
19376
|
blacklist: blacklist,
|
|
19388
|
-
event:
|
|
19377
|
+
event: 'ifRoutedAndNative',
|
|
19389
19378
|
fee: fee
|
|
19390
19379
|
});
|
|
19391
19380
|
});
|
|
@@ -19422,55 +19411,51 @@
|
|
|
19422
19411
|
var onRoutesUpdate = /*#__PURE__*/function () {
|
|
19423
19412
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(routes) {
|
|
19424
19413
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
19425
|
-
while (1) {
|
|
19426
|
-
|
|
19427
|
-
|
|
19428
|
-
|
|
19429
|
-
|
|
19430
|
-
|
|
19431
|
-
|
|
19432
|
-
|
|
19433
|
-
|
|
19434
|
-
|
|
19435
|
-
var
|
|
19436
|
-
|
|
19437
|
-
|
|
19438
|
-
|
|
19439
|
-
|
|
19440
|
-
|
|
19441
|
-
|
|
19442
|
-
|
|
19443
|
-
|
|
19444
|
-
|
|
19445
|
-
|
|
19446
|
-
|
|
19447
|
-
|
|
19448
|
-
|
|
19449
|
-
if (selectedRoute.fromAmount != newSelectRoute.fromAmount) {
|
|
19450
|
-
setUpdatedRouteWithNewPrice(newSelectRoute);
|
|
19451
|
-
}
|
|
19452
|
-
}
|
|
19453
|
-
}
|
|
19454
|
-
setAllRoutes(roundedRoutes);
|
|
19455
|
-
if (props.setMaxRoute) {
|
|
19456
|
-
props.setMaxRoute(findMaxRoute(roundedRoutes));
|
|
19414
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
19415
|
+
case 0:
|
|
19416
|
+
if (routes.length == 0) {
|
|
19417
|
+
setAllRoutes([]);
|
|
19418
|
+
if (props.setMaxRoute) {
|
|
19419
|
+
props.setMaxRoute(null);
|
|
19420
|
+
}
|
|
19421
|
+
} else {
|
|
19422
|
+
roundAmounts(routes).then( /*#__PURE__*/function () {
|
|
19423
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(roundedRoutes) {
|
|
19424
|
+
var selectRoute, newSelectRoute;
|
|
19425
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
19426
|
+
while (1) switch (_context.prev = _context.next) {
|
|
19427
|
+
case 0:
|
|
19428
|
+
if (typeof selectedRoute == 'undefined') {
|
|
19429
|
+
selectRoute = roundedRoutes[0];
|
|
19430
|
+
setSelectedRoute(selectRoute);
|
|
19431
|
+
} else {
|
|
19432
|
+
newSelectRoute = roundedRoutes[roundedRoutes.findIndex(function (route) {
|
|
19433
|
+
return route.fromToken.address == selectedRoute.fromToken.address && route.blockchain == selectedRoute.blockchain;
|
|
19434
|
+
})];
|
|
19435
|
+
if (newSelectRoute) {
|
|
19436
|
+
if (selectedRoute.fromAmount != newSelectRoute.fromAmount) {
|
|
19437
|
+
setUpdatedRouteWithNewPrice(newSelectRoute);
|
|
19457
19438
|
}
|
|
19458
|
-
|
|
19459
|
-
case "end":
|
|
19460
|
-
return _context.stop();
|
|
19439
|
+
}
|
|
19461
19440
|
}
|
|
19462
|
-
|
|
19463
|
-
|
|
19464
|
-
|
|
19465
|
-
|
|
19466
|
-
|
|
19467
|
-
|
|
19468
|
-
|
|
19469
|
-
|
|
19470
|
-
|
|
19471
|
-
|
|
19472
|
-
|
|
19473
|
-
|
|
19441
|
+
setAllRoutes(roundedRoutes);
|
|
19442
|
+
if (props.setMaxRoute) {
|
|
19443
|
+
props.setMaxRoute(findMaxRoute(roundedRoutes));
|
|
19444
|
+
}
|
|
19445
|
+
case 3:
|
|
19446
|
+
case "end":
|
|
19447
|
+
return _context.stop();
|
|
19448
|
+
}
|
|
19449
|
+
}, _callee);
|
|
19450
|
+
}));
|
|
19451
|
+
return function (_x2) {
|
|
19452
|
+
return _ref2.apply(this, arguments);
|
|
19453
|
+
};
|
|
19454
|
+
}());
|
|
19455
|
+
}
|
|
19456
|
+
case 1:
|
|
19457
|
+
case "end":
|
|
19458
|
+
return _context2.stop();
|
|
19474
19459
|
}
|
|
19475
19460
|
}, _callee2);
|
|
19476
19461
|
}));
|
|
@@ -19506,29 +19491,27 @@
|
|
|
19506
19491
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(route, amountBN) {
|
|
19507
19492
|
var readableAmount, roundedAmountBN;
|
|
19508
19493
|
return regenerator.wrap(function _callee3$(_context3) {
|
|
19509
|
-
while (1) {
|
|
19510
|
-
|
|
19511
|
-
|
|
19512
|
-
|
|
19513
|
-
|
|
19514
|
-
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19521
|
-
|
|
19522
|
-
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
|
|
19529
|
-
|
|
19530
|
-
return _context3.stop();
|
|
19531
|
-
}
|
|
19494
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
19495
|
+
case 0:
|
|
19496
|
+
if (!route.directTransfer) {
|
|
19497
|
+
_context3.next = 2;
|
|
19498
|
+
break;
|
|
19499
|
+
}
|
|
19500
|
+
return _context3.abrupt("return", route);
|
|
19501
|
+
case 2:
|
|
19502
|
+
_context3.next = 4;
|
|
19503
|
+
return route.fromToken.readable(amountBN || route.transaction.params.amounts[0]);
|
|
19504
|
+
case 4:
|
|
19505
|
+
readableAmount = _context3.sent;
|
|
19506
|
+
_context3.next = 7;
|
|
19507
|
+
return route.fromToken.BigNumber(round(readableAmount));
|
|
19508
|
+
case 7:
|
|
19509
|
+
roundedAmountBN = _context3.sent;
|
|
19510
|
+
updateRouteAmount(route, roundedAmountBN);
|
|
19511
|
+
return _context3.abrupt("return", route);
|
|
19512
|
+
case 10:
|
|
19513
|
+
case "end":
|
|
19514
|
+
return _context3.stop();
|
|
19532
19515
|
}
|
|
19533
19516
|
}, _callee3);
|
|
19534
19517
|
}));
|
|
@@ -19539,16 +19522,14 @@
|
|
|
19539
19522
|
var roundAmounts = /*#__PURE__*/function () {
|
|
19540
19523
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4(routes) {
|
|
19541
19524
|
return regenerator.wrap(function _callee4$(_context4) {
|
|
19542
|
-
while (1) {
|
|
19543
|
-
|
|
19544
|
-
|
|
19545
|
-
return
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
return _context4.stop();
|
|
19551
|
-
}
|
|
19525
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
19526
|
+
case 0:
|
|
19527
|
+
return _context4.abrupt("return", Promise.all(routes.map(function (route) {
|
|
19528
|
+
return roundAmount(route);
|
|
19529
|
+
})));
|
|
19530
|
+
case 1:
|
|
19531
|
+
case "end":
|
|
19532
|
+
return _context4.stop();
|
|
19552
19533
|
}
|
|
19553
19534
|
}, _callee4);
|
|
19554
19535
|
}));
|
|
@@ -19559,15 +19540,13 @@
|
|
|
19559
19540
|
var updateRouteWithNewPrice = /*#__PURE__*/function () {
|
|
19560
19541
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee5() {
|
|
19561
19542
|
return regenerator.wrap(function _callee5$(_context5) {
|
|
19562
|
-
while (1) {
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
return _context5.stop();
|
|
19570
|
-
}
|
|
19543
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
19544
|
+
case 0:
|
|
19545
|
+
setSelectedRoute(_objectSpread({}, updatedRouteWithNewPrice));
|
|
19546
|
+
setUpdatedRouteWithNewPrice(null);
|
|
19547
|
+
case 2:
|
|
19548
|
+
case "end":
|
|
19549
|
+
return _context5.stop();
|
|
19571
19550
|
}
|
|
19572
19551
|
}, _callee5);
|
|
19573
19552
|
}));
|
|
@@ -19647,6 +19626,7 @@
|
|
|
19647
19626
|
if (updatable == false || (payment === null || payment === void 0 ? void 0 : payment.route) == undefined) {
|
|
19648
19627
|
return;
|
|
19649
19628
|
}
|
|
19629
|
+
setPaymentValueLoss(null);
|
|
19650
19630
|
Promise.all([web3Exchanges.route({
|
|
19651
19631
|
blockchain: payment.route.blockchain,
|
|
19652
19632
|
tokenIn: payment.route.fromToken.address,
|
|
@@ -19682,7 +19662,7 @@
|
|
|
19682
19662
|
}
|
|
19683
19663
|
}
|
|
19684
19664
|
var fromTokenUSDAmount;
|
|
19685
|
-
if (payment.route.fromToken.address
|
|
19665
|
+
if (payment.route.fromToken.address == web3Constants.CONSTANTS[payment.route.blockchain].USD) {
|
|
19686
19666
|
fromTokenUSDAmount = payment.route.fromAmount.toString();
|
|
19687
19667
|
} else if (fromTokenUSDRoute == undefined) {
|
|
19688
19668
|
setPaymentValue('');
|
|
@@ -20097,6 +20077,16 @@
|
|
|
20097
20077
|
}));
|
|
20098
20078
|
});
|
|
20099
20079
|
|
|
20080
|
+
var blockTimes = {
|
|
20081
|
+
// in seconds
|
|
20082
|
+
ethereum: 13,
|
|
20083
|
+
bsc: 4,
|
|
20084
|
+
polygon: 3
|
|
20085
|
+
};
|
|
20086
|
+
var etaForConfirmations = (function (blockchain, confirmationsRequired, confirmationsPassed) {
|
|
20087
|
+
return (confirmationsRequired - confirmationsPassed) * blockTimes[blockchain];
|
|
20088
|
+
});
|
|
20089
|
+
|
|
20100
20090
|
var LoadingText = (function (props) {
|
|
20101
20091
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20102
20092
|
className: "LoadingText"
|
|
@@ -20118,7 +20108,9 @@
|
|
|
20118
20108
|
asynchronousTracking = _useContext2.asynchronousTracking,
|
|
20119
20109
|
trackingInitialized = _useContext2.trackingInitialized,
|
|
20120
20110
|
release = _useContext2.release,
|
|
20121
|
-
forwardTo = _useContext2.forwardTo
|
|
20111
|
+
forwardTo = _useContext2.forwardTo,
|
|
20112
|
+
confirmationsRequired = _useContext2.confirmationsRequired,
|
|
20113
|
+
confirmationsPassed = _useContext2.confirmationsPassed;
|
|
20122
20114
|
var _useContext3 = React.useContext(PaymentContext),
|
|
20123
20115
|
payment = _useContext3.payment,
|
|
20124
20116
|
paymentState = _useContext3.paymentState,
|
|
@@ -20137,6 +20129,34 @@
|
|
|
20137
20129
|
_useContext6.navigate;
|
|
20138
20130
|
var _useContext7 = React.useContext(ClosableContext),
|
|
20139
20131
|
close = _useContext7.close;
|
|
20132
|
+
var _useState = React.useState(),
|
|
20133
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20134
|
+
secondsLeft = _useState2[0],
|
|
20135
|
+
setSecondsLeft = _useState2[1];
|
|
20136
|
+
var _useState3 = React.useState(0),
|
|
20137
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
20138
|
+
secondsLeftCountdown = _useState4[0],
|
|
20139
|
+
setSecondsLeftCountdown = _useState4[1];
|
|
20140
|
+
React.useEffect(function () {
|
|
20141
|
+
if (confirmationsRequired) {
|
|
20142
|
+
var interval = setInterval(function () {
|
|
20143
|
+
setSecondsLeftCountdown(secondsLeftCountdown + 1);
|
|
20144
|
+
}, 1000);
|
|
20145
|
+
return function () {
|
|
20146
|
+
clearInterval(interval);
|
|
20147
|
+
};
|
|
20148
|
+
}
|
|
20149
|
+
}, [confirmationsRequired, secondsLeftCountdown]);
|
|
20150
|
+
React.useEffect(function () {
|
|
20151
|
+
if (confirmationsPassed) {
|
|
20152
|
+
setSecondsLeft(etaForConfirmations(payment.blockchain, confirmationsRequired, confirmationsPassed) - secondsLeftCountdown);
|
|
20153
|
+
}
|
|
20154
|
+
}, [confirmationsPassed, secondsLeftCountdown]);
|
|
20155
|
+
React.useEffect(function () {
|
|
20156
|
+
if (confirmationsPassed) {
|
|
20157
|
+
setSecondsLeftCountdown(0);
|
|
20158
|
+
}
|
|
20159
|
+
}, [confirmationsPassed]);
|
|
20140
20160
|
var trackingInfo = function trackingInfo() {
|
|
20141
20161
|
if (synchronousTracking == false && asynchronousTracking == false || asynchronousTracking && trackingInitialized) {
|
|
20142
20162
|
return null;
|
|
@@ -20187,7 +20207,9 @@
|
|
|
20187
20207
|
className: "CardBodyWrapper"
|
|
20188
20208
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20189
20209
|
className: "Opacity05"
|
|
20190
|
-
}, "Validating payment"
|
|
20210
|
+
}, "Validating payment", confirmationsRequired && secondsLeft > 0 && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
20211
|
+
title: "".concat(confirmationsPassed, "/").concat(confirmationsRequired, " required confirmations")
|
|
20212
|
+
}, " ", secondsLeft, "s"))))));
|
|
20191
20213
|
}
|
|
20192
20214
|
};
|
|
20193
20215
|
var additionalPaymentInformation = function additionalPaymentInformation() {
|
|
@@ -20238,7 +20260,7 @@
|
|
|
20238
20260
|
return null;
|
|
20239
20261
|
} else if (paymentState == 'initialized') {
|
|
20240
20262
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20241
|
-
className: "
|
|
20263
|
+
className: "PaddingBottomXS"
|
|
20242
20264
|
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
20243
20265
|
className: "ButtonPrimary",
|
|
20244
20266
|
onClick: approve,
|
|
@@ -20560,44 +20582,59 @@
|
|
|
20560
20582
|
integration = _useContext2.integration,
|
|
20561
20583
|
link = _useContext2.link,
|
|
20562
20584
|
type = _useContext2.type;
|
|
20585
|
+
var _useContext3 = React.useContext(WalletContext),
|
|
20586
|
+
account = _useContext3.account;
|
|
20587
|
+
_useContext3.wallet;
|
|
20563
20588
|
var _useState = React.useState(),
|
|
20564
20589
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20565
20590
|
transaction = _useState2[0],
|
|
20566
20591
|
setTransaction = _useState2[1];
|
|
20567
20592
|
var _useState3 = React.useState(),
|
|
20568
20593
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
20569
|
-
|
|
20570
|
-
|
|
20594
|
+
confirmationsRequired = _useState4[0],
|
|
20595
|
+
setConfirmationsRequired = _useState4[1];
|
|
20571
20596
|
var _useState5 = React.useState(),
|
|
20572
20597
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
20573
|
-
|
|
20574
|
-
|
|
20575
|
-
var _useState7 = React.useState(
|
|
20598
|
+
confirmationsPassed = _useState6[0],
|
|
20599
|
+
setConfirmationsPassed = _useState6[1];
|
|
20600
|
+
var _useState7 = React.useState(),
|
|
20576
20601
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
20577
|
-
|
|
20578
|
-
|
|
20579
|
-
var _useState9 = React.useState(
|
|
20580
|
-
_useState10 = _slicedToArray(_useState9,
|
|
20581
|
-
|
|
20582
|
-
|
|
20583
|
-
|
|
20584
|
-
|
|
20585
|
-
|
|
20586
|
-
|
|
20587
|
-
|
|
20588
|
-
|
|
20589
|
-
|
|
20590
|
-
|
|
20591
|
-
|
|
20592
|
-
|
|
20593
|
-
|
|
20594
|
-
|
|
20595
|
-
|
|
20596
|
-
|
|
20597
|
-
|
|
20598
|
-
|
|
20599
|
-
|
|
20600
|
-
|
|
20602
|
+
afterBlock = _useState8[0],
|
|
20603
|
+
setAfterBlock = _useState8[1];
|
|
20604
|
+
var _useState9 = React.useState(),
|
|
20605
|
+
_useState10 = _slicedToArray(_useState9, 2);
|
|
20606
|
+
_useState10[0];
|
|
20607
|
+
_useState10[1];
|
|
20608
|
+
var _useState11 = React.useState(),
|
|
20609
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
20610
|
+
paymentRoute = _useState12[0],
|
|
20611
|
+
setPaymentRoute = _useState12[1];
|
|
20612
|
+
var _useState13 = React.useState(false),
|
|
20613
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
20614
|
+
trackingInitialized = _useState14[0],
|
|
20615
|
+
setTrackingInitialized = _useState14[1];
|
|
20616
|
+
var _useState15 = React.useState(!!(track && (track.endpoint || typeof track.method == 'function') && track.async != true)),
|
|
20617
|
+
_useState16 = _slicedToArray(_useState15, 1),
|
|
20618
|
+
synchronousTracking = _useState16[0];
|
|
20619
|
+
var _useState17 = React.useState(!!(track && track.async == true)),
|
|
20620
|
+
_useState18 = _slicedToArray(_useState17, 1),
|
|
20621
|
+
asynchronousTracking = _useState18[0];
|
|
20622
|
+
var _useState19 = React.useState(!!(track && track.poll && (track.poll.endpoint || typeof track.poll.method == 'function') && track.async != true)),
|
|
20623
|
+
_useState20 = _slicedToArray(_useState19, 1),
|
|
20624
|
+
polling = _useState20[0];
|
|
20625
|
+
var _useState21 = React.useState(false),
|
|
20626
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
20627
|
+
release = _useState22[0],
|
|
20628
|
+
setRelease = _useState22[1];
|
|
20629
|
+
var _useState23 = React.useState(),
|
|
20630
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
20631
|
+
forwardTo = _useState24[0],
|
|
20632
|
+
setForwardTo = _useState24[1];
|
|
20633
|
+
var _useContext4 = React.useContext(ClosableContext),
|
|
20634
|
+
setClosable = _useContext4.setClosable;
|
|
20635
|
+
var _useContext5 = React.useContext(NavigateContext),
|
|
20636
|
+
navigate = _useContext5.navigate;
|
|
20637
|
+
_useContext5.set;
|
|
20601
20638
|
var openSocket = function openSocket(transaction) {
|
|
20602
20639
|
var socket = new WebSocket('wss://integrate.depay.com/cable');
|
|
20603
20640
|
socket.onopen = function (event) {
|
|
@@ -20605,14 +20642,18 @@
|
|
|
20605
20642
|
command: 'subscribe',
|
|
20606
20643
|
identifier: JSON.stringify({
|
|
20607
20644
|
blockchain: transaction.blockchain,
|
|
20608
|
-
sender: transaction.from
|
|
20609
|
-
nonce: transaction.nonce,
|
|
20645
|
+
sender: transaction.from,
|
|
20646
|
+
nonce: transaction.nonce.toString(),
|
|
20610
20647
|
channel: 'PaymentChannel'
|
|
20611
20648
|
})
|
|
20612
20649
|
};
|
|
20613
20650
|
socket.send(JSON.stringify(msg));
|
|
20614
20651
|
};
|
|
20615
|
-
socket.onclose = function (event) {
|
|
20652
|
+
socket.onclose = function (event) {
|
|
20653
|
+
if (!event || event.code != 1000) {
|
|
20654
|
+
openSocket(transaction);
|
|
20655
|
+
}
|
|
20656
|
+
};
|
|
20616
20657
|
socket.onmessage = function (event) {
|
|
20617
20658
|
var item = JSON.parse(event.data);
|
|
20618
20659
|
if (item.type === "ping" || !item.message) {
|
|
@@ -20625,12 +20666,15 @@
|
|
|
20625
20666
|
setRelease(true);
|
|
20626
20667
|
setClosable(!item.message.forward_to);
|
|
20627
20668
|
setForwardTo(item.message.forward_to);
|
|
20628
|
-
socket.close();
|
|
20669
|
+
socket.close(1000);
|
|
20629
20670
|
if (!!item.message.forward_to) {
|
|
20630
20671
|
setTimeout(function () {
|
|
20631
20672
|
props.document.location.href = item.message.forward_to;
|
|
20632
20673
|
}, 200);
|
|
20633
20674
|
}
|
|
20675
|
+
} else if (item.message.confirmations) {
|
|
20676
|
+
setConfirmationsRequired(item.message.confirmations.required);
|
|
20677
|
+
setConfirmationsPassed(item.message.confirmations.passed);
|
|
20634
20678
|
}
|
|
20635
20679
|
};
|
|
20636
20680
|
socket.onerror = function (error) {
|
|
@@ -20675,10 +20719,10 @@
|
|
|
20675
20719
|
var _paymentRoute$feeAmou;
|
|
20676
20720
|
callTracking({
|
|
20677
20721
|
blockchain: transaction.blockchain,
|
|
20678
|
-
transaction: transaction.id
|
|
20679
|
-
sender: transaction.from
|
|
20680
|
-
nonce: transaction.nonce,
|
|
20681
|
-
after_block: afterBlock,
|
|
20722
|
+
transaction: transaction.id,
|
|
20723
|
+
sender: transaction.from,
|
|
20724
|
+
nonce: transaction.nonce.toString(),
|
|
20725
|
+
after_block: afterBlock.toString(),
|
|
20682
20726
|
from_token: paymentRoute.fromToken.address,
|
|
20683
20727
|
from_amount: paymentRoute.fromAmount.toString(),
|
|
20684
20728
|
from_decimals: paymentRoute.fromDecimals,
|
|
@@ -20700,10 +20744,10 @@
|
|
|
20700
20744
|
}
|
|
20701
20745
|
var payment = {
|
|
20702
20746
|
blockchain: transaction.blockchain,
|
|
20703
|
-
transaction: transaction.id
|
|
20704
|
-
sender: transaction.from
|
|
20705
|
-
nonce: transaction.nonce,
|
|
20706
|
-
after_block: afterBlock,
|
|
20747
|
+
transaction: transaction.id,
|
|
20748
|
+
sender: transaction.from,
|
|
20749
|
+
nonce: transaction.nonce.toString(),
|
|
20750
|
+
after_block: afterBlock.toString(),
|
|
20707
20751
|
to_token: paymentRoute.toToken.address
|
|
20708
20752
|
};
|
|
20709
20753
|
var handlePollingResponse = function handlePollingResponse(data) {
|
|
@@ -20763,16 +20807,16 @@
|
|
|
20763
20807
|
body: JSON.stringify({
|
|
20764
20808
|
blockchain: transaction.blockchain,
|
|
20765
20809
|
transaction: transaction.id,
|
|
20766
|
-
sender: transaction.from
|
|
20767
|
-
nonce: transaction.nonce,
|
|
20810
|
+
sender: transaction.from,
|
|
20811
|
+
nonce: transaction.nonce.toString(),
|
|
20768
20812
|
receiver: paymentRoute.toAddress,
|
|
20769
20813
|
token: paymentRoute.toToken.address,
|
|
20770
20814
|
amount: paymentRoute.fee ? ethers.ethers.utils.formatUnits(paymentRoute.transaction.params.amounts[1], paymentRoute.toDecimals) : ethers.ethers.utils.formatUnits(paymentRoute.toAmount, paymentRoute.toDecimals),
|
|
20771
20815
|
confirmations: 1,
|
|
20772
|
-
after_block: afterBlock,
|
|
20816
|
+
after_block: afterBlock.toString(),
|
|
20773
20817
|
uuid: transaction.id,
|
|
20774
20818
|
payload: {
|
|
20775
|
-
sender_id: transaction.from
|
|
20819
|
+
sender_id: transaction.from,
|
|
20776
20820
|
sender_token_id: paymentRoute.fromToken.address,
|
|
20777
20821
|
sender_amount: ethers.ethers.utils.formatUnits(paymentRoute.fromAmount, paymentRoute.fromDecimals),
|
|
20778
20822
|
integration: integration,
|
|
@@ -20807,15 +20851,95 @@
|
|
|
20807
20851
|
setPaymentRoute(paymentRoute);
|
|
20808
20852
|
openSocket(transaction);
|
|
20809
20853
|
};
|
|
20854
|
+
var preTrack = function preTrack(afterBlock, paymentRoute) {
|
|
20855
|
+
if (!synchronousTracking && !asynchronousTracking) {
|
|
20856
|
+
return Promise.resolve();
|
|
20857
|
+
}
|
|
20858
|
+
return new Promise( /*#__PURE__*/function () {
|
|
20859
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(resolve, reject) {
|
|
20860
|
+
var _paymentRoute$feeAmou2;
|
|
20861
|
+
var payment;
|
|
20862
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
20863
|
+
while (1) switch (_context.prev = _context.next) {
|
|
20864
|
+
case 0:
|
|
20865
|
+
_context.t0 = paymentRoute.blockchain;
|
|
20866
|
+
_context.t1 = account;
|
|
20867
|
+
_context.next = 4;
|
|
20868
|
+
return web3Client.request({
|
|
20869
|
+
blockchain: paymentRoute.blockchain,
|
|
20870
|
+
address: account,
|
|
20871
|
+
method: 'transactionCount'
|
|
20872
|
+
});
|
|
20873
|
+
case 4:
|
|
20874
|
+
_context.t2 = _context.sent.toString();
|
|
20875
|
+
_context.t3 = afterBlock.toString();
|
|
20876
|
+
_context.t4 = paymentRoute.fromToken.address;
|
|
20877
|
+
_context.t5 = paymentRoute.fromAmount.toString();
|
|
20878
|
+
_context.t6 = paymentRoute.fromDecimals;
|
|
20879
|
+
_context.t7 = paymentRoute.toToken.address;
|
|
20880
|
+
_context.t8 = paymentRoute.toAmount.toString();
|
|
20881
|
+
_context.t9 = paymentRoute.toDecimals;
|
|
20882
|
+
_context.t10 = paymentRoute === null || paymentRoute === void 0 ? void 0 : (_paymentRoute$feeAmou2 = paymentRoute.feeAmount) === null || _paymentRoute$feeAmou2 === void 0 ? void 0 : _paymentRoute$feeAmou2.toString();
|
|
20883
|
+
payment = {
|
|
20884
|
+
blockchain: _context.t0,
|
|
20885
|
+
sender: _context.t1,
|
|
20886
|
+
nonce: _context.t2,
|
|
20887
|
+
after_block: _context.t3,
|
|
20888
|
+
from_token: _context.t4,
|
|
20889
|
+
from_amount: _context.t5,
|
|
20890
|
+
from_decimals: _context.t6,
|
|
20891
|
+
to_token: _context.t7,
|
|
20892
|
+
to_amount: _context.t8,
|
|
20893
|
+
to_decimals: _context.t9,
|
|
20894
|
+
fee_amount: _context.t10
|
|
20895
|
+
};
|
|
20896
|
+
if (!track.endpoint) {
|
|
20897
|
+
_context.next = 18;
|
|
20898
|
+
break;
|
|
20899
|
+
}
|
|
20900
|
+
return _context.abrupt("return", fetch(track.endpoint, {
|
|
20901
|
+
method: 'POST',
|
|
20902
|
+
headers: {
|
|
20903
|
+
'Content-Type': 'application/json'
|
|
20904
|
+
},
|
|
20905
|
+
body: JSON.stringify(payment)
|
|
20906
|
+
}).then(function (response) {
|
|
20907
|
+
if (response.status == 200 || response.status == 201) {
|
|
20908
|
+
console.log('PAYMENT PRETRACKING INITIALIZED');
|
|
20909
|
+
return resolve();
|
|
20910
|
+
} else {
|
|
20911
|
+
return reject('PRETRACKING REQUEST FAILED');
|
|
20912
|
+
}
|
|
20913
|
+
}));
|
|
20914
|
+
case 18:
|
|
20915
|
+
if (track.method) {
|
|
20916
|
+
track.method(payment).then(resolve)["catch"](reject);
|
|
20917
|
+
} else {
|
|
20918
|
+
reject('No tracking defined!');
|
|
20919
|
+
}
|
|
20920
|
+
case 19:
|
|
20921
|
+
case "end":
|
|
20922
|
+
return _context.stop();
|
|
20923
|
+
}
|
|
20924
|
+
}, _callee);
|
|
20925
|
+
}));
|
|
20926
|
+
return function (_x, _x2) {
|
|
20927
|
+
return _ref.apply(this, arguments);
|
|
20928
|
+
};
|
|
20929
|
+
}());
|
|
20930
|
+
};
|
|
20810
20931
|
return /*#__PURE__*/React__default["default"].createElement(PaymentTrackingContext.Provider, {
|
|
20811
20932
|
value: {
|
|
20812
20933
|
synchronousTracking: synchronousTracking,
|
|
20813
20934
|
asynchronousTracking: asynchronousTracking,
|
|
20814
20935
|
initializeTracking: initializeTracking,
|
|
20936
|
+
preTrack: preTrack,
|
|
20815
20937
|
trackingInitialized: trackingInitialized,
|
|
20816
20938
|
continueTryTracking: continueTryTracking,
|
|
20817
20939
|
release: release,
|
|
20818
|
-
forwardTo: forwardTo
|
|
20940
|
+
forwardTo: forwardTo,
|
|
20941
|
+
confirmationsRequired: confirmationsRequired,
|
|
20942
|
+
confirmationsPassed: confirmationsPassed
|
|
20819
20943
|
}
|
|
20820
20944
|
}, props.children);
|
|
20821
20945
|
});
|
|
@@ -20840,7 +20964,7 @@
|
|
|
20840
20964
|
React.useEffect(function () {
|
|
20841
20965
|
if (polling) {
|
|
20842
20966
|
var poll = function poll() {
|
|
20843
|
-
fetch("https://public.depay.com/transactions/".concat(givenTransaction.blockchain, "/").concat(givenTransaction.from
|
|
20967
|
+
fetch("https://public.depay.com/transactions/".concat(givenTransaction.blockchain, "/").concat(givenTransaction.from, "/").concat(givenTransaction.nonce)).then(function (response) {
|
|
20844
20968
|
if (response.status == 200) {
|
|
20845
20969
|
response.json().then(function (data) {
|
|
20846
20970
|
if (data.status != 'pending') {
|
|
@@ -20873,10 +20997,10 @@
|
|
|
20873
20997
|
},
|
|
20874
20998
|
body: JSON.stringify({
|
|
20875
20999
|
id: transaction.id,
|
|
20876
|
-
after_block: afterBlock,
|
|
21000
|
+
after_block: afterBlock.toString(),
|
|
20877
21001
|
blockchain: transaction.blockchain,
|
|
20878
|
-
sender: transaction.from
|
|
20879
|
-
nonce: transaction.nonce
|
|
21002
|
+
sender: transaction.from,
|
|
21003
|
+
nonce: transaction.nonce.toString()
|
|
20880
21004
|
})
|
|
20881
21005
|
}).then(function (response) {
|
|
20882
21006
|
if (response.status == 200 || response.status == 201) {
|
|
@@ -20901,14 +21025,18 @@
|
|
|
20901
21025
|
command: 'subscribe',
|
|
20902
21026
|
identifier: JSON.stringify({
|
|
20903
21027
|
blockchain: transaction.blockchain,
|
|
20904
|
-
sender: transaction.from
|
|
20905
|
-
nonce: transaction.nonce,
|
|
21028
|
+
sender: transaction.from,
|
|
21029
|
+
nonce: transaction.nonce.toString(),
|
|
20906
21030
|
channel: 'TransactionChannel'
|
|
20907
21031
|
})
|
|
20908
21032
|
};
|
|
20909
21033
|
socket.send(JSON.stringify(msg));
|
|
20910
21034
|
};
|
|
20911
|
-
socket.onclose = function (event) {
|
|
21035
|
+
socket.onclose = function (event) {
|
|
21036
|
+
if (!event || event.code != 1000) {
|
|
21037
|
+
openSocket(transaction);
|
|
21038
|
+
}
|
|
21039
|
+
};
|
|
20912
21040
|
socket.onmessage = function (event) {
|
|
20913
21041
|
var item = JSON.parse(event.data);
|
|
20914
21042
|
if (item.type === "ping") {
|
|
@@ -20916,6 +21044,7 @@
|
|
|
20916
21044
|
}
|
|
20917
21045
|
if (item.message && item.message.status && item.message.status != 'pending') {
|
|
20918
21046
|
setFoundTransaction(item.message);
|
|
21047
|
+
socket.close(1000);
|
|
20919
21048
|
}
|
|
20920
21049
|
};
|
|
20921
21050
|
socket.onerror = function (error) {
|
|
@@ -20996,34 +21125,32 @@
|
|
|
20996
21125
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
20997
21126
|
var accept;
|
|
20998
21127
|
return regenerator.wrap(function _callee$(_context) {
|
|
20999
|
-
while (1) {
|
|
21000
|
-
|
|
21001
|
-
|
|
21002
|
-
|
|
21003
|
-
|
|
21004
|
-
|
|
21005
|
-
|
|
21128
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21129
|
+
case 0:
|
|
21130
|
+
accept = _ref.accept;
|
|
21131
|
+
if (!(!(accept instanceof Array) || accept.length == 0)) {
|
|
21132
|
+
_context.next = 3;
|
|
21133
|
+
break;
|
|
21134
|
+
}
|
|
21135
|
+
throw 'You need to set the tokens you accept as donation!';
|
|
21136
|
+
case 3:
|
|
21137
|
+
accept.forEach(function (configuration) {
|
|
21138
|
+
if (typeof configuration.blockchain === 'undefined') {
|
|
21139
|
+
throw 'You need to set the blockchain you want to receive the donation on!';
|
|
21006
21140
|
}
|
|
21007
|
-
|
|
21008
|
-
|
|
21009
|
-
|
|
21010
|
-
|
|
21011
|
-
|
|
21012
|
-
|
|
21013
|
-
|
|
21014
|
-
|
|
21015
|
-
|
|
21016
|
-
|
|
21017
|
-
|
|
21018
|
-
|
|
21019
|
-
|
|
21020
|
-
throw 'You need to set the receiver address that you want to receive the donation!';
|
|
21021
|
-
}
|
|
21022
|
-
});
|
|
21023
|
-
case 4:
|
|
21024
|
-
case "end":
|
|
21025
|
-
return _context.stop();
|
|
21026
|
-
}
|
|
21141
|
+
if (!['ethereum', 'bsc', 'polygon'].includes(configuration.blockchain)) {
|
|
21142
|
+
throw 'You need to set a supported blockchain!';
|
|
21143
|
+
}
|
|
21144
|
+
if (typeof configuration.token === 'undefined') {
|
|
21145
|
+
throw 'You need to set the token you want to receive as donation!';
|
|
21146
|
+
}
|
|
21147
|
+
if (typeof configuration.receiver === 'undefined') {
|
|
21148
|
+
throw 'You need to set the receiver address that you want to receive the donation!';
|
|
21149
|
+
}
|
|
21150
|
+
});
|
|
21151
|
+
case 4:
|
|
21152
|
+
case "end":
|
|
21153
|
+
return _context.stop();
|
|
21027
21154
|
}
|
|
21028
21155
|
}, _callee);
|
|
21029
21156
|
}));
|
|
@@ -21035,82 +21162,80 @@
|
|
|
21035
21162
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
21036
21163
|
var amount, accept, event, sent, succeeded, validated, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, fee, closable, integration, link, container, title, document, unmount;
|
|
21037
21164
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
21038
|
-
while (1) {
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
return
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21065
|
-
|
|
21066
|
-
|
|
21067
|
-
|
|
21068
|
-
|
|
21069
|
-
|
|
21070
|
-
|
|
21071
|
-
|
|
21072
|
-
|
|
21073
|
-
|
|
21074
|
-
|
|
21075
|
-
|
|
21076
|
-
|
|
21077
|
-
|
|
21078
|
-
|
|
21079
|
-
|
|
21080
|
-
|
|
21081
|
-
|
|
21082
|
-
|
|
21083
|
-
|
|
21084
|
-
|
|
21085
|
-
|
|
21086
|
-
|
|
21087
|
-
|
|
21088
|
-
|
|
21089
|
-
|
|
21090
|
-
|
|
21091
|
-
|
|
21092
|
-
|
|
21093
|
-
|
|
21094
|
-
|
|
21095
|
-
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21106
|
-
|
|
21107
|
-
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
|
|
21112
|
-
return _context2.stop();
|
|
21113
|
-
}
|
|
21165
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
21166
|
+
case 0:
|
|
21167
|
+
amount = _ref3.amount, accept = _ref3.accept, event = _ref3.event, sent = _ref3.sent, succeeded = _ref3.succeeded, validated = _ref3.validated, 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, closable = _ref3.closable, integration = _ref3.integration, link = _ref3.link, container = _ref3.container, title = _ref3.title, document = _ref3.document;
|
|
21168
|
+
requireReactVersion();
|
|
21169
|
+
_context2.prev = 2;
|
|
21170
|
+
_context2.next = 5;
|
|
21171
|
+
return preflight$2({
|
|
21172
|
+
accept: accept
|
|
21173
|
+
});
|
|
21174
|
+
case 5:
|
|
21175
|
+
unmount = mount({
|
|
21176
|
+
style: style,
|
|
21177
|
+
container: container,
|
|
21178
|
+
document: ensureDocument(document),
|
|
21179
|
+
closed: closed
|
|
21180
|
+
}, function (unmount) {
|
|
21181
|
+
return function (container) {
|
|
21182
|
+
return /*#__PURE__*/React__default["default"].createElement(ErrorProvider, {
|
|
21183
|
+
errorCallback: error,
|
|
21184
|
+
container: container,
|
|
21185
|
+
unmount: unmount
|
|
21186
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConfigurationProvider, {
|
|
21187
|
+
configuration: {
|
|
21188
|
+
type: 'donation',
|
|
21189
|
+
amount: amount,
|
|
21190
|
+
accept: accept,
|
|
21191
|
+
currency: currency,
|
|
21192
|
+
event: event,
|
|
21193
|
+
track: track,
|
|
21194
|
+
fee: fee,
|
|
21195
|
+
sent: sent,
|
|
21196
|
+
succeeded: succeeded,
|
|
21197
|
+
validated: validated,
|
|
21198
|
+
failed: failed,
|
|
21199
|
+
blacklist: blacklist,
|
|
21200
|
+
whitelist: whitelist,
|
|
21201
|
+
providers: providers,
|
|
21202
|
+
integration: integration,
|
|
21203
|
+
link: link,
|
|
21204
|
+
title: title
|
|
21205
|
+
}
|
|
21206
|
+
}, /*#__PURE__*/React__default["default"].createElement(UpdatableProvider, null, /*#__PURE__*/React__default["default"].createElement(ClosableProvider, {
|
|
21207
|
+
unmount: unmount,
|
|
21208
|
+
closable: closable
|
|
21209
|
+
}, /*#__PURE__*/React__default["default"].createElement(WalletProvider, {
|
|
21210
|
+
container: container,
|
|
21211
|
+
connected: connected,
|
|
21212
|
+
unmount: unmount
|
|
21213
|
+
}, /*#__PURE__*/React__default["default"].createElement(NavigateProvider, null, /*#__PURE__*/React__default["default"].createElement(ConversionRateProvider, null, /*#__PURE__*/React__default["default"].createElement(ChangableAmountProvider, {
|
|
21214
|
+
accept: accept
|
|
21215
|
+
}, /*#__PURE__*/React__default["default"].createElement(TransactionTrackingProvider, null, /*#__PURE__*/React__default["default"].createElement(PaymentTrackingProvider, {
|
|
21216
|
+
document: ensureDocument(document)
|
|
21217
|
+
}, /*#__PURE__*/React__default["default"].createElement(DonationRoutingProvider, {
|
|
21218
|
+
container: container,
|
|
21219
|
+
document: document
|
|
21220
|
+
}, /*#__PURE__*/React__default["default"].createElement(DonationStack, {
|
|
21221
|
+
document: document,
|
|
21222
|
+
container: container
|
|
21223
|
+
}), /*#__PURE__*/React__default["default"].createElement(PoweredBy, null))))))))))));
|
|
21224
|
+
};
|
|
21225
|
+
});
|
|
21226
|
+
return _context2.abrupt("return", {
|
|
21227
|
+
unmount: unmount
|
|
21228
|
+
});
|
|
21229
|
+
case 9:
|
|
21230
|
+
_context2.prev = 9;
|
|
21231
|
+
_context2.t0 = _context2["catch"](2);
|
|
21232
|
+
console.log('critical error', _context2.t0);
|
|
21233
|
+
if (critical != undefined) {
|
|
21234
|
+
critical(_context2.t0);
|
|
21235
|
+
}
|
|
21236
|
+
case 13:
|
|
21237
|
+
case "end":
|
|
21238
|
+
return _context2.stop();
|
|
21114
21239
|
}
|
|
21115
21240
|
}, _callee2, null, [[2, 9]]);
|
|
21116
21241
|
}));
|
|
@@ -21231,46 +21356,44 @@
|
|
|
21231
21356
|
return new Promise( /*#__PURE__*/function () {
|
|
21232
21357
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_resolve, reject) {
|
|
21233
21358
|
return regenerator.wrap(function _callee$(_context) {
|
|
21234
|
-
while (1) {
|
|
21235
|
-
|
|
21236
|
-
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
|
|
21240
|
-
|
|
21241
|
-
|
|
21242
|
-
|
|
21243
|
-
|
|
21244
|
-
|
|
21245
|
-
|
|
21246
|
-
return
|
|
21247
|
-
|
|
21248
|
-
|
|
21249
|
-
|
|
21250
|
-
|
|
21251
|
-
|
|
21252
|
-
|
|
21253
|
-
|
|
21254
|
-
|
|
21255
|
-
|
|
21256
|
-
|
|
21257
|
-
|
|
21258
|
-
|
|
21259
|
-
|
|
21260
|
-
|
|
21261
|
-
|
|
21262
|
-
|
|
21263
|
-
|
|
21264
|
-
|
|
21265
|
-
|
|
21266
|
-
|
|
21267
|
-
|
|
21268
|
-
|
|
21269
|
-
|
|
21270
|
-
|
|
21271
|
-
|
|
21272
|
-
return _context.stop();
|
|
21273
|
-
}
|
|
21359
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21360
|
+
case 0:
|
|
21361
|
+
Connect().then(function () {
|
|
21362
|
+
mount({
|
|
21363
|
+
style: style,
|
|
21364
|
+
document: ensureDocument(document)
|
|
21365
|
+
}, function (unmount) {
|
|
21366
|
+
var userClosedDialog = function userClosedDialog() {
|
|
21367
|
+
reject('USER_CLOSED_DIALOG');
|
|
21368
|
+
unmount();
|
|
21369
|
+
};
|
|
21370
|
+
return function (container) {
|
|
21371
|
+
return /*#__PURE__*/React__default["default"].createElement(ErrorProvider, {
|
|
21372
|
+
errorCallback: error,
|
|
21373
|
+
container: container,
|
|
21374
|
+
unmount: unmount
|
|
21375
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConfigurationProvider, {
|
|
21376
|
+
configuration: {
|
|
21377
|
+
message: message,
|
|
21378
|
+
endpoint: endpoint || '/login',
|
|
21379
|
+
recover: recover
|
|
21380
|
+
}
|
|
21381
|
+
}, /*#__PURE__*/React__default["default"].createElement(UpdatableProvider, null, /*#__PURE__*/React__default["default"].createElement(ClosableProvider, {
|
|
21382
|
+
unmount: userClosedDialog
|
|
21383
|
+
}, /*#__PURE__*/React__default["default"].createElement(LoginStack, {
|
|
21384
|
+
document: document,
|
|
21385
|
+
container: container,
|
|
21386
|
+
resolve: function resolve(account) {
|
|
21387
|
+
unmount();
|
|
21388
|
+
_resolve(account);
|
|
21389
|
+
}
|
|
21390
|
+
}), /*#__PURE__*/React__default["default"].createElement(PoweredBy, null)))));
|
|
21391
|
+
};
|
|
21392
|
+
});
|
|
21393
|
+
})["catch"](reject);
|
|
21394
|
+
case 1:
|
|
21395
|
+
case "end":
|
|
21396
|
+
return _context.stop();
|
|
21274
21397
|
}
|
|
21275
21398
|
}, _callee);
|
|
21276
21399
|
}));
|
|
@@ -21445,6 +21568,44 @@
|
|
|
21445
21568
|
});
|
|
21446
21569
|
});
|
|
21447
21570
|
|
|
21571
|
+
var PreTrackingFailedDialog = (function () {
|
|
21572
|
+
var _useContext = React.useContext(PaymentContext);
|
|
21573
|
+
_useContext.transaction;
|
|
21574
|
+
var _useContext2 = React.useContext(reactDialogStack.NavigateStackContext),
|
|
21575
|
+
navigate = _useContext2.navigate;
|
|
21576
|
+
var tryAgain = function tryAgain() {
|
|
21577
|
+
navigate('back');
|
|
21578
|
+
};
|
|
21579
|
+
return /*#__PURE__*/React__default["default"].createElement(Dialog$1, {
|
|
21580
|
+
stacked: false,
|
|
21581
|
+
header: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21582
|
+
className: "PaddingTopS PaddingLeftM PaddingRightM"
|
|
21583
|
+
}),
|
|
21584
|
+
body: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21585
|
+
className: "TextCenter"
|
|
21586
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21587
|
+
className: "GraphicWrapper"
|
|
21588
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
21589
|
+
className: "Graphic",
|
|
21590
|
+
src: ErrorGraphic
|
|
21591
|
+
})), /*#__PURE__*/React__default["default"].createElement("h1", {
|
|
21592
|
+
className: "LineHeightL Text FontSizeL PaddingTopS FontWeightBold"
|
|
21593
|
+
}, "Tracking payment failed"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21594
|
+
className: "Text PaddingTopS PaddingBottomS PaddingLeftS PaddingRightS"
|
|
21595
|
+
}, /*#__PURE__*/React__default["default"].createElement("strong", {
|
|
21596
|
+
className: "FontSizeM"
|
|
21597
|
+
}, "Please ensure you are connected to the internet, then click \"Try again\"."), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21598
|
+
className: "PaddingTopS"
|
|
21599
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", null, "If this keeps happening, please report it.")))),
|
|
21600
|
+
footer: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21601
|
+
className: "PaddingTopXS PaddingRightM PaddingLeftM PaddingBottomM"
|
|
21602
|
+
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
21603
|
+
className: "ButtonPrimary",
|
|
21604
|
+
onClick: tryAgain
|
|
21605
|
+
}, "Try again"))
|
|
21606
|
+
});
|
|
21607
|
+
});
|
|
21608
|
+
|
|
21448
21609
|
var TrackingFailedDialog = (function () {
|
|
21449
21610
|
var _useContext = React.useContext(PaymentTrackingContext),
|
|
21450
21611
|
continueTryTracking = _useContext.continueTryTracking;
|
|
@@ -21505,7 +21666,8 @@
|
|
|
21505
21666
|
ChangePayment: /*#__PURE__*/React__default["default"].createElement(ChangePaymentDialog, null),
|
|
21506
21667
|
PaymentFailed: /*#__PURE__*/React__default["default"].createElement(PaymentFailedDialog, null),
|
|
21507
21668
|
WrongNetwork: /*#__PURE__*/React__default["default"].createElement(WrongNetworkDialog, null),
|
|
21508
|
-
TrackingFailed: /*#__PURE__*/React__default["default"].createElement(TrackingFailedDialog, null)
|
|
21669
|
+
TrackingFailed: /*#__PURE__*/React__default["default"].createElement(TrackingFailedDialog, null),
|
|
21670
|
+
PreTrackingFailed: /*#__PURE__*/React__default["default"].createElement(PreTrackingFailedDialog, null)
|
|
21509
21671
|
}
|
|
21510
21672
|
});
|
|
21511
21673
|
});
|
|
@@ -21514,37 +21676,35 @@
|
|
|
21514
21676
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
21515
21677
|
var accept, recover;
|
|
21516
21678
|
return regenerator.wrap(function _callee$(_context) {
|
|
21517
|
-
while (1) {
|
|
21518
|
-
|
|
21519
|
-
|
|
21520
|
-
|
|
21521
|
-
|
|
21522
|
-
|
|
21523
|
-
|
|
21679
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21680
|
+
case 0:
|
|
21681
|
+
accept = _ref.accept, recover = _ref.recover;
|
|
21682
|
+
if (!recover) {
|
|
21683
|
+
_context.next = 3;
|
|
21684
|
+
break;
|
|
21685
|
+
}
|
|
21686
|
+
return _context.abrupt("return");
|
|
21687
|
+
case 3:
|
|
21688
|
+
accept.forEach(function (configuration) {
|
|
21689
|
+
if (typeof configuration.blockchain === 'undefined') {
|
|
21690
|
+
throw 'You need to set the blockchain your want to receive the payment on!';
|
|
21524
21691
|
}
|
|
21525
|
-
|
|
21526
|
-
|
|
21527
|
-
|
|
21528
|
-
|
|
21529
|
-
|
|
21530
|
-
|
|
21531
|
-
|
|
21532
|
-
|
|
21533
|
-
|
|
21534
|
-
|
|
21535
|
-
|
|
21536
|
-
|
|
21537
|
-
|
|
21538
|
-
|
|
21539
|
-
|
|
21540
|
-
|
|
21541
|
-
throw 'You need to set the receiver address that you want to receive the payment!';
|
|
21542
|
-
}
|
|
21543
|
-
});
|
|
21544
|
-
case 4:
|
|
21545
|
-
case "end":
|
|
21546
|
-
return _context.stop();
|
|
21547
|
-
}
|
|
21692
|
+
if (!['ethereum', 'bsc', 'polygon'].includes(configuration.blockchain)) {
|
|
21693
|
+
throw 'You need to set a supported blockchain!';
|
|
21694
|
+
}
|
|
21695
|
+
if (typeof configuration.token === 'undefined' && typeof configuration.fromToken === 'undefined' && typeof configuration.fromAmount === 'undefined' && typeof configuration.toToken === 'undefined') {
|
|
21696
|
+
throw 'You need to set the token you want to receive as payment!';
|
|
21697
|
+
}
|
|
21698
|
+
if (typeof configuration.token === 'undefined' && typeof configuration.fromToken !== 'undefined' && typeof configuration.fromAmount === 'undefined' && typeof configuration.toToken === 'undefined') {
|
|
21699
|
+
throw 'You need to set the fromToken, fromAmount and toToken!';
|
|
21700
|
+
}
|
|
21701
|
+
if (typeof configuration.receiver === 'undefined') {
|
|
21702
|
+
throw 'You need to set the receiver address that you want to receive the payment!';
|
|
21703
|
+
}
|
|
21704
|
+
});
|
|
21705
|
+
case 4:
|
|
21706
|
+
case "end":
|
|
21707
|
+
return _context.stop();
|
|
21548
21708
|
}
|
|
21549
21709
|
}, _callee);
|
|
21550
21710
|
}));
|
|
@@ -21554,93 +21714,91 @@
|
|
|
21554
21714
|
}();
|
|
21555
21715
|
var Payment = /*#__PURE__*/function () {
|
|
21556
21716
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
21557
|
-
var accept, amount,
|
|
21717
|
+
var accept, amount, sent, succeeded, validated, failed, error, critical, style, whitelist, blacklist, providers, currency, connected, closed, track, fee, recover, closable, integration, link, container, before, document, unmount;
|
|
21558
21718
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
21559
|
-
while (1) {
|
|
21560
|
-
|
|
21561
|
-
|
|
21562
|
-
|
|
21563
|
-
|
|
21564
|
-
|
|
21565
|
-
|
|
21566
|
-
|
|
21567
|
-
|
|
21568
|
-
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
|
|
21572
|
-
|
|
21573
|
-
|
|
21574
|
-
|
|
21575
|
-
|
|
21576
|
-
|
|
21577
|
-
return
|
|
21578
|
-
|
|
21579
|
-
|
|
21580
|
-
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21584
|
-
|
|
21585
|
-
|
|
21586
|
-
amount: amount,
|
|
21587
|
-
accept: accept,
|
|
21588
|
-
currency: currency,
|
|
21589
|
-
event: event,
|
|
21590
|
-
sent: sent,
|
|
21591
|
-
succeeded: succeeded,
|
|
21592
|
-
validated: validated,
|
|
21593
|
-
failed: failed,
|
|
21594
|
-
whitelist: whitelist,
|
|
21595
|
-
blacklist: blacklist,
|
|
21596
|
-
providers: providers,
|
|
21597
|
-
track: track,
|
|
21598
|
-
fee: fee,
|
|
21599
|
-
recover: recover,
|
|
21600
|
-
integration: integration,
|
|
21601
|
-
link: link
|
|
21602
|
-
}
|
|
21603
|
-
}, /*#__PURE__*/React__default["default"].createElement(UpdatableProvider, null, /*#__PURE__*/React__default["default"].createElement(ClosableProvider, {
|
|
21604
|
-
unmount: unmount,
|
|
21605
|
-
closable: closable
|
|
21606
|
-
}, /*#__PURE__*/React__default["default"].createElement(WalletProvider, {
|
|
21607
|
-
document: document,
|
|
21608
|
-
container: container,
|
|
21609
|
-
connected: connected,
|
|
21610
|
-
unmount: unmount
|
|
21611
|
-
}, /*#__PURE__*/React__default["default"].createElement(NavigateProvider, null, /*#__PURE__*/React__default["default"].createElement(ConversionRateProvider, null, /*#__PURE__*/React__default["default"].createElement(ChangableAmountProvider, {
|
|
21612
|
-
accept: accept
|
|
21613
|
-
}, /*#__PURE__*/React__default["default"].createElement(PaymentAmountRoutingProvider, {
|
|
21719
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
21720
|
+
case 0:
|
|
21721
|
+
accept = _ref3.accept, amount = _ref3.amount, sent = _ref3.sent, succeeded = _ref3.succeeded, validated = _ref3.validated, 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, recover = _ref3.recover, closable = _ref3.closable, integration = _ref3.integration, link = _ref3.link, container = _ref3.container, before = _ref3.before, document = _ref3.document;
|
|
21722
|
+
requireReactVersion();
|
|
21723
|
+
_context2.prev = 2;
|
|
21724
|
+
_context2.next = 5;
|
|
21725
|
+
return preflight$1({
|
|
21726
|
+
accept: accept,
|
|
21727
|
+
recover: recover
|
|
21728
|
+
});
|
|
21729
|
+
case 5:
|
|
21730
|
+
unmount = mount({
|
|
21731
|
+
style: style,
|
|
21732
|
+
container: container,
|
|
21733
|
+
document: ensureDocument(document),
|
|
21734
|
+
closed: closed
|
|
21735
|
+
}, function (unmount) {
|
|
21736
|
+
return function (container) {
|
|
21737
|
+
return /*#__PURE__*/React__default["default"].createElement(ErrorProvider, {
|
|
21738
|
+
errorCallback: error,
|
|
21739
|
+
container: container,
|
|
21740
|
+
unmount: unmount
|
|
21741
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConfigurationProvider, {
|
|
21742
|
+
configuration: {
|
|
21743
|
+
type: 'payment',
|
|
21744
|
+
before: before,
|
|
21745
|
+
amount: amount,
|
|
21614
21746
|
accept: accept,
|
|
21747
|
+
currency: currency,
|
|
21748
|
+
event: event,
|
|
21749
|
+
sent: sent,
|
|
21750
|
+
succeeded: succeeded,
|
|
21751
|
+
validated: validated,
|
|
21752
|
+
failed: failed,
|
|
21615
21753
|
whitelist: whitelist,
|
|
21616
21754
|
blacklist: blacklist,
|
|
21617
|
-
|
|
21618
|
-
|
|
21619
|
-
|
|
21620
|
-
|
|
21621
|
-
|
|
21622
|
-
|
|
21623
|
-
|
|
21624
|
-
|
|
21625
|
-
|
|
21626
|
-
|
|
21627
|
-
|
|
21628
|
-
|
|
21629
|
-
|
|
21630
|
-
|
|
21631
|
-
|
|
21632
|
-
|
|
21633
|
-
|
|
21634
|
-
|
|
21635
|
-
|
|
21636
|
-
|
|
21637
|
-
|
|
21638
|
-
|
|
21639
|
-
|
|
21640
|
-
|
|
21641
|
-
|
|
21642
|
-
|
|
21643
|
-
|
|
21755
|
+
providers: providers,
|
|
21756
|
+
track: track,
|
|
21757
|
+
fee: fee,
|
|
21758
|
+
recover: recover,
|
|
21759
|
+
integration: integration,
|
|
21760
|
+
link: link
|
|
21761
|
+
}
|
|
21762
|
+
}, /*#__PURE__*/React__default["default"].createElement(UpdatableProvider, null, /*#__PURE__*/React__default["default"].createElement(ClosableProvider, {
|
|
21763
|
+
unmount: unmount,
|
|
21764
|
+
closable: closable
|
|
21765
|
+
}, /*#__PURE__*/React__default["default"].createElement(WalletProvider, {
|
|
21766
|
+
document: document,
|
|
21767
|
+
container: container,
|
|
21768
|
+
connected: connected,
|
|
21769
|
+
unmount: unmount
|
|
21770
|
+
}, /*#__PURE__*/React__default["default"].createElement(NavigateProvider, null, /*#__PURE__*/React__default["default"].createElement(ConversionRateProvider, null, /*#__PURE__*/React__default["default"].createElement(ChangableAmountProvider, {
|
|
21771
|
+
accept: accept
|
|
21772
|
+
}, /*#__PURE__*/React__default["default"].createElement(PaymentAmountRoutingProvider, {
|
|
21773
|
+
accept: accept,
|
|
21774
|
+
whitelist: whitelist,
|
|
21775
|
+
blacklist: blacklist,
|
|
21776
|
+
event: event,
|
|
21777
|
+
fee: fee
|
|
21778
|
+
}, /*#__PURE__*/React__default["default"].createElement(TransactionTrackingProvider, null, /*#__PURE__*/React__default["default"].createElement(PaymentTrackingProvider, {
|
|
21779
|
+
document: ensureDocument(document)
|
|
21780
|
+
}, /*#__PURE__*/React__default["default"].createElement(PaymentProvider, {
|
|
21781
|
+
container: container,
|
|
21782
|
+
document: document
|
|
21783
|
+
}, /*#__PURE__*/React__default["default"].createElement(PaymentValueProvider, null, /*#__PURE__*/React__default["default"].createElement(PaymentStack, {
|
|
21784
|
+
document: document,
|
|
21785
|
+
container: container
|
|
21786
|
+
}), /*#__PURE__*/React__default["default"].createElement(PoweredBy, null))))))))))))));
|
|
21787
|
+
};
|
|
21788
|
+
});
|
|
21789
|
+
return _context2.abrupt("return", {
|
|
21790
|
+
unmount: unmount
|
|
21791
|
+
});
|
|
21792
|
+
case 9:
|
|
21793
|
+
_context2.prev = 9;
|
|
21794
|
+
_context2.t0 = _context2["catch"](2);
|
|
21795
|
+
console.log('critical error', _context2.t0);
|
|
21796
|
+
if (critical != undefined) {
|
|
21797
|
+
critical(_context2.t0);
|
|
21798
|
+
}
|
|
21799
|
+
case 13:
|
|
21800
|
+
case "end":
|
|
21801
|
+
return _context2.stop();
|
|
21644
21802
|
}
|
|
21645
21803
|
}, _callee2, null, [[2, 9]]);
|
|
21646
21804
|
}));
|
|
@@ -21652,15 +21810,14 @@
|
|
|
21652
21810
|
var account = _ref5.account,
|
|
21653
21811
|
accept = _ref5.accept,
|
|
21654
21812
|
whitelist = _ref5.whitelist,
|
|
21655
|
-
blacklist = _ref5.blacklist
|
|
21656
|
-
|
|
21657
|
-
fee = _ref5.fee;
|
|
21813
|
+
blacklist = _ref5.blacklist;
|
|
21814
|
+
_ref5.event;
|
|
21815
|
+
var fee = _ref5.fee;
|
|
21658
21816
|
routePayments({
|
|
21659
21817
|
account: account,
|
|
21660
21818
|
accept: accept,
|
|
21661
21819
|
whitelist: whitelist,
|
|
21662
21820
|
blacklist: blacklist,
|
|
21663
|
-
event: event,
|
|
21664
21821
|
fee: fee
|
|
21665
21822
|
});
|
|
21666
21823
|
};
|
|
@@ -21926,31 +22083,29 @@
|
|
|
21926
22083
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(_ref) {
|
|
21927
22084
|
var sell;
|
|
21928
22085
|
return regenerator.wrap(function _callee$(_context) {
|
|
21929
|
-
while (1) {
|
|
21930
|
-
|
|
21931
|
-
|
|
21932
|
-
|
|
21933
|
-
|
|
21934
|
-
|
|
21935
|
-
|
|
21936
|
-
|
|
21937
|
-
|
|
21938
|
-
|
|
21939
|
-
|
|
21940
|
-
|
|
21941
|
-
|
|
21942
|
-
|
|
21943
|
-
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
21952
|
-
return _context.stop();
|
|
21953
|
-
}
|
|
22086
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22087
|
+
case 0:
|
|
22088
|
+
sell = _ref.sell;
|
|
22089
|
+
if (!(_typeof(sell) != 'object')) {
|
|
22090
|
+
_context.next = 3;
|
|
22091
|
+
break;
|
|
22092
|
+
}
|
|
22093
|
+
throw 'You need to configure at least 1 "blockchain": "token"';
|
|
22094
|
+
case 3:
|
|
22095
|
+
if (!(Object.keys(sell).length == 0)) {
|
|
22096
|
+
_context.next = 5;
|
|
22097
|
+
break;
|
|
22098
|
+
}
|
|
22099
|
+
throw 'You need to configure at least 1 "blockchain": "token"';
|
|
22100
|
+
case 5:
|
|
22101
|
+
if (!(Object.values(sell).length == 0)) {
|
|
22102
|
+
_context.next = 7;
|
|
22103
|
+
break;
|
|
22104
|
+
}
|
|
22105
|
+
throw 'You need to configure at least 1 "blockchain": "token"';
|
|
22106
|
+
case 7:
|
|
22107
|
+
case "end":
|
|
22108
|
+
return _context.stop();
|
|
21954
22109
|
}
|
|
21955
22110
|
}, _callee);
|
|
21956
22111
|
}));
|
|
@@ -21962,81 +22117,79 @@
|
|
|
21962
22117
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(_ref3) {
|
|
21963
22118
|
var amount, sell, sent, succeeded, failed, error, critical, style, blacklist, providers, currency, connected, closed, tokenImage, closable, integration, document, accept, unmount;
|
|
21964
22119
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
21965
|
-
while (1) {
|
|
21966
|
-
|
|
21967
|
-
|
|
21968
|
-
|
|
21969
|
-
|
|
21970
|
-
|
|
21971
|
-
|
|
21972
|
-
|
|
21973
|
-
|
|
21974
|
-
|
|
21975
|
-
|
|
21976
|
-
|
|
21977
|
-
|
|
21978
|
-
|
|
21979
|
-
|
|
21980
|
-
|
|
21981
|
-
|
|
21982
|
-
|
|
21983
|
-
|
|
21984
|
-
|
|
21985
|
-
|
|
21986
|
-
|
|
21987
|
-
return
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
21991
|
-
|
|
21992
|
-
|
|
21993
|
-
|
|
21994
|
-
|
|
21995
|
-
|
|
21996
|
-
|
|
21997
|
-
|
|
21998
|
-
|
|
21999
|
-
|
|
22000
|
-
|
|
22001
|
-
|
|
22002
|
-
|
|
22003
|
-
|
|
22004
|
-
|
|
22005
|
-
|
|
22006
|
-
|
|
22007
|
-
|
|
22008
|
-
|
|
22009
|
-
|
|
22010
|
-
|
|
22011
|
-
|
|
22012
|
-
|
|
22013
|
-
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
|
|
22018
|
-
|
|
22019
|
-
|
|
22020
|
-
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
|
|
22024
|
-
|
|
22025
|
-
|
|
22026
|
-
|
|
22027
|
-
|
|
22028
|
-
|
|
22029
|
-
|
|
22030
|
-
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
|
|
22034
|
-
|
|
22035
|
-
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
return _context2.stop();
|
|
22039
|
-
}
|
|
22120
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
22121
|
+
case 0:
|
|
22122
|
+
amount = _ref3.amount, sell = _ref3.sell, sent = _ref3.sent, succeeded = _ref3.succeeded, 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, tokenImage = _ref3.tokenImage, closable = _ref3.closable, integration = _ref3.integration, document = _ref3.document;
|
|
22123
|
+
requireReactVersion();
|
|
22124
|
+
_context2.prev = 2;
|
|
22125
|
+
_context2.next = 5;
|
|
22126
|
+
return preflight({
|
|
22127
|
+
sell: sell
|
|
22128
|
+
});
|
|
22129
|
+
case 5:
|
|
22130
|
+
accept = Object.keys(sell).map(function (key) {
|
|
22131
|
+
return {
|
|
22132
|
+
blockchain: key,
|
|
22133
|
+
token: sell[key]
|
|
22134
|
+
};
|
|
22135
|
+
});
|
|
22136
|
+
unmount = mount({
|
|
22137
|
+
style: style,
|
|
22138
|
+
document: ensureDocument(document),
|
|
22139
|
+
closed: closed
|
|
22140
|
+
}, function (unmount) {
|
|
22141
|
+
return function (container) {
|
|
22142
|
+
return /*#__PURE__*/React__default["default"].createElement(ErrorProvider, {
|
|
22143
|
+
errorCallback: error,
|
|
22144
|
+
container: container,
|
|
22145
|
+
unmount: unmount
|
|
22146
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConfigurationProvider, {
|
|
22147
|
+
configuration: {
|
|
22148
|
+
type: 'sale',
|
|
22149
|
+
tokenImage: tokenImage,
|
|
22150
|
+
amount: amount,
|
|
22151
|
+
sell: sell,
|
|
22152
|
+
currency: currency,
|
|
22153
|
+
sent: sent,
|
|
22154
|
+
succeeded: succeeded,
|
|
22155
|
+
failed: failed,
|
|
22156
|
+
blacklist: blacklist,
|
|
22157
|
+
providers: providers,
|
|
22158
|
+
integration: integration
|
|
22159
|
+
}
|
|
22160
|
+
}, /*#__PURE__*/React__default["default"].createElement(UpdatableProvider, null, /*#__PURE__*/React__default["default"].createElement(ClosableProvider, {
|
|
22161
|
+
unmount: unmount,
|
|
22162
|
+
closable: closable
|
|
22163
|
+
}, /*#__PURE__*/React__default["default"].createElement(WalletProvider, {
|
|
22164
|
+
container: container,
|
|
22165
|
+
connected: connected,
|
|
22166
|
+
unmount: unmount
|
|
22167
|
+
}, /*#__PURE__*/React__default["default"].createElement(NavigateProvider, null, /*#__PURE__*/React__default["default"].createElement(ConversionRateProvider, null, /*#__PURE__*/React__default["default"].createElement(ChangableAmountProvider, {
|
|
22168
|
+
accept: accept
|
|
22169
|
+
}, /*#__PURE__*/React__default["default"].createElement(TransactionTrackingProvider, null, /*#__PURE__*/React__default["default"].createElement(PaymentTrackingProvider, {
|
|
22170
|
+
document: ensureDocument(document)
|
|
22171
|
+
}, /*#__PURE__*/React__default["default"].createElement(SaleRoutingProvider, {
|
|
22172
|
+
container: container,
|
|
22173
|
+
document: document
|
|
22174
|
+
}, /*#__PURE__*/React__default["default"].createElement(SaleStack, {
|
|
22175
|
+
document: document,
|
|
22176
|
+
container: container
|
|
22177
|
+
}), /*#__PURE__*/React__default["default"].createElement(PoweredBy, null))))))))))));
|
|
22178
|
+
};
|
|
22179
|
+
});
|
|
22180
|
+
return _context2.abrupt("return", {
|
|
22181
|
+
unmount: unmount
|
|
22182
|
+
});
|
|
22183
|
+
case 10:
|
|
22184
|
+
_context2.prev = 10;
|
|
22185
|
+
_context2.t0 = _context2["catch"](2);
|
|
22186
|
+
console.log('critical error', _context2.t0);
|
|
22187
|
+
if (critical != undefined) {
|
|
22188
|
+
critical(_context2.t0);
|
|
22189
|
+
}
|
|
22190
|
+
case 14:
|
|
22191
|
+
case "end":
|
|
22192
|
+
return _context2.stop();
|
|
22040
22193
|
}
|
|
22041
22194
|
}, _callee2, null, [[2, 10]]);
|
|
22042
22195
|
}));
|
|
@@ -22355,7 +22508,7 @@
|
|
|
22355
22508
|
};
|
|
22356
22509
|
var select = function select(token) {
|
|
22357
22510
|
if (blockchain.tokens.find(function (majorToken) {
|
|
22358
|
-
return majorToken.address
|
|
22511
|
+
return majorToken.address == (token.address || token.external_id);
|
|
22359
22512
|
})) {
|
|
22360
22513
|
setOpen(false);
|
|
22361
22514
|
props.resolve({
|
|
@@ -22513,41 +22666,39 @@
|
|
|
22513
22666
|
return new Promise( /*#__PURE__*/function () {
|
|
22514
22667
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(resolve, reject) {
|
|
22515
22668
|
return regenerator.wrap(function _callee$(_context) {
|
|
22516
|
-
while (1) {
|
|
22517
|
-
|
|
22518
|
-
|
|
22519
|
-
|
|
22520
|
-
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
22526
|
-
|
|
22527
|
-
return
|
|
22528
|
-
|
|
22529
|
-
|
|
22530
|
-
|
|
22531
|
-
|
|
22532
|
-
|
|
22533
|
-
|
|
22534
|
-
|
|
22535
|
-
|
|
22536
|
-
|
|
22537
|
-
|
|
22538
|
-
|
|
22539
|
-
|
|
22540
|
-
|
|
22541
|
-
|
|
22542
|
-
|
|
22543
|
-
|
|
22544
|
-
|
|
22545
|
-
|
|
22546
|
-
|
|
22547
|
-
|
|
22548
|
-
|
|
22549
|
-
return _context.stop();
|
|
22550
|
-
}
|
|
22669
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22670
|
+
case 0:
|
|
22671
|
+
mount({
|
|
22672
|
+
style: style,
|
|
22673
|
+
document: ensureDocument(document)
|
|
22674
|
+
}, function (unmount) {
|
|
22675
|
+
var userClosedDialog = function userClosedDialog() {
|
|
22676
|
+
reject('USER_CLOSED_DIALOG');
|
|
22677
|
+
unmount();
|
|
22678
|
+
};
|
|
22679
|
+
return function (container) {
|
|
22680
|
+
return /*#__PURE__*/React__default["default"].createElement(ErrorProvider, {
|
|
22681
|
+
error: startupError,
|
|
22682
|
+
errorCallback: error,
|
|
22683
|
+
container: container,
|
|
22684
|
+
unmount: unmount
|
|
22685
|
+
}, /*#__PURE__*/React__default["default"].createElement(ConfigurationProvider, {
|
|
22686
|
+
configuration: {
|
|
22687
|
+
what: what
|
|
22688
|
+
}
|
|
22689
|
+
}, /*#__PURE__*/React__default["default"].createElement(UpdatableProvider, null, /*#__PURE__*/React__default["default"].createElement(ClosableProvider, {
|
|
22690
|
+
unmount: userClosedDialog
|
|
22691
|
+
}, /*#__PURE__*/React__default["default"].createElement(SelectionProvider, null, /*#__PURE__*/React__default["default"].createElement(SelectStack, {
|
|
22692
|
+
document: document,
|
|
22693
|
+
container: container,
|
|
22694
|
+
unmount: unmount,
|
|
22695
|
+
resolve: resolve
|
|
22696
|
+
})), /*#__PURE__*/React__default["default"].createElement(PoweredBy, null)))));
|
|
22697
|
+
};
|
|
22698
|
+
});
|
|
22699
|
+
case 1:
|
|
22700
|
+
case "end":
|
|
22701
|
+
return _context.stop();
|
|
22551
22702
|
}
|
|
22552
22703
|
}, _callee);
|
|
22553
22704
|
}));
|