@depay/widgets 12.3.15 → 12.3.16
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.bundle.js +10 -10
- package/dist/esm/index.evm.js +101 -91
- package/dist/esm/index.evm.js.map +1 -1
- package/dist/esm/index.js +101 -91
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.solana.js +101 -91
- package/dist/esm/index.solana.js.map +1 -1
- package/dist/umd/index.bundle.js +10 -10
- package/dist/umd/index.evm.js +101 -91
- package/dist/umd/index.evm.js.map +1 -1
- package/dist/umd/index.js +101 -91
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.solana.js +101 -91
- package/dist/umd/index.solana.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.solana.js
CHANGED
|
@@ -22665,7 +22665,7 @@ var SelectWalletDialog = (function (props) {
|
|
|
22665
22665
|
}, {
|
|
22666
22666
|
label: "Wallet missing?",
|
|
22667
22667
|
action: function action() {
|
|
22668
|
-
window.open('mailto:support@depay.com?subject=Add wallet&body=
|
|
22668
|
+
window.open('mailto:support@depay.com?subject=Add wallet&body=Please enter the name of the wallet you want us to add:', '_blank');
|
|
22669
22669
|
}
|
|
22670
22670
|
}]
|
|
22671
22671
|
})),
|
|
@@ -25781,6 +25781,7 @@ var PaymentProvider = (function (props) {
|
|
|
25781
25781
|
};
|
|
25782
25782
|
var pay = /*#__PURE__*/function () {
|
|
25783
25783
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
25784
|
+
var _transaction$params;
|
|
25784
25785
|
var transaction, stop, currentBlock;
|
|
25785
25786
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
25786
25787
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -25821,24 +25822,26 @@ var PaymentProvider = (function (props) {
|
|
|
25821
25822
|
case 18:
|
|
25822
25823
|
currentBlock = _context2.sent;
|
|
25823
25824
|
_context2.next = 21;
|
|
25824
|
-
return trace(currentBlock, payment.route, transaction).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
25825
|
+
return trace(currentBlock, payment.route, transaction, transaction === null || transaction === void 0 || (_transaction$params = transaction.params) === null || _transaction$params === void 0 || (_transaction$params = _transaction$params.payment) === null || _transaction$params === void 0 ? void 0 : _transaction$params.deadline).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
25825
25826
|
return regenerator.wrap(function _callee$(_context) {
|
|
25826
25827
|
while (1) switch (_context.prev = _context.next) {
|
|
25827
25828
|
case 0:
|
|
25828
25829
|
setClosable(false);
|
|
25829
25830
|
_context.next = 3;
|
|
25830
25831
|
return wallet.sendTransaction(Object.assign({}, transaction, {
|
|
25831
|
-
sent: function sent(
|
|
25832
|
-
|
|
25832
|
+
sent: function sent(sentTransaction) {
|
|
25833
|
+
var _transaction$params2;
|
|
25834
|
+
initializeTransactionTracking(sentTransaction, currentBlock, transaction === null || transaction === void 0 || (_transaction$params2 = transaction.params) === null || _transaction$params2 === void 0 || (_transaction$params2 = _transaction$params2.payment) === null || _transaction$params2 === void 0 ? void 0 : _transaction$params2.deadline);
|
|
25833
25835
|
if (_sent) {
|
|
25834
|
-
_sent(
|
|
25836
|
+
_sent(sentTransaction);
|
|
25835
25837
|
}
|
|
25836
25838
|
},
|
|
25837
25839
|
succeeded: paymentSucceeded,
|
|
25838
25840
|
failed: paymentFailed
|
|
25839
25841
|
})).then(function (sentTransaction) {
|
|
25842
|
+
var _transaction$params3;
|
|
25840
25843
|
setTransaction(sentTransaction);
|
|
25841
|
-
initializePaymentTracking(sentTransaction, currentBlock, payment.route);
|
|
25844
|
+
initializePaymentTracking(sentTransaction, currentBlock, payment.route, transaction === null || transaction === void 0 || (_transaction$params3 = transaction.params) === null || _transaction$params3 === void 0 || (_transaction$params3 = _transaction$params3.payment) === null || _transaction$params3 === void 0 ? void 0 : _transaction$params3.deadline);
|
|
25842
25845
|
})["catch"](function (error) {
|
|
25843
25846
|
console.log('error', error);
|
|
25844
25847
|
setPaymentState('initialized');
|
|
@@ -26661,7 +26664,7 @@ var Footer = (function () {
|
|
|
26661
26664
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
26662
26665
|
className: "Card transparent small",
|
|
26663
26666
|
title: "DePay has validated the payment",
|
|
26664
|
-
href: "https://depay.com/
|
|
26667
|
+
href: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
|
|
26665
26668
|
target: "_blank",
|
|
26666
26669
|
rel: "noopener noreferrer"
|
|
26667
26670
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -26680,8 +26683,8 @@ var Footer = (function () {
|
|
|
26680
26683
|
} else {
|
|
26681
26684
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
26682
26685
|
className: "Card transparent small",
|
|
26683
|
-
title: "DePay is validating payment",
|
|
26684
|
-
href: "https://depay.com/
|
|
26686
|
+
title: "DePay is validating the payment",
|
|
26687
|
+
href: "https://status.depay.com/tx/".concat(transaction.blockchain, "/").concat(transaction.id),
|
|
26685
26688
|
target: "_blank",
|
|
26686
26689
|
rel: "noopener noreferrer"
|
|
26687
26690
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -27343,53 +27346,59 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27343
27346
|
wallet = _useContext3.wallet;
|
|
27344
27347
|
var _useState = useState(),
|
|
27345
27348
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27346
|
-
|
|
27347
|
-
|
|
27349
|
+
deadline = _useState2[0],
|
|
27350
|
+
setDeadline = _useState2[1];
|
|
27348
27351
|
var _useState3 = useState(),
|
|
27349
27352
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
27350
|
-
|
|
27351
|
-
|
|
27353
|
+
transaction = _useState4[0],
|
|
27354
|
+
setTransaction = _useState4[1];
|
|
27352
27355
|
var _useState5 = useState(),
|
|
27353
27356
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
27354
|
-
|
|
27355
|
-
|
|
27357
|
+
confirmationsRequired = _useState6[0],
|
|
27358
|
+
setConfirmationsRequired = _useState6[1];
|
|
27356
27359
|
var _useState7 = useState(),
|
|
27357
27360
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
27358
|
-
|
|
27359
|
-
|
|
27361
|
+
confirmationsPassed = _useState8[0],
|
|
27362
|
+
setConfirmationsPassed = _useState8[1];
|
|
27360
27363
|
var _useState9 = useState(),
|
|
27361
|
-
_useState10 = _slicedToArray(_useState9, 2)
|
|
27362
|
-
_useState10[0]
|
|
27363
|
-
_useState10[1];
|
|
27364
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
27365
|
+
afterBlock = _useState10[0],
|
|
27366
|
+
setAfterBlock = _useState10[1];
|
|
27364
27367
|
var _useState11 = useState(),
|
|
27365
|
-
_useState12 = _slicedToArray(_useState11, 2)
|
|
27366
|
-
|
|
27367
|
-
|
|
27368
|
+
_useState12 = _slicedToArray(_useState11, 2);
|
|
27369
|
+
_useState12[0];
|
|
27370
|
+
_useState12[1];
|
|
27368
27371
|
var _useState13 = useState(),
|
|
27369
27372
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
27370
|
-
|
|
27371
|
-
|
|
27372
|
-
var _useState15 = useState(
|
|
27373
|
+
paymentRoute = _useState14[0],
|
|
27374
|
+
setPaymentRoute = _useState14[1];
|
|
27375
|
+
var _useState15 = useState(),
|
|
27373
27376
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
27374
|
-
|
|
27375
|
-
|
|
27376
|
-
var
|
|
27377
|
-
|
|
27378
|
-
|
|
27379
|
-
|
|
27377
|
+
attemptId = _useState16[0],
|
|
27378
|
+
setAttemptId = _useState16[1];
|
|
27379
|
+
var attemptIdRef = useRef(attemptId);
|
|
27380
|
+
attemptIdRef.current = attemptId;
|
|
27381
|
+
var _useState17 = useState(false),
|
|
27382
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
27383
|
+
trackingInitialized = _useState18[0],
|
|
27384
|
+
setTrackingInitialized = _useState18[1];
|
|
27385
|
+
var _useState19 = useState(!!configurationId || !!(track && (track.endpoint || typeof track.method == 'function') && track.async != true)),
|
|
27380
27386
|
_useState20 = _slicedToArray(_useState19, 1),
|
|
27381
|
-
|
|
27382
|
-
var _useState21 = useState(
|
|
27387
|
+
synchronousTracking = _useState20[0];
|
|
27388
|
+
var _useState21 = useState(!configurationId && !!(track && track.async == true)),
|
|
27383
27389
|
_useState22 = _slicedToArray(_useState21, 1),
|
|
27384
|
-
|
|
27385
|
-
var _useState23 = useState(
|
|
27386
|
-
_useState24 = _slicedToArray(_useState23,
|
|
27387
|
-
|
|
27388
|
-
|
|
27389
|
-
var _useState25 = useState(),
|
|
27390
|
+
asynchronousTracking = _useState22[0];
|
|
27391
|
+
var _useState23 = useState(!!configurationId || !!(track && track.poll && (track.poll.endpoint || typeof track.poll.method == 'function') && track.async != true)),
|
|
27392
|
+
_useState24 = _slicedToArray(_useState23, 1),
|
|
27393
|
+
polling = _useState24[0];
|
|
27394
|
+
var _useState25 = useState(false),
|
|
27390
27395
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
27391
|
-
|
|
27392
|
-
|
|
27396
|
+
release = _useState26[0],
|
|
27397
|
+
setRelease = _useState26[1];
|
|
27398
|
+
var _useState27 = useState(),
|
|
27399
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
27400
|
+
forwardTo = _useState28[0],
|
|
27401
|
+
setForwardTo = _useState28[1];
|
|
27393
27402
|
var _useContext4 = useContext(ClosableContext),
|
|
27394
27403
|
setClosable = _useContext4.setClosable;
|
|
27395
27404
|
var _useContext5 = useContext(NavigateContext),
|
|
@@ -27473,18 +27482,18 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27473
27482
|
console.log('WebSocket Error: ', error);
|
|
27474
27483
|
};
|
|
27475
27484
|
};
|
|
27476
|
-
var retryStartTracking = function retryStartTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
27485
|
+
var retryStartTracking = function retryStartTracking(transaction, afterBlock, paymentRoute, deadline, attempt) {
|
|
27477
27486
|
attempt = parseInt(attempt || 1, 10);
|
|
27478
27487
|
if (attempt < ((track === null || track === void 0 ? void 0 : track.attempts) || 40)) {
|
|
27479
27488
|
setTimeout(function () {
|
|
27480
|
-
startTracking(transaction, afterBlock, paymentRoute, attempt + 1);
|
|
27489
|
+
startTracking(transaction, afterBlock, paymentRoute, deadline, attempt + 1);
|
|
27481
27490
|
}, 3000);
|
|
27482
27491
|
} else {
|
|
27483
27492
|
navigate('TrackingFailed');
|
|
27484
27493
|
}
|
|
27485
27494
|
};
|
|
27486
27495
|
var continueTryTracking = function continueTryTracking() {
|
|
27487
|
-
retryStartTracking(transaction, afterBlock, paymentRoute, 1);
|
|
27496
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, deadline, 1);
|
|
27488
27497
|
};
|
|
27489
27498
|
var callTracking = function callTracking(payment) {
|
|
27490
27499
|
if (configurationId) {
|
|
@@ -27525,7 +27534,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27525
27534
|
}
|
|
27526
27535
|
};
|
|
27527
27536
|
var startTracking = /*#__PURE__*/function () {
|
|
27528
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(transaction, afterBlock, paymentRoute, attempt) {
|
|
27537
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2(transaction, afterBlock, paymentRoute, deadline, attempt) {
|
|
27529
27538
|
var _paymentRoute$feeAmou;
|
|
27530
27539
|
return regenerator.wrap(function _callee2$(_context2) {
|
|
27531
27540
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -27550,8 +27559,9 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27550
27559
|
_context2.t10 = paymentRoute.toAmount.toString();
|
|
27551
27560
|
_context2.t11 = paymentRoute.toDecimals;
|
|
27552
27561
|
_context2.t12 = paymentRoute === null || paymentRoute === void 0 || (_paymentRoute$feeAmou = paymentRoute.feeAmount) === null || _paymentRoute$feeAmou === void 0 ? void 0 : _paymentRoute$feeAmou.toString();
|
|
27553
|
-
_context2.t13 =
|
|
27554
|
-
_context2.t14 =
|
|
27562
|
+
_context2.t13 = attemptIdRef.current;
|
|
27563
|
+
_context2.t14 = deadline;
|
|
27564
|
+
_context2.t15 = {
|
|
27555
27565
|
blockchain: _context2.t1,
|
|
27556
27566
|
transaction: _context2.t2,
|
|
27557
27567
|
sender: _context2.t3,
|
|
@@ -27564,25 +27574,26 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27564
27574
|
to_amount: _context2.t10,
|
|
27565
27575
|
to_decimals: _context2.t11,
|
|
27566
27576
|
fee_amount: _context2.t12,
|
|
27567
|
-
|
|
27577
|
+
trace_attempt_id: _context2.t13,
|
|
27578
|
+
deadline: _context2.t14
|
|
27568
27579
|
};
|
|
27569
|
-
(0, _context2.t0)(_context2.
|
|
27580
|
+
(0, _context2.t0)(_context2.t15).then(function (response) {
|
|
27570
27581
|
setTrackingInitialized(true);
|
|
27571
27582
|
})["catch"](function (error) {
|
|
27572
|
-
retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
|
|
27583
|
+
retryStartTracking(transaction, afterBlock, paymentRoute, deadline, attempt);
|
|
27573
27584
|
});
|
|
27574
|
-
case
|
|
27585
|
+
case 19:
|
|
27575
27586
|
case "end":
|
|
27576
27587
|
return _context2.stop();
|
|
27577
27588
|
}
|
|
27578
27589
|
}, _callee2);
|
|
27579
27590
|
}));
|
|
27580
|
-
return function startTracking(_x2, _x3, _x4, _x5) {
|
|
27591
|
+
return function startTracking(_x2, _x3, _x4, _x5, _x6) {
|
|
27581
27592
|
return _ref2.apply(this, arguments);
|
|
27582
27593
|
};
|
|
27583
27594
|
}();
|
|
27584
27595
|
var pollStatus = /*#__PURE__*/function () {
|
|
27585
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(polling, transaction, afterBlock, paymentRoute, pollingInterval) {
|
|
27596
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(polling, transaction, afterBlock, paymentRoute, pollingInterval, attemptId) {
|
|
27586
27597
|
var payment, handlePollingResponse;
|
|
27587
27598
|
return regenerator.wrap(function _callee3$(_context3) {
|
|
27588
27599
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -27669,7 +27680,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27669
27680
|
}
|
|
27670
27681
|
}, _callee3);
|
|
27671
27682
|
}));
|
|
27672
|
-
return function pollStatus(
|
|
27683
|
+
return function pollStatus(_x7, _x8, _x9, _x10, _x11, _x12) {
|
|
27673
27684
|
return _ref3.apply(this, arguments);
|
|
27674
27685
|
};
|
|
27675
27686
|
}();
|
|
@@ -27686,14 +27697,14 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27686
27697
|
return;
|
|
27687
27698
|
}
|
|
27688
27699
|
var pollingInterval = setInterval(function () {
|
|
27689
|
-
return pollStatus(polling, transaction, afterBlock, paymentRoute, pollingInterval);
|
|
27700
|
+
return pollStatus(polling, transaction, afterBlock, paymentRoute, pollingInterval, attemptId);
|
|
27690
27701
|
}, 5000);
|
|
27691
27702
|
return function () {
|
|
27692
27703
|
clearInterval(pollingInterval);
|
|
27693
27704
|
};
|
|
27694
|
-
}, [polling, transaction, afterBlock, paymentRoute]);
|
|
27705
|
+
}, [polling, transaction, afterBlock, attemptId, paymentRoute]);
|
|
27695
27706
|
var storePayment = /*#__PURE__*/function () {
|
|
27696
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4(transaction, afterBlock, paymentRoute) {
|
|
27707
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4(transaction, afterBlock, paymentRoute, deadline) {
|
|
27697
27708
|
return regenerator.wrap(function _callee4$(_context4) {
|
|
27698
27709
|
while (1) switch (_context4.prev = _context4.next) {
|
|
27699
27710
|
case 0:
|
|
@@ -27728,7 +27739,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27728
27739
|
};
|
|
27729
27740
|
_context4.t13 = paymentRoute.fee ? ethers.utils.formatUnits(paymentRoute.feeAmount, paymentRoute.toDecimals) : null;
|
|
27730
27741
|
_context4.t14 = paymentRoute.fee ? paymentRoute.fee.receiver : null;
|
|
27731
|
-
_context4.t15 =
|
|
27742
|
+
_context4.t15 = deadline;
|
|
27732
27743
|
_context4.t16 = {
|
|
27733
27744
|
blockchain: _context4.t3,
|
|
27734
27745
|
transaction: _context4.t4,
|
|
@@ -27754,12 +27765,12 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27754
27765
|
(0, _context4.t0)('https://public.depay.com/payments', _context4.t18).then(function (response) {
|
|
27755
27766
|
if (response.status == 200 || response.status == 201) ; else {
|
|
27756
27767
|
setTimeout(function () {
|
|
27757
|
-
storePayment(transaction, afterBlock, paymentRoute);
|
|
27768
|
+
storePayment(transaction, afterBlock, paymentRoute, deadline);
|
|
27758
27769
|
}, 3000);
|
|
27759
27770
|
}
|
|
27760
27771
|
})["catch"](function (error) {
|
|
27761
27772
|
setTimeout(function () {
|
|
27762
|
-
storePayment(transaction, afterBlock, paymentRoute);
|
|
27773
|
+
storePayment(transaction, afterBlock, paymentRoute, deadline);
|
|
27763
27774
|
}, 3000);
|
|
27764
27775
|
});
|
|
27765
27776
|
case 22:
|
|
@@ -27768,24 +27779,26 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27768
27779
|
}
|
|
27769
27780
|
}, _callee4);
|
|
27770
27781
|
}));
|
|
27771
|
-
return function storePayment(
|
|
27782
|
+
return function storePayment(_x13, _x14, _x15, _x16) {
|
|
27772
27783
|
return _ref4.apply(this, arguments);
|
|
27773
27784
|
};
|
|
27774
27785
|
}();
|
|
27775
|
-
var initializeTracking = function initializeTracking(transaction, afterBlock, paymentRoute) {
|
|
27776
|
-
storePayment(transaction, afterBlock, paymentRoute);
|
|
27786
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock, paymentRoute, deadline) {
|
|
27787
|
+
storePayment(transaction, afterBlock, paymentRoute, deadline);
|
|
27777
27788
|
if (synchronousTracking || track && track.async == true) {
|
|
27778
|
-
startTracking(transaction, afterBlock, paymentRoute);
|
|
27789
|
+
startTracking(transaction, afterBlock, paymentRoute, deadline);
|
|
27779
27790
|
}
|
|
27780
27791
|
if (synchronousTracking == false) {
|
|
27781
27792
|
return;
|
|
27782
27793
|
}
|
|
27794
|
+
setDeadline(deadline);
|
|
27783
27795
|
setTransaction(transaction);
|
|
27784
27796
|
setAfterBlock(afterBlock);
|
|
27785
27797
|
setPaymentRoute(paymentRoute);
|
|
27786
27798
|
openSocket(transaction);
|
|
27787
27799
|
};
|
|
27788
|
-
var trace = function trace(afterBlock, paymentRoute, transaction) {
|
|
27800
|
+
var trace = function trace(afterBlock, paymentRoute, transaction, deadline) {
|
|
27801
|
+
setAttemptId(); // reset attemptId in case payment is retried
|
|
27789
27802
|
if (!synchronousTracking && !asynchronousTracking) {
|
|
27790
27803
|
return Promise.resolve();
|
|
27791
27804
|
}
|
|
@@ -27814,7 +27827,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27814
27827
|
_context5.t8 = paymentRoute.toAmount.toString();
|
|
27815
27828
|
_context5.t9 = paymentRoute.toDecimals;
|
|
27816
27829
|
_context5.t10 = paymentRoute === null || paymentRoute === void 0 || (_paymentRoute$feeAmou2 = paymentRoute.feeAmount) === null || _paymentRoute$feeAmou2 === void 0 ? void 0 : _paymentRoute$feeAmou2.toString();
|
|
27817
|
-
_context5.t11 =
|
|
27830
|
+
_context5.t11 = deadline;
|
|
27818
27831
|
payment = {
|
|
27819
27832
|
blockchain: _context5.t0,
|
|
27820
27833
|
sender: _context5.t1,
|
|
@@ -27879,7 +27892,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
27879
27892
|
}
|
|
27880
27893
|
}, _callee5);
|
|
27881
27894
|
}));
|
|
27882
|
-
return function (
|
|
27895
|
+
return function (_x17, _x18) {
|
|
27883
27896
|
return _ref5.apply(this, arguments);
|
|
27884
27897
|
};
|
|
27885
27898
|
}());
|
|
@@ -36944,17 +36957,16 @@ var TransactionTrackingProvider = (function (props) {
|
|
|
36944
36957
|
}
|
|
36945
36958
|
}, [polling]);
|
|
36946
36959
|
var createTracking = /*#__PURE__*/function () {
|
|
36947
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(transaction, afterBlock, attempt) {
|
|
36960
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(transaction, afterBlock, deadline, attempt) {
|
|
36948
36961
|
return regenerator.wrap(function _callee$(_context) {
|
|
36949
36962
|
while (1) switch (_context.prev = _context.next) {
|
|
36950
36963
|
case 0:
|
|
36951
36964
|
if (!(attempt > 3)) {
|
|
36952
|
-
_context.next =
|
|
36965
|
+
_context.next = 2;
|
|
36953
36966
|
break;
|
|
36954
36967
|
}
|
|
36955
|
-
console.log('TRANSACTION TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
36956
36968
|
return _context.abrupt("return");
|
|
36957
|
-
case
|
|
36969
|
+
case 2:
|
|
36958
36970
|
_context.t0 = fetch;
|
|
36959
36971
|
_context.t1 = {
|
|
36960
36972
|
'Content-Type': 'application/json'
|
|
@@ -36964,40 +36976,38 @@ var TransactionTrackingProvider = (function (props) {
|
|
|
36964
36976
|
_context.t4 = afterBlock.toString();
|
|
36965
36977
|
_context.t5 = transaction.blockchain;
|
|
36966
36978
|
_context.t6 = transaction.from;
|
|
36967
|
-
_context.next =
|
|
36979
|
+
_context.next = 11;
|
|
36968
36980
|
return getNonce({
|
|
36969
36981
|
transaction: transaction,
|
|
36970
36982
|
wallet: wallet,
|
|
36971
36983
|
account: account
|
|
36972
36984
|
});
|
|
36973
|
-
case
|
|
36985
|
+
case 11:
|
|
36974
36986
|
_context.t7 = _context.sent;
|
|
36975
|
-
_context.t8 =
|
|
36987
|
+
_context.t8 = deadline;
|
|
36988
|
+
_context.t9 = {
|
|
36976
36989
|
id: _context.t3,
|
|
36977
36990
|
after_block: _context.t4,
|
|
36978
36991
|
blockchain: _context.t5,
|
|
36979
36992
|
sender: _context.t6,
|
|
36980
|
-
nonce: _context.t7
|
|
36993
|
+
nonce: _context.t7,
|
|
36994
|
+
deadline: _context.t8
|
|
36981
36995
|
};
|
|
36982
|
-
_context.
|
|
36983
|
-
_context.
|
|
36996
|
+
_context.t10 = _context.t2.stringify.call(_context.t2, _context.t9);
|
|
36997
|
+
_context.t11 = {
|
|
36984
36998
|
method: 'POST',
|
|
36985
36999
|
headers: _context.t1,
|
|
36986
|
-
body: _context.
|
|
37000
|
+
body: _context.t10
|
|
36987
37001
|
};
|
|
36988
|
-
(0, _context.t0)('https://public.depay.com/transactions', _context.
|
|
36989
|
-
if (response.status == 200 || response.status == 201) {
|
|
36990
|
-
console.log('TRANSACTION TRACKING INITIALIZED');
|
|
36991
|
-
} else {
|
|
36992
|
-
console.log('TRANSACTION TRACKING FAILED', response);
|
|
37002
|
+
(0, _context.t0)('https://public.depay.com/transactions', _context.t11).then(function (response) {
|
|
37003
|
+
if (response.status == 200 || response.status == 201) ; else {
|
|
36993
37004
|
setTimeout(function () {
|
|
36994
|
-
createTracking(transaction, afterBlock, attempt + 1);
|
|
37005
|
+
createTracking(transaction, afterBlock, deadline, attempt + 1);
|
|
36995
37006
|
}, 3000);
|
|
36996
37007
|
}
|
|
36997
37008
|
})["catch"](function (error) {
|
|
36998
|
-
console.log('TRANSACTION TRACKING FAILED', error);
|
|
36999
37009
|
setTimeout(function () {
|
|
37000
|
-
createTracking(transaction, afterBlock, attempt + 1);
|
|
37010
|
+
createTracking(transaction, afterBlock, deadline, attempt + 1);
|
|
37001
37011
|
}, 3000);
|
|
37002
37012
|
});
|
|
37003
37013
|
case 17:
|
|
@@ -37006,7 +37016,7 @@ var TransactionTrackingProvider = (function (props) {
|
|
|
37006
37016
|
}
|
|
37007
37017
|
}, _callee);
|
|
37008
37018
|
}));
|
|
37009
|
-
return function createTracking(_x, _x2, _x3) {
|
|
37019
|
+
return function createTracking(_x, _x2, _x3, _x4) {
|
|
37010
37020
|
return _ref.apply(this, arguments);
|
|
37011
37021
|
};
|
|
37012
37022
|
}();
|
|
@@ -37047,7 +37057,7 @@ var TransactionTrackingProvider = (function (props) {
|
|
|
37047
37057
|
}
|
|
37048
37058
|
}, _callee2);
|
|
37049
37059
|
}));
|
|
37050
|
-
return function (
|
|
37060
|
+
return function (_x5) {
|
|
37051
37061
|
return _ref2.apply(this, arguments);
|
|
37052
37062
|
};
|
|
37053
37063
|
}();
|
|
@@ -37072,13 +37082,13 @@ var TransactionTrackingProvider = (function (props) {
|
|
|
37072
37082
|
console.log('WebSocket Error: ', error);
|
|
37073
37083
|
};
|
|
37074
37084
|
};
|
|
37075
|
-
var initializeTracking = function initializeTracking(transaction, afterBlock) {
|
|
37085
|
+
var initializeTracking = function initializeTracking(transaction, afterBlock, deadline) {
|
|
37076
37086
|
if (!supported$4.evm.includes(transaction.blockchain)) {
|
|
37077
37087
|
return;
|
|
37078
37088
|
}
|
|
37079
37089
|
setGivenTransaction(transaction);
|
|
37080
37090
|
if (recover == undefined) {
|
|
37081
|
-
createTracking(transaction, afterBlock, 1);
|
|
37091
|
+
createTracking(transaction, afterBlock, deadline, 1);
|
|
37082
37092
|
}
|
|
37083
37093
|
openSocket(transaction);
|
|
37084
37094
|
setPolling(true);
|