@quantovainc/qcore 0.2.0 → 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/README.md +33 -9
- package/browser.mjs +5 -3
- package/index.d.ts +63 -51
- package/index.js +5 -3
- package/package.json +2 -2
- package/pkg/package.json +1 -1
- package/pkg/qcore_js.d.ts +11 -3
- package/pkg/qcore_js.js +1 -1
- package/pkg/qcore_js_bg.js +151 -33
- package/pkg/qcore_js_bg.wasm +0 -0
- package/pkg/qcore_js_bg.wasm.d.ts +9 -4
- package/pkg-node/package.json +1 -1
- package/pkg-node/qcore_js.d.ts +11 -3
- package/pkg-node/qcore_js.js +155 -33
- package/pkg-node/qcore_js_bg.wasm +0 -0
- package/shared.js +142 -57
- package/shared.mjs +142 -57
package/pkg/qcore_js_bg.js
CHANGED
|
@@ -195,6 +195,17 @@ export function chainIdFromName(name) {
|
|
|
195
195
|
return BigInt.asUintN(64, ret);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
+
/**
|
|
199
|
+
* @param {bigint} valid_until
|
|
200
|
+
* @param {bigint} head
|
|
201
|
+
*/
|
|
202
|
+
export function checkValidUntil(valid_until, head) {
|
|
203
|
+
const ret = wasm.checkValidUntil(valid_until, head);
|
|
204
|
+
if (ret[1]) {
|
|
205
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
198
209
|
/**
|
|
199
210
|
* @param {string} deployer
|
|
200
211
|
* @param {bigint} nonce
|
|
@@ -237,6 +248,25 @@ export function localChainId() {
|
|
|
237
248
|
return BigInt.asUintN(64, ret);
|
|
238
249
|
}
|
|
239
250
|
|
|
251
|
+
/**
|
|
252
|
+
* @param {string} candidate
|
|
253
|
+
* @param {string[]} known
|
|
254
|
+
* @returns {string | undefined}
|
|
255
|
+
*/
|
|
256
|
+
export function lookalikeOf(candidate, known) {
|
|
257
|
+
const ptr0 = passStringToWasm0(candidate, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
258
|
+
const len0 = WASM_VECTOR_LEN;
|
|
259
|
+
const ptr1 = passArrayJsValueToWasm0(known, wasm.__wbindgen_malloc);
|
|
260
|
+
const len1 = WASM_VECTOR_LEN;
|
|
261
|
+
const ret = wasm.lookalikeOf(ptr0, len0, ptr1, len1);
|
|
262
|
+
let v3;
|
|
263
|
+
if (ret[0] !== 0) {
|
|
264
|
+
v3 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
265
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
266
|
+
}
|
|
267
|
+
return v3;
|
|
268
|
+
}
|
|
269
|
+
|
|
240
270
|
/**
|
|
241
271
|
* @returns {bigint}
|
|
242
272
|
*/
|
|
@@ -418,6 +448,20 @@ export function parseEvents(response) {
|
|
|
418
448
|
}
|
|
419
449
|
}
|
|
420
450
|
|
|
451
|
+
/**
|
|
452
|
+
* @param {string} a
|
|
453
|
+
* @param {string} b
|
|
454
|
+
* @returns {boolean}
|
|
455
|
+
*/
|
|
456
|
+
export function sameAddress(a, b) {
|
|
457
|
+
const ptr0 = passStringToWasm0(a, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
458
|
+
const len0 = WASM_VECTOR_LEN;
|
|
459
|
+
const ptr1 = passStringToWasm0(b, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
460
|
+
const len1 = WASM_VECTOR_LEN;
|
|
461
|
+
const ret = wasm.sameAddress(ptr0, len0, ptr1, len1);
|
|
462
|
+
return ret !== 0;
|
|
463
|
+
}
|
|
464
|
+
|
|
421
465
|
/**
|
|
422
466
|
* @param {bigint} slot
|
|
423
467
|
* @returns {string}
|
|
@@ -461,11 +505,12 @@ export function seedFromMnemonic(phrase) {
|
|
|
461
505
|
* @param {string} fee
|
|
462
506
|
* @param {bigint} chain_id
|
|
463
507
|
* @param {bigint} valid_until
|
|
508
|
+
* @param {string | null} [transfer_fee]
|
|
464
509
|
* @returns {string}
|
|
465
510
|
*/
|
|
466
|
-
export function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, amount, nonce, meter_limit, fee, chain_id, valid_until) {
|
|
467
|
-
let
|
|
468
|
-
let
|
|
511
|
+
export function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, amount, nonce, meter_limit, fee, chain_id, valid_until, transfer_fee) {
|
|
512
|
+
let deferred9_0;
|
|
513
|
+
let deferred9_1;
|
|
469
514
|
try {
|
|
470
515
|
const ptr0 = passStringToWasm0(seed_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
471
516
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -479,18 +524,20 @@ export function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, a
|
|
|
479
524
|
const len4 = WASM_VECTOR_LEN;
|
|
480
525
|
const ptr5 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
481
526
|
const len5 = WASM_VECTOR_LEN;
|
|
482
|
-
|
|
483
|
-
var
|
|
484
|
-
|
|
527
|
+
var ptr6 = isLikeNone(transfer_fee) ? 0 : passStringToWasm0(transfer_fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
528
|
+
var len6 = WASM_VECTOR_LEN;
|
|
529
|
+
const ret = wasm.signAssetCall(ptr0, len0, index, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, nonce, meter_limit, ptr5, len5, chain_id, valid_until, ptr6, len6);
|
|
530
|
+
var ptr8 = ret[0];
|
|
531
|
+
var len8 = ret[1];
|
|
485
532
|
if (ret[3]) {
|
|
486
|
-
|
|
533
|
+
ptr8 = 0; len8 = 0;
|
|
487
534
|
throw takeFromExternrefTable0(ret[2]);
|
|
488
535
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
return getStringFromWasm0(
|
|
536
|
+
deferred9_0 = ptr8;
|
|
537
|
+
deferred9_1 = len8;
|
|
538
|
+
return getStringFromWasm0(ptr8, len8);
|
|
492
539
|
} finally {
|
|
493
|
-
wasm.__wbindgen_free(
|
|
540
|
+
wasm.__wbindgen_free(deferred9_0, deferred9_1, 1);
|
|
494
541
|
}
|
|
495
542
|
}
|
|
496
543
|
|
|
@@ -505,11 +552,12 @@ export function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, a
|
|
|
505
552
|
* @param {string} value
|
|
506
553
|
* @param {bigint} chain_id
|
|
507
554
|
* @param {bigint} valid_until
|
|
555
|
+
* @param {string | null} [transfer_fee]
|
|
508
556
|
* @returns {string}
|
|
509
557
|
*/
|
|
510
|
-
export function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_limit, fee, value, chain_id, valid_until) {
|
|
511
|
-
let
|
|
512
|
-
let
|
|
558
|
+
export function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_limit, fee, value, chain_id, valid_until, transfer_fee) {
|
|
559
|
+
let deferred8_0;
|
|
560
|
+
let deferred8_1;
|
|
513
561
|
try {
|
|
514
562
|
const ptr0 = passStringToWasm0(seed_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
515
563
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -521,18 +569,20 @@ export function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_
|
|
|
521
569
|
const len3 = WASM_VECTOR_LEN;
|
|
522
570
|
const ptr4 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
523
571
|
const len4 = WASM_VECTOR_LEN;
|
|
524
|
-
|
|
525
|
-
var
|
|
526
|
-
|
|
572
|
+
var ptr5 = isLikeNone(transfer_fee) ? 0 : passStringToWasm0(transfer_fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
573
|
+
var len5 = WASM_VECTOR_LEN;
|
|
574
|
+
const ret = wasm.signPayableCall(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, ptr4, len4, chain_id, valid_until, ptr5, len5);
|
|
575
|
+
var ptr7 = ret[0];
|
|
576
|
+
var len7 = ret[1];
|
|
527
577
|
if (ret[3]) {
|
|
528
|
-
|
|
578
|
+
ptr7 = 0; len7 = 0;
|
|
529
579
|
throw takeFromExternrefTable0(ret[2]);
|
|
530
580
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
return getStringFromWasm0(
|
|
581
|
+
deferred8_0 = ptr7;
|
|
582
|
+
deferred8_1 = len7;
|
|
583
|
+
return getStringFromWasm0(ptr7, len7);
|
|
534
584
|
} finally {
|
|
535
|
-
wasm.__wbindgen_free(
|
|
585
|
+
wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
|
|
536
586
|
}
|
|
537
587
|
}
|
|
538
588
|
|
|
@@ -578,11 +628,12 @@ export function signRegister(seed_hex, index, nonce, fee, chain_id, valid_until)
|
|
|
578
628
|
* @param {string} fee
|
|
579
629
|
* @param {bigint} chain_id
|
|
580
630
|
* @param {bigint} valid_until
|
|
631
|
+
* @param {string | null} [transfer_fee]
|
|
581
632
|
* @returns {string}
|
|
582
633
|
*/
|
|
583
|
-
export function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit, fee, chain_id, valid_until) {
|
|
584
|
-
let
|
|
585
|
-
let
|
|
634
|
+
export function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit, fee, chain_id, valid_until, transfer_fee) {
|
|
635
|
+
let deferred7_0;
|
|
636
|
+
let deferred7_1;
|
|
586
637
|
try {
|
|
587
638
|
const ptr0 = passStringToWasm0(seed_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
588
639
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -592,18 +643,20 @@ export function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit,
|
|
|
592
643
|
const len2 = WASM_VECTOR_LEN;
|
|
593
644
|
const ptr3 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
594
645
|
const len3 = WASM_VECTOR_LEN;
|
|
595
|
-
|
|
596
|
-
var
|
|
597
|
-
|
|
646
|
+
var ptr4 = isLikeNone(transfer_fee) ? 0 : passStringToWasm0(transfer_fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
647
|
+
var len4 = WASM_VECTOR_LEN;
|
|
648
|
+
const ret = wasm.sign_call(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, chain_id, valid_until, ptr4, len4);
|
|
649
|
+
var ptr6 = ret[0];
|
|
650
|
+
var len6 = ret[1];
|
|
598
651
|
if (ret[3]) {
|
|
599
|
-
|
|
652
|
+
ptr6 = 0; len6 = 0;
|
|
600
653
|
throw takeFromExternrefTable0(ret[2]);
|
|
601
654
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
return getStringFromWasm0(
|
|
655
|
+
deferred7_0 = ptr6;
|
|
656
|
+
deferred7_1 = len6;
|
|
657
|
+
return getStringFromWasm0(ptr6, len6);
|
|
605
658
|
} finally {
|
|
606
|
-
wasm.__wbindgen_free(
|
|
659
|
+
wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
|
|
607
660
|
}
|
|
608
661
|
}
|
|
609
662
|
|
|
@@ -788,6 +841,32 @@ export function valid_address(address) {
|
|
|
788
841
|
return ret !== 0;
|
|
789
842
|
}
|
|
790
843
|
|
|
844
|
+
/**
|
|
845
|
+
* @param {string} transfer_fee
|
|
846
|
+
* @param {bigint} meter_limit
|
|
847
|
+
* @returns {string}
|
|
848
|
+
*/
|
|
849
|
+
export function vmCallFee(transfer_fee, meter_limit) {
|
|
850
|
+
let deferred3_0;
|
|
851
|
+
let deferred3_1;
|
|
852
|
+
try {
|
|
853
|
+
const ptr0 = passStringToWasm0(transfer_fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
854
|
+
const len0 = WASM_VECTOR_LEN;
|
|
855
|
+
const ret = wasm.vmCallFee(ptr0, len0, meter_limit);
|
|
856
|
+
var ptr2 = ret[0];
|
|
857
|
+
var len2 = ret[1];
|
|
858
|
+
if (ret[3]) {
|
|
859
|
+
ptr2 = 0; len2 = 0;
|
|
860
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
861
|
+
}
|
|
862
|
+
deferred3_0 = ptr2;
|
|
863
|
+
deferred3_1 = len2;
|
|
864
|
+
return getStringFromWasm0(ptr2, len2);
|
|
865
|
+
} finally {
|
|
866
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
791
870
|
/**
|
|
792
871
|
* @returns {string}
|
|
793
872
|
*/
|
|
@@ -807,6 +886,17 @@ export function __wbg_Error_92b29b0548f8b746(arg0, arg1) {
|
|
|
807
886
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
808
887
|
return ret;
|
|
809
888
|
}
|
|
889
|
+
export function __wbg___wbindgen_string_get_b0ca35b86a603356(arg0, arg1) {
|
|
890
|
+
const obj = arg1;
|
|
891
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
892
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
893
|
+
var len1 = WASM_VECTOR_LEN;
|
|
894
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
895
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
896
|
+
}
|
|
897
|
+
export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
|
|
898
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
899
|
+
}
|
|
810
900
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
811
901
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
812
902
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
@@ -821,6 +911,20 @@ export function __wbindgen_init_externref_table() {
|
|
|
821
911
|
table.set(offset + 2, true);
|
|
822
912
|
table.set(offset + 3, false);
|
|
823
913
|
}
|
|
914
|
+
function addToExternrefTable0(obj) {
|
|
915
|
+
const idx = wasm.__externref_table_alloc();
|
|
916
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
917
|
+
return idx;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
let cachedDataViewMemory0 = null;
|
|
921
|
+
function getDataViewMemory0() {
|
|
922
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
923
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
924
|
+
}
|
|
925
|
+
return cachedDataViewMemory0;
|
|
926
|
+
}
|
|
927
|
+
|
|
824
928
|
function getStringFromWasm0(ptr, len) {
|
|
825
929
|
return decodeText(ptr >>> 0, len);
|
|
826
930
|
}
|
|
@@ -833,6 +937,20 @@ function getUint8ArrayMemory0() {
|
|
|
833
937
|
return cachedUint8ArrayMemory0;
|
|
834
938
|
}
|
|
835
939
|
|
|
940
|
+
function isLikeNone(x) {
|
|
941
|
+
return x === undefined || x === null;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
945
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
946
|
+
for (let i = 0; i < array.length; i++) {
|
|
947
|
+
const add = addToExternrefTable0(array[i]);
|
|
948
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
949
|
+
}
|
|
950
|
+
WASM_VECTOR_LEN = array.length;
|
|
951
|
+
return ptr;
|
|
952
|
+
}
|
|
953
|
+
|
|
836
954
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
837
955
|
if (realloc === undefined) {
|
|
838
956
|
const buf = cachedTextEncoder.encode(arg);
|
package/pkg/qcore_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -9,9 +9,11 @@ export const block_by_height_body: (a: bigint) => [number, number];
|
|
|
9
9
|
export const buildSignedOrderCall: (a: bigint, b: number, c: number, d: number, e: number, f: bigint, g: bigint, h: number, i: number, j: number, k: number, l: bigint, m: number, n: number, o: bigint, p: bigint) => [number, number, number, number];
|
|
10
10
|
export const buildTypedOrderCall: (a: bigint, b: number, c: number, d: number, e: number, f: bigint, g: bigint, h: bigint, i: number, j: number, k: number, l: number, m: bigint, n: bigint) => [number, number, number, number];
|
|
11
11
|
export const chainIdFromName: (a: number, b: number) => bigint;
|
|
12
|
+
export const checkValidUntil: (a: bigint, b: bigint) => [number, number];
|
|
12
13
|
export const contractAddress: (a: number, b: number, c: bigint) => [number, number];
|
|
13
14
|
export const eventsBody: (a: bigint) => [number, number];
|
|
14
15
|
export const localChainId: () => bigint;
|
|
16
|
+
export const lookalikeOf: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
17
|
export const mainnetChainId: () => bigint;
|
|
16
18
|
export const mapAddrWordKey: (a: bigint, b: number, c: number, d: bigint) => [number, number, number, number];
|
|
17
19
|
export const mapSlotKey: (a: bigint, b: number, c: number) => [number, number, number, number];
|
|
@@ -21,12 +23,13 @@ export const nonceSlotKey: (a: number, b: number) => [number, number, number, nu
|
|
|
21
23
|
export const orderSigner: (a: number, b: number, c: bigint) => [number, number, number, number];
|
|
22
24
|
export const packSymbol: (a: number, b: number) => bigint;
|
|
23
25
|
export const parseEvents: (a: number, b: number) => [number, number, number, number];
|
|
26
|
+
export const sameAddress: (a: number, b: number, c: number, d: number) => number;
|
|
24
27
|
export const scalarSlotKey: (a: bigint) => [number, number];
|
|
25
28
|
export const seedFromMnemonic: (a: number, b: number) => [number, number, number];
|
|
26
|
-
export const signAssetCall: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: bigint, m: bigint, n: number, o: number, p: bigint, q: bigint) => [number, number, number, number];
|
|
27
|
-
export const signPayableCall: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: bigint, i: bigint, j: number, k: number, l: number, m: number, n: bigint, o: bigint) => [number, number, number, number];
|
|
29
|
+
export const signAssetCall: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: bigint, m: bigint, n: number, o: number, p: bigint, q: bigint, r: number, s: number) => [number, number, number, number];
|
|
30
|
+
export const signPayableCall: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: bigint, i: bigint, j: number, k: number, l: number, m: number, n: bigint, o: bigint, p: number, q: number) => [number, number, number, number];
|
|
28
31
|
export const signRegister: (a: number, b: number, c: bigint, d: bigint, e: number, f: number, g: bigint, h: bigint) => [number, number, number, number];
|
|
29
|
-
export const sign_call: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: bigint, i: bigint, j: number, k: number, l: bigint, m: bigint) => [number, number, number, number];
|
|
32
|
+
export const sign_call: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: bigint, i: bigint, j: number, k: number, l: bigint, m: bigint, n: number, o: number) => [number, number, number, number];
|
|
30
33
|
export const sign_transfer: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: bigint, i: number, j: number, k: bigint, l: bigint) => [number, number, number, number];
|
|
31
34
|
export const storageBody: (a: number, b: number) => [number, number];
|
|
32
35
|
export const storageValue: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
@@ -37,10 +40,12 @@ export const tokenSymbolSlot: () => bigint;
|
|
|
37
40
|
export const transaction_body: (a: number, b: number) => [number, number];
|
|
38
41
|
export const unpackSymbol: (a: bigint) => [number, number];
|
|
39
42
|
export const valid_address: (a: number, b: number) => number;
|
|
43
|
+
export const vmCallFee: (a: number, b: number, c: bigint) => [number, number, number, number];
|
|
40
44
|
export const vmDeployAddress: () => [number, number];
|
|
41
|
-
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
42
45
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
43
46
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
47
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
44
48
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
45
49
|
export const __externref_table_dealloc: (a: number) => void;
|
|
50
|
+
export const __externref_table_alloc: () => number;
|
|
46
51
|
export const __wbindgen_start: () => void;
|
package/pkg-node/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qcore-js",
|
|
3
3
|
"description": "The JavaScript binding for the Quantova client core, generated over QCore with wasm-bindgen. The core does the key derivation, the post quantum signing, and the wire, the page does the fetch.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
package/pkg-node/qcore_js.d.ts
CHANGED
|
@@ -17,12 +17,16 @@ export function buildTypedOrderCall(chain_id: bigint, contract: string, selector
|
|
|
17
17
|
|
|
18
18
|
export function chainIdFromName(name: string): bigint;
|
|
19
19
|
|
|
20
|
+
export function checkValidUntil(valid_until: bigint, head: bigint): void;
|
|
21
|
+
|
|
20
22
|
export function contractAddress(deployer: string, nonce: bigint): string | undefined;
|
|
21
23
|
|
|
22
24
|
export function eventsBody(height: bigint): string;
|
|
23
25
|
|
|
24
26
|
export function localChainId(): bigint;
|
|
25
27
|
|
|
28
|
+
export function lookalikeOf(candidate: string, known: string[]): string | undefined;
|
|
29
|
+
|
|
26
30
|
export function mainnetChainId(): bigint;
|
|
27
31
|
|
|
28
32
|
export function mapAddrWordKey(map_domain_tag: bigint, key32_hex: string, word: bigint): string;
|
|
@@ -41,17 +45,19 @@ export function packSymbol(symbol: string): bigint;
|
|
|
41
45
|
|
|
42
46
|
export function parseEvents(response: string): string;
|
|
43
47
|
|
|
48
|
+
export function sameAddress(a: string, b: string): boolean;
|
|
49
|
+
|
|
44
50
|
export function scalarSlotKey(slot: bigint): string;
|
|
45
51
|
|
|
46
52
|
export function seedFromMnemonic(phrase: string): any;
|
|
47
53
|
|
|
48
|
-
export function signAssetCall(seed_hex: string, index: bigint, target: string, args_hex: string, asset_issuer: string, amount: string, nonce: bigint, meter_limit: bigint, fee: string, chain_id: bigint, valid_until: bigint): string;
|
|
54
|
+
export function signAssetCall(seed_hex: string, index: bigint, target: string, args_hex: string, asset_issuer: string, amount: string, nonce: bigint, meter_limit: bigint, fee: string, chain_id: bigint, valid_until: bigint, transfer_fee?: string | null): string;
|
|
49
55
|
|
|
50
|
-
export function signPayableCall(seed_hex: string, index: bigint, target: string, args_hex: string, nonce: bigint, meter_limit: bigint, fee: string, value: string, chain_id: bigint, valid_until: bigint): string;
|
|
56
|
+
export function signPayableCall(seed_hex: string, index: bigint, target: string, args_hex: string, nonce: bigint, meter_limit: bigint, fee: string, value: string, chain_id: bigint, valid_until: bigint, transfer_fee?: string | null): string;
|
|
51
57
|
|
|
52
58
|
export function signRegister(seed_hex: string, index: bigint, nonce: bigint, fee: string, chain_id: bigint, valid_until: bigint): string;
|
|
53
59
|
|
|
54
|
-
export function sign_call(seed_hex: string, index: bigint, target: string, args_hex: string, nonce: bigint, meter_limit: bigint, fee: string, chain_id: bigint, valid_until: bigint): string;
|
|
60
|
+
export function sign_call(seed_hex: string, index: bigint, target: string, args_hex: string, nonce: bigint, meter_limit: bigint, fee: string, chain_id: bigint, valid_until: bigint, transfer_fee?: string | null): string;
|
|
55
61
|
|
|
56
62
|
export function sign_transfer(seed_hex: string, index: bigint, to: string, amount: string, nonce: bigint, fee: string, chain_id: bigint, valid_until: bigint): string;
|
|
57
63
|
|
|
@@ -73,4 +79,6 @@ export function unpackSymbol(word: bigint): string;
|
|
|
73
79
|
|
|
74
80
|
export function valid_address(address: string): boolean;
|
|
75
81
|
|
|
82
|
+
export function vmCallFee(transfer_fee: string, meter_limit: bigint): string;
|
|
83
|
+
|
|
76
84
|
export function vmDeployAddress(): string;
|