@depay/widgets 9.1.1 → 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/umd/index.js CHANGED
@@ -20643,12 +20643,13 @@
20643
20643
  var openSocket = function openSocket(transaction) {
20644
20644
  var socket = new WebSocket('wss://integrate.depay.com/cable');
20645
20645
  socket.onopen = function (event) {
20646
+ var _transaction$nonce;
20646
20647
  var msg = {
20647
20648
  command: 'subscribe',
20648
20649
  identifier: JSON.stringify({
20649
20650
  blockchain: transaction.blockchain,
20650
20651
  sender: transaction.from,
20651
- nonce: transaction.nonce.toString(),
20652
+ nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce = transaction.nonce) === null || _transaction$nonce === void 0 ? void 0 : _transaction$nonce.toString(),
20652
20653
  channel: 'PaymentChannel'
20653
20654
  })
20654
20655
  };
@@ -20721,12 +20722,12 @@
20721
20722
  }
20722
20723
  };
20723
20724
  var startTracking = function startTracking(transaction, afterBlock, paymentRoute, attempt) {
20724
- var _paymentRoute$feeAmou;
20725
+ var _transaction$nonce2, _paymentRoute$feeAmou;
20725
20726
  callTracking({
20726
20727
  blockchain: transaction.blockchain,
20727
20728
  transaction: transaction.id,
20728
20729
  sender: transaction.from,
20729
- nonce: transaction.nonce.toString(),
20730
+ nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce2 = transaction.nonce) === null || _transaction$nonce2 === void 0 ? void 0 : _transaction$nonce2.toString(),
20730
20731
  after_block: afterBlock.toString(),
20731
20732
  from_token: paymentRoute.fromToken.address,
20732
20733
  from_amount: paymentRoute.fromAmount.toString(),
@@ -20744,6 +20745,7 @@
20744
20745
  });
20745
20746
  };
20746
20747
  var pollStatus = function pollStatus(polling, transaction, afterBlock, paymentRoute, pollingInterval) {
20748
+ var _transaction$nonce3;
20747
20749
  if (!polling || transaction == undefined || afterBlock == undefined || paymentRoute == undefined) {
20748
20750
  return;
20749
20751
  }
@@ -20751,7 +20753,7 @@
20751
20753
  blockchain: transaction.blockchain,
20752
20754
  transaction: transaction.id,
20753
20755
  sender: transaction.from,
20754
- nonce: transaction.nonce.toString(),
20756
+ nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce3 = transaction.nonce) === null || _transaction$nonce3 === void 0 ? void 0 : _transaction$nonce3.toString(),
20755
20757
  after_block: afterBlock.toString(),
20756
20758
  to_token: paymentRoute.toToken.address
20757
20759
  };
@@ -20804,6 +20806,7 @@
20804
20806
  };
20805
20807
  }, [polling, transaction, afterBlock, paymentRoute]);
20806
20808
  var storePayment = function storePayment(transaction, afterBlock, paymentRoute, attempt) {
20809
+ var _transaction$nonce4;
20807
20810
  fetch('https://public.depay.com/payments', {
20808
20811
  headers: {
20809
20812
  'Content-Type': 'application/json'
@@ -20813,7 +20816,7 @@
20813
20816
  blockchain: transaction.blockchain,
20814
20817
  transaction: transaction.id,
20815
20818
  sender: transaction.from,
20816
- nonce: transaction.nonce.toString(),
20819
+ nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce4 = transaction.nonce) === null || _transaction$nonce4 === void 0 ? void 0 : _transaction$nonce4.toString(),
20817
20820
  receiver: paymentRoute.toAddress,
20818
20821
  token: paymentRoute.toToken.address,
20819
20822
  amount: paymentRoute.fee ? ethers.ethers.utils.formatUnits(paymentRoute.transaction.params.amounts[1], paymentRoute.toDecimals) : ethers.ethers.utils.formatUnits(paymentRoute.toAmount, paymentRoute.toDecimals),
@@ -20991,6 +20994,7 @@
20991
20994
  }
20992
20995
  }, [polling]);
20993
20996
  var createTracking = function createTracking(transaction, afterBlock, attempt) {
20997
+ var _transaction$nonce;
20994
20998
  if (attempt > 3) {
20995
20999
  console.log('TRANSACTION TRACKING FAILED AFTER 3 ATTEMPTS!');
20996
21000
  return;
@@ -21005,7 +21009,7 @@
21005
21009
  after_block: afterBlock.toString(),
21006
21010
  blockchain: transaction.blockchain,
21007
21011
  sender: transaction.from,
21008
- nonce: transaction.nonce.toString()
21012
+ nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce = transaction.nonce) === null || _transaction$nonce === void 0 ? void 0 : _transaction$nonce.toString()
21009
21013
  })
21010
21014
  }).then(function (response) {
21011
21015
  if (response.status == 200 || response.status == 201) {
@@ -21026,12 +21030,13 @@
21026
21030
  var openSocket = function openSocket(transaction) {
21027
21031
  var socket = new WebSocket('wss://integrate.depay.com/cable');
21028
21032
  socket.onopen = function (event) {
21033
+ var _transaction$nonce2;
21029
21034
  var msg = {
21030
21035
  command: 'subscribe',
21031
21036
  identifier: JSON.stringify({
21032
21037
  blockchain: transaction.blockchain,
21033
21038
  sender: transaction.from,
21034
- nonce: transaction.nonce.toString(),
21039
+ nonce: transaction === null || transaction === void 0 ? void 0 : (_transaction$nonce2 = transaction.nonce) === null || _transaction$nonce2 === void 0 ? void 0 : _transaction$nonce2.toString(),
21035
21040
  channel: 'TransactionChannel'
21036
21041
  })
21037
21042
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/widgets",
3
3
  "moduleName": "DePayWidgets",
4
- "version": "9.1.1",
4
+ "version": "9.1.2",
5
5
  "description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
6
6
  "main": "./dist/umd/index.js",
7
7
  "module": "./dist/esm/index.js",
@@ -48,7 +48,7 @@
48
48
  "@depay/web3-exchanges": "^11.3.3",
49
49
  "@depay/web3-payments": "^10.10.2",
50
50
  "@depay/web3-tokens": "^9.12.8",
51
- "@depay/web3-wallets": "^13.1.1",
51
+ "@depay/web3-wallets": "^13.1.2",
52
52
  "decimal.js": "^10.3.1"
53
53
  },
54
54
  "peerDependencies": {