@stellar/stellar-sdk 13.0.0 → 13.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.
- package/CHANGELOG.md +24 -4
- package/README.md +1 -1
- package/dist/stellar-sdk-minimal.js +41079 -40629
- package/dist/stellar-sdk-minimal.min.js +1 -1
- package/dist/stellar-sdk-no-axios.js +51476 -50336
- package/dist/stellar-sdk-no-axios.min.js +1 -1
- package/dist/stellar-sdk-no-eventsource.js +44487 -44397
- package/dist/stellar-sdk-no-eventsource.min.js +1 -1
- package/dist/stellar-sdk.js +54884 -54104
- package/dist/stellar-sdk.min.js +1 -1
- package/lib/contract/assembled_transaction.js +3 -5
- package/lib/contract/client.d.ts +2 -0
- package/lib/contract/client.js +72 -11
- package/lib/contract/sent_transaction.d.ts +3 -1
- package/lib/contract/spec.js +1 -1
- package/lib/friendbot/index.d.ts +1 -0
- package/lib/horizon/call_builder.d.ts +1 -1
- package/lib/horizon/horizon_api.d.ts +15 -0
- package/lib/horizon/horizon_axios_client.js +1 -1
- package/lib/horizon/server.d.ts +5 -0
- package/lib/horizon/server.js +80 -59
- package/lib/minimal/contract/assembled_transaction.js +3 -5
- package/lib/minimal/contract/client.d.ts +2 -0
- package/lib/minimal/contract/client.js +72 -11
- package/lib/minimal/contract/sent_transaction.d.ts +3 -1
- package/lib/minimal/contract/spec.js +1 -1
- package/lib/minimal/friendbot/index.d.ts +1 -0
- package/lib/minimal/horizon/call_builder.d.ts +1 -1
- package/lib/minimal/horizon/horizon_api.d.ts +15 -0
- package/lib/minimal/horizon/horizon_axios_client.js +1 -1
- package/lib/minimal/horizon/server.d.ts +5 -0
- package/lib/minimal/horizon/server.js +80 -59
- package/lib/minimal/rpc/api.d.ts +2 -1
- package/lib/minimal/rpc/axios.js +1 -1
- package/lib/minimal/rpc/parsers.js +1 -0
- package/lib/minimal/rpc/server.js +27 -8
- package/lib/no-axios/contract/assembled_transaction.js +3 -5
- package/lib/no-axios/contract/client.d.ts +2 -0
- package/lib/no-axios/contract/client.js +72 -11
- package/lib/no-axios/contract/sent_transaction.d.ts +3 -1
- package/lib/no-axios/contract/spec.js +1 -1
- package/lib/no-axios/friendbot/index.d.ts +1 -0
- package/lib/no-axios/horizon/call_builder.d.ts +1 -1
- package/lib/no-axios/horizon/horizon_api.d.ts +15 -0
- package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
- package/lib/no-axios/horizon/server.d.ts +5 -0
- package/lib/no-axios/horizon/server.js +80 -59
- package/lib/no-axios/rpc/api.d.ts +2 -1
- package/lib/no-axios/rpc/axios.js +1 -1
- package/lib/no-axios/rpc/parsers.js +1 -0
- package/lib/no-axios/rpc/server.js +27 -8
- package/lib/no-eventsource/contract/assembled_transaction.js +3 -5
- package/lib/no-eventsource/contract/client.d.ts +2 -0
- package/lib/no-eventsource/contract/client.js +72 -11
- package/lib/no-eventsource/contract/sent_transaction.d.ts +3 -1
- package/lib/no-eventsource/contract/spec.js +1 -1
- package/lib/no-eventsource/friendbot/index.d.ts +1 -0
- package/lib/no-eventsource/horizon/call_builder.d.ts +1 -1
- package/lib/no-eventsource/horizon/horizon_api.d.ts +15 -0
- package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
- package/lib/no-eventsource/horizon/server.d.ts +5 -0
- package/lib/no-eventsource/horizon/server.js +80 -59
- package/lib/no-eventsource/rpc/api.d.ts +2 -1
- package/lib/no-eventsource/rpc/axios.js +1 -1
- package/lib/no-eventsource/rpc/parsers.js +1 -0
- package/lib/no-eventsource/rpc/server.js +27 -8
- package/lib/rpc/api.d.ts +2 -1
- package/lib/rpc/axios.js +1 -1
- package/lib/rpc/parsers.js +1 -0
- package/lib/rpc/server.js +27 -8
- package/package.json +24 -20
|
@@ -696,7 +696,7 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
696
696
|
key: "requestAirdrop",
|
|
697
697
|
value: (function () {
|
|
698
698
|
var _requestAirdrop = _asyncToGenerator(_regeneratorRuntime().mark(function _callee22(address, friendbotUrl) {
|
|
699
|
-
var account, response, meta, sequence, _error$response, _error$response$detai;
|
|
699
|
+
var account, response, meta, txMeta, sequence, _error$response, _error$response$detai;
|
|
700
700
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
701
701
|
while (1) switch (_context22.prev = _context22.next) {
|
|
702
702
|
case 0:
|
|
@@ -723,28 +723,47 @@ var RpcServer = exports.RpcServer = function () {
|
|
|
723
723
|
return _axios.default.post("".concat(friendbotUrl, "?addr=").concat(encodeURIComponent(account)));
|
|
724
724
|
case 12:
|
|
725
725
|
response = _context22.sent;
|
|
726
|
+
if (response.data.result_meta_xdr) {
|
|
727
|
+
_context22.next = 22;
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
_context22.next = 16;
|
|
731
|
+
return this.getTransaction(response.data.hash);
|
|
732
|
+
case 16:
|
|
733
|
+
txMeta = _context22.sent;
|
|
734
|
+
if (!(txMeta.status !== _api.Api.GetTransactionStatus.SUCCESS)) {
|
|
735
|
+
_context22.next = 19;
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
throw new Error("Funding account ".concat(address, " failed"));
|
|
739
|
+
case 19:
|
|
740
|
+
meta = txMeta.resultMetaXdr;
|
|
741
|
+
_context22.next = 23;
|
|
742
|
+
break;
|
|
743
|
+
case 22:
|
|
726
744
|
meta = _stellarBase.xdr.TransactionMeta.fromXDR(response.data.result_meta_xdr, 'base64');
|
|
745
|
+
case 23:
|
|
727
746
|
sequence = findCreatedAccountSequenceInTransactionMeta(meta);
|
|
728
747
|
return _context22.abrupt("return", new _stellarBase.Account(account, sequence));
|
|
729
|
-
case
|
|
730
|
-
_context22.prev =
|
|
748
|
+
case 27:
|
|
749
|
+
_context22.prev = 27;
|
|
731
750
|
_context22.t1 = _context22["catch"](9);
|
|
732
751
|
if (!(((_error$response = _context22.t1.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 400)) {
|
|
733
|
-
_context22.next =
|
|
752
|
+
_context22.next = 32;
|
|
734
753
|
break;
|
|
735
754
|
}
|
|
736
755
|
if (!((_error$response$detai = _context22.t1.response.detail) !== null && _error$response$detai !== void 0 && _error$response$detai.includes('createAccountAlreadyExist'))) {
|
|
737
|
-
_context22.next =
|
|
756
|
+
_context22.next = 32;
|
|
738
757
|
break;
|
|
739
758
|
}
|
|
740
759
|
return _context22.abrupt("return", this.getAccount(account));
|
|
741
|
-
case
|
|
760
|
+
case 32:
|
|
742
761
|
throw _context22.t1;
|
|
743
|
-
case
|
|
762
|
+
case 33:
|
|
744
763
|
case "end":
|
|
745
764
|
return _context22.stop();
|
|
746
765
|
}
|
|
747
|
-
}, _callee22, this, [[9,
|
|
766
|
+
}, _callee22, this, [[9, 27]]);
|
|
748
767
|
}));
|
|
749
768
|
function requestAirdrop(_x21, _x22) {
|
|
750
769
|
return _requestAirdrop.apply(this, arguments);
|
|
@@ -52,7 +52,6 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
52
52
|
_this$options$allowHt;
|
|
53
53
|
_classCallCheck(this, AssembledTransaction);
|
|
54
54
|
_defineProperty(this, "simulate", _asyncToGenerator(_regeneratorRuntime().mark(function _callee() {
|
|
55
|
-
var _restore;
|
|
56
55
|
var _ref2,
|
|
57
56
|
restore,
|
|
58
57
|
account,
|
|
@@ -78,7 +77,7 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
78
77
|
case 4:
|
|
79
78
|
_this.built = _this.raw.build();
|
|
80
79
|
case 5:
|
|
81
|
-
restore =
|
|
80
|
+
restore = restore !== null && restore !== void 0 ? restore : _this.options.restore;
|
|
82
81
|
delete _this.simulationResult;
|
|
83
82
|
delete _this.simulationTransactionData;
|
|
84
83
|
_context.next = 10;
|
|
@@ -564,7 +563,6 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
564
563
|
key: "restoreFootprint",
|
|
565
564
|
value: (function () {
|
|
566
565
|
var _restoreFootprint = _asyncToGenerator(_regeneratorRuntime().mark(function _callee8(restorePreamble, account) {
|
|
567
|
-
var _account;
|
|
568
566
|
var restoreTx, sentTransaction;
|
|
569
567
|
return _regeneratorRuntime().wrap(function _callee8$(_context9) {
|
|
570
568
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -575,11 +573,11 @@ var AssembledTransaction = exports.AssembledTransaction = function () {
|
|
|
575
573
|
}
|
|
576
574
|
throw new Error("For automatic restore to work you must provide a signTransaction function when initializing your Client");
|
|
577
575
|
case 2:
|
|
578
|
-
if (!(
|
|
576
|
+
if (!(account !== null && account !== void 0)) {
|
|
579
577
|
_context9.next = 6;
|
|
580
578
|
break;
|
|
581
579
|
}
|
|
582
|
-
_context9.t0 =
|
|
580
|
+
_context9.t0 = account;
|
|
583
581
|
_context9.next = 9;
|
|
584
582
|
break;
|
|
585
583
|
case 6:
|
|
@@ -29,6 +29,8 @@ export declare class Client {
|
|
|
29
29
|
salt?: Buffer | Uint8Array;
|
|
30
30
|
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
31
31
|
format?: "hex" | "base64";
|
|
32
|
+
/** The address to use to deploy the custom contract */
|
|
33
|
+
address?: string;
|
|
32
34
|
}): Promise<AssembledTransaction<T>>;
|
|
33
35
|
constructor(spec: Spec, options: ClientOptions);
|
|
34
36
|
/**
|
|
@@ -15,14 +15,20 @@ var _excluded = ["method"],
|
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
17
|
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; }
|
|
18
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
19
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
18
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
19
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
20
20
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21
21
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
22
22
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
23
23
|
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; }
|
|
24
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
25
25
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
27
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
29
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
30
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
31
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
26
32
|
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); }
|
|
27
33
|
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); }); }; }
|
|
28
34
|
var CONSTRUCTOR_FUNC = "__constructor";
|
|
@@ -31,33 +37,88 @@ function specFromWasm(_x) {
|
|
|
31
37
|
}
|
|
32
38
|
function _specFromWasm() {
|
|
33
39
|
_specFromWasm = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5(wasm) {
|
|
34
|
-
var wasmModule,
|
|
40
|
+
var xdrSections, wasmModule, customData, bufferSection, specEntryArray, spec;
|
|
35
41
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
36
42
|
while (1) switch (_context5.prev = _context5.next) {
|
|
37
43
|
case 0:
|
|
38
|
-
_context5.
|
|
44
|
+
_context5.prev = 0;
|
|
45
|
+
_context5.next = 3;
|
|
39
46
|
return WebAssembly.compile(wasm);
|
|
40
|
-
case
|
|
47
|
+
case 3:
|
|
41
48
|
wasmModule = _context5.sent;
|
|
42
49
|
xdrSections = WebAssembly.Module.customSections(wasmModule, "contractspecv0");
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
_context5.next = 11;
|
|
51
|
+
break;
|
|
52
|
+
case 7:
|
|
53
|
+
_context5.prev = 7;
|
|
54
|
+
_context5.t0 = _context5["catch"](0);
|
|
55
|
+
customData = parseWasmCustomSections(wasm);
|
|
56
|
+
xdrSections = customData.get('contractspecv0');
|
|
57
|
+
case 11:
|
|
58
|
+
if (!(!xdrSections || xdrSections.length === 0)) {
|
|
59
|
+
_context5.next = 13;
|
|
45
60
|
break;
|
|
46
61
|
}
|
|
47
62
|
throw new Error("Could not obtain contract spec from wasm");
|
|
48
|
-
case
|
|
63
|
+
case 13:
|
|
49
64
|
bufferSection = Buffer.from(xdrSections[0]);
|
|
50
65
|
specEntryArray = (0, _utils.processSpecEntryStream)(bufferSection);
|
|
51
66
|
spec = new _spec.Spec(specEntryArray);
|
|
52
67
|
return _context5.abrupt("return", spec);
|
|
53
|
-
case
|
|
68
|
+
case 17:
|
|
54
69
|
case "end":
|
|
55
70
|
return _context5.stop();
|
|
56
71
|
}
|
|
57
|
-
}, _callee5);
|
|
72
|
+
}, _callee5, null, [[0, 7]]);
|
|
58
73
|
}));
|
|
59
74
|
return _specFromWasm.apply(this, arguments);
|
|
60
75
|
}
|
|
76
|
+
function parseWasmCustomSections(buffer) {
|
|
77
|
+
var sections = new Map();
|
|
78
|
+
var arrayBuffer = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
|
|
79
|
+
var offset = 0;
|
|
80
|
+
var read = function read(length) {
|
|
81
|
+
if (offset + length > buffer.byteLength) throw new Error('Buffer overflow');
|
|
82
|
+
var bytes = new Uint8Array(arrayBuffer, offset, length);
|
|
83
|
+
offset += length;
|
|
84
|
+
return bytes;
|
|
85
|
+
};
|
|
86
|
+
if (_toConsumableArray(read(4)).join() !== '0,97,115,109') throw new Error('Invalid WASM magic');
|
|
87
|
+
if (_toConsumableArray(read(4)).join() !== '1,0,0,0') throw new Error('Invalid WASM version');
|
|
88
|
+
while (offset < buffer.byteLength) {
|
|
89
|
+
var sectionId = read(1)[0];
|
|
90
|
+
var sectionLength = readVarUint32();
|
|
91
|
+
var start = offset;
|
|
92
|
+
if (sectionId === 0) {
|
|
93
|
+
var nameLen = readVarUint32();
|
|
94
|
+
if (nameLen === 0 || offset + nameLen > start + sectionLength) continue;
|
|
95
|
+
var nameBytes = read(nameLen);
|
|
96
|
+
var payload = read(sectionLength - (offset - start));
|
|
97
|
+
try {
|
|
98
|
+
var name = new TextDecoder('utf-8', {
|
|
99
|
+
fatal: true
|
|
100
|
+
}).decode(nameBytes);
|
|
101
|
+
if (payload.length > 0) {
|
|
102
|
+
sections.set(name, (sections.get(name) || []).concat(payload));
|
|
103
|
+
}
|
|
104
|
+
} catch (_unused) {}
|
|
105
|
+
} else {
|
|
106
|
+
offset += sectionLength;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function readVarUint32() {
|
|
110
|
+
var value = 0,
|
|
111
|
+
shift = 0;
|
|
112
|
+
while (true) {
|
|
113
|
+
var byte = read(1)[0];
|
|
114
|
+
value |= (byte & 0x7F) << shift;
|
|
115
|
+
if ((byte & 0x80) === 0) break;
|
|
116
|
+
if ((shift += 7) >= 32) throw new Error('Invalid WASM value');
|
|
117
|
+
}
|
|
118
|
+
return value >>> 0;
|
|
119
|
+
}
|
|
120
|
+
return sections;
|
|
121
|
+
}
|
|
61
122
|
function specFromWasmHash(_x2, _x3) {
|
|
62
123
|
return _specFromWasmHash.apply(this, arguments);
|
|
63
124
|
}
|
|
@@ -157,7 +218,7 @@ var Client = exports.Client = function () {
|
|
|
157
218
|
case 3:
|
|
158
219
|
spec = _context.sent;
|
|
159
220
|
operation = _stellarBase.Operation.createCustomContract({
|
|
160
|
-
address: new _stellarBase.Address(options.publicKey),
|
|
221
|
+
address: new _stellarBase.Address(options.address || options.publicKey),
|
|
161
222
|
wasmHash: typeof wasmHash === "string" ? Buffer.from(wasmHash, format !== null && format !== void 0 ? format : "hex") : wasmHash,
|
|
162
223
|
salt: salt,
|
|
163
224
|
constructorArgs: args ? spec.funcArgsToScVals(CONSTRUCTOR_FUNC, args) : []
|
|
@@ -78,7 +78,9 @@ export declare class SentTransaction<T> {
|
|
|
78
78
|
* Initialize a `SentTransaction` from `options` and a `signed`
|
|
79
79
|
* AssembledTransaction. This will also send the transaction to the network.
|
|
80
80
|
*/
|
|
81
|
-
static init: <U>(
|
|
81
|
+
static init: <U>(
|
|
82
|
+
/** {@link AssembledTransaction} from which this SentTransaction was initialized */
|
|
83
|
+
assembled: AssembledTransaction<U>) => Promise<SentTransaction<U>>;
|
|
82
84
|
private send;
|
|
83
85
|
get result(): T;
|
|
84
86
|
}
|
|
@@ -13,7 +13,7 @@ export interface EventSourceOptions<T> {
|
|
|
13
13
|
* @param {string} serverUrl URL of Horizon server
|
|
14
14
|
* @class CallBuilder
|
|
15
15
|
*/
|
|
16
|
-
export declare class CallBuilder<T extends HorizonApi.FeeStatsResponse | HorizonApi.BaseResponse | ServerApi.CollectionPage<HorizonApi.BaseResponse>> {
|
|
16
|
+
export declare class CallBuilder<T extends HorizonApi.FeeStatsResponse | HorizonApi.BaseResponse | HorizonApi.RootResponse | ServerApi.CollectionPage<HorizonApi.BaseResponse>> {
|
|
17
17
|
protected url: URI;
|
|
18
18
|
filter: string[][];
|
|
19
19
|
protected originalSegments: string[];
|
|
@@ -236,6 +236,8 @@ export declare namespace HorizonApi {
|
|
|
236
236
|
asset_code?: string;
|
|
237
237
|
asset_issuer?: string;
|
|
238
238
|
amount: string;
|
|
239
|
+
to_muxed?: string;
|
|
240
|
+
to_muxed_id?: string;
|
|
239
241
|
}
|
|
240
242
|
interface PathPaymentOperationResponse extends BaseOperationResponse<OperationResponseType.pathPayment, OperationResponseTypeI.pathPayment> {
|
|
241
243
|
amount: string;
|
|
@@ -524,4 +526,17 @@ export declare namespace HorizonApi {
|
|
|
524
526
|
};
|
|
525
527
|
result_xdr: string;
|
|
526
528
|
}
|
|
529
|
+
interface RootResponse {
|
|
530
|
+
horizon_version: string;
|
|
531
|
+
core_version: string;
|
|
532
|
+
ingest_latest_ledger: number;
|
|
533
|
+
history_latest_ledger: number;
|
|
534
|
+
history_latest_ledger_closed_at: string;
|
|
535
|
+
history_elder_ledger: number;
|
|
536
|
+
core_latest_ledger: number;
|
|
537
|
+
network_passphrase: string;
|
|
538
|
+
current_protocol_version: number;
|
|
539
|
+
supported_protocol_version: number;
|
|
540
|
+
core_supported_protocol_version: number;
|
|
541
|
+
}
|
|
527
542
|
}
|
|
@@ -10,7 +10,7 @@ var _urijs = _interopRequireDefault(require("urijs"));
|
|
|
10
10
|
var _httpClient = require("../http-client");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
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); }
|
|
13
|
-
var version = exports.version = "13.
|
|
13
|
+
var version = exports.version = "13.2.0";
|
|
14
14
|
var SERVER_TIME_MAP = exports.SERVER_TIME_MAP = {};
|
|
15
15
|
var AxiosClient = exports.AxiosClient = (0, _httpClient.create)({
|
|
16
16
|
headers: {
|
|
@@ -84,6 +84,11 @@ export declare class HorizonServer {
|
|
|
84
84
|
* @returns {Promise<HorizonApi.FeeStatsResponse>} Promise that resolves to the fee stats returned by Horizon.
|
|
85
85
|
*/
|
|
86
86
|
feeStats(): Promise<HorizonApi.FeeStatsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Fetch the Horizon server's root endpoint.
|
|
89
|
+
* @returns {Promise<HorizonApi.RootResponse>} Promise that resolves to the root endpoint returned by Horizon.
|
|
90
|
+
*/
|
|
91
|
+
root(): Promise<HorizonApi.RootResponse>;
|
|
87
92
|
/**
|
|
88
93
|
* Submits a transaction to the network.
|
|
89
94
|
*
|
|
@@ -170,28 +170,49 @@ var HorizonServer = exports.HorizonServer = function () {
|
|
|
170
170
|
}
|
|
171
171
|
return feeStats;
|
|
172
172
|
}())
|
|
173
|
+
}, {
|
|
174
|
+
key: "root",
|
|
175
|
+
value: (function () {
|
|
176
|
+
var _root = _asyncToGenerator(_regeneratorRuntime().mark(function _callee4() {
|
|
177
|
+
var cb;
|
|
178
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
179
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
180
|
+
case 0:
|
|
181
|
+
cb = new _call_builder.CallBuilder((0, _urijs.default)(this.serverURL));
|
|
182
|
+
return _context4.abrupt("return", cb.call());
|
|
183
|
+
case 2:
|
|
184
|
+
case "end":
|
|
185
|
+
return _context4.stop();
|
|
186
|
+
}
|
|
187
|
+
}, _callee4, this);
|
|
188
|
+
}));
|
|
189
|
+
function root() {
|
|
190
|
+
return _root.apply(this, arguments);
|
|
191
|
+
}
|
|
192
|
+
return root;
|
|
193
|
+
}())
|
|
173
194
|
}, {
|
|
174
195
|
key: "submitTransaction",
|
|
175
196
|
value: (function () {
|
|
176
|
-
var _submitTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
197
|
+
var _submitTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee5(transaction) {
|
|
177
198
|
var opts,
|
|
178
199
|
tx,
|
|
179
|
-
|
|
180
|
-
return _regeneratorRuntime().wrap(function
|
|
181
|
-
while (1) switch (
|
|
200
|
+
_args5 = arguments;
|
|
201
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
202
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
182
203
|
case 0:
|
|
183
|
-
opts =
|
|
204
|
+
opts = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {
|
|
184
205
|
skipMemoRequiredCheck: false
|
|
185
206
|
};
|
|
186
207
|
if (opts.skipMemoRequiredCheck) {
|
|
187
|
-
|
|
208
|
+
_context5.next = 4;
|
|
188
209
|
break;
|
|
189
210
|
}
|
|
190
|
-
|
|
211
|
+
_context5.next = 4;
|
|
191
212
|
return this.checkMemoRequired(transaction);
|
|
192
213
|
case 4:
|
|
193
214
|
tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
|
|
194
|
-
return
|
|
215
|
+
return _context5.abrupt("return", _horizon_axios_client.default.post((0, _urijs.default)(this.serverURL).segment("transactions").toString(), "tx=".concat(tx), {
|
|
195
216
|
timeout: SUBMIT_TRANSACTION_TIMEOUT
|
|
196
217
|
}).then(function (response) {
|
|
197
218
|
if (!response.data.result_xdr) {
|
|
@@ -302,9 +323,9 @@ var HorizonServer = exports.HorizonServer = function () {
|
|
|
302
323
|
}));
|
|
303
324
|
case 6:
|
|
304
325
|
case "end":
|
|
305
|
-
return
|
|
326
|
+
return _context5.stop();
|
|
306
327
|
}
|
|
307
|
-
},
|
|
328
|
+
}, _callee5, this);
|
|
308
329
|
}));
|
|
309
330
|
function submitTransaction(_x2) {
|
|
310
331
|
return _submitTransaction.apply(this, arguments);
|
|
@@ -314,25 +335,25 @@ var HorizonServer = exports.HorizonServer = function () {
|
|
|
314
335
|
}, {
|
|
315
336
|
key: "submitAsyncTransaction",
|
|
316
337
|
value: (function () {
|
|
317
|
-
var _submitAsyncTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
338
|
+
var _submitAsyncTransaction = _asyncToGenerator(_regeneratorRuntime().mark(function _callee6(transaction) {
|
|
318
339
|
var opts,
|
|
319
340
|
tx,
|
|
320
|
-
|
|
321
|
-
return _regeneratorRuntime().wrap(function
|
|
322
|
-
while (1) switch (
|
|
341
|
+
_args6 = arguments;
|
|
342
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
343
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
323
344
|
case 0:
|
|
324
|
-
opts =
|
|
345
|
+
opts = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {
|
|
325
346
|
skipMemoRequiredCheck: false
|
|
326
347
|
};
|
|
327
348
|
if (opts.skipMemoRequiredCheck) {
|
|
328
|
-
|
|
349
|
+
_context6.next = 4;
|
|
329
350
|
break;
|
|
330
351
|
}
|
|
331
|
-
|
|
352
|
+
_context6.next = 4;
|
|
332
353
|
return this.checkMemoRequired(transaction);
|
|
333
354
|
case 4:
|
|
334
355
|
tx = encodeURIComponent(transaction.toEnvelope().toXDR().toString("base64"));
|
|
335
|
-
return
|
|
356
|
+
return _context6.abrupt("return", _horizon_axios_client.default.post((0, _urijs.default)(this.serverURL).segment("transactions_async").toString(), "tx=".concat(tx)).then(function (response) {
|
|
336
357
|
return response.data;
|
|
337
358
|
}).catch(function (response) {
|
|
338
359
|
if (response instanceof Error) {
|
|
@@ -342,9 +363,9 @@ var HorizonServer = exports.HorizonServer = function () {
|
|
|
342
363
|
}));
|
|
343
364
|
case 6:
|
|
344
365
|
case "end":
|
|
345
|
-
return
|
|
366
|
+
return _context6.stop();
|
|
346
367
|
}
|
|
347
|
-
},
|
|
368
|
+
}, _callee6, this);
|
|
348
369
|
}));
|
|
349
370
|
function submitAsyncTransaction(_x3) {
|
|
350
371
|
return _submitAsyncTransaction.apply(this, arguments);
|
|
@@ -429,21 +450,21 @@ var HorizonServer = exports.HorizonServer = function () {
|
|
|
429
450
|
}, {
|
|
430
451
|
key: "loadAccount",
|
|
431
452
|
value: (function () {
|
|
432
|
-
var _loadAccount = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
453
|
+
var _loadAccount = _asyncToGenerator(_regeneratorRuntime().mark(function _callee7(accountId) {
|
|
433
454
|
var res;
|
|
434
|
-
return _regeneratorRuntime().wrap(function
|
|
435
|
-
while (1) switch (
|
|
455
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
456
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
436
457
|
case 0:
|
|
437
|
-
|
|
458
|
+
_context7.next = 2;
|
|
438
459
|
return this.accounts().accountId(accountId).call();
|
|
439
460
|
case 2:
|
|
440
|
-
res =
|
|
441
|
-
return
|
|
461
|
+
res = _context7.sent;
|
|
462
|
+
return _context7.abrupt("return", new _account_response.AccountResponse(res));
|
|
442
463
|
case 4:
|
|
443
464
|
case "end":
|
|
444
|
-
return
|
|
465
|
+
return _context7.stop();
|
|
445
466
|
}
|
|
446
|
-
},
|
|
467
|
+
}, _callee7, this);
|
|
447
468
|
}));
|
|
448
469
|
function loadAccount(_x4) {
|
|
449
470
|
return _loadAccount.apply(this, arguments);
|
|
@@ -458,88 +479,88 @@ var HorizonServer = exports.HorizonServer = function () {
|
|
|
458
479
|
}, {
|
|
459
480
|
key: "checkMemoRequired",
|
|
460
481
|
value: (function () {
|
|
461
|
-
var _checkMemoRequired = _asyncToGenerator(_regeneratorRuntime().mark(function
|
|
482
|
+
var _checkMemoRequired = _asyncToGenerator(_regeneratorRuntime().mark(function _callee8(transaction) {
|
|
462
483
|
var destinations, i, operation, destination, account;
|
|
463
|
-
return _regeneratorRuntime().wrap(function
|
|
464
|
-
while (1) switch (
|
|
484
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
485
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
465
486
|
case 0:
|
|
466
487
|
if (transaction instanceof _stellarBase.FeeBumpTransaction) {
|
|
467
488
|
transaction = transaction.innerTransaction;
|
|
468
489
|
}
|
|
469
490
|
if (!(transaction.memo.type !== "none")) {
|
|
470
|
-
|
|
491
|
+
_context8.next = 3;
|
|
471
492
|
break;
|
|
472
493
|
}
|
|
473
|
-
return
|
|
494
|
+
return _context8.abrupt("return");
|
|
474
495
|
case 3:
|
|
475
496
|
destinations = new Set();
|
|
476
497
|
i = 0;
|
|
477
498
|
case 5:
|
|
478
499
|
if (!(i < transaction.operations.length)) {
|
|
479
|
-
|
|
500
|
+
_context8.next = 36;
|
|
480
501
|
break;
|
|
481
502
|
}
|
|
482
503
|
operation = transaction.operations[i];
|
|
483
|
-
|
|
484
|
-
|
|
504
|
+
_context8.t0 = operation.type;
|
|
505
|
+
_context8.next = _context8.t0 === "payment" ? 10 : _context8.t0 === "pathPaymentStrictReceive" ? 10 : _context8.t0 === "pathPaymentStrictSend" ? 10 : _context8.t0 === "accountMerge" ? 10 : 11;
|
|
485
506
|
break;
|
|
486
507
|
case 10:
|
|
487
|
-
return
|
|
508
|
+
return _context8.abrupt("break", 12);
|
|
488
509
|
case 11:
|
|
489
|
-
return
|
|
510
|
+
return _context8.abrupt("continue", 33);
|
|
490
511
|
case 12:
|
|
491
512
|
destination = operation.destination;
|
|
492
513
|
if (!destinations.has(destination)) {
|
|
493
|
-
|
|
514
|
+
_context8.next = 15;
|
|
494
515
|
break;
|
|
495
516
|
}
|
|
496
|
-
return
|
|
517
|
+
return _context8.abrupt("continue", 33);
|
|
497
518
|
case 15:
|
|
498
519
|
destinations.add(destination);
|
|
499
520
|
if (!destination.startsWith("M")) {
|
|
500
|
-
|
|
521
|
+
_context8.next = 18;
|
|
501
522
|
break;
|
|
502
523
|
}
|
|
503
|
-
return
|
|
524
|
+
return _context8.abrupt("continue", 33);
|
|
504
525
|
case 18:
|
|
505
|
-
|
|
506
|
-
|
|
526
|
+
_context8.prev = 18;
|
|
527
|
+
_context8.next = 21;
|
|
507
528
|
return this.loadAccount(destination);
|
|
508
529
|
case 21:
|
|
509
|
-
account =
|
|
530
|
+
account = _context8.sent;
|
|
510
531
|
if (!(account.data_attr["config.memo_required"] === ACCOUNT_REQUIRES_MEMO)) {
|
|
511
|
-
|
|
532
|
+
_context8.next = 24;
|
|
512
533
|
break;
|
|
513
534
|
}
|
|
514
535
|
throw new _errors.AccountRequiresMemoError("account requires memo", destination, i);
|
|
515
536
|
case 24:
|
|
516
|
-
|
|
537
|
+
_context8.next = 33;
|
|
517
538
|
break;
|
|
518
539
|
case 26:
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
if (!(
|
|
522
|
-
|
|
540
|
+
_context8.prev = 26;
|
|
541
|
+
_context8.t1 = _context8["catch"](18);
|
|
542
|
+
if (!(_context8.t1 instanceof _errors.AccountRequiresMemoError)) {
|
|
543
|
+
_context8.next = 30;
|
|
523
544
|
break;
|
|
524
545
|
}
|
|
525
|
-
throw
|
|
546
|
+
throw _context8.t1;
|
|
526
547
|
case 30:
|
|
527
|
-
if (
|
|
528
|
-
|
|
548
|
+
if (_context8.t1 instanceof _errors.NotFoundError) {
|
|
549
|
+
_context8.next = 32;
|
|
529
550
|
break;
|
|
530
551
|
}
|
|
531
|
-
throw
|
|
552
|
+
throw _context8.t1;
|
|
532
553
|
case 32:
|
|
533
|
-
return
|
|
554
|
+
return _context8.abrupt("continue", 33);
|
|
534
555
|
case 33:
|
|
535
556
|
i += 1;
|
|
536
|
-
|
|
557
|
+
_context8.next = 5;
|
|
537
558
|
break;
|
|
538
559
|
case 36:
|
|
539
560
|
case "end":
|
|
540
|
-
return
|
|
561
|
+
return _context8.stop();
|
|
541
562
|
}
|
|
542
|
-
},
|
|
563
|
+
}, _callee8, this, [[18, 26]]);
|
|
543
564
|
}));
|
|
544
565
|
function checkMemoRequired(_x5) {
|
|
545
566
|
return _checkMemoRequired.apply(this, arguments);
|
|
@@ -155,6 +155,7 @@ export declare namespace Api {
|
|
|
155
155
|
export interface GetEventsResponse {
|
|
156
156
|
latestLedger: number;
|
|
157
157
|
events: EventResponse[];
|
|
158
|
+
cursor: string;
|
|
158
159
|
}
|
|
159
160
|
export interface EventResponse extends BaseEventResponse {
|
|
160
161
|
contractId?: Contract;
|
|
@@ -164,13 +165,13 @@ export declare namespace Api {
|
|
|
164
165
|
export interface RawGetEventsResponse {
|
|
165
166
|
latestLedger: number;
|
|
166
167
|
events: RawEventResponse[];
|
|
168
|
+
cursor: string;
|
|
167
169
|
}
|
|
168
170
|
interface BaseEventResponse {
|
|
169
171
|
id: string;
|
|
170
172
|
type: EventType;
|
|
171
173
|
ledger: number;
|
|
172
174
|
ledgerClosedAt: string;
|
|
173
|
-
cursor: string;
|
|
174
175
|
pagingToken: string;
|
|
175
176
|
inSuccessfulContractCall: boolean;
|
|
176
177
|
txHash: string;
|