wao 0.10.4 → 0.10.6

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
@@ -613,11 +613,11 @@ var AO = /*#__PURE__*/function () {
613
613
  value: function () {
614
614
  var _msg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(_ref12) {
615
615
  var _this3 = this;
616
- var pid, jwk, data, _ref12$act, act, _ref12$tags, tags, _ref12$check, check, get, _ref12$timeout, timeout, err, _yield$this$ar$checkW2, getNewTxs, checkOut, res, out, mid, results, _tags, start, _txs, _txmap, t, checked, _iterator4, _step4, v, _res;
616
+ var pid, jwk, data, _ref12$act, act, _ref12$tags, tags, _ref12$check, check, get, _ref12$timeout, timeout, _ref12$mode, mode, err, _yield$this$ar$checkW2, anchors, getNewTxs, checkOut, res, out, mid, results, _tags, start, _txs, _txmap, t, checked, _iterator6, _step6, v, _res;
617
617
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
618
618
  while (1) switch (_context11.prev = _context11.next) {
619
619
  case 0:
620
- 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 ? 0 : _ref12$timeout;
620
+ 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 ? 0 : _ref12$timeout, _ref12$mode = _ref12.mode, mode = _ref12$mode === void 0 ? "aoconnect" : _ref12$mode;
621
621
  err = null;
622
622
  _context11.next = 4;
623
623
  return this.ar.checkWallet({
@@ -635,20 +635,25 @@ var AO = /*#__PURE__*/function () {
635
635
  err: err
636
636
  });
637
637
  case 9:
638
+ anchors = {};
638
639
  getNewTxs = /*#__PURE__*/function () {
639
640
  var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(pid, _txs, _txmap) {
640
- var txs, _iterator2, _step2, v, t, _t$fromProcess, _v$owner;
641
+ var txs, _iterator2, _step2, v, t, _t$fromProcess, _v$owner, _iterator3, _step3, _v, _iterator4, _step4, v2;
641
642
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
642
643
  while (1) switch (_context9.prev = _context9.next) {
643
644
  case 0:
644
- _context9.next = 2;
645
+ if (!(mode === "gql")) {
646
+ _context9.next = 8;
647
+ break;
648
+ }
649
+ _context9.next = 3;
645
650
  return _this3.ar.gql.txs({
646
651
  recipient: pid,
647
652
  fields: ["id", "recipient", "tags", {
648
653
  owner: ["address"]
649
654
  }]
650
655
  });
651
- case 2:
656
+ case 3:
652
657
  txs = _context9.sent;
653
658
  _iterator2 = _createForOfIteratorHelper(txs);
654
659
  try {
@@ -671,7 +676,50 @@ var AO = /*#__PURE__*/function () {
671
676
  } finally {
672
677
  _iterator2.f();
673
678
  }
674
- case 5:
679
+ _context9.next = 16;
680
+ break;
681
+ case 8:
682
+ _context9.t0 = _createForOfIteratorHelper;
683
+ _context9.t1 = _ramda.reverse;
684
+ _context9.next = 12;
685
+ return _this3.res({
686
+ pid: pid
687
+ });
688
+ case 12:
689
+ _context9.t2 = _context9.sent;
690
+ _context9.t3 = (0, _context9.t1)(_context9.t2);
691
+ _iterator3 = (0, _context9.t0)(_context9.t3);
692
+ try {
693
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
694
+ _v = _step3.value;
695
+ if ((0, _ramda.isNil)(_txmap[_v.cursor])) {
696
+ _txmap[_v.cursor] = {
697
+ checked: false,
698
+ res: _v
699
+ };
700
+ _txs.unshift({
701
+ id: _v.cursor
702
+ });
703
+ console.log("new shit is here", _v.cursor, _v);
704
+ _iterator4 = _createForOfIteratorHelper(_v.Messages || []);
705
+ try {
706
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
707
+ v2 = _step4.value;
708
+ console.log(v2);
709
+ }
710
+ } catch (err) {
711
+ _iterator4.e(err);
712
+ } finally {
713
+ _iterator4.f();
714
+ }
715
+ }
716
+ }
717
+ } catch (err) {
718
+ _iterator3.e(err);
719
+ } finally {
720
+ _iterator3.f();
721
+ }
722
+ case 16:
675
723
  case "end":
676
724
  return _context9.stop();
677
725
  }
@@ -683,27 +731,27 @@ var AO = /*#__PURE__*/function () {
683
731
  }();
684
732
  checkOut = /*#__PURE__*/function () {
685
733
  var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(get, _txs, _txmap, out) {
686
- var _iterator3, _step3, v, _res2, _out;
734
+ var _iterator5, _step5, v, _res2, _out;
687
735
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
688
736
  while (1) switch (_context10.prev = _context10.next) {
689
737
  case 0:
690
- _iterator3 = _createForOfIteratorHelper(_txs);
738
+ _iterator5 = _createForOfIteratorHelper(_txs);
691
739
  _context10.prev = 1;
692
- _iterator3.s();
740
+ _iterator5.s();
693
741
  case 3:
694
- if ((_step3 = _iterator3.n()).done) {
742
+ if ((_step5 = _iterator5.n()).done) {
695
743
  _context10.next = 18;
696
744
  break;
697
745
  }
698
- v = _step3.value;
746
+ v = _step5.value;
699
747
  if (!(0, _ramda.isNil)(_txmap[v.id].res)) {
700
748
  _context10.next = 10;
701
749
  break;
702
750
  }
703
751
  _context10.next = 8;
704
- return _this3.result({
705
- process: pid,
706
- message: v.id
752
+ return _this3.res({
753
+ pid: pid,
754
+ mid: v.id
707
755
  });
708
756
  case 8:
709
757
  _res2 = _context10.sent;
@@ -730,10 +778,10 @@ var AO = /*#__PURE__*/function () {
730
778
  case 20:
731
779
  _context10.prev = 20;
732
780
  _context10.t0 = _context10["catch"](1);
733
- _iterator3.e(_context10.t0);
781
+ _iterator5.e(_context10.t0);
734
782
  case 23:
735
783
  _context10.prev = 23;
736
- _iterator3.f();
784
+ _iterator5.f();
737
785
  return _context10.finish(23);
738
786
  case 26:
739
787
  return _context10.abrupt("return", out);
@@ -750,21 +798,21 @@ var AO = /*#__PURE__*/function () {
750
798
  res = null, out = null, mid = null, results = [];
751
799
  _tags = (0, _utils.buildTags)(act, tags);
752
800
  start = Date.now();
753
- _context11.prev = 14;
754
- _context11.next = 17;
801
+ _context11.prev = 15;
802
+ _context11.next = 18;
755
803
  return this.message({
756
804
  process: pid,
757
805
  signer: this.toSigner(jwk),
758
806
  tags: _tags,
759
807
  data: (0, _utils.jsonToStr)(data)
760
808
  });
761
- case 17:
809
+ case 18:
762
810
  mid = _context11.sent;
763
811
  if (!(0, _ramda.is)(Array, check)) check = [check];
764
812
  _context11.t0 = mid;
765
- _context11.next = 22;
813
+ _context11.next = 23;
766
814
  return this.ar.toAddr(jwk);
767
- case 22:
815
+ case 23:
768
816
  _context11.t1 = _context11.sent;
769
817
  _context11.t2 = {
770
818
  id: _context11.t0,
@@ -778,27 +826,31 @@ var AO = /*#__PURE__*/function () {
778
826
  checked: false,
779
827
  ref: t["x-reference"]
780
828
  };
781
- case 29:
782
- _iterator4 = _createForOfIteratorHelper(_txs);
783
- _context11.prev = 30;
784
- _iterator4.s();
785
- case 32:
786
- if ((_step4 = _iterator4.n()).done) {
787
- _context11.next = 46;
829
+ case 30:
830
+ _iterator6 = _createForOfIteratorHelper(_txs);
831
+ _context11.prev = 31;
832
+ _iterator6.s();
833
+ case 33:
834
+ if ((_step6 = _iterator6.n()).done) {
835
+ _context11.next = 48;
788
836
  break;
789
837
  }
790
- v = _step4.value;
838
+ v = _step6.value;
791
839
  if (_txmap[v.id].checked) {
792
- _context11.next = 44;
840
+ _context11.next = 46;
793
841
  break;
794
842
  }
795
843
  _txmap[v.id].checked = true;
796
- _context11.next = 38;
797
- return this.result({
798
- process: pid,
799
- message: v.id
844
+ if (!(0, _ramda.isNil)(_txmap[v.id].res)) {
845
+ _context11.next = 43;
846
+ break;
847
+ }
848
+ _context11.next = 40;
849
+ return this.res({
850
+ pid: pid,
851
+ mid: v.id
800
852
  });
801
- case 38:
853
+ case 40:
802
854
  _res = _context11.sent;
803
855
  if ((0, _ramda.isNil)(res)) {
804
856
  res = _res;
@@ -809,99 +861,104 @@ var AO = /*#__PURE__*/function () {
809
861
  });
810
862
  }
811
863
  _txmap[v.id].res = _res;
812
- checked = (0, _utils.allChecked)(check, _res, v.from);
864
+ case 43:
865
+ if (!(0, _ramda.isNil)(check) && check.length > 0) {
866
+ checked = (0, _utils.allChecked)(check, _txmap[v.id].res, v.from);
867
+ } else {
868
+ checked = true;
869
+ }
813
870
  if (!checked) {
814
- _context11.next = 44;
871
+ _context11.next = 46;
815
872
  break;
816
873
  }
817
- return _context11.abrupt("break", 46);
818
- case 44:
819
- _context11.next = 32;
820
- break;
874
+ return _context11.abrupt("break", 48);
821
875
  case 46:
822
- _context11.next = 51;
876
+ _context11.next = 33;
823
877
  break;
824
878
  case 48:
825
- _context11.prev = 48;
826
- _context11.t3 = _context11["catch"](30);
827
- _iterator4.e(_context11.t3);
828
- case 51:
829
- _context11.prev = 51;
830
- _iterator4.f();
831
- return _context11.finish(51);
832
- case 54:
879
+ _context11.next = 53;
880
+ break;
881
+ case 50:
882
+ _context11.prev = 50;
883
+ _context11.t3 = _context11["catch"](31);
884
+ _iterator6.e(_context11.t3);
885
+ case 53:
886
+ _context11.prev = 53;
887
+ _iterator6.f();
888
+ return _context11.finish(53);
889
+ case 56:
833
890
  if (!checked) {
834
- _context11.next = 56;
891
+ _context11.next = 58;
835
892
  break;
836
893
  }
837
- return _context11.abrupt("break", 61);
838
- case 56:
839
- _context11.next = 58;
840
- return (0, _utils.wait)(1000);
894
+ return _context11.abrupt("break", 63);
841
895
  case 58:
842
896
  _context11.next = 60;
843
- return getNewTxs(pid, _txs, _txmap);
897
+ return (0, _utils.wait)(1000);
844
898
  case 60:
899
+ _context11.next = 62;
900
+ return getNewTxs(pid, _txs, _txmap);
901
+ case 62:
845
902
  if (Date.now() - start < timeout) {
846
- _context11.next = 29;
903
+ _context11.next = 30;
847
904
  break;
848
905
  }
849
- case 61:
906
+ case 63:
850
907
  if (checked) {
851
- _context11.next = 65;
908
+ _context11.next = 67;
852
909
  break;
853
910
  }
854
911
  err = "something went wrong!";
855
- _context11.next = 89;
912
+ _context11.next = 91;
856
913
  break;
857
- case 65:
914
+ case 67:
858
915
  _context11.t4 = _utils.mergeOut;
859
916
  _context11.t5 = out;
860
- _context11.next = 69;
917
+ _context11.next = 71;
861
918
  return checkOut(get, _txs, _txmap, out);
862
- case 69:
919
+ case 71:
863
920
  _context11.t6 = _context11.sent;
864
921
  _context11.t7 = get;
865
922
  out = (0, _context11.t4)(_context11.t5, _context11.t6, _context11.t7);
866
923
  if (!(!(0, _utils.isOutComplete)(out, get) && !(0, _ramda.isNil)(get))) {
867
- _context11.next = 89;
924
+ _context11.next = 91;
868
925
  break;
869
926
  }
870
- case 73:
927
+ case 75:
871
928
  if (!(Date.now() - start < timeout)) {
872
- _context11.next = 89;
929
+ _context11.next = 91;
873
930
  break;
874
931
  }
875
- _context11.next = 76;
932
+ _context11.next = 78;
876
933
  return getNewTxs(pid, _txs, _txmap);
877
- case 76:
934
+ case 78:
878
935
  _context11.t8 = _utils.mergeOut;
879
936
  _context11.t9 = out;
880
- _context11.next = 80;
937
+ _context11.next = 82;
881
938
  return checkOut(get, _txs, _txmap, out);
882
- case 80:
939
+ case 82:
883
940
  _context11.t10 = _context11.sent;
884
941
  _context11.t11 = get;
885
942
  out = (0, _context11.t8)(_context11.t9, _context11.t10, _context11.t11);
886
943
  if (!(0, _utils.isOutComplete)(out, get)) {
887
- _context11.next = 85;
944
+ _context11.next = 87;
888
945
  break;
889
946
  }
890
- return _context11.abrupt("break", 89);
891
- case 85:
892
- _context11.next = 87;
893
- return (0, _utils.wait)(1000);
947
+ return _context11.abrupt("break", 91);
894
948
  case 87:
895
- _context11.next = 73;
896
- break;
949
+ _context11.next = 89;
950
+ return (0, _utils.wait)(1000);
897
951
  case 89:
898
- _context11.next = 94;
952
+ _context11.next = 75;
899
953
  break;
900
954
  case 91:
901
- _context11.prev = 91;
902
- _context11.t12 = _context11["catch"](14);
955
+ _context11.next = 96;
956
+ break;
957
+ case 93:
958
+ _context11.prev = 93;
959
+ _context11.t12 = _context11["catch"](15);
903
960
  err = _context11.t12;
904
- case 94:
961
+ case 96:
905
962
  return _context11.abrupt("return", {
906
963
  mid: mid,
907
964
  res: res,
@@ -909,11 +966,11 @@ var AO = /*#__PURE__*/function () {
909
966
  out: out,
910
967
  results: results
911
968
  });
912
- case 95:
969
+ case 97:
913
970
  case "end":
914
971
  return _context11.stop();
915
972
  }
916
- }, _callee11, this, [[14, 91], [30, 48, 51, 54]]);
973
+ }, _callee11, this, [[15, 93], [31, 50, 53, 56]]);
917
974
  }));
918
975
  function msg(_x7) {
919
976
  return _msg.apply(this, arguments);
@@ -957,9 +1014,9 @@ var AO = /*#__PURE__*/function () {
957
1014
  case 13:
958
1015
  mid = _context12.sent;
959
1016
  _context12.next = 16;
960
- return this.result({
961
- process: pid,
962
- message: mid
1017
+ return this.res({
1018
+ pid: pid,
1019
+ mid: mid
963
1020
  });
964
1021
  case 16:
965
1022
  res = _context12.sent;
@@ -1060,40 +1117,94 @@ var AO = /*#__PURE__*/function () {
1060
1117
  return dry;
1061
1118
  }()
1062
1119
  }, {
1063
- key: "eval",
1120
+ key: "res",
1064
1121
  value: function () {
1065
- var _eval2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_ref17) {
1066
- var pid, jwk, data, fns;
1122
+ var _res3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(_ref17) {
1123
+ var pid, mid, limit, asc, from, to, sort, _res4;
1067
1124
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1068
1125
  while (1) switch (_context14.prev = _context14.next) {
1069
1126
  case 0:
1070
- pid = _ref17.pid, jwk = _ref17.jwk, data = _ref17.data;
1127
+ pid = _ref17.pid, mid = _ref17.mid, limit = _ref17.limit, asc = _ref17.asc, from = _ref17.from, to = _ref17.to;
1128
+ if (mid) {
1129
+ _context14.next = 11;
1130
+ break;
1131
+ }
1132
+ sort = asc ? "ASC" : "DESC";
1133
+ _context14.next = 5;
1134
+ return this.results({
1135
+ process: pid,
1136
+ limit: limit,
1137
+ sort: sort,
1138
+ from: from,
1139
+ to: to
1140
+ });
1141
+ case 5:
1142
+ _res4 = _context14.sent;
1143
+ if (_res4.edges) {
1144
+ _context14.next = 8;
1145
+ break;
1146
+ }
1147
+ return _context14.abrupt("return", null);
1148
+ case 8:
1149
+ return _context14.abrupt("return", (0, _ramda.map)(function (v) {
1150
+ return _objectSpread({
1151
+ cursor: v.cursor
1152
+ }, v.node);
1153
+ })(_res4.edges));
1154
+ case 11:
1155
+ _context14.next = 13;
1156
+ return this.result({
1157
+ process: pid,
1158
+ message: mid
1159
+ });
1160
+ case 13:
1161
+ return _context14.abrupt("return", _context14.sent);
1162
+ case 14:
1163
+ case "end":
1164
+ return _context14.stop();
1165
+ }
1166
+ }, _callee14, this);
1167
+ }));
1168
+ function res(_x17) {
1169
+ return _res3.apply(this, arguments);
1170
+ }
1171
+ return res;
1172
+ }()
1173
+ }, {
1174
+ key: "eval",
1175
+ value: function () {
1176
+ var _eval2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_ref18) {
1177
+ var pid, jwk, data, fns;
1178
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1179
+ while (1) switch (_context15.prev = _context15.next) {
1180
+ case 0:
1181
+ pid = _ref18.pid, jwk = _ref18.jwk, data = _ref18.data;
1071
1182
  fns = [{
1072
1183
  args: {
1073
1184
  pid: pid,
1074
1185
  data: data,
1075
1186
  act: "Eval"
1076
1187
  },
1077
- err: function err(_ref18) {
1188
+ err: function err(_ref19) {
1078
1189
  var _res$Output, _res$Output2, _res$Output3;
1079
- var res = _ref18.res;
1190
+ var res = _ref19.res;
1080
1191
  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));
1081
1192
  }
1082
1193
  }];
1083
- _context14.next = 4;
1194
+ _context15.next = 4;
1084
1195
  return this.pipe({
1085
1196
  jwk: jwk,
1086
1197
  fns: fns
1087
1198
  });
1088
1199
  case 4:
1089
- return _context14.abrupt("return", _context14.sent);
1200
+ return _context15.abrupt("return", _context15.sent);
1090
1201
  case 5:
1091
1202
  case "end":
1092
- return _context14.stop();
1203
+ return _context15.stop();
1093
1204
  }
1094
- }, _callee14, this);
1205
+ }, _callee15, this);
1095
1206
  }));
1096
- function _eval(_x17) {
1207
+ function _eval(_x18) {
1097
1208
  return _eval2.apply(this, arguments);
1098
1209
  }
1099
1210
  return _eval;
@@ -1101,27 +1212,27 @@ var AO = /*#__PURE__*/function () {
1101
1212
  }, {
1102
1213
  key: "transform",
1103
1214
  value: function () {
1104
- var _transform = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(_ref19) {
1215
+ var _transform = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref20) {
1105
1216
  var src, data, fills, err, out, _data, k, text;
1106
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1107
- while (1) switch (_context15.prev = _context15.next) {
1217
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1218
+ while (1) switch (_context16.prev = _context16.next) {
1108
1219
  case 0:
1109
- src = _ref19.src, data = _ref19.data, fills = _ref19.fills;
1220
+ src = _ref20.src, data = _ref20.data, fills = _ref20.fills;
1110
1221
  err = null, out = null;
1111
1222
  if (!(data !== null && data !== void 0)) {
1112
- _context15.next = 6;
1223
+ _context16.next = 6;
1113
1224
  break;
1114
1225
  }
1115
- _context15.t0 = data;
1116
- _context15.next = 9;
1226
+ _context16.t0 = data;
1227
+ _context16.next = 9;
1117
1228
  break;
1118
1229
  case 6:
1119
- _context15.next = 8;
1230
+ _context16.next = 8;
1120
1231
  return this.ar.data(src, true);
1121
1232
  case 8:
1122
- _context15.t0 = _context15.sent;
1233
+ _context16.t0 = _context16.sent;
1123
1234
  case 9:
1124
- _data = _context15.t0;
1235
+ _data = _context16.t0;
1125
1236
  if (!_data) err = "data doesn't exist";else {
1126
1237
  for (k in fills !== null && fills !== void 0 ? fills : {}) {
1127
1238
  text = fills[k];
@@ -1130,17 +1241,17 @@ var AO = /*#__PURE__*/function () {
1130
1241
  }
1131
1242
  out = _data;
1132
1243
  }
1133
- return _context15.abrupt("return", {
1244
+ return _context16.abrupt("return", {
1134
1245
  err: err,
1135
1246
  out: out
1136
1247
  });
1137
1248
  case 12:
1138
1249
  case "end":
1139
- return _context15.stop();
1250
+ return _context16.stop();
1140
1251
  }
1141
- }, _callee15, this);
1252
+ }, _callee16, this);
1142
1253
  }));
1143
- function transform(_x18) {
1254
+ function transform(_x19) {
1144
1255
  return _transform.apply(this, arguments);
1145
1256
  }
1146
1257
  return transform;
@@ -1148,12 +1259,12 @@ var AO = /*#__PURE__*/function () {
1148
1259
  }, {
1149
1260
  key: "load",
1150
1261
  value: function () {
1151
- var _load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref20) {
1262
+ var _load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref21) {
1152
1263
  var src, data, fills, pid, jwk, fns;
1153
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1154
- while (1) switch (_context16.prev = _context16.next) {
1264
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1265
+ while (1) switch (_context17.prev = _context17.next) {
1155
1266
  case 0:
1156
- src = _ref20.src, data = _ref20.data, fills = _ref20.fills, pid = _ref20.pid, jwk = _ref20.jwk;
1267
+ src = _ref21.src, data = _ref21.data, fills = _ref21.fills, pid = _ref21.pid, jwk = _ref21.jwk;
1157
1268
  fns = [{
1158
1269
  fn: this.transform,
1159
1270
  args: {
@@ -1170,20 +1281,20 @@ var AO = /*#__PURE__*/function () {
1170
1281
  pid: pid
1171
1282
  }
1172
1283
  }];
1173
- _context16.next = 4;
1284
+ _context17.next = 4;
1174
1285
  return this.pipe({
1175
1286
  jwk: jwk,
1176
1287
  fns: fns
1177
1288
  });
1178
1289
  case 4:
1179
- return _context16.abrupt("return", _context16.sent);
1290
+ return _context17.abrupt("return", _context17.sent);
1180
1291
  case 5:
1181
1292
  case "end":
1182
- return _context16.stop();
1293
+ return _context17.stop();
1183
1294
  }
1184
- }, _callee16, this);
1295
+ }, _callee17, this);
1185
1296
  }));
1186
- function load(_x19) {
1297
+ function load(_x20) {
1187
1298
  return _load.apply(this, arguments);
1188
1299
  }
1189
1300
  return load;
@@ -1191,66 +1302,66 @@ var AO = /*#__PURE__*/function () {
1191
1302
  }, {
1192
1303
  key: "wait",
1193
1304
  value: function () {
1194
- var _wait2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(_ref21) {
1195
- var pid, _ref21$attempts, attempts, exist, err, _yield$this$dry, res, _err;
1196
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1197
- while (1) switch (_context17.prev = _context17.next) {
1305
+ var _wait2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(_ref22) {
1306
+ var pid, _ref22$attempts, attempts, exist, err, _yield$this$dry, res, _err;
1307
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1308
+ while (1) switch (_context18.prev = _context18.next) {
1198
1309
  case 0:
1199
- pid = _ref21.pid, _ref21$attempts = _ref21.attempts, attempts = _ref21$attempts === void 0 ? 10 : _ref21$attempts;
1310
+ pid = _ref22.pid, _ref22$attempts = _ref22.attempts, attempts = _ref22$attempts === void 0 ? 10 : _ref22$attempts;
1200
1311
  exist = false;
1201
1312
  err = null;
1202
1313
  case 3:
1203
1314
  if (!(attempts > 0)) {
1204
- _context17.next = 20;
1315
+ _context18.next = 20;
1205
1316
  break;
1206
1317
  }
1207
1318
  if (this.in_memory) {
1208
- _context17.next = 7;
1319
+ _context18.next = 7;
1209
1320
  break;
1210
1321
  }
1211
- _context17.next = 7;
1322
+ _context18.next = 7;
1212
1323
  return (0, _utils.wait)(1000);
1213
1324
  case 7:
1214
- _context17.next = 9;
1325
+ _context18.next = 9;
1215
1326
  return this.dry({
1216
1327
  pid: pid,
1217
1328
  data: "#Inbox"
1218
1329
  });
1219
1330
  case 9:
1220
- _yield$this$dry = _context17.sent;
1331
+ _yield$this$dry = _context18.sent;
1221
1332
  res = _yield$this$dry.res;
1222
1333
  _err = _yield$this$dry.err;
1223
1334
  if (!(res !== null && res !== void 0 && res.error)) {
1224
- _context17.next = 14;
1335
+ _context18.next = 14;
1225
1336
  break;
1226
1337
  }
1227
- return _context17.abrupt("return", {
1338
+ return _context18.abrupt("return", {
1228
1339
  err: res.error,
1229
1340
  pid: pid
1230
1341
  });
1231
1342
  case 14:
1232
1343
  if (!(_typeof(res === null || res === void 0 ? void 0 : res.Output) === "object")) {
1233
- _context17.next = 16;
1344
+ _context18.next = 16;
1234
1345
  break;
1235
1346
  }
1236
- return _context17.abrupt("break", 20);
1347
+ return _context18.abrupt("break", 20);
1237
1348
  case 16:
1238
1349
  attempts -= 1;
1239
1350
  if (attempts === 0) err = "timeout";
1240
- _context17.next = 3;
1351
+ _context18.next = 3;
1241
1352
  break;
1242
1353
  case 20:
1243
- return _context17.abrupt("return", {
1354
+ return _context18.abrupt("return", {
1244
1355
  err: err,
1245
1356
  pid: pid
1246
1357
  });
1247
1358
  case 21:
1248
1359
  case "end":
1249
- return _context17.stop();
1360
+ return _context18.stop();
1250
1361
  }
1251
- }, _callee17, this);
1362
+ }, _callee18, this);
1252
1363
  }));
1253
- function wait(_x20) {
1364
+ function wait(_x21) {
1254
1365
  return _wait2.apply(this, arguments);
1255
1366
  }
1256
1367
  return wait;
@@ -1258,13 +1369,13 @@ var AO = /*#__PURE__*/function () {
1258
1369
  }, {
1259
1370
  key: "attest",
1260
1371
  value: function () {
1261
- var _attest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(_ref22) {
1372
+ var _attest = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref23) {
1262
1373
  var id, jwk, tags;
1263
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1264
- while (1) switch (_context18.prev = _context18.next) {
1374
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1375
+ while (1) switch (_context19.prev = _context19.next) {
1265
1376
  case 0:
1266
- id = _ref22.id, jwk = _ref22.jwk, tags = _ref22.tags;
1267
- _context18.next = 3;
1377
+ id = _ref23.id, jwk = _ref23.jwk, tags = _ref23.tags;
1378
+ _context19.next = 3;
1268
1379
  return this.ar.post({
1269
1380
  tags: (0, _ramda.mergeLeft)(tags, {
1270
1381
  "Data-Protocol": "ao",
@@ -1274,14 +1385,14 @@ var AO = /*#__PURE__*/function () {
1274
1385
  jwk: jwk
1275
1386
  });
1276
1387
  case 3:
1277
- return _context18.abrupt("return", _context18.sent);
1388
+ return _context19.abrupt("return", _context19.sent);
1278
1389
  case 4:
1279
1390
  case "end":
1280
- return _context18.stop();
1391
+ return _context19.stop();
1281
1392
  }
1282
- }, _callee18, this);
1393
+ }, _callee19, this);
1283
1394
  }));
1284
- function attest(_x21) {
1395
+ function attest(_x22) {
1285
1396
  return _attest.apply(this, arguments);
1286
1397
  }
1287
1398
  return attest;
@@ -1289,13 +1400,13 @@ var AO = /*#__PURE__*/function () {
1289
1400
  }, {
1290
1401
  key: "avail",
1291
1402
  value: function () {
1292
- var _avail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(_ref23) {
1403
+ var _avail = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(_ref24) {
1293
1404
  var ids, jwk, tags;
1294
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1295
- while (1) switch (_context19.prev = _context19.next) {
1405
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1406
+ while (1) switch (_context20.prev = _context20.next) {
1296
1407
  case 0:
1297
- ids = _ref23.ids, jwk = _ref23.jwk, tags = _ref23.tags;
1298
- _context19.next = 3;
1408
+ ids = _ref24.ids, jwk = _ref24.jwk, tags = _ref24.tags;
1409
+ _context20.next = 3;
1299
1410
  return this.ar.post({
1300
1411
  tags: (0, _ramda.mergeLeft)(tags, {
1301
1412
  "Data-Protocol": "WeaveDrive",
@@ -1306,14 +1417,14 @@ var AO = /*#__PURE__*/function () {
1306
1417
  jwk: jwk
1307
1418
  });
1308
1419
  case 3:
1309
- return _context19.abrupt("return", _context19.sent);
1420
+ return _context20.abrupt("return", _context20.sent);
1310
1421
  case 4:
1311
1422
  case "end":
1312
- return _context19.stop();
1423
+ return _context20.stop();
1313
1424
  }
1314
- }, _callee19, this);
1425
+ }, _callee20, this);
1315
1426
  }));
1316
- function avail(_x22) {
1427
+ function avail(_x23) {
1317
1428
  return _avail.apply(this, arguments);
1318
1429
  }
1319
1430
  return avail;
@@ -1321,12 +1432,12 @@ var AO = /*#__PURE__*/function () {
1321
1432
  }, {
1322
1433
  key: "deploy",
1323
1434
  value: function () {
1324
- var _deploy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(_ref24) {
1325
- var boot, loads, src, src_data, _ref24$fills, fills, _ref24$module, module, _ref24$scheduler, scheduler, jwk, _ref24$tags, tags, data, fns, isBoot, i, _iterator5, _step5, v, args, result;
1326
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
1327
- while (1) switch (_context20.prev = _context20.next) {
1435
+ var _deploy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(_ref25) {
1436
+ var boot, loads, src, src_data, _ref25$fills, fills, _ref25$module, module, _ref25$scheduler, scheduler, jwk, _ref25$tags, tags, data, fns, isBoot, i, _iterator7, _step7, v, args, result;
1437
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1438
+ while (1) switch (_context21.prev = _context21.next) {
1328
1439
  case 0:
1329
- 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;
1440
+ boot = _ref25.boot, loads = _ref25.loads, src = _ref25.src, src_data = _ref25.src_data, _ref25$fills = _ref25.fills, fills = _ref25$fills === void 0 ? {} : _ref25$fills, _ref25$module = _ref25.module, module = _ref25$module === void 0 ? this.module : _ref25$module, _ref25$scheduler = _ref25.scheduler, scheduler = _ref25$scheduler === void 0 ? this.scheduler : _ref25$scheduler, jwk = _ref25.jwk, _ref25$tags = _ref25.tags, tags = _ref25$tags === void 0 ? {} : _ref25$tags, data = _ref25.data;
1330
1441
  fns = [], isBoot = false;
1331
1442
  if (boot === true && !data) {
1332
1443
  isBoot = true;
@@ -1374,14 +1485,14 @@ var AO = /*#__PURE__*/function () {
1374
1485
  }
1375
1486
  });
1376
1487
  i = 0;
1377
- _iterator5 = _createForOfIteratorHelper(!loads ? src_data ? [{
1488
+ _iterator7 = _createForOfIteratorHelper(!loads ? src_data ? [{
1378
1489
  data: src_data,
1379
1490
  src: src,
1380
1491
  fills: fills
1381
1492
  }] : [] : loads);
1382
1493
  try {
1383
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1384
- v = _step5.value;
1494
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
1495
+ v = _step7.value;
1385
1496
  if (!isBoot || i !== 0) {
1386
1497
  args = v;
1387
1498
  if (typeof args === "string") args = {
@@ -1398,26 +1509,26 @@ var AO = /*#__PURE__*/function () {
1398
1509
  i++;
1399
1510
  }
1400
1511
  } catch (err) {
1401
- _iterator5.e(err);
1512
+ _iterator7.e(err);
1402
1513
  } finally {
1403
- _iterator5.f();
1514
+ _iterator7.f();
1404
1515
  }
1405
- _context20.next = 9;
1516
+ _context21.next = 9;
1406
1517
  return this.pipe({
1407
1518
  jwk: jwk,
1408
1519
  fns: fns
1409
1520
  });
1410
1521
  case 9:
1411
- result = _context20.sent;
1522
+ result = _context21.sent;
1412
1523
  if (result.pid) result.p = this.p(result.pid);
1413
- return _context20.abrupt("return", result);
1524
+ return _context21.abrupt("return", result);
1414
1525
  case 12:
1415
1526
  case "end":
1416
- return _context20.stop();
1527
+ return _context21.stop();
1417
1528
  }
1418
- }, _callee20, this);
1529
+ }, _callee21, this);
1419
1530
  }));
1420
- function deploy(_x23) {
1531
+ function deploy(_x24) {
1421
1532
  return _deploy.apply(this, arguments);
1422
1533
  }
1423
1534
  return deploy;
@@ -1455,24 +1566,24 @@ var Process = /*#__PURE__*/function () {
1455
1566
  return _createClass(Process, [{
1456
1567
  key: "load",
1457
1568
  value: function () {
1458
- var _load2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
1569
+ var _load2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
1459
1570
  var opt,
1460
- _args21 = arguments;
1461
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
1462
- while (1) switch (_context21.prev = _context21.next) {
1571
+ _args22 = arguments;
1572
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1573
+ while (1) switch (_context22.prev = _context22.next) {
1463
1574
  case 0:
1464
- opt = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
1465
- _context21.next = 3;
1575
+ opt = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
1576
+ _context22.next = 3;
1466
1577
  return this.ao.load(_objectSpread({
1467
1578
  pid: this.pid
1468
1579
  }, opt));
1469
1580
  case 3:
1470
- return _context21.abrupt("return", _context21.sent);
1581
+ return _context22.abrupt("return", _context22.sent);
1471
1582
  case 4:
1472
1583
  case "end":
1473
- return _context21.stop();
1584
+ return _context22.stop();
1474
1585
  }
1475
- }, _callee21, this);
1586
+ }, _callee22, this);
1476
1587
  }));
1477
1588
  function load() {
1478
1589
  return _load2.apply(this, arguments);
@@ -1482,27 +1593,27 @@ var Process = /*#__PURE__*/function () {
1482
1593
  }, {
1483
1594
  key: "msg",
1484
1595
  value: function () {
1485
- var _msg2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(act, tags, opts) {
1596
+ var _msg2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(act, tags, opts) {
1486
1597
  var _getParams, _tags, _opts;
1487
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1488
- while (1) switch (_context22.prev = _context22.next) {
1598
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1599
+ while (1) switch (_context23.prev = _context23.next) {
1489
1600
  case 0:
1490
1601
  _getParams = getParams(tags, opts), _tags = _getParams._tags, _opts = _getParams._opts;
1491
- _context22.next = 3;
1602
+ _context23.next = 3;
1492
1603
  return this.ao.msg(_objectSpread({
1493
1604
  pid: this.pid,
1494
1605
  act: act,
1495
1606
  tags: _tags
1496
1607
  }, _opts));
1497
1608
  case 3:
1498
- return _context22.abrupt("return", _context22.sent);
1609
+ return _context23.abrupt("return", _context23.sent);
1499
1610
  case 4:
1500
1611
  case "end":
1501
- return _context22.stop();
1612
+ return _context23.stop();
1502
1613
  }
1503
- }, _callee22, this);
1614
+ }, _callee23, this);
1504
1615
  }));
1505
- function msg(_x24, _x25, _x26) {
1616
+ function msg(_x25, _x26, _x27) {
1506
1617
  return _msg2.apply(this, arguments);
1507
1618
  }
1508
1619
  return msg;
@@ -1510,27 +1621,27 @@ var Process = /*#__PURE__*/function () {
1510
1621
  }, {
1511
1622
  key: "dry",
1512
1623
  value: function () {
1513
- var _dry2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(act, tags, opts) {
1624
+ var _dry2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(act, tags, opts) {
1514
1625
  var _getParams2, _tags, _opts;
1515
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
1516
- while (1) switch (_context23.prev = _context23.next) {
1626
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1627
+ while (1) switch (_context24.prev = _context24.next) {
1517
1628
  case 0:
1518
1629
  _getParams2 = getParams(tags, opts), _tags = _getParams2._tags, _opts = _getParams2._opts;
1519
- _context23.next = 3;
1630
+ _context24.next = 3;
1520
1631
  return this.ao.dry(_objectSpread({
1521
1632
  pid: this.pid,
1522
1633
  act: act,
1523
1634
  tags: _tags
1524
1635
  }, _opts));
1525
1636
  case 3:
1526
- return _context23.abrupt("return", _context23.sent);
1637
+ return _context24.abrupt("return", _context24.sent);
1527
1638
  case 4:
1528
1639
  case "end":
1529
- return _context23.stop();
1640
+ return _context24.stop();
1530
1641
  }
1531
- }, _callee23, this);
1642
+ }, _callee24, this);
1532
1643
  }));
1533
- function dry(_x27, _x28, _x29) {
1644
+ function dry(_x28, _x29, _x30) {
1534
1645
  return _dry2.apply(this, arguments);
1535
1646
  }
1536
1647
  return dry;
@@ -1538,28 +1649,28 @@ var Process = /*#__PURE__*/function () {
1538
1649
  }, {
1539
1650
  key: "m",
1540
1651
  value: function () {
1541
- var _m = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
1652
+ var _m = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1542
1653
  var res,
1543
- _args24 = arguments;
1544
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
1545
- while (1) switch (_context24.prev = _context24.next) {
1654
+ _args25 = arguments;
1655
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1656
+ while (1) switch (_context25.prev = _context25.next) {
1546
1657
  case 0:
1547
- _context24.next = 2;
1548
- return this.msg.apply(this, _args24);
1658
+ _context25.next = 2;
1659
+ return this.msg.apply(this, _args25);
1549
1660
  case 2:
1550
- res = _context24.sent;
1661
+ res = _context25.sent;
1551
1662
  if (!res.err) {
1552
- _context24.next = 5;
1663
+ _context25.next = 5;
1553
1664
  break;
1554
1665
  }
1555
1666
  throw Error(res.err);
1556
1667
  case 5:
1557
- return _context24.abrupt("return", res.out);
1668
+ return _context25.abrupt("return", res.out);
1558
1669
  case 6:
1559
1670
  case "end":
1560
- return _context24.stop();
1671
+ return _context25.stop();
1561
1672
  }
1562
- }, _callee24, this);
1673
+ }, _callee25, this);
1563
1674
  }));
1564
1675
  function m() {
1565
1676
  return _m.apply(this, arguments);
@@ -1569,28 +1680,28 @@ var Process = /*#__PURE__*/function () {
1569
1680
  }, {
1570
1681
  key: "d",
1571
1682
  value: function () {
1572
- var _d = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1683
+ var _d = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
1573
1684
  var res,
1574
- _args25 = arguments;
1575
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1576
- while (1) switch (_context25.prev = _context25.next) {
1685
+ _args26 = arguments;
1686
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1687
+ while (1) switch (_context26.prev = _context26.next) {
1577
1688
  case 0:
1578
- _context25.next = 2;
1579
- return this.dry.apply(this, _args25);
1689
+ _context26.next = 2;
1690
+ return this.dry.apply(this, _args26);
1580
1691
  case 2:
1581
- res = _context25.sent;
1692
+ res = _context26.sent;
1582
1693
  if (!res.err) {
1583
- _context25.next = 5;
1694
+ _context26.next = 5;
1584
1695
  break;
1585
1696
  }
1586
1697
  throw Error(res.err);
1587
1698
  case 5:
1588
- return _context25.abrupt("return", res.out);
1699
+ return _context26.abrupt("return", res.out);
1589
1700
  case 6:
1590
1701
  case "end":
1591
- return _context25.stop();
1702
+ return _context26.stop();
1592
1703
  }
1593
- }, _callee25, this);
1704
+ }, _callee26, this);
1594
1705
  }));
1595
1706
  function d() {
1596
1707
  return _d.apply(this, arguments);