@typeberry/native 0.0.4-e18a946 → 0.2.0-173c341
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/index.d.ts +7 -91
- package/index.js +14 -220
- package/package.json +22 -1
package/index.d.ts
CHANGED
|
@@ -1,90 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export { InitInput$2 as InitInput, InitOutput$2 as InitOutput, SyncInitInput$2 as SyncInitInput, batch_verify_tickets, __wbg_init$2 as default, derive_public_key, generate_seal, initSync$2 as initSync, ring_commitment, verify_seal };
|
|
3
|
-
}
|
|
4
|
-
/* tslint:disable */
|
|
5
|
-
/* eslint-disable */
|
|
6
|
-
/**
|
|
7
|
-
* Seal verification as defined in:
|
|
8
|
-
* https://graypaper.fluffylabs.dev/#/68eaa1f/0eff000eff00?v=0.6.4
|
|
9
|
-
* or
|
|
10
|
-
* https://graypaper.fluffylabs.dev/#/68eaa1f/0e54010e5401?v=0.6.4
|
|
11
|
-
*/
|
|
12
|
-
declare function verify_seal(signer_key: Uint8Array, seal_data: Uint8Array, payload: Uint8Array, aux_data: Uint8Array): Uint8Array;
|
|
13
|
-
/**
|
|
14
|
-
* Generate seal that is verifiable using `verify_seal` function.
|
|
15
|
-
*
|
|
16
|
-
* # Arguments
|
|
17
|
-
* * `secret_seed` - Seed used to derive the secret key
|
|
18
|
-
* * `input` - VRF input data
|
|
19
|
-
* * `aux_data` - Auxiliary data for the VRF proof
|
|
20
|
-
*
|
|
21
|
-
* # Returns
|
|
22
|
-
* A byte vector with the following format:
|
|
23
|
-
* - On success (97 bytes):
|
|
24
|
-
* - Byte 0: Status code `0` (RESULT_OK)
|
|
25
|
-
* - Bytes 1-32: Serialized VRF output (32 bytes, compressed)
|
|
26
|
-
* - Bytes 33-96: Serialized IETF VRF proof (64 bytes, compressed)
|
|
27
|
-
* - On error (1 byte):
|
|
28
|
-
* - Byte 0: Status code `1` (RESULT_ERR)
|
|
29
|
-
*
|
|
30
|
-
* Returns an error if the input cannot be converted to a valid VRF input point
|
|
31
|
-
* or if serialization of the output or proof fails.
|
|
32
|
-
*/
|
|
33
|
-
declare function generate_seal(secret_seed: Uint8Array, input: Uint8Array, aux_data: Uint8Array): Uint8Array;
|
|
34
|
-
/**
|
|
35
|
-
* Derive Private and Public Key from Seed
|
|
36
|
-
*
|
|
37
|
-
* returns: `Vec<u8>` containing the exit (1 byte) status followed by the (32 bytes) public key
|
|
38
|
-
*/
|
|
39
|
-
declare function derive_public_key(seed: Uint8Array): Uint8Array;
|
|
40
|
-
/**
|
|
41
|
-
* Verify multiple tickets at once as defined in:
|
|
42
|
-
* https://graypaper.fluffylabs.dev/#/68eaa1f/0f3e000f3e00?v=0.6.4
|
|
43
|
-
*
|
|
44
|
-
* NOTE: the aux_data of VRF function is empty!
|
|
45
|
-
*/
|
|
46
|
-
declare function batch_verify_tickets(ring_size: number, commitment: Uint8Array, tickets_data: Uint8Array, vrf_input_data_len: number): Uint8Array;
|
|
47
|
-
/**
|
|
48
|
-
* Generate ring commitment given concatenation of ring keys.
|
|
49
|
-
*/
|
|
50
|
-
declare function ring_commitment(keys: Uint8Array): Uint8Array;
|
|
51
|
-
type InitInput$2 = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
52
|
-
interface InitOutput$2 {
|
|
53
|
-
readonly memory: WebAssembly.Memory;
|
|
54
|
-
readonly batch_verify_tickets: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
55
|
-
readonly derive_public_key: (a: number, b: number) => [number, number];
|
|
56
|
-
readonly generate_seal: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
57
|
-
readonly ring_commitment: (a: number, b: number) => [number, number];
|
|
58
|
-
readonly verify_seal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
|
59
|
-
readonly __wbindgen_export_0: WebAssembly.Table;
|
|
60
|
-
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
61
|
-
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
62
|
-
readonly __wbindgen_start: () => void;
|
|
63
|
-
}
|
|
64
|
-
type SyncInitInput$2 = BufferSource | WebAssembly.Module;
|
|
65
|
-
/**
|
|
66
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
67
|
-
* a precompiled `WebAssembly.Module`.
|
|
68
|
-
*
|
|
69
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
70
|
-
*
|
|
71
|
-
* @returns {InitOutput}
|
|
72
|
-
*/
|
|
73
|
-
declare function initSync$2(module: {
|
|
74
|
-
module: SyncInitInput$2;
|
|
75
|
-
} | SyncInitInput$2): InitOutput$2;
|
|
1
|
+
import * as bandersnatch from "@typeberry/bandersnatch";
|
|
76
2
|
|
|
77
|
-
|
|
78
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
79
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
80
|
-
*
|
|
81
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
82
|
-
*
|
|
83
|
-
* @returns {Promise<InitOutput>}
|
|
84
|
-
*/
|
|
85
|
-
declare function __wbg_init$2(module_or_path?: {
|
|
86
|
-
module_or_path: InitInput$2 | Promise<InitInput$2>;
|
|
87
|
-
} | InitInput$2 | Promise<InitInput$2>): Promise<InitOutput$2>;
|
|
3
|
+
//#region ed25519/pkg/ed25519_wasm.d.ts
|
|
88
4
|
declare namespace ed25519_wasm_d_exports {
|
|
89
5
|
export { InitInput$1 as InitInput, InitOutput$1 as InitOutput, SyncInitInput$1 as SyncInitInput, __wbg_init$1 as default, initSync$1 as initSync, verify_ed25519, verify_ed25519_batch };
|
|
90
6
|
}
|
|
@@ -142,8 +58,8 @@ declare namespace reed_solomon_wasm_d_exports {
|
|
|
142
58
|
}
|
|
143
59
|
/* tslint:disable */
|
|
144
60
|
/* eslint-disable */
|
|
145
|
-
declare function encode(recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
146
61
|
declare function decode(original_count: number, recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
62
|
+
declare function encode(recovery_count: number, shards: ShardsCollection): ShardsCollection;
|
|
147
63
|
/**
|
|
148
64
|
* Collection of shards (either input or output).
|
|
149
65
|
*
|
|
@@ -232,9 +148,9 @@ declare function __wbg_init(module_or_path?: {
|
|
|
232
148
|
//#region native/index.d.ts
|
|
233
149
|
declare function initAll(): Promise<void>;
|
|
234
150
|
declare const init: {
|
|
235
|
-
bandersnatch: any
|
|
236
|
-
ed25519:
|
|
237
|
-
reedSolomon:
|
|
151
|
+
bandersnatch: () => Promise<any>;
|
|
152
|
+
ed25519: () => Promise<InitOutput$1>;
|
|
153
|
+
reedSolomon: () => Promise<InitOutput>;
|
|
238
154
|
};
|
|
239
155
|
//#endregion
|
|
240
|
-
export {
|
|
156
|
+
export { bandersnatch, ed25519_wasm_d_exports as ed25519, init, initAll, reed_solomon_wasm_d_exports as reedSolomon };
|