wao 0.2.1 → 0.2.2
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.js +35 -12
- package/cjs/helpers.js +1 -1
- package/cjs/lua/aos.wasm +0 -0
- package/cjs/lua/sqlite.wasm +0 -0
- package/esm/aoconnect.js +13 -0
- package/esm/helpers.js +1 -1
- package/esm/lua/aos.wasm +0 -0
- package/esm/lua/sqlite.wasm +0 -0
- package/package.json +1 -1
package/cjs/aoconnect.js
CHANGED
|
@@ -118,10 +118,20 @@ var connect = exports.connect = function connect() {
|
|
|
118
118
|
"Do_Uc2Sju_ffp6Ev0AnLVdPtot15rvMjP-a9VVaA5fM": {
|
|
119
119
|
file: "aos2_0_1",
|
|
120
120
|
format: "wasm64-unknown-emscripten-draft_2024_02_15"
|
|
121
|
+
},
|
|
122
|
+
cNlipBptaF9JeFAf4wUmpi43EojNanIBos3EfNrEOWo: {
|
|
123
|
+
file: "aos_1",
|
|
124
|
+
format: "wasm64-unknown-emscripten-draft_2024_02_15"
|
|
125
|
+
},
|
|
126
|
+
ghSkge2sIUD_F00ym5sEimC63BDBuBrq4b5OcwxOjiw: {
|
|
127
|
+
file: "sqlite",
|
|
128
|
+
format: "wasm64-unknown-emscripten-draft_2024_02_15"
|
|
121
129
|
}
|
|
122
130
|
};
|
|
123
131
|
var modules = {
|
|
124
|
-
aos_2_0_1: "Do_Uc2Sju_ffp6Ev0AnLVdPtot15rvMjP-a9VVaA5fM"
|
|
132
|
+
aos_2_0_1: "Do_Uc2Sju_ffp6Ev0AnLVdPtot15rvMjP-a9VVaA5fM",
|
|
133
|
+
aos_1: "cNlipBptaF9JeFAf4wUmpi43EojNanIBos3EfNrEOWo",
|
|
134
|
+
sqlite: "ghSkge2sIUD_F00ym5sEimC63BDBuBrq4b5OcwxOjiw"
|
|
125
135
|
};
|
|
126
136
|
var modmap = {};
|
|
127
137
|
var env = {
|
|
@@ -402,6 +412,7 @@ var connect = exports.connect = function connect() {
|
|
|
402
412
|
};
|
|
403
413
|
}();
|
|
404
414
|
return {
|
|
415
|
+
scheduler: "GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA",
|
|
405
416
|
modules: modules,
|
|
406
417
|
accounts: _accounts["default"].users,
|
|
407
418
|
message: _message,
|
|
@@ -459,33 +470,45 @@ var connect = exports.connect = function connect() {
|
|
|
459
470
|
while (1) switch (_context6.prev = _context6.next) {
|
|
460
471
|
case 0:
|
|
461
472
|
opt = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
|
473
|
+
if (opt.module) {
|
|
474
|
+
_context6.next = 3;
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
throw Error("module.missing");
|
|
478
|
+
case 3:
|
|
479
|
+
if (opt.scheduler) {
|
|
480
|
+
_context6.next = 5;
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
throw Error("scheduler.missing");
|
|
484
|
+
case 5:
|
|
462
485
|
mod = (_opt$module = opt.module) !== null && _opt$module !== void 0 ? _opt$module : modules["aos_2_0_1"];
|
|
463
486
|
if (!(!modmap[mod] && wasms[mod])) {
|
|
464
|
-
_context6.next =
|
|
487
|
+
_context6.next = 15;
|
|
465
488
|
break;
|
|
466
489
|
}
|
|
467
|
-
_context6.next =
|
|
490
|
+
_context6.next = 9;
|
|
468
491
|
return dirname();
|
|
469
|
-
case
|
|
492
|
+
case 9:
|
|
470
493
|
_dirname = _context6.sent;
|
|
471
494
|
wasm = (0, _fs.readFileSync)((0, _path.resolve)(_dirname, "lua/".concat(wasms[mod].file, ".wasm")));
|
|
472
|
-
_context6.next =
|
|
495
|
+
_context6.next = 13;
|
|
473
496
|
return (0, _aoLoader["default"])(wasm, {
|
|
474
497
|
format: wasms[mod].format
|
|
475
498
|
});
|
|
476
|
-
case
|
|
499
|
+
case 13:
|
|
477
500
|
handle = _context6.sent;
|
|
478
501
|
modmap[mod] = {
|
|
479
502
|
handle: handle,
|
|
480
503
|
id: mod
|
|
481
504
|
};
|
|
482
|
-
case
|
|
505
|
+
case 15:
|
|
483
506
|
if (mod) {
|
|
484
|
-
_context6.next =
|
|
507
|
+
_context6.next = 17;
|
|
485
508
|
break;
|
|
486
509
|
}
|
|
487
510
|
throw Error("module not found");
|
|
488
|
-
case
|
|
511
|
+
case 17:
|
|
489
512
|
_module = modmap[mod];
|
|
490
513
|
ex = false;
|
|
491
514
|
(_opt$tags = opt.tags) !== null && _opt$tags !== void 0 ? _opt$tags : opt.tags = [];
|
|
@@ -504,9 +527,9 @@ var connect = exports.connect = function connect() {
|
|
|
504
527
|
name: "Type",
|
|
505
528
|
value: "Process"
|
|
506
529
|
});
|
|
507
|
-
_context6.next =
|
|
530
|
+
_context6.next = 25;
|
|
508
531
|
return parse(opt);
|
|
509
|
-
case
|
|
532
|
+
case 25:
|
|
510
533
|
_yield$parse3 = _context6.sent;
|
|
511
534
|
id = _yield$parse3.id;
|
|
512
535
|
owner = _yield$parse3.owner;
|
|
@@ -525,7 +548,7 @@ var connect = exports.connect = function connect() {
|
|
|
525
548
|
txs: []
|
|
526
549
|
};
|
|
527
550
|
return _context6.abrupt("return", id);
|
|
528
|
-
case
|
|
551
|
+
case 31:
|
|
529
552
|
case "end":
|
|
530
553
|
return _context6.stop();
|
|
531
554
|
}
|
package/cjs/helpers.js
CHANGED
|
@@ -270,7 +270,7 @@ var setup = exports.setup = /*#__PURE__*/function () {
|
|
|
270
270
|
auth = _context3.sent.address;
|
|
271
271
|
case 43:
|
|
272
272
|
_context3.next = 45;
|
|
273
|
-
return src.upload("
|
|
273
|
+
return src.upload("sqlite", "wasm");
|
|
274
274
|
case 45:
|
|
275
275
|
wasm = _context3.sent;
|
|
276
276
|
_context3.next = 48;
|
package/cjs/lua/aos.wasm
ADDED
|
Binary file
|
|
Binary file
|
package/esm/aoconnect.js
CHANGED
|
@@ -55,9 +55,19 @@ export const connect = () => {
|
|
|
55
55
|
file: "aos2_0_1",
|
|
56
56
|
format: "wasm64-unknown-emscripten-draft_2024_02_15",
|
|
57
57
|
},
|
|
58
|
+
cNlipBptaF9JeFAf4wUmpi43EojNanIBos3EfNrEOWo: {
|
|
59
|
+
file: "aos_1",
|
|
60
|
+
format: "wasm64-unknown-emscripten-draft_2024_02_15",
|
|
61
|
+
},
|
|
62
|
+
ghSkge2sIUD_F00ym5sEimC63BDBuBrq4b5OcwxOjiw: {
|
|
63
|
+
file: "sqlite",
|
|
64
|
+
format: "wasm64-unknown-emscripten-draft_2024_02_15",
|
|
65
|
+
},
|
|
58
66
|
}
|
|
59
67
|
let modules = {
|
|
60
68
|
aos_2_0_1: "Do_Uc2Sju_ffp6Ev0AnLVdPtot15rvMjP-a9VVaA5fM",
|
|
69
|
+
aos_1: "cNlipBptaF9JeFAf4wUmpi43EojNanIBos3EfNrEOWo",
|
|
70
|
+
sqlite: "ghSkge2sIUD_F00ym5sEimC63BDBuBrq4b5OcwxOjiw",
|
|
61
71
|
}
|
|
62
72
|
let modmap = {}
|
|
63
73
|
let env = { msgs: {} }
|
|
@@ -196,6 +206,7 @@ export const connect = () => {
|
|
|
196
206
|
}
|
|
197
207
|
|
|
198
208
|
return {
|
|
209
|
+
scheduler: "GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA",
|
|
199
210
|
modules,
|
|
200
211
|
accounts: accounts.users,
|
|
201
212
|
message,
|
|
@@ -205,6 +216,8 @@ export const connect = () => {
|
|
|
205
216
|
return _txs
|
|
206
217
|
},
|
|
207
218
|
spawn: async (opt = {}) => {
|
|
219
|
+
if (!opt.module) throw Error("module.missing")
|
|
220
|
+
if (!opt.scheduler) throw Error("scheduler.missing")
|
|
208
221
|
let mod = opt.module ?? modules["aos_2_0_1"]
|
|
209
222
|
if (!modmap[mod] && wasms[mod]) {
|
|
210
223
|
const __dirname = await dirname()
|
package/esm/helpers.js
CHANGED
|
@@ -87,7 +87,7 @@ export const setup = async ({
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
// ao
|
|
90
|
-
const wasm = await src.upload("
|
|
90
|
+
const wasm = await src.upload("sqlite", "wasm")
|
|
91
91
|
const wasm2 = await src.upload("aos", "wasm")
|
|
92
92
|
const wasm_aos2 = await src.upload("aos2_0_1", "wasm")
|
|
93
93
|
|
package/esm/lua/aos.wasm
ADDED
|
Binary file
|
|
Binary file
|