@fairblock/stabletrust 1.0.22 → 2.0.1
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 +360 -106
- package/examples/anonymous-flow.js +338 -0
- package/package.json +1 -1
- package/pkg/README.md +310 -0
- package/pkg/confidential_transfer_proof_generation.d.ts +13 -9
- package/pkg/confidential_transfer_proof_generation.js +571 -604
- package/pkg/confidential_transfer_proof_generation_bg.wasm +0 -0
- package/pkg/confidential_transfer_proof_generation_bg.wasm.d.ts +2 -0
- package/src/anonymous-client.js +1353 -0
- package/src/{client.js → confidential-client.js} +11 -8
- package/src/constants.js +8 -9
- package/src/index.d.ts +341 -1
- package/src/index.js +2 -1
- package/pkg/proof_generator_wasm_bg.wasm +0 -0
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function generate_withdraw_proof(input: string): string;
|
|
4
|
-
export function decrypt_ciphertext(ciphertext_base64: string, keypair_base64: string): string;
|
|
5
3
|
/**
|
|
6
4
|
* Generate a deterministic ElGamal keypair from an EIP-712 signature
|
|
7
5
|
*/
|
|
8
6
|
export function generate_deterministic_keypair(signature_hex: string, domain_context: string): string;
|
|
9
|
-
export function test_wasm(): string;
|
|
10
|
-
export function generate_transfer_proof(input: string): string;
|
|
11
7
|
/**
|
|
12
|
-
*
|
|
13
|
-
* handle_index: 0 for sender, 1 for recipient
|
|
8
|
+
* Generate a deterministic ElGamal keypair using legacy method (for backward compatibility)
|
|
14
9
|
*/
|
|
15
|
-
export function
|
|
10
|
+
export function generate_deterministic_keypair_legacy(signature_hex: string): string;
|
|
16
11
|
/**
|
|
17
12
|
* Generate a random ElGamal keypair (for compatibility)
|
|
18
13
|
*/
|
|
19
14
|
export function generate_keypair(): string;
|
|
20
15
|
export function encrypt_amount(amount: bigint, pubkey_base64: string): string;
|
|
16
|
+
export function decrypt_ciphertext(ciphertext_base64: string, keypair_base64: string): string;
|
|
17
|
+
export function encrypt_amount_with_randomness(amount: bigint, pubkey_base64: string): string;
|
|
18
|
+
export function decrypt_ciphertext_with_randomness(ciphertext_base64: string, randomness_base64: string): string;
|
|
19
|
+
export function generate_transfer_proof(input: string): string;
|
|
20
|
+
export function generate_withdraw_proof(input: string): string;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Decode transfer proof from contract input data and extract transfer amount ciphertext
|
|
23
|
+
* handle_index: 0 for sender, 1 for recipient
|
|
23
24
|
*/
|
|
24
|
-
export function
|
|
25
|
+
export function decode_transfer_proof(validity_proof_base64: string, handle_index: number): string;
|
|
26
|
+
export function test_wasm(): string;
|
|
25
27
|
|
|
26
28
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
27
29
|
|
|
@@ -29,7 +31,9 @@ export interface InitOutput {
|
|
|
29
31
|
readonly memory: WebAssembly.Memory;
|
|
30
32
|
readonly decode_transfer_proof: (a: number, b: number, c: number, d: number) => void;
|
|
31
33
|
readonly decrypt_ciphertext: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
34
|
+
readonly decrypt_ciphertext_with_randomness: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
32
35
|
readonly encrypt_amount: (a: number, b: bigint, c: number, d: number) => void;
|
|
36
|
+
readonly encrypt_amount_with_randomness: (a: number, b: bigint, c: number, d: number) => void;
|
|
33
37
|
readonly generate_deterministic_keypair: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
34
38
|
readonly generate_deterministic_keypair_legacy: (a: number, b: number, c: number) => void;
|
|
35
39
|
readonly generate_keypair: (a: number) => void;
|