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,1311 @@
1
+ "use strict";
2
+
3
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
4
+ // Trust me, you don't want to mess with it!
5
+ import nativeModule from "./cojson_core_rn-ffi.js";
6
+ import { AbstractFfiConverterByteArray, FfiConverterArray, FfiConverterArrayBuffer, FfiConverterBool, FfiConverterFloat64, FfiConverterInt32, FfiConverterObject, FfiConverterOptional, FfiConverterUInt32, FfiConverterUInt64, UniffiAbstractObject, UniffiError, UniffiInternalError, UniffiRustCaller, destructorGuardSymbol, pointerLiteralSymbol, uniffiCreateFfiConverterString, uniffiTypeNameSymbol } from 'uniffi-bindgen-react-native';
7
+
8
+ // Get converters from the other files, if any.
9
+ const uniffiCaller = new UniffiRustCaller(() => ({
10
+ code: 0
11
+ }));
12
+ const uniffiIsDebug =
13
+ // @ts-ignore -- The process global might not be defined
14
+ typeof process !== 'object' ||
15
+ // @ts-ignore -- The process global might not be defined
16
+ process?.env?.NODE_ENV !== 'production' || false;
17
+ // Public interface members begin here.
18
+
19
+ /**
20
+ * Hash data once using BLAKE3.
21
+ * - `data`: Raw bytes to hash
22
+ * Returns 32 bytes of hash output.
23
+ * This is the simplest way to compute a BLAKE3 hash of a single piece of data.
24
+ */
25
+ export function blake3HashOnce(data) {
26
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
27
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_blake3_hash_once(FfiConverterArrayBuffer.lower(data), callStatus);
28
+ }, /*liftString:*/FfiConverterString.lift));
29
+ }
30
+ /**
31
+ * Hash data once using BLAKE3 with a context prefix.
32
+ * - `data`: Raw bytes to hash
33
+ * - `context`: Context bytes to prefix to the data
34
+ * Returns 32 bytes of hash output.
35
+ * This is useful for domain separation - the same data hashed with different contexts will produce different outputs.
36
+ */
37
+ export function blake3HashOnceWithContext(data, context) {
38
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
39
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_blake3_hash_once_with_context(FfiConverterArrayBuffer.lower(data), FfiConverterArrayBuffer.lower(context), callStatus);
40
+ }, /*liftString:*/FfiConverterString.lift));
41
+ }
42
+ /**
43
+ * Uniffi-exposed function to decrypt bytes with a key secret and nonce material.
44
+ * - `ciphertext`: The encrypted bytes to decrypt
45
+ * - `key_secret`: A base58-encoded key secret with "keySecret_z" prefix
46
+ * - `nonce_material`: Raw bytes used to generate the nonce (must match encryption)
47
+ * Returns the decrypted bytes or throws an error if decryption fails.
48
+ */
49
+ export function decrypt(ciphertext, keySecret, nonceMaterial) /*throws*/{
50
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
51
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_decrypt(FfiConverterArrayBuffer.lower(ciphertext), FfiConverterString.lower(keySecret), FfiConverterArrayBuffer.lower(nonceMaterial), callStatus);
52
+ }, /*liftString:*/FfiConverterString.lift));
53
+ }
54
+ /**
55
+ * Uniffi-exposed function for XSalsa20 decryption without authentication.
56
+ * - `key`: 32-byte key for decryption (must match encryption key)
57
+ * - `nonce_material`: Raw bytes used to generate a 24-byte nonce (must match encryption)
58
+ * - `ciphertext`: Encrypted bytes to decrypt
59
+ * Returns the decrypted bytes or throws an error if decryption fails.
60
+ * Note: This function does not provide authentication. Use decrypt_xsalsa20_poly1305 for authenticated decryption.
61
+ */
62
+ export function decryptXsalsa20(key, nonceMaterial, ciphertext) /*throws*/{
63
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
64
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_decrypt_xsalsa20(FfiConverterArrayBuffer.lower(key), FfiConverterArrayBuffer.lower(nonceMaterial), FfiConverterArrayBuffer.lower(ciphertext), callStatus);
65
+ }, /*liftString:*/FfiConverterString.lift));
66
+ }
67
+ /**
68
+ * uniffi-exposed function to sign a message using Ed25519.
69
+ * - `signing_key`: 32 bytes of signing key material
70
+ * - `message`: Raw bytes to sign
71
+ * Returns 64 bytes of signature material or throws CryptoErrorUniffi if signing fails.
72
+ */
73
+ export function ed25519Sign(signingKey, message) /*throws*/{
74
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
75
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_sign(FfiConverterArrayBuffer.lower(signingKey), FfiConverterArrayBuffer.lower(message), callStatus);
76
+ }, /*liftString:*/FfiConverterString.lift));
77
+ }
78
+ /**
79
+ * uniffi-exposed function to validate and copy Ed25519 signature bytes.
80
+ * - `bytes`: 64 bytes of signature material to validate
81
+ * Returns the same 64 bytes if valid or throws CryptoErrorUniffi if invalid.
82
+ */
83
+ export function ed25519SignatureFromBytes(bytes) /*throws*/{
84
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
85
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_signature_from_bytes(FfiConverterArrayBuffer.lower(bytes), callStatus);
86
+ }, /*liftString:*/FfiConverterString.lift));
87
+ }
88
+ /**
89
+ * uniffi-exposed function to validate and copy Ed25519 signing key bytes.
90
+ * - `bytes`: 32 bytes of signing key material to validate
91
+ * Returns the same 32 bytes if valid or throws CryptoErrorUniffi if invalid.
92
+ */
93
+ export function ed25519SigningKeyFromBytes(bytes) /*throws*/{
94
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
95
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_from_bytes(FfiConverterArrayBuffer.lower(bytes), callStatus);
96
+ }, /*liftString:*/FfiConverterString.lift));
97
+ }
98
+ /**
99
+ * uniffi-exposed function to sign a message with an Ed25519 signing key.
100
+ * - `signing_key`: 32 bytes of signing key material
101
+ * - `message`: Raw bytes to sign
102
+ * Returns 64 bytes of signature material or throws CryptoErrorUniffi if signing fails.
103
+ */
104
+ export function ed25519SigningKeySign(signingKey, message) /*throws*/{
105
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
106
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_sign(FfiConverterArrayBuffer.lower(signingKey), FfiConverterArrayBuffer.lower(message), callStatus);
107
+ }, /*liftString:*/FfiConverterString.lift));
108
+ }
109
+ /**
110
+ * uniffi-exposed function to derive the public key from an Ed25519 signing key.
111
+ * - `signing_key`: 32 bytes of signing key material
112
+ * Returns 32 bytes of public key material or throws CryptoErrorUniffi if key is invalid.
113
+ */
114
+ export function ed25519SigningKeyToPublic(signingKey) /*throws*/{
115
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
116
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_to_public(FfiConverterArrayBuffer.lower(signingKey), callStatus);
117
+ }, /*liftString:*/FfiConverterString.lift));
118
+ }
119
+ /**
120
+ * uniffi-exposed function to verify an Ed25519 signature.
121
+ * - `verifying_key`: 32 bytes of verifying key material
122
+ * - `message`: Raw bytes that were signed
123
+ * - `signature`: 64 bytes of signature material
124
+ * Returns true if signature is valid, false otherwise, or throws CryptoErrorUniffi if verification fails.
125
+ */
126
+ export function ed25519Verify(verifyingKey, message, signature) /*throws*/{
127
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
128
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_verify(FfiConverterArrayBuffer.lower(verifyingKey), FfiConverterArrayBuffer.lower(message), FfiConverterArrayBuffer.lower(signature), callStatus);
129
+ }, /*liftString:*/FfiConverterString.lift));
130
+ }
131
+ /**
132
+ * uniffi-exposed function to derive an Ed25519 verifying key from a signing key.
133
+ * - `signing_key`: 32 bytes of signing key material
134
+ * Returns 32 bytes of verifying key material or throws CryptoErrorUniffi if key is invalid.
135
+ */
136
+ export function ed25519VerifyingKey(signingKey) /*throws*/{
137
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
138
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_verifying_key(FfiConverterArrayBuffer.lower(signingKey), callStatus);
139
+ }, /*liftString:*/FfiConverterString.lift));
140
+ }
141
+ /**
142
+ * uniffi-exposed function to validate and copy Ed25519 verifying key bytes.
143
+ * - `bytes`: 32 bytes of verifying key material to validate
144
+ * Returns the same 32 bytes if valid or throws CryptoErrorUniffi if invalid.
145
+ */
146
+ export function ed25519VerifyingKeyFromBytes(bytes) /*throws*/{
147
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
148
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_ed25519_verifying_key_from_bytes(FfiConverterArrayBuffer.lower(bytes), callStatus);
149
+ }, /*liftString:*/FfiConverterString.lift));
150
+ }
151
+ /**
152
+ * Uniffi-exposed function to encrypt bytes with a key secret and nonce material.
153
+ * - `value`: The raw bytes to encrypt
154
+ * - `key_secret`: A base58-encoded key secret with "keySecret_z" prefix
155
+ * - `nonce_material`: Raw bytes used to generate the nonce
156
+ * Returns the encrypted bytes or throws an error if encryption fails.
157
+ */
158
+ export function encrypt(value, keySecret, nonceMaterial) /*throws*/{
159
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
160
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_encrypt(FfiConverterArrayBuffer.lower(value), FfiConverterString.lower(keySecret), FfiConverterArrayBuffer.lower(nonceMaterial), callStatus);
161
+ }, /*liftString:*/FfiConverterString.lift));
162
+ }
163
+ /**
164
+ * Uniffi-exposed function for XSalsa20 encryption without authentication.
165
+ * - `key`: 32-byte key for encryption
166
+ * - `nonce_material`: Raw bytes used to generate a 24-byte nonce via BLAKE3
167
+ * - `plaintext`: Raw bytes to encrypt
168
+ * Returns the encrypted bytes or throws an error if encryption fails.
169
+ * Note: This function does not provide authentication. Use encrypt_xsalsa20_poly1305 for authenticated encryption.
170
+ */
171
+ export function encryptXsalsa20(key, nonceMaterial, plaintext) /*throws*/{
172
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
173
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_encrypt_xsalsa20(FfiConverterArrayBuffer.lower(key), FfiConverterArrayBuffer.lower(nonceMaterial), FfiConverterArrayBuffer.lower(plaintext), callStatus);
174
+ }, /*liftString:*/FfiConverterString.lift));
175
+ }
176
+ /**
177
+ * Generate a 24-byte nonce from input material using BLAKE3.
178
+ * - `nonce_material`: Raw bytes to derive the nonce from
179
+ * Returns 24 bytes suitable for use as a nonce in cryptographic operations.
180
+ * This function is deterministic - the same input will produce the same nonce.
181
+ */
182
+ export function generateNonce(nonceMaterial) {
183
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
184
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_generate_nonce(FfiConverterArrayBuffer.lower(nonceMaterial), callStatus);
185
+ }, /*liftString:*/FfiConverterString.lift));
186
+ }
187
+ /**
188
+ * Uniffi-exposed function to derive a sealer ID from a sealer secret.
189
+ * - `secret`: UTF-8 encoded sealer secret string
190
+ * Returns a base58-encoded sealer ID with "sealer_z" prefix or throws an error if derivation fails.
191
+ */
192
+ export function getSealerId(secret) /*throws*/{
193
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
194
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_get_sealer_id(FfiConverterString.lower(secret), callStatus);
195
+ }, /*liftString:*/FfiConverterString.lift));
196
+ }
197
+ /**
198
+ * Uniffi-exposed function to derive a signer ID from a signing key.
199
+ * - `secret`: UTF-8 encoded Ed25519 signing key string
200
+ * Returns base58-encoded verifying key with "signer_z" prefix or throws an error if derivation fails.
201
+ */
202
+ export function getSignerId(secret) /*throws*/{
203
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
204
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_get_signer_id(FfiConverterString.lower(secret), callStatus);
205
+ }, /*liftString:*/FfiConverterString.lift));
206
+ }
207
+ /**
208
+ * Generate a new Ed25519 signing key using secure random number generation.
209
+ * Returns 32 bytes of raw key material suitable for use with other Ed25519 functions.
210
+ */
211
+ export function newEd25519SigningKey() {
212
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
213
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_new_ed25519_signing_key(callStatus);
214
+ }, /*liftString:*/FfiConverterString.lift));
215
+ }
216
+ /**
217
+ * Generate a new X25519 private key using secure random number generation.
218
+ * Returns 32 bytes of raw key material suitable for use with other X25519 functions.
219
+ * This key can be reused for multiple Diffie-Hellman exchanges.
220
+ */
221
+ export function newX25519PrivateKey() {
222
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCall(/*caller:*/callStatus => {
223
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_new_x25519_private_key(callStatus);
224
+ }, /*liftString:*/FfiConverterString.lift));
225
+ }
226
+ /**
227
+ * Uniffi-exposed function for sealing a message using X25519 + XSalsa20-Poly1305.
228
+ * Provides authenticated encryption with perfect forward secrecy.
229
+ * - `message`: Raw bytes to seal
230
+ * - `sender_secret`: Base58-encoded sender's private key with "sealerSecret_z" prefix
231
+ * - `recipient_id`: Base58-encoded recipient's public key with "sealer_z" prefix
232
+ * - `nonce_material`: Raw bytes used to generate the nonce
233
+ * Returns sealed bytes or throws an error if sealing fails.
234
+ */
235
+ export function seal(message, senderSecret, recipientId, nonceMaterial) /*throws*/{
236
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
237
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_seal(FfiConverterArrayBuffer.lower(message), FfiConverterString.lower(senderSecret), FfiConverterString.lower(recipientId), FfiConverterArrayBuffer.lower(nonceMaterial), callStatus);
238
+ }, /*liftString:*/FfiConverterString.lift));
239
+ }
240
+ /**
241
+ * Uniffi-exposed function to sign a message using Ed25519.
242
+ * - `message`: Raw bytes to sign
243
+ * - `secret`: UTF-8 encoded Ed25519 signing key string
244
+ * Returns base58-encoded signature with "signature_z" prefix or throws an error if signing fails.
245
+ */
246
+ export function sign(message, secret) /*throws*/{
247
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
248
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_sign(FfiConverterArrayBuffer.lower(message), FfiConverterString.lower(secret), callStatus);
249
+ }, /*liftString:*/FfiConverterString.lift));
250
+ }
251
+ /**
252
+ * Uniffi-exposed function for unsealing a message using X25519 + XSalsa20-Poly1305.
253
+ * Provides authenticated decryption with perfect forward secrecy.
254
+ * - `sealed_message`: The sealed bytes to decrypt
255
+ * - `recipient_secret`: Base58-encoded recipient's private key with "sealerSecret_z" prefix
256
+ * - `sender_id`: Base58-encoded sender's public key with "sealer_z" prefix
257
+ * - `nonce_material`: Raw bytes used to generate the nonce (must match sealing)
258
+ * Returns unsealed bytes or throws an error if unsealing fails.
259
+ */
260
+ export function unseal(sealedMessage, recipientSecret, senderId, nonceMaterial) /*throws*/{
261
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
262
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_unseal(FfiConverterArrayBuffer.lower(sealedMessage), FfiConverterString.lower(recipientSecret), FfiConverterString.lower(senderId), FfiConverterArrayBuffer.lower(nonceMaterial), callStatus);
263
+ }, /*liftString:*/FfiConverterString.lift));
264
+ }
265
+ /**
266
+ * Uniffi-exposed function to verify an Ed25519 signature.
267
+ * - `signature`: Base58-encoded signature string
268
+ * - `message`: Raw bytes that were signed
269
+ * - `id`: Base58-encoded verifying key string
270
+ * Returns true if signature is valid, false otherwise, or throws an error if verification fails.
271
+ */
272
+ export function verify(signature, message, id) /*throws*/{
273
+ return FfiConverterBool.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
274
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_verify(FfiConverterString.lower(signature), FfiConverterArrayBuffer.lower(message), FfiConverterString.lower(id), callStatus);
275
+ }, /*liftString:*/FfiConverterString.lift));
276
+ }
277
+ /**
278
+ * Uniffi-exposed function to perform X25519 Diffie-Hellman key exchange.
279
+ * - `private_key`: 32 bytes of private key material
280
+ * - `public_key`: 32 bytes of public key material
281
+ * Returns 32 bytes of shared secret material or throws an error if key exchange fails.
282
+ */
283
+ export function x25519DiffieHellman(privateKey, publicKey) /*throws*/{
284
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
285
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_x25519_diffie_hellman(FfiConverterArrayBuffer.lower(privateKey), FfiConverterArrayBuffer.lower(publicKey), callStatus);
286
+ }, /*liftString:*/FfiConverterString.lift));
287
+ }
288
+ /**
289
+ * Uniffi-exposed function to derive an X25519 public key from a private key.
290
+ * - `private_key`: 32 bytes of private key material
291
+ * Returns 32 bytes of public key material or throws an error if key is invalid.
292
+ */
293
+ export function x25519PublicKey(privateKey) /*throws*/{
294
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeCryptoErrorUniffi.lift.bind(FfiConverterTypeCryptoErrorUniffi), /*caller:*/callStatus => {
295
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_func_x25519_public_key(FfiConverterArrayBuffer.lower(privateKey), callStatus);
296
+ }, /*liftString:*/FfiConverterString.lift));
297
+ }
298
+ const stringConverter = {
299
+ stringToBytes: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer(s, status)),
300
+ bytesToString: ab => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string(ab, status)),
301
+ stringByteLength: s => uniffiCaller.rustCall(status => nativeModule().ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length(s, status))
302
+ };
303
+ const FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
304
+
305
+ // Error type: Blake3Error
306
+
307
+ // Enum: Blake3Error
308
+ export let Blake3Error_Tags = /*#__PURE__*/function (Blake3Error_Tags) {
309
+ Blake3Error_Tags["LockError"] = "LockError";
310
+ return Blake3Error_Tags;
311
+ }({});
312
+ export const Blake3Error = (() => {
313
+ class LockError_ extends UniffiError {
314
+ /**
315
+ * @private
316
+ * This field is private and should not be used, use `tag` instead.
317
+ */
318
+ [uniffiTypeNameSymbol] = 'Blake3Error';
319
+ tag = Blake3Error_Tags.LockError;
320
+ constructor() {
321
+ super('Blake3Error', 'LockError');
322
+ }
323
+ static new() {
324
+ return new LockError_();
325
+ }
326
+ static instanceOf(obj) {
327
+ return obj.tag === Blake3Error_Tags.LockError;
328
+ }
329
+ static hasInner(obj) {
330
+ return false;
331
+ }
332
+ }
333
+ function instanceOf(obj) {
334
+ return obj[uniffiTypeNameSymbol] === 'Blake3Error';
335
+ }
336
+ return Object.freeze({
337
+ instanceOf,
338
+ LockError: LockError_
339
+ });
340
+ })();
341
+ // FfiConverter for enum Blake3Error
342
+ const FfiConverterTypeBlake3Error = (() => {
343
+ const ordinalConverter = FfiConverterInt32;
344
+ class FFIConverter extends AbstractFfiConverterByteArray {
345
+ read(from) {
346
+ switch (ordinalConverter.read(from)) {
347
+ case 1:
348
+ return new Blake3Error.LockError();
349
+ default:
350
+ throw new UniffiInternalError.UnexpectedEnumCase();
351
+ }
352
+ }
353
+ write(value, into) {
354
+ switch (value.tag) {
355
+ case Blake3Error_Tags.LockError:
356
+ {
357
+ ordinalConverter.write(1, into);
358
+ return;
359
+ }
360
+ default:
361
+ // Throwing from here means that Blake3Error_Tags hasn't matched an ordinal.
362
+ throw new UniffiInternalError.UnexpectedEnumCase();
363
+ }
364
+ }
365
+ allocationSize(value) {
366
+ switch (value.tag) {
367
+ case Blake3Error_Tags.LockError:
368
+ {
369
+ return ordinalConverter.allocationSize(1);
370
+ }
371
+ default:
372
+ throw new UniffiInternalError.UnexpectedEnumCase();
373
+ }
374
+ }
375
+ }
376
+ return new FFIConverter();
377
+ })();
378
+
379
+ // Error type: CryptoErrorUniffi
380
+
381
+ // Enum: CryptoErrorUniffi
382
+ export let CryptoErrorUniffi_Tags = /*#__PURE__*/function (CryptoErrorUniffi_Tags) {
383
+ CryptoErrorUniffi_Tags["InvalidKeyLength"] = "InvalidKeyLength";
384
+ CryptoErrorUniffi_Tags["InvalidNonceLength"] = "InvalidNonceLength";
385
+ CryptoErrorUniffi_Tags["InvalidSealerSecretFormat"] = "InvalidSealerSecretFormat";
386
+ CryptoErrorUniffi_Tags["InvalidSignatureLength"] = "InvalidSignatureLength";
387
+ CryptoErrorUniffi_Tags["InvalidVerifyingKey"] = "InvalidVerifyingKey";
388
+ CryptoErrorUniffi_Tags["InvalidPublicKey"] = "InvalidPublicKey";
389
+ CryptoErrorUniffi_Tags["WrongTag"] = "WrongTag";
390
+ CryptoErrorUniffi_Tags["CipherError"] = "CipherError";
391
+ CryptoErrorUniffi_Tags["InvalidPrefix"] = "InvalidPrefix";
392
+ CryptoErrorUniffi_Tags["Base58Error"] = "Base58Error";
393
+ return CryptoErrorUniffi_Tags;
394
+ }({});
395
+ export const CryptoErrorUniffi = (() => {
396
+ class InvalidKeyLength_ extends UniffiError {
397
+ /**
398
+ * @private
399
+ * This field is private and should not be used, use `tag` instead.
400
+ */
401
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
402
+ tag = CryptoErrorUniffi_Tags.InvalidKeyLength;
403
+ constructor(v0, v1) {
404
+ super('CryptoErrorUniffi', 'InvalidKeyLength');
405
+ this.inner = Object.freeze([v0, v1]);
406
+ }
407
+ static new(v0, v1) {
408
+ return new InvalidKeyLength_(v0, v1);
409
+ }
410
+ static instanceOf(obj) {
411
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidKeyLength;
412
+ }
413
+ static hasInner(obj) {
414
+ return InvalidKeyLength_.instanceOf(obj);
415
+ }
416
+ static getInner(obj) {
417
+ return obj.inner;
418
+ }
419
+ }
420
+ class InvalidNonceLength_ extends UniffiError {
421
+ /**
422
+ * @private
423
+ * This field is private and should not be used, use `tag` instead.
424
+ */
425
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
426
+ tag = CryptoErrorUniffi_Tags.InvalidNonceLength;
427
+ constructor() {
428
+ super('CryptoErrorUniffi', 'InvalidNonceLength');
429
+ }
430
+ static new() {
431
+ return new InvalidNonceLength_();
432
+ }
433
+ static instanceOf(obj) {
434
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidNonceLength;
435
+ }
436
+ static hasInner(obj) {
437
+ return false;
438
+ }
439
+ }
440
+ class InvalidSealerSecretFormat_ extends UniffiError {
441
+ /**
442
+ * @private
443
+ * This field is private and should not be used, use `tag` instead.
444
+ */
445
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
446
+ tag = CryptoErrorUniffi_Tags.InvalidSealerSecretFormat;
447
+ constructor() {
448
+ super('CryptoErrorUniffi', 'InvalidSealerSecretFormat');
449
+ }
450
+ static new() {
451
+ return new InvalidSealerSecretFormat_();
452
+ }
453
+ static instanceOf(obj) {
454
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidSealerSecretFormat;
455
+ }
456
+ static hasInner(obj) {
457
+ return false;
458
+ }
459
+ }
460
+ class InvalidSignatureLength_ extends UniffiError {
461
+ /**
462
+ * @private
463
+ * This field is private and should not be used, use `tag` instead.
464
+ */
465
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
466
+ tag = CryptoErrorUniffi_Tags.InvalidSignatureLength;
467
+ constructor() {
468
+ super('CryptoErrorUniffi', 'InvalidSignatureLength');
469
+ }
470
+ static new() {
471
+ return new InvalidSignatureLength_();
472
+ }
473
+ static instanceOf(obj) {
474
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidSignatureLength;
475
+ }
476
+ static hasInner(obj) {
477
+ return false;
478
+ }
479
+ }
480
+ class InvalidVerifyingKey_ extends UniffiError {
481
+ /**
482
+ * @private
483
+ * This field is private and should not be used, use `tag` instead.
484
+ */
485
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
486
+ tag = CryptoErrorUniffi_Tags.InvalidVerifyingKey;
487
+ constructor(v0) {
488
+ super('CryptoErrorUniffi', 'InvalidVerifyingKey');
489
+ this.inner = Object.freeze([v0]);
490
+ }
491
+ static new(v0) {
492
+ return new InvalidVerifyingKey_(v0);
493
+ }
494
+ static instanceOf(obj) {
495
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidVerifyingKey;
496
+ }
497
+ static hasInner(obj) {
498
+ return InvalidVerifyingKey_.instanceOf(obj);
499
+ }
500
+ static getInner(obj) {
501
+ return obj.inner;
502
+ }
503
+ }
504
+ class InvalidPublicKey_ extends UniffiError {
505
+ /**
506
+ * @private
507
+ * This field is private and should not be used, use `tag` instead.
508
+ */
509
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
510
+ tag = CryptoErrorUniffi_Tags.InvalidPublicKey;
511
+ constructor(v0) {
512
+ super('CryptoErrorUniffi', 'InvalidPublicKey');
513
+ this.inner = Object.freeze([v0]);
514
+ }
515
+ static new(v0) {
516
+ return new InvalidPublicKey_(v0);
517
+ }
518
+ static instanceOf(obj) {
519
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidPublicKey;
520
+ }
521
+ static hasInner(obj) {
522
+ return InvalidPublicKey_.instanceOf(obj);
523
+ }
524
+ static getInner(obj) {
525
+ return obj.inner;
526
+ }
527
+ }
528
+ class WrongTag_ extends UniffiError {
529
+ /**
530
+ * @private
531
+ * This field is private and should not be used, use `tag` instead.
532
+ */
533
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
534
+ tag = CryptoErrorUniffi_Tags.WrongTag;
535
+ constructor() {
536
+ super('CryptoErrorUniffi', 'WrongTag');
537
+ }
538
+ static new() {
539
+ return new WrongTag_();
540
+ }
541
+ static instanceOf(obj) {
542
+ return obj.tag === CryptoErrorUniffi_Tags.WrongTag;
543
+ }
544
+ static hasInner(obj) {
545
+ return false;
546
+ }
547
+ }
548
+ class CipherError_ extends UniffiError {
549
+ /**
550
+ * @private
551
+ * This field is private and should not be used, use `tag` instead.
552
+ */
553
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
554
+ tag = CryptoErrorUniffi_Tags.CipherError;
555
+ constructor() {
556
+ super('CryptoErrorUniffi', 'CipherError');
557
+ }
558
+ static new() {
559
+ return new CipherError_();
560
+ }
561
+ static instanceOf(obj) {
562
+ return obj.tag === CryptoErrorUniffi_Tags.CipherError;
563
+ }
564
+ static hasInner(obj) {
565
+ return false;
566
+ }
567
+ }
568
+ class InvalidPrefix_ extends UniffiError {
569
+ /**
570
+ * @private
571
+ * This field is private and should not be used, use `tag` instead.
572
+ */
573
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
574
+ tag = CryptoErrorUniffi_Tags.InvalidPrefix;
575
+ constructor(v0, v1) {
576
+ super('CryptoErrorUniffi', 'InvalidPrefix');
577
+ this.inner = Object.freeze([v0, v1]);
578
+ }
579
+ static new(v0, v1) {
580
+ return new InvalidPrefix_(v0, v1);
581
+ }
582
+ static instanceOf(obj) {
583
+ return obj.tag === CryptoErrorUniffi_Tags.InvalidPrefix;
584
+ }
585
+ static hasInner(obj) {
586
+ return InvalidPrefix_.instanceOf(obj);
587
+ }
588
+ static getInner(obj) {
589
+ return obj.inner;
590
+ }
591
+ }
592
+ class Base58Error_ extends UniffiError {
593
+ /**
594
+ * @private
595
+ * This field is private and should not be used, use `tag` instead.
596
+ */
597
+ [uniffiTypeNameSymbol] = 'CryptoErrorUniffi';
598
+ tag = CryptoErrorUniffi_Tags.Base58Error;
599
+ constructor(v0) {
600
+ super('CryptoErrorUniffi', 'Base58Error');
601
+ this.inner = Object.freeze([v0]);
602
+ }
603
+ static new(v0) {
604
+ return new Base58Error_(v0);
605
+ }
606
+ static instanceOf(obj) {
607
+ return obj.tag === CryptoErrorUniffi_Tags.Base58Error;
608
+ }
609
+ static hasInner(obj) {
610
+ return Base58Error_.instanceOf(obj);
611
+ }
612
+ static getInner(obj) {
613
+ return obj.inner;
614
+ }
615
+ }
616
+ function instanceOf(obj) {
617
+ return obj[uniffiTypeNameSymbol] === 'CryptoErrorUniffi';
618
+ }
619
+ return Object.freeze({
620
+ instanceOf,
621
+ InvalidKeyLength: InvalidKeyLength_,
622
+ InvalidNonceLength: InvalidNonceLength_,
623
+ InvalidSealerSecretFormat: InvalidSealerSecretFormat_,
624
+ InvalidSignatureLength: InvalidSignatureLength_,
625
+ InvalidVerifyingKey: InvalidVerifyingKey_,
626
+ InvalidPublicKey: InvalidPublicKey_,
627
+ WrongTag: WrongTag_,
628
+ CipherError: CipherError_,
629
+ InvalidPrefix: InvalidPrefix_,
630
+ Base58Error: Base58Error_
631
+ });
632
+ })();
633
+ // FfiConverter for enum CryptoErrorUniffi
634
+ const FfiConverterTypeCryptoErrorUniffi = (() => {
635
+ const ordinalConverter = FfiConverterInt32;
636
+ class FFIConverter extends AbstractFfiConverterByteArray {
637
+ read(from) {
638
+ switch (ordinalConverter.read(from)) {
639
+ case 1:
640
+ return new CryptoErrorUniffi.InvalidKeyLength(FfiConverterUInt64.read(from), FfiConverterUInt64.read(from));
641
+ case 2:
642
+ return new CryptoErrorUniffi.InvalidNonceLength();
643
+ case 3:
644
+ return new CryptoErrorUniffi.InvalidSealerSecretFormat();
645
+ case 4:
646
+ return new CryptoErrorUniffi.InvalidSignatureLength();
647
+ case 5:
648
+ return new CryptoErrorUniffi.InvalidVerifyingKey(FfiConverterString.read(from));
649
+ case 6:
650
+ return new CryptoErrorUniffi.InvalidPublicKey(FfiConverterString.read(from));
651
+ case 7:
652
+ return new CryptoErrorUniffi.WrongTag();
653
+ case 8:
654
+ return new CryptoErrorUniffi.CipherError();
655
+ case 9:
656
+ return new CryptoErrorUniffi.InvalidPrefix(FfiConverterString.read(from), FfiConverterString.read(from));
657
+ case 10:
658
+ return new CryptoErrorUniffi.Base58Error(FfiConverterString.read(from));
659
+ default:
660
+ throw new UniffiInternalError.UnexpectedEnumCase();
661
+ }
662
+ }
663
+ write(value, into) {
664
+ switch (value.tag) {
665
+ case CryptoErrorUniffi_Tags.InvalidKeyLength:
666
+ {
667
+ ordinalConverter.write(1, into);
668
+ const inner = value.inner;
669
+ FfiConverterUInt64.write(inner[0], into);
670
+ FfiConverterUInt64.write(inner[1], into);
671
+ return;
672
+ }
673
+ case CryptoErrorUniffi_Tags.InvalidNonceLength:
674
+ {
675
+ ordinalConverter.write(2, into);
676
+ return;
677
+ }
678
+ case CryptoErrorUniffi_Tags.InvalidSealerSecretFormat:
679
+ {
680
+ ordinalConverter.write(3, into);
681
+ return;
682
+ }
683
+ case CryptoErrorUniffi_Tags.InvalidSignatureLength:
684
+ {
685
+ ordinalConverter.write(4, into);
686
+ return;
687
+ }
688
+ case CryptoErrorUniffi_Tags.InvalidVerifyingKey:
689
+ {
690
+ ordinalConverter.write(5, into);
691
+ const inner = value.inner;
692
+ FfiConverterString.write(inner[0], into);
693
+ return;
694
+ }
695
+ case CryptoErrorUniffi_Tags.InvalidPublicKey:
696
+ {
697
+ ordinalConverter.write(6, into);
698
+ const inner = value.inner;
699
+ FfiConverterString.write(inner[0], into);
700
+ return;
701
+ }
702
+ case CryptoErrorUniffi_Tags.WrongTag:
703
+ {
704
+ ordinalConverter.write(7, into);
705
+ return;
706
+ }
707
+ case CryptoErrorUniffi_Tags.CipherError:
708
+ {
709
+ ordinalConverter.write(8, into);
710
+ return;
711
+ }
712
+ case CryptoErrorUniffi_Tags.InvalidPrefix:
713
+ {
714
+ ordinalConverter.write(9, into);
715
+ const inner = value.inner;
716
+ FfiConverterString.write(inner[0], into);
717
+ FfiConverterString.write(inner[1], into);
718
+ return;
719
+ }
720
+ case CryptoErrorUniffi_Tags.Base58Error:
721
+ {
722
+ ordinalConverter.write(10, into);
723
+ const inner = value.inner;
724
+ FfiConverterString.write(inner[0], into);
725
+ return;
726
+ }
727
+ default:
728
+ // Throwing from here means that CryptoErrorUniffi_Tags hasn't matched an ordinal.
729
+ throw new UniffiInternalError.UnexpectedEnumCase();
730
+ }
731
+ }
732
+ allocationSize(value) {
733
+ switch (value.tag) {
734
+ case CryptoErrorUniffi_Tags.InvalidKeyLength:
735
+ {
736
+ const inner = value.inner;
737
+ let size = ordinalConverter.allocationSize(1);
738
+ size += FfiConverterUInt64.allocationSize(inner[0]);
739
+ size += FfiConverterUInt64.allocationSize(inner[1]);
740
+ return size;
741
+ }
742
+ case CryptoErrorUniffi_Tags.InvalidNonceLength:
743
+ {
744
+ return ordinalConverter.allocationSize(2);
745
+ }
746
+ case CryptoErrorUniffi_Tags.InvalidSealerSecretFormat:
747
+ {
748
+ return ordinalConverter.allocationSize(3);
749
+ }
750
+ case CryptoErrorUniffi_Tags.InvalidSignatureLength:
751
+ {
752
+ return ordinalConverter.allocationSize(4);
753
+ }
754
+ case CryptoErrorUniffi_Tags.InvalidVerifyingKey:
755
+ {
756
+ const inner = value.inner;
757
+ let size = ordinalConverter.allocationSize(5);
758
+ size += FfiConverterString.allocationSize(inner[0]);
759
+ return size;
760
+ }
761
+ case CryptoErrorUniffi_Tags.InvalidPublicKey:
762
+ {
763
+ const inner = value.inner;
764
+ let size = ordinalConverter.allocationSize(6);
765
+ size += FfiConverterString.allocationSize(inner[0]);
766
+ return size;
767
+ }
768
+ case CryptoErrorUniffi_Tags.WrongTag:
769
+ {
770
+ return ordinalConverter.allocationSize(7);
771
+ }
772
+ case CryptoErrorUniffi_Tags.CipherError:
773
+ {
774
+ return ordinalConverter.allocationSize(8);
775
+ }
776
+ case CryptoErrorUniffi_Tags.InvalidPrefix:
777
+ {
778
+ const inner = value.inner;
779
+ let size = ordinalConverter.allocationSize(9);
780
+ size += FfiConverterString.allocationSize(inner[0]);
781
+ size += FfiConverterString.allocationSize(inner[1]);
782
+ return size;
783
+ }
784
+ case CryptoErrorUniffi_Tags.Base58Error:
785
+ {
786
+ const inner = value.inner;
787
+ let size = ordinalConverter.allocationSize(10);
788
+ size += FfiConverterString.allocationSize(inner[0]);
789
+ return size;
790
+ }
791
+ default:
792
+ throw new UniffiInternalError.UnexpectedEnumCase();
793
+ }
794
+ }
795
+ }
796
+ return new FFIConverter();
797
+ })();
798
+
799
+ // Error type: SessionLogError
800
+
801
+ // Enum: SessionLogError
802
+ export let SessionLogError_Tags = /*#__PURE__*/function (SessionLogError_Tags) {
803
+ SessionLogError_Tags["CoJson"] = "CoJson";
804
+ SessionLogError_Tags["Serde"] = "Serde";
805
+ SessionLogError_Tags["Generic"] = "Generic";
806
+ SessionLogError_Tags["LockError"] = "LockError";
807
+ return SessionLogError_Tags;
808
+ }({});
809
+ export const SessionLogError = (() => {
810
+ class CoJson_ extends UniffiError {
811
+ /**
812
+ * @private
813
+ * This field is private and should not be used, use `tag` instead.
814
+ */
815
+ [uniffiTypeNameSymbol] = 'SessionLogError';
816
+ tag = SessionLogError_Tags.CoJson;
817
+ constructor(v0) {
818
+ super('SessionLogError', 'CoJson');
819
+ this.inner = Object.freeze([v0]);
820
+ }
821
+ static new(v0) {
822
+ return new CoJson_(v0);
823
+ }
824
+ static instanceOf(obj) {
825
+ return obj.tag === SessionLogError_Tags.CoJson;
826
+ }
827
+ static hasInner(obj) {
828
+ return CoJson_.instanceOf(obj);
829
+ }
830
+ static getInner(obj) {
831
+ return obj.inner;
832
+ }
833
+ }
834
+ class Serde_ extends UniffiError {
835
+ /**
836
+ * @private
837
+ * This field is private and should not be used, use `tag` instead.
838
+ */
839
+ [uniffiTypeNameSymbol] = 'SessionLogError';
840
+ tag = SessionLogError_Tags.Serde;
841
+ constructor(v0) {
842
+ super('SessionLogError', 'Serde');
843
+ this.inner = Object.freeze([v0]);
844
+ }
845
+ static new(v0) {
846
+ return new Serde_(v0);
847
+ }
848
+ static instanceOf(obj) {
849
+ return obj.tag === SessionLogError_Tags.Serde;
850
+ }
851
+ static hasInner(obj) {
852
+ return Serde_.instanceOf(obj);
853
+ }
854
+ static getInner(obj) {
855
+ return obj.inner;
856
+ }
857
+ }
858
+ class Generic_ extends UniffiError {
859
+ /**
860
+ * @private
861
+ * This field is private and should not be used, use `tag` instead.
862
+ */
863
+ [uniffiTypeNameSymbol] = 'SessionLogError';
864
+ tag = SessionLogError_Tags.Generic;
865
+ constructor(v0) {
866
+ super('SessionLogError', 'Generic');
867
+ this.inner = Object.freeze([v0]);
868
+ }
869
+ static new(v0) {
870
+ return new Generic_(v0);
871
+ }
872
+ static instanceOf(obj) {
873
+ return obj.tag === SessionLogError_Tags.Generic;
874
+ }
875
+ static hasInner(obj) {
876
+ return Generic_.instanceOf(obj);
877
+ }
878
+ static getInner(obj) {
879
+ return obj.inner;
880
+ }
881
+ }
882
+ class LockError_ extends UniffiError {
883
+ /**
884
+ * @private
885
+ * This field is private and should not be used, use `tag` instead.
886
+ */
887
+ [uniffiTypeNameSymbol] = 'SessionLogError';
888
+ tag = SessionLogError_Tags.LockError;
889
+ constructor() {
890
+ super('SessionLogError', 'LockError');
891
+ }
892
+ static new() {
893
+ return new LockError_();
894
+ }
895
+ static instanceOf(obj) {
896
+ return obj.tag === SessionLogError_Tags.LockError;
897
+ }
898
+ static hasInner(obj) {
899
+ return false;
900
+ }
901
+ }
902
+ function instanceOf(obj) {
903
+ return obj[uniffiTypeNameSymbol] === 'SessionLogError';
904
+ }
905
+ return Object.freeze({
906
+ instanceOf,
907
+ CoJson: CoJson_,
908
+ Serde: Serde_,
909
+ Generic: Generic_,
910
+ LockError: LockError_
911
+ });
912
+ })();
913
+ // FfiConverter for enum SessionLogError
914
+ const FfiConverterTypeSessionLogError = (() => {
915
+ const ordinalConverter = FfiConverterInt32;
916
+ class FFIConverter extends AbstractFfiConverterByteArray {
917
+ read(from) {
918
+ switch (ordinalConverter.read(from)) {
919
+ case 1:
920
+ return new SessionLogError.CoJson(FfiConverterString.read(from));
921
+ case 2:
922
+ return new SessionLogError.Serde(FfiConverterString.read(from));
923
+ case 3:
924
+ return new SessionLogError.Generic(FfiConverterString.read(from));
925
+ case 4:
926
+ return new SessionLogError.LockError();
927
+ default:
928
+ throw new UniffiInternalError.UnexpectedEnumCase();
929
+ }
930
+ }
931
+ write(value, into) {
932
+ switch (value.tag) {
933
+ case SessionLogError_Tags.CoJson:
934
+ {
935
+ ordinalConverter.write(1, into);
936
+ const inner = value.inner;
937
+ FfiConverterString.write(inner[0], into);
938
+ return;
939
+ }
940
+ case SessionLogError_Tags.Serde:
941
+ {
942
+ ordinalConverter.write(2, into);
943
+ const inner = value.inner;
944
+ FfiConverterString.write(inner[0], into);
945
+ return;
946
+ }
947
+ case SessionLogError_Tags.Generic:
948
+ {
949
+ ordinalConverter.write(3, into);
950
+ const inner = value.inner;
951
+ FfiConverterString.write(inner[0], into);
952
+ return;
953
+ }
954
+ case SessionLogError_Tags.LockError:
955
+ {
956
+ ordinalConverter.write(4, into);
957
+ return;
958
+ }
959
+ default:
960
+ // Throwing from here means that SessionLogError_Tags hasn't matched an ordinal.
961
+ throw new UniffiInternalError.UnexpectedEnumCase();
962
+ }
963
+ }
964
+ allocationSize(value) {
965
+ switch (value.tag) {
966
+ case SessionLogError_Tags.CoJson:
967
+ {
968
+ const inner = value.inner;
969
+ let size = ordinalConverter.allocationSize(1);
970
+ size += FfiConverterString.allocationSize(inner[0]);
971
+ return size;
972
+ }
973
+ case SessionLogError_Tags.Serde:
974
+ {
975
+ const inner = value.inner;
976
+ let size = ordinalConverter.allocationSize(2);
977
+ size += FfiConverterString.allocationSize(inner[0]);
978
+ return size;
979
+ }
980
+ case SessionLogError_Tags.Generic:
981
+ {
982
+ const inner = value.inner;
983
+ let size = ordinalConverter.allocationSize(3);
984
+ size += FfiConverterString.allocationSize(inner[0]);
985
+ return size;
986
+ }
987
+ case SessionLogError_Tags.LockError:
988
+ {
989
+ return ordinalConverter.allocationSize(4);
990
+ }
991
+ default:
992
+ throw new UniffiInternalError.UnexpectedEnumCase();
993
+ }
994
+ }
995
+ }
996
+ return new FFIConverter();
997
+ })();
998
+ export class Blake3Hasher extends UniffiAbstractObject {
999
+ [uniffiTypeNameSymbol] = 'Blake3Hasher';
1000
+ constructor() {
1001
+ super();
1002
+ const pointer = uniffiCaller.rustCall(/*caller:*/callStatus => {
1003
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_constructor_blake3hasher_new(callStatus);
1004
+ }, /*liftString:*/FfiConverterString.lift);
1005
+ this[pointerLiteralSymbol] = pointer;
1006
+ this[destructorGuardSymbol] = uniffiTypeBlake3HasherObjectFactory.bless(pointer);
1007
+ }
1008
+ cloneHasher() /*throws*/{
1009
+ return FfiConverterTypeBlake3Hasher.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBlake3Error.lift.bind(FfiConverterTypeBlake3Error), /*caller:*/callStatus => {
1010
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_blake3hasher_clone_hasher(uniffiTypeBlake3HasherObjectFactory.clonePointer(this), callStatus);
1011
+ }, /*liftString:*/FfiConverterString.lift));
1012
+ }
1013
+ finalize() /*throws*/{
1014
+ return FfiConverterArrayBuffer.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBlake3Error.lift.bind(FfiConverterTypeBlake3Error), /*caller:*/callStatus => {
1015
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_blake3hasher_finalize(uniffiTypeBlake3HasherObjectFactory.clonePointer(this), callStatus);
1016
+ }, /*liftString:*/FfiConverterString.lift));
1017
+ }
1018
+ update(data) /*throws*/{
1019
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeBlake3Error.lift.bind(FfiConverterTypeBlake3Error), /*caller:*/callStatus => {
1020
+ nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_blake3hasher_update(uniffiTypeBlake3HasherObjectFactory.clonePointer(this), FfiConverterArrayBuffer.lower(data), callStatus);
1021
+ }, /*liftString:*/FfiConverterString.lift);
1022
+ }
1023
+
1024
+ /**
1025
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1026
+ */
1027
+ uniffiDestroy() {
1028
+ const ptr = this[destructorGuardSymbol];
1029
+ if (ptr !== undefined) {
1030
+ const pointer = uniffiTypeBlake3HasherObjectFactory.pointer(this);
1031
+ uniffiTypeBlake3HasherObjectFactory.freePointer(pointer);
1032
+ uniffiTypeBlake3HasherObjectFactory.unbless(ptr);
1033
+ delete this[destructorGuardSymbol];
1034
+ }
1035
+ }
1036
+ static instanceOf(obj) {
1037
+ return uniffiTypeBlake3HasherObjectFactory.isConcreteType(obj);
1038
+ }
1039
+ }
1040
+ const uniffiTypeBlake3HasherObjectFactory = (() => {
1041
+ return {
1042
+ create(pointer) {
1043
+ const instance = Object.create(Blake3Hasher.prototype);
1044
+ instance[pointerLiteralSymbol] = pointer;
1045
+ instance[destructorGuardSymbol] = this.bless(pointer);
1046
+ instance[uniffiTypeNameSymbol] = 'Blake3Hasher';
1047
+ return instance;
1048
+ },
1049
+ bless(p) {
1050
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_blake3hasher_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
1051
+ },
1052
+ unbless(ptr) {
1053
+ ptr.markDestroyed();
1054
+ },
1055
+ pointer(obj) {
1056
+ if (obj[destructorGuardSymbol] === undefined) {
1057
+ throw new UniffiInternalError.UnexpectedNullPointer();
1058
+ }
1059
+ return obj[pointerLiteralSymbol];
1060
+ },
1061
+ clonePointer(obj) {
1062
+ const pointer = this.pointer(obj);
1063
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_cojson_core_rn_fn_clone_blake3hasher(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
1064
+ },
1065
+ freePointer(pointer) {
1066
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_cojson_core_rn_fn_free_blake3hasher(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
1067
+ },
1068
+ isConcreteType(obj) {
1069
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'Blake3Hasher';
1070
+ }
1071
+ };
1072
+ })();
1073
+ // FfiConverter for Blake3HasherInterface
1074
+ const FfiConverterTypeBlake3Hasher = new FfiConverterObject(uniffiTypeBlake3HasherObjectFactory);
1075
+ export class SessionLog extends UniffiAbstractObject {
1076
+ [uniffiTypeNameSymbol] = 'SessionLog';
1077
+ constructor(coId, sessionId, signerId) {
1078
+ super();
1079
+ const pointer = uniffiCaller.rustCall(/*caller:*/callStatus => {
1080
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_constructor_sessionlog_new(FfiConverterString.lower(coId), FfiConverterString.lower(sessionId), FfiConverterOptionalString.lower(signerId), callStatus);
1081
+ }, /*liftString:*/FfiConverterString.lift);
1082
+ this[pointerLiteralSymbol] = pointer;
1083
+ this[destructorGuardSymbol] = uniffiTypeSessionLogObjectFactory.bless(pointer);
1084
+ }
1085
+ addNewPrivateTransaction(changesJson, signerSecret, encryptionKey, keyId, madeAt, meta) /*throws*/{
1086
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSessionLogError.lift.bind(FfiConverterTypeSessionLogError), /*caller:*/callStatus => {
1087
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_add_new_private_transaction(uniffiTypeSessionLogObjectFactory.clonePointer(this), FfiConverterString.lower(changesJson), FfiConverterString.lower(signerSecret), FfiConverterString.lower(encryptionKey), FfiConverterString.lower(keyId), FfiConverterFloat64.lower(madeAt), FfiConverterOptionalString.lower(meta), callStatus);
1088
+ }, /*liftString:*/FfiConverterString.lift));
1089
+ }
1090
+ addNewTrustingTransaction(changesJson, signerSecret, madeAt, meta) /*throws*/{
1091
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSessionLogError.lift.bind(FfiConverterTypeSessionLogError), /*caller:*/callStatus => {
1092
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_add_new_trusting_transaction(uniffiTypeSessionLogObjectFactory.clonePointer(this), FfiConverterString.lower(changesJson), FfiConverterString.lower(signerSecret), FfiConverterFloat64.lower(madeAt), FfiConverterOptionalString.lower(meta), callStatus);
1093
+ }, /*liftString:*/FfiConverterString.lift));
1094
+ }
1095
+ cloneSessionLog() /*throws*/{
1096
+ return FfiConverterTypeSessionLog.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSessionLogError.lift.bind(FfiConverterTypeSessionLogError), /*caller:*/callStatus => {
1097
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_clone_session_log(uniffiTypeSessionLogObjectFactory.clonePointer(this), callStatus);
1098
+ }, /*liftString:*/FfiConverterString.lift));
1099
+ }
1100
+ decryptNextTransactionChangesJson(txIndex, encryptionKey) /*throws*/{
1101
+ return FfiConverterString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSessionLogError.lift.bind(FfiConverterTypeSessionLogError), /*caller:*/callStatus => {
1102
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_decrypt_next_transaction_changes_json(uniffiTypeSessionLogObjectFactory.clonePointer(this), FfiConverterUInt32.lower(txIndex), FfiConverterString.lower(encryptionKey), callStatus);
1103
+ }, /*liftString:*/FfiConverterString.lift));
1104
+ }
1105
+ decryptNextTransactionMetaJson(txIndex, encryptionKey) /*throws*/{
1106
+ return FfiConverterOptionalString.lift(uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSessionLogError.lift.bind(FfiConverterTypeSessionLogError), /*caller:*/callStatus => {
1107
+ return nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_decrypt_next_transaction_meta_json(uniffiTypeSessionLogObjectFactory.clonePointer(this), FfiConverterUInt32.lower(txIndex), FfiConverterString.lower(encryptionKey), callStatus);
1108
+ }, /*liftString:*/FfiConverterString.lift));
1109
+ }
1110
+ tryAdd(transactionsJson, newSignatureStr, skipVerify) /*throws*/{
1111
+ uniffiCaller.rustCallWithError(/*liftError:*/FfiConverterTypeSessionLogError.lift.bind(FfiConverterTypeSessionLogError), /*caller:*/callStatus => {
1112
+ nativeModule().ubrn_uniffi_cojson_core_rn_fn_method_sessionlog_try_add(uniffiTypeSessionLogObjectFactory.clonePointer(this), FfiConverterArrayString.lower(transactionsJson), FfiConverterString.lower(newSignatureStr), FfiConverterBool.lower(skipVerify), callStatus);
1113
+ }, /*liftString:*/FfiConverterString.lift);
1114
+ }
1115
+
1116
+ /**
1117
+ * {@inheritDoc uniffi-bindgen-react-native#UniffiAbstractObject.uniffiDestroy}
1118
+ */
1119
+ uniffiDestroy() {
1120
+ const ptr = this[destructorGuardSymbol];
1121
+ if (ptr !== undefined) {
1122
+ const pointer = uniffiTypeSessionLogObjectFactory.pointer(this);
1123
+ uniffiTypeSessionLogObjectFactory.freePointer(pointer);
1124
+ uniffiTypeSessionLogObjectFactory.unbless(ptr);
1125
+ delete this[destructorGuardSymbol];
1126
+ }
1127
+ }
1128
+ static instanceOf(obj) {
1129
+ return uniffiTypeSessionLogObjectFactory.isConcreteType(obj);
1130
+ }
1131
+ }
1132
+ const uniffiTypeSessionLogObjectFactory = (() => {
1133
+ return {
1134
+ create(pointer) {
1135
+ const instance = Object.create(SessionLog.prototype);
1136
+ instance[pointerLiteralSymbol] = pointer;
1137
+ instance[destructorGuardSymbol] = this.bless(pointer);
1138
+ instance[uniffiTypeNameSymbol] = 'SessionLog';
1139
+ return instance;
1140
+ },
1141
+ bless(p) {
1142
+ return uniffiCaller.rustCall(/*caller:*/status => nativeModule().ubrn_uniffi_internal_fn_method_sessionlog_ffi__bless_pointer(p, status), /*liftString:*/FfiConverterString.lift);
1143
+ },
1144
+ unbless(ptr) {
1145
+ ptr.markDestroyed();
1146
+ },
1147
+ pointer(obj) {
1148
+ if (obj[destructorGuardSymbol] === undefined) {
1149
+ throw new UniffiInternalError.UnexpectedNullPointer();
1150
+ }
1151
+ return obj[pointerLiteralSymbol];
1152
+ },
1153
+ clonePointer(obj) {
1154
+ const pointer = this.pointer(obj);
1155
+ return uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_cojson_core_rn_fn_clone_sessionlog(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
1156
+ },
1157
+ freePointer(pointer) {
1158
+ uniffiCaller.rustCall(/*caller:*/callStatus => nativeModule().ubrn_uniffi_cojson_core_rn_fn_free_sessionlog(pointer, callStatus), /*liftString:*/FfiConverterString.lift);
1159
+ },
1160
+ isConcreteType(obj) {
1161
+ return obj[destructorGuardSymbol] && obj[uniffiTypeNameSymbol] === 'SessionLog';
1162
+ }
1163
+ };
1164
+ })();
1165
+ // FfiConverter for SessionLogInterface
1166
+ const FfiConverterTypeSessionLog = new FfiConverterObject(uniffiTypeSessionLogObjectFactory);
1167
+
1168
+ // FfiConverter for string | undefined
1169
+ const FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
1170
+
1171
+ // FfiConverter for Array<string>
1172
+ const FfiConverterArrayString = new FfiConverterArray(FfiConverterString);
1173
+
1174
+ /**
1175
+ * This should be called before anything else.
1176
+ *
1177
+ * It is likely that this is being done for you by the library's `index.ts`.
1178
+ *
1179
+ * It checks versions of uniffi between when the Rust scaffolding was generated
1180
+ * and when the bindings were generated.
1181
+ *
1182
+ * It also initializes the machinery to enable Rust to talk back to Javascript.
1183
+ */
1184
+ function uniffiEnsureInitialized() {
1185
+ // Get the bindings contract version from our ComponentInterface
1186
+ const bindingsContractVersion = 29;
1187
+ // Get the scaffolding contract version by calling the into the dylib
1188
+ const scaffoldingContractVersion = nativeModule().ubrn_ffi_cojson_core_rn_uniffi_contract_version();
1189
+ if (bindingsContractVersion !== scaffoldingContractVersion) {
1190
+ throw new UniffiInternalError.ContractVersionMismatch(scaffoldingContractVersion, bindingsContractVersion);
1191
+ }
1192
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_blake3_hash_once() !== 58834) {
1193
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_blake3_hash_once');
1194
+ }
1195
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_blake3_hash_once_with_context() !== 28201) {
1196
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_blake3_hash_once_with_context');
1197
+ }
1198
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_decrypt() !== 5223) {
1199
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_decrypt');
1200
+ }
1201
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_decrypt_xsalsa20() !== 29059) {
1202
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_decrypt_xsalsa20');
1203
+ }
1204
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_sign() !== 5643) {
1205
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_ed25519_sign');
1206
+ }
1207
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_signature_from_bytes() !== 4624) {
1208
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_ed25519_signature_from_bytes');
1209
+ }
1210
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_from_bytes() !== 37961) {
1211
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_from_bytes');
1212
+ }
1213
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_sign() !== 50296) {
1214
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_sign');
1215
+ }
1216
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_to_public() !== 17719) {
1217
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_to_public');
1218
+ }
1219
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_verify() !== 49484) {
1220
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_ed25519_verify');
1221
+ }
1222
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key() !== 63215) {
1223
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key');
1224
+ }
1225
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key_from_bytes() !== 42802) {
1226
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key_from_bytes');
1227
+ }
1228
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_encrypt() !== 552) {
1229
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_encrypt');
1230
+ }
1231
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_encrypt_xsalsa20() !== 29297) {
1232
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_encrypt_xsalsa20');
1233
+ }
1234
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_generate_nonce() !== 55335) {
1235
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_generate_nonce');
1236
+ }
1237
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_get_sealer_id() !== 35163) {
1238
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_get_sealer_id');
1239
+ }
1240
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_get_signer_id() !== 4067) {
1241
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_get_signer_id');
1242
+ }
1243
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_new_ed25519_signing_key() !== 3282) {
1244
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_new_ed25519_signing_key');
1245
+ }
1246
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_new_x25519_private_key() !== 56777) {
1247
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_new_x25519_private_key');
1248
+ }
1249
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_seal() !== 48965) {
1250
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_seal');
1251
+ }
1252
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_sign() !== 12539) {
1253
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_sign');
1254
+ }
1255
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_unseal() !== 52356) {
1256
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_unseal');
1257
+ }
1258
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_verify() !== 59548) {
1259
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_verify');
1260
+ }
1261
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_x25519_diffie_hellman() !== 23336) {
1262
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_x25519_diffie_hellman');
1263
+ }
1264
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_func_x25519_public_key() !== 18915) {
1265
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_func_x25519_public_key');
1266
+ }
1267
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_blake3hasher_clone_hasher() !== 23778) {
1268
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_blake3hasher_clone_hasher');
1269
+ }
1270
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_blake3hasher_finalize() !== 64111) {
1271
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_blake3hasher_finalize');
1272
+ }
1273
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_blake3hasher_update() !== 27902) {
1274
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_blake3hasher_update');
1275
+ }
1276
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_private_transaction() !== 3753) {
1277
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_private_transaction');
1278
+ }
1279
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_trusting_transaction() !== 43511) {
1280
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_trusting_transaction');
1281
+ }
1282
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_clone_session_log() !== 8261) {
1283
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_sessionlog_clone_session_log');
1284
+ }
1285
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_changes_json() !== 22072) {
1286
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_changes_json');
1287
+ }
1288
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_meta_json() !== 5632) {
1289
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_meta_json');
1290
+ }
1291
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_method_sessionlog_try_add() !== 21226) {
1292
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_method_sessionlog_try_add');
1293
+ }
1294
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_constructor_blake3hasher_new() !== 24312) {
1295
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_constructor_blake3hasher_new');
1296
+ }
1297
+ if (nativeModule().ubrn_uniffi_cojson_core_rn_checksum_constructor_sessionlog_new() !== 25716) {
1298
+ throw new UniffiInternalError.ApiChecksumMismatch('uniffi_cojson_core_rn_checksum_constructor_sessionlog_new');
1299
+ }
1300
+ }
1301
+ export default Object.freeze({
1302
+ initialize: uniffiEnsureInitialized,
1303
+ converters: {
1304
+ FfiConverterTypeBlake3Error,
1305
+ FfiConverterTypeBlake3Hasher,
1306
+ FfiConverterTypeCryptoErrorUniffi,
1307
+ FfiConverterTypeSessionLog,
1308
+ FfiConverterTypeSessionLogError
1309
+ }
1310
+ });
1311
+ //# sourceMappingURL=cojson_core_rn.js.map