wao 0.16.5 → 0.16.7
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/aoconnect-base.js +128 -133
- package/esm/aoconnect-base.js +11 -12
- package/package.json +1 -1
package/cjs/aoconnect-base.js
CHANGED
|
@@ -5,16 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
|
+
var _arweave = _interopRequireDefault(require("arweave"));
|
|
8
9
|
var WarpArBundles = _interopRequireWildcard(require("warp-arbundles"));
|
|
9
10
|
var _crypto = _interopRequireDefault(require("crypto"));
|
|
10
11
|
var _base64url = _interopRequireDefault(require("base64url"));
|
|
11
12
|
var _utils = require("./utils.js");
|
|
12
13
|
var _weavedrive = _interopRequireDefault(require("./weavedrive.js"));
|
|
13
14
|
var _ramda = require("ramda");
|
|
14
|
-
var _WarpArBundles$defaul;
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
var _Arweave$default, _WarpArBundles$defaul;
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
19
|
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; }
|
|
19
20
|
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; }
|
|
20
21
|
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; }
|
|
@@ -30,6 +31,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
30
31
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
31
32
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
32
33
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
34
|
+
var Arweave = (_Arweave$default = _arweave["default"]["default"]) !== null && _Arweave$default !== void 0 ? _Arweave$default : _arweave["default"];
|
|
35
|
+
var arweave = Arweave.init();
|
|
33
36
|
var pkg = (_WarpArBundles$defaul = WarpArBundles["default"]) !== null && _WarpArBundles$defaul !== void 0 ? _WarpArBundles$defaul : WarpArBundles;
|
|
34
37
|
var DataItem = pkg.DataItem;
|
|
35
38
|
var onRecovery = {};
|
|
@@ -664,7 +667,7 @@ var _default = exports["default"] = function _default() {
|
|
|
664
667
|
var _assign = /*#__PURE__*/function () {
|
|
665
668
|
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(opt) {
|
|
666
669
|
var _opt$tags2;
|
|
667
|
-
var p, _opt, hash, _yield$ar$dataitem2, id, owner, item, _opt$data2, _ref10, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, data, _tags, from,
|
|
670
|
+
var p, _opt, hash, _yield$ar$dataitem2, id, owner, item, _opt$data2, _ref10, _opt$from, _res$Messages, _res$Spawns, _res$Assignments, data, _tags, from, msg, _env, _yield$mem$getTx3, _yield$mem$getWasm2, format, mod, wasm, wdrive, start, res, _msg, _iterator3, _step3, v, _iterator4, _step4, _v, __tags, _iterator5, _step5, _v2, _iterator6, _step6, v2;
|
|
668
671
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
669
672
|
while (1) switch (_context4.prev = _context4.next) {
|
|
670
673
|
case 0:
|
|
@@ -747,136 +750,128 @@ var _default = exports["default"] = function _default() {
|
|
|
747
750
|
_tags = _opt.tags;
|
|
748
751
|
from = (_ref10 = (_opt$from = _opt.from) !== null && _opt$from !== void 0 ? _opt$from : opt.from) !== null && _ref10 !== void 0 ? _ref10 : owner;
|
|
749
752
|
if (!_opt.item) {
|
|
750
|
-
_context4.next =
|
|
753
|
+
_context4.next = 50;
|
|
751
754
|
break;
|
|
752
755
|
}
|
|
753
|
-
_context4.prev = 44;
|
|
754
756
|
data = _base64url["default"].decode(_opt.item.data);
|
|
755
757
|
_tags = _opt.item.tags;
|
|
756
758
|
if (from) {
|
|
757
|
-
_context4.next =
|
|
759
|
+
_context4.next = 50;
|
|
758
760
|
break;
|
|
759
761
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
+
_context4.next = 49;
|
|
763
|
+
return arweave.wallets.jwkToAddress({
|
|
764
|
+
kty: "RSA",
|
|
765
|
+
n: _opt.item.owner,
|
|
766
|
+
e: "AQAB"
|
|
767
|
+
});
|
|
768
|
+
case 49:
|
|
769
|
+
from = _context4.sent;
|
|
770
|
+
case 50:
|
|
762
771
|
_context4.next = 52;
|
|
763
|
-
return _crypto["default"].subtle.digest("SHA-256", raw_owner);
|
|
764
|
-
case 52:
|
|
765
|
-
_context4.t12 = _context4.sent;
|
|
766
|
-
hashBuffer = _context4.t11.from.call(_context4.t11, _context4.t12);
|
|
767
|
-
from = _base64url["default"].encode(hashBuffer);
|
|
768
|
-
case 55:
|
|
769
|
-
_context4.next = 60;
|
|
770
|
-
break;
|
|
771
|
-
case 57:
|
|
772
|
-
_context4.prev = 57;
|
|
773
|
-
_context4.t13 = _context4["catch"](44);
|
|
774
|
-
console.log(_context4.t13);
|
|
775
|
-
case 60:
|
|
776
|
-
_context4.next = 62;
|
|
777
772
|
return genMsg(opt.message, p, data, _tags, from, mu.addr);
|
|
778
|
-
case
|
|
773
|
+
case 52:
|
|
779
774
|
msg = _context4.sent;
|
|
780
|
-
_context4.next =
|
|
775
|
+
_context4.next = 55;
|
|
781
776
|
return genEnv({
|
|
782
777
|
pid: p.id,
|
|
783
778
|
owner: p.owner,
|
|
784
779
|
module: p.module
|
|
785
780
|
});
|
|
786
|
-
case
|
|
781
|
+
case 55:
|
|
787
782
|
_env = _context4.sent;
|
|
788
783
|
if (p.handle) {
|
|
789
|
-
_context4.next =
|
|
784
|
+
_context4.next = 88;
|
|
790
785
|
break;
|
|
791
786
|
}
|
|
792
|
-
_context4.next =
|
|
787
|
+
_context4.next = 59;
|
|
793
788
|
return mem.getWasm(p.modulea);
|
|
794
|
-
case
|
|
789
|
+
case 59:
|
|
795
790
|
_yield$mem$getWasm2 = _context4.sent;
|
|
796
791
|
format = _yield$mem$getWasm2.format;
|
|
797
792
|
mod = _yield$mem$getWasm2.mod;
|
|
798
793
|
wasm = _yield$mem$getWasm2.wasm;
|
|
799
794
|
wdrive = extensions[p.extention];
|
|
800
|
-
_context4.
|
|
801
|
-
_context4.
|
|
802
|
-
_context4.
|
|
803
|
-
_context4.
|
|
804
|
-
_context4.next =
|
|
795
|
+
_context4.t11 = AoLoader;
|
|
796
|
+
_context4.t12 = wasm;
|
|
797
|
+
_context4.t13 = format;
|
|
798
|
+
_context4.t14 = wdrive;
|
|
799
|
+
_context4.next = 70;
|
|
805
800
|
return mem.getTx(p.id);
|
|
806
|
-
case
|
|
807
|
-
_context4.
|
|
808
|
-
_context4.
|
|
809
|
-
if (_context4.
|
|
810
|
-
_context4.next =
|
|
801
|
+
case 70:
|
|
802
|
+
_context4.t16 = _yield$mem$getTx3 = _context4.sent;
|
|
803
|
+
_context4.t15 = _context4.t16 === null;
|
|
804
|
+
if (_context4.t15) {
|
|
805
|
+
_context4.next = 74;
|
|
811
806
|
break;
|
|
812
807
|
}
|
|
813
|
-
_context4.
|
|
814
|
-
case
|
|
815
|
-
if (!_context4.
|
|
816
|
-
_context4.next =
|
|
808
|
+
_context4.t15 = _yield$mem$getTx3 === void 0;
|
|
809
|
+
case 74:
|
|
810
|
+
if (!_context4.t15) {
|
|
811
|
+
_context4.next = 78;
|
|
817
812
|
break;
|
|
818
813
|
}
|
|
819
|
-
_context4.
|
|
820
|
-
_context4.next =
|
|
814
|
+
_context4.t17 = void 0;
|
|
815
|
+
_context4.next = 79;
|
|
821
816
|
break;
|
|
822
|
-
case
|
|
823
|
-
_context4.
|
|
824
|
-
case
|
|
825
|
-
_context4.
|
|
826
|
-
_context4.next =
|
|
817
|
+
case 78:
|
|
818
|
+
_context4.t17 = _yield$mem$getTx3.item;
|
|
819
|
+
case 79:
|
|
820
|
+
_context4.t18 = _context4.t17;
|
|
821
|
+
_context4.next = 82;
|
|
827
822
|
return mem.getTx(mod);
|
|
828
|
-
case
|
|
829
|
-
_context4.
|
|
830
|
-
_context4.
|
|
831
|
-
format: _context4.
|
|
832
|
-
WeaveDrive: _context4.
|
|
833
|
-
spawn: _context4.
|
|
834
|
-
module: _context4.
|
|
823
|
+
case 82:
|
|
824
|
+
_context4.t19 = _context4.sent;
|
|
825
|
+
_context4.t20 = {
|
|
826
|
+
format: _context4.t13,
|
|
827
|
+
WeaveDrive: _context4.t14,
|
|
828
|
+
spawn: _context4.t18,
|
|
829
|
+
module: _context4.t19
|
|
835
830
|
};
|
|
836
|
-
_context4.next =
|
|
837
|
-
return (0, _context4.
|
|
838
|
-
case
|
|
831
|
+
_context4.next = 86;
|
|
832
|
+
return (0, _context4.t11)(_context4.t12, _context4.t20);
|
|
833
|
+
case 86:
|
|
839
834
|
p.handle = _context4.sent;
|
|
840
835
|
mem.env[opt.process].handle = p.handle;
|
|
841
|
-
case
|
|
836
|
+
case 88:
|
|
842
837
|
if (p.compressed) {
|
|
843
838
|
start = Date.now();
|
|
844
839
|
p.memory = mem.decompress(p.memory, p.original_size);
|
|
845
840
|
p.compressed = false;
|
|
846
841
|
}
|
|
847
|
-
_context4.next =
|
|
842
|
+
_context4.next = 91;
|
|
848
843
|
return p.handle(p.memory, msg, _env);
|
|
849
|
-
case
|
|
844
|
+
case 91:
|
|
850
845
|
res = _context4.sent;
|
|
851
846
|
p.memory = res.Memory;
|
|
852
847
|
delete res.Memory;
|
|
853
848
|
p.results.push(opt.message);
|
|
854
|
-
_context4.next =
|
|
849
|
+
_context4.next = 97;
|
|
855
850
|
return mem.set(p, "env", opt.process);
|
|
856
|
-
case
|
|
851
|
+
case 97:
|
|
857
852
|
_msg = _objectSpread(_objectSpread({}, (0, _ramda.dissoc)("signer", _opt)), {}, {
|
|
858
853
|
res: res
|
|
859
854
|
});
|
|
860
|
-
_context4.next =
|
|
855
|
+
_context4.next = 100;
|
|
861
856
|
return mem.set(_msg, "msgs", opt.message);
|
|
862
|
-
case
|
|
857
|
+
case 100:
|
|
863
858
|
_iterator3 = _createForOfIteratorHelper((_res$Messages = res.Messages) !== null && _res$Messages !== void 0 ? _res$Messages : []);
|
|
864
|
-
_context4.prev =
|
|
859
|
+
_context4.prev = 101;
|
|
865
860
|
_iterator3.s();
|
|
866
|
-
case
|
|
861
|
+
case 103:
|
|
867
862
|
if ((_step3 = _iterator3.n()).done) {
|
|
868
|
-
_context4.next =
|
|
863
|
+
_context4.next = 112;
|
|
869
864
|
break;
|
|
870
865
|
}
|
|
871
866
|
v = _step3.value;
|
|
872
|
-
_context4.next =
|
|
867
|
+
_context4.next = 107;
|
|
873
868
|
return mem.get("env", v.Target);
|
|
874
|
-
case
|
|
869
|
+
case 107:
|
|
875
870
|
if (!_context4.sent) {
|
|
876
|
-
_context4.next =
|
|
871
|
+
_context4.next = 110;
|
|
877
872
|
break;
|
|
878
873
|
}
|
|
879
|
-
_context4.next =
|
|
874
|
+
_context4.next = 110;
|
|
880
875
|
return message({
|
|
881
876
|
"for": opt.message,
|
|
882
877
|
process: v.Target,
|
|
@@ -885,32 +880,32 @@ var _default = exports["default"] = function _default() {
|
|
|
885
880
|
signer: mu.signer,
|
|
886
881
|
from: opt.process
|
|
887
882
|
});
|
|
888
|
-
case
|
|
889
|
-
_context4.next =
|
|
883
|
+
case 110:
|
|
884
|
+
_context4.next = 103;
|
|
890
885
|
break;
|
|
891
|
-
case
|
|
892
|
-
_context4.next =
|
|
886
|
+
case 112:
|
|
887
|
+
_context4.next = 117;
|
|
893
888
|
break;
|
|
894
|
-
case
|
|
895
|
-
_context4.prev =
|
|
896
|
-
_context4.
|
|
897
|
-
_iterator3.e(_context4.
|
|
898
|
-
case
|
|
899
|
-
_context4.prev =
|
|
889
|
+
case 114:
|
|
890
|
+
_context4.prev = 114;
|
|
891
|
+
_context4.t21 = _context4["catch"](101);
|
|
892
|
+
_iterator3.e(_context4.t21);
|
|
893
|
+
case 117:
|
|
894
|
+
_context4.prev = 117;
|
|
900
895
|
_iterator3.f();
|
|
901
|
-
return _context4.finish(
|
|
902
|
-
case
|
|
896
|
+
return _context4.finish(117);
|
|
897
|
+
case 120:
|
|
903
898
|
_iterator4 = _createForOfIteratorHelper((_res$Spawns = res.Spawns) !== null && _res$Spawns !== void 0 ? _res$Spawns : []);
|
|
904
|
-
_context4.prev =
|
|
899
|
+
_context4.prev = 121;
|
|
905
900
|
_iterator4.s();
|
|
906
|
-
case
|
|
901
|
+
case 123:
|
|
907
902
|
if ((_step4 = _iterator4.n()).done) {
|
|
908
|
-
_context4.next =
|
|
903
|
+
_context4.next = 130;
|
|
909
904
|
break;
|
|
910
905
|
}
|
|
911
906
|
_v = _step4.value;
|
|
912
907
|
__tags = (0, _utils.tags)(_v.Tags);
|
|
913
|
-
_context4.next =
|
|
908
|
+
_context4.next = 128;
|
|
914
909
|
return spawn({
|
|
915
910
|
"for": opt.message,
|
|
916
911
|
module: __tags.Module,
|
|
@@ -920,87 +915,87 @@ var _default = exports["default"] = function _default() {
|
|
|
920
915
|
from: __tags["From-Process"],
|
|
921
916
|
signer: mu.signer
|
|
922
917
|
});
|
|
923
|
-
case
|
|
924
|
-
_context4.next =
|
|
918
|
+
case 128:
|
|
919
|
+
_context4.next = 123;
|
|
925
920
|
break;
|
|
926
|
-
case
|
|
927
|
-
_context4.next =
|
|
921
|
+
case 130:
|
|
922
|
+
_context4.next = 135;
|
|
928
923
|
break;
|
|
929
|
-
case
|
|
930
|
-
_context4.prev =
|
|
931
|
-
_context4.
|
|
932
|
-
_iterator4.e(_context4.
|
|
933
|
-
case
|
|
934
|
-
_context4.prev =
|
|
924
|
+
case 132:
|
|
925
|
+
_context4.prev = 132;
|
|
926
|
+
_context4.t22 = _context4["catch"](121);
|
|
927
|
+
_iterator4.e(_context4.t22);
|
|
928
|
+
case 135:
|
|
929
|
+
_context4.prev = 135;
|
|
935
930
|
_iterator4.f();
|
|
936
|
-
return _context4.finish(
|
|
937
|
-
case
|
|
931
|
+
return _context4.finish(135);
|
|
932
|
+
case 138:
|
|
938
933
|
_iterator5 = _createForOfIteratorHelper((_res$Assignments = res.Assignments) !== null && _res$Assignments !== void 0 ? _res$Assignments : []);
|
|
939
|
-
_context4.prev =
|
|
934
|
+
_context4.prev = 139;
|
|
940
935
|
_iterator5.s();
|
|
941
|
-
case
|
|
936
|
+
case 141:
|
|
942
937
|
if ((_step5 = _iterator5.n()).done) {
|
|
943
|
-
_context4.next =
|
|
938
|
+
_context4.next = 162;
|
|
944
939
|
break;
|
|
945
940
|
}
|
|
946
941
|
_v2 = _step5.value;
|
|
947
942
|
_iterator6 = _createForOfIteratorHelper(_v2.Processes);
|
|
948
|
-
_context4.prev =
|
|
943
|
+
_context4.prev = 144;
|
|
949
944
|
_iterator6.s();
|
|
950
|
-
case
|
|
945
|
+
case 146:
|
|
951
946
|
if ((_step6 = _iterator6.n()).done) {
|
|
952
|
-
_context4.next =
|
|
947
|
+
_context4.next = 152;
|
|
953
948
|
break;
|
|
954
949
|
}
|
|
955
950
|
v2 = _step6.value;
|
|
956
|
-
_context4.next =
|
|
951
|
+
_context4.next = 150;
|
|
957
952
|
return _assign({
|
|
958
953
|
message: _v2.Message,
|
|
959
954
|
process: v2,
|
|
960
955
|
from: opt.process,
|
|
961
956
|
signer: mu.signer
|
|
962
957
|
});
|
|
958
|
+
case 150:
|
|
959
|
+
_context4.next = 146;
|
|
960
|
+
break;
|
|
961
|
+
case 152:
|
|
962
|
+
_context4.next = 157;
|
|
963
|
+
break;
|
|
964
|
+
case 154:
|
|
965
|
+
_context4.prev = 154;
|
|
966
|
+
_context4.t23 = _context4["catch"](144);
|
|
967
|
+
_iterator6.e(_context4.t23);
|
|
968
|
+
case 157:
|
|
969
|
+
_context4.prev = 157;
|
|
970
|
+
_iterator6.f();
|
|
971
|
+
return _context4.finish(157);
|
|
963
972
|
case 160:
|
|
964
|
-
_context4.next =
|
|
973
|
+
_context4.next = 141;
|
|
965
974
|
break;
|
|
966
975
|
case 162:
|
|
967
976
|
_context4.next = 167;
|
|
968
977
|
break;
|
|
969
978
|
case 164:
|
|
970
979
|
_context4.prev = 164;
|
|
971
|
-
_context4.
|
|
972
|
-
|
|
980
|
+
_context4.t24 = _context4["catch"](139);
|
|
981
|
+
_iterator5.e(_context4.t24);
|
|
973
982
|
case 167:
|
|
974
983
|
_context4.prev = 167;
|
|
975
|
-
|
|
984
|
+
_iterator5.f();
|
|
976
985
|
return _context4.finish(167);
|
|
977
986
|
case 170:
|
|
978
|
-
_context4.next = 151;
|
|
979
|
-
break;
|
|
980
|
-
case 172:
|
|
981
|
-
_context4.next = 177;
|
|
982
|
-
break;
|
|
983
|
-
case 174:
|
|
984
|
-
_context4.prev = 174;
|
|
985
|
-
_context4.t27 = _context4["catch"](149);
|
|
986
|
-
_iterator5.e(_context4.t27);
|
|
987
|
-
case 177:
|
|
988
|
-
_context4.prev = 177;
|
|
989
|
-
_iterator5.f();
|
|
990
|
-
return _context4.finish(177);
|
|
991
|
-
case 180:
|
|
992
987
|
return _context4.abrupt("return", id);
|
|
993
|
-
case
|
|
994
|
-
_context4.prev =
|
|
995
|
-
_context4.
|
|
996
|
-
console.log(_context4.
|
|
997
|
-
case
|
|
988
|
+
case 173:
|
|
989
|
+
_context4.prev = 173;
|
|
990
|
+
_context4.t25 = _context4["catch"](39);
|
|
991
|
+
console.log(_context4.t25);
|
|
992
|
+
case 176:
|
|
998
993
|
return _context4.abrupt("return", null);
|
|
999
|
-
case
|
|
994
|
+
case 177:
|
|
1000
995
|
case "end":
|
|
1001
996
|
return _context4.stop();
|
|
1002
997
|
}
|
|
1003
|
-
}, _callee4, null, [[39,
|
|
998
|
+
}, _callee4, null, [[39, 173], [101, 114, 117, 120], [121, 132, 135, 138], [139, 164, 167, 170], [144, 154, 157, 160]]);
|
|
1004
999
|
}));
|
|
1005
1000
|
return function assign(_x8) {
|
|
1006
1001
|
return _ref9.apply(this, arguments);
|
package/esm/aoconnect-base.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _Arweave from "arweave"
|
|
2
|
+
const Arweave = _Arweave.default ?? _Arweave
|
|
3
|
+
const arweave = Arweave.init()
|
|
1
4
|
import * as WarpArBundles from "warp-arbundles"
|
|
2
5
|
const pkg = WarpArBundles.default ?? WarpArBundles
|
|
3
6
|
const { DataItem } = pkg
|
|
@@ -309,18 +312,14 @@ export default ({ AR, scheduler, mu, su, cu, acc, AoLoader, ArMem } = {}) => {
|
|
|
309
312
|
let _tags = _opt.tags
|
|
310
313
|
let from = _opt.from ?? opt.from ?? owner
|
|
311
314
|
if (_opt.item) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
from = base64url.encode(hashBuffer)
|
|
321
|
-
}
|
|
322
|
-
} catch (e) {
|
|
323
|
-
console.log(e)
|
|
315
|
+
data = base64url.decode(_opt.item.data)
|
|
316
|
+
_tags = _opt.item.tags
|
|
317
|
+
if (!from) {
|
|
318
|
+
from = await arweave.wallets.jwkToAddress({
|
|
319
|
+
kty: "RSA",
|
|
320
|
+
n: _opt.item.owner,
|
|
321
|
+
e: "AQAB",
|
|
322
|
+
})
|
|
324
323
|
}
|
|
325
324
|
}
|
|
326
325
|
// check: is owner=mu.addr right?
|