@stellar/stellar-sdk 12.0.1 → 12.2.0

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/stellar-sdk.js +1415 -1114
  3. package/dist/stellar-sdk.min.js +1 -1
  4. package/lib/browser.d.ts +1 -1
  5. package/lib/browser.js +4 -4
  6. package/lib/config.js +5 -2
  7. package/lib/contract/assembled_transaction.d.ts +102 -29
  8. package/lib/contract/assembled_transaction.js +361 -127
  9. package/lib/contract/client.d.ts +1 -1
  10. package/lib/contract/client.js +5 -2
  11. package/lib/contract/sent_transaction.d.ts +14 -18
  12. package/lib/contract/sent_transaction.js +17 -33
  13. package/lib/contract/spec.d.ts +1 -1
  14. package/lib/contract/spec.js +921 -956
  15. package/lib/contract/types.d.ts +10 -0
  16. package/lib/contract/types.js +4 -1
  17. package/lib/contract/utils.d.ts +4 -6
  18. package/lib/contract/utils.js +20 -2
  19. package/lib/errors.d.ts +4 -4
  20. package/lib/federation/server.d.ts +1 -1
  21. package/lib/horizon/account_call_builder.d.ts +2 -3
  22. package/lib/horizon/account_response.d.ts +1 -1
  23. package/lib/horizon/assets_call_builder.d.ts +2 -3
  24. package/lib/horizon/call_builder.d.ts +8 -8
  25. package/lib/horizon/call_builder.js +2 -6
  26. package/lib/horizon/claimable_balances_call_builder.d.ts +3 -4
  27. package/lib/horizon/effect_call_builder.d.ts +2 -3
  28. package/lib/horizon/friendbot_builder.d.ts +0 -1
  29. package/lib/horizon/horizon_api.d.ts +5 -1
  30. package/lib/horizon/horizon_axios_client.js +6 -6
  31. package/lib/horizon/ledger_call_builder.d.ts +2 -3
  32. package/lib/horizon/liquidity_pool_call_builder.d.ts +2 -4
  33. package/lib/horizon/offer_call_builder.d.ts +2 -3
  34. package/lib/horizon/operation_call_builder.d.ts +3 -4
  35. package/lib/horizon/orderbook_call_builder.d.ts +0 -1
  36. package/lib/horizon/path_call_builder.d.ts +1 -2
  37. package/lib/horizon/payment_call_builder.d.ts +2 -3
  38. package/lib/horizon/server.d.ts +29 -10
  39. package/lib/horizon/server.js +98 -55
  40. package/lib/horizon/strict_receive_path_call_builder.d.ts +1 -2
  41. package/lib/horizon/strict_send_path_call_builder.d.ts +1 -2
  42. package/lib/horizon/trade_aggregation_call_builder.d.ts +9 -10
  43. package/lib/horizon/trade_aggregation_call_builder.js +3 -7
  44. package/lib/horizon/trades_call_builder.d.ts +2 -3
  45. package/lib/horizon/transaction_call_builder.d.ts +3 -4
  46. package/lib/horizon/types/assets.d.ts +1 -1
  47. package/lib/horizon/types/effects.d.ts +1 -1
  48. package/lib/horizon/types/offer.d.ts +1 -1
  49. package/lib/index.d.ts +0 -1
  50. package/lib/rpc/api.d.ts +29 -5
  51. package/lib/rpc/browser.d.ts +1 -1
  52. package/lib/rpc/browser.js +4 -4
  53. package/lib/rpc/index.d.ts +0 -1
  54. package/lib/rpc/jsonrpc.js +3 -3
  55. package/lib/rpc/parsers.d.ts +3 -3
  56. package/lib/rpc/parsers.js +23 -23
  57. package/lib/rpc/server.d.ts +13 -7
  58. package/lib/rpc/server.js +48 -56
  59. package/lib/rpc/transaction.d.ts +3 -4
  60. package/lib/rpc/transaction.js +23 -25
  61. package/lib/webauth/utils.js +3 -3
  62. package/package.json +24 -33
