@massalabs/gossip-sdk 0.0.2-dev.20260128111120 → 0.0.2-dev.20260128162527
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/dist/assets/generated/wasm/gossip_wasm.d.ts +299 -159
- package/dist/assets/generated/wasm/gossip_wasm.js +1323 -1165
- package/dist/assets/generated/wasm/gossip_wasm_bg.wasm +0 -0
- package/dist/assets/generated/wasm/gossip_wasm_bg.wasm.d.ts +140 -44
- package/dist/assets/generated/wasm/package.json +1 -1
- package/dist/assets/generated/wasm-node/README.md +281 -0
- package/dist/assets/generated/wasm-node/gossip_wasm.d.ts +443 -0
- package/dist/assets/generated/wasm-node/gossip_wasm.js +1488 -0
- package/dist/assets/generated/wasm-node/gossip_wasm_bg.wasm +0 -0
- package/dist/assets/generated/wasm-node/gossip_wasm_bg.wasm.d.ts +164 -0
- package/dist/assets/generated/wasm-node/package.json +11 -0
- package/dist/config/protocol.js +18 -12
- package/dist/contacts.d.ts +1 -1
- package/dist/gossipSdk.d.ts +1 -1
- package/dist/index.d.ts +9 -23
- package/dist/index.js +19 -35
- package/dist/services/announcement.d.ts +1 -1
- package/dist/services/announcement.js +1 -1
- package/dist/services/auth.d.ts +1 -1
- package/dist/services/auth.js +1 -1
- package/dist/services/discussion.js +1 -1
- package/dist/services/message.js +1 -1
- package/dist/services/refresh.js +1 -1
- package/dist/wasm/encryption.d.ts +1 -1
- package/dist/wasm/encryption.js +1 -1
- package/dist/wasm/loader.d.ts +4 -3
- package/dist/wasm/loader.js +13 -38
- package/dist/wasm/session.d.ts +1 -1
- package/dist/wasm/session.js +1 -1
- package/dist/wasm/userKeys.d.ts +1 -1
- package/dist/wasm/userKeys.js +1 -1
- package/package.json +11 -2
|
@@ -2,9 +2,44 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export function start(): void;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Decrypts data using AES-256-SIV authenticated encryption.
|
|
6
|
+
*
|
|
7
|
+
* # Parameters
|
|
8
|
+
*
|
|
9
|
+
* - `key`: The encryption key (64 bytes, must match encryption key)
|
|
10
|
+
* - `nonce`: The nonce (16 bytes, must match encryption nonce)
|
|
11
|
+
* - `ciphertext`: The encrypted data with authentication tag
|
|
12
|
+
* - `aad`: Additional authenticated data (must match encryption AAD)
|
|
13
|
+
*
|
|
14
|
+
* # Returns
|
|
15
|
+
*
|
|
16
|
+
* The decrypted plaintext, or `null` if authentication fails.
|
|
17
|
+
*
|
|
18
|
+
* # Security Notes
|
|
19
|
+
*
|
|
20
|
+
* - Returns `null` if:
|
|
21
|
+
* - The ciphertext has been tampered with
|
|
22
|
+
* - The wrong key or nonce is used
|
|
23
|
+
* - The AAD doesn't match
|
|
24
|
+
* - Never ignore a decryption failure; it indicates tampering or corruption
|
|
25
|
+
*
|
|
26
|
+
* # Example
|
|
27
|
+
*
|
|
28
|
+
* ```javascript
|
|
29
|
+
* const plaintext = aead_decrypt(key, nonce, ciphertext, aad);
|
|
30
|
+
* if (plaintext) {
|
|
31
|
+
* console.log("Decrypted:", new TextDecoder().decode(plaintext));
|
|
32
|
+
* } else {
|
|
33
|
+
* console.error("Decryption failed - data may be corrupted or tampered");
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
6
36
|
*/
|
|
7
|
-
export function
|
|
37
|
+
export function aead_decrypt(
|
|
38
|
+
key: EncryptionKey,
|
|
39
|
+
nonce: Nonce,
|
|
40
|
+
ciphertext: Uint8Array,
|
|
41
|
+
aad: Uint8Array
|
|
42
|
+
): Uint8Array | undefined;
|
|
8
43
|
/**
|
|
9
44
|
* Encrypts data using AES-256-SIV authenticated encryption.
|
|
10
45
|
*
|
|
@@ -37,41 +72,16 @@ export function generate_user_keys(passphrase: string): UserKeys;
|
|
|
37
72
|
* const ciphertext = aead_encrypt(key, nonce, plaintext, aad);
|
|
38
73
|
* ```
|
|
39
74
|
*/
|
|
40
|
-
export function aead_encrypt(
|
|
75
|
+
export function aead_encrypt(
|
|
76
|
+
key: EncryptionKey,
|
|
77
|
+
nonce: Nonce,
|
|
78
|
+
plaintext: Uint8Array,
|
|
79
|
+
aad: Uint8Array
|
|
80
|
+
): Uint8Array;
|
|
41
81
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* # Parameters
|
|
45
|
-
*
|
|
46
|
-
* - `key`: The encryption key (64 bytes, must match encryption key)
|
|
47
|
-
* - `nonce`: The nonce (16 bytes, must match encryption nonce)
|
|
48
|
-
* - `ciphertext`: The encrypted data with authentication tag
|
|
49
|
-
* - `aad`: Additional authenticated data (must match encryption AAD)
|
|
50
|
-
*
|
|
51
|
-
* # Returns
|
|
52
|
-
*
|
|
53
|
-
* The decrypted plaintext, or `null` if authentication fails.
|
|
54
|
-
*
|
|
55
|
-
* # Security Notes
|
|
56
|
-
*
|
|
57
|
-
* - Returns `null` if:
|
|
58
|
-
* - The ciphertext has been tampered with
|
|
59
|
-
* - The wrong key or nonce is used
|
|
60
|
-
* - The AAD doesn't match
|
|
61
|
-
* - Never ignore a decryption failure; it indicates tampering or corruption
|
|
62
|
-
*
|
|
63
|
-
* # Example
|
|
64
|
-
*
|
|
65
|
-
* ```javascript
|
|
66
|
-
* const plaintext = aead_decrypt(key, nonce, ciphertext, aad);
|
|
67
|
-
* if (plaintext) {
|
|
68
|
-
* console.log("Decrypted:", new TextDecoder().decode(plaintext));
|
|
69
|
-
* } else {
|
|
70
|
-
* console.error("Decryption failed - data may be corrupted or tampered");
|
|
71
|
-
* }
|
|
72
|
-
* ```
|
|
82
|
+
* Generates user keys from a passphrase using password-based key derivation.
|
|
73
83
|
*/
|
|
74
|
-
export function
|
|
84
|
+
export function generate_user_keys(passphrase: string): UserKeys;
|
|
75
85
|
/**
|
|
76
86
|
* Session status indicating the state of a peer session.
|
|
77
87
|
*/
|
|
@@ -113,10 +123,18 @@ export class EncryptionKey {
|
|
|
113
123
|
private constructor();
|
|
114
124
|
free(): void;
|
|
115
125
|
[Symbol.dispose](): void;
|
|
126
|
+
/**
|
|
127
|
+
* Creates an encryption key from raw bytes (must be 64 bytes).
|
|
128
|
+
*/
|
|
129
|
+
static from_bytes(bytes: Uint8Array): EncryptionKey;
|
|
116
130
|
/**
|
|
117
131
|
* Generates a new random encryption key (64 bytes).
|
|
118
132
|
*/
|
|
119
133
|
static generate(): EncryptionKey;
|
|
134
|
+
/**
|
|
135
|
+
* Gets the raw bytes of the encryption key.
|
|
136
|
+
*/
|
|
137
|
+
to_bytes(): Uint8Array;
|
|
120
138
|
/**
|
|
121
139
|
* Generates a deterministic encryption key (64 bytes) from a seed and salt.
|
|
122
140
|
*
|
|
@@ -127,14 +145,6 @@ export class EncryptionKey {
|
|
|
127
145
|
* - `salt`: unique, random salt (minimum 8 bytes, recommended 16+ bytes)
|
|
128
146
|
*/
|
|
129
147
|
static from_seed(seed: string, salt: Uint8Array): EncryptionKey;
|
|
130
|
-
/**
|
|
131
|
-
* Creates an encryption key from raw bytes (must be 64 bytes).
|
|
132
|
-
*/
|
|
133
|
-
static from_bytes(bytes: Uint8Array): EncryptionKey;
|
|
134
|
-
/**
|
|
135
|
-
* Gets the raw bytes of the encryption key.
|
|
136
|
-
*/
|
|
137
|
-
to_bytes(): Uint8Array;
|
|
138
148
|
}
|
|
139
149
|
/**
|
|
140
150
|
* Nonce for AEAD operations (AES-256-SIV).
|
|
@@ -146,14 +156,14 @@ export class Nonce {
|
|
|
146
156
|
private constructor();
|
|
147
157
|
free(): void;
|
|
148
158
|
[Symbol.dispose](): void;
|
|
149
|
-
/**
|
|
150
|
-
* Generates a new random nonce (16 bytes).
|
|
151
|
-
*/
|
|
152
|
-
static generate(): Nonce;
|
|
153
159
|
/**
|
|
154
160
|
* Creates a nonce from raw bytes (must be 16 bytes).
|
|
155
161
|
*/
|
|
156
162
|
static from_bytes(bytes: Uint8Array): Nonce;
|
|
163
|
+
/**
|
|
164
|
+
* Generates a new random nonce (16 bytes).
|
|
165
|
+
*/
|
|
166
|
+
static generate(): Nonce;
|
|
157
167
|
/**
|
|
158
168
|
* Gets the raw bytes of the nonce.
|
|
159
169
|
*/
|
|
@@ -166,22 +176,22 @@ export class ReceiveMessageOutput {
|
|
|
166
176
|
private constructor();
|
|
167
177
|
free(): void;
|
|
168
178
|
[Symbol.dispose](): void;
|
|
169
|
-
/**
|
|
170
|
-
* Gets the received message contents.
|
|
171
|
-
*/
|
|
172
|
-
readonly message: Uint8Array;
|
|
173
|
-
/**
|
|
174
|
-
* Gets the message timestamp (milliseconds since Unix epoch).
|
|
175
|
-
*/
|
|
176
|
-
readonly timestamp: number;
|
|
177
179
|
/**
|
|
178
180
|
* Gets the list of newly acknowledged seekers.
|
|
179
181
|
*/
|
|
180
182
|
readonly acknowledged_seekers: Array<any>;
|
|
183
|
+
/**
|
|
184
|
+
* Gets the received message contents.
|
|
185
|
+
*/
|
|
186
|
+
readonly message: Uint8Array;
|
|
181
187
|
/**
|
|
182
188
|
* Gets the sender's user id (32 bytes).
|
|
183
189
|
*/
|
|
184
190
|
readonly user_id: Uint8Array;
|
|
191
|
+
/**
|
|
192
|
+
* Gets the message timestamp (milliseconds since Unix epoch).
|
|
193
|
+
*/
|
|
194
|
+
readonly timestamp: number;
|
|
185
195
|
}
|
|
186
196
|
/**
|
|
187
197
|
* Output from sending a message.
|
|
@@ -190,14 +200,14 @@ export class SendMessageOutput {
|
|
|
190
200
|
private constructor();
|
|
191
201
|
free(): void;
|
|
192
202
|
[Symbol.dispose](): void;
|
|
193
|
-
/**
|
|
194
|
-
* Gets the seeker (identifier for message board lookup).
|
|
195
|
-
*/
|
|
196
|
-
readonly seeker: Uint8Array;
|
|
197
203
|
/**
|
|
198
204
|
* Gets the encrypted message data.
|
|
199
205
|
*/
|
|
200
206
|
readonly data: Uint8Array;
|
|
207
|
+
/**
|
|
208
|
+
* Gets the seeker (identifier for message board lookup).
|
|
209
|
+
*/
|
|
210
|
+
readonly seeker: Uint8Array;
|
|
201
211
|
}
|
|
202
212
|
/**
|
|
203
213
|
* Session manager configuration for controlling session behavior.
|
|
@@ -205,10 +215,6 @@ export class SendMessageOutput {
|
|
|
205
215
|
export class SessionConfig {
|
|
206
216
|
free(): void;
|
|
207
217
|
[Symbol.dispose](): void;
|
|
208
|
-
/**
|
|
209
|
-
* Creates a new session configuration with the given parameters.
|
|
210
|
-
*/
|
|
211
|
-
constructor(max_incoming_announcement_age_millis: number, max_incoming_announcement_future_millis: number, max_incoming_message_age_millis: number, max_incoming_message_future_millis: number, max_session_inactivity_millis: number, keep_alive_interval_millis: number, max_session_lag_length: bigint);
|
|
212
218
|
/**
|
|
213
219
|
* Creates a default configuration with sensible defaults:
|
|
214
220
|
* - Announcement age: 1 week
|
|
@@ -220,6 +226,18 @@ export class SessionConfig {
|
|
|
220
226
|
* - Max lag: 10000 messages
|
|
221
227
|
*/
|
|
222
228
|
static new_default(): SessionConfig;
|
|
229
|
+
/**
|
|
230
|
+
* Creates a new session configuration with the given parameters.
|
|
231
|
+
*/
|
|
232
|
+
constructor(
|
|
233
|
+
max_incoming_announcement_age_millis: number,
|
|
234
|
+
max_incoming_announcement_future_millis: number,
|
|
235
|
+
max_incoming_message_age_millis: number,
|
|
236
|
+
max_incoming_message_future_millis: number,
|
|
237
|
+
max_session_inactivity_millis: number,
|
|
238
|
+
keep_alive_interval_millis: number,
|
|
239
|
+
max_session_lag_length: bigint
|
|
240
|
+
);
|
|
223
241
|
}
|
|
224
242
|
/**
|
|
225
243
|
* Session manager wrapper for WebAssembly.
|
|
@@ -228,17 +246,31 @@ export class SessionManagerWrapper {
|
|
|
228
246
|
free(): void;
|
|
229
247
|
[Symbol.dispose](): void;
|
|
230
248
|
/**
|
|
231
|
-
*
|
|
249
|
+
* Discards a peer and all associated session state.
|
|
232
250
|
*/
|
|
233
|
-
|
|
251
|
+
peer_discard(peer_id: Uint8Array): void;
|
|
234
252
|
/**
|
|
235
|
-
*
|
|
253
|
+
* Sends a message to a peer.
|
|
236
254
|
*/
|
|
237
|
-
|
|
255
|
+
send_message(
|
|
256
|
+
peer_id: Uint8Array,
|
|
257
|
+
message_contents: Uint8Array
|
|
258
|
+
): SendMessageOutput | undefined;
|
|
238
259
|
/**
|
|
239
260
|
* Serializes and encrypts the session manager into a blob.
|
|
240
261
|
*/
|
|
241
262
|
to_encrypted_blob(key: EncryptionKey): Uint8Array;
|
|
263
|
+
/**
|
|
264
|
+
* Deserializes a session manager from an encrypted blob.
|
|
265
|
+
*/
|
|
266
|
+
static from_encrypted_blob(
|
|
267
|
+
encrypted_blob: Uint8Array,
|
|
268
|
+
key: EncryptionKey
|
|
269
|
+
): SessionManagerWrapper;
|
|
270
|
+
/**
|
|
271
|
+
* Gets the session status for a peer.
|
|
272
|
+
*/
|
|
273
|
+
peer_session_status(peer_id: Uint8Array): SessionStatus;
|
|
242
274
|
/**
|
|
243
275
|
* Establishes an outgoing session with a peer.
|
|
244
276
|
*
|
|
@@ -266,7 +298,12 @@ export class SessionManagerWrapper {
|
|
|
266
298
|
*
|
|
267
299
|
* The announcement bytes to publish to the blockchain.
|
|
268
300
|
*/
|
|
269
|
-
establish_outgoing_session(
|
|
301
|
+
establish_outgoing_session(
|
|
302
|
+
peer_pk: UserPublicKeys,
|
|
303
|
+
our_pk: UserPublicKeys,
|
|
304
|
+
our_sk: UserSecretKeys,
|
|
305
|
+
user_data: Uint8Array
|
|
306
|
+
): Uint8Array;
|
|
270
307
|
/**
|
|
271
308
|
* Feeds an incoming announcement from the blockchain.
|
|
272
309
|
*
|
|
@@ -298,35 +335,35 @@ export class SessionManagerWrapper {
|
|
|
298
335
|
* metadata that is not highly sensitive. Send truly sensitive information through regular
|
|
299
336
|
* messages after the session is established.
|
|
300
337
|
*/
|
|
301
|
-
feed_incoming_announcement(
|
|
338
|
+
feed_incoming_announcement(
|
|
339
|
+
announcement_bytes: Uint8Array,
|
|
340
|
+
our_pk: UserPublicKeys,
|
|
341
|
+
our_sk: UserSecretKeys
|
|
342
|
+
): AnnouncementResult | undefined;
|
|
302
343
|
/**
|
|
303
344
|
* Gets the list of message board seekers to monitor.
|
|
304
345
|
*/
|
|
305
346
|
get_message_board_read_keys(): Array<any>;
|
|
306
|
-
/**
|
|
307
|
-
* Sends a message to a peer.
|
|
308
|
-
*/
|
|
309
|
-
send_message(peer_id: Uint8Array, message_contents: Uint8Array): SendMessageOutput | undefined;
|
|
310
347
|
/**
|
|
311
348
|
* Processes an incoming message from the message board.
|
|
312
349
|
*/
|
|
313
|
-
feed_incoming_message_board_read(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
350
|
+
feed_incoming_message_board_read(
|
|
351
|
+
seeker: Uint8Array,
|
|
352
|
+
ciphertext: Uint8Array,
|
|
353
|
+
our_sk: UserSecretKeys
|
|
354
|
+
): ReceiveMessageOutput | undefined;
|
|
318
355
|
/**
|
|
319
|
-
*
|
|
320
|
-
*/
|
|
321
|
-
peer_session_status(peer_id: Uint8Array): SessionStatus;
|
|
322
|
-
/**
|
|
323
|
-
* Discards a peer and all associated session state.
|
|
356
|
+
* Creates a new session manager with the given configuration.
|
|
324
357
|
*/
|
|
325
|
-
|
|
358
|
+
constructor(config: SessionConfig);
|
|
326
359
|
/**
|
|
327
360
|
* Refreshes sessions and returns peer IDs that need keep-alive messages.
|
|
328
361
|
*/
|
|
329
362
|
refresh(): Array<any>;
|
|
363
|
+
/**
|
|
364
|
+
* Gets the list of all peer IDs.
|
|
365
|
+
*/
|
|
366
|
+
peer_list(): Array<any>;
|
|
330
367
|
}
|
|
331
368
|
/**
|
|
332
369
|
* User keypair containing both public and secret keys.
|
|
@@ -352,21 +389,17 @@ export class UserPublicKeys {
|
|
|
352
389
|
free(): void;
|
|
353
390
|
[Symbol.dispose](): void;
|
|
354
391
|
/**
|
|
355
|
-
*
|
|
392
|
+
* Deserializes public keys from bytes.
|
|
356
393
|
*/
|
|
357
|
-
|
|
394
|
+
static from_bytes(bytes: Uint8Array): UserPublicKeys;
|
|
358
395
|
/**
|
|
359
396
|
* Serializes the public keys to bytes.
|
|
360
397
|
*/
|
|
361
398
|
to_bytes(): Uint8Array;
|
|
362
399
|
/**
|
|
363
|
-
*
|
|
364
|
-
*/
|
|
365
|
-
static from_bytes(bytes: Uint8Array): UserPublicKeys;
|
|
366
|
-
/**
|
|
367
|
-
* Gets the DSA verification key bytes.
|
|
400
|
+
* Derives a unique user ID from the public keys.
|
|
368
401
|
*/
|
|
369
|
-
|
|
402
|
+
derive_id(): Uint8Array;
|
|
370
403
|
/**
|
|
371
404
|
* Gets the KEM public key bytes.
|
|
372
405
|
*/
|
|
@@ -375,6 +408,10 @@ export class UserPublicKeys {
|
|
|
375
408
|
* Gets the Massa public key bytes.
|
|
376
409
|
*/
|
|
377
410
|
readonly massa_public_key: Uint8Array;
|
|
411
|
+
/**
|
|
412
|
+
* Gets the DSA verification key bytes.
|
|
413
|
+
*/
|
|
414
|
+
readonly dsa_verification_key: Uint8Array;
|
|
378
415
|
}
|
|
379
416
|
/**
|
|
380
417
|
* User secret keys for signing and decryption.
|
|
@@ -383,116 +420,219 @@ export class UserSecretKeys {
|
|
|
383
420
|
private constructor();
|
|
384
421
|
free(): void;
|
|
385
422
|
[Symbol.dispose](): void;
|
|
386
|
-
/**
|
|
387
|
-
* Serializes the secret keys to bytes for secure storage.
|
|
388
|
-
*/
|
|
389
|
-
to_bytes(): Uint8Array;
|
|
390
423
|
/**
|
|
391
424
|
* Deserializes secret keys from bytes.
|
|
392
425
|
*/
|
|
393
426
|
static from_bytes(bytes: Uint8Array): UserSecretKeys;
|
|
394
427
|
/**
|
|
395
|
-
*
|
|
428
|
+
* Serializes the secret keys to bytes for secure storage.
|
|
396
429
|
*/
|
|
397
|
-
|
|
430
|
+
to_bytes(): Uint8Array;
|
|
398
431
|
/**
|
|
399
432
|
* Gets the KEM secret key bytes.
|
|
400
433
|
*/
|
|
401
434
|
readonly kem_secret_key: Uint8Array;
|
|
435
|
+
/**
|
|
436
|
+
* Gets the DSA signing key bytes.
|
|
437
|
+
*/
|
|
438
|
+
readonly dsa_signing_key: Uint8Array;
|
|
402
439
|
/**
|
|
403
440
|
* Gets only the Massa secret key bytes
|
|
404
441
|
*/
|
|
405
442
|
readonly massa_secret_key: Uint8Array;
|
|
406
443
|
}
|
|
407
444
|
|
|
408
|
-
export type InitInput =
|
|
445
|
+
export type InitInput =
|
|
446
|
+
| RequestInfo
|
|
447
|
+
| URL
|
|
448
|
+
| Response
|
|
449
|
+
| BufferSource
|
|
450
|
+
| WebAssembly.Module;
|
|
409
451
|
|
|
410
452
|
export interface InitOutput {
|
|
411
453
|
readonly memory: WebAssembly.Memory;
|
|
454
|
+
readonly __wbg_announcementresult_free: (a: number, b: number) => void;
|
|
455
|
+
readonly __wbg_encryptionkey_free: (a: number, b: number) => void;
|
|
456
|
+
readonly __wbg_nonce_free: (a: number, b: number) => void;
|
|
457
|
+
readonly __wbg_receivemessageoutput_free: (a: number, b: number) => void;
|
|
458
|
+
readonly __wbg_sendmessageoutput_free: (a: number, b: number) => void;
|
|
412
459
|
readonly __wbg_sessionconfig_free: (a: number, b: number) => void;
|
|
413
|
-
readonly
|
|
414
|
-
readonly
|
|
460
|
+
readonly __wbg_sessionmanagerwrapper_free: (a: number, b: number) => void;
|
|
461
|
+
readonly __wbg_userkeys_free: (a: number, b: number) => void;
|
|
415
462
|
readonly __wbg_userpublickeys_free: (a: number, b: number) => void;
|
|
416
|
-
readonly userpublickeys_derive_id: (a: number) => [number, number];
|
|
417
|
-
readonly userpublickeys_dsa_verification_key: (a: number) => [number, number];
|
|
418
|
-
readonly userpublickeys_kem_public_key: (a: number) => [number, number];
|
|
419
|
-
readonly userpublickeys_massa_public_key: (a: number) => [number, number];
|
|
420
|
-
readonly userpublickeys_to_bytes: (a: number) => [number, number, number, number];
|
|
421
|
-
readonly userpublickeys_from_bytes: (a: number, b: number) => [number, number, number];
|
|
422
463
|
readonly __wbg_usersecretkeys_free: (a: number, b: number) => void;
|
|
423
|
-
readonly
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
readonly
|
|
432
|
-
|
|
464
|
+
readonly aead_decrypt: (
|
|
465
|
+
a: number,
|
|
466
|
+
b: number,
|
|
467
|
+
c: number,
|
|
468
|
+
d: number,
|
|
469
|
+
e: number,
|
|
470
|
+
f: number
|
|
471
|
+
) => [number, number];
|
|
472
|
+
readonly aead_encrypt: (
|
|
473
|
+
a: number,
|
|
474
|
+
b: number,
|
|
475
|
+
c: number,
|
|
476
|
+
d: number,
|
|
477
|
+
e: number,
|
|
478
|
+
f: number
|
|
479
|
+
) => [number, number];
|
|
480
|
+
readonly announcementresult_announcer_public_keys: (a: number) => number;
|
|
481
|
+
readonly announcementresult_timestamp: (a: number) => number;
|
|
482
|
+
readonly announcementresult_user_data: (a: number) => [number, number];
|
|
483
|
+
readonly encryptionkey_from_bytes: (
|
|
484
|
+
a: number,
|
|
485
|
+
b: number
|
|
486
|
+
) => [number, number, number];
|
|
487
|
+
readonly encryptionkey_from_seed: (
|
|
488
|
+
a: number,
|
|
489
|
+
b: number,
|
|
490
|
+
c: number,
|
|
491
|
+
d: number
|
|
492
|
+
) => [number, number, number];
|
|
433
493
|
readonly encryptionkey_generate: () => number;
|
|
434
|
-
readonly encryptionkey_from_seed: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
435
|
-
readonly encryptionkey_from_bytes: (a: number, b: number) => [number, number, number];
|
|
436
494
|
readonly encryptionkey_to_bytes: (a: number) => [number, number];
|
|
437
|
-
readonly
|
|
438
|
-
|
|
495
|
+
readonly generate_user_keys: (
|
|
496
|
+
a: number,
|
|
497
|
+
b: number
|
|
498
|
+
) => [number, number, number];
|
|
439
499
|
readonly nonce_from_bytes: (a: number, b: number) => [number, number, number];
|
|
500
|
+
readonly nonce_generate: () => number;
|
|
440
501
|
readonly nonce_to_bytes: (a: number) => [number, number];
|
|
441
|
-
readonly
|
|
442
|
-
readonly aead_decrypt: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
443
|
-
readonly __wbg_sendmessageoutput_free: (a: number, b: number) => void;
|
|
444
|
-
readonly sendmessageoutput_seeker: (a: number) => [number, number];
|
|
445
|
-
readonly sendmessageoutput_data: (a: number) => [number, number];
|
|
446
|
-
readonly __wbg_receivemessageoutput_free: (a: number, b: number) => void;
|
|
447
|
-
readonly __wbg_announcementresult_free: (a: number, b: number) => void;
|
|
448
|
-
readonly announcementresult_announcer_public_keys: (a: number) => number;
|
|
449
|
-
readonly announcementresult_timestamp: (a: number) => number;
|
|
450
|
-
readonly announcementresult_user_data: (a: number) => [number, number];
|
|
502
|
+
readonly receivemessageoutput_acknowledged_seekers: (a: number) => any;
|
|
451
503
|
readonly receivemessageoutput_message: (a: number) => [number, number];
|
|
452
504
|
readonly receivemessageoutput_timestamp: (a: number) => number;
|
|
453
|
-
readonly receivemessageoutput_acknowledged_seekers: (a: number) => any;
|
|
454
505
|
readonly receivemessageoutput_user_id: (a: number) => [number, number];
|
|
455
|
-
readonly
|
|
506
|
+
readonly sendmessageoutput_data: (a: number) => [number, number];
|
|
507
|
+
readonly sendmessageoutput_seeker: (a: number) => [number, number];
|
|
508
|
+
readonly sessionconfig_new: (
|
|
509
|
+
a: number,
|
|
510
|
+
b: number,
|
|
511
|
+
c: number,
|
|
512
|
+
d: number,
|
|
513
|
+
e: number,
|
|
514
|
+
f: number,
|
|
515
|
+
g: bigint
|
|
516
|
+
) => number;
|
|
517
|
+
readonly sessionconfig_new_default: () => number;
|
|
518
|
+
readonly sessionmanagerwrapper_establish_outgoing_session: (
|
|
519
|
+
a: number,
|
|
520
|
+
b: number,
|
|
521
|
+
c: number,
|
|
522
|
+
d: number,
|
|
523
|
+
e: number,
|
|
524
|
+
f: number
|
|
525
|
+
) => [number, number];
|
|
526
|
+
readonly sessionmanagerwrapper_feed_incoming_announcement: (
|
|
527
|
+
a: number,
|
|
528
|
+
b: number,
|
|
529
|
+
c: number,
|
|
530
|
+
d: number,
|
|
531
|
+
e: number
|
|
532
|
+
) => number;
|
|
533
|
+
readonly sessionmanagerwrapper_feed_incoming_message_board_read: (
|
|
534
|
+
a: number,
|
|
535
|
+
b: number,
|
|
536
|
+
c: number,
|
|
537
|
+
d: number,
|
|
538
|
+
e: number,
|
|
539
|
+
f: number
|
|
540
|
+
) => number;
|
|
541
|
+
readonly sessionmanagerwrapper_from_encrypted_blob: (
|
|
542
|
+
a: number,
|
|
543
|
+
b: number,
|
|
544
|
+
c: number
|
|
545
|
+
) => [number, number, number];
|
|
546
|
+
readonly sessionmanagerwrapper_get_message_board_read_keys: (
|
|
547
|
+
a: number
|
|
548
|
+
) => any;
|
|
456
549
|
readonly sessionmanagerwrapper_new: (a: number) => number;
|
|
457
|
-
readonly
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
readonly sessionmanagerwrapper_send_message: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
463
|
-
readonly sessionmanagerwrapper_feed_incoming_message_board_read: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
550
|
+
readonly sessionmanagerwrapper_peer_discard: (
|
|
551
|
+
a: number,
|
|
552
|
+
b: number,
|
|
553
|
+
c: number
|
|
554
|
+
) => [number, number];
|
|
464
555
|
readonly sessionmanagerwrapper_peer_list: (a: number) => any;
|
|
465
|
-
readonly sessionmanagerwrapper_peer_session_status: (
|
|
466
|
-
|
|
556
|
+
readonly sessionmanagerwrapper_peer_session_status: (
|
|
557
|
+
a: number,
|
|
558
|
+
b: number,
|
|
559
|
+
c: number
|
|
560
|
+
) => [number, number, number];
|
|
467
561
|
readonly sessionmanagerwrapper_refresh: (a: number) => any;
|
|
562
|
+
readonly sessionmanagerwrapper_send_message: (
|
|
563
|
+
a: number,
|
|
564
|
+
b: number,
|
|
565
|
+
c: number,
|
|
566
|
+
d: number,
|
|
567
|
+
e: number
|
|
568
|
+
) => [number, number, number];
|
|
569
|
+
readonly sessionmanagerwrapper_to_encrypted_blob: (
|
|
570
|
+
a: number,
|
|
571
|
+
b: number
|
|
572
|
+
) => [number, number, number, number];
|
|
573
|
+
readonly userkeys_public_keys: (a: number) => [number, number, number];
|
|
574
|
+
readonly userkeys_secret_keys: (a: number) => [number, number, number];
|
|
575
|
+
readonly userpublickeys_derive_id: (a: number) => [number, number];
|
|
576
|
+
readonly userpublickeys_dsa_verification_key: (a: number) => [number, number];
|
|
577
|
+
readonly userpublickeys_from_bytes: (
|
|
578
|
+
a: number,
|
|
579
|
+
b: number
|
|
580
|
+
) => [number, number, number];
|
|
581
|
+
readonly userpublickeys_kem_public_key: (a: number) => [number, number];
|
|
582
|
+
readonly userpublickeys_massa_public_key: (a: number) => [number, number];
|
|
583
|
+
readonly userpublickeys_to_bytes: (
|
|
584
|
+
a: number
|
|
585
|
+
) => [number, number, number, number];
|
|
586
|
+
readonly usersecretkeys_dsa_signing_key: (a: number) => [number, number];
|
|
587
|
+
readonly usersecretkeys_from_bytes: (
|
|
588
|
+
a: number,
|
|
589
|
+
b: number
|
|
590
|
+
) => [number, number, number];
|
|
591
|
+
readonly usersecretkeys_kem_secret_key: (a: number) => [number, number];
|
|
592
|
+
readonly usersecretkeys_massa_secret_key: (a: number) => [number, number];
|
|
593
|
+
readonly usersecretkeys_to_bytes: (
|
|
594
|
+
a: number
|
|
595
|
+
) => [number, number, number, number];
|
|
468
596
|
readonly start: () => void;
|
|
469
597
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
470
598
|
readonly __externref_table_alloc: () => number;
|
|
471
599
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
472
600
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
473
601
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
474
|
-
readonly __wbindgen_realloc: (
|
|
602
|
+
readonly __wbindgen_realloc: (
|
|
603
|
+
a: number,
|
|
604
|
+
b: number,
|
|
605
|
+
c: number,
|
|
606
|
+
d: number
|
|
607
|
+
) => number;
|
|
475
608
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
476
609
|
readonly __wbindgen_start: () => void;
|
|
477
610
|
}
|
|
478
611
|
|
|
479
612
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
480
613
|
/**
|
|
481
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
482
|
-
* a precompiled `WebAssembly.Module`.
|
|
483
|
-
*
|
|
484
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
485
|
-
*
|
|
486
|
-
* @returns {InitOutput}
|
|
487
|
-
*/
|
|
488
|
-
export function initSync(
|
|
614
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
615
|
+
* a precompiled `WebAssembly.Module`.
|
|
616
|
+
*
|
|
617
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
618
|
+
*
|
|
619
|
+
* @returns {InitOutput}
|
|
620
|
+
*/
|
|
621
|
+
export function initSync(
|
|
622
|
+
module: { module: SyncInitInput } | SyncInitInput
|
|
623
|
+
): InitOutput;
|
|
489
624
|
|
|
490
625
|
/**
|
|
491
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
492
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
493
|
-
*
|
|
494
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
495
|
-
*
|
|
496
|
-
* @returns {Promise<InitOutput>}
|
|
497
|
-
*/
|
|
498
|
-
export default function __wbg_init
|
|
626
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
627
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
628
|
+
*
|
|
629
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
630
|
+
*
|
|
631
|
+
* @returns {Promise<InitOutput>}
|
|
632
|
+
*/
|
|
633
|
+
export default function __wbg_init(
|
|
634
|
+
module_or_path?:
|
|
635
|
+
| { module_or_path: InitInput | Promise<InitInput> }
|
|
636
|
+
| InitInput
|
|
637
|
+
| Promise<InitInput>
|
|
638
|
+
): Promise<InitOutput>;
|