@depay/widgets 8.0.2 → 8.0.3

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
@@ -79,6 +79,9 @@
79
79
  var exports = {},
80
80
  Op = Object.prototype,
81
81
  hasOwn = Op.hasOwnProperty,
82
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
83
+ obj[key] = desc.value;
84
+ },
82
85
  $Symbol = "function" == typeof Symbol ? Symbol : {},
83
86
  iteratorSymbol = $Symbol.iterator || "@@iterator",
84
87
  asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
@@ -102,40 +105,9 @@
102
105
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
103
106
  generator = Object.create(protoGenerator.prototype),
104
107
  context = new Context(tryLocsList || []);
105
- return generator._invoke = function (innerFn, self, context) {
106
- var state = "suspendedStart";
107
- return function (method, arg) {
108
- if ("executing" === state) throw new Error("Generator is already running");
109
- if ("completed" === state) {
110
- if ("throw" === method) throw arg;
111
- return doneResult();
112
- }
113
- for (context.method = method, context.arg = arg;;) {
114
- var delegate = context.delegate;
115
- if (delegate) {
116
- var delegateResult = maybeInvokeDelegate(delegate, context);
117
- if (delegateResult) {
118
- if (delegateResult === ContinueSentinel) continue;
119
- return delegateResult;
120
- }
121
- }
122
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
123
- if ("suspendedStart" === state) throw state = "completed", context.arg;
124
- context.dispatchException(context.arg);
125
- } else "return" === context.method && context.abrupt("return", context.arg);
126
- state = "executing";
127
- var record = tryCatch(innerFn, self, context);
128
- if ("normal" === record.type) {
129
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
130
- return {
131
- value: record.arg,
132
- done: context.done
133
- };
134
- }
135
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
136
- }
137
- };
138
- }(innerFn, self, context), generator;
108
+ return defineProperty(generator, "_invoke", {
109
+ value: makeInvokeMethod(innerFn, self, context)
110
+ }), generator;
139
111
  }
140
112
  function tryCatch(fn, obj, arg) {
141
113
  try {
@@ -189,13 +161,49 @@
189
161
  reject(record.arg);
190
162
  }
191
163
  var previousPromise;
192
- this._invoke = function (method, arg) {
193
- function callInvokeWithMethodAndArg() {
194
- return new PromiseImpl(function (resolve, reject) {
195
- invoke(method, arg, resolve, reject);
196
- });
164
+ defineProperty(this, "_invoke", {
165
+ value: function value(method, arg) {
166
+ function callInvokeWithMethodAndArg() {
167
+ return new PromiseImpl(function (resolve, reject) {
168
+ invoke(method, arg, resolve, reject);
169
+ });
170
+ }
171
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
172
+ }
173
+ });
174
+ }
175
+ function makeInvokeMethod(innerFn, self, context) {
176
+ var state = "suspendedStart";
177
+ return function (method, arg) {
178
+ if ("executing" === state) throw new Error("Generator is already running");
179
+ if ("completed" === state) {
180
+ if ("throw" === method) throw arg;
181
+ return doneResult();
182
+ }
183
+ for (context.method = method, context.arg = arg;;) {
184
+ var delegate = context.delegate;
185
+ if (delegate) {
186
+ var delegateResult = maybeInvokeDelegate(delegate, context);
187
+ if (delegateResult) {
188
+ if (delegateResult === ContinueSentinel) continue;
189
+ return delegateResult;
190
+ }
191
+ }
192
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
193
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
194
+ context.dispatchException(context.arg);
195
+ } else "return" === context.method && context.abrupt("return", context.arg);
196
+ state = "executing";
197
+ var record = tryCatch(innerFn, self, context);
198
+ if ("normal" === record.type) {
199
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
200
+ return {
201
+ value: record.arg,
202
+ done: context.done
203
+ };
204
+ }
205
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
197
206
  }
198
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
199
207
  };
200
208
  }
201
209
  function maybeInvokeDelegate(delegate, context) {
@@ -253,7 +261,13 @@
253
261
  done: !0
254
262
  };
255
263
  }
256
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
264
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
265
+ value: GeneratorFunctionPrototype,
266
+ configurable: !0
267
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
268
+ value: GeneratorFunction,
269
+ configurable: !0
270
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
257
271
  var ctor = "function" == typeof genFun && genFun.constructor;
