wao 0.3.1 → 0.4.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/cjs/ar.js CHANGED
@@ -42,9 +42,9 @@ var AR = /*#__PURE__*/function () {
42
42
  if (!_arweave.protocol) _arweave.protocol = (0, _utils.isLocalhost)(_arweave.host) ? "http" : "https";
43
43
  if (!_arweave.port) _arweave.port = (0, _utils.isLocalhost)(_arweave.host) ? 1984 : 443;
44
44
  this.port = _arweave.port;
45
- this.arweave = _arweave2["default"].init(_arweave);
46
45
  this.host = _arweave.host;
47
46
  this.protocol = _arweave.protocol;
47
+ this.arweave = _arweave2["default"].init(_arweave);
48
48
  }
49
49
  return _createClass(AR, [{
50
50
  key: "isArConnect",
package/cjs/armem.js ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _arweave = _interopRequireDefault(require("arweave"));
9
+ var _ramda = require("ramda");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ 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); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ 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); }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ var ArMem = exports["default"] = /*#__PURE__*/_createClass(function ArMem() {
17
+ var _this = this;
18
+ _classCallCheck(this, ArMem);
19
+ this.__type__ = "mem";
20
+ this.arweave = _arweave["default"].init();
21
+ this.arweave.transactions.getTransactionAnchor = function () {
22
+ return _this.blocks.length === 0 ? "" : (0, _ramda.last)(_this.blocks);
23
+ };
24
+ this.arweave.transactions.getPrice = function () {
25
+ return 0;
26
+ };
27
+ this.txs = {};
28
+ this.height = 0;
29
+ this.blocks = [];
30
+ this.env = {};
31
+ this.modules = {
32
+ aos2_0_1: "Do_Uc2Sju_ffp6Ev0AnLVdPtot15rvMjP-a9VVaA5fM",
33
+ aos1: "cNlipBptaF9JeFAf4wUmpi43EojNanIBos3EfNrEOWo",
34
+ sqlite: "ghSkge2sIUD_F00ym5sEimC63BDBuBrq4b5OcwxOjiw"
35
+ };
36
+ this.modmap = {};
37
+ this.msgs = {};
38
+ this.wasms = {
39
+ "Do_Uc2Sju_ffp6Ev0AnLVdPtot15rvMjP-a9VVaA5fM": {
40
+ file: "aos2_0_1",
41
+ format: "wasm64-unknown-emscripten-draft_2024_02_15"
42
+ },
43
+ cNlipBptaF9JeFAf4wUmpi43EojNanIBos3EfNrEOWo: {
44
+ file: "aos_1",
45
+ format: "wasm64-unknown-emscripten-draft_2024_02_15"
46
+ },
47
+ ghSkge2sIUD_F00ym5sEimC63BDBuBrq4b5OcwxOjiw: {
48
+ file: "sqlite",
49
+ format: "wasm64-unknown-emscripten-draft_2024_02_15"
50
+ }
51
+ };
52
+ });
package/cjs/gql.js ADDED
@@ -0,0 +1,393 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _ramda = require("ramda");
9
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _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; }
10
+ 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; }
11
+ 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; }
12
+ 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; }
13
+ 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); }
14
+ 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); }); }; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ 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); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ 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); }
20
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
21
+ 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; } }
22
+ 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; }
23
+ var full = "id anchor signature recipient owner { address key } fee { winston ar } quantity { winston ar } data { size type } tags { name value } block { id timestamp height previous } parent { id }";
24
+ var full_blocks = "id timestamp height previous";
25
+ var subs = {
26
+ owner: ["address", "key"],
27
+ fee: ["winston", "ar"],
28
+ quantity: ["winston", "ar"],
29
+ data: ["size", "type"],
30
+ tags: ["name", "value"],
31
+ block: ["id", "timestamp", "height", "previous"],
32
+ parent: ["id"]
33
+ };
34
+ var field = function field(key) {
35
+ var val = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
36
+ if ((0, _ramda.includes)(key, ["id", "anchor", "signature", "recipient"])) {
37
+ return key;
38
+ } else if (subs[key]) {
39
+ var _subs = [];
40
+ if (val === true) val = subs[key];else if ((0, _ramda.is)(Object, val) && !(0, _ramda.is)(Array, val)) {
41
+ var _val = [];
42
+ var isTrue = false;
43
+ var isFalse = false;
44
+ for (var k in val) if (val[k] === true) isTrue = true;else if (val[k] === false) isFalse = true;
45
+ if (!isTrue && isFalse) {
46
+ var _iterator = _createForOfIteratorHelper(subs[key]),
47
+ _step;
48
+ try {
49
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
50
+ var _k = _step.value;
51
+ if (val[_k] !== false) _val.push(_k);
52
+ }
53
+ } catch (err) {
54
+ _iterator.e(err);
55
+ } finally {
56
+ _iterator.f();
57
+ }
58
+ } else {
59
+ for (var _k2 in val) if (val[_k2] === true) _val.push(_k2);
60
+ }
61
+ val = _val;
62
+ } else if (!(0, _ramda.is)(Array, val)) val = subs[key];
63
+ var _iterator2 = _createForOfIteratorHelper(val),
64
+ _step2;
65
+ try {
66
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
67
+ var v2 = _step2.value;
68
+ if ((0, _ramda.is)(String, v2) && (0, _ramda.includes)(v2, subs[key])) _subs.push(v2);
69
+ }
70
+ } catch (err) {
71
+ _iterator2.e(err);
72
+ } finally {
73
+ _iterator2.f();
74
+ }
75
+ if (_subs.length === 0) return null;
76
+ return "".concat(key, " { ").concat(_subs.join(" "), " }");
77
+ }
78
+ return null;
79
+ };
80
+ var field_blocks = function field_blocks(key) {
81
+ var val = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
82
+ if ((0, _ramda.includes)(key, ["id", "timestamp", "height", "previous"])) {
83
+ return key;
84
+ }
85
+ return null;
86
+ };
87
+ var query = function query() {
88
+ var _block2, _block3;
89
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
90
+ var cond = [];
91
+ var tags = [];
92
+ for (var k in (_opt$tags = opt.tags) !== null && _opt$tags !== void 0 ? _opt$tags : {}) {
93
+ var _opt$tags;
94
+ if ((0, _ramda.is)(String, opt.tags[k])) {
95
+ tags.push("{ name: \"".concat(k, "\", values: [\"").concat(opt.tags[k], "\"] }"));
96
+ } else if ((0, _ramda.is)(Array, opt.tags[k])) {
97
+ tags.push("{ name: \"".concat(k, "\", values: [").concat((0, _ramda.map)(function (v) {
98
+ return "\"".concat(v, "\"");
99
+ }, opt.tags[k]).join(", "), "] }"));
100
+ }
101
+ }
102
+ if (tags.length > 0) cond.push("tags: [".concat(tags.join(", "), "]"));
103
+ var recipients = null;
104
+ if ((0, _ramda.is)(Array, opt.recipients)) recipients = opt.recipients;else if ((0, _ramda.is)(String, opt.recipient)) recipients = [opt.recipient];
105
+ if (!(0, _ramda.isNil)(recipients) && recipients.length > 0) {
106
+ cond.push("recipients: [".concat((0, _ramda.map)(function (v) {
107
+ return "\"".concat(v, "\"");
108
+ }, recipients).join(", "), "]"));
109
+ }
110
+ var owners = null;
111
+ if ((0, _ramda.is)(Array, opt.owners)) owners = opt.owners;else if ((0, _ramda.is)(String, opt.owner)) owners = [opt.owner];
112
+ if (!(0, _ramda.isNil)(owners) && owners.length > 0) {
113
+ cond.push("owners: [".concat((0, _ramda.map)(function (v) {
114
+ return "\"".concat(v, "\"");
115
+ }, owners).join(", "), "]"));
116
+ }
117
+ var ids = null;
118
+ if ((0, _ramda.is)(Array, opt.ids)) ids = opt.ids;else if ((0, _ramda.is)(String, opt.id)) ids = [opt.id];
119
+ if (!(0, _ramda.isNil)(ids) && ids.length > 0) {
120
+ cond.push("ids: [".concat((0, _ramda.map)(function (v) {
121
+ return "\"".concat(v, "\"");
122
+ }, ids).join(", "), "]"));
123
+ }
124
+ var _block = opt.block;
125
+ if ((0, _ramda.is)(Number, opt.block)) {
126
+ _block = {
127
+ min: opt.block,
128
+ max: opt.block
129
+ };
130
+ } else if ((0, _ramda.is)(Array, opt.block) && opt.block.length > 0) {
131
+ _block = {};
132
+ if (!(0, _ramda.isNil)(opt.block[0])) _block.min = opt.block[0];
133
+ if (!(0, _ramda.isNil)(opt.block[1])) _block.max = opt.block[1];
134
+ }
135
+ if (!(0, _ramda.isNil)((_block2 = _block) === null || _block2 === void 0 ? void 0 : _block2.max) || !(0, _ramda.isNil)((_block3 = _block) === null || _block3 === void 0 ? void 0 : _block3.min)) {
136
+ var block = [];
137
+ if (!(0, _ramda.isNil)(_block.min)) block.push("min: ".concat(_block.min));
138
+ if (!(0, _ramda.isNil)(_block.max)) block.push("max: ".concat(_block.max));
139
+ if (block.length > 0) cond.push("block : {".concat(block.join(", "), "}"));
140
+ }
141
+ if (opt.first) cond.push("first: ".concat(opt.first));
142
+ if (opt.after) cond.push("after: \"".concat(opt.after, "\""));
143
+ if (opt.asc) cond.push("sort: HEIGHT_ASC");
144
+ var _cond = "";
145
+ if (cond.length > 0) _cond = "(".concat(cond.join(", "), ")");
146
+ var fields = [];
147
+ if ((0, _ramda.is)(Array, opt.fields) && opt.fields.length > 0) {
148
+ var _iterator3 = _createForOfIteratorHelper(opt.fields),
149
+ _step3;
150
+ try {
151
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
152
+ var v = _step3.value;
153
+ if ((0, _ramda.is)(String, v)) {
154
+ var fld = field(v);
155
+ if (fld) fields.push(fld);
156
+ } else if ((0, _ramda.is)(Object, v) && !(0, _ramda.is)(Array, v)) {
157
+ for (var _k3 in v) {
158
+ var _fld = field(_k3, v[_k3]);
159
+ if (_fld) fields.push(_fld);
160
+ }
161
+ }
162
+ }
163
+ } catch (err) {
164
+ _iterator3.e(err);
165
+ } finally {
166
+ _iterator3.f();
167
+ }
168
+ } else if ((0, _ramda.is)(Object, opt.fields) && !(0, _ramda.is)(Array, opt.fields)) {
169
+ for (var _k4 in opt.fields) {
170
+ var _fld2 = field(_k4, opt.fields[_k4]);
171
+ if (_fld2) fields.push(_fld2);
172
+ }
173
+ }
174
+ var _fields = fields.length > 0 ? fields.join(" ") : full;
175
+ return "query {\n transactions ".concat(_cond, "{\n edges { cursor node { ").concat(_fields, " } }\n }\n}");
176
+ };
177
+ var query_blocks = function query_blocks() {
178
+ var _height2, _height3;
179
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
180
+ var cond = [];
181
+ var _height = opt.height;
182
+ if ((0, _ramda.is)(Number, opt.height)) {
183
+ _height = {
184
+ min: opt.height,
185
+ max: opt.height
186
+ };
187
+ } else if ((0, _ramda.is)(Array, opt.height) && opt.height.length > 0) {
188
+ _height = {};
189
+ if (!(0, _ramda.isNil)(opt.height[0])) _height.min = opt.height[0];
190
+ if (!(0, _ramda.isNil)(opt.height[1])) _height.max = opt.height[1];
191
+ }
192
+ if (!(0, _ramda.isNil)((_height2 = _height) === null || _height2 === void 0 ? void 0 : _height2.max) || !(0, _ramda.isNil)((_height3 = _height) === null || _height3 === void 0 ? void 0 : _height3.min)) {
193
+ var height = [];
194
+ if (!(0, _ramda.isNil)(_height.min)) height.push("min: ".concat(_height.min));
195
+ if (!(0, _ramda.isNil)(_height.max)) height.push("max: ".concat(_height.max));
196
+ if (height.length > 0) cond.push("height : {".concat(height.join(", "), "}"));
197
+ }
198
+ if (opt.first) cond.push("first: ".concat(opt.first));
199
+ if (opt.after) cond.push("after: \"".concat(opt.after, "\""));
200
+ if (opt.asc) cond.push("sort: HEIGHT_ASC");
201
+ var _cond = "";
202
+ if (cond.length > 0) _cond = "(".concat(cond.join(", "), ")");
203
+ var fields = [];
204
+ if ((0, _ramda.is)(Array, opt.fields) && opt.fields.length > 0) {
205
+ var _fields2 = [];
206
+ var _iterator4 = _createForOfIteratorHelper(opt.fields),
207
+ _step4;
208
+ try {
209
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
210
+ var v = _step4.value;
211
+ if ((0, _ramda.is)(String, v)) {
212
+ var fld = field_blocks(v);
213
+ if (fld) _fields2.push(fld);
214
+ } else if ((0, _ramda.is)(Object, v) && !(0, _ramda.is)(Array, v)) {
215
+ for (var k in v) {
216
+ var _fld3 = field_blocks(k, v[k]);
217
+ if (_fld3) _fields2.push(_fld3);
218
+ }
219
+ }
220
+ }
221
+ } catch (err) {
222
+ _iterator4.e(err);
223
+ } finally {
224
+ _iterator4.f();
225
+ }
226
+ } else if ((0, _ramda.is)(Object, opt.fields) && !(0, _ramda.is)(Array, opt.fields)) {
227
+ for (var _k5 in opt.fields) {
228
+ var _fld4 = field_blocks(_k5, opt.fields[_k5]);
229
+ if (_fld4) fields.push(_fld4);
230
+ }
231
+ }
232
+ var _fields = fields.length > 0 ? fields.join(" ") : full_blocks;
233
+ return "query {\n blocks ".concat(_cond, "{\n edges { cursor node { ").concat(_fields, " } }\n }\n}");
234
+ };
235
+ var GQL = exports["default"] = /*#__PURE__*/function () {
236
+ function GQL(_ref) {
237
+ var _ref$url = _ref.url,
238
+ url = _ref$url === void 0 ? "https://arweave.net/graphql" : _ref$url;
239
+ _classCallCheck(this, GQL);
240
+ this.url = url;
241
+ }
242
+ return _createClass(GQL, [{
243
+ key: "_fetch",
244
+ value: function () {
245
+ var _fetch2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(query, tar) {
246
+ var json;
247
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
248
+ while (1) switch (_context.prev = _context.next) {
249
+ case 0:
250
+ _context.next = 2;
251
+ return fetch(this.url, {
252
+ method: "POST",
253
+ headers: {
254
+ "Content-Type": "application/json"
255
+ },
256
+ body: JSON.stringify({
257
+ query: query
258
+ })
259
+ }).then(function (r) {
260
+ return r.json();
261
+ });
262
+ case 2:
263
+ json = _context.sent;
264
+ return _context.abrupt("return", (0, _ramda.map)(function (v) {
265
+ return _objectSpread({
266
+ cursor: v.cursor
267
+ }, v.node);
268
+ })(json.data[tar].edges));
269
+ case 4:
270
+ case "end":
271
+ return _context.stop();
272
+ }
273
+ }, _callee, this);
274
+ }));
275
+ function _fetch(_x, _x2) {
276
+ return _fetch2.apply(this, arguments);
277
+ }
278
+ return _fetch;
279
+ }()
280
+ }, {
281
+ key: "fetch",
282
+ value: function () {
283
+ var _fetch3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
284
+ var _this = this;
285
+ var opt,
286
+ query,
287
+ tar,
288
+ data,
289
+ cursor,
290
+ next,
291
+ _args3 = arguments;
292
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
293
+ while (1) switch (_context3.prev = _context3.next) {
294
+ case 0:
295
+ opt = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
296
+ query = _args3.length > 1 ? _args3[1] : undefined;
297
+ tar = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : "transactions";
298
+ _context3.next = 5;
299
+ return this._fetch(query, tar);
300
+ case 5:
301
+ data = _context3.sent;
302
+ if (!(opt.next === true)) {
303
+ _context3.next = 13;
304
+ break;
305
+ }
306
+ cursor = null;
307
+ if (data.length > 0) cursor = (0, _ramda.last)(data).cursor;
308
+ next = !cursor ? null : /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
309
+ var _opt;
310
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
311
+ while (1) switch (_context2.prev = _context2.next) {
312
+ case 0:
313
+ _opt = (0, _ramda.clone)(opt);
314
+ _opt.after = cursor;
315
+ _context2.next = 4;
316
+ return _this.txs(_opt);
317
+ case 4:
318
+ return _context2.abrupt("return", _context2.sent);
319
+ case 5:
320
+ case "end":
321
+ return _context2.stop();
322
+ }
323
+ }, _callee2);
324
+ }));
325
+ return _context3.abrupt("return", {
326
+ data: data,
327
+ next: next
328
+ });
329
+ case 13:
330
+ return _context3.abrupt("return", data);
331
+ case 14:
332
+ case "end":
333
+ return _context3.stop();
334
+ }
335
+ }, _callee3, this);
336
+ }));
337
+ function fetch() {
338
+ return _fetch3.apply(this, arguments);
339
+ }
340
+ return fetch;
341
+ }()
342
+ }, {
343
+ key: "txs",
344
+ value: function () {
345
+ var _txs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
346
+ var opt,
347
+ _args4 = arguments;
348
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
349
+ while (1) switch (_context4.prev = _context4.next) {
350
+ case 0:
351
+ opt = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
352
+ _context4.next = 3;
353
+ return this.fetch(opt, query(opt));
354
+ case 3:
355
+ return _context4.abrupt("return", _context4.sent);
356
+ case 4:
357
+ case "end":
358
+ return _context4.stop();
359
+ }
360
+ }, _callee4, this);
361
+ }));
362
+ function txs() {
363
+ return _txs.apply(this, arguments);
364
+ }
365
+ return txs;
366
+ }()
367
+ }, {
368
+ key: "blocks",
369
+ value: function () {
370
+ var _blocks = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
371
+ var opt,
372
+ _args5 = arguments;
373
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
374
+ while (1) switch (_context5.prev = _context5.next) {
375
+ case 0:
376
+ opt = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
377
+ _context5.next = 3;
378
+ return this.fetch(opt, query_blocks(opt), "blocks");
379
+ case 3:
380
+ return _context5.abrupt("return", _context5.sent);
381
+ case 4:
382
+ case "end":
383
+ return _context5.stop();
384
+ }
385
+ }, _callee5, this);
386
+ }));
387
+ function blocks() {
388
+ return _blocks.apply(this, arguments);
389
+ }
390
+ return blocks;
391
+ }()
392
+ }]);
393
+ }();
package/cjs/index.js CHANGED
@@ -15,6 +15,13 @@ Object.defineProperty(exports, "AR", {
15
15
  return _ar["default"];
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "GQL", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _gql["default"];
22
+ }
23
+ });
18
24
  var _ar = _interopRequireDefault(require("./ar.js"));
