cojson-core-rn 0.19.10

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.
Files changed (46) hide show
  1. package/CojsonCoreRn.podspec +44 -0
  2. package/CojsonCoreRnFramework.xcframework/Info.plist +43 -0
  3. package/CojsonCoreRnFramework.xcframework/ios-arm64/libcojson_core_rn.a +0 -0
  4. package/CojsonCoreRnFramework.xcframework/ios-arm64-simulator/libcojson_core_rn.a +0 -0
  5. package/LICENSE.txt +19 -0
  6. package/README.md +50 -0
  7. package/android/CMakeLists.txt +76 -0
  8. package/android/build.gradle +144 -0
  9. package/android/cpp-adapter.cpp +43 -0
  10. package/android/gradle.properties +5 -0
  11. package/android/src/main/AndroidManifest.xml +5 -0
  12. package/android/src/main/java/com/cojsoncorern/CojsonCoreRnModule.kt +43 -0
  13. package/android/src/main/java/com/cojsoncorern/CojsonCoreRnPackage.kt +34 -0
  14. package/android/src/main/jniLibs/arm64-v8a/libcojson_core_rn.a +0 -0
  15. package/android/src/main/jniLibs/armeabi-v7a/libcojson_core_rn.a +0 -0
  16. package/android/src/main/jniLibs/x86/libcojson_core_rn.a +0 -0
  17. package/android/src/main/jniLibs/x86_64/libcojson_core_rn.a +0 -0
  18. package/cpp/cojson-core-rn.cpp +16 -0
  19. package/cpp/cojson-core-rn.h +15 -0
  20. package/cpp/generated/cojson_core_rn.cpp +3523 -0
  21. package/cpp/generated/cojson_core_rn.hpp +128 -0
  22. package/ios/CojsonCoreRn.h +16 -0
  23. package/ios/CojsonCoreRn.mm +66 -0
  24. package/lib/module/NativeCojsonCoreRn.js +7 -0
  25. package/lib/module/NativeCojsonCoreRn.js.map +1 -0
  26. package/lib/module/generated/cojson_core_rn-ffi.js +43 -0
  27. package/lib/module/generated/cojson_core_rn-ffi.js.map +1 -0
  28. package/lib/module/generated/cojson_core_rn.js +1311 -0
  29. package/lib/module/generated/cojson_core_rn.js.map +1 -0
  30. package/lib/module/index.js +43 -0
  31. package/lib/module/index.js.map +1 -0
  32. package/lib/module/package.json +1 -0
  33. package/lib/typescript/package.json +1 -0
  34. package/lib/typescript/src/NativeCojsonCoreRn.d.ts +8 -0
  35. package/lib/typescript/src/NativeCojsonCoreRn.d.ts.map +1 -0
  36. package/lib/typescript/src/generated/cojson_core_rn-ffi.d.ts +158 -0
  37. package/lib/typescript/src/generated/cojson_core_rn-ffi.d.ts.map +1 -0
  38. package/lib/typescript/src/generated/cojson_core_rn.d.ts +1299 -0
  39. package/lib/typescript/src/generated/cojson_core_rn.d.ts.map +1 -0
  40. package/lib/typescript/src/index.d.ts +8 -0
  41. package/lib/typescript/src/index.d.ts.map +1 -0
  42. package/package.json +167 -0
  43. package/src/NativeCojsonCoreRn.ts +10 -0
  44. package/src/generated/cojson_core_rn-ffi.ts +429 -0
  45. package/src/generated/cojson_core_rn.ts +2342 -0
  46. package/src/index.tsx +41 -0