258
272
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
259
273
  }, exports.mark = function (genFun) {
@@ -274,8 +288,9 @@
274
288
  return this;
275
289
  }), define(Gp, "toString", function () {
276
290
  return "[object Generator]";
277
- }), exports.keys = function (object) {
278
- var keys = [];
291
+ }), exports.keys = function (val) {
292
+ var object = Object(val),
293
+ keys = [];
279
294
  for (var key in object) {
280
295
  keys.push(key);
281
296
  }
@@ -979,7 +994,7 @@
979
994
  `
980
995
  }
981
996
 
982
- const _jsxFileName$1 = "/home/runner/work/react-dialog/react-dialog/src/components/Dialog.jsx";
997
+ const _jsxFileName$1 = "/Users/sebastian/Work/DePay/react-dialog/src/components/Dialog.jsx";
983
998
  class Dialog extends React__default["default"].Component {
984
999
  constructor(props) {
985
1000
  super(props);
@@ -1041,7 +1056,7 @@
1041
1056
  }
1042
1057
  }
1043
1058
 
1044
- const _jsxFileName = "/home/runner/work/react-dialog/react-dialog/src/index.jsx";
1059
+ const _jsxFileName = "/Users/sebastian/Work/DePay/react-dialog/src/index.jsx";
1045
1060
  class ReactDialog extends React__default["default"].Component {
1046
1061
  constructor(props) {
1047
1062
  super(props);
@@ -20587,6 +20602,12 @@
20587
20602
  'Content-Type': 'application/json'
20588
20603
  },
20589
20604
  body: JSON.stringify(payment)
20605
+ }).then(function (response) {
20606
+ if (response.status == 200 || response.status == 201) {
20607
+ return response;
20608
+ } else {
20609
+ throw response;
20610
+ }
20590
20611
  });
20591
20612
  } else if (track.method) {
20592
20613
  return track.method(payment);
@@ -20610,9 +20631,7 @@
20610
20631
  to_decimals: paymentRoute.toDecimals,
20611
20632
  fee_amount: paymentRoute === null || paymentRoute === void 0 ? void 0 : (_paymentRoute$feeAmou = paymentRoute.feeAmount) === null || _paymentRoute$feeAmou === void 0 ? void 0 : _paymentRoute$feeAmou.toString()
20612
20633
  }).then(function (response) {
20613
- if (response.status != 200 && response.status != 201) {
20614
- retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
20615
- }
20634
+ console.log('PAYMENT TRACKING INITIALIZED');
20616
20635
  })["catch"](function (error) {
20617
20636
  console.log('PAYMENT TRACKING FAILED', error);
20618
20637
  retryStartTracking(transaction, afterBlock, paymentRoute, attempt);
@@ -20630,20 +20649,16 @@
20630
20649
  after_block: afterBlock,
20631
20650
  to_token: paymentRoute.toToken.address
20632
20651
  };
20633
- var handleResponse = function handleResponse(response) {
20634
- if (response.status == 200 || response.status == 201) {
20635
- response.json().then(function (data) {
20636
- if (data && data.forward_to) {
20637
- setForwardTo(data.forward_to);
20638
- setTimeout(function () {
20639
- props.document.location.href = data.forward_to;
20640
- }, 100);
20641
- } else {
20642
- setClosable(true);
20643
- }
20644
- })["catch"](function () {
20652
+ var handlePollingResponse = function handlePollingResponse(data) {
20653
+ if (data) {
20654
+ if (data && data.forward_to) {
20655
+ setForwardTo(data.forward_to);
20656
+ setTimeout(function () {
20657
+ props.document.location.href = data.forward_to;
20658
+ }, 100);
20659
+ } else {
20645
20660
  setClosable(true);
20646
- });
20661
+ }
20647
20662
  clearInterval(pollingInterval);
20648
20663
  setRelease(true);
20649
20664
  }
@@ -20655,9 +20670,17 @@
20655
20670
  'Content-Type': 'application/json'
20656
20671
  },
20657
20672
  body: JSON.stringify(payment)
20658
- }).then(handleResponse);
20673
+ }).then(function (response) {
20674
+ if (response.status == 200 || response.status == 201) {
20675
+ return response.json()["catch"](function () {
20676
+ setClosable(true);
20677
+ });
20678
+ } else {
20679
+ return undefined;
20680
+ }
20681
+ }).then(handlePollingResponse);
20659
20682
  } else if (track.poll.method) {
20660
- track.poll.method(payment).then(handleResponse);
20683
+ track.poll.method(payment).then(handlePollingResponse);
20661
20684
  }
20662
20685
  };
20663
20686
  React.useEffect(function () {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/widgets",
3
3
  "moduleName": "DePayWidgets",
4
- "version": "8.0.2",
4
+ "version": "8.0.3",
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",