@@ -32,6 +32,9 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
32
32
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
33
33
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
34
34
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
35
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
37
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
35
38
  function _regeneratorRuntime() { "use strict"; _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
36
39
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
37
40
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
@@ -43,7 +46,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
43
46
  var SUBMIT_TRANSACTION_TIMEOUT = exports.SUBMIT_TRANSACTION_TIMEOUT = 60 * 1000;
44
47
  var STROOPS_IN_LUMEN = 10000000;
45
48
  var ACCOUNT_REQUIRES_MEMO = "MQ==";
46
- function _getAmountInLumens(amt) {
49
+ function getAmountInLumens(amt) {
47
50
  return new _bignumber.default(amt).div(STROOPS_IN_LUMEN).toString();
48
51
  }
49
52
  var Server = exports.Server = function () {
@@ -62,6 +65,9 @@ var Server = exports.Server = function () {
62
65
  if (opts.authToken) {
63
66
  customHeaders["X-Auth-Token"] = opts.authToken;
64
67
  }
68
+ if (opts.headers) {
69
+ Object.assign(customHeaders, opts.headers);
70
+ }
65
71
  if (Object.keys(customHeaders).length > 0) {
66
72
  _horizon_axios_client.default.interceptors.request.use(function (config) {
67
73
  config.headers = Object.assign(config.headers, customHeaders);
@@ -105,11 +111,8 @@ var Server = exports.Server = function () {
105
111
  _context.next = 8;
106
112
  return _horizon_axios_client.default.get((0, _urijs.default)(this.serverURL).toString());
107
113
  case 8:
108
- _context.next = 10;
109
- return this.fetchTimebounds(seconds, true);
110
- case 10:
111
- return _context.abrupt("return", _context.sent);
112
- case 11:
114
+ return _context.abrupt("return", this.fetchTimebounds(seconds, true));
115
+ case 9:
113
116
  case "end":
114
117
  return _context.stop();
115
118
  }
@@ -217,7 +220,7 @@ var Server = exports.Server = function () {
217
220
  sellerId = _stellarBase.StrKey.encodeEd25519PublicKey(offerClaimed.sellerId().ed25519());
218
221
  break;
219
222
  default:
220
- throw new Error("Invalid offer result type: " + offerClaimedAtom.switch());
223
+ throw new Error("Invalid offer result type: ".concat(offerClaimedAtom.switch()));
221
224
  }
222
225
  var claimedOfferAmountBought = new _bignumber.default(offerClaimed.amountBought().toString());
223
226
  var claimedOfferAmountSold = new _bignumber.default(offerClaimed.amountSold().toString());
@@ -239,9 +242,9 @@ var Server = exports.Server = function () {
239
242
  sellerId: sellerId,
240
243
  offerId: offerClaimed.offerId().toString(),
241
244
  assetSold: assetSold,
242
- amountSold: _getAmountInLumens(claimedOfferAmountSold),
245
+ amountSold: getAmountInLumens(claimedOfferAmountSold),
243
246
  assetBought: assetBought,
244
- amountBought: _getAmountInLumens(claimedOfferAmountBought)
247
+ amountBought: getAmountInLumens(claimedOfferAmountBought)
245
248
  };
246
249
  });
247
250
  var effect = offerSuccess.offer().switch().name;
@@ -252,7 +255,7 @@ var Server = exports.Server = function () {
252
255
  offerId: offerXDR.offerId().toString(),
253
256
  selling: {},
254
257
  buying: {},
255
- amount: _getAmountInLumens(offerXDR.amount().toString()),
258
+ amount: getAmountInLumens(offerXDR.amount().toString()),
256
259
  price: {
257
260
  n: offerXDR.price().n(),
258
261
  d: offerXDR.price().d()
@@ -276,8 +279,8 @@ var Server = exports.Server = function () {
276
279
  effect: effect,
277
280
  operationIndex: i,
278
281
  currentOffer: currentOffer,
279
- amountBought: _getAmountInLumens(amountBought),
280
- amountSold: _getAmountInLumens(amountSold),
282
+ amountBought: getAmountInLumens(amountBought),
283
+ amountSold: getAmountInLumens(amountSold),
281
284
  isFullyOpen: !offersClaimed.length && effect !== "manageOfferDeleted",
282
285
  wasPartiallyFilled: !!offersClaimed.length && effect !== "manageOfferDeleted",
283
286
  wasImmediatelyFilled: !!offersClaimed.length && effect === "manageOfferDeleted",
@@ -287,7 +290,7 @@ var Server = exports.Server = function () {
287
290
  return !!result;
288
291
  });
289
292
  }
290
- return Object.assign({}, response.data, {
293
+ return _objectSpread(_objectSpread({}, response.data), {}, {
291
294
  offerResults: hasManageOffer ? offerResults : undefined
292
295
  });
293
296
  }).catch(function (response) {
@@ -307,6 +310,46 @@ var Server = exports.Server = function () {
307
310
  }
308
311
  return submitTransaction;
309
312
  }())
313
+ }, {
314
+ key: "submitAsyncTransaction",
315
+ value: (function () {
316
+ var _submitAsyncTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5(transaction) {
317
+ var opts,
318
+ tx,
319
+ _args5 = arguments;
320
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
321
+ while (1) switch (_context5.prev = _context5.next) {
322
+ case 0:
323
+ opts = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {
324
+ skipMemoRequiredCheck: false
325
+ };
326
+ if (opts.skipMemoRequiredCheck) {
327
+ _context5.next = 4;
328
+ break;
329
+ }
330
+ _context5.next = 4;
331
+ return this.checkMemoRequired(transaction);
332
+ case 4:
333
+ tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
334
+ return _context5.abrupt("return", _horizon_axios_client.default.post((0, _urijs.default)(this.serverURL).segment("transactions_async").toString(), "tx=".concat(tx)).then(function (response) {
335
+ return response.data;
336
+ }).catch(function (response) {
337
+ if (response instanceof Error) {
338
+ return Promise.reject(response);
339
+ }
340
+ return Promise.reject(new _errors.BadResponseError("Transaction submission failed. Server responded: ".concat(response.status, " ").concat(response.statusText), response.data));
341
+ }));
342
+ case 6:
343
+ case "end":
344
+ return _context5.stop();
345
+ }
346
+ }, _callee5, this);
347
+ }));
348
+ function submitAsyncTransaction(_x3) {
349
+ return _submitAsyncTransaction.apply(this, arguments);
350
+ }
351
+ return submitAsyncTransaction;
352
+ }())
310
353
  }, {
311
354
  key: "accounts",
312
355
  value: function accounts() {
@@ -385,23 +428,23 @@ var Server = exports.Server = function () {
385
428
  }, {
386
429
  key: "loadAccount",
387
430
  value: (function () {
388
- var _loadAccount = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5(accountId) {
431
+ var _loadAccount = _asyncToGenerator(_regeneratorRuntime().mark(function _callee6(accountId) {
389
432
  var res;
390
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
391
- while (1) switch (_context5.prev = _context5.next) {
433
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
434
+ while (1) switch (_context6.prev = _context6.next) {
392
435
  case 0:
393
- _context5.next = 2;
436
+ _context6.next = 2;
394
437
  return this.accounts().accountId(accountId).call();
395
438
  case 2:
396
- res = _context5.sent;
397
- return _context5.abrupt("return", new _account_response.AccountResponse(res));
439
+ res = _context6.sent;
440
+ return _context6.abrupt("return", new _account_response.AccountResponse(res));
398
441
  case 4:
399
442
  case "end":
400
- return _context5.stop();
443
+ return _context6.stop();
401
444
  }
402
- }, _callee5, this);
445
+ }, _callee6, this);
403
446
  }));
404
- function loadAccount(_x3) {
447
+ function loadAccount(_x4) {
405
448
  return _loadAccount.apply(this, arguments);
406
449
  }
407
450
  return loadAccount;
@@ -414,90 +457,90 @@ var Server = exports.Server = function () {
414
457
  }, {
415
458
  key: "checkMemoRequired",
416
459
  value: (function () {
417
- var _checkMemoRequired = _asyncToGenerator(_regeneratorRuntime().mark(function _callee6(transaction) {
460
+ var _checkMemoRequired = _asyncToGenerator(_regeneratorRuntime().mark(function _callee7(transaction) {
418
461
  var destinations, i, operation, destination, account;
419
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
420
- while (1) switch (_context6.prev = _context6.next) {
462
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
463
+ while (1) switch (_context7.prev = _context7.next) {
421
464
  case 0:
422
465
  if (transaction instanceof _stellarBase.FeeBumpTransaction) {
423
466
  transaction = transaction.innerTransaction;
424
467
  }
425
468
  if (!(transaction.memo.type !== "none")) {
426
- _context6.next = 3;
469
+ _context7.next = 3;
427
470
  break;
428
471
  }
429
- return _context6.abrupt("return");
472
+ return _context7.abrupt("return");
430
473
  case 3:
431
474
  destinations = new Set();
432
475
  i = 0;
433
476
  case 5:
434
477
  if (!(i < transaction.operations.length)) {
435
- _context6.next = 36;
478
+ _context7.next = 36;
436
479
  break;
437
480
  }
438
481
  operation = transaction.operations[i];
439
- _context6.t0 = operation.type;
440
- _context6.next = _context6.t0 === "payment" ? 10 : _context6.t0 === "pathPaymentStrictReceive" ? 10 : _context6.t0 === "pathPaymentStrictSend" ? 10 : _context6.t0 === "accountMerge" ? 10 : 11;
482
+ _context7.t0 = operation.type;
483
+ _context7.next = _context7.t0 === "payment" ? 10 : _context7.t0 === "pathPaymentStrictReceive" ? 10 : _context7.t0 === "pathPaymentStrictSend" ? 10 : _context7.t0 === "accountMerge" ? 10 : 11;
441
484
  break;
442
485
  case 10:
443
- return _context6.abrupt("break", 12);
486
+ return _context7.abrupt("break", 12);
444
487
  case 11:
445
- return _context6.abrupt("continue", 33);
488
+ return _context7.abrupt("continue", 33);
446
489
  case 12:
447
490
  destination = operation.destination;
448
491
  if (!destinations.has(destination)) {
449
- _context6.next = 15;
492
+ _context7.next = 15;
450
493
  break;
451
494
  }
452
- return _context6.abrupt("continue", 33);
495
+ return _context7.abrupt("continue", 33);
453
496
  case 15:
454
497
  destinations.add(destination);
455
498
  if (!destination.startsWith("M")) {
456
- _context6.next = 18;
499
+ _context7.next = 18;
457
500
  break;
458
501
  }
459
- return _context6.abrupt("continue", 33);
502
+ return _context7.abrupt("continue", 33);
460
503
  case 18:
461
- _context6.prev = 18;
462
- _context6.next = 21;
504
+ _context7.prev = 18;
505
+ _context7.next = 21;
463
506
  return this.loadAccount(destination);
464
507
  case 21:
465
- account = _context6.sent;
508
+ account = _context7.sent;
466
509
  if (!(account.data_attr["config.memo_required"] === ACCOUNT_REQUIRES_MEMO)) {
467
- _context6.next = 24;
510
+ _context7.next = 24;
468
511
  break;
469
512
  }
470
513
  throw new _errors.AccountRequiresMemoError("account requires memo", destination, i);
471
514
  case 24:
472
- _context6.next = 33;
515
+ _context7.next = 33;
473
516
  break;
474
517
  case 26:
475
- _context6.prev = 26;
476
- _context6.t1 = _context6["catch"](18);
477
- if (!(_context6.t1 instanceof _errors.AccountRequiresMemoError)) {
478
- _context6.next = 30;
518
+ _context7.prev = 26;
519
+ _context7.t1 = _context7["catch"](18);
520
+ if (!(_context7.t1 instanceof _errors.AccountRequiresMemoError)) {
521
+ _context7.next = 30;
479
522
  break;
480
523
  }
481
- throw _context6.t1;
524
+ throw _context7.t1;
482
525
  case 30:
483
- if (_context6.t1 instanceof _errors.NotFoundError) {
484
- _context6.next = 32;
526
+ if (_context7.t1 instanceof _errors.NotFoundError) {
527
+ _context7.next = 32;
485
528
  break;
486
529
  }
487
- throw _context6.t1;
530
+ throw _context7.t1;
488
531
  case 32:
489
- return _context6.abrupt("continue", 33);
532
+ return _context7.abrupt("continue", 33);
490
533
  case 33:
491
- i++;
492
- _context6.next = 5;
534
+ i += 1;
535
+ _context7.next = 5;
493
536
  break;
494
537
  case 36:
495
538
  case "end":
496
- return _context6.stop();
539
+ return _context7.stop();
497
540
  }
498
- }, _callee6, this, [[18, 26]]);
541
+ }, _callee7, this, [[18, 26]]);
499
542
  }));
500
- function checkMemoRequired(_x4) {
543
+ function checkMemoRequired(_x5) {
501
544
  return _checkMemoRequired.apply(this, arguments);
502
545
  }
503
546
  return checkMemoRequired;
@@ -1,4 +1,3 @@
1
- /// <reference types="urijs" />
2
1
  import { Asset } from "@stellar/stellar-base";
3
2
  import { CallBuilder } from "./call_builder";
4
3
  import { ServerApi } from "./server_api";
@@ -23,7 +22,7 @@ import { ServerApi } from "./server_api";
23
22
  *
24
23
  * Do not create this object directly, use {@link Server#strictReceivePaths}.
25
24
  * @see [Find Payment Paths](https://developers.stellar.org/api/aggregations/paths/)
26
- * @extends CallBuilder
25
+ * @augments CallBuilder
27
26
  * @param {string} serverUrl Horizon server URL.
28
27
  * @param {string|Asset[]} source The sender's account ID or a list of Assets. Any returned path must use a source that the sender can hold.
29
28
  * @param {Asset} destinationAsset The destination asset.
@@ -1,4 +1,3 @@
1
- /// <reference types="urijs" />
2
1
  import { Asset } from "@stellar/stellar-base";
3
2
  import { CallBuilder } from "./call_builder";
4
3
  import { ServerApi } from "./server_api";
@@ -22,7 +21,7 @@ import { ServerApi } from "./server_api";
22
21
  *
23
22
  * Do not create this object directly, use {@link Server#strictSendPaths}.
24
23
  * @see [Find Payment Paths](https://developers.stellar.org/api/aggregations/paths/)
25
- * @extends CallBuilder
24
+ * @augments CallBuilder
26
25
  * @param {string} serverUrl Horizon server URL.
27
26
  * @param {Asset} sourceAsset The asset to be sent.
28
27
  * @param {string} sourceAmount The amount, denominated in the source asset, that any returned path should be able to satisfy.
@@ -1,4 +1,3 @@
1
- /// <reference types="urijs" />
2
1
  import { Asset } from "@stellar/stellar-base";
3
2
  import { CallBuilder } from "./call_builder";
4
3
  import { HorizonApi } from "./horizon_api";
@@ -8,28 +7,28 @@ import { ServerApi } from "./server_api";
8
7
  * Do not create this object directly, use {@link Server#tradeAggregation}.
9
8
  *
10
9
  * @class TradeAggregationCallBuilder
11
- * @extends CallBuilder
12
- * @constructor
10
+ * @augments CallBuilder
11
+ * @class
13
12
  * @param {string} serverUrl serverUrl Horizon server URL.
14
13
  * @param {Asset} base base asset
15
14
  * @param {Asset} counter counter asset
16
- * @param {long} start_time lower time boundary represented as millis since epoch
17
- * @param {long} end_time upper time boundary represented as millis since epoch
18
- * @param {long} resolution segment duration as millis since epoch. *Supported values are 1 minute (60000), 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000).
19
- * @param {long} offset segments can be offset using this parameter. Expressed in milliseconds. *Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours.
15
+ * @param {number} start_time lower time boundary represented as millis since epoch
16
+ * @param {number} end_time upper time boundary represented as millis since epoch
17
+ * @param {number} resolution segment duration as millis since epoch. *Supported values are 1 minute (60000), 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000).
18
+ * @param {number} offset segments can be offset using this parameter. Expressed in milliseconds. *Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours.
20
19
  */
21
20
  export declare class TradeAggregationCallBuilder extends CallBuilder<ServerApi.CollectionPage<TradeAggregationRecord>> {
22
21
  constructor(serverUrl: URI, base: Asset, counter: Asset, start_time: number, end_time: number, resolution: number, offset: number);
23
22
  /**
24
23
  * @private
25
- * @param {long} resolution Trade data resolution in milliseconds
24
+ * @param {number} resolution Trade data resolution in milliseconds
26
25
  * @returns {boolean} true if the resolution is allowed
27
26
  */
28
27
  private isValidResolution;
29
28
  /**
30
29
  * @private
31
- * @param {long} offset Time offset in milliseconds
32
- * @param {long} resolution Trade data resolution in milliseconds
30
+ * @param {number} offset Time offset in milliseconds
31
+ * @param {number} resolution Trade data resolution in milliseconds
33
32
  * @returns {boolean} true if the offset is valid
34
33
  */
35
34
  private isValidOffset;
@@ -62,13 +62,9 @@ var TradeAggregationCallBuilder = exports.TradeAggregationCallBuilder = function
62
62
  return _createClass(TradeAggregationCallBuilder, [{
63
63
  key: "isValidResolution",
64
64
  value: function isValidResolution(resolution) {
65
- for (var _i = 0, _allowedResolutions = allowedResolutions; _i < _allowedResolutions.length; _i++) {
66
- var allowed = _allowedResolutions[_i];
67
- if (allowed === resolution) {
68
- return true;
69
- }
70
- }
71
- return false;
65
+ return allowedResolutions.some(function (allowed) {
66
+ return allowed === resolution;
67
+ });
72
68
  }
73
69
  }, {
74
70
  key: "isValidOffset",
@@ -1,4 +1,3 @@
1
- /// <reference types="urijs" />
2
1
  import { Asset } from "@stellar/stellar-base";
3
2
  import { CallBuilder } from "./call_builder";
4
3
  import { ServerApi } from "./server_api";
@@ -7,8 +6,8 @@ import { ServerApi } from "./server_api";
7
6
  * Do not create this object directly, use {@link Server#trades}.
8
7
  *
9
8
  * @class TradesCallBuilder
10
- * @extends CallBuilder
11
- * @constructor
9
+ * @augments CallBuilder
10
+ * @class
12
11
  * @see [Trades](https://developers.stellar.org/api/resources/trades/)
13
12
  * @param {string} serverUrl serverUrl Horizon server URL.
14
13
  */
@@ -1,4 +1,3 @@
1
- /// <reference types="urijs" />
2
1
  import { CallBuilder } from "./call_builder";
3
2
  import { ServerApi } from "./server_api";
4
3
  /**
@@ -6,9 +5,9 @@ import { ServerApi } from "./server_api";
6
5
  * Do not create this object directly, use {@link Server#transactions}.
7
6
  *
8
7
  * @class TransactionCallBuilder
9
- * @extends CallBuilder
8
+ * @augments CallBuilder
10
9
  * @see [All Transactions](https://developers.stellar.org/api/resources/transactions/)
11
- * @constructor
10
+ * @class
12
11
  * @param {string} serverUrl Horizon server URL.
13
12
  */
14
13
  export declare class TransactionCallBuilder extends CallBuilder<ServerApi.CollectionPage<ServerApi.TransactionRecord>> {
@@ -51,7 +50,7 @@ export declare class TransactionCallBuilder extends CallBuilder<ServerApi.Collec
51
50
  /**
52
51
  * Adds a parameter defining whether to include failed transactions. By default only successful transactions are
53
52
  * returned.
54
- * @param {bool} value Set to `true` to include failed transactions.
53
+ * @param {boolean} value Set to `true` to include failed transactions.
55
54
  * @returns {TransactionCallBuilder} current TransactionCallBuilder instance
56
55
  */
57
56
  includeFailed(value: boolean): this;
@@ -1,5 +1,5 @@
1
1
  import { AssetType } from "@stellar/stellar-base";
2
- import { HorizonApi } from "./../horizon_api";
2
+ import { HorizonApi } from "../horizon_api";
3
3
  export interface AssetRecord extends HorizonApi.BaseResponse {
4
4
  asset_type: AssetType.credit4 | AssetType.credit12;
5
5
  asset_code: string;
@@ -1,4 +1,4 @@
1
- import { HorizonApi } from "./../horizon_api";
1
+ import { HorizonApi } from "../horizon_api";
2
2
  import { OfferAsset } from "./offer";
3
3
  export declare enum EffectType {
4
4
  account_created = 0,
@@ -1,5 +1,5 @@
1
1
  import { AssetType } from "@stellar/stellar-base";
2
- import { HorizonApi } from "./../horizon_api";
2
+ import { HorizonApi } from "../horizon_api";
3
3
  export interface OfferAsset {
4
4
  asset_type: AssetType;
5
5
  asset_code?: string;
package/lib/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference path="../types/dom-monkeypatch.d.ts" />
2
1
  export * from './errors';
3
2
  export { Config } from './config';
4
3
  export { Utils } from './utils';
package/lib/rpc/api.d.ts CHANGED
@@ -20,12 +20,13 @@ export declare namespace Api {
20
20
  key: string;
21
21
  /** a base-64 encoded {@link xdr.LedgerEntryData} instance */
22
22
  xdr: string;
23
- /** optional, a future ledger number upon which this entry will expire
23
+ /**
24
+ * optional, a future ledger number upon which this entry will expire
24
25
  * based on https://github.com/stellar/soroban-tools/issues/1010
25
26
  */
26
27
  liveUntilLedgerSeq?: number;
27
28
  }
28
- /** An XDR-parsed version of {@link RawLedgerEntryResult} */
29
+ /** An XDR-parsed version of {@link this.RawLedgerEntryResult} */
29
30
  export interface GetLedgerEntriesResponse {
30
31
  entries: LedgerEntryResult[];
31
32
  latestLedger: number;
@@ -178,7 +179,7 @@ export declare namespace Api {
178
179
  retval: xdr.ScVal;
179
180
  }
180
181
  /**
181
- * Simplifies {@link RawSimulateTransactionResponse} into separate interfaces
182
+ * Simplifies {@link Api.RawSimulateTransactionResponse} into separate interfaces
182
183
  * based on status:
183
184
  * - on success, this includes all fields, though `result` is only present
184
185
  * if an invocation was simulated (since otherwise there's nothing to
@@ -199,7 +200,6 @@ export declare namespace Api {
199
200
  * The field is always present, but may be empty in cases where:
200
201
  * - you didn't simulate an invocation or
201
202
  * - there were no events
202
- * @see {@link humanizeEvents}
203
203
  */
204
204
  events: xdr.DiagnosticEvent[];
205
205
  /** a private field to mark the schema as parsed */
@@ -253,7 +253,8 @@ export declare namespace Api {
253
253
  /** These are xdr.DiagnosticEvents in base64 */
254
254
  events?: string[];
255
255
  minResourceFee?: string;
256
- /** This will only contain a single element if present, because only a single
256
+ /**
257
+ * This will only contain a single element if present, because only a single
257
258
  * invokeHostFunctionOperation is supported per transaction.
258
259
  * */
259
260
  results?: RawSimulateHostFunctionResult[];
@@ -266,5 +267,28 @@ export declare namespace Api {
266
267
  /** State Difference information */
267
268
  stateChanges?: RawLedgerEntryChange[];
268
269
  }
270
+ export interface GetFeeStatsResponse {
271
+ sorobanInclusionFee: FeeDistribution;
272
+ inclusionFee: FeeDistribution;
273
+ latestLedger: number;
274
+ }
275
+ interface FeeDistribution {
276
+ max: string;
277
+ min: string;
278
+ mode: string;
279
+ p10: string;
280
+ p20: string;
281
+ p30: string;
282
+ p40: string;
283
+ p50: string;
284
+ p60: string;
285
+ p70: string;
286
+ p80: string;
287
+ p90: string;
288
+ p95: string;
289
+ p99: string;
290
+ transactionCount: string;
291
+ ledgerCount: number;
292
+ }
269
293
  export {};
270
294
  }
@@ -1,6 +1,6 @@
1
+ import axios from 'axios';
1
2
  export * from './index';
2
3
  export * as StellarBase from '@stellar/stellar-base';
3
- import axios from 'axios';
4
4
  export { axios };
5
5
  declare const _default: any;
6
6
  export default _default;
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  var _exportNames = {
8
- StellarBase: true,
9
- axios: true
8
+ axios: true,
9
+ StellarBase: true
10
10
  };
11
11
  exports.StellarBase = void 0;
12
12
  Object.defineProperty(exports, "axios", {
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "axios", {
16
16
  }
17
17
  });
18
18
  exports.default = void 0;
19
+ var _axios = _interopRequireDefault(require("axios"));
19
20
  var _index = require("./index");
20
21
  Object.keys(_index).forEach(function (key) {
21
22
  if (key === "default" || key === "__esModule") return;
@@ -30,8 +31,7 @@ Object.keys(_index).forEach(function (key) {
30
31
  });
31
32
  var _StellarBase = _interopRequireWildcard(require("@stellar/stellar-base"));
32
33
  exports.StellarBase = _StellarBase;
33
- var _axios = _interopRequireDefault(require("axios"));
34
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
35
34
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
36
35
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
36
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
37
37
  var _default = exports.default = module.exports;
@@ -1,4 +1,3 @@
1
- /// <reference path="../../types/dom-monkeypatch.d.ts" />
2
1
  export * from "./api";
3
2
  export { Server, Durability } from "./server";
4
3
  export { default as AxiosClient } from "./axios";
@@ -10,6 +10,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
10
10
  function _regeneratorRuntime() { "use strict"; _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
11
11
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
12
12
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
13
+ function hasOwnProperty(obj, prop) {
14
+ return obj.hasOwnProperty(prop);
15
+ }
13
16
  function postObject(_x, _x2) {
14
17
  return _postObject.apply(this, arguments);
15
18
  }
@@ -46,7 +49,4 @@ function _postObject() {
46
49
  }, _callee);
47
50
  }));
48
51
  return _postObject.apply(this, arguments);
49
- }
50
- function hasOwnProperty(obj, prop) {
51
- return obj.hasOwnProperty(prop);
52
52
  }