@synonymdev/react-native-pubky 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +17 -13
- package/android/src/main/java/com/pubky/PubkyModule.kt +1 -1
- package/android/src/main/java/uniffi/{pubkymobile/pubkymobile.kt → pubkycore/pubkycore.kt} +185 -150
- package/android/src/main/jniLibs/arm64-v8a/{libpubkymobile.so → libpubkycore.so} +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libpubkycore.so +0 -0
- package/android/src/main/jniLibs/x86/{libpubkymobile.so → libpubkycore.so} +0 -0
- package/android/src/main/jniLibs/x86_64/{libpubkymobile.so → libpubkycore.so} +0 -0
- package/ios/Frameworks/{PubkyMobile.xcframework → PubkyCore.xcframework}/Info.plist +8 -8
- package/ios/Frameworks/{PubkyMobile.xcframework → PubkyCore.xcframework}/ios-arm64/Headers/module.modulemap +2 -2
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64/Headers/pubkycoreFFI.h +297 -0
- package/ios/Frameworks/{PubkyMobile.xcframework/ios-arm64/libpubkymobile.a → PubkyCore.xcframework/ios-arm64/libpubkycore.a} +0 -0
- package/ios/Frameworks/{PubkyMobile.xcframework → PubkyCore.xcframework}/ios-arm64-simulator/Headers/module.modulemap +2 -2
- package/ios/Frameworks/PubkyCore.xcframework/ios-arm64-simulator/Headers/pubkycoreFFI.h +297 -0
- package/ios/Frameworks/{PubkyMobile.xcframework/ios-arm64-simulator/libpubkymobile.a → PubkyCore.xcframework/ios-arm64-simulator/libpubkycore.a} +0 -0
- package/ios/{pubkymobile.swift → pubkycore.swift} +81 -48
- package/lib/typescript/commonjs/src/index.d.ts +9 -10
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +9 -10
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +12 -7
- package/react-native-pubky.podspec +1 -1
- package/src/index.tsx +9 -9
- package/android/src/main/jniLibs/armeabi-v7a/libpubkymobile.so +0 -0
- package/ios/Frameworks/PubkyMobile.xcframework/ios-arm64/Headers/mobileFFI.h +0 -188
- package/ios/Frameworks/PubkyMobile.xcframework/ios-arm64/Headers/pubkymobileFFI.h +0 -292
- package/ios/Frameworks/PubkyMobile.xcframework/ios-arm64/libmobile.a +0 -0
- package/ios/Frameworks/PubkyMobile.xcframework/ios-arm64-simulator/Headers/mobileFFI.h +0 -188
- package/ios/Frameworks/PubkyMobile.xcframework/ios-arm64-simulator/Headers/pubkymobileFFI.h +0 -292
- package/ios/Frameworks/PubkyMobile.xcframework/ios-arm64-simulator/libmobile.a +0 -0
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
@file:Suppress("NAME_SHADOWING")
|
5
5
|
|
6
|
-
package uniffi.
|
6
|
+
package uniffi.pubkycore;
|
7
7
|
|
8
8
|
// Common helper code.
|
9
9
|
//
|
@@ -49,7 +49,7 @@ open class RustBuffer : Structure() {
|
|
49
49
|
|
50
50
|
companion object {
|
51
51
|
internal fun alloc(size: Int = 0) = rustCall() { status ->
|
52
|
-
_UniFFILib.INSTANCE.
|
52
|
+
_UniFFILib.INSTANCE.ffi_pubkycore_rustbuffer_alloc(size, status)
|
53
53
|
}.also {
|
54
54
|
if(it.data == null) {
|
55
55
|
throw RuntimeException("RustBuffer.alloc() returned null data pointer (size=${size})")
|
@@ -65,7 +65,7 @@ open class RustBuffer : Structure() {
|
|
65
65
|
}
|
66
66
|
|
67
67
|
internal fun free(buf: RustBuffer.ByValue) = rustCall() { status ->
|
68
|
-
_UniFFILib.INSTANCE.
|
68
|
+
_UniFFILib.INSTANCE.ffi_pubkycore_rustbuffer_free(buf, status)
|
69
69
|
}
|
70
70
|
}
|
71
71
|
|
@@ -362,7 +362,7 @@ private fun findLibraryName(componentName: String): String {
|
|
362
362
|
if (libOverride != null) {
|
363
363
|
return libOverride
|
364
364
|
}
|
365
|
-
return "
|
365
|
+
return "pubkycore"
|
366
366
|
}
|
367
367
|
|
368
368
|
private inline fun <reified Lib : Library> loadIndirect(
|
@@ -377,7 +377,7 @@ private inline fun <reified Lib : Library> loadIndirect(
|
|
377
377
|
internal interface _UniFFILib : Library {
|
378
378
|
companion object {
|
379
379
|
internal val INSTANCE: _UniFFILib by lazy {
|
380
|
-
loadIndirect<_UniFFILib>(componentName = "
|
380
|
+
loadIndirect<_UniFFILib>(componentName = "pubkycore")
|
381
381
|
.also { lib: _UniFFILib ->
|
382
382
|
uniffiCheckContractApiVersion(lib)
|
383
383
|
uniffiCheckApiChecksums(lib)
|
@@ -386,207 +386,211 @@ internal interface _UniFFILib : Library {
|
|
386
386
|
}
|
387
387
|
}
|
388
388
|
|
389
|
-
fun
|
389
|
+
fun uniffi_pubkycore_fn_free_eventnotifier(`ptr`: Pointer,_uniffi_out_err: RustCallStatus,
|
390
390
|
): Unit
|
391
|
-
fun
|
391
|
+
fun uniffi_pubkycore_fn_init_callback_eventlistener(`callbackStub`: ForeignCallback,_uniffi_out_err: RustCallStatus,
|
392
392
|
): Unit
|
393
|
-
fun
|
393
|
+
fun uniffi_pubkycore_fn_func_auth(`url`: RustBuffer.ByValue,`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
394
394
|
): RustBuffer.ByValue
|
395
|
-
fun
|
395
|
+
fun uniffi_pubkycore_fn_func_create_recovery_file(`secretKey`: RustBuffer.ByValue,`passphrase`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
396
396
|
): RustBuffer.ByValue
|
397
|
-
fun
|
397
|
+
fun uniffi_pubkycore_fn_func_decrypt_recovery_file(`recoveryFile`: RustBuffer.ByValue,`passphrase`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
398
398
|
): RustBuffer.ByValue
|
399
|
-
fun
|
399
|
+
fun uniffi_pubkycore_fn_func_delete_file(`url`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
400
400
|
): RustBuffer.ByValue
|
401
|
-
fun
|
401
|
+
fun uniffi_pubkycore_fn_func_generate_secret_key(_uniffi_out_err: RustCallStatus,
|
402
402
|
): RustBuffer.ByValue
|
403
|
-
fun
|
403
|
+
fun uniffi_pubkycore_fn_func_get(`url`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
404
404
|
): RustBuffer.ByValue
|
405
|
-
fun
|
405
|
+
fun uniffi_pubkycore_fn_func_get_public_key_from_secret_key(`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
406
406
|
): RustBuffer.ByValue
|
407
|
-
fun
|
407
|
+
fun uniffi_pubkycore_fn_func_list(`url`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
408
408
|
): RustBuffer.ByValue
|
409
|
-
fun
|
409
|
+
fun uniffi_pubkycore_fn_func_parse_auth_url(`url`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
410
410
|
): RustBuffer.ByValue
|
411
|
-
fun
|
411
|
+
fun uniffi_pubkycore_fn_func_publish(`recordName`: RustBuffer.ByValue,`recordContent`: RustBuffer.ByValue,`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
412
412
|
): RustBuffer.ByValue
|
413
|
-
fun
|
413
|
+
fun uniffi_pubkycore_fn_func_publish_https(`recordName`: RustBuffer.ByValue,`target`: RustBuffer.ByValue,`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
414
414
|
): RustBuffer.ByValue
|
415
|
-
fun
|
415
|
+
fun uniffi_pubkycore_fn_func_put(`url`: RustBuffer.ByValue,`content`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
416
416
|
): RustBuffer.ByValue
|
417
|
-
fun
|
417
|
+
fun uniffi_pubkycore_fn_func_remove_event_listener(_uniffi_out_err: RustCallStatus,
|
418
418
|
): Unit
|
419
|
-
fun
|
419
|
+
fun uniffi_pubkycore_fn_func_resolve(`publicKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
420
420
|
): RustBuffer.ByValue
|
421
|
-
fun
|
421
|
+
fun uniffi_pubkycore_fn_func_resolve_https(`publicKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
422
422
|
): RustBuffer.ByValue
|
423
|
-
fun
|
423
|
+
fun uniffi_pubkycore_fn_func_session(`pubky`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
424
424
|
): RustBuffer.ByValue
|
425
|
-
fun
|
425
|
+
fun uniffi_pubkycore_fn_func_set_event_listener(`listener`: Long,_uniffi_out_err: RustCallStatus,
|
426
426
|
): Unit
|
427
|
-
fun
|
427
|
+
fun uniffi_pubkycore_fn_func_sign_in(`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
428
428
|
): RustBuffer.ByValue
|
429
|
-
fun
|
429
|
+
fun uniffi_pubkycore_fn_func_sign_out(`secretKey`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
430
430
|
): RustBuffer.ByValue
|
431
|
-
fun
|
431
|
+
fun uniffi_pubkycore_fn_func_sign_up(`secretKey`: RustBuffer.ByValue,`homeserver`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
432
432
|
): RustBuffer.ByValue
|
433
|
-
fun
|
433
|
+
fun uniffi_pubkycore_fn_func_switch_network(`useTestnet`: Byte,_uniffi_out_err: RustCallStatus,
|
434
434
|
): RustBuffer.ByValue
|
435
|
-
fun
|
435
|
+
fun ffi_pubkycore_rustbuffer_alloc(`size`: Int,_uniffi_out_err: RustCallStatus,
|
436
436
|
): RustBuffer.ByValue
|
437
|
-
fun
|
437
|
+
fun ffi_pubkycore_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,_uniffi_out_err: RustCallStatus,
|
438
|
+
): RustBuffer.ByValue
|
439
|
+
fun ffi_pubkycore_rustbuffer_free(`buf`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
|
438
440
|
): Unit
|
439
|
-
fun
|
441
|
+
fun ffi_pubkycore_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Int,_uniffi_out_err: RustCallStatus,
|
440
442
|
): RustBuffer.ByValue
|
441
|
-
fun
|
443
|
+
fun ffi_pubkycore_rust_future_continuation_callback_set(`callback`: UniFffiRustFutureContinuationCallbackType,
|
442
444
|
): Unit
|
443
|
-
fun
|
445
|
+
fun ffi_pubkycore_rust_future_poll_u8(`handle`: Pointer,`uniffiCallback`: USize,
|
444
446
|
): Unit
|
445
|
-
fun
|
447
|
+
fun ffi_pubkycore_rust_future_cancel_u8(`handle`: Pointer,
|
446
448
|
): Unit
|
447
|
-
fun
|
449
|
+
fun ffi_pubkycore_rust_future_free_u8(`handle`: Pointer,
|
448
450
|
): Unit
|
449
|
-
fun
|
451
|
+
fun ffi_pubkycore_rust_future_complete_u8(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
450
452
|
): Byte
|
451
|
-
fun
|
453
|
+
fun ffi_pubkycore_rust_future_poll_i8(`handle`: Pointer,`uniffiCallback`: USize,
|
452
454
|
): Unit
|
453
|
-
fun
|
455
|
+
fun ffi_pubkycore_rust_future_cancel_i8(`handle`: Pointer,
|
454
456
|
): Unit
|
455
|
-
fun
|
457
|
+
fun ffi_pubkycore_rust_future_free_i8(`handle`: Pointer,
|
456
458
|
): Unit
|
457
|
-
fun
|
459
|
+
fun ffi_pubkycore_rust_future_complete_i8(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
458
460
|
): Byte
|
459
|
-
fun
|
461
|
+
fun ffi_pubkycore_rust_future_poll_u16(`handle`: Pointer,`uniffiCallback`: USize,
|
460
462
|
): Unit
|
461
|
-
fun
|
463
|
+
fun ffi_pubkycore_rust_future_cancel_u16(`handle`: Pointer,
|
462
464
|
): Unit
|
463
|
-
fun
|
465
|
+
fun ffi_pubkycore_rust_future_free_u16(`handle`: Pointer,
|
464
466
|
): Unit
|
465
|
-
fun
|
467
|
+
fun ffi_pubkycore_rust_future_complete_u16(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
466
468
|
): Short
|
467
|
-
fun
|
469
|
+
fun ffi_pubkycore_rust_future_poll_i16(`handle`: Pointer,`uniffiCallback`: USize,
|
468
470
|
): Unit
|
469
|
-
fun
|
471
|
+
fun ffi_pubkycore_rust_future_cancel_i16(`handle`: Pointer,
|
470
472
|
): Unit
|
471
|
-
fun
|
473
|
+
fun ffi_pubkycore_rust_future_free_i16(`handle`: Pointer,
|
472
474
|
): Unit
|
473
|
-
fun
|
475
|
+
fun ffi_pubkycore_rust_future_complete_i16(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
474
476
|
): Short
|
475
|
-
fun
|
477
|
+
fun ffi_pubkycore_rust_future_poll_u32(`handle`: Pointer,`uniffiCallback`: USize,
|
476
478
|
): Unit
|
477
|
-
fun
|
479
|
+
fun ffi_pubkycore_rust_future_cancel_u32(`handle`: Pointer,
|
478
480
|
): Unit
|
479
|
-
fun
|
481
|
+
fun ffi_pubkycore_rust_future_free_u32(`handle`: Pointer,
|
480
482
|
): Unit
|
481
|
-
fun
|
483
|
+
fun ffi_pubkycore_rust_future_complete_u32(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
482
484
|
): Int
|
483
|
-
fun
|
485
|
+
fun ffi_pubkycore_rust_future_poll_i32(`handle`: Pointer,`uniffiCallback`: USize,
|
484
486
|
): Unit
|
485
|
-
fun
|
487
|
+
fun ffi_pubkycore_rust_future_cancel_i32(`handle`: Pointer,
|
486
488
|
): Unit
|
487
|
-
fun
|
489
|
+
fun ffi_pubkycore_rust_future_free_i32(`handle`: Pointer,
|
488
490
|
): Unit
|
489
|
-
fun
|
491
|
+
fun ffi_pubkycore_rust_future_complete_i32(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
490
492
|
): Int
|
491
|
-
fun
|
493
|
+
fun ffi_pubkycore_rust_future_poll_u64(`handle`: Pointer,`uniffiCallback`: USize,
|
492
494
|
): Unit
|
493
|
-
fun
|
495
|
+
fun ffi_pubkycore_rust_future_cancel_u64(`handle`: Pointer,
|
494
496
|
): Unit
|
495
|
-
fun
|
497
|
+
fun ffi_pubkycore_rust_future_free_u64(`handle`: Pointer,
|
496
498
|
): Unit
|
497
|
-
fun
|
499
|
+
fun ffi_pubkycore_rust_future_complete_u64(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
498
500
|
): Long
|
499
|
-
fun
|
501
|
+
fun ffi_pubkycore_rust_future_poll_i64(`handle`: Pointer,`uniffiCallback`: USize,
|
500
502
|
): Unit
|
501
|
-
fun
|
503
|
+
fun ffi_pubkycore_rust_future_cancel_i64(`handle`: Pointer,
|
502
504
|
): Unit
|
503
|
-
fun
|
505
|
+
fun ffi_pubkycore_rust_future_free_i64(`handle`: Pointer,
|
504
506
|
): Unit
|
505
|
-
fun
|
507
|
+
fun ffi_pubkycore_rust_future_complete_i64(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
506
508
|
): Long
|
507
|
-
fun
|
509
|
+
fun ffi_pubkycore_rust_future_poll_f32(`handle`: Pointer,`uniffiCallback`: USize,
|
508
510
|
): Unit
|
509
|
-
fun
|
511
|
+
fun ffi_pubkycore_rust_future_cancel_f32(`handle`: Pointer,
|
510
512
|
): Unit
|
511
|
-
fun
|
513
|
+
fun ffi_pubkycore_rust_future_free_f32(`handle`: Pointer,
|
512
514
|
): Unit
|
513
|
-
fun
|
515
|
+
fun ffi_pubkycore_rust_future_complete_f32(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
514
516
|
): Float
|
515
|
-
fun
|
517
|
+
fun ffi_pubkycore_rust_future_poll_f64(`handle`: Pointer,`uniffiCallback`: USize,
|
516
518
|
): Unit
|
517
|
-
fun
|
519
|
+
fun ffi_pubkycore_rust_future_cancel_f64(`handle`: Pointer,
|
518
520
|
): Unit
|
519
|
-
fun
|
521
|
+
fun ffi_pubkycore_rust_future_free_f64(`handle`: Pointer,
|
520
522
|
): Unit
|
521
|
-
fun
|
523
|
+
fun ffi_pubkycore_rust_future_complete_f64(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
522
524
|
): Double
|
523
|
-
fun
|
525
|
+
fun ffi_pubkycore_rust_future_poll_pointer(`handle`: Pointer,`uniffiCallback`: USize,
|
524
526
|
): Unit
|
525
|
-
fun
|
527
|
+
fun ffi_pubkycore_rust_future_cancel_pointer(`handle`: Pointer,
|
526
528
|
): Unit
|
527
|
-
fun
|
529
|
+
fun ffi_pubkycore_rust_future_free_pointer(`handle`: Pointer,
|
528
530
|
): Unit
|
529
|
-
fun
|
531
|
+
fun ffi_pubkycore_rust_future_complete_pointer(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
530
532
|
): Pointer
|
531
|
-
fun
|
533
|
+
fun ffi_pubkycore_rust_future_poll_rust_buffer(`handle`: Pointer,`uniffiCallback`: USize,
|
532
534
|
): Unit
|
533
|
-
fun
|
535
|
+
fun ffi_pubkycore_rust_future_cancel_rust_buffer(`handle`: Pointer,
|
534
536
|
): Unit
|
535
|
-
fun
|
537
|
+
fun ffi_pubkycore_rust_future_free_rust_buffer(`handle`: Pointer,
|
536
538
|
): Unit
|
537
|
-
fun
|
539
|
+
fun ffi_pubkycore_rust_future_complete_rust_buffer(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
538
540
|
): RustBuffer.ByValue
|
539
|
-
fun
|
541
|
+
fun ffi_pubkycore_rust_future_poll_void(`handle`: Pointer,`uniffiCallback`: USize,
|
540
542
|
): Unit
|
541
|
-
fun
|
543
|
+
fun ffi_pubkycore_rust_future_cancel_void(`handle`: Pointer,
|
542
544
|
): Unit
|
543
|
-
fun
|
545
|
+
fun ffi_pubkycore_rust_future_free_void(`handle`: Pointer,
|
544
546
|
): Unit
|
545
|
-
fun
|
547
|
+
fun ffi_pubkycore_rust_future_complete_void(`handle`: Pointer,_uniffi_out_err: RustCallStatus,
|
546
548
|
): Unit
|
547
|
-
fun
|
549
|
+
fun uniffi_pubkycore_checksum_func_auth(
|
550
|
+
): Short
|
551
|
+
fun uniffi_pubkycore_checksum_func_create_recovery_file(
|
548
552
|
): Short
|
549
|
-
fun
|
553
|
+
fun uniffi_pubkycore_checksum_func_decrypt_recovery_file(
|
550
554
|
): Short
|
551
|
-
fun
|
555
|
+
fun uniffi_pubkycore_checksum_func_delete_file(
|
552
556
|
): Short
|
553
|
-
fun
|
557
|
+
fun uniffi_pubkycore_checksum_func_generate_secret_key(
|
554
558
|
): Short
|
555
|
-
fun
|
559
|
+
fun uniffi_pubkycore_checksum_func_get(
|
556
560
|
): Short
|
557
|
-
fun
|
561
|
+
fun uniffi_pubkycore_checksum_func_get_public_key_from_secret_key(
|
558
562
|
): Short
|
559
|
-
fun
|
563
|
+
fun uniffi_pubkycore_checksum_func_list(
|
560
564
|
): Short
|
561
|
-
fun
|
565
|
+
fun uniffi_pubkycore_checksum_func_parse_auth_url(
|
562
566
|
): Short
|
563
|
-
fun
|
567
|
+
fun uniffi_pubkycore_checksum_func_publish(
|
564
568
|
): Short
|
565
|
-
fun
|
569
|
+
fun uniffi_pubkycore_checksum_func_publish_https(
|
566
570
|
): Short
|
567
|
-
fun
|
571
|
+
fun uniffi_pubkycore_checksum_func_put(
|
568
572
|
): Short
|
569
|
-
fun
|
573
|
+
fun uniffi_pubkycore_checksum_func_remove_event_listener(
|
570
574
|
): Short
|
571
|
-
fun
|
575
|
+
fun uniffi_pubkycore_checksum_func_resolve(
|
572
576
|
): Short
|
573
|
-
fun
|
577
|
+
fun uniffi_pubkycore_checksum_func_resolve_https(
|
574
578
|
): Short
|
575
|
-
fun
|
579
|
+
fun uniffi_pubkycore_checksum_func_session(
|
576
580
|
): Short
|
577
|
-
fun
|
581
|
+
fun uniffi_pubkycore_checksum_func_set_event_listener(
|
578
582
|
): Short
|
579
|
-
fun
|
583
|
+
fun uniffi_pubkycore_checksum_func_sign_in(
|
580
584
|
): Short
|
581
|
-
fun
|
585
|
+
fun uniffi_pubkycore_checksum_func_sign_out(
|
582
586
|
): Short
|
583
|
-
fun
|
587
|
+
fun uniffi_pubkycore_checksum_func_sign_up(
|
584
588
|
): Short
|
585
|
-
fun
|
589
|
+
fun uniffi_pubkycore_checksum_func_switch_network(
|
586
590
|
): Short
|
587
|
-
fun
|
591
|
+
fun uniffi_pubkycore_checksum_method_eventlistener_on_event_occurred(
|
588
592
|
): Short
|
589
|
-
fun
|
593
|
+
fun ffi_pubkycore_uniffi_contract_version(
|
590
594
|
): Int
|
591
595
|
|
592
596
|
}
|
@@ -595,7 +599,7 @@ private fun uniffiCheckContractApiVersion(lib: _UniFFILib) {
|
|
595
599
|
// Get the bindings contract version from our ComponentInterface
|
596
600
|
val bindings_contract_version = 24
|
597
601
|
// Get the scaffolding contract version by calling the into the dylib
|
598
|
-
val scaffolding_contract_version = lib.
|
602
|
+
val scaffolding_contract_version = lib.ffi_pubkycore_uniffi_contract_version()
|
599
603
|
if (bindings_contract_version != scaffolding_contract_version) {
|
600
604
|
throw RuntimeException("UniFFI contract version mismatch: try cleaning and rebuilding your project")
|
601
605
|
}
|
@@ -603,67 +607,70 @@ private fun uniffiCheckContractApiVersion(lib: _UniFFILib) {
|
|
603
607
|
|
604
608
|
@Suppress("UNUSED_PARAMETER")
|
605
609
|
private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
|
606
|
-
if (lib.
|
610
|
+
if (lib.uniffi_pubkycore_checksum_func_auth() != 51826.toShort()) {
|
607
611
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
608
612
|
}
|
609
|
-
if (lib.
|
613
|
+
if (lib.uniffi_pubkycore_checksum_func_create_recovery_file() != 48846.toShort()) {
|
610
614
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
611
615
|
}
|
612
|
-
if (lib.
|
616
|
+
if (lib.uniffi_pubkycore_checksum_func_decrypt_recovery_file() != 26407.toShort()) {
|
613
617
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
614
618
|
}
|
615
|
-
if (lib.
|
619
|
+
if (lib.uniffi_pubkycore_checksum_func_delete_file() != 9063.toShort()) {
|
616
620
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
617
621
|
}
|
618
|
-
if (lib.
|
622
|
+
if (lib.uniffi_pubkycore_checksum_func_generate_secret_key() != 12800.toShort()) {
|
619
623
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
620
624
|
}
|
621
|
-
if (lib.
|
625
|
+
if (lib.uniffi_pubkycore_checksum_func_get() != 6591.toShort()) {
|
622
626
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
623
627
|
}
|
624
|
-
if (lib.
|
628
|
+
if (lib.uniffi_pubkycore_checksum_func_get_public_key_from_secret_key() != 40316.toShort()) {
|
625
629
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
626
630
|
}
|
627
|
-
if (lib.
|
631
|
+
if (lib.uniffi_pubkycore_checksum_func_list() != 43198.toShort()) {
|
628
632
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
629
633
|
}
|
630
|
-
if (lib.
|
634
|
+
if (lib.uniffi_pubkycore_checksum_func_parse_auth_url() != 27379.toShort()) {
|
631
635
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
632
636
|
}
|
633
|
-
if (lib.
|
637
|
+
if (lib.uniffi_pubkycore_checksum_func_publish() != 48989.toShort()) {
|
634
638
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
635
639
|
}
|
636
|
-
if (lib.
|
640
|
+
if (lib.uniffi_pubkycore_checksum_func_publish_https() != 5614.toShort()) {
|
637
641
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
638
642
|
}
|
639
|
-
if (lib.
|
643
|
+
if (lib.uniffi_pubkycore_checksum_func_put() != 48150.toShort()) {
|
640
644
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
641
645
|
}
|
642
|
-
if (lib.
|
646
|
+
if (lib.uniffi_pubkycore_checksum_func_remove_event_listener() != 23534.toShort()) {
|
643
647
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
644
648
|
}
|
645
|
-
if (lib.
|
649
|
+
if (lib.uniffi_pubkycore_checksum_func_resolve() != 34317.toShort()) {
|
646
650
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
647
651
|
}
|
648
|
-
if (lib.
|
652
|
+
if (lib.uniffi_pubkycore_checksum_func_resolve_https() != 17266.toShort()) {
|
649
653
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
650
654
|
}
|
651
|
-
if (lib.
|
655
|
+
if (lib.uniffi_pubkycore_checksum_func_session() != 59795.toShort()) {
|
652
656
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
653
657
|
}
|
654
|
-
if (lib.
|
658
|
+
if (lib.uniffi_pubkycore_checksum_func_set_event_listener() != 60071.toShort()) {
|
655
659
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
656
660
|
}
|
657
|
-
if (lib.
|
661
|
+
if (lib.uniffi_pubkycore_checksum_func_sign_in() != 21584.toShort()) {
|
658
662
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
659
663
|
}
|
660
|
-
if (lib.
|
664
|
+
if (lib.uniffi_pubkycore_checksum_func_sign_out() != 34903.toShort()) {
|
661
665
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
662
666
|
}
|
663
|
-
if (lib.
|
667
|
+
if (lib.uniffi_pubkycore_checksum_func_sign_up() != 37999.toShort()) {
|
664
668
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
665
669
|
}
|
666
|
-
if (lib.
|
670
|
+
if (lib.uniffi_pubkycore_checksum_func_switch_network() != 64215.toShort()) {
|
671
|
+
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
672
|
+
}
|
673
|
+
if (lib.uniffi_pubkycore_checksum_method_eventlistener_on_event_occurred() != 11531.toShort()) {
|
667
674
|
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
668
675
|
}
|
669
676
|
}
|
@@ -673,6 +680,26 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
|
|
673
680
|
// Public interface members begin here.
|
674
681
|
|
675
682
|
|
683
|
+
public object FfiConverterBoolean: FfiConverter<Boolean, Byte> {
|
684
|
+
override fun lift(value: Byte): Boolean {
|
685
|
+
return value.toInt() != 0
|
686
|
+
}
|
687
|
+
|
688
|
+
override fun read(buf: ByteBuffer): Boolean {
|
689
|
+
return lift(buf.get())
|
690
|
+
}
|
691
|
+
|
692
|
+
override fun lower(value: Boolean): Byte {
|
693
|
+
return if (value) 1.toByte() else 0.toByte()
|
694
|
+
}
|
695
|
+
|
696
|
+
override fun allocationSize(value: Boolean) = 1
|
697
|
+
|
698
|
+
override fun write(value: Boolean, buf: ByteBuffer) {
|
699
|
+
buf.put(lower(value))
|
700
|
+
}
|
701
|
+
}
|
702
|
+
|
676
703
|
public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
|
677
704
|
// Note: we don't inherit from FfiConverterRustBuffer, because we use a
|
678
705
|
// special encoding when lowering/lifting. We can use `RustBuffer.len` to
|
@@ -909,7 +936,7 @@ class EventNotifier(
|
|
909
936
|
*/
|
910
937
|
override protected fun freeRustArcPtr() {
|
911
938
|
rustCall() { status ->
|
912
|
-
_UniFFILib.INSTANCE.
|
939
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_free_eventnotifier(this.pointer, status)
|
913
940
|
}
|
914
941
|
}
|
915
942
|
|
@@ -1100,7 +1127,7 @@ public object FfiConverterTypeEventListener: FfiConverterCallbackInterface<Event
|
|
1100
1127
|
) {
|
1101
1128
|
override fun register(lib: _UniFFILib) {
|
1102
1129
|
rustCall() { status ->
|
1103
|
-
lib.
|
1130
|
+
lib.uniffi_pubkycore_fn_init_callback_eventlistener(this.foreignCallback, status)
|
1104
1131
|
}
|
1105
1132
|
}
|
1106
1133
|
}
|
@@ -1133,7 +1160,7 @@ public object FfiConverterSequenceString: FfiConverterRustBuffer<List<String>> {
|
|
1133
1160
|
fun `auth`(`url`: String, `secretKey`: String): List<String> {
|
1134
1161
|
return FfiConverterSequenceString.lift(
|
1135
1162
|
rustCall() { _status ->
|
1136
|
-
_UniFFILib.INSTANCE.
|
1163
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_auth(FfiConverterString.lower(`url`),FfiConverterString.lower(`secretKey`),_status)
|
1137
1164
|
})
|
1138
1165
|
}
|
1139
1166
|
|
@@ -1141,7 +1168,7 @@ fun `auth`(`url`: String, `secretKey`: String): List<String> {
|
|
1141
1168
|
fun `createRecoveryFile`(`secretKey`: String, `passphrase`: String): List<String> {
|
1142
1169
|
return FfiConverterSequenceString.lift(
|
1143
1170
|
rustCall() { _status ->
|
1144
|
-
_UniFFILib.INSTANCE.
|
1171
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_create_recovery_file(FfiConverterString.lower(`secretKey`),FfiConverterString.lower(`passphrase`),_status)
|
1145
1172
|
})
|
1146
1173
|
}
|
1147
1174
|
|
@@ -1149,7 +1176,7 @@ fun `createRecoveryFile`(`secretKey`: String, `passphrase`: String): List<String
|
|
1149
1176
|
fun `decryptRecoveryFile`(`recoveryFile`: String, `passphrase`: String): List<String> {
|
1150
1177
|
return FfiConverterSequenceString.lift(
|
1151
1178
|
rustCall() { _status ->
|
1152
|
-
_UniFFILib.INSTANCE.
|
1179
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_decrypt_recovery_file(FfiConverterString.lower(`recoveryFile`),FfiConverterString.lower(`passphrase`),_status)
|
1153
1180
|
})
|
1154
1181
|
}
|
1155
1182
|
|
@@ -1157,7 +1184,7 @@ fun `decryptRecoveryFile`(`recoveryFile`: String, `passphrase`: String): List<St
|
|
1157
1184
|
fun `deleteFile`(`url`: String): List<String> {
|
1158
1185
|
return FfiConverterSequenceString.lift(
|
1159
1186
|
rustCall() { _status ->
|
1160
|
-
_UniFFILib.INSTANCE.
|
1187
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_delete_file(FfiConverterString.lower(`url`),_status)
|
1161
1188
|
})
|
1162
1189
|
}
|
1163
1190
|
|
@@ -1165,7 +1192,7 @@ fun `deleteFile`(`url`: String): List<String> {
|
|
1165
1192
|
fun `generateSecretKey`(): List<String> {
|
1166
1193
|
return FfiConverterSequenceString.lift(
|
1167
1194
|
rustCall() { _status ->
|
1168
|
-
_UniFFILib.INSTANCE.
|
1195
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_generate_secret_key(_status)
|
1169
1196
|
})
|
1170
1197
|
}
|
1171
1198
|
|
@@ -1173,7 +1200,7 @@ fun `generateSecretKey`(): List<String> {
|
|
1173
1200
|
fun `get`(`url`: String): List<String> {
|
1174
1201
|
return FfiConverterSequenceString.lift(
|
1175
1202
|
rustCall() { _status ->
|
1176
|
-
_UniFFILib.INSTANCE.
|
1203
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_get(FfiConverterString.lower(`url`),_status)
|
1177
1204
|
})
|
1178
1205
|
}
|
1179
1206
|
|
@@ -1181,7 +1208,7 @@ fun `get`(`url`: String): List<String> {
|
|
1181
1208
|
fun `getPublicKeyFromSecretKey`(`secretKey`: String): List<String> {
|
1182
1209
|
return FfiConverterSequenceString.lift(
|
1183
1210
|
rustCall() { _status ->
|
1184
|
-
_UniFFILib.INSTANCE.
|
1211
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_get_public_key_from_secret_key(FfiConverterString.lower(`secretKey`),_status)
|
1185
1212
|
})
|
1186
1213
|
}
|
1187
1214
|
|
@@ -1189,7 +1216,7 @@ fun `getPublicKeyFromSecretKey`(`secretKey`: String): List<String> {
|
|
1189
1216
|
fun `list`(`url`: String): List<String> {
|
1190
1217
|
return FfiConverterSequenceString.lift(
|
1191
1218
|
rustCall() { _status ->
|
1192
|
-
_UniFFILib.INSTANCE.
|
1219
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_list(FfiConverterString.lower(`url`),_status)
|
1193
1220
|
})
|
1194
1221
|
}
|
1195
1222
|
|
@@ -1197,7 +1224,7 @@ fun `list`(`url`: String): List<String> {
|
|
1197
1224
|
fun `parseAuthUrl`(`url`: String): List<String> {
|
1198
1225
|
return FfiConverterSequenceString.lift(
|
1199
1226
|
rustCall() { _status ->
|
1200
|
-
_UniFFILib.INSTANCE.
|
1227
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_parse_auth_url(FfiConverterString.lower(`url`),_status)
|
1201
1228
|
})
|
1202
1229
|
}
|
1203
1230
|
|
@@ -1205,7 +1232,7 @@ fun `parseAuthUrl`(`url`: String): List<String> {
|
|
1205
1232
|
fun `publish`(`recordName`: String, `recordContent`: String, `secretKey`: String): List<String> {
|
1206
1233
|
return FfiConverterSequenceString.lift(
|
1207
1234
|
rustCall() { _status ->
|
1208
|
-
_UniFFILib.INSTANCE.
|
1235
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_publish(FfiConverterString.lower(`recordName`),FfiConverterString.lower(`recordContent`),FfiConverterString.lower(`secretKey`),_status)
|
1209
1236
|
})
|
1210
1237
|
}
|
1211
1238
|
|
@@ -1213,7 +1240,7 @@ fun `publish`(`recordName`: String, `recordContent`: String, `secretKey`: String
|
|
1213
1240
|
fun `publishHttps`(`recordName`: String, `target`: String, `secretKey`: String): List<String> {
|
1214
1241
|
return FfiConverterSequenceString.lift(
|
1215
1242
|
rustCall() { _status ->
|
1216
|
-
_UniFFILib.INSTANCE.
|
1243
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_publish_https(FfiConverterString.lower(`recordName`),FfiConverterString.lower(`target`),FfiConverterString.lower(`secretKey`),_status)
|
1217
1244
|
})
|
1218
1245
|
}
|
1219
1246
|
|
@@ -1221,7 +1248,7 @@ fun `publishHttps`(`recordName`: String, `target`: String, `secretKey`: String):
|
|
1221
1248
|
fun `put`(`url`: String, `content`: String): List<String> {
|
1222
1249
|
return FfiConverterSequenceString.lift(
|
1223
1250
|
rustCall() { _status ->
|
1224
|
-
_UniFFILib.INSTANCE.
|
1251
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_put(FfiConverterString.lower(`url`),FfiConverterString.lower(`content`),_status)
|
1225
1252
|
})
|
1226
1253
|
}
|
1227
1254
|
|
@@ -1229,7 +1256,7 @@ fun `put`(`url`: String, `content`: String): List<String> {
|
|
1229
1256
|
fun `removeEventListener`() =
|
1230
1257
|
|
1231
1258
|
rustCall() { _status ->
|
1232
|
-
_UniFFILib.INSTANCE.
|
1259
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_remove_event_listener(_status)
|
1233
1260
|
}
|
1234
1261
|
|
1235
1262
|
|
@@ -1237,7 +1264,7 @@ fun `removeEventListener`() =
|
|
1237
1264
|
fun `resolve`(`publicKey`: String): List<String> {
|
1238
1265
|
return FfiConverterSequenceString.lift(
|
1239
1266
|
rustCall() { _status ->
|
1240
|
-
_UniFFILib.INSTANCE.
|
1267
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_resolve(FfiConverterString.lower(`publicKey`),_status)
|
1241
1268
|
})
|
1242
1269
|
}
|
1243
1270
|
|
@@ -1245,7 +1272,7 @@ fun `resolve`(`publicKey`: String): List<String> {
|
|
1245
1272
|
fun `resolveHttps`(`publicKey`: String): List<String> {
|
1246
1273
|
return FfiConverterSequenceString.lift(
|
1247
1274
|
rustCall() { _status ->
|
1248
|
-
_UniFFILib.INSTANCE.
|
1275
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_resolve_https(FfiConverterString.lower(`publicKey`),_status)
|
1249
1276
|
})
|
1250
1277
|
}
|
1251
1278
|
|
@@ -1253,7 +1280,7 @@ fun `resolveHttps`(`publicKey`: String): List<String> {
|
|
1253
1280
|
fun `session`(`pubky`: String): List<String> {
|
1254
1281
|
return FfiConverterSequenceString.lift(
|
1255
1282
|
rustCall() { _status ->
|
1256
|
-
_UniFFILib.INSTANCE.
|
1283
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_session(FfiConverterString.lower(`pubky`),_status)
|
1257
1284
|
})
|
1258
1285
|
}
|
1259
1286
|
|
@@ -1261,7 +1288,7 @@ fun `session`(`pubky`: String): List<String> {
|
|
1261
1288
|
fun `setEventListener`(`listener`: EventListener) =
|
1262
1289
|
|
1263
1290
|
rustCall() { _status ->
|
1264
|
-
_UniFFILib.INSTANCE.
|
1291
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_set_event_listener(FfiConverterTypeEventListener.lower(`listener`),_status)
|
1265
1292
|
}
|
1266
1293
|
|
1267
1294
|
|
@@ -1269,7 +1296,7 @@ fun `setEventListener`(`listener`: EventListener) =
|
|
1269
1296
|
fun `signIn`(`secretKey`: String): List<String> {
|
1270
1297
|
return FfiConverterSequenceString.lift(
|
1271
1298
|
rustCall() { _status ->
|
1272
|
-
_UniFFILib.INSTANCE.
|
1299
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_sign_in(FfiConverterString.lower(`secretKey`),_status)
|
1273
1300
|
})
|
1274
1301
|
}
|
1275
1302
|
|
@@ -1277,7 +1304,7 @@ fun `signIn`(`secretKey`: String): List<String> {
|
|
1277
1304
|
fun `signOut`(`secretKey`: String): List<String> {
|
1278
1305
|
return FfiConverterSequenceString.lift(
|
1279
1306
|
rustCall() { _status ->
|
1280
|
-
_UniFFILib.INSTANCE.
|
1307
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_sign_out(FfiConverterString.lower(`secretKey`),_status)
|
1281
1308
|
})
|
1282
1309
|
}
|
1283
1310
|
|
@@ -1285,7 +1312,15 @@ fun `signOut`(`secretKey`: String): List<String> {
|
|
1285
1312
|
fun `signUp`(`secretKey`: String, `homeserver`: String): List<String> {
|
1286
1313
|
return FfiConverterSequenceString.lift(
|
1287
1314
|
rustCall() { _status ->
|
1288
|
-
_UniFFILib.INSTANCE.
|
1315
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_sign_up(FfiConverterString.lower(`secretKey`),FfiConverterString.lower(`homeserver`),_status)
|
1316
|
+
})
|
1317
|
+
}
|
1318
|
+
|
1319
|
+
|
1320
|
+
fun `switchNetwork`(`useTestnet`: Boolean): List<String> {
|
1321
|
+
return FfiConverterSequenceString.lift(
|
1322
|
+
rustCall() { _status ->
|
1323
|
+
_UniFFILib.INSTANCE.uniffi_pubkycore_fn_func_switch_network(FfiConverterBoolean.lower(`useTestnet`),_status)
|
1289
1324
|
})
|
1290
1325
|
}
|
1291
1326
|
|