@rolly-dev/wasm-signer 0.12.0 → 1.0.0
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 +10 -13
- package/dist/node/README.md +10 -13
- package/dist/node/rolly_wasm_signer.d.ts +41 -142
- package/dist/node/rolly_wasm_signer.js +96 -415
- package/dist/node/rolly_wasm_signer_bg.wasm +0 -0
- package/dist/node/rolly_wasm_signer_bg.wasm.d.ts +7 -15
- package/dist/node-inline/README.md +10 -13
- package/dist/node-inline/rolly_wasm_signer.d.ts +41 -142
- package/dist/node-inline/rolly_wasm_signer.js +97 -416
- package/dist/node-inline/rolly_wasm_signer.mjs +94 -405
- package/dist/node-inline/rolly_wasm_signer_bg.wasm.d.ts +7 -15
- package/dist/web/README.md +10 -13
- package/dist/web/rolly_wasm_signer.d.ts +48 -157
- package/dist/web/rolly_wasm_signer.js +92 -403
- package/dist/web/rolly_wasm_signer_bg.wasm +0 -0
- package/dist/web/rolly_wasm_signer_bg.wasm.d.ts +7 -15
- package/js/browser.d.mts +2 -10
- package/js/browser.mjs +2 -10
- package/js/index.d.ts +2 -10
- package/js/node-inline.cjs +2 -10
- package/js/node-inline.mjs +2 -10
- package/js/node.cjs +2 -10
- package/js/node.mjs +2 -10
- package/js/react.d.mts +3 -11
- package/js/react.mjs +4 -20
- package/package.json +1 -1
|
Binary file
|
|
@@ -4,29 +4,21 @@ export const memory: WebAssembly.Memory;
|
|
|
4
4
|
export const amount_split: (a: number, b: bigint) => void;
|
|
5
5
|
export const compute_address_hash: (a: number, b: number, c: number) => void;
|
|
6
6
|
export const compute_server_seed_hash: (a: number, b: number, c: number) => void;
|
|
7
|
-
export const compute_tx_msg_hash: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
|
|
8
|
-
export const create_bet_auth: (a: number, b: number, c: number, d: bigint, e: bigint) => void;
|
|
9
7
|
export const derive_session_key: (a: number, b: number, c: number) => void;
|
|
10
8
|
export const generate_user_seed: (a: number) => void;
|
|
11
9
|
export const goldilocks_fields_to_hex: (a: number, b: number, c: number) => void;
|
|
12
10
|
export const goldilocks_reduce: (a: bigint) => bigint;
|
|
11
|
+
export const hash_balance_leaf: (a: number, b: number, c: number) => void;
|
|
12
|
+
export const make_main_leaf: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
13
13
|
export const poseidon2_hash: (a: number, b: number, c: number) => void;
|
|
14
14
|
export const poseidon2_two_to_one: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
15
|
-
export const schnorr_keygen: (a: number, b: number, c: number) => void;
|
|
16
|
-
export const schnorr_pk_encode: (a: number, b: number, c: number) => void;
|
|
17
|
-
export const schnorr_pk_hash: (a: number, b: number, c: number) => void;
|
|
18
|
-
export const schnorr_pk_hash_hex: (a: number, b: number, c: number) => void;
|
|
19
|
-
export const schnorr_pubkey: (a: number, b: number, c: number) => void;
|
|
20
|
-
export const schnorr_sign_cpk: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
21
|
-
export const schnorr_sign_tx: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint) => number;
|
|
22
|
-
export const schnorr_verify_tx: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: bigint) => number;
|
|
23
15
|
export const seed_hash_truncated: (a: number, b: number, c: number) => void;
|
|
24
|
-
export const session_public_key: (a: number, b: number, c: number) => void;
|
|
16
|
+
export const session_public_key: (a: number, b: number, c: number, d: bigint) => void;
|
|
25
17
|
export const string_to_user_seed: (a: number, b: number, c: number) => void;
|
|
26
18
|
export const string_to_user_seed_hex: (a: number, b: number, c: number) => void;
|
|
27
19
|
export const goldilocks_modulus: () => bigint;
|
|
28
|
-
export const __wbindgen_export: (a: number
|
|
29
|
-
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
30
|
-
export const __wbindgen_export3: (a: number) => void;
|
|
20
|
+
export const __wbindgen_export: (a: number) => void;
|
|
31
21
|
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
32
|
-
export const
|
|
22
|
+
export const __wbindgen_export2: (a: number, b: number, c: number) => void;
|
|
23
|
+
export const __wbindgen_export3: (a: number, b: number) => number;
|
|
24
|
+
export const __wbindgen_export4: (a: number, b: number, c: number, d: number) => number;
|
package/js/browser.d.mts
CHANGED
|
@@ -3,7 +3,6 @@ export {
|
|
|
3
3
|
poseidon2_two_to_one,
|
|
4
4
|
derive_session_key,
|
|
5
5
|
session_public_key,
|
|
6
|
-
create_bet_auth,
|
|
7
6
|
compute_server_seed_hash,
|
|
8
7
|
seed_hash_truncated,
|
|
9
8
|
string_to_user_seed,
|
|
@@ -12,17 +11,10 @@ export {
|
|
|
12
11
|
goldilocks_fields_to_hex,
|
|
13
12
|
goldilocks_modulus,
|
|
14
13
|
goldilocks_reduce,
|
|
15
|
-
schnorr_keygen,
|
|
16
|
-
schnorr_pubkey,
|
|
17
|
-
schnorr_sign_tx,
|
|
18
|
-
schnorr_verify_tx,
|
|
19
|
-
schnorr_pk_hash,
|
|
20
|
-
schnorr_pk_hash_hex,
|
|
21
|
-
schnorr_pk_encode,
|
|
22
|
-
schnorr_sign_cpk,
|
|
23
|
-
compute_tx_msg_hash,
|
|
24
14
|
amount_split,
|
|
25
15
|
compute_address_hash,
|
|
16
|
+
hash_balance_leaf,
|
|
17
|
+
make_main_leaf,
|
|
26
18
|
} from '../dist/web/rolly_wasm_signer.js';
|
|
27
19
|
|
|
28
20
|
export { default as init } from '../dist/web/rolly_wasm_signer.js';
|
package/js/browser.mjs
CHANGED
|
@@ -5,7 +5,6 @@ export {
|
|
|
5
5
|
poseidon2_two_to_one,
|
|
6
6
|
derive_session_key,
|
|
7
7
|
session_public_key,
|
|
8
|
-
create_bet_auth,
|
|
9
8
|
compute_server_seed_hash,
|
|
10
9
|
seed_hash_truncated,
|
|
11
10
|
string_to_user_seed,
|
|
@@ -14,15 +13,8 @@ export {
|
|
|
14
13
|
goldilocks_fields_to_hex,
|
|
15
14
|
goldilocks_modulus,
|
|
16
15
|
goldilocks_reduce,
|
|
17
|
-
schnorr_keygen,
|
|
18
|
-
schnorr_pubkey,
|
|
19
|
-
schnorr_sign_tx,
|
|
20
|
-
schnorr_verify_tx,
|
|
21
|
-
schnorr_pk_hash,
|
|
22
|
-
schnorr_pk_hash_hex,
|
|
23
|
-
schnorr_pk_encode,
|
|
24
|
-
schnorr_sign_cpk,
|
|
25
|
-
compute_tx_msg_hash,
|
|
26
16
|
amount_split,
|
|
27
17
|
compute_address_hash,
|
|
18
|
+
hash_balance_leaf,
|
|
19
|
+
make_main_leaf,
|
|
28
20
|
} from '../dist/web/rolly_wasm_signer.js';
|
package/js/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export {
|
|
|
3
3
|
poseidon2_two_to_one,
|
|
4
4
|
derive_session_key,
|
|
5
5
|
session_public_key,
|
|
6
|
-
create_bet_auth,
|
|
7
6
|
compute_server_seed_hash,
|
|
8
7
|
seed_hash_truncated,
|
|
9
8
|
string_to_user_seed,
|
|
@@ -12,15 +11,8 @@ export {
|
|
|
12
11
|
goldilocks_fields_to_hex,
|
|
13
12
|
goldilocks_modulus,
|
|
14
13
|
goldilocks_reduce,
|
|
15
|
-
schnorr_keygen,
|
|
16
|
-
schnorr_pubkey,
|
|
17
|
-
schnorr_sign_tx,
|
|
18
|
-
schnorr_verify_tx,
|
|
19
|
-
schnorr_pk_hash,
|
|
20
|
-
schnorr_pk_hash_hex,
|
|
21
|
-
schnorr_pk_encode,
|
|
22
|
-
schnorr_sign_cpk,
|
|
23
|
-
compute_tx_msg_hash,
|
|
24
14
|
amount_split,
|
|
25
15
|
compute_address_hash,
|
|
16
|
+
hash_balance_leaf,
|
|
17
|
+
make_main_leaf,
|
|
26
18
|
} from '../dist/node-inline/rolly_wasm_signer.js';
|
package/js/node-inline.cjs
CHANGED
|
@@ -7,7 +7,6 @@ module.exports = {
|
|
|
7
7
|
poseidon2_two_to_one: wasm.poseidon2_two_to_one,
|
|
8
8
|
derive_session_key: wasm.derive_session_key,
|
|
9
9
|
session_public_key: wasm.session_public_key,
|
|
10
|
-
create_bet_auth: wasm.create_bet_auth,
|
|
11
10
|
compute_server_seed_hash: wasm.compute_server_seed_hash,
|
|
12
11
|
seed_hash_truncated: wasm.seed_hash_truncated,
|
|
13
12
|
string_to_user_seed: wasm.string_to_user_seed,
|
|
@@ -16,15 +15,8 @@ module.exports = {
|
|
|
16
15
|
goldilocks_fields_to_hex: wasm.goldilocks_fields_to_hex,
|
|
17
16
|
goldilocks_modulus: wasm.goldilocks_modulus,
|
|
18
17
|
goldilocks_reduce: wasm.goldilocks_reduce,
|
|
19
|
-
schnorr_keygen: wasm.schnorr_keygen,
|
|
20
|
-
schnorr_pubkey: wasm.schnorr_pubkey,
|
|
21
|
-
schnorr_sign_tx: wasm.schnorr_sign_tx,
|
|
22
|
-
schnorr_verify_tx: wasm.schnorr_verify_tx,
|
|
23
|
-
schnorr_pk_hash: wasm.schnorr_pk_hash,
|
|
24
|
-
schnorr_pk_hash_hex: wasm.schnorr_pk_hash_hex,
|
|
25
|
-
schnorr_pk_encode: wasm.schnorr_pk_encode,
|
|
26
|
-
schnorr_sign_cpk: wasm.schnorr_sign_cpk,
|
|
27
|
-
compute_tx_msg_hash: wasm.compute_tx_msg_hash,
|
|
28
18
|
amount_split: wasm.amount_split,
|
|
29
19
|
compute_address_hash: wasm.compute_address_hash,
|
|
20
|
+
hash_balance_leaf: wasm.hash_balance_leaf,
|
|
21
|
+
make_main_leaf: wasm.make_main_leaf,
|
|
30
22
|
};
|
package/js/node-inline.mjs
CHANGED
|
@@ -3,7 +3,6 @@ export {
|
|
|
3
3
|
poseidon2_two_to_one,
|
|
4
4
|
derive_session_key,
|
|
5
5
|
session_public_key,
|
|
6
|
-
create_bet_auth,
|
|
7
6
|
compute_server_seed_hash,
|
|
8
7
|
seed_hash_truncated,
|
|
9
8
|
string_to_user_seed,
|
|
@@ -12,15 +11,8 @@ export {
|
|
|
12
11
|
goldilocks_fields_to_hex,
|
|
13
12
|
goldilocks_modulus,
|
|
14
13
|
goldilocks_reduce,
|
|
15
|
-
schnorr_keygen,
|
|
16
|
-
schnorr_pubkey,
|
|
17
|
-
schnorr_sign_tx,
|
|
18
|
-
schnorr_verify_tx,
|
|
19
|
-
schnorr_pk_hash,
|
|
20
|
-
schnorr_pk_hash_hex,
|
|
21
|
-
schnorr_pk_encode,
|
|
22
|
-
schnorr_sign_cpk,
|
|
23
|
-
compute_tx_msg_hash,
|
|
24
14
|
amount_split,
|
|
25
15
|
compute_address_hash,
|
|
16
|
+
hash_balance_leaf,
|
|
17
|
+
make_main_leaf,
|
|
26
18
|
} from '../dist/node-inline/rolly_wasm_signer.mjs';
|
package/js/node.cjs
CHANGED
|
@@ -7,7 +7,6 @@ module.exports = {
|
|
|
7
7
|
poseidon2_two_to_one: wasm.poseidon2_two_to_one,
|
|
8
8
|
derive_session_key: wasm.derive_session_key,
|
|
9
9
|
session_public_key: wasm.session_public_key,
|
|
10
|
-
create_bet_auth: wasm.create_bet_auth,
|
|
11
10
|
compute_server_seed_hash: wasm.compute_server_seed_hash,
|
|
12
11
|
seed_hash_truncated: wasm.seed_hash_truncated,
|
|
13
12
|
string_to_user_seed: wasm.string_to_user_seed,
|
|
@@ -16,15 +15,8 @@ module.exports = {
|
|
|
16
15
|
goldilocks_fields_to_hex: wasm.goldilocks_fields_to_hex,
|
|
17
16
|
goldilocks_modulus: wasm.goldilocks_modulus,
|
|
18
17
|
goldilocks_reduce: wasm.goldilocks_reduce,
|
|
19
|
-
schnorr_keygen: wasm.schnorr_keygen,
|
|
20
|
-
schnorr_pubkey: wasm.schnorr_pubkey,
|
|
21
|
-
schnorr_sign_tx: wasm.schnorr_sign_tx,
|
|
22
|
-
schnorr_verify_tx: wasm.schnorr_verify_tx,
|
|
23
|
-
schnorr_pk_hash: wasm.schnorr_pk_hash,
|
|
24
|
-
schnorr_pk_hash_hex: wasm.schnorr_pk_hash_hex,
|
|
25
|
-
schnorr_pk_encode: wasm.schnorr_pk_encode,
|
|
26
|
-
schnorr_sign_cpk: wasm.schnorr_sign_cpk,
|
|
27
|
-
compute_tx_msg_hash: wasm.compute_tx_msg_hash,
|
|
28
18
|
amount_split: wasm.amount_split,
|
|
29
19
|
compute_address_hash: wasm.compute_address_hash,
|
|
20
|
+
hash_balance_leaf: wasm.hash_balance_leaf,
|
|
21
|
+
make_main_leaf: wasm.make_main_leaf,
|
|
30
22
|
};
|
package/js/node.mjs
CHANGED
|
@@ -8,7 +8,6 @@ export const {
|
|
|
8
8
|
poseidon2_two_to_one,
|
|
9
9
|
derive_session_key,
|
|
10
10
|
session_public_key,
|
|
11
|
-
create_bet_auth,
|
|
12
11
|
compute_server_seed_hash,
|
|
13
12
|
seed_hash_truncated,
|
|
14
13
|
string_to_user_seed,
|
|
@@ -17,15 +16,8 @@ export const {
|
|
|
17
16
|
goldilocks_fields_to_hex,
|
|
18
17
|
goldilocks_modulus,
|
|
19
18
|
goldilocks_reduce,
|
|
20
|
-
schnorr_keygen,
|
|
21
|
-
schnorr_pubkey,
|
|
22
|
-
schnorr_sign_tx,
|
|
23
|
-
schnorr_verify_tx,
|
|
24
|
-
schnorr_pk_hash,
|
|
25
|
-
schnorr_pk_hash_hex,
|
|
26
|
-
schnorr_pk_encode,
|
|
27
|
-
schnorr_sign_cpk,
|
|
28
|
-
compute_tx_msg_hash,
|
|
29
19
|
amount_split,
|
|
30
20
|
compute_address_hash,
|
|
21
|
+
hash_balance_leaf,
|
|
22
|
+
make_main_leaf,
|
|
31
23
|
} = wasm;
|
package/js/react.d.mts
CHANGED
|
@@ -4,8 +4,7 @@ export interface RollyWasmResult {
|
|
|
4
4
|
poseidon2_hash: (input: BigUint64Array) => BigUint64Array;
|
|
5
5
|
poseidon2_two_to_one: (left: BigUint64Array, right: BigUint64Array) => BigUint64Array;
|
|
6
6
|
derive_session_key: (sig_bytes: Uint8Array) => BigUint64Array;
|
|
7
|
-
session_public_key: (session_key: BigUint64Array) => BigUint64Array;
|
|
8
|
-
create_bet_auth: (session_key: BigUint64Array, bet_amount: bigint, nonce: bigint) => BigUint64Array;
|
|
7
|
+
session_public_key: (session_key: BigUint64Array, session_expiry: bigint) => BigUint64Array;
|
|
9
8
|
compute_server_seed_hash: (server_seed: BigUint64Array) => BigUint64Array;
|
|
10
9
|
seed_hash_truncated: (server_seed: BigUint64Array) => BigUint64Array;
|
|
11
10
|
string_to_user_seed: (input: string) => BigUint64Array;
|
|
@@ -14,17 +13,10 @@ export interface RollyWasmResult {
|
|
|
14
13
|
goldilocks_fields_to_hex: (fields: BigUint64Array) => string;
|
|
15
14
|
goldilocks_modulus: () => bigint;
|
|
16
15
|
goldilocks_reduce: (value: bigint) => bigint;
|
|
17
|
-
schnorr_keygen: (entropy: Uint8Array) => string;
|
|
18
|
-
schnorr_pubkey: (sk_hex: string) => string;
|
|
19
|
-
schnorr_sign_tx: (sk_hex: string, tx_type: number, user_id: number, currency_id: number, amount_lo: number, amount_hi: number, session_expiry: bigint) => any;
|
|
20
|
-
schnorr_verify_tx: (pk_hex: string, sig_s_hex: string, sig_e_hex: string, tx_type: number, user_id: number, currency_id: number, amount_lo: number, amount_hi: number, session_expiry: bigint) => boolean;
|
|
21
|
-
schnorr_pk_hash: (pk_hex: string) => BigUint64Array;
|
|
22
|
-
schnorr_pk_hash_hex: (pk_hex: string) => string;
|
|
23
|
-
schnorr_pk_encode: (pk_hex: string) => BigUint64Array;
|
|
24
|
-
schnorr_sign_cpk: (old_sk_hex: string, user_id: number, new_pk_hash: BigUint64Array) => any;
|
|
25
|
-
compute_tx_msg_hash: (tx_type: number, user_id: number, currency_id: number, amount_lo: number, amount_hi: number, session_expiry: bigint) => BigUint64Array;
|
|
26
16
|
amount_split: (amount: bigint) => Uint32Array;
|
|
27
17
|
compute_address_hash: (address_hex: string) => BigUint64Array;
|
|
18
|
+
hash_balance_leaf: (raw: BigUint64Array) => BigUint64Array;
|
|
19
|
+
make_main_leaf: (balance_hash: BigUint64Array, pk_hash: BigUint64Array, address_hash: BigUint64Array) => BigUint64Array;
|
|
28
20
|
}
|
|
29
21
|
|
|
30
22
|
export function useRollyWasm(): RollyWasmResult;
|
package/js/react.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import init, {
|
|
|
4
4
|
poseidon2_two_to_one,
|
|
5
5
|
derive_session_key,
|
|
6
6
|
session_public_key,
|
|
7
|
-
create_bet_auth,
|
|
8
7
|
compute_server_seed_hash,
|
|
9
8
|
seed_hash_truncated,
|
|
10
9
|
string_to_user_seed,
|
|
@@ -13,17 +12,10 @@ import init, {
|
|
|
13
12
|
goldilocks_fields_to_hex,
|
|
14
13
|
goldilocks_modulus,
|
|
15
14
|
goldilocks_reduce,
|
|
16
|
-
schnorr_keygen,
|
|
17
|
-
schnorr_pubkey,
|
|
18
|
-
schnorr_sign_tx,
|
|
19
|
-
schnorr_verify_tx,
|
|
20
|
-
schnorr_pk_hash,
|
|
21
|
-
schnorr_pk_hash_hex,
|
|
22
|
-
schnorr_pk_encode,
|
|
23
|
-
schnorr_sign_cpk,
|
|
24
|
-
compute_tx_msg_hash,
|
|
25
15
|
amount_split,
|
|
26
16
|
compute_address_hash,
|
|
17
|
+
hash_balance_leaf,
|
|
18
|
+
make_main_leaf,
|
|
27
19
|
} from '../dist/web/rolly_wasm_signer.js';
|
|
28
20
|
|
|
29
21
|
let _ready = false;
|
|
@@ -41,7 +33,6 @@ const fns = {
|
|
|
41
33
|
poseidon2_two_to_one: guard(poseidon2_two_to_one),
|
|
42
34
|
derive_session_key: guard(derive_session_key),
|
|
43
35
|
session_public_key: guard(session_public_key),
|
|
44
|
-
create_bet_auth: guard(create_bet_auth),
|
|
45
36
|
compute_server_seed_hash: guard(compute_server_seed_hash),
|
|
46
37
|
seed_hash_truncated: guard(seed_hash_truncated),
|
|
47
38
|
string_to_user_seed: guard(string_to_user_seed),
|
|
@@ -50,17 +41,10 @@ const fns = {
|
|
|
50
41
|
goldilocks_fields_to_hex: guard(goldilocks_fields_to_hex),
|
|
51
42
|
goldilocks_modulus: guard(goldilocks_modulus),
|
|
52
43
|
goldilocks_reduce: guard(goldilocks_reduce),
|
|
53
|
-
schnorr_keygen: guard(schnorr_keygen),
|
|
54
|
-
schnorr_pubkey: guard(schnorr_pubkey),
|
|
55
|
-
schnorr_sign_tx: guard(schnorr_sign_tx),
|
|
56
|
-
schnorr_verify_tx: guard(schnorr_verify_tx),
|
|
57
|
-
schnorr_pk_hash: guard(schnorr_pk_hash),
|
|
58
|
-
schnorr_pk_hash_hex: guard(schnorr_pk_hash_hex),
|
|
59
|
-
schnorr_pk_encode: guard(schnorr_pk_encode),
|
|
60
|
-
schnorr_sign_cpk: guard(schnorr_sign_cpk),
|
|
61
|
-
compute_tx_msg_hash: guard(compute_tx_msg_hash),
|
|
62
44
|
amount_split: guard(amount_split),
|
|
63
45
|
compute_address_hash: guard(compute_address_hash),
|
|
46
|
+
hash_balance_leaf: guard(hash_balance_leaf),
|
|
47
|
+
make_main_leaf: guard(make_main_leaf),
|
|
64
48
|
};
|
|
65
49
|
|
|
66
50
|
/**
|