19
25
  var _ao = _interopRequireDefault(require("./ao.js"));
26
+ var _gql = _interopRequireDefault(require("./gql.js"));
20
27
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
package/cjs/tao.js CHANGED
@@ -7,8 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = void 0;
8
8
  var _ao = _interopRequireDefault(require("./ao.js"));
9
9
  var _utils = require("./utils.js");
10
- var _ar = _interopRequireDefault(require("./ar.js"));
10
+ var _tar = _interopRequireDefault(require("./tar.js"));
11
11
  var _aoconnect = require("./aoconnect.js");
12
+ var _test = require("./test.js");
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
14
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _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; }
14
15
  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,8 +38,7 @@ var AO = /*#__PURE__*/function (_MAO) {
37
38
  in_memory: true
38
39
  })]);
39
40
  _this.in_memory = true;
40
- var _connect = (0, _aoconnect.connect)(),
41
- accounts = _connect.accounts,
41
+ var _connect = (0, _aoconnect.connect)(opt.mem),
42
42
  modules = _connect.modules,
43
43
  results = _connect.results,
44
44
  assign = _connect.assign,
@@ -48,18 +48,19 @@ var AO = /*#__PURE__*/function (_MAO) {
48
48
  dryrun = _connect.dryrun,
49
49
  monitor = _connect.monitor,
50
50
  unmonitor = _connect.unmonitor,
51
- txs = _connect.txs;
52
- _this.module = modules.aos2_0_1;
51
+ mem = _connect.mem;
52
+ _this.module = mem.modules.aos2_0_1;
53
53
  _this.assign = assign;
54
54
  _this.result = result;
55
55
  _this.results = results;
56
56
  _this.message = message;
57
57
  _this.spawn = spawn;
58
58
  _this.dryrun = dryrun;
59
- _this.ar.txs = txs;
60
59
  _this.monitor = monitor;
61
60
  _this.unmonitor = unmonitor;
62
- _this.accounts = accounts;
61
+ _this.ar = new _tar["default"]({
62
+ mem: mem
63
+ });
63
64
  return _this;
64
65
  }
65
66
  _inherits(AO, _MAO);
@@ -67,11 +68,10 @@ var AO = /*#__PURE__*/function (_MAO) {
67
68
  key: "init",
68
69
  value: function () {
69
70
  var _init = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(jwk) {
70
- var _this$accounts;
71
71
  return _regeneratorRuntime().wrap(function _callee$(_context) {
72
72
  while (1) switch (_context.prev = _context.next) {
73
73
  case 0:
74
- if (!jwk && (_this$accounts = this.accounts) !== null && _this$accounts !== void 0 && _this$accounts[0]) jwk = this.accounts[0].jwk;
74
+ if (!jwk && this.acc[0]) jwk = this.acc[0].jwk;
75
75
  _context.next = 3;
76
76
  return this.ar.init(jwk);
77
77
  case 3: