@depay/widgets 9.1.0 → 9.1.2
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 +4 -4
- package/dist/esm/index.js +12 -7
- package/dist/umd/index.bundle.js +4 -4
- package/dist/umd/index.js +12 -7
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -20648,12 +20648,13 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
20648
20648
|
var openSocket = function openSocket(transaction) {
|
|
20649
20649
|
var socket = new WebSocket('wss://integrate.depay.com/cable');
|
|
20650
20650
|
socket.onopen = function (event) {
|
|
20651
|
+
var _transaction$nonce;
|
|
20651
20652
|
var msg = {
|
|
20652
20653
|
command: 'subscribe',
|
|
20653
20654
|
identifier: JSON.stringify({
|
|
20654
20655
|
blockchain: transaction.blockchain,
|
|
20655
20656
|
sender: transaction.from,
|
|
20656
|
-
nonce: transaction.nonce.toString(),
|
|
20657
|
+
nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce = transaction.nonce) === null || _transaction$nonce === void 0 ? void 0 : _transaction$nonce.toString(),
|
|
20657
20658
|
channel: 'PaymentChannel'
|
|
20658
20659
|
})
|
|
20659
20660
|
};
|
|
@@ -20726,12 +20727,12 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
20726
20727
|
}
|
|
20727
20728
|
};
|
|
20728
20729
|
var startTracking = function startTracking(transaction, afterBlock, paymentRoute, attempt) {
|
|
20729
|
-
var _paymentRoute$feeAmou;
|
|
20730
|
+
var _transaction$nonce2, _paymentRoute$feeAmou;
|
|
20730
20731
|
callTracking({
|
|
20731
20732
|
blockchain: transaction.blockchain,
|
|
20732
20733
|
transaction: transaction.id,
|
|
20733
20734
|
sender: transaction.from,
|
|
20734
|
-
nonce: transaction.nonce.toString(),
|
|
20735
|
+
nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce2 = transaction.nonce) === null || _transaction$nonce2 === void 0 ? void 0 : _transaction$nonce2.toString(),
|
|
20735
20736
|
after_block: afterBlock.toString(),
|
|
20736
20737
|
from_token: paymentRoute.fromToken.address,
|
|
20737
20738
|
from_amount: paymentRoute.fromAmount.toString(),
|
|
@@ -20749,6 +20750,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
20749
20750
|
});
|
|
20750
20751
|
};
|
|
20751
20752
|
var pollStatus = function pollStatus(polling, transaction, afterBlock, paymentRoute, pollingInterval) {
|
|
20753
|
+
var _transaction$nonce3;
|
|
20752
20754
|
if (!polling || transaction == undefined || afterBlock == undefined || paymentRoute == undefined) {
|
|
20753
20755
|
return;
|
|
20754
20756
|
}
|
|
@@ -20756,7 +20758,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
20756
20758
|
blockchain: transaction.blockchain,
|
|
20757
20759
|
transaction: transaction.id,
|
|
20758
20760
|
sender: transaction.from,
|
|
20759
|
-
nonce: transaction.nonce.toString(),
|
|
20761
|
+
nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce3 = transaction.nonce) === null || _transaction$nonce3 === void 0 ? void 0 : _transaction$nonce3.toString(),
|
|
20760
20762
|
after_block: afterBlock.toString(),
|
|
20761
20763
|
to_token: paymentRoute.toToken.address
|
|
20762
20764
|
};
|
|
@@ -20809,6 +20811,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
20809
20811
|
};
|
|
20810
20812
|
}, [polling, transaction, afterBlock, paymentRoute]);
|
|
20811
20813
|
var storePayment = function storePayment(transaction, afterBlock, paymentRoute, attempt) {
|
|
20814
|
+
var _transaction$nonce4;
|
|
20812
20815
|
fetch('https://public.depay.com/payments', {
|
|
20813
20816
|
headers: {
|
|
20814
20817
|
'Content-Type': 'application/json'
|
|
@@ -20818,7 +20821,7 @@ var PaymentTrackingProvider = (function (props) {
|
|
|
20818
20821
|
blockchain: transaction.blockchain,
|
|
20819
20822
|
transaction: transaction.id,
|
|
20820
20823
|
sender: transaction.from,
|
|
20821
|
-
nonce: transaction.nonce.toString(),
|
|
20824
|
+
nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce4 = transaction.nonce) === null || _transaction$nonce4 === void 0 ? void 0 : _transaction$nonce4.toString(),
|
|
20822
20825
|
receiver: paymentRoute.toAddress,
|
|
20823
20826
|
token: paymentRoute.toToken.address,
|
|
20824
20827
|
amount: paymentRoute.fee ? ethers.utils.formatUnits(paymentRoute.transaction.params.amounts[1], paymentRoute.toDecimals) : ethers.utils.formatUnits(paymentRoute.toAmount, paymentRoute.toDecimals),
|
|
@@ -20996,6 +20999,7 @@ var TransactionTrackingProvider = (function (props) {
|
|
|
20996
20999
|
}
|
|
20997
21000
|
}, [polling]);
|
|
20998
21001
|
var createTracking = function createTracking(transaction, afterBlock, attempt) {
|
|
21002
|
+
var _transaction$nonce;
|
|
20999
21003
|
if (attempt > 3) {
|
|
21000
21004
|
console.log('TRANSACTION TRACKING FAILED AFTER 3 ATTEMPTS!');
|
|
21001
21005
|
return;
|
|
@@ -21010,7 +21014,7 @@ var TransactionTrackingProvider = (function (props) {
|
|
|
21010
21014
|
after_block: afterBlock.toString(),
|
|
21011
21015
|
blockchain: transaction.blockchain,
|
|
21012
21016
|
sender: transaction.from,
|
|
21013
|
-
nonce: transaction.nonce.toString()
|
|
21017
|
+
nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce = transaction.nonce) === null || _transaction$nonce === void 0 ? void 0 : _transaction$nonce.toString()
|
|
21014
21018
|
})
|
|
21015
21019
|
}).then(function (response) {
|
|
21016
21020
|
if (response.status == 200 || response.status == 201) {
|
|
@@ -21031,12 +21035,13 @@ var TransactionTrackingProvider = (function (props) {
|
|
|
21031
21035
|
var openSocket = function openSocket(transaction) {
|
|
21032
21036
|
var socket = new WebSocket('wss://integrate.depay.com/cable');
|
|
21033
21037
|
socket.onopen = function (event) {
|
|
21038
|
+
var _transaction$nonce2;
|
|
21034
21039
|
var msg = {
|
|
21035
21040
|
command: 'subscribe',
|
|
21036
21041
|
identifier: JSON.stringify({
|
|
21037
21042
|
blockchain: transaction.blockchain,
|
|
21038
21043
|
sender: transaction.from,
|
|
21039
|
-
nonce: transaction.nonce.toString(),
|
|
21044
|
+
nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce2 = transaction.nonce) === null || _transaction$nonce2 === void 0 ? void 0 : _transaction$nonce2.toString(),
|
|
21040
21045
|
channel: 'TransactionChannel'
|
|
21041
21046
|
})
|
|
21042
21047
|
};
|