@depay/widgets 12.3.16 → 12.3.18

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
@@ -25724,7 +25724,7 @@
25724
25724
  var pay = /*#__PURE__*/function () {
25725
25725
  var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
25726
25726
  var _transaction$params;
25727
- var transaction, stop, currentBlock;
25727
+ var transaction, stop, currentBlock, deadline;
25728
25728
  return regenerator.wrap(function _callee2$(_context2) {
25729
25729
  while (1) switch (_context2.prev = _context2.next) {
25730
25730
  case 0:
@@ -25763,8 +25763,9 @@
25763
25763
  });
25764
25764
  case 18:
25765
25765
  currentBlock = _context2.sent;
25766
- _context2.next = 21;
25767
- 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() {
25766
+ deadline = transaction.deadline || (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);
25767
+ _context2.next = 22;
25768
+ return trace(currentBlock, payment.route, transaction, deadline).then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
25768
25769
  return regenerator.wrap(function _callee$(_context) {
25769
25770
  while (1) switch (_context.prev = _context.next) {
25770
25771
  case 0:
@@ -25772,8 +25773,7 @@
25772
25773
  _context.next = 3;
25773
25774
  return wallet.sendTransaction(Object.assign({}, transaction, {
25774
25775
  sent: function sent(sentTransaction) {
25775
- var _transaction$params2;
25776
- 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);
25776
+ initializeTransactionTracking(sentTransaction, currentBlock, deadline);
25777
25777
  if (_sent) {
25778
25778
  _sent(sentTransaction);
25779
25779
  }
@@ -25781,9 +25781,8 @@
25781
25781
  succeeded: paymentSucceeded,
25782
25782
  failed: paymentFailed
25783
25783
  })).then(function (sentTransaction) {
25784
- var _transaction$params3;
25785
25784
  setTransaction(sentTransaction);
25786
- 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);
25785
+ initializePaymentTracking(sentTransaction, currentBlock, payment.route, deadline);
25787
25786
  })["catch"](function (error) {
25788
25787
  console.log('error', error);
25789
25788
  setPaymentState('initialized');
@@ -25805,7 +25804,7 @@
25805
25804
  setUpdatable(true);
25806
25805
  navigate('TracingFailed');
25807
25806
  });
25808
- case 21:
25807
+ case 22:
25809
25808
  case "end":
25810
25809
  return _context2.stop();
25811
25810
  }
@@ -27211,7 +27210,7 @@
27211
27210
  }();
27212
27211
  var getNonce = /*#__PURE__*/function () {
27213
27212
  var _ref6 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3(_ref5) {
27214
- var blockchain, transaction, account, wallet, _transaction$nonce, paymentsAccountData;
27213
+ var blockchain, transaction, account, wallet, _transaction$nonce, _transaction$nonce2, paymentsAccountData;
27215
27214
  return regenerator.wrap(function _callee3$(_context3) {
27216
27215
  while (1) switch (_context3.prev = _context3.next) {
27217
27216
  case 0:
@@ -27241,27 +27240,33 @@
27241
27240
  case 10:
27242
27241
  return _context3.abrupt("return", _context3.sent.toString());
27243
27242
  case 11:
27244
- _context3.next = 22;
27243
+ _context3.next = 24;
27245
27244
  break;
27246
27245
  case 13:
27247
27246
  if (!supported.solana.includes(blockchain)) {
27248
- _context3.next = 22;
27247
+ _context3.next = 24;
27248
+ break;
27249
+ }
27250
+ if (!(transaction && transaction !== null && transaction !== void 0 && transaction.nonce)) {
27251
+ _context3.next = 16;
27249
27252
  break;
27250
27253
  }
27251
- _context3.next = 16;
27254
+ return _context3.abrupt("return", transaction === null || transaction === void 0 || (_transaction$nonce2 = transaction.nonce) === null || _transaction$nonce2 === void 0 ? void 0 : _transaction$nonce2.toString());
27255
+ case 16:
27256
+ _context3.next = 18;
27252
27257
  return getPaymentsAccountData({
27253
27258
  account: account
27254
27259
  });
27255
- case 16:
27260
+ case 18:
27256
27261
  paymentsAccountData = _context3.sent;
27257
27262
  if (!paymentsAccountData) {
27258
- _context3.next = 21;
27263
+ _context3.next = 23;
27259
27264
  break;
27260
27265
  }
27261
27266
  return _context3.abrupt("return", paymentsAccountData.nonce.toString());
27262
- case 21:
27267
+ case 23:
27263
27268
  return _context3.abrupt("return", '0');
27264
- case 22:
27269
+ case 24:
27265
27270
  case "end":
27266
27271
  return _context3.stop();
27267
27272
  }