@quantovainc/qcore 0.1.31 → 0.1.32
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/browser.mjs +2 -2
- package/index.d.ts +21 -3
- package/index.js +2 -2
- package/package.json +3 -2
- package/pkg/qcore_js.d.ts +7 -7
- package/pkg/qcore_js_bg.js +34 -46
- package/pkg/qcore_js_bg.wasm +0 -0
- package/pkg/qcore_js_bg.wasm.d.ts +7 -7
- package/pkg-node/qcore_js.d.ts +7 -7
- package/pkg-node/qcore_js.js +34 -46
- package/pkg-node/qcore_js_bg.wasm +0 -0
- package/shared.js +141 -63
- package/shared.mjs +546 -0
package/browser.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
3
3
|
|
|
4
4
|
import * as core from './pkg/qcore_js.js';
|
|
5
|
-
import { makeClient, generateSeed, Network } from './shared.
|
|
5
|
+
import { makeClient, generateSeed, validUntil, Network } from './shared.mjs';
|
|
6
6
|
|
|
7
7
|
const Client = makeClient(core);
|
|
8
8
|
|
|
9
|
-
export { Client, core, generateSeed, Network };
|
|
9
|
+
export { Client, core, generateSeed, validUntil, Network };
|
package/index.d.ts
CHANGED
|
@@ -104,6 +104,7 @@ export interface QCore {
|
|
|
104
104
|
fee: string,
|
|
105
105
|
value: string,
|
|
106
106
|
chain_id: bigint,
|
|
107
|
+
valid_until: bigint,
|
|
107
108
|
): string;
|
|
108
109
|
signAssetCall(
|
|
109
110
|
seed_hex: string,
|
|
@@ -116,8 +117,16 @@ export interface QCore {
|
|
|
116
117
|
meter_limit: bigint,
|
|
117
118
|
fee: string,
|
|
118
119
|
chain_id: bigint,
|
|
120
|
+
valid_until: bigint,
|
|
121
|
+
): string;
|
|
122
|
+
signRegister(
|
|
123
|
+
seed_hex: string,
|
|
124
|
+
index: bigint,
|
|
125
|
+
nonce: bigint,
|
|
126
|
+
fee: string,
|
|
127
|
+
chain_id: bigint,
|
|
128
|
+
valid_until: bigint,
|
|
119
129
|
): string;
|
|
120
|
-
signRegister(seed_hex: string, index: bigint, nonce: bigint, fee: string, chain_id: bigint): string;
|
|
121
130
|
sign_call(
|
|
122
131
|
seed_hex: string,
|
|
123
132
|
index: bigint,
|
|
@@ -127,6 +136,7 @@ export interface QCore {
|
|
|
127
136
|
meter_limit: bigint,
|
|
128
137
|
fee: string,
|
|
129
138
|
chain_id: bigint,
|
|
139
|
+
valid_until: bigint,
|
|
130
140
|
): string;
|
|
131
141
|
sign_transfer(
|
|
132
142
|
seed_hex: string,
|
|
@@ -136,6 +146,7 @@ export interface QCore {
|
|
|
136
146
|
nonce: bigint,
|
|
137
147
|
fee: string,
|
|
138
148
|
chain_id: bigint,
|
|
149
|
+
valid_until: bigint,
|
|
139
150
|
): string;
|
|
140
151
|
storageBody(contract: string): string;
|
|
141
152
|
storageValue(response: string, slot_key_hex: string): string;
|
|
@@ -162,7 +173,6 @@ export class Network {
|
|
|
162
173
|
export interface ClientOptions {
|
|
163
174
|
acknowledgeMainnet?: boolean;
|
|
164
175
|
network?: Network;
|
|
165
|
-
/** Bind signatures to this chain name; a gateway reporting any other is refused. */
|
|
166
176
|
expectedChainId?: string;
|
|
167
177
|
}
|
|
168
178
|
|
|
@@ -185,11 +195,13 @@ export class Client {
|
|
|
185
195
|
to: string,
|
|
186
196
|
amount: string | bigint,
|
|
187
197
|
maxFeeQuon: string | bigint,
|
|
198
|
+
expectedNonce?: bigint | number | string,
|
|
188
199
|
): Promise<TransferResult>;
|
|
189
200
|
register(
|
|
190
201
|
seedHex: string,
|
|
191
202
|
index: number,
|
|
192
203
|
maxFeeQuon: string | bigint,
|
|
204
|
+
expectedNonce?: bigint | number | string,
|
|
193
205
|
): Promise<TransferResult>;
|
|
194
206
|
call(
|
|
195
207
|
seedHex: string,
|
|
@@ -198,6 +210,7 @@ export class Client {
|
|
|
198
210
|
argsHex: string,
|
|
199
211
|
meterLimit: number | bigint,
|
|
200
212
|
maxFeeQuon: string | bigint,
|
|
213
|
+
expectedNonce?: bigint | number | string,
|
|
201
214
|
): Promise<TransferResult>;
|
|
202
215
|
assetCall(
|
|
203
216
|
seedHex: string,
|
|
@@ -208,6 +221,7 @@ export class Client {
|
|
|
208
221
|
amount: string | bigint,
|
|
209
222
|
meterLimit: number | bigint,
|
|
210
223
|
maxFeeQuon: string | bigint,
|
|
224
|
+
expectedNonce?: bigint | number | string,
|
|
211
225
|
): Promise<TransferResult>;
|
|
212
226
|
payableCall(
|
|
213
227
|
seedHex: string,
|
|
@@ -217,6 +231,7 @@ export class Client {
|
|
|
217
231
|
value: string | bigint,
|
|
218
232
|
meterLimit: number | bigint,
|
|
219
233
|
maxFeeQuon: string | bigint,
|
|
234
|
+
expectedNonce?: bigint | number | string,
|
|
220
235
|
): Promise<TransferResult>;
|
|
221
236
|
contractNonce(contract: string, signerHex: string): Promise<bigint>;
|
|
222
237
|
contractScalar(contract: string, slot: number | bigint): Promise<bigint>;
|
|
@@ -230,10 +245,13 @@ export class Client {
|
|
|
230
245
|
ownerIndex: number,
|
|
231
246
|
meterLimit: number | bigint,
|
|
232
247
|
maxFeeQuon: string | bigint,
|
|
233
|
-
expectedOrderNonce?: bigint | number | string
|
|
248
|
+
expectedOrderNonce?: bigint | number | string,
|
|
249
|
+
expectedNonce?: bigint | number | string,
|
|
234
250
|
): Promise<SignedOrderResult>;
|
|
235
251
|
}
|
|
236
252
|
|
|
237
253
|
export const core: QCore;
|
|
238
254
|
|
|
239
255
|
export function generateSeed(): string;
|
|
256
|
+
|
|
257
|
+
export function validUntil(nodeInfo: { head_height?: number | string | bigint }): bigint;
|
package/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
3
3
|
|
|
4
4
|
const core = require('./pkg-node/qcore_js.js');
|
|
5
|
-
const { makeClient, generateSeed, Network } = require('./shared.js');
|
|
5
|
+
const { makeClient, generateSeed, validUntil, Network } = require('./shared.js');
|
|
6
6
|
|
|
7
7
|
const Client = makeClient(core);
|
|
8
8
|
|
|
9
|
-
module.exports = { Client, core, generateSeed, Network };
|
|
9
|
+
module.exports = { Client, core, generateSeed, validUntil, Network };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantovainc/qcore",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"description": "Quantova's post quantum client core for JavaScript. Signs with ML-DSA-65 and builds Q1 addresses.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "bash scripts/build.sh",
|
|
7
|
-
"test": "node test-types.js && node test-conformance.js && node test-order-nonce.js && node test-chain-binding.js && node test-sign-validate.js && node test-transport.js && node test-fee-cap.js && node test-network.js"
|
|
7
|
+
"test": "node test-types.js && node test-conformance.js && node test-order-nonce.js && node test-chain-binding.js && node test-sign-validate.js && node test-transport.js && node test-fee-cap.js && node test-network.js && node test-typed-order.js && node test-asset-guards.js"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [
|
|
10
10
|
"post-quantum",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"index.js",
|
|
67
67
|
"browser.mjs",
|
|
68
68
|
"shared.js",
|
|
69
|
+
"shared.mjs",
|
|
69
70
|
"index.d.ts",
|
|
70
71
|
"pkg-node/qcore_js.js",
|
|
71
72
|
"pkg-node/qcore_js_bg.wasm",
|
package/pkg/qcore_js.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export function mapAddrWordKey(map_domain_tag: bigint, key32_hex: string, word:
|
|
|
29
29
|
|
|
30
30
|
export function mapSlotKey(map_domain_tag: bigint, key_address_hex: string): string;
|
|
31
31
|
|
|
32
|
-
export function mnemonicFromSeed(seed_hex: string):
|
|
32
|
+
export function mnemonicFromSeed(seed_hex: string): any;
|
|
33
33
|
|
|
34
34
|
export function nameKey(label: string): string;
|
|
35
35
|
|
|
@@ -43,17 +43,17 @@ export function parseEvents(response: string): string;
|
|
|
43
43
|
|
|
44
44
|
export function scalarSlotKey(slot: bigint): string;
|
|
45
45
|
|
|
46
|
-
export function seedFromMnemonic(phrase: string):
|
|
46
|
+
export function seedFromMnemonic(phrase: string): any;
|
|
47
47
|
|
|
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): string;
|
|
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;
|
|
49
49
|
|
|
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): string;
|
|
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;
|
|
51
51
|
|
|
52
|
-
export function signRegister(seed_hex: string, index: bigint, nonce: bigint, fee: string, chain_id: bigint): string;
|
|
52
|
+
export function signRegister(seed_hex: string, index: bigint, nonce: bigint, fee: string, chain_id: bigint, valid_until: bigint): string;
|
|
53
53
|
|
|
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): string;
|
|
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;
|
|
55
55
|
|
|
56
|
-
export function sign_transfer(seed_hex: string, index: bigint, to: string, amount: string, nonce: bigint, fee: string, chain_id: bigint): string;
|
|
56
|
+
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
57
|
|
|
58
58
|
export function storageBody(contract: string): string;
|
|
59
59
|
|
package/pkg/qcore_js_bg.js
CHANGED
|
@@ -300,27 +300,16 @@ export function mapSlotKey(map_domain_tag, key_address_hex) {
|
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
302
|
* @param {string} seed_hex
|
|
303
|
-
* @returns {
|
|
303
|
+
* @returns {any}
|
|
304
304
|
*/
|
|
305
305
|
export function mnemonicFromSeed(seed_hex) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const ret = wasm.mnemonicFromSeed(ptr0, len0);
|
|
312
|
-
var ptr2 = ret[0];
|
|
313
|
-
var len2 = ret[1];
|
|
314
|
-
if (ret[3]) {
|
|
315
|
-
ptr2 = 0; len2 = 0;
|
|
316
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
317
|
-
}
|
|
318
|
-
deferred3_0 = ptr2;
|
|
319
|
-
deferred3_1 = len2;
|
|
320
|
-
return getStringFromWasm0(ptr2, len2);
|
|
321
|
-
} finally {
|
|
322
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
306
|
+
const ptr0 = passStringToWasm0(seed_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
307
|
+
const len0 = WASM_VECTOR_LEN;
|
|
308
|
+
const ret = wasm.mnemonicFromSeed(ptr0, len0);
|
|
309
|
+
if (ret[2]) {
|
|
310
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
323
311
|
}
|
|
312
|
+
return takeFromExternrefTable0(ret[0]);
|
|
324
313
|
}
|
|
325
314
|
|
|
326
315
|
/**
|
|
@@ -448,27 +437,16 @@ export function scalarSlotKey(slot) {
|
|
|
448
437
|
|
|
449
438
|
/**
|
|
450
439
|
* @param {string} phrase
|
|
451
|
-
* @returns {
|
|
440
|
+
* @returns {any}
|
|
452
441
|
*/
|
|
453
442
|
export function seedFromMnemonic(phrase) {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
const ret = wasm.seedFromMnemonic(ptr0, len0);
|
|
460
|
-
var ptr2 = ret[0];
|
|
461
|
-
var len2 = ret[1];
|
|
462
|
-
if (ret[3]) {
|
|
463
|
-
ptr2 = 0; len2 = 0;
|
|
464
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
465
|
-
}
|
|
466
|
-
deferred3_0 = ptr2;
|
|
467
|
-
deferred3_1 = len2;
|
|
468
|
-
return getStringFromWasm0(ptr2, len2);
|
|
469
|
-
} finally {
|
|
470
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
443
|
+
const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
444
|
+
const len0 = WASM_VECTOR_LEN;
|
|
445
|
+
const ret = wasm.seedFromMnemonic(ptr0, len0);
|
|
446
|
+
if (ret[2]) {
|
|
447
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
471
448
|
}
|
|
449
|
+
return takeFromExternrefTable0(ret[0]);
|
|
472
450
|
}
|
|
473
451
|
|
|
474
452
|
/**
|
|
@@ -482,9 +460,10 @@ export function seedFromMnemonic(phrase) {
|
|
|
482
460
|
* @param {bigint} meter_limit
|
|
483
461
|
* @param {string} fee
|
|
484
462
|
* @param {bigint} chain_id
|
|
463
|
+
* @param {bigint} valid_until
|
|
485
464
|
* @returns {string}
|
|
486
465
|
*/
|
|
487
|
-
export function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, amount, nonce, meter_limit, fee, chain_id) {
|
|
466
|
+
export function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, amount, nonce, meter_limit, fee, chain_id, valid_until) {
|
|
488
467
|
let deferred8_0;
|
|
489
468
|
let deferred8_1;
|
|
490
469
|
try {
|
|
@@ -500,7 +479,7 @@ export function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, a
|
|
|
500
479
|
const len4 = WASM_VECTOR_LEN;
|
|
501
480
|
const ptr5 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
502
481
|
const len5 = WASM_VECTOR_LEN;
|
|
503
|
-
const ret = wasm.signAssetCall(ptr0, len0, index, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, nonce, meter_limit, ptr5, len5, chain_id);
|
|
482
|
+
const ret = wasm.signAssetCall(ptr0, len0, index, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, nonce, meter_limit, ptr5, len5, chain_id, valid_until);
|
|
504
483
|
var ptr7 = ret[0];
|
|
505
484
|
var len7 = ret[1];
|
|
506
485
|
if (ret[3]) {
|
|
@@ -525,9 +504,10 @@ export function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, a
|
|
|
525
504
|
* @param {string} fee
|
|
526
505
|
* @param {string} value
|
|
527
506
|
* @param {bigint} chain_id
|
|
507
|
+
* @param {bigint} valid_until
|
|
528
508
|
* @returns {string}
|
|
529
509
|
*/
|
|
530
|
-
export function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_limit, fee, value, chain_id) {
|
|
510
|
+
export function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_limit, fee, value, chain_id, valid_until) {
|
|
531
511
|
let deferred7_0;
|
|
532
512
|
let deferred7_1;
|
|
533
513
|
try {
|
|
@@ -541,7 +521,7 @@ export function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_
|
|
|
541
521
|
const len3 = WASM_VECTOR_LEN;
|
|
542
522
|
const ptr4 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
543
523
|
const len4 = WASM_VECTOR_LEN;
|
|
544
|
-
const ret = wasm.signPayableCall(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, ptr4, len4, chain_id);
|
|
524
|
+
const ret = wasm.signPayableCall(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, ptr4, len4, chain_id, valid_until);
|
|
545
525
|
var ptr6 = ret[0];
|
|
546
526
|
var len6 = ret[1];
|
|
547
527
|
if (ret[3]) {
|
|
@@ -562,9 +542,10 @@ export function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_
|
|
|
562
542
|
* @param {bigint} nonce
|
|
563
543
|
* @param {string} fee
|
|
564
544
|
* @param {bigint} chain_id
|
|
545
|
+
* @param {bigint} valid_until
|
|
565
546
|
* @returns {string}
|
|
566
547
|
*/
|
|
567
|
-
export function signRegister(seed_hex, index, nonce, fee, chain_id) {
|
|
548
|
+
export function signRegister(seed_hex, index, nonce, fee, chain_id, valid_until) {
|
|
568
549
|
let deferred4_0;
|
|
569
550
|
let deferred4_1;
|
|
570
551
|
try {
|
|
@@ -572,7 +553,7 @@ export function signRegister(seed_hex, index, nonce, fee, chain_id) {
|
|
|
572
553
|
const len0 = WASM_VECTOR_LEN;
|
|
573
554
|
const ptr1 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
574
555
|
const len1 = WASM_VECTOR_LEN;
|
|
575
|
-
const ret = wasm.signRegister(ptr0, len0, index, nonce, ptr1, len1, chain_id);
|
|
556
|
+
const ret = wasm.signRegister(ptr0, len0, index, nonce, ptr1, len1, chain_id, valid_until);
|
|
576
557
|
var ptr3 = ret[0];
|
|
577
558
|
var len3 = ret[1];
|
|
578
559
|
if (ret[3]) {
|
|
@@ -596,9 +577,10 @@ export function signRegister(seed_hex, index, nonce, fee, chain_id) {
|
|
|
596
577
|
* @param {bigint} meter_limit
|
|
597
578
|
* @param {string} fee
|
|
598
579
|
* @param {bigint} chain_id
|
|
580
|
+
* @param {bigint} valid_until
|
|
599
581
|
* @returns {string}
|
|
600
582
|
*/
|
|
601
|
-
export function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit, fee, chain_id) {
|
|
583
|
+
export function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit, fee, chain_id, valid_until) {
|
|
602
584
|
let deferred6_0;
|
|
603
585
|
let deferred6_1;
|
|
604
586
|
try {
|
|
@@ -610,7 +592,7 @@ export function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit,
|
|
|
610
592
|
const len2 = WASM_VECTOR_LEN;
|
|
611
593
|
const ptr3 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
612
594
|
const len3 = WASM_VECTOR_LEN;
|
|
613
|
-
const ret = wasm.sign_call(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, chain_id);
|
|
595
|
+
const ret = wasm.sign_call(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, chain_id, valid_until);
|
|
614
596
|
var ptr5 = ret[0];
|
|
615
597
|
var len5 = ret[1];
|
|
616
598
|
if (ret[3]) {
|
|
@@ -633,9 +615,10 @@ export function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit,
|
|
|
633
615
|
* @param {bigint} nonce
|
|
634
616
|
* @param {string} fee
|
|
635
617
|
* @param {bigint} chain_id
|
|
618
|
+
* @param {bigint} valid_until
|
|
636
619
|
* @returns {string}
|
|
637
620
|
*/
|
|
638
|
-
export function sign_transfer(seed_hex, index, to, amount, nonce, fee, chain_id) {
|
|
621
|
+
export function sign_transfer(seed_hex, index, to, amount, nonce, fee, chain_id, valid_until) {
|
|
639
622
|
let deferred6_0;
|
|
640
623
|
let deferred6_1;
|
|
641
624
|
try {
|
|
@@ -647,7 +630,7 @@ export function sign_transfer(seed_hex, index, to, amount, nonce, fee, chain_id)
|
|
|
647
630
|
const len2 = WASM_VECTOR_LEN;
|
|
648
631
|
const ptr3 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
649
632
|
const len3 = WASM_VECTOR_LEN;
|
|
650
|
-
const ret = wasm.sign_transfer(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, ptr3, len3, chain_id);
|
|
633
|
+
const ret = wasm.sign_transfer(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, ptr3, len3, chain_id, valid_until);
|
|
651
634
|
var ptr5 = ret[0];
|
|
652
635
|
var len5 = ret[1];
|
|
653
636
|
if (ret[3]) {
|
|
@@ -824,6 +807,11 @@ export function __wbg_Error_92b29b0548f8b746(arg0, arg1) {
|
|
|
824
807
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
825
808
|
return ret;
|
|
826
809
|
}
|
|
810
|
+
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
811
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
812
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
813
|
+
return ret;
|
|
814
|
+
}
|
|
827
815
|
export function __wbindgen_init_externref_table() {
|
|
828
816
|
const table = wasm.__wbindgen_externrefs;
|
|
829
817
|
const offset = table.grow(4);
|
package/pkg/qcore_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -15,19 +15,19 @@ export const localChainId: () => bigint;
|
|
|
15
15
|
export const mainnetChainId: () => bigint;
|
|
16
16
|
export const mapAddrWordKey: (a: bigint, b: number, c: number, d: bigint) => [number, number, number, number];
|
|
17
17
|
export const mapSlotKey: (a: bigint, b: number, c: number) => [number, number, number, number];
|
|
18
|
-
export const mnemonicFromSeed: (a: number, b: number) => [number, number, number
|
|
18
|
+
export const mnemonicFromSeed: (a: number, b: number) => [number, number, number];
|
|
19
19
|
export const nameKey: (a: number, b: number) => [number, number];
|
|
20
20
|
export const nonceSlotKey: (a: number, b: number) => [number, number, number, number];
|
|
21
21
|
export const orderSigner: (a: number, b: number, c: bigint) => [number, number, number, number];
|
|
22
22
|
export const packSymbol: (a: number, b: number) => bigint;
|
|
23
23
|
export const parseEvents: (a: number, b: number) => [number, number, number, number];
|
|
24
24
|
export const scalarSlotKey: (a: bigint) => [number, number];
|
|
25
|
-
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) => [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) => [number, number, number, number];
|
|
28
|
-
export const signRegister: (a: number, b: number, c: bigint, d: bigint, e: number, f: number, g: 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) => [number, number, number, number];
|
|
30
|
-
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) => [number, number, number, number];
|
|
25
|
+
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];
|
|
28
|
+
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];
|
|
30
|
+
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
31
|
export const storageBody: (a: number, b: number) => [number, number];
|
|
32
32
|
export const storageValue: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
33
33
|
export const submit_body: (a: number, b: number) => [number, number, number, number];
|
package/pkg-node/qcore_js.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export function mapAddrWordKey(map_domain_tag: bigint, key32_hex: string, word:
|
|
|
29
29
|
|
|
30
30
|
export function mapSlotKey(map_domain_tag: bigint, key_address_hex: string): string;
|
|
31
31
|
|
|
32
|
-
export function mnemonicFromSeed(seed_hex: string):
|
|
32
|
+
export function mnemonicFromSeed(seed_hex: string): any;
|
|
33
33
|
|
|
34
34
|
export function nameKey(label: string): string;
|
|
35
35
|
|
|
@@ -43,17 +43,17 @@ export function parseEvents(response: string): string;
|
|
|
43
43
|
|
|
44
44
|
export function scalarSlotKey(slot: bigint): string;
|
|
45
45
|
|
|
46
|
-
export function seedFromMnemonic(phrase: string):
|
|
46
|
+
export function seedFromMnemonic(phrase: string): any;
|
|
47
47
|
|
|
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): string;
|
|
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;
|
|
49
49
|
|
|
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): string;
|
|
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;
|
|
51
51
|
|
|
52
|
-
export function signRegister(seed_hex: string, index: bigint, nonce: bigint, fee: string, chain_id: bigint): string;
|
|
52
|
+
export function signRegister(seed_hex: string, index: bigint, nonce: bigint, fee: string, chain_id: bigint, valid_until: bigint): string;
|
|
53
53
|
|
|
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): string;
|
|
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;
|
|
55
55
|
|
|
56
|
-
export function sign_transfer(seed_hex: string, index: bigint, to: string, amount: string, nonce: bigint, fee: string, chain_id: bigint): string;
|
|
56
|
+
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
57
|
|
|
58
58
|
export function storageBody(contract: string): string;
|
|
59
59
|
|
package/pkg-node/qcore_js.js
CHANGED
|
@@ -316,27 +316,16 @@ exports.mapSlotKey = mapSlotKey;
|
|
|
316
316
|
|
|
317
317
|
/**
|
|
318
318
|
* @param {string} seed_hex
|
|
319
|
-
* @returns {
|
|
319
|
+
* @returns {any}
|
|
320
320
|
*/
|
|
321
321
|
function mnemonicFromSeed(seed_hex) {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const ret = wasm.mnemonicFromSeed(ptr0, len0);
|
|
328
|
-
var ptr2 = ret[0];
|
|
329
|
-
var len2 = ret[1];
|
|
330
|
-
if (ret[3]) {
|
|
331
|
-
ptr2 = 0; len2 = 0;
|
|
332
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
333
|
-
}
|
|
334
|
-
deferred3_0 = ptr2;
|
|
335
|
-
deferred3_1 = len2;
|
|
336
|
-
return getStringFromWasm0(ptr2, len2);
|
|
337
|
-
} finally {
|
|
338
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
322
|
+
const ptr0 = passStringToWasm0(seed_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
323
|
+
const len0 = WASM_VECTOR_LEN;
|
|
324
|
+
const ret = wasm.mnemonicFromSeed(ptr0, len0);
|
|
325
|
+
if (ret[2]) {
|
|
326
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
339
327
|
}
|
|
328
|
+
return takeFromExternrefTable0(ret[0]);
|
|
340
329
|
}
|
|
341
330
|
exports.mnemonicFromSeed = mnemonicFromSeed;
|
|
342
331
|
|
|
@@ -471,27 +460,16 @@ exports.scalarSlotKey = scalarSlotKey;
|
|
|
471
460
|
|
|
472
461
|
/**
|
|
473
462
|
* @param {string} phrase
|
|
474
|
-
* @returns {
|
|
463
|
+
* @returns {any}
|
|
475
464
|
*/
|
|
476
465
|
function seedFromMnemonic(phrase) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
const ret = wasm.seedFromMnemonic(ptr0, len0);
|
|
483
|
-
var ptr2 = ret[0];
|
|
484
|
-
var len2 = ret[1];
|
|
485
|
-
if (ret[3]) {
|
|
486
|
-
ptr2 = 0; len2 = 0;
|
|
487
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
488
|
-
}
|
|
489
|
-
deferred3_0 = ptr2;
|
|
490
|
-
deferred3_1 = len2;
|
|
491
|
-
return getStringFromWasm0(ptr2, len2);
|
|
492
|
-
} finally {
|
|
493
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
466
|
+
const ptr0 = passStringToWasm0(phrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
467
|
+
const len0 = WASM_VECTOR_LEN;
|
|
468
|
+
const ret = wasm.seedFromMnemonic(ptr0, len0);
|
|
469
|
+
if (ret[2]) {
|
|
470
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
494
471
|
}
|
|
472
|
+
return takeFromExternrefTable0(ret[0]);
|
|
495
473
|
}
|
|
496
474
|
exports.seedFromMnemonic = seedFromMnemonic;
|
|
497
475
|
|
|
@@ -506,9 +484,10 @@ exports.seedFromMnemonic = seedFromMnemonic;
|
|
|
506
484
|
* @param {bigint} meter_limit
|
|
507
485
|
* @param {string} fee
|
|
508
486
|
* @param {bigint} chain_id
|
|
487
|
+
* @param {bigint} valid_until
|
|
509
488
|
* @returns {string}
|
|
510
489
|
*/
|
|
511
|
-
function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, amount, nonce, meter_limit, fee, chain_id) {
|
|
490
|
+
function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, amount, nonce, meter_limit, fee, chain_id, valid_until) {
|
|
512
491
|
let deferred8_0;
|
|
513
492
|
let deferred8_1;
|
|
514
493
|
try {
|
|
@@ -524,7 +503,7 @@ function signAssetCall(seed_hex, index, target, args_hex, asset_issuer, amount,
|
|
|
524
503
|
const len4 = WASM_VECTOR_LEN;
|
|
525
504
|
const ptr5 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
526
505
|
const len5 = WASM_VECTOR_LEN;
|
|
527
|
-
const ret = wasm.signAssetCall(ptr0, len0, index, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, nonce, meter_limit, ptr5, len5, chain_id);
|
|
506
|
+
const ret = wasm.signAssetCall(ptr0, len0, index, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, nonce, meter_limit, ptr5, len5, chain_id, valid_until);
|
|
528
507
|
var ptr7 = ret[0];
|
|
529
508
|
var len7 = ret[1];
|
|
530
509
|
if (ret[3]) {
|
|
@@ -550,9 +529,10 @@ exports.signAssetCall = signAssetCall;
|
|
|
550
529
|
* @param {string} fee
|
|
551
530
|
* @param {string} value
|
|
552
531
|
* @param {bigint} chain_id
|
|
532
|
+
* @param {bigint} valid_until
|
|
553
533
|
* @returns {string}
|
|
554
534
|
*/
|
|
555
|
-
function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_limit, fee, value, chain_id) {
|
|
535
|
+
function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_limit, fee, value, chain_id, valid_until) {
|
|
556
536
|
let deferred7_0;
|
|
557
537
|
let deferred7_1;
|
|
558
538
|
try {
|
|
@@ -566,7 +546,7 @@ function signPayableCall(seed_hex, index, target, args_hex, nonce, meter_limit,
|
|
|
566
546
|
const len3 = WASM_VECTOR_LEN;
|
|
567
547
|
const ptr4 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
568
548
|
const len4 = WASM_VECTOR_LEN;
|
|
569
|
-
const ret = wasm.signPayableCall(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, ptr4, len4, chain_id);
|
|
549
|
+
const ret = wasm.signPayableCall(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, ptr4, len4, chain_id, valid_until);
|
|
570
550
|
var ptr6 = ret[0];
|
|
571
551
|
var len6 = ret[1];
|
|
572
552
|
if (ret[3]) {
|
|
@@ -588,9 +568,10 @@ exports.signPayableCall = signPayableCall;
|
|
|
588
568
|
* @param {bigint} nonce
|
|
589
569
|
* @param {string} fee
|
|
590
570
|
* @param {bigint} chain_id
|
|
571
|
+
* @param {bigint} valid_until
|
|
591
572
|
* @returns {string}
|
|
592
573
|
*/
|
|
593
|
-
function signRegister(seed_hex, index, nonce, fee, chain_id) {
|
|
574
|
+
function signRegister(seed_hex, index, nonce, fee, chain_id, valid_until) {
|
|
594
575
|
let deferred4_0;
|
|
595
576
|
let deferred4_1;
|
|
596
577
|
try {
|
|
@@ -598,7 +579,7 @@ function signRegister(seed_hex, index, nonce, fee, chain_id) {
|
|
|
598
579
|
const len0 = WASM_VECTOR_LEN;
|
|
599
580
|
const ptr1 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
600
581
|
const len1 = WASM_VECTOR_LEN;
|
|
601
|
-
const ret = wasm.signRegister(ptr0, len0, index, nonce, ptr1, len1, chain_id);
|
|
582
|
+
const ret = wasm.signRegister(ptr0, len0, index, nonce, ptr1, len1, chain_id, valid_until);
|
|
602
583
|
var ptr3 = ret[0];
|
|
603
584
|
var len3 = ret[1];
|
|
604
585
|
if (ret[3]) {
|
|
@@ -623,9 +604,10 @@ exports.signRegister = signRegister;
|
|
|
623
604
|
* @param {bigint} meter_limit
|
|
624
605
|
* @param {string} fee
|
|
625
606
|
* @param {bigint} chain_id
|
|
607
|
+
* @param {bigint} valid_until
|
|
626
608
|
* @returns {string}
|
|
627
609
|
*/
|
|
628
|
-
function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit, fee, chain_id) {
|
|
610
|
+
function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit, fee, chain_id, valid_until) {
|
|
629
611
|
let deferred6_0;
|
|
630
612
|
let deferred6_1;
|
|
631
613
|
try {
|
|
@@ -637,7 +619,7 @@ function sign_call(seed_hex, index, target, args_hex, nonce, meter_limit, fee, c
|
|
|
637
619
|
const len2 = WASM_VECTOR_LEN;
|
|
638
620
|
const ptr3 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
639
621
|
const len3 = WASM_VECTOR_LEN;
|
|
640
|
-
const ret = wasm.sign_call(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, chain_id);
|
|
622
|
+
const ret = wasm.sign_call(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, meter_limit, ptr3, len3, chain_id, valid_until);
|
|
641
623
|
var ptr5 = ret[0];
|
|
642
624
|
var len5 = ret[1];
|
|
643
625
|
if (ret[3]) {
|
|
@@ -661,9 +643,10 @@ exports.sign_call = sign_call;
|
|
|
661
643
|
* @param {bigint} nonce
|
|
662
644
|
* @param {string} fee
|
|
663
645
|
* @param {bigint} chain_id
|
|
646
|
+
* @param {bigint} valid_until
|
|
664
647
|
* @returns {string}
|
|
665
648
|
*/
|
|
666
|
-
function sign_transfer(seed_hex, index, to, amount, nonce, fee, chain_id) {
|
|
649
|
+
function sign_transfer(seed_hex, index, to, amount, nonce, fee, chain_id, valid_until) {
|
|
667
650
|
let deferred6_0;
|
|
668
651
|
let deferred6_1;
|
|
669
652
|
try {
|
|
@@ -675,7 +658,7 @@ function sign_transfer(seed_hex, index, to, amount, nonce, fee, chain_id) {
|
|
|
675
658
|
const len2 = WASM_VECTOR_LEN;
|
|
676
659
|
const ptr3 = passStringToWasm0(fee, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
677
660
|
const len3 = WASM_VECTOR_LEN;
|
|
678
|
-
const ret = wasm.sign_transfer(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, ptr3, len3, chain_id);
|
|
661
|
+
const ret = wasm.sign_transfer(ptr0, len0, index, ptr1, len1, ptr2, len2, nonce, ptr3, len3, chain_id, valid_until);
|
|
679
662
|
var ptr5 = ret[0];
|
|
680
663
|
var len5 = ret[1];
|
|
681
664
|
if (ret[3]) {
|
|
@@ -866,6 +849,11 @@ function __wbg_get_imports() {
|
|
|
866
849
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
867
850
|
return ret;
|
|
868
851
|
},
|
|
852
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
853
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
854
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
855
|
+
return ret;
|
|
856
|
+
},
|
|
869
857
|
__wbindgen_init_externref_table: function() {
|
|
870
858
|
const table = wasm.__wbindgen_externrefs;
|
|
871
859
|
const offset = table.grow(4);
|
|
Binary file
|