@@ -0,0 +1,2342 @@
1
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
2
+ // Trust me, you don't want to mess with it!
3
+ import nativeModule, {
4
+ type UniffiRustFutureContinuationCallback,
5
+ type UniffiForeignFuture,
6
+ type UniffiForeignFutureStructU8,
7
+ type UniffiForeignFutureCompleteU8,
8
+ type UniffiForeignFutureStructI8,
9
+ type UniffiForeignFutureCompleteI8,
10
+ type UniffiForeignFutureStructU16,
11
+ type UniffiForeignFutureCompleteU16,
12
+ type UniffiForeignFutureStructI16,
13
+ type UniffiForeignFutureCompleteI16,
14
+ type UniffiForeignFutureStructU32,
15
+ type UniffiForeignFutureCompleteU32,
16
+ type UniffiForeignFutureStructI32,
17
+ type UniffiForeignFutureCompleteI32,
18
+ type UniffiForeignFutureStructU64,
19
+ type UniffiForeignFutureCompleteU64,
20
+ type UniffiForeignFutureStructI64,
21
+ type UniffiForeignFutureCompleteI64,
22
+ type UniffiForeignFutureStructF32,
23
+ type UniffiForeignFutureCompleteF32,
24
+ type UniffiForeignFutureStructF64,
25
+ type UniffiForeignFutureCompleteF64,
26
+ type UniffiForeignFutureStructPointer,
27
+ type UniffiForeignFutureCompletePointer,
28
+ type UniffiForeignFutureStructRustBuffer,
29
+ type UniffiForeignFutureCompleteRustBuffer,
30
+ type UniffiForeignFutureStructVoid,
31
+ type UniffiForeignFutureCompleteVoid,
32
+ } from './cojson_core_rn-ffi';
33
+ import {
34
+ type FfiConverter,
35
+ type UniffiByteArray,
36
+ type UniffiObjectFactory,
37
+ type UniffiRustArcPtr,
38
+ type UnsafeMutableRawPointer,
39
+ AbstractFfiConverterByteArray,
40
+ FfiConverterArray,
41
+ FfiConverterArrayBuffer,
42
+ FfiConverterBool,
43
+ FfiConverterFloat64,
44
+ FfiConverterInt32,
45
+ FfiConverterObject,
46
+ FfiConverterOptional,
47
+ FfiConverterUInt32,
48
+ FfiConverterUInt64,
49
+ RustBuffer,
50
+ UniffiAbstractObject,
51
+ UniffiError,
52
+ UniffiInternalError,
53
+ UniffiRustCaller,
54
+ destructorGuardSymbol,
55
+ pointerLiteralSymbol,
56
+ uniffiCreateFfiConverterString,
57
+ uniffiTypeNameSymbol,
58
+ variantOrdinalSymbol,
59
+ } from 'uniffi-bindgen-react-native';
60
+
61
+ // Get converters from the other files, if any.
62
+ const uniffiCaller = new UniffiRustCaller(() => ({ code: 0 }));
63
+
64
+ const uniffiIsDebug =
65
+ // @ts-ignore -- The process global might not be defined
66
+ typeof process !== 'object' ||
67
+ // @ts-ignore -- The process global might not be defined
68
+ process?.env?.NODE_ENV !== 'production' ||
69
+ false;
70
+ // Public interface members begin here.
71
+
72
+ /**
73
+ * Hash data once using BLAKE3.
74
+ * - `data`: Raw bytes to hash
75
+ * Returns 32 bytes of hash output.
76
+ * This is the simplest way to compute a BLAKE3 hash of a single piece of data.
77
+ */
78
+ export function blake3HashOnce(data: ArrayBuffer): ArrayBuffer {
79
+ return FfiConverterArrayBuffer.lift(
80
+ uniffiCaller.rustCall(
81
+ /*caller:*/ (callStatus) => {
82
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_blake3_hash_once(
83
+ FfiConverterArrayBuffer.lower(data),
84
+ callStatus
85
+ );
86
+ },
87
+ /*liftString:*/ FfiConverterString.lift
88
+ )
89
+ );
90
+ }
91
+ /**
92
+ * Hash data once using BLAKE3 with a context prefix.
93
+ * - `data`: Raw bytes to hash
94
+ * - `context`: Context bytes to prefix to the data
95
+ * Returns 32 bytes of hash output.
96
+ * This is useful for domain separation - the same data hashed with different contexts will produce different outputs.
97
+ */
98
+ export function blake3HashOnceWithContext(
99
+ data: ArrayBuffer,
100
+ context: ArrayBuffer
101
+ ): ArrayBuffer {
102
+ return FfiConverterArrayBuffer.lift(
103
+ uniffiCaller.rustCall(
104
+ /*caller:*/ (callStatus) => {
105
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_blake3_hash_once_with_context(
106
+ FfiConverterArrayBuffer.lower(data),
107
+ FfiConverterArrayBuffer.lower(context),
108
+ callStatus
109
+ );
110
+ },
111
+ /*liftString:*/ FfiConverterString.lift
112
+ )
113
+ );
114
+ }
115
+ /**
116
+ * Uniffi-exposed function to decrypt bytes with a key secret and nonce material.
117
+ * - `ciphertext`: The encrypted bytes to decrypt
118
+ * - `key_secret`: A base58-encoded key secret with "keySecret_z" prefix
119
+ * - `nonce_material`: Raw bytes used to generate the nonce (must match encryption)
120
+ * Returns the decrypted bytes or throws an error if decryption fails.
121
+ */
122
+ export function decrypt(
123
+ ciphertext: ArrayBuffer,
124
+ keySecret: string,
125
+ nonceMaterial: ArrayBuffer
126
+ ): ArrayBuffer /*throws*/ {
127
+ return FfiConverterArrayBuffer.lift(
128
+ uniffiCaller.rustCallWithError(
129
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
130
+ FfiConverterTypeCryptoErrorUniffi
131
+ ),
132
+ /*caller:*/ (callStatus) => {
133
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_decrypt(
134
+ FfiConverterArrayBuffer.lower(ciphertext),
135
+ FfiConverterString.lower(keySecret),
136
+ FfiConverterArrayBuffer.lower(nonceMaterial),
137
+ callStatus
138
+ );
139
+ },
140
+ /*liftString:*/ FfiConverterString.lift
141
+ )
142
+ );
143
+ }
144
+ /**
145
+ * Uniffi-exposed function for XSalsa20 decryption without authentication.
146
+ * - `key`: 32-byte key for decryption (must match encryption key)
147
+ * - `nonce_material`: Raw bytes used to generate a 24-byte nonce (must match encryption)
148
+ * - `ciphertext`: Encrypted bytes to decrypt
149
+ * Returns the decrypted bytes or throws an error if decryption fails.
150
+ * Note: This function does not provide authentication. Use decrypt_xsalsa20_poly1305 for authenticated decryption.
151
+ */
152
+ export function decryptXsalsa20(
153
+ key: ArrayBuffer,
154
+ nonceMaterial: ArrayBuffer,
155
+ ciphertext: ArrayBuffer
156
+ ): ArrayBuffer /*throws*/ {
157
+ return FfiConverterArrayBuffer.lift(
158
+ uniffiCaller.rustCallWithError(
159
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
160
+ FfiConverterTypeCryptoErrorUniffi
161
+ ),
162
+ /*caller:*/ (callStatus) => {
163
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_decrypt_xsalsa20(
164
+ FfiConverterArrayBuffer.lower(key),
165
+ FfiConverterArrayBuffer.lower(nonceMaterial),
166
+ FfiConverterArrayBuffer.lower(ciphertext),
167
+ callStatus
168
+ );
169
+ },
170
+ /*liftString:*/ FfiConverterString.lift
171
+ )
172
+ );
173
+ }
174
+ /**
175
+ * uniffi-exposed function to sign a message using Ed25519.
176
+ * - `signing_key`: 32 bytes of signing key material
177
+ * - `message`: Raw bytes to sign
178
+ * Returns 64 bytes of signature material or throws CryptoErrorUniffi if signing fails.
179
+ */
180
+ export function ed25519Sign(
181
+ signingKey: ArrayBuffer,
182
+ message: ArrayBuffer
183
+ ): ArrayBuffer /*throws*/ {
184
+ return FfiConverterArrayBuffer.lift(
185
+ uniffiCaller.rustCallWithError(
186
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
187
+ FfiConverterTypeCryptoErrorUniffi
188
+ ),
189
+ /*caller:*/ (callStatus) => {
190
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_sign(
191
+ FfiConverterArrayBuffer.lower(signingKey),
192
+ FfiConverterArrayBuffer.lower(message),
193
+ callStatus
194
+ );
195
+ },
196
+ /*liftString:*/ FfiConverterString.lift
197
+ )
198
+ );
199
+ }
200
+ /**
201
+ * uniffi-exposed function to validate and copy Ed25519 signature bytes.
202
+ * - `bytes`: 64 bytes of signature material to validate
203
+ * Returns the same 64 bytes if valid or throws CryptoErrorUniffi if invalid.
204
+ */
205
+ export function ed25519SignatureFromBytes(
206
+ bytes: ArrayBuffer
207
+ ): ArrayBuffer /*throws*/ {
208
+ return FfiConverterArrayBuffer.lift(
209
+ uniffiCaller.rustCallWithError(
210
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
211
+ FfiConverterTypeCryptoErrorUniffi
212
+ ),
213
+ /*caller:*/ (callStatus) => {
214
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_signature_from_bytes(
215
+ FfiConverterArrayBuffer.lower(bytes),
216
+ callStatus
217
+ );
218
+ },
219
+ /*liftString:*/ FfiConverterString.lift
220
+ )
221
+ );
222
+ }
223
+ /**
224
+ * uniffi-exposed function to validate and copy Ed25519 signing key bytes.
225
+ * - `bytes`: 32 bytes of signing key material to validate
226
+ * Returns the same 32 bytes if valid or throws CryptoErrorUniffi if invalid.
227
+ */
228
+ export function ed25519SigningKeyFromBytes(
229
+ bytes: ArrayBuffer
230
+ ): ArrayBuffer /*throws*/ {
231
+ return FfiConverterArrayBuffer.lift(
232
+ uniffiCaller.rustCallWithError(
233
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
234
+ FfiConverterTypeCryptoErrorUniffi
235
+ ),
236
+ /*caller:*/ (callStatus) => {
237
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_from_bytes(
238
+ FfiConverterArrayBuffer.lower(bytes),
239
+ callStatus
240
+ );
241
+ },
242
+ /*liftString:*/ FfiConverterString.lift
243
+ )
244
+ );
245
+ }
246
+ /**
247
+ * uniffi-exposed function to sign a message with an Ed25519 signing key.
248
+ * - `signing_key`: 32 bytes of signing key material
249
+ * - `message`: Raw bytes to sign
250
+ * Returns 64 bytes of signature material or throws CryptoErrorUniffi if signing fails.
251
+ */
252
+ export function ed25519SigningKeySign(
253
+ signingKey: ArrayBuffer,
254
+ message: ArrayBuffer
255
+ ): ArrayBuffer /*throws*/ {
256
+ return FfiConverterArrayBuffer.lift(
257
+ uniffiCaller.rustCallWithError(
258
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
259
+ FfiConverterTypeCryptoErrorUniffi
260
+ ),
261
+ /*caller:*/ (callStatus) => {
262
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_sign(
263
+ FfiConverterArrayBuffer.lower(signingKey),
264
+ FfiConverterArrayBuffer.lower(message),
265
+ callStatus
266
+ );
267
+ },
268
+ /*liftString:*/ FfiConverterString.lift
269
+ )
270
+ );
271
+ }
272
+ /**
273
+ * uniffi-exposed function to derive the public key from an Ed25519 signing key.
274
+ * - `signing_key`: 32 bytes of signing key material
275
+ * Returns 32 bytes of public key material or throws CryptoErrorUniffi if key is invalid.
276
+ */
277
+ export function ed25519SigningKeyToPublic(
278
+ signingKey: ArrayBuffer
279
+ ): ArrayBuffer /*throws*/ {
280
+ return FfiConverterArrayBuffer.lift(
281
+ uniffiCaller.rustCallWithError(
282
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
283
+ FfiConverterTypeCryptoErrorUniffi
284
+ ),
285
+ /*caller:*/ (callStatus) => {
286
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_to_public(
287
+ FfiConverterArrayBuffer.lower(signingKey),
288
+ callStatus
289
+ );
290
+ },
291
+ /*liftString:*/ FfiConverterString.lift
292
+ )
293
+ );
294
+ }
295
+ /**
296
+ * uniffi-exposed function to verify an Ed25519 signature.
297
+ * - `verifying_key`: 32 bytes of verifying key material
298
+ * - `message`: Raw bytes that were signed
299
+ * - `signature`: 64 bytes of signature material
300
+ * Returns true if signature is valid, false otherwise, or throws CryptoErrorUniffi if verification fails.
301
+ */
302
+ export function ed25519Verify(
303
+ verifyingKey: ArrayBuffer,
304
+ message: ArrayBuffer,
305
+ signature: ArrayBuffer
306
+ ): boolean /*throws*/ {
307
+ return FfiConverterBool.lift(
308
+ uniffiCaller.rustCallWithError(
309
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
310
+ FfiConverterTypeCryptoErrorUniffi
311
+ ),
312
+ /*caller:*/ (callStatus) => {
313
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_verify(
314
+ FfiConverterArrayBuffer.lower(verifyingKey),
315
+ FfiConverterArrayBuffer.lower(message),
316
+ FfiConverterArrayBuffer.lower(signature),
317
+ callStatus
318
+ );
319
+ },
320
+ /*liftString:*/ FfiConverterString.lift
321
+ )
322
+ );
323
+ }
324
+ /**
325
+ * uniffi-exposed function to derive an Ed25519 verifying key from a signing key.
326
+ * - `signing_key`: 32 bytes of signing key material
327
+ * Returns 32 bytes of verifying key material or throws CryptoErrorUniffi if key is invalid.
328
+ */
329
+ export function ed25519VerifyingKey(
330
+ signingKey: ArrayBuffer
331
+ ): ArrayBuffer /*throws*/ {
332
+ return FfiConverterArrayBuffer.lift(
333
+ uniffiCaller.rustCallWithError(
334
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
335
+ FfiConverterTypeCryptoErrorUniffi
336
+ ),
337
+ /*caller:*/ (callStatus) => {
338
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_verifying_key(
339
+ FfiConverterArrayBuffer.lower(signingKey),
340
+ callStatus
341
+ );
342
+ },
343
+ /*liftString:*/ FfiConverterString.lift
344
+ )
345
+ );
346
+ }
347
+ /**
348
+ * uniffi-exposed function to validate and copy Ed25519 verifying key bytes.
349
+ * - `bytes`: 32 bytes of verifying key material to validate
350
+ * Returns the same 32 bytes if valid or throws CryptoErrorUniffi if invalid.
351
+ */
352
+ export function ed25519VerifyingKeyFromBytes(
353
+ bytes: ArrayBuffer
354
+ ): ArrayBuffer /*throws*/ {
355
+ return FfiConverterArrayBuffer.lift(
356
+ uniffiCaller.rustCallWithError(
357
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
358
+ FfiConverterTypeCryptoErrorUniffi
359
+ ),
360
+ /*caller:*/ (callStatus) => {
361
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_verifying_key_from_bytes(
362
+ FfiConverterArrayBuffer.lower(bytes),
363
+ callStatus
364
+ );
365
+ },
366
+ /*liftString:*/ FfiConverterString.lift
367
+ )
368
+ );
369
+ }
370
+ /**
371
+ * Uniffi-exposed function to encrypt bytes with a key secret and nonce material.
372
+ * - `value`: The raw bytes to encrypt
373
+ * - `key_secret`: A base58-encoded key secret with "keySecret_z" prefix
374
+ * - `nonce_material`: Raw bytes used to generate the nonce
375
+ * Returns the encrypted bytes or throws an error if encryption fails.
376
+ */
377
+ export function encrypt(
378
+ value: ArrayBuffer,
379
+ keySecret: string,
380
+ nonceMaterial: ArrayBuffer
381
+ ): ArrayBuffer /*throws*/ {
382
+ return FfiConverterArrayBuffer.lift(
383
+ uniffiCaller.rustCallWithError(
384
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
385
+ FfiConverterTypeCryptoErrorUniffi
386
+ ),
387
+ /*caller:*/ (callStatus) => {
388
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_encrypt(
389
+ FfiConverterArrayBuffer.lower(value),
390
+ FfiConverterString.lower(keySecret),
391
+ FfiConverterArrayBuffer.lower(nonceMaterial),
392
+ callStatus
393
+ );
394
+ },
395
+ /*liftString:*/ FfiConverterString.lift
396
+ )
397
+ );
398
+ }
399
+ /**
400
+ * Uniffi-exposed function for XSalsa20 encryption without authentication.
401
+ * - `key`: 32-byte key for encryption
402
+ * - `nonce_material`: Raw bytes used to generate a 24-byte nonce via BLAKE3
403
+ * - `plaintext`: Raw bytes to encrypt
404
+ * Returns the encrypted bytes or throws an error if encryption fails.
405
+ * Note: This function does not provide authentication. Use encrypt_xsalsa20_poly1305 for authenticated encryption.
406
+ */
407
+ export function encryptXsalsa20(
408
+ key: ArrayBuffer,
409
+ nonceMaterial: ArrayBuffer,
410
+ plaintext: ArrayBuffer
411
+ ): ArrayBuffer /*throws*/ {
412
+ return FfiConverterArrayBuffer.lift(
413
+ uniffiCaller.rustCallWithError(
414
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
415
+ FfiConverterTypeCryptoErrorUniffi
416
+ ),
417
+ /*caller:*/ (callStatus) => {
418
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_encrypt_xsalsa20(
419
+ FfiConverterArrayBuffer.lower(key),
420
+ FfiConverterArrayBuffer.lower(nonceMaterial),
421
+ FfiConverterArrayBuffer.lower(plaintext),
422
+ callStatus
423
+ );
424
+ },
425
+ /*liftString:*/ FfiConverterString.lift
426
+ )
427
+ );
428
+ }
429
+ /**
430
+ * Generate a 24-byte nonce from input material using BLAKE3.
431
+ * - `nonce_material`: Raw bytes to derive the nonce from
432
+ * Returns 24 bytes suitable for use as a nonce in cryptographic operations.
433
+ * This function is deterministic - the same input will produce the same nonce.
434
+ */
435
+ export function generateNonce(nonceMaterial: ArrayBuffer): ArrayBuffer {
436
+ return FfiConverterArrayBuffer.lift(
437
+ uniffiCaller.rustCall(
438
+ /*caller:*/ (callStatus) => {
439
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_generate_nonce(
440
+ FfiConverterArrayBuffer.lower(nonceMaterial),
441
+ callStatus
442
+ );
443
+ },
444
+ /*liftString:*/ FfiConverterString.lift
445
+ )
446
+ );
447
+ }
448
+ /**
449
+ * Uniffi-exposed function to derive a sealer ID from a sealer secret.
450
+ * - `secret`: UTF-8 encoded sealer secret string
451
+ * Returns a base58-encoded sealer ID with "sealer_z" prefix or throws an error if derivation fails.
452
+ */
453
+ export function getSealerId(secret: string): string /*throws*/ {
454
+ return FfiConverterString.lift(
455
+ uniffiCaller.rustCallWithError(
456
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
457
+ FfiConverterTypeCryptoErrorUniffi
458
+ ),
459
+ /*caller:*/ (callStatus) => {
460
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_get_sealer_id(
461
+ FfiConverterString.lower(secret),
462
+ callStatus
463
+ );
464
+ },
465
+ /*liftString:*/ FfiConverterString.lift
466
+ )
467
+ );
468
+ }
469
+ /**
470
+ * Uniffi-exposed function to derive a signer ID from a signing key.
471
+ * - `secret`: UTF-8 encoded Ed25519 signing key string
472
+ * Returns base58-encoded verifying key with "signer_z" prefix or throws an error if derivation fails.
473
+ */
474
+ export function getSignerId(secret: string): string /*throws*/ {
475
+ return FfiConverterString.lift(
476
+ uniffiCaller.rustCallWithError(
477
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
478
+ FfiConverterTypeCryptoErrorUniffi
479
+ ),
480
+ /*caller:*/ (callStatus) => {
481
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_get_signer_id(
482
+ FfiConverterString.lower(secret),
483
+ callStatus
484
+ );
485
+ },
486
+ /*liftString:*/ FfiConverterString.lift
487
+ )
488
+ );
489
+ }
490
+ /**
491
+ * Generate a new Ed25519 signing key using secure random number generation.
492
+ * Returns 32 bytes of raw key material suitable for use with other Ed25519 functions.
493
+ */
494
+ export function newEd25519SigningKey(): ArrayBuffer {
495
+ return FfiConverterArrayBuffer.lift(
496
+ uniffiCaller.rustCall(
497
+ /*caller:*/ (callStatus) => {
498
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_new_ed25519_signing_key(
499
+ callStatus
500
+ );
501
+ },
502
+ /*liftString:*/ FfiConverterString.lift
503
+ )
504
+ );
505
+ }
506
+ /**
507
+ * Generate a new X25519 private key using secure random number generation.
508
+ * Returns 32 bytes of raw key material suitable for use with other X25519 functions.
509
+ * This key can be reused for multiple Diffie-Hellman exchanges.
510
+ */
511
+ export function newX25519PrivateKey(): ArrayBuffer {
512
+ return FfiConverterArrayBuffer.lift(
513
+ uniffiCaller.rustCall(
514
+ /*caller:*/ (callStatus) => {
515
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_new_x25519_private_key(
516
+ callStatus
517
+ );
518
+ },
519
+ /*liftString:*/ FfiConverterString.lift
520
+ )
521
+ );
522
+ }
523
+ /**
524
+ * Uniffi-exposed function for sealing a message using X25519 + XSalsa20-Poly1305.
525
+ * Provides authenticated encryption with perfect forward secrecy.
526
+ * - `message`: Raw bytes to seal
527
+ * - `sender_secret`: Base58-encoded sender's private key with "sealerSecret_z" prefix
528
+ * - `recipient_id`: Base58-encoded recipient's public key with "sealer_z" prefix
529
+ * - `nonce_material`: Raw bytes used to generate the nonce
530
+ * Returns sealed bytes or throws an error if sealing fails.
531
+ */
532
+ export function seal(
533
+ message: ArrayBuffer,
534
+ senderSecret: string,
535
+ recipientId: string,
536
+ nonceMaterial: ArrayBuffer
537
+ ): ArrayBuffer /*throws*/ {
538
+ return FfiConverterArrayBuffer.lift(
539
+ uniffiCaller.rustCallWithError(
540
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
541
+ FfiConverterTypeCryptoErrorUniffi
542
+ ),
543
+ /*caller:*/ (callStatus) => {
544
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_seal(
545
+ FfiConverterArrayBuffer.lower(message),
546
+ FfiConverterString.lower(senderSecret),
547
+ FfiConverterString.lower(recipientId),
548
+ FfiConverterArrayBuffer.lower(nonceMaterial),
549
+ callStatus
550
+ );
551
+ },
552
+ /*liftString:*/ FfiConverterString.lift
553
+ )
554
+ );
555
+ }
556
+ /**
557
+ * Uniffi-exposed function to sign a message using Ed25519.
558
+ * - `message`: Raw bytes to sign
559
+ * - `secret`: UTF-8 encoded Ed25519 signing key string
560
+ * Returns base58-encoded signature with "signature_z" prefix or throws an error if signing fails.
561
+ */
562
+ export function sign(message: ArrayBuffer, secret: string): string /*throws*/ {
563
+ return FfiConverterString.lift(
564
+ uniffiCaller.rustCallWithError(
565
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
566
+ FfiConverterTypeCryptoErrorUniffi
567
+ ),
568
+ /*caller:*/ (callStatus) => {
569
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_sign(
570
+ FfiConverterArrayBuffer.lower(message),
571
+ FfiConverterString.lower(secret),
572
+ callStatus
573
+ );
574
+ },
575
+ /*liftString:*/ FfiConverterString.lift
576
+ )
577
+ );
578
+ }
579
+ /**
580
+ * Uniffi-exposed function for unsealing a message using X25519 + XSalsa20-Poly1305.
581
+ * Provides authenticated decryption with perfect forward secrecy.
582
+ * - `sealed_message`: The sealed bytes to decrypt
583
+ * - `recipient_secret`: Base58-encoded recipient's private key with "sealerSecret_z" prefix
584
+ * - `sender_id`: Base58-encoded sender's public key with "sealer_z" prefix
585
+ * - `nonce_material`: Raw bytes used to generate the nonce (must match sealing)
586
+ * Returns unsealed bytes or throws an error if unsealing fails.
587
+ */
588
+ export function unseal(
589
+ sealedMessage: ArrayBuffer,
590
+ recipientSecret: string,
591
+ senderId: string,
592
+ nonceMaterial: ArrayBuffer
593
+ ): ArrayBuffer /*throws*/ {
594
+ return FfiConverterArrayBuffer.lift(
595
+ uniffiCaller.rustCallWithError(
596
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
597
+ FfiConverterTypeCryptoErrorUniffi
598
+ ),
599
+ /*caller:*/ (callStatus) => {
600
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_unseal(
601
+ FfiConverterArrayBuffer.lower(sealedMessage),
602
+ FfiConverterString.lower(recipientSecret),
603
+ FfiConverterString.lower(senderId),
604
+ FfiConverterArrayBuffer.lower(nonceMaterial),
605
+ callStatus
606
+ );
607
+ },
608
+ /*liftString:*/ FfiConverterString.lift
609
+ )
610
+ );
611
+ }
612
+ /**
613
+ * Uniffi-exposed function to verify an Ed25519 signature.
614
+ * - `signature`: Base58-encoded signature string
615
+ * - `message`: Raw bytes that were signed
616
+ * - `id`: Base58-encoded verifying key string
617
+ * Returns true if signature is valid, false otherwise, or throws an error if verification fails.
618
+ */
619
+ export function verify(
620
+ signature: string,
621
+ message: ArrayBuffer,
622
+ id: string
623
+ ): boolean /*throws*/ {
624
+ return FfiConverterBool.lift(
625
+ uniffiCaller.rustCallWithError(
626
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
627
+ FfiConverterTypeCryptoErrorUniffi
628
+ ),
629
+ /*caller:*/ (callStatus) => {
630
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_verify(
631
+ FfiConverterString.lower(signature),
632
+ FfiConverterArrayBuffer.lower(message),
633
+ FfiConverterString.lower(id),
634
+ callStatus
635
+ );
636
+ },
637
+ /*liftString:*/ FfiConverterString.lift
638
+ )
639
+ );
640
+ }
641
+ /**
642
+ * Uniffi-exposed function to perform X25519 Diffie-Hellman key exchange.
643
+ * - `private_key`: 32 bytes of private key material
644
+ * - `public_key`: 32 bytes of public key material
645
+ * Returns 32 bytes of shared secret material or throws an error if key exchange fails.
646
+ */
647
+ export function x25519DiffieHellman(
648
+ privateKey: ArrayBuffer,
649
+ publicKey: ArrayBuffer
650
+ ): ArrayBuffer /*throws*/ {
651
+ return FfiConverterArrayBuffer.lift(
652
+ uniffiCaller.rustCallWithError(
653
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
654
+ FfiConverterTypeCryptoErrorUniffi
655
+ ),
656
+ /*caller:*/ (callStatus) => {
657
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_x25519_diffie_hellman(
658
+ FfiConverterArrayBuffer.lower(privateKey),
659
+ FfiConverterArrayBuffer.lower(publicKey),
660
+ callStatus
661
+ );
662
+ },
663
+ /*liftString:*/ FfiConverterString.lift
664
+ )
665
+ );
666
+ }
667
+ /**
668
+ * Uniffi-exposed function to derive an X25519 public key from a private key.
669
+ * - `private_key`: 32 bytes of private key material
670
+ * Returns 32 bytes of public key material or throws an error if key is invalid.
671
+ */
672
+ export function x25519PublicKey(
673
+ privateKey: ArrayBuffer
674
+ ): ArrayBuffer /*throws*/ {
675
+ return FfiConverterArrayBuffer.lift(
676
+ uniffiCaller.rustCallWithError(
677
+ /*liftError:*/ FfiConverterTypeCryptoErrorUniffi.lift.bind(
678
+ FfiConverterTypeCryptoErrorUniffi
679
+ ),
680
+ /*caller:*/ (callStatus) => {
681
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_x25519_public_key(
682
+ FfiConverterArrayBuffer.lower(privateKey),
683
+ callStatus
684
+ );
685
+ },
686
+ /*liftString:*/ FfiConverterString.lift
687
+ )
688
+ );
689
+ }
690
+
691
+ const stringConverter = {
692
+ stringToBytes: (s: string) =>
693
+ uniffiCaller.rustCall((status) =>
694
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
695
+ s,
696
+ status
697
+ )
698
+ ),
699
+ bytesToString: (ab: UniffiByteArray) =>
700
+ uniffiCaller.rustCall((status) =>
701
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
702
+ ab,
703
+ status
704
+ )
705
+ ),
706
+ stringByteLength: (s: string) =>
707
+ uniffiCaller.rustCall((status) =>
708
+ nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(
709
+ s,
710
+ status
711
+ )
712
+ ),
713
+ };
714
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
715
+
716
+ // Error type: Blake3Error
717
+
718
+ // Enum: Blake3Error
719
+ export enum Blake3Error_Tags {
720
+ LockError = 'LockError',
721
+ }
722
+ export const Blake3Error = (() => {
723
+ type LockError__interface = {
724
+ tag: Blake3Error_Tags.LockError;
725
+ };
726
+
727
+ class LockError_ extends UniffiError implements LockError__interface {
728
+ /**
729
+ * @private
730
+ * This field is private and should not be used, use `tag` instead.
731
+ */
732
+ readonly [uniffiTypeNameSymbol] = 'Blake3Error';
733
+ readonly tag = Blake3Error_Tags.LockError;
734
+ constructor() {
735
+ super('Blake3Error', 'LockError');
736
+ }
737
+
738
+ static new(): LockError_ {
739
+ return new LockError_();
740
+ }
741
+
742
+ static instanceOf(obj: any): obj is LockError_ {
743
+ return obj.tag === Blake3Error_Tags.LockError;
744
+ }
745
+
746
+ static hasInner(obj: any): obj is LockError_ {
747
+ return false;
748
+ }
749
+ }
750
+
751
+ function instanceOf(obj: any): obj is Blake3Error {
752
+ return obj[uniffiTypeNameSymbol] === 'Blake3Error';
753
+ }
754
+
755
+ return Object.freeze({
756
+ instanceOf,
757
+ LockError: LockError_,
758
+ });
759
+ })();
760
+
761
+ export type Blake3Error = InstanceType<
762
+ (typeof Blake3Error)[keyof Omit<typeof Blake3Error, 'instanceOf'>]
763
+ >;
764
+
765
+ // FfiConverter for enum Blake3Error
766
+ const FfiConverterTypeBlake3Error = (() => {
767
+ const ordinalConverter = FfiConverterInt32;
768
+ type TypeName = Blake3Error;
769
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
770
+ read(from: RustBuffer): TypeName {
771
+ switch (ordinalConverter.read(from)) {
772
+ case 1:
773
+ return new Blake3Error.LockError();
774
+ default:
775
+ throw new UniffiInternalError.UnexpectedEnumCase();
776
+ }
777
+ }
778
+ write(value: TypeName, into: RustBuffer): void {
779
+ switch (value.tag) {
780
+ case Blake3Error_Tags.LockError: {
781
+ ordinalConverter.write(1, into);
782
+ return;
783
+ }
784
+ default:
785
+ // Throwing from here means that Blake3Error_Tags hasn't matched an ordinal.
786
+ throw new UniffiInternalError.UnexpectedEnumCase();
787
+ }
788
+ }
789
+ allocationSize(value: TypeName): number {
790
+ switch (value.tag) {
791
+ case Blake3Error_Tags.LockError: {
792
+ return ordinalConverter.allocationSize(1);
793
+ }
794
+ default:
795
+ throw new UniffiInternalError.UnexpectedEnumCase();
796
+ }
797
+ }
798
+ }
799
+ return new FFIConverter();
800
+ })();
801
+
802
+ // Error type: CryptoErrorUniffi
803
+
804
+ // Enum: CryptoErrorUniffi
805
+ export enum CryptoErrorUniffi_Tags {
806
+ InvalidKeyLength = 'InvalidKeyLength',
807
+ InvalidNonceLength = 'InvalidNonceLength',
808
+ InvalidSealerSecretFormat = 'InvalidSealerSecretFormat',
809
+ InvalidSignatureLength = 'InvalidSignatureLength',
810
+ InvalidVerifyingKey = 'InvalidVerifyingKey',
811
+ InvalidPublicKey = 'InvalidPublicKey',
812
+ WrongTag = 'WrongTag',
813
+ CipherError = 'CipherError',
814
+ InvalidPrefix = 'InvalidPrefix',
815
+ Base58Error = 'Base58Error',
816
+ }
817
+ export const CryptoErrorUniffi = (() => {
818
+ type InvalidKeyLength__interface = {
819
+ tag: CryptoErrorUniffi_Tags.InvalidKeyLength;
820
+ inner: Readonly<[/*u64*/ bigint, /*u64*/ bigint]>;
821
+ };
822
+
823
+ class InvalidKeyLength_
824
+ extends UniffiError
825
+ implements InvalidKeyLength__interface
826
+ {
827
+ /**
828
+ * @private
829
+ * This field is private and should not be used, use `tag` instead.
830
+ */
831
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
832
+ readonly tag = CryptoErrorUniffi_Tags.InvalidKeyLength;
833
+ readonly inner: Readonly<[/*u64*/ bigint, /*u64*/ bigint]>;
834
+ constructor(v0: /*u64*/ bigint, v1: /*u64*/ bigint) {
835
+ super('CryptoErrorUniffi', 'InvalidKeyLength');
836
+ this.inner = Object.freeze([v0, v1]);
837
+ }
838
+
839
+ static new(v0: /*u64*/ bigint, v1: /*u64*/ bigint): InvalidKeyLength_ {
840
+ return new InvalidKeyLength_(v0, v1);
841
+ }
842
+
843
+ static instanceOf(obj: any): obj is InvalidKeyLength_ {
844
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidKeyLength;
845
+ }
846
+
847
+ static hasInner(obj: any): obj is InvalidKeyLength_ {
848
+ return InvalidKeyLength_.instanceOf(obj);
849
+ }
850
+
851
+ static getInner(
852
+ obj: InvalidKeyLength_
853
+ ): Readonly<[/*u64*/ bigint, /*u64*/ bigint]> {
854
+ return obj.inner;
855
+ }
856
+ }
857
+
858
+ type InvalidNonceLength__interface = {
859
+ tag: CryptoErrorUniffi_Tags.InvalidNonceLength;
860
+ };
861
+
862
+ class InvalidNonceLength_
863
+ extends UniffiError
864
+ implements InvalidNonceLength__interface
865
+ {
866
+ /**
867
+ * @private
868
+ * This field is private and should not be used, use `tag` instead.
869
+ */
870
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
871
+ readonly tag = CryptoErrorUniffi_Tags.InvalidNonceLength;
872
+ constructor() {
873
+ super('CryptoErrorUniffi', 'InvalidNonceLength');
874
+ }
875
+
876
+ static new(): InvalidNonceLength_ {
877
+ return new InvalidNonceLength_();
878
+ }
879
+
880
+ static instanceOf(obj: any): obj is InvalidNonceLength_ {
881
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidNonceLength;
882
+ }
883
+
884
+ static hasInner(obj: any): obj is InvalidNonceLength_ {
885
+ return false;
886
+ }
887
+ }
888
+
889
+ type InvalidSealerSecretFormat__interface = {
890
+ tag: CryptoErrorUniffi_Tags.InvalidSealerSecretFormat;
891
+ };
892
+
893
+ class InvalidSealerSecretFormat_
894
+ extends UniffiError
895
+ implements InvalidSealerSecretFormat__interface
896
+ {
897
+ /**
898
+ * @private
899
+ * This field is private and should not be used, use `tag` instead.
900
+ */
901
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
902
+ readonly tag = CryptoErrorUniffi_Tags.InvalidSealerSecretFormat;
903
+ constructor() {
904
+ super('CryptoErrorUniffi', 'InvalidSealerSecretFormat');
905
+ }
906
+
907
+ static new(): InvalidSealerSecretFormat_ {
908
+ return new InvalidSealerSecretFormat_();
909
+ }
910
+
911
+ static instanceOf(obj: any): obj is InvalidSealerSecretFormat_ {
912
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidSealerSecretFormat;
913
+ }
914
+
915
+ static hasInner(obj: any): obj is InvalidSealerSecretFormat_ {
916
+ return false;
917
+ }
918
+ }
919
+
920
+ type InvalidSignatureLength__interface = {
921
+ tag: CryptoErrorUniffi_Tags.InvalidSignatureLength;
922
+ };
923
+
924
+ class InvalidSignatureLength_
925
+ extends UniffiError
926
+ implements InvalidSignatureLength__interface
927
+ {
928
+ /**
929
+ * @private
930
+ * This field is private and should not be used, use `tag` instead.
931
+ */
932
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
933
+ readonly tag = CryptoErrorUniffi_Tags.InvalidSignatureLength;
934
+ constructor() {
935
+ super('CryptoErrorUniffi', 'InvalidSignatureLength');
936
+ }
937
+
938
+ static new(): InvalidSignatureLength_ {
939
+ return new InvalidSignatureLength_();
940
+ }
941
+
942
+ static instanceOf(obj: any): obj is InvalidSignatureLength_ {
943
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidSignatureLength;
944
+ }
945
+
946
+ static hasInner(obj: any): obj is InvalidSignatureLength_ {
947
+ return false;
948
+ }
949
+ }
950
+
951
+ type InvalidVerifyingKey__interface = {
952
+ tag: CryptoErrorUniffi_Tags.InvalidVerifyingKey;
953
+ inner: Readonly<[string]>;
954
+ };
955
+
956
+ class InvalidVerifyingKey_
957
+ extends UniffiError
958
+ implements InvalidVerifyingKey__interface
959
+ {
960
+ /**
961
+ * @private
962
+ * This field is private and should not be used, use `tag` instead.
963
+ */
964
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
965
+ readonly tag = CryptoErrorUniffi_Tags.InvalidVerifyingKey;
966
+ readonly inner: Readonly<[string]>;
967
+ constructor(v0: string) {
968
+ super('CryptoErrorUniffi', 'InvalidVerifyingKey');
969
+ this.inner = Object.freeze([v0]);
970
+ }
971
+
972
+ static new(v0: string): InvalidVerifyingKey_ {
973
+ return new InvalidVerifyingKey_(v0);
974
+ }
975
+
976
+ static instanceOf(obj: any): obj is InvalidVerifyingKey_ {
977
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidVerifyingKey;
978
+ }
979
+
980
+ static hasInner(obj: any): obj is InvalidVerifyingKey_ {
981
+ return InvalidVerifyingKey_.instanceOf(obj);
982
+ }
983
+
984
+ static getInner(obj: InvalidVerifyingKey_): Readonly<[string]> {
985
+ return obj.inner;
986
+ }
987
+ }
988
+
989
+ type InvalidPublicKey__interface = {
990
+ tag: CryptoErrorUniffi_Tags.InvalidPublicKey;
991
+ inner: Readonly<[string]>;
992
+ };
993
+
994
+ class InvalidPublicKey_
995
+ extends UniffiError
996
+ implements InvalidPublicKey__interface
997
+ {
998
+ /**
999
+ * @private
1000
+ * This field is private and should not be used, use `tag` instead.
1001
+ */
1002
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
1003
+ readonly tag = CryptoErrorUniffi_Tags.InvalidPublicKey;
1004
+ readonly inner: Readonly<[string]>;
1005
+ constructor(v0: string) {
1006
+ super('CryptoErrorUniffi', 'InvalidPublicKey');
1007
+ this.inner = Object.freeze([v0]);
1008
+ }
1009
+
1010
+ static new(v0: string): InvalidPublicKey_ {
1011
+ return new InvalidPublicKey_(v0);
1012
+ }
1013
+
1014
+ static instanceOf(obj: any): obj is InvalidPublicKey_ {
1015
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidPublicKey;
1016
+ }
1017
+
1018
+ static hasInner(obj: any): obj is InvalidPublicKey_ {
1019
+ return InvalidPublicKey_.instanceOf(obj);
1020
+ }
1021
+
1022
+ static getInner(obj: InvalidPublicKey_): Readonly<[string]> {
1023
+ return obj.inner;
1024
+ }
1025
+ }
1026
+
1027
+ type WrongTag__interface = {
1028
+ tag: CryptoErrorUniffi_Tags.WrongTag;
1029
+ };
1030
+
1031
+ class WrongTag_ extends UniffiError implements WrongTag__interface {
1032
+ /**
1033
+ * @private
1034
+ * This field is private and should not be used, use `tag` instead.
1035
+ */
1036
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
1037
+ readonly tag = CryptoErrorUniffi_Tags.WrongTag;
1038
+ constructor() {
1039
+ super('CryptoErrorUniffi', 'WrongTag');
1040
+ }
1041
+
1042
+ static new(): WrongTag_ {
1043
+ return new WrongTag_();
1044
+ }
1045
+
1046
+ static instanceOf(obj: any): obj is WrongTag_ {
1047
+ return obj.tag === CryptoErrorUniffi_Tags.WrongTag;
1048
+ }
1049
+
1050
+ static hasInner(obj: any): obj is WrongTag_ {
1051
+ return false;
1052
+ }
1053
+ }
1054
+
1055
+ type CipherError__interface = {
1056
+ tag: CryptoErrorUniffi_Tags.CipherError;
1057
+ };
1058
+
1059
+ class CipherError_ extends UniffiError implements CipherError__interface {
1060
+ /**
1061
+ * @private
1062
+ * This field is private and should not be used, use `tag` instead.
1063
+ */
1064
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
1065
+ readonly tag = CryptoErrorUniffi_Tags.CipherError;
1066
+ constructor() {
1067
+ super('CryptoErrorUniffi', 'CipherError');
1068
+ }
1069
+
1070
+ static new(): CipherError_ {
1071
+ return new CipherError_();
1072
+ }
1073
+
1074
+ static instanceOf(obj: any): obj is CipherError_ {
1075
+ return obj.tag === CryptoErrorUniffi_Tags.CipherError;
1076
+ }
1077
+
1078
+ static hasInner(obj: any): obj is CipherError_ {
1079
+ return false;
1080
+ }
1081
+ }
1082
+
1083
+ type InvalidPrefix__interface = {
1084
+ tag: CryptoErrorUniffi_Tags.InvalidPrefix;
1085
+ inner: Readonly<[string, string]>;
1086
+ };
1087
+
1088
+ class InvalidPrefix_ extends UniffiError implements InvalidPrefix__interface {
1089
+ /**
1090
+ * @private
1091
+ * This field is private and should not be used, use `tag` instead.
1092
+ */
1093
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
1094
+ readonly tag = CryptoErrorUniffi_Tags.InvalidPrefix;
1095
+ readonly inner: Readonly<[string, string]>;
1096
+ constructor(v0: string, v1: string) {
1097
+ super('CryptoErrorUniffi', 'InvalidPrefix');
1098
+ this.inner = Object.freeze([v0, v1]);
1099
+ }
1100
+
1101
+ static new(v0: string, v1: string): InvalidPrefix_ {
1102
+ return new InvalidPrefix_(v0, v1);
1103
+ }
1104
+
1105
+ static instanceOf(obj: any): obj is InvalidPrefix_ {
1106
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidPrefix;
1107
+ }
1108
+
1109
+ static hasInner(obj: any): obj is InvalidPrefix_ {
1110
+ return InvalidPrefix_.instanceOf(obj);
1111
+ }
1112
+
1113
+ static getInner(obj: InvalidPrefix_): Readonly<[string, string]> {
1114
+ return obj.inner;
1115
+ }
1116
+ }
1117
+
1118
+ type Base58Error__interface = {
1119
+ tag: CryptoErrorUniffi_Tags.Base58Error;
1120
+ inner: Readonly<[string]>;
1121
+ };
1122
+
1123
+ class Base58Error_ extends UniffiError implements Base58Error__interface {
1124
+ /**
1125
+ * @private
1126
+ * This field is private and should not be used, use `tag` instead.
1127
+ */
1128
+ readonly [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
1129
+ readonly tag = CryptoErrorUniffi_Tags.Base58Error;
1130
+ readonly inner: Readonly<[string]>;
1131
+ constructor(v0: string) {
1132
+ super('CryptoErrorUniffi', 'Base58Error');
1133
+ this.inner = Object.freeze([v0]);
1134
+ }
1135
+
1136
+ static new(v0: string): Base58Error_ {
1137
+ return new Base58Error_(v0);
1138
+ }
1139
+
1140
+ static instanceOf(obj: any): obj is Base58Error_ {
1141
+ return obj.tag === CryptoErrorUniffi_Tags.Base58Error;
1142
+ }
1143
+
1144
+ static hasInner(obj: any): obj is Base58Error_ {
1145
+ return Base58Error_.instanceOf(obj);
1146
+ }
1147
+
1148
+ static getInner(obj: Base58Error_): Readonly<[string]> {
1149
+ return obj.inner;
1150
+ }
1151
+ }
1152
+
1153
+ function instanceOf(obj: any): obj is CryptoErrorUniffi {
1154
+ return obj[uniffiTypeNameSymbol] === 'CryptoErrorUniffi';
1155
+ }
1156
+
1157
+ return Object.freeze({
1158
+ instanceOf,
1159
+ InvalidKeyLength: InvalidKeyLength_,
1160
+ InvalidNonceLength: InvalidNonceLength_,
1161
+ InvalidSealerSecretFormat: InvalidSealerSecretFormat_,
1162
+ InvalidSignatureLength: InvalidSignatureLength_,
1163
+ InvalidVerifyingKey: InvalidVerifyingKey_,
1164
+ InvalidPublicKey: InvalidPublicKey_,
1165
+ WrongTag: WrongTag_,
1166
+ CipherError: CipherError_,
1167
+ InvalidPrefix: InvalidPrefix_,
1168
+ Base58Error: Base58Error_,
1169
+ });
1170
+ })();
1171
+
1172
+ export type CryptoErrorUniffi = InstanceType<
1173
+ (typeof CryptoErrorUniffi)[keyof Omit<typeof CryptoErrorUniffi, 'instanceOf'>]
1174
+ >;
1175
+
1176
+ // FfiConverter for enum CryptoErrorUniffi
1177
+ const FfiConverterTypeCryptoErrorUniffi = (() => {
1178
+ const ordinalConverter = FfiConverterInt32;
1179
+ type TypeName = CryptoErrorUniffi;
1180
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1181
+ read(from: RustBuffer): TypeName {
1182
+ switch (ordinalConverter.read(from)) {
1183
+ case 1:
1184
+ return new CryptoErrorUniffi.InvalidKeyLength(
1185
+ FfiConverterUInt64.read(from),
1186
+ FfiConverterUInt64.read(from)
1187
+ );
1188
+ case 2:
1189
+ return new CryptoErrorUniffi.InvalidNonceLength();
1190
+ case 3:
1191
+ return new CryptoErrorUniffi.InvalidSealerSecretFormat();
1192
+ case 4:
1193
+ return new CryptoErrorUniffi.InvalidSignatureLength();
1194
+ case 5:
1195
+ return new CryptoErrorUniffi.InvalidVerifyingKey(
1196
+ FfiConverterString.read(from)
1197
+ );
1198
+ case 6:
1199
+ return new CryptoErrorUniffi.InvalidPublicKey(
1200
+ FfiConverterString.read(from)
1201
+ );
1202
+ case 7:
1203
+ return new CryptoErrorUniffi.WrongTag();
1204
+ case 8:
1205
+ return new CryptoErrorUniffi.CipherError();
1206
+ case 9:
1207
+ return new CryptoErrorUniffi.InvalidPrefix(
1208
+ FfiConverterString.read(from),
1209
+ FfiConverterString.read(from)
1210
+ );
1211
+ case 10:
1212
+ return new CryptoErrorUniffi.Base58Error(
1213
+ FfiConverterString.read(from)
1214
+ );
1215
+ default:
1216
+ throw new UniffiInternalError.UnexpectedEnumCase();
1217
+ }
1218
+ }
1219
+ write(value: TypeName, into: RustBuffer): void {
1220
+ switch (value.tag) {
1221
+ case CryptoErrorUniffi_Tags.InvalidKeyLength: {
1222
+ ordinalConverter.write(1, into);
1223
+ const inner = value.inner;
1224
+ FfiConverterUInt64.write(inner[0], into);
1225
+ FfiConverterUInt64.write(inner[1], into);
1226
+ return;
1227
+ }
1228
+ case CryptoErrorUniffi_Tags.InvalidNonceLength: {
1229
+ ordinalConverter.write(2, into);
1230
+ return;
1231
+ }
1232
+ case CryptoErrorUniffi_Tags.InvalidSealerSecretFormat: {
1233
+ ordinalConverter.write(3, into);
1234
+ return;
1235
+ }
1236
+ case CryptoErrorUniffi_Tags.InvalidSignatureLength: {
1237
+ ordinalConverter.write(4, into);
1238
+ return;
1239
+ }
1240
+ case CryptoErrorUniffi_Tags.InvalidVerifyingKey: {
1241
+ ordinalConverter.write(5, into);
1242
+ const inner = value.inner;
1243
+ FfiConverterString.write(inner[0], into);
1244
+ return;
1245
+ }
1246
+ case CryptoErrorUniffi_Tags.InvalidPublicKey: {
1247
+ ordinalConverter.write(6, into);
1248
+ const inner = value.inner;
1249
+ FfiConverterString.write(inner[0], into);
1250
+ return;
1251
+ }
1252
+ case CryptoErrorUniffi_Tags.WrongTag: {
1253
+ ordinalConverter.write(7, into);
1254
+ return;
1255
+ }
1256
+ case CryptoErrorUniffi_Tags.CipherError: {
1257
+ ordinalConverter.write(8, into);
1258
+ return;
1259
+ }
1260
+ case CryptoErrorUniffi_Tags.InvalidPrefix: {
1261
+ ordinalConverter.write(9, into);
1262
+ const inner = value.inner;
1263
+ FfiConverterString.write(inner[0], into);
1264
+ FfiConverterString.write(inner[1], into);
1265
+ return;
1266
+ }
1267
+ case CryptoErrorUniffi_Tags.Base58Error: {
1268
+ ordinalConverter.write(10, into);
1269
+ const inner = value.inner;
1270
+ FfiConverterString.write(inner[0], into);
1271
+ return;
1272
+ }
1273
+ default:
1274
+ // Throwing from here means that CryptoErrorUniffi_Tags hasn't matched an ordinal.
1275
+ throw new UniffiInternalError.UnexpectedEnumCase();
1276
+ }
1277
+ }
1278
+ allocationSize(value: TypeName): number {
1279
+ switch (value.tag) {
1280
+ case CryptoErrorUniffi_Tags.InvalidKeyLength: {
1281
+ const inner = value.inner;
1282
+ let size = ordinalConverter.allocationSize(1);
1283
+ size += FfiConverterUInt64.allocationSize(inner[0]);
1284
+ size += FfiConverterUInt64.allocationSize(inner[1]);
1285
+ return size;
1286
+ }
1287
+ case CryptoErrorUniffi_Tags.InvalidNonceLength: {
1288
+ return ordinalConverter.allocationSize(2);
1289
+ }
1290
+ case CryptoErrorUniffi_Tags.InvalidSealerSecretFormat: {
1291
+ return ordinalConverter.allocationSize(3);
1292
+ }
1293
+ case CryptoErrorUniffi_Tags.InvalidSignatureLength: {
1294
+ return ordinalConverter.allocationSize(4);
1295
+ }
1296
+ case CryptoErrorUniffi_Tags.InvalidVerifyingKey: {
1297
+ const inner = value.inner;
1298
+ let size = ordinalConverter.allocationSize(5);
1299
+ size += FfiConverterString.allocationSize(inner[0]);
1300
+ return size;
1301
+ }
1302
+ case CryptoErrorUniffi_Tags.InvalidPublicKey: {
1303
+ const inner = value.inner;
1304
+ let size = ordinalConverter.allocationSize(6);
1305
+ size += FfiConverterString.allocationSize(inner[0]);
1306
+ return size;
1307
+ }
1308
+ case CryptoErrorUniffi_Tags.WrongTag: {
1309
+ return ordinalConverter.allocationSize(7);
1310
+ }
1311
+ case CryptoErrorUniffi_Tags.CipherError: {
1312
+ return ordinalConverter.allocationSize(8);
1313
+ }
1314
+ case CryptoErrorUniffi_Tags.InvalidPrefix: {
1315
+ const inner = value.inner;
1316
+ let size = ordinalConverter.allocationSize(9);
1317
+ size += FfiConverterString.allocationSize(inner[0]);
1318
+ size += FfiConverterString.allocationSize(inner[1]);
1319
+ return size;
1320
+ }
1321
+ case CryptoErrorUniffi_Tags.Base58Error: {
1322
+ const inner = value.inner;
1323
+ let size = ordinalConverter.allocationSize(10);
1324
+ size += FfiConverterString.allocationSize(inner[0]);
1325
+ return size;
1326
+ }
1327
+ default:
1328
+ throw new UniffiInternalError.UnexpectedEnumCase();
1329
+ }
1330
+ }
1331
+ }
1332
+ return new FFIConverter();
1333
+ })();
1334
+
1335
+ // Error type: SessionLogError
1336
+
1337
+ // Enum: SessionLogError
1338
+ export enum SessionLogError_Tags {
1339
+ CoJson = 'CoJson',
1340
+ Serde = 'Serde',
1341
+ Generic = 'Generic',
1342
+ LockError = 'LockError',
1343
+ }
1344
+ export const SessionLogError = (() => {
1345
+ type CoJson__interface = {
1346
+ tag: SessionLogError_Tags.CoJson;
1347
+ inner: Readonly<[string]>;
1348
+ };
1349
+
1350
+ class CoJson_ extends UniffiError implements CoJson__interface {
1351
+ /**
1352
+ * @private
1353
+ * This field is private and should not be used, use `tag` instead.
1354
+ */
1355
+ readonly [uniffiTypeNameSymbol] = 'SessionLogError';
1356
+ readonly tag = SessionLogError_Tags.CoJson;
1357
+ readonly inner: Readonly<[string]>;
1358
+ constructor(v0: string) {
1359
+ super('SessionLogError', 'CoJson');
1360
+ this.inner = Object.freeze([v0]);
1361
+ }
1362
+
1363
+ static new(v0: string): CoJson_ {
1364
+ return new CoJson_(v0);
1365
+ }
1366
+
1367
+ static instanceOf(obj: any): obj is CoJson_ {
1368
+ return obj.tag === SessionLogError_Tags.CoJson;
1369
+ }
1370
+
1371
+ static hasInner(obj: any): obj is CoJson_ {
1372
+ return CoJson_.instanceOf(obj);
1373
+ }
1374
+
1375
+ static getInner(obj: CoJson_): Readonly<[string]> {
1376
+ return obj.inner;
1377
+ }
1378
+ }
1379
+
1380
+ type Serde__interface = {
1381
+ tag: SessionLogError_Tags.Serde;
1382
+ inner: Readonly<[string]>;
1383
+ };
1384
+
1385
+ class Serde_ extends UniffiError implements Serde__interface {
1386
+ /**
1387
+ * @private
1388
+ * This field is private and should not be used, use `tag` instead.
1389
+ */
1390
+ readonly [uniffiTypeNameSymbol] = 'SessionLogError';
1391
+ readonly tag = SessionLogError_Tags.Serde;
1392
+ readonly inner: Readonly<[string]>;
1393
+ constructor(v0: string) {
1394
+ super('SessionLogError', 'Serde');
1395
+ this.inner = Object.freeze([v0]);
1396
+ }
1397
+
1398
+ static new(v0: string): Serde_ {
1399
+ return new Serde_(v0);
1400
+ }
1401
+
1402
+ static instanceOf(obj: any): obj is Serde_ {
1403
+ return obj.tag === SessionLogError_Tags.Serde;
1404
+ }
1405
+
1406
+ static hasInner(obj: any): obj is Serde_ {
1407
+ return Serde_.instanceOf(obj);
1408
+ }
1409
+
1410
+ static getInner(obj: Serde_): Readonly<[string]> {
1411
+ return obj.inner;
1412
+ }
1413
+ }
1414
+
1415
+ type Generic__interface = {
1416
+ tag: SessionLogError_Tags.Generic;
1417
+ inner: Readonly<[string]>;
1418
+ };
1419
+
1420
+ class Generic_ extends UniffiError implements Generic__interface {
1421
+ /**
1422
+ * @private
1423
+ * This field is private and should not be used, use `tag` instead.
1424
+ */
1425
+ readonly [uniffiTypeNameSymbol] = 'SessionLogError';
1426
+ readonly tag = SessionLogError_Tags.Generic;
1427
+ readonly inner: Readonly<[string]>;
1428
+ constructor(v0: string) {
1429
+ super('SessionLogError', 'Generic');
1430
+ this.inner = Object.freeze([v0]);
1431
+ }
1432
+
1433
+ static new(v0: string): Generic_ {
1434
+ return new Generic_(v0);
1435
+ }
1436
+
1437
+ static instanceOf(obj: any): obj is Generic_ {
1438
+ return obj.tag === SessionLogError_Tags.Generic;
1439
+ }
1440
+
1441
+ static hasInner(obj: any): obj is Generic_ {
1442
+ return Generic_.instanceOf(obj);
1443
+ }
1444
+
1445
+ static getInner(obj: Generic_): Readonly<[string]> {
1446
+ return obj.inner;
1447
+ }
1448
+ }
1449
+
1450
+ type LockError__interface = {
1451
+ tag: SessionLogError_Tags.LockError;
1452
+ };
1453
+
1454
+ class LockError_ extends UniffiError implements LockError__interface {
1455
+ /**
1456
+ * @private
1457
+ * This field is private and should not be used, use `tag` instead.
1458
+ */
1459
+ readonly [uniffiTypeNameSymbol] = 'SessionLogError';
1460
+ readonly tag = SessionLogError_Tags.LockError;
1461
+ constructor() {
1462
+ super('SessionLogError', 'LockError');
1463
+ }
1464
+
1465
+ static new(): LockError_ {
1466
+ return new LockError_();
1467
+ }
1468
+
1469
+ static instanceOf(obj: any): obj is LockError_ {
1470
+ return obj.tag === SessionLogError_Tags.LockError;
1471
+ }
1472
+
1473
+ static hasInner(obj: any): obj is LockError_ {
1474
+ return false;
1475
+ }
1476
+ }
1477
+
1478
+ function instanceOf(obj: any): obj is SessionLogError {
1479
+ return obj[uniffiTypeNameSymbol] === 'SessionLogError';
1480
+ }
1481
+
1482
+ return Object.freeze({
1483
+ instanceOf,
1484
+ CoJson: CoJson_,
1485
+ Serde: Serde_,
1486
+ Generic: Generic_,
1487
+ LockError: LockError_,
1488
+ });
1489
+ })();
1490
+
1491
+ export type SessionLogError = InstanceType<
1492
+ (typeof SessionLogError)[keyof Omit<typeof SessionLogError, 'instanceOf'>]
1493
+ >;
1494
+
1495
+ // FfiConverter for enum SessionLogError
1496
+ const FfiConverterTypeSessionLogError = (() => {
1497
+ const ordinalConverter = FfiConverterInt32;
1498
+ type TypeName = SessionLogError;
1499
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
1500
+ read(from: RustBuffer): TypeName {
1501
+ switch (ordinalConverter.read(from)) {
1502
+ case 1:
1503
+ return new SessionLogError.CoJson(FfiConverterString.read(from));
1504
+ case 2:
1505
+ return new SessionLogError.Serde(FfiConverterString.read(from));
1506
+ case 3:
1507
+ return new SessionLogError.Generic(FfiConverterString.read(from));
1508
+ case 4:
1509
+ return new SessionLogError.LockError();
1510
+ default:
1511
+ throw new UniffiInternalError.UnexpectedEnumCase();
1512
+ }
1513
+ }
1514
+ write(value: TypeName, into: RustBuffer): void {
1515
+ switch (value.tag) {
1516
+ case SessionLogError_Tags.CoJson: {
1517
+ ordinalConverter.write(1, into);
1518
+ const inner = value.inner;
1519
+ FfiConverterString.write(inner[0], into);
1520
+ return;
1521
+ }
1522
+ case SessionLogError_Tags.Serde: {
1523
+ ordinalConverter.write(2, into);
1524
+ const inner = value.inner;
1525
+ FfiConverterString.write(inner[0], into);
1526
+ return;
1527
+ }
1528
+ case SessionLogError_Tags.Generic: {
1529
+ ordinalConverter.write(3, into);
1530
+ const inner = value.inner;
1531
+ FfiConverterString.write(inner[0], into);
1532
+ return;
1533
+ }
1534
+ case SessionLogError_Tags.LockError: {
1535
+ ordinalConverter.write(4, into);
1536
+ return;
1537
+ }
1538
+ default:
1539
+ // Throwing from here means that SessionLogError_Tags hasn't matched an ordinal.
1540
+ throw new UniffiInternalError.UnexpectedEnumCase();
1541
+ }
1542
+ }
1543
+ allocationSize(value: TypeName): number {
1544
+ switch (value.tag) {
1545
+ case SessionLogError_Tags.CoJson: {
1546
+ const inner = value.inner;
1547
+ let size = ordinalConverter.allocationSize(1);
1548
+ size += FfiConverterString.allocationSize(inner[0]);
1549
+ return size;
1550
+ }
1551
+ case SessionLogError_Tags.Serde: {
1552
+ const inner = value.inner;
1553
+ let size = ordinalConverter.allocationSize(2);
1554
+ size += FfiConverterString.allocationSize(inner[0]);
1555
+ return size;
1556
+ }
1557
+ case SessionLogError_Tags.Generic: {
1558
+ const inner = value.inner;
1559
+ let size = ordinalConverter.allocationSize(3);
1560
+ size += FfiConverterString.allocationSize(inner[0]);
1561
+ return size;
1562
+ }
1563
+ case SessionLogError_Tags.LockError: {
1564
+ return ordinalConverter.allocationSize(4);
1565
+ }
1566
+ default:
1567
+ throw new UniffiInternalError.UnexpectedEnumCase();
1568
+ }
1569
+ }
1570
+ }
1571
+ return new FFIConverter();
1572
+ })();
1573
+
1574
+ export interface Blake3HasherInterface {
1575
+ cloneHasher() /*throws*/ : Blake3HasherInterface;
1576
+ finalize() /*throws*/ : ArrayBuffer;
1577
+ update(data: ArrayBuffer) /*throws*/ : void;
1578
+ }
1579
+
1580
+ export class Blake3Hasher
1581
+ extends UniffiAbstractObject
1582
+ implements Blake3HasherInterface
1583
+ {
1584
+ readonly [uniffiTypeNameSymbol] = 'Blake3Hasher';
1585
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
1586
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
1587
+ constructor() {
1588
+ super();
1589
+ const pointer = uniffiCaller.rustCall(
1590
+ /*caller:*/ (callStatus) => {
1591
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_constructor_blake3hasher_new(
1592
+ callStatus
1593
+ );
1594
+ },
1595
+ /*liftString:*/ FfiConverterString.lift
1596
+ );
1597
+ this[pointerLiteralSymbol] = pointer;
1598
+ this[destructorGuardSymbol] =
1599
+ uniffiTypeBlake3HasherObjectFactory.bless(pointer);
1600
+ }
1601
+
1602
+ public cloneHasher(): Blake3HasherInterface /*throws*/ {
1603
+ return FfiConverterTypeBlake3Hasher.lift(
1604
+ uniffiCaller.rustCallWithError(
1605
+ /*liftError:*/ FfiConverterTypeBlake3Error.lift.bind(
1606
+ FfiConverterTypeBlake3Error
1607
+ ),
1608
+ /*caller:*/ (callStatus) => {
1609
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_blake3hasher_clone_hasher(
1610
+ uniffiTypeBlake3HasherObjectFactory.clonePointer(this),
1611
+ callStatus
1612
+ );
1613
+ },
1614
+ /*liftString:*/ FfiConverterString.lift
1615
+ )
1616
+ );
1617
+ }
1618
+
1619
+ public finalize(): ArrayBuffer /*throws*/ {
1620
+ return FfiConverterArrayBuffer.lift(
1621
+ uniffiCaller.rustCallWithError(
1622
+ /*liftError:*/ FfiConverterTypeBlake3Error.lift.bind(
1623
+ FfiConverterTypeBlake3Error
1624
+ ),
1625
+ /*caller:*/ (callStatus) => {
1626
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_blake3hasher_finalize(
1627
+ uniffiTypeBlake3HasherObjectFactory.clonePointer(this),
1628
+ callStatus
1629
+ );
1630
+ },
1631
+ /*liftString:*/ FfiConverterString.lift
1632
+ )
1633
+ );
1634
+ }
1635
+
1636
+ public update(data: ArrayBuffer): void /*throws*/ {
1637
+ uniffiCaller.rustCallWithError(
1638
+ /*liftError:*/ FfiConverterTypeBlake3Error.lift.bind(
1639
+ FfiConverterTypeBlake3Error
1640
+ ),
1641
+ /*caller:*/ (callStatus) => {
1642
+ nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_blake3hasher_update(
1643
+ uniffiTypeBlake3HasherObjectFactory.clonePointer(this),
1644
+ FfiConverterArrayBuffer.lower(data),
1645
+ callStatus
1646
+ );
1647
+ },
1648
+ /*liftString:*/ FfiConverterString.lift
1649
+ );
1650
+ }
1651
+
1652
+ /**
1653
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1654
+ */
1655
+ uniffiDestroy(): void {
1656
+ const ptr = (this as any)[destructorGuardSymbol];
1657
+ if (ptr !== undefined) {
1658
+ const pointer = uniffiTypeBlake3HasherObjectFactory.pointer(this);
1659
+ uniffiTypeBlake3HasherObjectFactory.freePointer(pointer);
1660
+ uniffiTypeBlake3HasherObjectFactory.unbless(ptr);
1661
+ delete (this as any)[destructorGuardSymbol];
1662
+ }
1663
+ }
1664
+
1665
+ static instanceOf(obj: any): obj is Blake3Hasher {
1666
+ return uniffiTypeBlake3HasherObjectFactory.isConcreteType(obj);
1667
+ }
1668
+ }
1669
+
1670
+ const uniffiTypeBlake3HasherObjectFactory: UniffiObjectFactory<Blake3HasherInterface> =
1671
+ (() => {
1672
+ return {
1673
+ create(pointer: UnsafeMutableRawPointer): Blake3HasherInterface {
1674
+ const instance = Object.create(Blake3Hasher.prototype);
1675
+ instance[pointerLiteralSymbol] = pointer;
1676
+ instance[destructorGuardSymbol] = this.bless(pointer);
1677
+ instance[uniffiTypeNameSymbol] = 'Blake3Hasher';
1678
+ return instance;
1679
+ },
1680
+
1681
+ bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
1682
+ return uniffiCaller.rustCall(
1683
+ /*caller:*/ (status) =>
1684
+ nativeModule().ubrn_uniffi_internal_fn_method_blake3hasher_ffi__bless_pointer(
1685
+ p,
1686
+ status
1687
+ ),
1688
+ /*liftString:*/ FfiConverterString.lift
1689
+ );
1690
+ },
1691
+
1692
+ unbless(ptr: UniffiRustArcPtr) {
1693
+ ptr.markDestroyed();
1694
+ },
1695
+
1696
+ pointer(obj: Blake3HasherInterface): UnsafeMutableRawPointer {
1697
+ if ((obj as any)[destructorGuardSymbol] === undefined) {
1698
+ throw new UniffiInternalError.UnexpectedNullPointer();
1699
+ }
1700
+ return (obj as any)[pointerLiteralSymbol];
1701
+ },
1702
+
1703
+ clonePointer(obj: Blake3HasherInterface): UnsafeMutableRawPointer {
1704
+ const pointer = this.pointer(obj);
1705
+ return uniffiCaller.rustCall(
1706
+ /*caller:*/ (callStatus) =>
1707
+ nativeModule().ubrn_uniffi_cojson_core_rn_fn_clone_blake3hasher(
1708
+ pointer,
1709
+ callStatus
1710
+ ),
1711
+ /*liftString:*/ FfiConverterString.lift
1712
+ );
1713
+ },
1714
+
1715
+ freePointer(pointer: UnsafeMutableRawPointer): void {
1716
+ uniffiCaller.rustCall(
1717
+ /*caller:*/ (callStatus) =>
1718
+ nativeModule().ubrn_uniffi_cojson_core_rn_fn_free_blake3hasher(
1719
+ pointer,
1720
+ callStatus
1721
+ ),
1722
+ /*liftString:*/ FfiConverterString.lift
1723
+ );
1724
+ },
1725
+
1726
+ isConcreteType(obj: any): obj is Blake3HasherInterface {
1727
+ return (
1728
+ obj[destructorGuardSymbol] &&
1729
+ obj[uniffiTypeNameSymbol] === 'Blake3Hasher'
1730
+ );
1731
+ },
1732
+ };
1733
+ })();
1734
+ // FfiConverter for Blake3HasherInterface
1735
+ const FfiConverterTypeBlake3Hasher = new FfiConverterObject(
1736
+ uniffiTypeBlake3HasherObjectFactory
1737
+ );
1738
+
1739
+ export interface SessionLogInterface {
1740
+ addNewPrivateTransaction(
1741
+ changesJson: string,
1742
+ signerSecret: string,
1743
+ encryptionKey: string,
1744
+ keyId: string,
1745
+ madeAt: /*f64*/ number,
1746
+ meta: string | undefined
1747
+ ) /*throws*/ : string;
1748
+ addNewTrustingTransaction(
1749
+ changesJson: string,
1750
+ signerSecret: string,
1751
+ madeAt: /*f64*/ number,
1752
+ meta: string | undefined
1753
+ ) /*throws*/ : string;
1754
+ cloneSessionLog() /*throws*/ : SessionLogInterface;
1755
+ decryptNextTransactionChangesJson(
1756
+ txIndex: /*u32*/ number,
1757
+ encryptionKey: string
1758
+ ) /*throws*/ : string;
1759
+ decryptNextTransactionMetaJson(
1760
+ txIndex: /*u32*/ number,
1761
+ encryptionKey: string
1762
+ ) /*throws*/ : string | undefined;
1763
+ tryAdd(
1764
+ transactionsJson: Array<string>,
1765
+ newSignatureStr: string,
1766
+ skipVerify: boolean
1767
+ ) /*throws*/ : void;
1768
+ }
1769
+
1770
+ export class SessionLog
1771
+ extends UniffiAbstractObject
1772
+ implements SessionLogInterface
1773
+ {
1774
+ readonly [uniffiTypeNameSymbol] = 'SessionLog';
1775
+ readonly [destructorGuardSymbol]: UniffiRustArcPtr;
1776
+ readonly [pointerLiteralSymbol]: UnsafeMutableRawPointer;
1777
+ constructor(coId: string, sessionId: string, signerId: string | undefined) {
1778
+ super();
1779
+ const pointer = uniffiCaller.rustCall(
1780
+ /*caller:*/ (callStatus) => {
1781
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_constructor_sessionlog_new(
1782
+ FfiConverterString.lower(coId),
1783
+ FfiConverterString.lower(sessionId),
1784
+ FfiConverterOptionalString.lower(signerId),
1785
+ callStatus
1786
+ );
1787
+ },
1788
+ /*liftString:*/ FfiConverterString.lift
1789
+ );
1790
+ this[pointerLiteralSymbol] = pointer;
1791
+ this[destructorGuardSymbol] =
1792
+ uniffiTypeSessionLogObjectFactory.bless(pointer);
1793
+ }
1794
+
1795
+ public addNewPrivateTransaction(
1796
+ changesJson: string,
1797
+ signerSecret: string,
1798
+ encryptionKey: string,
1799
+ keyId: string,
1800
+ madeAt: /*f64*/ number,
1801
+ meta: string | undefined
1802
+ ): string /*throws*/ {
1803
+ return FfiConverterString.lift(
1804
+ uniffiCaller.rustCallWithError(
1805
+ /*liftError:*/ FfiConverterTypeSessionLogError.lift.bind(
1806
+ FfiConverterTypeSessionLogError
1807
+ ),
1808
+ /*caller:*/ (callStatus) => {
1809
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_add_new_private_transaction(
1810
+ uniffiTypeSessionLogObjectFactory.clonePointer(this),
1811
+ FfiConverterString.lower(changesJson),
1812
+ FfiConverterString.lower(signerSecret),
1813
+ FfiConverterString.lower(encryptionKey),
1814
+ FfiConverterString.lower(keyId),
1815
+ FfiConverterFloat64.lower(madeAt),
1816
+ FfiConverterOptionalString.lower(meta),
1817
+ callStatus
1818
+ );
1819
+ },
1820
+ /*liftString:*/ FfiConverterString.lift
1821
+ )
1822
+ );
1823
+ }
1824
+
1825
+ public addNewTrustingTransaction(
1826
+ changesJson: string,
1827
+ signerSecret: string,
1828
+ madeAt: /*f64*/ number,
1829
+ meta: string | undefined
1830
+ ): string /*throws*/ {
1831
+ return FfiConverterString.lift(
1832
+ uniffiCaller.rustCallWithError(
1833
+ /*liftError:*/ FfiConverterTypeSessionLogError.lift.bind(
1834
+ FfiConverterTypeSessionLogError
1835
+ ),
1836
+ /*caller:*/ (callStatus) => {
1837
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_add_new_trusting_transaction(
1838
+ uniffiTypeSessionLogObjectFactory.clonePointer(this),
1839
+ FfiConverterString.lower(changesJson),
1840
+ FfiConverterString.lower(signerSecret),
1841
+ FfiConverterFloat64.lower(madeAt),
1842
+ FfiConverterOptionalString.lower(meta),
1843
+ callStatus
1844
+ );
1845
+ },
1846
+ /*liftString:*/ FfiConverterString.lift
1847
+ )
1848
+ );
1849
+ }
1850
+
1851
+ public cloneSessionLog(): SessionLogInterface /*throws*/ {
1852
+ return FfiConverterTypeSessionLog.lift(
1853
+ uniffiCaller.rustCallWithError(
1854
+ /*liftError:*/ FfiConverterTypeSessionLogError.lift.bind(
1855
+ FfiConverterTypeSessionLogError
1856
+ ),
1857
+ /*caller:*/ (callStatus) => {
1858
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_clone_session_log(
1859
+ uniffiTypeSessionLogObjectFactory.clonePointer(this),
1860
+ callStatus
1861
+ );
1862
+ },
1863
+ /*liftString:*/ FfiConverterString.lift
1864
+ )
1865
+ );
1866
+ }
1867
+
1868
+ public decryptNextTransactionChangesJson(
1869
+ txIndex: /*u32*/ number,
1870
+ encryptionKey: string
1871
+ ): string /*throws*/ {
1872
+ return FfiConverterString.lift(
1873
+ uniffiCaller.rustCallWithError(
1874
+ /*liftError:*/ FfiConverterTypeSessionLogError.lift.bind(
1875
+ FfiConverterTypeSessionLogError
1876
+ ),
1877
+ /*caller:*/ (callStatus) => {
1878
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_decrypt_next_transaction_changes_json(
1879
+ uniffiTypeSessionLogObjectFactory.clonePointer(this),
1880
+ FfiConverterUInt32.lower(txIndex),
1881
+ FfiConverterString.lower(encryptionKey),
1882
+ callStatus
1883
+ );
1884
+ },
1885
+ /*liftString:*/ FfiConverterString.lift
1886
+ )
1887
+ );
1888
+ }
1889
+
1890
+ public decryptNextTransactionMetaJson(
1891
+ txIndex: /*u32*/ number,
1892
+ encryptionKey: string
1893
+ ): string | undefined /*throws*/ {
1894
+ return FfiConverterOptionalString.lift(
1895
+ uniffiCaller.rustCallWithError(
1896
+ /*liftError:*/ FfiConverterTypeSessionLogError.lift.bind(
1897
+ FfiConverterTypeSessionLogError
1898
+ ),
1899
+ /*caller:*/ (callStatus) => {
1900
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_decrypt_next_transaction_meta_json(
1901
+ uniffiTypeSessionLogObjectFactory.clonePointer(this),
1902
+ FfiConverterUInt32.lower(txIndex),
1903
+ FfiConverterString.lower(encryptionKey),
1904
+ callStatus
1905
+ );
1906
+ },
1907
+ /*liftString:*/ FfiConverterString.lift
1908
+ )
1909
+ );
1910
+ }
1911
+
1912
+ public tryAdd(
1913
+ transactionsJson: Array<string>,
1914
+ newSignatureStr: string,
1915
+ skipVerify: boolean
1916
+ ): void /*throws*/ {
1917
+ uniffiCaller.rustCallWithError(
1918
+ /*liftError:*/ FfiConverterTypeSessionLogError.lift.bind(
1919
+ FfiConverterTypeSessionLogError
1920
+ ),
1921
+ /*caller:*/ (callStatus) => {
1922
+ nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_try_add(
1923
+ uniffiTypeSessionLogObjectFactory.clonePointer(this),
1924
+ FfiConverterArrayString.lower(transactionsJson),
1925
+ FfiConverterString.lower(newSignatureStr),
1926
+ FfiConverterBool.lower(skipVerify),
1927
+ callStatus
1928
+ );
1929
+ },
1930
+ /*liftString:*/ FfiConverterString.lift
1931
+ );
1932
+ }
1933
+
1934
+ /**
1935
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1936
+ */
1937
+ uniffiDestroy(): void {
1938
+ const ptr = (this as any)[destructorGuardSymbol];
1939
+ if (ptr !== undefined) {
1940
+ const pointer = uniffiTypeSessionLogObjectFactory.pointer(this);
1941
+ uniffiTypeSessionLogObjectFactory.freePointer(pointer);
1942
+ uniffiTypeSessionLogObjectFactory.unbless(ptr);
1943
+ delete (this as any)[destructorGuardSymbol];
1944
+ }
1945
+ }
1946
+
1947
+ static instanceOf(obj: any): obj is SessionLog {
1948
+ return uniffiTypeSessionLogObjectFactory.isConcreteType(obj);
1949
+ }
1950
+ }
1951
+
1952
+ const uniffiTypeSessionLogObjectFactory: UniffiObjectFactory<SessionLogInterface> =
1953
+ (() => {
1954
+ return {
1955
+ create(pointer: UnsafeMutableRawPointer): SessionLogInterface {
1956
+ const instance = Object.create(SessionLog.prototype);
1957
+ instance[pointerLiteralSymbol] = pointer;
1958
+ instance[destructorGuardSymbol] = this.bless(pointer);
1959
+ instance[uniffiTypeNameSymbol] = 'SessionLog';
1960
+ return instance;
1961
+ },
1962
+
1963
+ bless(p: UnsafeMutableRawPointer): UniffiRustArcPtr {
1964
+ return uniffiCaller.rustCall(
1965
+ /*caller:*/ (status) =>
1966
+ nativeModule().ubrn_uniffi_internal_fn_method_sessionlog_ffi__bless_pointer(
1967
+ p,
1968
+ status
1969
+ ),
1970
+ /*liftString:*/ FfiConverterString.lift
1971
+ );
1972
+ },
1973
+
1974
+ unbless(ptr: UniffiRustArcPtr) {
1975
+ ptr.markDestroyed();
1976
+ },
1977
+
1978
+ pointer(obj: SessionLogInterface): UnsafeMutableRawPointer {
1979
+ if ((obj as any)[destructorGuardSymbol] === undefined) {
1980
+ throw new UniffiInternalError.UnexpectedNullPointer();
1981
+ }
1982
+ return (obj as any)[pointerLiteralSymbol];
1983
+ },
1984
+
1985
+ clonePointer(obj: SessionLogInterface): UnsafeMutableRawPointer {
1986
+ const pointer = this.pointer(obj);
1987
+ return uniffiCaller.rustCall(
1988
+ /*caller:*/ (callStatus) =>
1989
+ nativeModule().ubrn_uniffi_cojson_core_rn_fn_clone_sessionlog(
1990
+ pointer,
1991
+ callStatus
1992
+ ),
1993
+ /*liftString:*/ FfiConverterString.lift
1994
+ );
1995
+ },
1996
+
1997
+ freePointer(pointer: UnsafeMutableRawPointer): void {
1998
+ uniffiCaller.rustCall(
1999
+ /*caller:*/ (callStatus) =>
2000
+ nativeModule().ubrn_uniffi_cojson_core_rn_fn_free_sessionlog(
2001
+ pointer,
2002
+ callStatus
2003
+ ),
2004
+ /*liftString:*/ FfiConverterString.lift
2005
+ );
2006
+ },
2007
+
2008
+ isConcreteType(obj: any): obj is SessionLogInterface {
2009
+ return (
2010
+ obj[destructorGuardSymbol] &&
2011
+ obj[uniffiTypeNameSymbol] === 'SessionLog'
2012
+ );
2013
+ },
2014
+ };
2015
+ })();
2016
+ // FfiConverter for SessionLogInterface
2017
+ const FfiConverterTypeSessionLog = new FfiConverterObject(
2018
+ uniffiTypeSessionLogObjectFactory
2019
+ );
2020
+
2021
+ // FfiConverter for string | undefined
2022
+ const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
2023
+
2024
+ // FfiConverter for Array<string>
2025
+ const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
2026
+
2027
+ /**
2028
+ * This should be called before anything else.
2029
+ *
2030
+ * It is likely that this is being done for you by the library's `index.ts`.
2031
+ *
2032
+ * It checks versions of uniffi between when the Rust scaffolding was generated
2033
+ * and when the bindings were generated.
2034
+ *
2035
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
2036
+ */
2037
+ function uniffiEnsureInitialized() {
2038
+ // Get the bindings contract version from our ComponentInterface
2039
+ const bindingsContractVersion = 29;
2040
+ // Get the scaffolding contract version by calling the into the dylib
2041
+ const scaffoldingContractVersion =
2042
+ nativeModule().ubrn_ffi_cojson_core_rn_uniffi_contract_version();
2043
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
2044
+ throw new UniffiInternalError.ContractVersionMismatch(
2045
+ scaffoldingContractVersion,
2046
+ bindingsContractVersion
2047
+ );
2048
+ }
2049
+ if (
2050
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_blake3_hash_once() !==
2051
+ 58834
2052
+ ) {
2053
+ throw new UniffiInternalError.ApiChecksumMismatch(
2054
+ 'uniffi_cojson_core_rn_checksum_func_blake3_hash_once'
2055
+ );
2056
+ }
2057
+ if (
2058
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_blake3_hash_once_with_context() !==
2059
+ 28201
2060
+ ) {
2061
+ throw new UniffiInternalError.ApiChecksumMismatch(
2062
+ 'uniffi_cojson_core_rn_checksum_func_blake3_hash_once_with_context'
2063
+ );
2064
+ }
2065
+ if (
2066
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_decrypt() !== 5223
2067
+ ) {
2068
+ throw new UniffiInternalError.ApiChecksumMismatch(
2069
+ 'uniffi_cojson_core_rn_checksum_func_decrypt'
2070
+ );
2071
+ }
2072
+ if (
2073
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_decrypt_xsalsa20() !==
2074
+ 29059
2075
+ ) {
2076
+ throw new UniffiInternalError.ApiChecksumMismatch(
2077
+ 'uniffi_cojson_core_rn_checksum_func_decrypt_xsalsa20'
2078
+ );
2079
+ }
2080
+ if (
2081
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_sign() !==
2082
+ 5643
2083
+ ) {
2084
+ throw new UniffiInternalError.ApiChecksumMismatch(
2085
+ 'uniffi_cojson_core_rn_checksum_func_ed25519_sign'
2086
+ );
2087
+ }
2088
+ if (
2089
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_signature_from_bytes() !==
2090
+ 4624
2091
+ ) {
2092
+ throw new UniffiInternalError.ApiChecksumMismatch(
2093
+ 'uniffi_cojson_core_rn_checksum_func_ed25519_signature_from_bytes'
2094
+ );
2095
+ }
2096
+ if (
2097
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_from_bytes() !==
2098
+ 37961
2099
+ ) {
2100
+ throw new UniffiInternalError.ApiChecksumMismatch(
2101
+ 'uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_from_bytes'
2102
+ );
2103
+ }
2104
+ if (
2105
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_sign() !==
2106
+ 50296
2107
+ ) {
2108
+ throw new UniffiInternalError.ApiChecksumMismatch(
2109
+ 'uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_sign'
2110
+ );
2111
+ }
2112
+ if (
2113
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_to_public() !==
2114
+ 17719
2115
+ ) {
2116
+ throw new UniffiInternalError.ApiChecksumMismatch(
2117
+ 'uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_to_public'
2118
+ );
2119
+ }
2120
+ if (
2121
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_verify() !==
2122
+ 49484
2123
+ ) {
2124
+ throw new UniffiInternalError.ApiChecksumMismatch(
2125
+ 'uniffi_cojson_core_rn_checksum_func_ed25519_verify'
2126
+ );
2127
+ }
2128
+ if (
2129
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key() !==
2130
+ 63215
2131
+ ) {
2132
+ throw new UniffiInternalError.ApiChecksumMismatch(
2133
+ 'uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key'
2134
+ );
2135
+ }
2136
+ if (
2137
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key_from_bytes() !==
2138
+ 42802
2139
+ ) {
2140
+ throw new UniffiInternalError.ApiChecksumMismatch(
2141
+ 'uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key_from_bytes'
2142
+ );
2143
+ }
2144
+ if (
2145
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_encrypt() !== 552
2146
+ ) {
2147
+ throw new UniffiInternalError.ApiChecksumMismatch(
2148
+ 'uniffi_cojson_core_rn_checksum_func_encrypt'
2149
+ );
2150
+ }
2151
+ if (
2152
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_encrypt_xsalsa20() !==
2153
+ 29297
2154
+ ) {
2155
+ throw new UniffiInternalError.ApiChecksumMismatch(
2156
+ 'uniffi_cojson_core_rn_checksum_func_encrypt_xsalsa20'
2157
+ );
2158
+ }
2159
+ if (
2160
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_generate_nonce() !==
2161
+ 55335
2162
+ ) {
2163
+ throw new UniffiInternalError.ApiChecksumMismatch(
2164
+ 'uniffi_cojson_core_rn_checksum_func_generate_nonce'
2165
+ );
2166
+ }
2167
+ if (
2168
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_get_sealer_id() !==
2169
+ 35163
2170
+ ) {
2171
+ throw new UniffiInternalError.ApiChecksumMismatch(
2172
+ 'uniffi_cojson_core_rn_checksum_func_get_sealer_id'
2173
+ );
2174
+ }
2175
+ if (
2176
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_get_signer_id() !==
2177
+ 4067
2178
+ ) {
2179
+ throw new UniffiInternalError.ApiChecksumMismatch(
2180
+ 'uniffi_cojson_core_rn_checksum_func_get_signer_id'
2181
+ );
2182
+ }
2183
+ if (
2184
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_new_ed25519_signing_key() !==
2185
+ 3282
2186
+ ) {
2187
+ throw new UniffiInternalError.ApiChecksumMismatch(
2188
+ 'uniffi_cojson_core_rn_checksum_func_new_ed25519_signing_key'
2189
+ );
2190
+ }
2191
+ if (
2192
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_new_x25519_private_key() !==
2193
+ 56777
2194
+ ) {
2195
+ throw new UniffiInternalError.ApiChecksumMismatch(
2196
+ 'uniffi_cojson_core_rn_checksum_func_new_x25519_private_key'
2197
+ );
2198
+ }
2199
+ if (
2200
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_seal() !== 48965
2201
+ ) {
2202
+ throw new UniffiInternalError.ApiChecksumMismatch(
2203
+ 'uniffi_cojson_core_rn_checksum_func_seal'
2204
+ );
2205
+ }
2206
+ if (
2207
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_sign() !== 12539
2208
+ ) {
2209
+ throw new UniffiInternalError.ApiChecksumMismatch(
2210
+ 'uniffi_cojson_core_rn_checksum_func_sign'
2211
+ );
2212
+ }
2213
+ if (
2214
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_unseal() !== 52356
2215
+ ) {
2216
+ throw new UniffiInternalError.ApiChecksumMismatch(
2217
+ 'uniffi_cojson_core_rn_checksum_func_unseal'
2218
+ );
2219
+ }
2220
+ if (
2221
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_verify() !== 59548
2222
+ ) {
2223
+ throw new UniffiInternalError.ApiChecksumMismatch(
2224
+ 'uniffi_cojson_core_rn_checksum_func_verify'
2225
+ );
2226
+ }
2227
+ if (
2228
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_x25519_diffie_hellman() !==
2229
+ 23336
2230
+ ) {
2231
+ throw new UniffiInternalError.ApiChecksumMismatch(
2232
+ 'uniffi_cojson_core_rn_checksum_func_x25519_diffie_hellman'
2233
+ );
2234
+ }
2235
+ if (
2236
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_x25519_public_key() !==
2237
+ 18915
2238
+ ) {
2239
+ throw new UniffiInternalError.ApiChecksumMismatch(
2240
+ 'uniffi_cojson_core_rn_checksum_func_x25519_public_key'
2241
+ );
2242
+ }
2243
+ if (
2244
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_blake3hasher_clone_hasher() !==
2245
+ 23778
2246
+ ) {
2247
+ throw new UniffiInternalError.ApiChecksumMismatch(
2248
+ 'uniffi_cojson_core_rn_checksum_method_blake3hasher_clone_hasher'
2249
+ );
2250
+ }
2251
+ if (
2252
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_blake3hasher_finalize() !==
2253
+ 64111
2254
+ ) {
2255
+ throw new UniffiInternalError.ApiChecksumMismatch(
2256
+ 'uniffi_cojson_core_rn_checksum_method_blake3hasher_finalize'
2257
+ );
2258
+ }
2259
+ if (
2260
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_blake3hasher_update() !==
2261
+ 27902
2262
+ ) {
2263
+ throw new UniffiInternalError.ApiChecksumMismatch(
2264
+ 'uniffi_cojson_core_rn_checksum_method_blake3hasher_update'
2265
+ );
2266
+ }
2267
+ if (
2268
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_private_transaction() !==
2269
+ 3753
2270
+ ) {
2271
+ throw new UniffiInternalError.ApiChecksumMismatch(
2272
+ 'uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_private_transaction'
2273
+ );
2274
+ }
2275
+ if (
2276
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_trusting_transaction() !==
2277
+ 43511
2278
+ ) {
2279
+ throw new UniffiInternalError.ApiChecksumMismatch(
2280
+ 'uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_trusting_transaction'
2281
+ );
2282
+ }
2283
+ if (
2284
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_clone_session_log() !==
2285
+ 8261
2286
+ ) {
2287
+ throw new UniffiInternalError.ApiChecksumMismatch(
2288
+ 'uniffi_cojson_core_rn_checksum_method_sessionlog_clone_session_log'
2289
+ );
2290
+ }
2291
+ if (
2292
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_changes_json() !==
2293
+ 22072
2294
+ ) {
2295
+ throw new UniffiInternalError.ApiChecksumMismatch(
2296
+ 'uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_changes_json'
2297
+ );
2298
+ }
2299
+ if (
2300
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_meta_json() !==
2301
+ 5632
2302
+ ) {
2303
+ throw new UniffiInternalError.ApiChecksumMismatch(
2304
+ 'uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_meta_json'
2305
+ );
2306
+ }
2307
+ if (
2308
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_try_add() !==
2309
+ 21226
2310
+ ) {
2311
+ throw new UniffiInternalError.ApiChecksumMismatch(
2312
+ 'uniffi_cojson_core_rn_checksum_method_sessionlog_try_add'
2313
+ );
2314
+ }
2315
+ if (
2316
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_constructor_blake3hasher_new() !==
2317
+ 24312
2318
+ ) {
2319
+ throw new UniffiInternalError.ApiChecksumMismatch(
2320
+ 'uniffi_cojson_core_rn_checksum_constructor_blake3hasher_new'
2321
+ );
2322
+ }
2323
+ if (
2324
+ nativeModule().ubrn_uniffi_cojson_core_rn_checksum_constructor_sessionlog_new() !==
2325
+ 25716
2326
+ ) {
2327
+ throw new UniffiInternalError.ApiChecksumMismatch(
2328
+ 'uniffi_cojson_core_rn_checksum_constructor_sessionlog_new'
2329
+ );
2330
+ }
2331
+ }
2332
+
2333
+ export default Object.freeze({
2334
+ initialize: uniffiEnsureInitialized,
2335
+ converters: {
2336
+ FfiConverterTypeBlake3Error,
2337
+ FfiConverterTypeBlake3Hasher,
2338
+ FfiConverterTypeCryptoErrorUniffi,
2339
+ FfiConverterTypeSessionLog,
2340
+ FfiConverterTypeSessionLogError,
2341
+ },
2342
+ });