@locuschain/lib 0.1.7 → 0.1.10
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/dist/chunks/{rpc-D_9iAveY.cjs → rpc-CGaI4dy-.cjs} +78 -80
- package/dist/chunks/{rpc-C-NwzWKp.js → rpc-DfVmqV8B.js} +78 -80
- package/dist/chunks/{rpc-CiBEY7yu.js → rpc-yDRMApre.js} +78 -80
- package/dist/index.amd.js +1 -1
- package/dist/index.cjs.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/support/index.amd.js +1 -1
- package/dist/support/index.cjs.cjs +1 -1
- package/dist/support/index.esm.js +1 -1
- package/dist/utils/index.amd.js +1 -1
- package/dist/utils/index.cjs.cjs +1 -1
- package/dist/utils/index.esm.js +2 -2
- package/dist/utils/lclib.d.mts +1 -1
- package/dist/utils/lclib.json +1 -1
- package/dist/web3/index.amd.js +1 -1
- package/dist/web3/index.cjs.cjs +1 -1
- package/dist/web3/index.esm.js +1 -1
- package/package.json +1 -1
|
@@ -39,35 +39,34 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
39
39
|
|
|
40
40
|
/* eslint-disable */
|
|
41
41
|
function toUint8Array(s) {
|
|
42
|
-
if (typeof atob ===
|
|
43
|
-
return new Uint8Array(atob(s).split(
|
|
42
|
+
if (typeof atob === 'function')
|
|
43
|
+
return new Uint8Array(atob(s).split('').map(charCodeAt));
|
|
44
44
|
// return (require('buf' + 'fer').Buffer).from(s, 'base64')
|
|
45
45
|
}
|
|
46
46
|
function charCodeAt(c) {
|
|
47
47
|
return c.charCodeAt(0);
|
|
48
48
|
}
|
|
49
49
|
var wasm = toUint8Array(wasmJson.Base64);
|
|
50
|
-
|
|
50
|
+
(() => {
|
|
51
51
|
const enosys = () => {
|
|
52
|
-
const err = new Error(
|
|
53
|
-
err.code =
|
|
52
|
+
const err = new Error('not implemented');
|
|
53
|
+
err.code = 'ENOSYS';
|
|
54
54
|
return err;
|
|
55
55
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
localFs = {
|
|
56
|
+
if (!globalThis.fs) {
|
|
57
|
+
let outputBuf = '';
|
|
58
|
+
globalThis.fs = {
|
|
60
59
|
constants: {
|
|
61
60
|
O_WRONLY: -1,
|
|
62
61
|
O_RDWR: -1,
|
|
63
62
|
O_CREAT: -1,
|
|
64
63
|
O_TRUNC: -1,
|
|
65
64
|
O_APPEND: -1,
|
|
66
|
-
O_EXCL: -1
|
|
65
|
+
O_EXCL: -1
|
|
67
66
|
}, // unused
|
|
68
67
|
writeSync(fd, buf) {
|
|
69
68
|
outputBuf += decoder.decode(buf);
|
|
70
|
-
const nl = outputBuf.lastIndexOf(
|
|
69
|
+
const nl = outputBuf.lastIndexOf('\n');
|
|
71
70
|
if (nl != -1) {
|
|
72
71
|
console.log(outputBuf.substring(0, nl));
|
|
73
72
|
outputBuf = outputBuf.substring(nl + 1);
|
|
@@ -150,7 +149,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
150
149
|
},
|
|
151
150
|
utimes(path, atime, mtime, callback) {
|
|
152
151
|
callback(enosys());
|
|
153
|
-
}
|
|
152
|
+
}
|
|
154
153
|
};
|
|
155
154
|
}
|
|
156
155
|
// if (!globalThis.process) {
|
|
@@ -184,29 +183,29 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
184
183
|
// };
|
|
185
184
|
// }
|
|
186
185
|
if (!globalThis.crypto) {
|
|
187
|
-
throw new Error(
|
|
186
|
+
throw new Error('globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)');
|
|
188
187
|
}
|
|
189
188
|
if (!globalThis.performance) {
|
|
190
|
-
throw new Error(
|
|
189
|
+
throw new Error('globalThis.performance is not available, polyfill required (performance.now only)');
|
|
191
190
|
}
|
|
192
191
|
if (!globalThis.TextEncoder) {
|
|
193
|
-
throw new Error(
|
|
192
|
+
throw new Error('globalThis.TextEncoder is not available, polyfill required');
|
|
194
193
|
}
|
|
195
194
|
if (!globalThis.TextDecoder) {
|
|
196
|
-
throw new Error(
|
|
195
|
+
throw new Error('globalThis.TextDecoder is not available, polyfill required');
|
|
197
196
|
}
|
|
198
|
-
const encoder = new TextEncoder(
|
|
199
|
-
const decoder = new TextDecoder(
|
|
200
|
-
|
|
197
|
+
const encoder = new TextEncoder('utf-8');
|
|
198
|
+
const decoder = new TextDecoder('utf-8');
|
|
199
|
+
globalThis.Go = class {
|
|
201
200
|
constructor() {
|
|
202
|
-
this.argv = [
|
|
201
|
+
this.argv = ['js'];
|
|
203
202
|
this.env = {};
|
|
204
|
-
this.exit =
|
|
203
|
+
this.exit = code => {
|
|
205
204
|
if (code !== 0) {
|
|
206
|
-
console.warn(
|
|
205
|
+
console.warn('exit code:', code);
|
|
207
206
|
}
|
|
208
207
|
};
|
|
209
|
-
this._exitPromise = new Promise(
|
|
208
|
+
this._exitPromise = new Promise(resolve => {
|
|
210
209
|
this._resolveExitPromise = resolve;
|
|
211
210
|
});
|
|
212
211
|
this._pendingEvent = null;
|
|
@@ -216,12 +215,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
216
215
|
this.mem.setUint32(addr + 0, v, true);
|
|
217
216
|
this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);
|
|
218
217
|
};
|
|
219
|
-
const getInt64 =
|
|
218
|
+
const getInt64 = addr => {
|
|
220
219
|
const low = this.mem.getUint32(addr + 0, true);
|
|
221
220
|
const high = this.mem.getInt32(addr + 4, true);
|
|
222
221
|
return low + high * 4294967296;
|
|
223
222
|
};
|
|
224
|
-
const loadValue =
|
|
223
|
+
const loadValue = addr => {
|
|
225
224
|
const f = this.mem.getFloat64(addr, true);
|
|
226
225
|
if (f === 0) {
|
|
227
226
|
return undefined;
|
|
@@ -234,7 +233,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
234
233
|
};
|
|
235
234
|
const storeValue = (addr, v) => {
|
|
236
235
|
const nanHead = 0x7ff80000;
|
|
237
|
-
if (typeof v ===
|
|
236
|
+
if (typeof v === 'number' && v !== 0) {
|
|
238
237
|
if (isNaN(v)) {
|
|
239
238
|
this.mem.setUint32(addr + 4, nanHead, true);
|
|
240
239
|
this.mem.setUint32(addr, 0, true);
|
|
@@ -260,30 +259,30 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
260
259
|
this._goRefCounts[id]++;
|
|
261
260
|
let typeFlag = 0;
|
|
262
261
|
switch (typeof v) {
|
|
263
|
-
case
|
|
262
|
+
case 'object':
|
|
264
263
|
if (v !== null) {
|
|
265
264
|
typeFlag = 1;
|
|
266
265
|
}
|
|
267
266
|
break;
|
|
268
|
-
case
|
|
267
|
+
case 'string':
|
|
269
268
|
typeFlag = 2;
|
|
270
269
|
break;
|
|
271
|
-
case
|
|
270
|
+
case 'symbol':
|
|
272
271
|
typeFlag = 3;
|
|
273
272
|
break;
|
|
274
|
-
case
|
|
273
|
+
case 'function':
|
|
275
274
|
typeFlag = 4;
|
|
276
275
|
break;
|
|
277
276
|
}
|
|
278
277
|
this.mem.setUint32(addr + 4, nanHead | typeFlag, true);
|
|
279
278
|
this.mem.setUint32(addr, id, true);
|
|
280
279
|
};
|
|
281
|
-
const loadSlice =
|
|
280
|
+
const loadSlice = addr => {
|
|
282
281
|
const array = getInt64(addr + 0);
|
|
283
282
|
const len = getInt64(addr + 8);
|
|
284
283
|
return new Uint8Array(this._inst.exports.mem.buffer, array, len);
|
|
285
284
|
};
|
|
286
|
-
const loadSliceOfValues =
|
|
285
|
+
const loadSliceOfValues = addr => {
|
|
287
286
|
const array = getInt64(addr + 0);
|
|
288
287
|
const len = getInt64(addr + 8);
|
|
289
288
|
const a = new Array(len);
|
|
@@ -292,7 +291,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
292
291
|
}
|
|
293
292
|
return a;
|
|
294
293
|
};
|
|
295
|
-
const loadString =
|
|
294
|
+
const loadString = addr => {
|
|
296
295
|
const saddr = getInt64(addr + 0);
|
|
297
296
|
const len = getInt64(addr + 8);
|
|
298
297
|
return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));
|
|
@@ -300,7 +299,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
300
299
|
const timeOrigin = Date.now() - performance.now();
|
|
301
300
|
this.importObject = {
|
|
302
301
|
_gotest: {
|
|
303
|
-
add: (a, b) => a + b
|
|
302
|
+
add: (a, b) => a + b
|
|
304
303
|
},
|
|
305
304
|
gojs: {
|
|
306
305
|
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
|
|
@@ -308,7 +307,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
308
307
|
// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
|
|
309
308
|
// This changes the SP, thus we have to update the SP used by the imported function.
|
|
310
309
|
// func wasmExit(code int32)
|
|
311
|
-
|
|
310
|
+
'runtime.wasmExit': sp => {
|
|
312
311
|
sp >>>= 0;
|
|
313
312
|
const code = this.mem.getInt32(sp + 8, true);
|
|
314
313
|
this.exited = true;
|
|
@@ -320,31 +319,31 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
320
319
|
this.exit(code);
|
|
321
320
|
},
|
|
322
321
|
// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)
|
|
323
|
-
|
|
322
|
+
'runtime.wasmWrite': sp => {
|
|
324
323
|
sp >>>= 0;
|
|
325
324
|
const fd = getInt64(sp + 8);
|
|
326
325
|
const p = getInt64(sp + 16);
|
|
327
326
|
const n = this.mem.getInt32(sp + 24, true);
|
|
328
|
-
|
|
327
|
+
fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));
|
|
329
328
|
},
|
|
330
329
|
// func resetMemoryDataView()
|
|
331
|
-
|
|
330
|
+
'runtime.resetMemoryDataView': sp => {
|
|
332
331
|
this.mem = new DataView(this._inst.exports.mem.buffer);
|
|
333
332
|
},
|
|
334
333
|
// func nanotime1() int64
|
|
335
|
-
|
|
334
|
+
'runtime.nanotime1': sp => {
|
|
336
335
|
sp >>>= 0;
|
|
337
336
|
setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);
|
|
338
337
|
},
|
|
339
338
|
// func walltime() (sec int64, nsec int32)
|
|
340
|
-
|
|
339
|
+
'runtime.walltime': sp => {
|
|
341
340
|
sp >>>= 0;
|
|
342
341
|
const msec = new Date().getTime();
|
|
343
342
|
setInt64(sp + 8, msec / 1000);
|
|
344
343
|
this.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);
|
|
345
344
|
},
|
|
346
345
|
// func scheduleTimeoutEvent(delay int64) int32
|
|
347
|
-
|
|
346
|
+
'runtime.scheduleTimeoutEvent': sp => {
|
|
348
347
|
sp >>>= 0;
|
|
349
348
|
const id = this._nextCallbackTimeoutID;
|
|
350
349
|
this._nextCallbackTimeoutID++;
|
|
@@ -353,26 +352,26 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
353
352
|
while (this._scheduledTimeouts.has(id)) {
|
|
354
353
|
// for some reason Go failed to register the timeout event, log and try again
|
|
355
354
|
// (temporary workaround for https://github.com/golang/go/issues/28975)
|
|
356
|
-
console.warn(
|
|
355
|
+
console.warn('scheduleTimeoutEvent: missed timeout event');
|
|
357
356
|
this._resume();
|
|
358
357
|
}
|
|
359
358
|
}, getInt64(sp + 8)));
|
|
360
359
|
this.mem.setInt32(sp + 16, id, true);
|
|
361
360
|
},
|
|
362
361
|
// func clearTimeoutEvent(id int32)
|
|
363
|
-
|
|
362
|
+
'runtime.clearTimeoutEvent': sp => {
|
|
364
363
|
sp >>>= 0;
|
|
365
364
|
const id = this.mem.getInt32(sp + 8, true);
|
|
366
365
|
clearTimeout(this._scheduledTimeouts.get(id));
|
|
367
366
|
this._scheduledTimeouts.delete(id);
|
|
368
367
|
},
|
|
369
368
|
// func getRandomData(r []byte)
|
|
370
|
-
|
|
369
|
+
'runtime.getRandomData': sp => {
|
|
371
370
|
sp >>>= 0;
|
|
372
371
|
crypto.getRandomValues(loadSlice(sp + 8));
|
|
373
372
|
},
|
|
374
373
|
// func finalizeRef(v ref)
|
|
375
|
-
|
|
374
|
+
'syscall/js.finalizeRef': sp => {
|
|
376
375
|
sp >>>= 0;
|
|
377
376
|
const id = this.mem.getUint32(sp + 8, true);
|
|
378
377
|
this._goRefCounts[id]--;
|
|
@@ -384,39 +383,39 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
384
383
|
}
|
|
385
384
|
},
|
|
386
385
|
// func stringVal(value string) ref
|
|
387
|
-
|
|
386
|
+
'syscall/js.stringVal': sp => {
|
|
388
387
|
sp >>>= 0;
|
|
389
388
|
storeValue(sp + 24, loadString(sp + 8));
|
|
390
389
|
},
|
|
391
390
|
// func valueGet(v ref, p string) ref
|
|
392
|
-
|
|
391
|
+
'syscall/js.valueGet': sp => {
|
|
393
392
|
sp >>>= 0;
|
|
394
393
|
const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));
|
|
395
394
|
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
|
396
395
|
storeValue(sp + 32, result);
|
|
397
396
|
},
|
|
398
397
|
// func valueSet(v ref, p string, x ref)
|
|
399
|
-
|
|
398
|
+
'syscall/js.valueSet': sp => {
|
|
400
399
|
sp >>>= 0;
|
|
401
400
|
Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));
|
|
402
401
|
},
|
|
403
402
|
// func valueDelete(v ref, p string)
|
|
404
|
-
|
|
403
|
+
'syscall/js.valueDelete': sp => {
|
|
405
404
|
sp >>>= 0;
|
|
406
405
|
Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));
|
|
407
406
|
},
|
|
408
407
|
// func valueIndex(v ref, i int) ref
|
|
409
|
-
|
|
408
|
+
'syscall/js.valueIndex': sp => {
|
|
410
409
|
sp >>>= 0;
|
|
411
410
|
storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));
|
|
412
411
|
},
|
|
413
412
|
// valueSetIndex(v ref, i int, x ref)
|
|
414
|
-
|
|
413
|
+
'syscall/js.valueSetIndex': sp => {
|
|
415
414
|
sp >>>= 0;
|
|
416
415
|
Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));
|
|
417
416
|
},
|
|
418
417
|
// func valueCall(v ref, m string, args []ref) (ref, bool)
|
|
419
|
-
|
|
418
|
+
'syscall/js.valueCall': sp => {
|
|
420
419
|
sp >>>= 0;
|
|
421
420
|
try {
|
|
422
421
|
const v = loadValue(sp + 8);
|
|
@@ -434,7 +433,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
434
433
|
}
|
|
435
434
|
},
|
|
436
435
|
// func valueInvoke(v ref, args []ref) (ref, bool)
|
|
437
|
-
|
|
436
|
+
'syscall/js.valueInvoke': sp => {
|
|
438
437
|
sp >>>= 0;
|
|
439
438
|
try {
|
|
440
439
|
const v = loadValue(sp + 8);
|
|
@@ -451,7 +450,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
451
450
|
}
|
|
452
451
|
},
|
|
453
452
|
// func valueNew(v ref, args []ref) (ref, bool)
|
|
454
|
-
|
|
453
|
+
'syscall/js.valueNew': sp => {
|
|
455
454
|
sp >>>= 0;
|
|
456
455
|
try {
|
|
457
456
|
const v = loadValue(sp + 8);
|
|
@@ -468,30 +467,30 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
468
467
|
}
|
|
469
468
|
},
|
|
470
469
|
// func valueLength(v ref) int
|
|
471
|
-
|
|
470
|
+
'syscall/js.valueLength': sp => {
|
|
472
471
|
sp >>>= 0;
|
|
473
472
|
setInt64(sp + 16, parseInt(loadValue(sp + 8).length));
|
|
474
473
|
},
|
|
475
474
|
// valuePrepareString(v ref) (ref, int)
|
|
476
|
-
|
|
475
|
+
'syscall/js.valuePrepareString': sp => {
|
|
477
476
|
sp >>>= 0;
|
|
478
477
|
const str = encoder.encode(String(loadValue(sp + 8)));
|
|
479
478
|
storeValue(sp + 16, str);
|
|
480
479
|
setInt64(sp + 24, str.length);
|
|
481
480
|
},
|
|
482
481
|
// valueLoadString(v ref, b []byte)
|
|
483
|
-
|
|
482
|
+
'syscall/js.valueLoadString': sp => {
|
|
484
483
|
sp >>>= 0;
|
|
485
484
|
const str = loadValue(sp + 8);
|
|
486
485
|
loadSlice(sp + 16).set(str);
|
|
487
486
|
},
|
|
488
487
|
// func valueInstanceOf(v ref, t ref) bool
|
|
489
|
-
|
|
488
|
+
'syscall/js.valueInstanceOf': sp => {
|
|
490
489
|
sp >>>= 0;
|
|
491
490
|
this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);
|
|
492
491
|
},
|
|
493
492
|
// func copyBytesToGo(dst []byte, src ref) (int, bool)
|
|
494
|
-
|
|
493
|
+
'syscall/js.copyBytesToGo': sp => {
|
|
495
494
|
sp >>>= 0;
|
|
496
495
|
const dst = loadSlice(sp + 8);
|
|
497
496
|
const src = loadValue(sp + 32);
|
|
@@ -505,7 +504,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
505
504
|
this.mem.setUint8(sp + 48, 1);
|
|
506
505
|
},
|
|
507
506
|
// func copyBytesToJS(dst ref, src []byte) (int, bool)
|
|
508
|
-
|
|
507
|
+
'syscall/js.copyBytesToJS': sp => {
|
|
509
508
|
sp >>>= 0;
|
|
510
509
|
const dst = loadValue(sp + 8);
|
|
511
510
|
const src = loadSlice(sp + 16);
|
|
@@ -518,16 +517,16 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
518
517
|
setInt64(sp + 40, toCopy.length);
|
|
519
518
|
this.mem.setUint8(sp + 48, 1);
|
|
520
519
|
},
|
|
521
|
-
debug:
|
|
520
|
+
debug: value => {
|
|
522
521
|
console.log(value);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
525
524
|
};
|
|
526
525
|
}
|
|
527
526
|
run(instance) {
|
|
528
527
|
return __awaiter(this, void 0, void 0, function* () {
|
|
529
528
|
if (!(instance instanceof WebAssembly.Instance)) {
|
|
530
|
-
throw new Error(
|
|
529
|
+
throw new Error('Go.run: WebAssembly.Instance expected');
|
|
531
530
|
}
|
|
532
531
|
this._inst = instance;
|
|
533
532
|
this.mem = new DataView(this._inst.exports.mem.buffer);
|
|
@@ -539,7 +538,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
539
538
|
true,
|
|
540
539
|
false,
|
|
541
540
|
globalThis,
|
|
542
|
-
this
|
|
541
|
+
this
|
|
543
542
|
];
|
|
544
543
|
this._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id
|
|
545
544
|
this._ids = new Map([
|
|
@@ -549,15 +548,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
549
548
|
[true, 3],
|
|
550
549
|
[false, 4],
|
|
551
550
|
[globalThis, 5],
|
|
552
|
-
[this, 6]
|
|
551
|
+
[this, 6]
|
|
553
552
|
]);
|
|
554
553
|
this._idPool = []; // unused ids that have been garbage collected
|
|
555
554
|
this.exited = false; // whether the Go program has exited
|
|
556
555
|
// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.
|
|
557
556
|
let offset = 4096;
|
|
558
|
-
const strPtr =
|
|
557
|
+
const strPtr = str => {
|
|
559
558
|
const ptr = offset;
|
|
560
|
-
const bytes = encoder.encode(str +
|
|
559
|
+
const bytes = encoder.encode(str + '\0');
|
|
561
560
|
new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);
|
|
562
561
|
offset += bytes.length;
|
|
563
562
|
if (offset % 8 !== 0) {
|
|
@@ -567,17 +566,17 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
567
566
|
};
|
|
568
567
|
const argc = this.argv.length;
|
|
569
568
|
const argvPtrs = [];
|
|
570
|
-
this.argv.forEach(
|
|
569
|
+
this.argv.forEach(arg => {
|
|
571
570
|
argvPtrs.push(strPtr(arg));
|
|
572
571
|
});
|
|
573
572
|
argvPtrs.push(0);
|
|
574
573
|
const keys = Object.keys(this.env).sort();
|
|
575
|
-
keys.forEach(
|
|
574
|
+
keys.forEach(key => {
|
|
576
575
|
argvPtrs.push(strPtr(`${key}=${this.env[key]}`));
|
|
577
576
|
});
|
|
578
577
|
argvPtrs.push(0);
|
|
579
578
|
const argv = offset;
|
|
580
|
-
argvPtrs.forEach(
|
|
579
|
+
argvPtrs.forEach(ptr => {
|
|
581
580
|
this.mem.setUint32(offset, ptr, true);
|
|
582
581
|
this.mem.setUint32(offset + 4, 0, true);
|
|
583
582
|
offset += 8;
|
|
@@ -586,7 +585,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
586
585
|
// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
|
|
587
586
|
const wasmMinDataAddr = 4096 + 8192;
|
|
588
587
|
if (offset >= wasmMinDataAddr) {
|
|
589
|
-
throw new Error(
|
|
588
|
+
throw new Error('total length of command line and environment variables exceeds limit');
|
|
590
589
|
}
|
|
591
590
|
this._inst.exports.run(argc, argv);
|
|
592
591
|
if (this.exited) {
|
|
@@ -597,7 +596,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
597
596
|
}
|
|
598
597
|
_resume() {
|
|
599
598
|
if (this.exited) {
|
|
600
|
-
throw new Error(
|
|
599
|
+
throw new Error('Go program has already exited');
|
|
601
600
|
}
|
|
602
601
|
this._inst.exports.resume();
|
|
603
602
|
if (this.exited) {
|
|
@@ -617,8 +616,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
617
616
|
})();
|
|
618
617
|
((function () {
|
|
619
618
|
try {
|
|
620
|
-
if (typeof WebAssembly ===
|
|
621
|
-
typeof WebAssembly.instantiate === "function") {
|
|
619
|
+
if (typeof WebAssembly === 'object' && typeof WebAssembly.instantiate === 'function') {
|
|
622
620
|
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
|
|
623
621
|
if (module instanceof WebAssembly.Module) {
|
|
624
622
|
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
|
|
@@ -628,8 +626,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
628
626
|
catch (e) { }
|
|
629
627
|
return false;
|
|
630
628
|
}))();
|
|
631
|
-
const go = new Go();
|
|
632
|
-
const LCLIB_SEQ_KEY =
|
|
629
|
+
const go = new globalThis.Go();
|
|
630
|
+
const LCLIB_SEQ_KEY = '__LCLIB_WASM_SEQ__';
|
|
633
631
|
if (globalThis[LCLIB_SEQ_KEY] === undefined) {
|
|
634
632
|
globalThis[LCLIB_SEQ_KEY] = 0;
|
|
635
633
|
}
|
|
@@ -646,14 +644,14 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
646
644
|
function load() {
|
|
647
645
|
return new Promise((resolve, reject) => {
|
|
648
646
|
WebAssembly.instantiate(wasm, go.importObject)
|
|
649
|
-
.then(
|
|
647
|
+
.then(result => {
|
|
650
648
|
globalThis.__LCLIB_WASM_CONFIG__ = lclibWasmConfig;
|
|
651
649
|
go.run(result.instance);
|
|
652
650
|
delete globalThis.__LCLIB_WASM_CONFIG__;
|
|
653
651
|
resolve();
|
|
654
652
|
})
|
|
655
|
-
.catch(
|
|
656
|
-
console.error(
|
|
653
|
+
.catch(err => {
|
|
654
|
+
console.error('err:', err);
|
|
657
655
|
reject();
|
|
658
656
|
});
|
|
659
657
|
});
|
package/dist/index.amd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(['exports', './constant/index.amd', './utils/index.amd', './web3/index.amd', './chunks/rpc-
|
|
1
|
+
define(['exports', './constant/index.amd', './utils/index.amd', './web3/index.amd', './chunks/rpc-yDRMApre', './chunks/address-class-Dp7aNQb2', './chunks/tx-type-BeeK7Ci3', 'lodash'], (function (exports, constant, utils, web3, rpc, addressClass, txType, _) { 'use strict';
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
package/dist/index.cjs.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var constant = require('./constant/index.cjs.cjs');
|
|
4
4
|
var utils = require('./utils/index.cjs.cjs');
|
|
5
5
|
var web3 = require('./web3/index.cjs.cjs');
|
|
6
|
-
var rpc = require('./chunks/rpc-
|
|
6
|
+
var rpc = require('./chunks/rpc-CGaI4dy-.cjs');
|
|
7
7
|
require('./chunks/address-class-Cjy48Uqk.cjs');
|
|
8
8
|
require('./chunks/tx-type-jR5Owltc.cjs');
|
|
9
9
|
require('lodash');
|
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AddressClass, Currency, FeeType, GRANT_COST_PER_TX, MaxVMRewardsCount, TxType, TxTypes } from './constant/index.esm.js';
|
|
2
2
|
export { checkAddressType, isAccount, isContract, isSystemToken, isToken, loadLocusWasm, loadLocusWasmSync, txValidator, verifyTxParams } from './utils/index.esm.js';
|
|
3
3
|
export { Account, AccountProvider, HttpRpcProvider, RpcProvider, Web3 } from './web3/index.esm.js';
|
|
4
|
-
export { R as Rpc, T as TX_CREATION_RPC_LIST, c as calculateTxLinkHash, a as compileCoreScript, b as convertAddressToData, d as convertAddressToHex, e as convertBase32ToData, f as convertBase32ToHex, g as convertCurrency, h as convertDataTo, i as convertDataToAddress, j as convertDataToBase32, k as convertDataToHex, l as convertDataToString, m as convertHexToAddress, n as convertHexToBase32, o as convertHexToData, p as convertStringToData, q as convertToData, r as createAccountAndKeystore, s as createMasterKeystore, t as createNormalKey, u as createNormalKeystore, v as decodeTxs, w as deriveKeysFromMnemonic, x as disCompileCoreScript, y as encodeTxCurrency, z as encodeTxNumber, A as generateMnemonic, B as generateMnemonicBySeed, C as getDefFromCoreScript, D as getHomeShard, E as getLibraryVersions, F as gzipAndEncode, G as hash, H as isGrantConsumingTx, I as loadMasterKeystore, J as loadNormalKeystore, K as makeCurrency, L as sign, M as signByMasterKey, N as testCoreScript, O as verify, P as verifyByMasterKey, Q as verifyMerkleProof, S as verifyTx } from './chunks/rpc-
|
|
4
|
+
export { R as Rpc, T as TX_CREATION_RPC_LIST, c as calculateTxLinkHash, a as compileCoreScript, b as convertAddressToData, d as convertAddressToHex, e as convertBase32ToData, f as convertBase32ToHex, g as convertCurrency, h as convertDataTo, i as convertDataToAddress, j as convertDataToBase32, k as convertDataToHex, l as convertDataToString, m as convertHexToAddress, n as convertHexToBase32, o as convertHexToData, p as convertStringToData, q as convertToData, r as createAccountAndKeystore, s as createMasterKeystore, t as createNormalKey, u as createNormalKeystore, v as decodeTxs, w as deriveKeysFromMnemonic, x as disCompileCoreScript, y as encodeTxCurrency, z as encodeTxNumber, A as generateMnemonic, B as generateMnemonicBySeed, C as getDefFromCoreScript, D as getHomeShard, E as getLibraryVersions, F as gzipAndEncode, G as hash, H as isGrantConsumingTx, I as loadMasterKeystore, J as loadNormalKeystore, K as makeCurrency, L as sign, M as signByMasterKey, N as testCoreScript, O as verify, P as verifyByMasterKey, Q as verifyMerkleProof, S as verifyTx } from './chunks/rpc-DfVmqV8B.js';
|
|
5
5
|
import './chunks/address-class-CHAZYhdZ.js';
|
|
6
6
|
import './chunks/tx-type-nyLU5xv5.js';
|
|
7
7
|
import 'lodash';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(['exports', '../utils/index.amd', '../chunks/rpc-
|
|
1
|
+
define(['exports', '../utils/index.amd', '../chunks/rpc-yDRMApre', 'lodash', '../chunks/address-class-Dp7aNQb2'], (function (exports, utils$2, rpc, _, addressClass) { 'use strict';
|
|
2
2
|
|
|
3
3
|
function _interopNamespaceDefault(e) {
|
|
4
4
|
var n = Object.create(null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../utils/index.esm.js';
|
|
2
|
-
import { k as convertDataToHex, m as convertHexToAddress, d as convertAddressToHex, o as convertHexToData, _ as __awaiter } from '../chunks/rpc-
|
|
2
|
+
import { k as convertDataToHex, m as convertHexToAddress, d as convertAddressToHex, o as convertHexToData, _ as __awaiter } from '../chunks/rpc-DfVmqV8B.js';
|
|
3
3
|
import * as _ from 'lodash';
|
|
4
4
|
import '../chunks/address-class-CHAZYhdZ.js';
|
|
5
5
|
|
package/dist/utils/index.amd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(['exports', '../chunks/address-class-Dp7aNQb2', '../chunks/rpc-
|
|
1
|
+
define(['exports', '../chunks/address-class-Dp7aNQb2', '../chunks/rpc-yDRMApre', 'lodash'], (function (exports, addressClass, rpc, _) { 'use strict';
|
|
2
2
|
|
|
3
3
|
class TxValidator {
|
|
4
4
|
constructor() {
|
package/dist/utils/index.cjs.cjs
CHANGED
package/dist/utils/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as AddressClass } from '../chunks/address-class-CHAZYhdZ.js';
|
|
2
|
-
import { S as verifyTx, a as compileCoreScript, U as load, V as loadSync, d as convertAddressToHex } from '../chunks/rpc-
|
|
3
|
-
export { R as Rpc, T as TX_CREATION_RPC_LIST, c as calculateTxLinkHash, b as convertAddressToData, e as convertBase32ToData, f as convertBase32ToHex, g as convertCurrency, h as convertDataTo, i as convertDataToAddress, j as convertDataToBase32, k as convertDataToHex, l as convertDataToString, m as convertHexToAddress, n as convertHexToBase32, o as convertHexToData, p as convertStringToData, q as convertToData, r as createAccountAndKeystore, s as createMasterKeystore, t as createNormalKey, u as createNormalKeystore, v as decodeTxs, w as deriveKeysFromMnemonic, x as disCompileCoreScript, y as encodeTxCurrency, z as encodeTxNumber, A as generateMnemonic, B as generateMnemonicBySeed, C as getDefFromCoreScript, D as getHomeShard, E as getLibraryVersions, F as gzipAndEncode, G as hash, H as isGrantConsumingTx, I as loadMasterKeystore, J as loadNormalKeystore, K as makeCurrency, L as sign, M as signByMasterKey, N as testCoreScript, O as verify, P as verifyByMasterKey, Q as verifyMerkleProof } from '../chunks/rpc-
|
|
2
|
+
import { S as verifyTx, a as compileCoreScript, U as load, V as loadSync, d as convertAddressToHex } from '../chunks/rpc-DfVmqV8B.js';
|
|
3
|
+
export { R as Rpc, T as TX_CREATION_RPC_LIST, c as calculateTxLinkHash, b as convertAddressToData, e as convertBase32ToData, f as convertBase32ToHex, g as convertCurrency, h as convertDataTo, i as convertDataToAddress, j as convertDataToBase32, k as convertDataToHex, l as convertDataToString, m as convertHexToAddress, n as convertHexToBase32, o as convertHexToData, p as convertStringToData, q as convertToData, r as createAccountAndKeystore, s as createMasterKeystore, t as createNormalKey, u as createNormalKeystore, v as decodeTxs, w as deriveKeysFromMnemonic, x as disCompileCoreScript, y as encodeTxCurrency, z as encodeTxNumber, A as generateMnemonic, B as generateMnemonicBySeed, C as getDefFromCoreScript, D as getHomeShard, E as getLibraryVersions, F as gzipAndEncode, G as hash, H as isGrantConsumingTx, I as loadMasterKeystore, J as loadNormalKeystore, K as makeCurrency, L as sign, M as signByMasterKey, N as testCoreScript, O as verify, P as verifyByMasterKey, Q as verifyMerkleProof } from '../chunks/rpc-DfVmqV8B.js';
|
|
4
4
|
import ___default from 'lodash';
|
|
5
5
|
|
|
6
6
|
class TxValidator {
|
package/dist/utils/lclib.d.mts
CHANGED