wao 0.5.6 → 0.6.1

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/ao.js CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var WarpArBundles = _interopRequireWildcard(require("warp-arbundles"));
8
- var _ar2 = _interopRequireDefault(require("./ar.js"));
8
+ var _ar3 = _interopRequireDefault(require("./ar.js"));
9
9
  var _aoconnect = require("@permaweb/aoconnect");
10
10
  var _ramda = require("ramda");
11
11
  var _utils = require("./utils.js");
@@ -81,20 +81,32 @@ function createDataItemSigner2(wallet) {
81
81
  }
82
82
  var AO = /*#__PURE__*/function () {
83
83
  function AO() {
84
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
85
- _ref4$authority = _ref4.authority,
86
- authority = _ref4$authority === void 0 ? _utils.srcs.authority : _ref4$authority,
87
- module = _ref4.module,
88
- _ref4$module_type = _ref4.module_type,
89
- module_type = _ref4$module_type === void 0 ? "aos2" : _ref4$module_type,
90
- _ref4$scheduler = _ref4.scheduler,
91
- scheduler = _ref4$scheduler === void 0 ? _utils.srcs.scheduler : _ref4$scheduler,
92
- aoconnect = _ref4.aoconnect,
93
- _ref4$ar = _ref4.ar,
94
- ar = _ref4$ar === void 0 ? {} : _ref4$ar,
95
- _ref4$in_memory = _ref4.in_memory,
96
- in_memory = _ref4$in_memory === void 0 ? false : _ref4$in_memory;
84
+ var _ar2;
85
+ var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
97
86
  _classCallCheck(this, AO);
87
+ var _port = null;
88
+ if (typeof opt === "number") {
89
+ _port = opt;
90
+ opt = {};
91
+ }
92
+ var _opt = opt,
93
+ _opt$authority = _opt.authority,
94
+ authority = _opt$authority === void 0 ? _utils.srcs.authority : _opt$authority,
95
+ module = _opt.module,
96
+ _opt$module_type = _opt.module_type,
97
+ module_type = _opt$module_type === void 0 ? "aos2" : _opt$module_type,
98
+ _opt$scheduler = _opt.scheduler,
99
+ scheduler = _opt$scheduler === void 0 ? _utils.srcs.scheduler : _opt$scheduler,
100
+ aoconnect = _opt.aoconnect,
101
+ ar = _opt.ar,
102
+ _opt$in_memory = _opt.in_memory,
103
+ in_memory = _opt$in_memory === void 0 ? false : _opt$in_memory,
104
+ port = _opt.port;
105
+ if (!_port && port) _port = port;
106
+ if (!aoconnect && _port) aoconnect = (0, _utils.optAO)(_port);
107
+ if (!ar && _port) ar = {
108
+ port: _port
109
+ };
98
110
  if (!module) {
99
111
  switch (module_type) {
100
112
  case "sqlite":
@@ -108,11 +120,11 @@ var AO = /*#__PURE__*/function () {
108
120
  }
109
121
  }
110
122
  this.__type__ = "ao";
111
- if ((ar === null || ar === void 0 ? void 0 : ar.__type__) === "ar") this.ar = ar;else {
123
+ if (((_ar2 = ar) === null || _ar2 === void 0 ? void 0 : _ar2.__type__) === "ar") this.ar = ar;else {
112
124
  var _ar = _typeof(ar) === "object" ? ar : {};
113
- this.ar = new _ar2["default"](ar);
125
+ this.ar = new _ar3["default"](_ar);
114
126
  }
115
- if (in_memory) {} else if (aoconnect) {
127
+ if (!in_memory && aoconnect) {
116
128
  var _connect = (0, _aoconnect.connect)(aoconnect),
117
129
  _results = _connect.results,
118
130
  _assign = _connect.assign,
@@ -180,30 +192,30 @@ var AO = /*#__PURE__*/function () {
180
192
  }, {
181
193
  key: "pipe",
182
194
  value: function () {
183
- var _pipe = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref5) {
195
+ var _pipe = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
184
196
  var _fns$0$args, _ret2;
185
- var jwk, _ref5$fns, fns, cb, _, out, res, i, nextArgs, ret, err, pid, mid, id, copy, binds, _iterator, _step, _binds$v$fn, _v$bind, _v$name, _v$fn, _fns$args, _fns, v, bind, name, fn, _fn, _res, _err, _ret, k;
197
+ var jwk, _ref4$fns, fns, cb, _, out, res, i, nextArgs, ret, err, pid, mid, id, copy, binds, _iterator, _step, _binds$v$fn, _v$bind, _v$name, _v$fn, _fns$args, _fns, v, bind, name, fn, _fn, _res, _err, _ret, k;
186
198
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
187
199
  while (1) switch (_context4.prev = _context4.next) {
188
200
  case 0:
189
- jwk = _ref5.jwk, _ref5$fns = _ref5.fns, fns = _ref5$fns === void 0 ? [] : _ref5$fns, cb = _ref5.cb;
201
+ jwk = _ref4.jwk, _ref4$fns = _ref4.fns, fns = _ref4$fns === void 0 ? [] : _ref4$fns, cb = _ref4.cb;
190
202
  _ = {}, out = {}, res = [], i = 0;
191
203
  nextArgs = (_fns$0$args = fns[0].args) !== null && _fns$0$args !== void 0 ? _fns$0$args : {};
192
204
  ret = null, err = null, pid = null, mid = null, id = null;
193
205
  if (!jwk) fns.unshift({
194
206
  fn: "checkWallet"
195
207
  });
196
- copy = function copy(_ref6) {
208
+ copy = function copy(_ref5) {
197
209
  var _args$_from$slice$joi, _out$_from$slice$join, _inp$_from$slice$join, _inp$from;
198
- var _ = _ref6._,
199
- inp = _ref6.inp,
200
- out = _ref6.out,
201
- args = _ref6.args,
202
- from = _ref6.from,
203
- to = _ref6.to,
204
- pid = _ref6.pid,
205
- mid = _ref6.mid,
206
- id = _ref6.id;
210
+ var _ = _ref5._,
211
+ inp = _ref5.inp,
212
+ out = _ref5.out,
213
+ args = _ref5.args,
214
+ from = _ref5.from,
215
+ to = _ref5.to,
216
+ pid = _ref5.pid,
217
+ mid = _ref5.mid,
218
+ id = _ref5.id;
207
219
  var _from = from.split(".");
208
220
  var _to = to.split(".");
209
221
  var field = null,
@@ -392,13 +404,13 @@ var AO = /*#__PURE__*/function () {
392
404
  }, {
393
405
  key: "postModule",
394
406
  value: function () {
395
- var _postModule = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref7) {
407
+ var _postModule = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref6) {
396
408
  var _this = this;
397
- var data, jwk, _ref7$tags, tags, _ref7$overwrite, overwrite, _tags, fns;
409
+ var data, jwk, _ref6$tags, tags, _ref6$overwrite, overwrite, _tags, fns;
398
410
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
399
411
  while (1) switch (_context5.prev = _context5.next) {
400
412
  case 0:
401
- data = _ref7.data, jwk = _ref7.jwk, _ref7$tags = _ref7.tags, tags = _ref7$tags === void 0 ? {} : _ref7$tags, _ref7$overwrite = _ref7.overwrite, overwrite = _ref7$overwrite === void 0 ? false : _ref7$overwrite;
413
+ data = _ref6.data, jwk = _ref6.jwk, _ref6$tags = _ref6.tags, tags = _ref6$tags === void 0 ? {} : _ref6$tags, _ref6$overwrite = _ref6.overwrite, overwrite = _ref6$overwrite === void 0 ? false : _ref6$overwrite;
402
414
  _tags = (0, _ramda.mergeLeft)(tags, {
403
415
  "Data-Protocol": "ao",
404
416
  Variant: "ao.TN.1",
@@ -407,7 +419,8 @@ var AO = /*#__PURE__*/function () {
407
419
  "Input-Encoding": "JSON-V1",
408
420
  "Output-Encoding": "JSON-V1",
409
421
  "Memory-Limit": "1-gb",
410
- "Compute-Limit": "9000000000000"
422
+ "Compute-Limit": "9000000000000",
423
+ Extension: "WeaveDrive"
411
424
  });
412
425
  fns = [{
413
426
  fn: "post",
@@ -415,8 +428,8 @@ var AO = /*#__PURE__*/function () {
415
428
  data: data,
416
429
  tags: _tags
417
430
  },
418
- then: function then(_ref8) {
419
- var id = _ref8.id;
431
+ then: function then(_ref7) {
432
+ var id = _ref7.id;
420
433
  if (!_this.module || overwrite) _this.module = id;
421
434
  }
422
435
  }];
@@ -441,13 +454,13 @@ var AO = /*#__PURE__*/function () {
441
454
  }, {
442
455
  key: "postScheduler",
443
456
  value: function () {
444
- var _postScheduler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref9) {
457
+ var _postScheduler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref8) {
445
458
  var _this2 = this;
446
- var jwk, url, _ref9$tags, tags, _ref9$overwrite, overwrite, _tags, then, fns;
459
+ var jwk, url, _ref8$tags, tags, _ref8$overwrite, overwrite, _tags, then, fns;
447
460
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
448
461
  while (1) switch (_context7.prev = _context7.next) {
449
462
  case 0:
450
- jwk = _ref9.jwk, url = _ref9.url, _ref9$tags = _ref9.tags, tags = _ref9$tags === void 0 ? {} : _ref9$tags, _ref9$overwrite = _ref9.overwrite, overwrite = _ref9$overwrite === void 0 ? false : _ref9$overwrite;
463
+ jwk = _ref8.jwk, url = _ref8.url, _ref8$tags = _ref8.tags, tags = _ref8$tags === void 0 ? {} : _ref8$tags, _ref8$overwrite = _ref8.overwrite, overwrite = _ref8$overwrite === void 0 ? false : _ref8$overwrite;
451
464
  _tags = (0, _ramda.mergeLeft)(tags, {
452
465
  "Data-Protocol": "ao",
453
466
  Variant: "ao.TN.1",
@@ -456,12 +469,12 @@ var AO = /*#__PURE__*/function () {
456
469
  "Time-To-Live": "3600000"
457
470
  });
458
471
  then = /*#__PURE__*/function () {
459
- var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref10) {
472
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref9) {
460
473
  var jwk, out, _;
461
474
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
462
475
  while (1) switch (_context6.prev = _context6.next) {
463
476
  case 0:
464
- jwk = _ref10.jwk, out = _ref10.out, _ = _ref10._;
477
+ jwk = _ref9.jwk, out = _ref9.out, _ = _ref9._;
465
478
  _context6.next = 3;
466
479
  return _this2.ar.toAddr(jwk);
467
480
  case 3:
@@ -474,7 +487,7 @@ var AO = /*#__PURE__*/function () {
474
487
  }, _callee6);
475
488
  }));
476
489
  return function then(_x6) {
477
- return _ref11.apply(this, arguments);
490
+ return _ref10.apply(this, arguments);
478
491
  };
479
492
  }();
480
493
  fns = [{
@@ -506,14 +519,14 @@ var AO = /*#__PURE__*/function () {
506
519
  key: "spwn",
507
520
  value: function () {
508
521
  var _spwn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
509
- var _ref12,
522
+ var _ref11,
510
523
  boot,
511
- _ref12$module,
524
+ _ref11$module,
512
525
  module,
513
- _ref12$scheduler,
526
+ _ref11$scheduler,
514
527
  scheduler,
515
528
  jwk,
516
- _ref12$tags,
529
+ _ref11$tags,
517
530
  tags,
518
531
  data,
519
532
  auth,
@@ -525,7 +538,7 @@ var AO = /*#__PURE__*/function () {
525
538
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
526
539
  while (1) switch (_context8.prev = _context8.next) {
527
540
  case 0:
528
- _ref12 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, boot = _ref12.boot, _ref12$module = _ref12.module, module = _ref12$module === void 0 ? this.module : _ref12$module, _ref12$scheduler = _ref12.scheduler, scheduler = _ref12$scheduler === void 0 ? this.scheduler : _ref12$scheduler, jwk = _ref12.jwk, _ref12$tags = _ref12.tags, tags = _ref12$tags === void 0 ? {} : _ref12$tags, data = _ref12.data, auth = _ref12.auth;
541
+ _ref11 = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {}, boot = _ref11.boot, _ref11$module = _ref11.module, module = _ref11$module === void 0 ? this.module : _ref11$module, _ref11$scheduler = _ref11.scheduler, scheduler = _ref11$scheduler === void 0 ? this.scheduler : _ref11$scheduler, jwk = _ref11.jwk, _ref11$tags = _ref11.tags, tags = _ref11$tags === void 0 ? {} : _ref11$tags, data = _ref11.data, auth = _ref11.auth;
529
542
  err = null;
530
543
  _context8.next = 4;
531
544
  return this.ar.checkWallet({
@@ -585,13 +598,13 @@ var AO = /*#__PURE__*/function () {
585
598
  }, {
586
599
  key: "msg",
587
600
  value: function () {
588
- var _msg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref13) {
601
+ var _msg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref12) {
589
602
  var _this3 = this;
590
- var pid, jwk, data, _ref13$act, act, _ref13$tags, tags, _ref13$check, check, get, _ref13$timeout, timeout, err, _yield$this$ar$checkW2, res, out, mid, results, _tags, start, exRef, _getRef, cache, checks, isOK, _getResult, _yield$_getResult2;
603
+ var pid, jwk, data, _ref12$act, act, _ref12$tags, tags, _ref12$check, check, get, _ref12$timeout, timeout, err, _yield$this$ar$checkW2, res, out, mid, results, _tags, start, exRef, _getRef, cache, checks, isOK, _getResult, _yield$_getResult2;
591
604
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
592
605
  while (1) switch (_context11.prev = _context11.next) {
593
606
  case 0:
594
- pid = _ref13.pid, jwk = _ref13.jwk, data = _ref13.data, _ref13$act = _ref13.act, act = _ref13$act === void 0 ? "Eval" : _ref13$act, _ref13$tags = _ref13.tags, tags = _ref13$tags === void 0 ? {} : _ref13$tags, _ref13$check = _ref13.check, check = _ref13$check === void 0 ? [] : _ref13$check, get = _ref13.get, _ref13$timeout = _ref13.timeout, timeout = _ref13$timeout === void 0 ? 10000 : _ref13$timeout;
607
+ pid = _ref12.pid, jwk = _ref12.jwk, data = _ref12.data, _ref12$act = _ref12.act, act = _ref12$act === void 0 ? "Eval" : _ref12$act, _ref12$tags = _ref12.tags, tags = _ref12$tags === void 0 ? {} : _ref12$tags, _ref12$check = _ref12.check, check = _ref12$check === void 0 ? [] : _ref12$check, get = _ref12.get, _ref12$timeout = _ref12.timeout, timeout = _ref12$timeout === void 0 ? 10000 : _ref12$timeout;
595
608
  err = null;
596
609
  _context11.next = 4;
597
610
  return this.ar.checkWallet({
@@ -639,7 +652,7 @@ var AO = /*#__PURE__*/function () {
639
652
  return false;
640
653
  };
641
654
  _getRef = /*#__PURE__*/function () {
642
- var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(ref) {
655
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(ref) {
643
656
  var txs,
644
657
  ex,
645
658
  _args9 = arguments;
@@ -704,12 +717,12 @@ var AO = /*#__PURE__*/function () {
704
717
  }, _callee9);
705
718
  }));
706
719
  return function getRef(_x8) {
707
- return _ref14.apply(this, arguments);
720
+ return _ref13.apply(this, arguments);
708
721
  };
709
722
  }();
710
723
  cache = [], checks = [], isOK = false;
711
724
  _getResult = /*#__PURE__*/function () {
712
- var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(mid) {
725
+ var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(mid) {
713
726
  var res, err, i, _iterator3, _step3, _checks$i, v, _checks, checks2, k, refs, _iterator4, _step4, _v, _ltags, _iterator5, _step5, _v2, _ltags3, txs, _iterator6, _step6, v2, _ltags2, _yield$_getResult, _res, _out, _err, _ok;
714
727
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
715
728
  while (1) switch (_context10.prev = _context10.next) {
@@ -875,7 +888,7 @@ var AO = /*#__PURE__*/function () {
875
888
  }, _callee10, null, [[11, 57, 60, 63], [22, 45, 48, 51]]);
876
889
  }));
877
890
  return function getResult(_x9) {
878
- return _ref15.apply(this, arguments);
891
+ return _ref14.apply(this, arguments);
879
892
  };
880
893
  }();
881
894
  _context11.next = 22;
@@ -913,12 +926,12 @@ var AO = /*#__PURE__*/function () {
913
926
  }, {
914
927
  key: "asgn",
915
928
  value: function () {
916
- var _asgn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref16) {
929
+ var _asgn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(_ref15) {
917
930
  var pid, mid, jwk, check, get, err, _yield$this$ar$checkW3, res, out, checks, i, _iterator7, _step7, _checks$i2, v, _checks, checks2, k;
918
931
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
919
932
  while (1) switch (_context12.prev = _context12.next) {
920
933
  case 0:
921
- pid = _ref16.pid, mid = _ref16.mid, jwk = _ref16.jwk, check = _ref16.check, get = _ref16.get;
934
+ pid = _ref15.pid, mid = _ref15.mid, jwk = _ref15.jwk, check = _ref15.check, get = _ref15.get;
922
935
  err = null;
923
936
  _context12.next = 4;
924
937
  return this.ar.checkWallet({
@@ -1010,12 +1023,12 @@ var AO = /*#__PURE__*/function () {
1010
1023
  }, {
1011
1024
  key: "dry",
1012
1025
  value: function () {
1013
- var _dry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(_ref17) {
1014
- var pid, jwk, data, _ref17$act, act, _ref17$tags, tags, check, get, _ref17$timeout, timeout, err, _yield$this$ar$checkW4, res, out, _tags, _res, checks, i, _iterator8, _step8, _checks$i3, v, _checks, checks2, k;
1026
+ var _dry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(_ref16) {
1027
+ var pid, jwk, data, _ref16$act, act, _ref16$tags, tags, check, get, _ref16$timeout, timeout, err, _yield$this$ar$checkW4, res, out, _tags, _res, checks, i, _iterator8, _step8, _checks$i3, v, _checks, checks2, k;
1015
1028
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1016
1029
  while (1) switch (_context13.prev = _context13.next) {
1017
1030
  case 0:
1018
- pid = _ref17.pid, jwk = _ref17.jwk, data = _ref17.data, _ref17$act = _ref17.act, act = _ref17$act === void 0 ? "Eval" : _ref17$act, _ref17$tags = _ref17.tags, tags = _ref17$tags === void 0 ? {} : _ref17$tags, check = _ref17.check, get = _ref17.get, _ref17$timeout = _ref17.timeout, timeout = _ref17$timeout === void 0 ? 10000 : _ref17$timeout;
1031
+ pid = _ref16.pid, jwk = _ref16.jwk, data = _ref16.data, _ref16$act = _ref16.act, act = _ref16$act === void 0 ? "Eval" : _ref16$act, _ref16$tags = _ref16.tags, tags = _ref16$tags === void 0 ? {} : _ref16$tags, check = _ref16.check, get = _ref16.get, _ref16$timeout = _ref16.timeout, timeout = _ref16$timeout === void 0 ? 10000 : _ref16$timeout;
1019
1032
  err = null;
1020
1033
  _context13.next = 4;
1021
1034
  return this.ar.checkWallet({
@@ -1099,21 +1112,21 @@ var AO = /*#__PURE__*/function () {
1099
1112
  }, {
1100
1113
  key: "eval",
1101
1114
  value: function () {
1102
- var _eval2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_ref18) {
1115
+ var _eval2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_ref17) {
1103
1116
  var pid, jwk, data, fns;
1104
1117
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1105
1118
  while (1) switch (_context14.prev = _context14.next) {
1106
1119
  case 0:
1107
- pid = _ref18.pid, jwk = _ref18.jwk, data = _ref18.data;
1120
+ pid = _ref17.pid, jwk = _ref17.jwk, data = _ref17.data;
1108
1121
  fns = [{
1109
1122
  args: {
1110
1123
  pid: pid,
1111
1124
  data: data,
1112
1125
  act: "Eval"
1113
1126
  },
1114
- err: function err(_ref19) {
1127
+ err: function err(_ref18) {
1115
1128
  var _res$Output, _res$Output2, _res$Output3;
1116
- var res = _ref19.res;
1129
+ var res = _ref18.res;
1117
1130
  return _typeof(res === null || res === void 0 || (_res$Output = res.Output) === null || _res$Output === void 0 ? void 0 : _res$Output.data) !== "object" && !(typeof (res === null || res === void 0 || (_res$Output2 = res.Output) === null || _res$Output2 === void 0 ? void 0 : _res$Output2.prompt) === "string" && /aos\-/.test(res === null || res === void 0 || (_res$Output3 = res.Output) === null || _res$Output3 === void 0 ? void 0 : _res$Output3.prompt));
1118
1131
  }
1119
1132
  }];
@@ -1138,12 +1151,12 @@ var AO = /*#__PURE__*/function () {
1138
1151
  }, {
1139
1152
  key: "transform",
1140
1153
  value: function () {
1141
- var _transform = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_ref20) {
1154
+ var _transform = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_ref19) {
1142
1155
  var src, data, fills, err, out, _data, k, text;
1143
1156
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1144
1157
  while (1) switch (_context15.prev = _context15.next) {
1145
1158
  case 0:
1146
- src = _ref20.src, data = _ref20.data, fills = _ref20.fills;
1159
+ src = _ref19.src, data = _ref19.data, fills = _ref19.fills;
1147
1160
  err = null, out = null;
1148
1161
  if (!(data !== null && data !== void 0)) {
1149
1162
  _context15.next = 6;
@@ -1185,12 +1198,12 @@ var AO = /*#__PURE__*/function () {
1185
1198
  }, {
1186
1199
  key: "load",
1187
1200
  value: function () {
1188
- var _load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref21) {
1201
+ var _load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref20) {
1189
1202
  var src, data, fills, pid, jwk, fns;
1190
1203
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1191
1204
  while (1) switch (_context16.prev = _context16.next) {
1192
1205
  case 0:
1193
- src = _ref21.src, data = _ref21.data, fills = _ref21.fills, pid = _ref21.pid, jwk = _ref21.jwk;
1206
+ src = _ref20.src, data = _ref20.data, fills = _ref20.fills, pid = _ref20.pid, jwk = _ref20.jwk;
1194
1207
  fns = [{
1195
1208
  fn: this.transform,
1196
1209
  args: {
@@ -1228,17 +1241,17 @@ var AO = /*#__PURE__*/function () {
1228
1241
  }, {
1229
1242
  key: "wait",
1230
1243
  value: function () {
1231
- var _wait2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref22) {
1232
- var pid, _ref22$attempts, attempts, exist, err, _yield$this$dry, res, _err;
1244
+ var _wait2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref21) {
1245
+ var pid, _ref21$attempts, attempts, exist, err, _yield$this$dry, res, _err;
1233
1246
  return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1234
1247
  while (1) switch (_context17.prev = _context17.next) {
1235
1248
  case 0:
1236
- pid = _ref22.pid, _ref22$attempts = _ref22.attempts, attempts = _ref22$attempts === void 0 ? 5 : _ref22$attempts;
1249
+ pid = _ref21.pid, _ref21$attempts = _ref21.attempts, attempts = _ref21$attempts === void 0 ? 5 : _ref21$attempts;
1237
1250
  exist = false;
1238
1251
  err = null;
1239
1252
  case 3:
1240
1253
  if (!(attempts > 0)) {
1241
- _context17.next = 18;
1254
+ _context17.next = 20;
1242
1255
  break;
1243
1256
  }
1244
1257
  if (this.in_memory) {
@@ -1257,22 +1270,31 @@ var AO = /*#__PURE__*/function () {
1257
1270
  _yield$this$dry = _context17.sent;
1258
1271
  res = _yield$this$dry.res;
1259
1272
  _err = _yield$this$dry.err;
1260
- if (!(_typeof(res === null || res === void 0 ? void 0 : res.Output) === "object")) {
1273
+ if (!(res !== null && res !== void 0 && res.error)) {
1261
1274
  _context17.next = 14;
1262
1275
  break;
1263
1276
  }
1264
- return _context17.abrupt("break", 18);
1277
+ return _context17.abrupt("return", {
1278
+ err: res.error,
1279
+ pid: pid
1280
+ });
1265
1281
  case 14:
1282
+ if (!(_typeof(res === null || res === void 0 ? void 0 : res.Output) === "object")) {
1283
+ _context17.next = 16;
1284
+ break;
1285
+ }
1286
+ return _context17.abrupt("break", 20);
1287
+ case 16:
1266
1288
  attempts -= 1;
1267
1289
  if (attempts === 0) err = "timeout";
1268
1290
  _context17.next = 3;
1269
1291
  break;
1270
- case 18:
1292
+ case 20:
1271
1293
  return _context17.abrupt("return", {
1272
1294
  err: err,
1273
1295
  pid: pid
1274
1296
  });
1275
- case 19:
1297
+ case 21:
1276
1298
  case "end":
1277
1299
  return _context17.stop();
1278
1300
  }
@@ -1284,14 +1306,77 @@ var AO = /*#__PURE__*/function () {
1284
1306
  return wait;
1285
1307
  }()
1286
1308
  }, {
1287
- key: "deploy",
1309
+ key: "attest",
1288
1310
  value: function () {
1289
- var _deploy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(_ref23) {
1290
- var boot, loads, src, src_data, _ref23$fills, fills, _ref23$module, module, _ref23$scheduler, scheduler, jwk, _ref23$tags, tags, data, fns, isBoot, i, _iterator9, _step9, v, result;
1311
+ var _attest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(_ref22) {
1312
+ var id, jwk, tags;
1291
1313
  return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1292
1314
  while (1) switch (_context18.prev = _context18.next) {
1293
1315
  case 0:
1294
- boot = _ref23.boot, loads = _ref23.loads, src = _ref23.src, src_data = _ref23.src_data, _ref23$fills = _ref23.fills, fills = _ref23$fills === void 0 ? {} : _ref23$fills, _ref23$module = _ref23.module, module = _ref23$module === void 0 ? this.module : _ref23$module, _ref23$scheduler = _ref23.scheduler, scheduler = _ref23$scheduler === void 0 ? this.scheduler : _ref23$scheduler, jwk = _ref23.jwk, _ref23$tags = _ref23.tags, tags = _ref23$tags === void 0 ? {} : _ref23$tags, data = _ref23.data;
1316
+ id = _ref22.id, jwk = _ref22.jwk, tags = _ref22.tags;
1317
+ _context18.next = 3;
1318
+ return this.ar.post({
1319
+ tags: (0, _ramda.mergeLeft)(tags, {
1320
+ "Data-Protocol": "ao",
1321
+ Type: "Attestation",
1322
+ Message: id
1323
+ }),
1324
+ jwk: jwk
1325
+ });
1326
+ case 3:
1327
+ return _context18.abrupt("return", _context18.sent);
1328
+ case 4:
1329
+ case "end":
1330
+ return _context18.stop();
1331
+ }
1332
+ }, _callee18, this);
1333
+ }));
1334
+ function attest(_x16) {
1335
+ return _attest.apply(this, arguments);
1336
+ }
1337
+ return attest;
1338
+ }()
1339
+ }, {
1340
+ key: "avail",
1341
+ value: function () {
1342
+ var _avail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref23) {
1343
+ var ids, jwk, tags;
1344
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1345
+ while (1) switch (_context19.prev = _context19.next) {
1346
+ case 0:
1347
+ ids = _ref23.ids, jwk = _ref23.jwk, tags = _ref23.tags;
1348
+ _context19.next = 3;
1349
+ return this.ar.post({
1350
+ tags: (0, _ramda.mergeLeft)(tags, {
1351
+ "Data-Protocol": "WeaveDrive",
1352
+ Variant: "WeaveDrive.tn.1",
1353
+ Type: "Available",
1354
+ ID: ids
1355
+ }),
1356
+ jwk: jwk
1357
+ });
1358
+ case 3:
1359
+ return _context19.abrupt("return", _context19.sent);
1360
+ case 4:
1361
+ case "end":
1362
+ return _context19.stop();
1363
+ }
1364
+ }, _callee19, this);
1365
+ }));
1366
+ function avail(_x17) {
1367
+ return _avail.apply(this, arguments);
1368
+ }
1369
+ return avail;
1370
+ }()
1371
+ }, {
1372
+ key: "deploy",
1373
+ value: function () {
1374
+ var _deploy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(_ref24) {
1375
+ var boot, loads, src, src_data, _ref24$fills, fills, _ref24$module, module, _ref24$scheduler, scheduler, jwk, _ref24$tags, tags, data, fns, isBoot, i, _iterator9, _step9, v, args, result;
1376
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1377
+ while (1) switch (_context20.prev = _context20.next) {
1378
+ case 0:
1379
+ boot = _ref24.boot, loads = _ref24.loads, src = _ref24.src, src_data = _ref24.src_data, _ref24$fills = _ref24.fills, fills = _ref24$fills === void 0 ? {} : _ref24$fills, _ref24$module = _ref24.module, module = _ref24$module === void 0 ? this.module : _ref24$module, _ref24$scheduler = _ref24.scheduler, scheduler = _ref24$scheduler === void 0 ? this.scheduler : _ref24$scheduler, jwk = _ref24.jwk, _ref24$tags = _ref24.tags, tags = _ref24$tags === void 0 ? {} : _ref24$tags, data = _ref24.data;
1295
1380
  fns = [], isBoot = false;
1296
1381
  if (boot === true && !data) {
1297
1382
  isBoot = true;
@@ -1348,9 +1433,13 @@ var AO = /*#__PURE__*/function () {
1348
1433
  for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
1349
1434
  v = _step9.value;
1350
1435
  if (!isBoot || i !== 0) {
1436
+ args = v;
1437
+ if (typeof args === "string") args = {
1438
+ data: v
1439
+ };
1351
1440
  fns.push({
1352
1441
  fn: this.load,
1353
- args: v,
1442
+ args: args,
1354
1443
  then: {
1355
1444
  "args.pid": "pid"
1356
1445
  }
@@ -1363,22 +1452,22 @@ var AO = /*#__PURE__*/function () {
1363
1452
  } finally {
1364
1453
  _iterator9.f();
1365
1454
  }
1366
- _context18.next = 9;
1455
+ _context20.next = 9;
1367
1456
  return this.pipe({
1368
1457
  jwk: jwk,
1369
1458
  fns: fns
1370
1459
  });
1371
1460
  case 9:
1372
- result = _context18.sent;
1461
+ result = _context20.sent;
1373
1462
  if (result.pid) result.p = this.p(result.pid);
1374
- return _context18.abrupt("return", result);
1463
+ return _context20.abrupt("return", result);
1375
1464
  case 12:
1376
1465
  case "end":
1377
- return _context18.stop();
1466
+ return _context20.stop();
1378
1467
  }
1379
- }, _callee18, this);
1468
+ }, _callee20, this);
1380
1469
  }));
1381
- function deploy(_x16) {
1470
+ function deploy(_x18) {
1382
1471
  return _deploy.apply(this, arguments);
1383
1472
  }
1384
1473
  return deploy;
@@ -1414,29 +1503,56 @@ var Process = /*#__PURE__*/function () {
1414
1503
  this.pid = pid;
1415
1504
  }
1416
1505
  return _createClass(Process, [{
1506
+ key: "load",
1507
+ value: function () {
1508
+ var _load2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1509
+ var opt,
1510
+ _args21 = arguments;
1511
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1512
+ while (1) switch (_context21.prev = _context21.next) {
1513
+ case 0:
1514
+ opt = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
1515
+ _context21.next = 3;
1516
+ return this.ao.load(_objectSpread({
1517
+ pid: this.pid
1518
+ }, opt));
1519
+ case 3:
1520
+ return _context21.abrupt("return", _context21.sent);
1521
+ case 4:
1522
+ case "end":
1523
+ return _context21.stop();
1524
+ }
1525
+ }, _callee21, this);
1526
+ }));
1527
+ function load() {
1528
+ return _load2.apply(this, arguments);
1529
+ }
1530
+ return load;
1531
+ }()
1532
+ }, {
1417
1533
  key: "msg",
1418
1534
  value: function () {
1419
- var _msg2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(act, tags, opts) {
1535
+ var _msg2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(act, tags, opts) {
1420
1536
  var _getParams, _tags, _opts;
1421
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1422
- while (1) switch (_context19.prev = _context19.next) {
1537
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1538
+ while (1) switch (_context22.prev = _context22.next) {
1423
1539
  case 0:
1424
1540
  _getParams = getParams(tags, opts), _tags = _getParams._tags, _opts = _getParams._opts;
1425
- _context19.next = 3;
1541
+ _context22.next = 3;
1426
1542
  return this.ao.msg(_objectSpread({
1427
1543
  pid: this.pid,
1428
1544
  act: act,
1429
1545
  tags: _tags
1430
1546
  }, _opts));
1431
1547
  case 3:
1432
- return _context19.abrupt("return", _context19.sent);
1548
+ return _context22.abrupt("return", _context22.sent);
1433
1549
  case 4:
1434
1550
  case "end":
1435
- return _context19.stop();
1551
+ return _context22.stop();
1436
1552
  }
1437
- }, _callee19, this);
1553
+ }, _callee22, this);
1438
1554
  }));
1439
- function msg(_x17, _x18, _x19) {
1555
+ function msg(_x19, _x20, _x21) {
1440
1556
  return _msg2.apply(this, arguments);
1441
1557
  }
1442
1558
  return msg;
@@ -1444,27 +1560,27 @@ var Process = /*#__PURE__*/function () {
1444
1560
  }, {
1445
1561
  key: "dry",
1446
1562
  value: function () {
1447
- var _dry2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(act, tags, opts) {
1563
+ var _dry2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(act, tags, opts) {
1448
1564
  var _getParams2, _tags, _opts;
1449
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1450
- while (1) switch (_context20.prev = _context20.next) {
1565
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1566
+ while (1) switch (_context23.prev = _context23.next) {
1451
1567
  case 0:
1452
1568
  _getParams2 = getParams(tags, opts), _tags = _getParams2._tags, _opts = _getParams2._opts;
1453
- _context20.next = 3;
1569
+ _context23.next = 3;
1454
1570
  return this.ao.dry(_objectSpread({
1455
1571
  pid: this.pid,
1456
1572
  act: act,
1457
1573
  tags: _tags
1458
1574
  }, _opts));
1459
1575
  case 3:
1460
- return _context20.abrupt("return", _context20.sent);
1576
+ return _context23.abrupt("return", _context23.sent);
1461
1577
  case 4:
1462
1578
  case "end":
1463
- return _context20.stop();
1579
+ return _context23.stop();
1464
1580
  }
1465
- }, _callee20, this);
1581
+ }, _callee23, this);
1466
1582
  }));
1467
- function dry(_x20, _x21, _x22) {
1583
+ function dry(_x22, _x23, _x24) {
1468
1584
  return _dry2.apply(this, arguments);
1469
1585
  }
1470
1586
  return dry;
@@ -1472,28 +1588,28 @@ var Process = /*#__PURE__*/function () {
1472
1588
  }, {
1473
1589
  key: "m",
1474
1590
  value: function () {
1475
- var _m = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1591
+ var _m = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1476
1592
  var res,
1477
- _args21 = arguments;
1478
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1479
- while (1) switch (_context21.prev = _context21.next) {
1593
+ _args24 = arguments;
1594
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1595
+ while (1) switch (_context24.prev = _context24.next) {
1480
1596
  case 0:
1481
- _context21.next = 2;
1482
- return this.msg.apply(this, _args21);
1597
+ _context24.next = 2;
1598
+ return this.msg.apply(this, _args24);
1483
1599
  case 2:
1484
- res = _context21.sent;
1600
+ res = _context24.sent;
1485
1601
  if (!res.err) {
1486
- _context21.next = 5;
1602
+ _context24.next = 5;
1487
1603
  break;
1488
1604
  }
1489
1605
  throw Error(res.err);
1490
1606
  case 5:
1491
- return _context21.abrupt("return", res.out);
1607
+ return _context24.abrupt("return", res.out);
1492
1608
  case 6:
1493
1609
  case "end":
1494
- return _context21.stop();
1610
+ return _context24.stop();
1495
1611
  }
1496
- }, _callee21, this);
1612
+ }, _callee24, this);
1497
1613
  }));
1498
1614
  function m() {
1499
1615
  return _m.apply(this, arguments);
@@ -1503,28 +1619,28 @@ var Process = /*#__PURE__*/function () {
1503
1619
  }, {
1504
1620
  key: "d",
1505
1621
  value: function () {
1506
- var _d = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1622
+ var _d = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1507
1623
  var res,
1508
- _args22 = arguments;
1509
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1510
- while (1) switch (_context22.prev = _context22.next) {
1624
+ _args25 = arguments;
1625
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1626
+ while (1) switch (_context25.prev = _context25.next) {
1511
1627
  case 0:
1512
- _context22.next = 2;
1513
- return this.dry.apply(this, _args22);
1628
+ _context25.next = 2;
1629
+ return this.dry.apply(this, _args25);
1514
1630
  case 2:
1515
- res = _context22.sent;
1631
+ res = _context25.sent;
1516
1632
  if (!res.err) {
1517
- _context22.next = 5;
1633
+ _context25.next = 5;
1518
1634
  break;
1519
1635
  }
1520
1636
  throw Error(res.err);
1521
1637
  case 5:
1522
- return _context22.abrupt("return", res.out);
1638
+ return _context25.abrupt("return", res.out);
1523
1639
  case 6:
1524
1640
  case "end":
1525
- return _context22.stop();
1641
+ return _context25.stop();
1526
1642
  }
1527
- }, _callee22, this);
1643
+ }, _callee25, this);
1528
1644
  }));
1529
1645
  function d() {
1530
1646
  return _d.apply(this, arguments);