breez-sdk-spark 0.1.9__cp310-cp310-macosx_11_0_universal2.whl → 0.3.5rc1__cp310-cp310-macosx_11_0_universal2.whl
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.
Potentially problematic release.
This version of breez-sdk-spark might be problematic. Click here for more details.
- breez_sdk_spark/breez_sdk_common.py +2032 -448
- breez_sdk_spark/breez_sdk_spark.py +6641 -3398
- breez_sdk_spark/libbreez_sdk_spark_bindings.dylib +0 -0
- {breez_sdk_spark-0.1.9.dist-info → breez_sdk_spark-0.3.5rc1.dist-info}/METADATA +1 -1
- breez_sdk_spark-0.3.5rc1.dist-info/RECORD +9 -0
- breez_sdk_spark-0.1.9.dist-info/RECORD +0 -9
- {breez_sdk_spark-0.1.9.dist-info → breez_sdk_spark-0.3.5rc1.dist-info}/WHEEL +0 -0
- {breez_sdk_spark-0.1.9.dist-info → breez_sdk_spark-0.3.5rc1.dist-info}/top_level.txt +0 -0
|
@@ -461,11 +461,35 @@ def _uniffi_check_contract_api_version(lib):
|
|
|
461
461
|
raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
|
|
462
462
|
|
|
463
463
|
def _uniffi_check_api_checksums(lib):
|
|
464
|
-
if lib.
|
|
464
|
+
if lib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies() != 63089:
|
|
465
465
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
466
|
-
if lib.
|
|
466
|
+
if lib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates() != 48636:
|
|
467
467
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
468
|
-
if lib.
|
|
468
|
+
if lib.uniffi_breez_sdk_common_checksum_method_restclient_get_request() != 1702:
|
|
469
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
470
|
+
if lib.uniffi_breez_sdk_common_checksum_method_restclient_post_request() != 38998:
|
|
471
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
472
|
+
if lib.uniffi_breez_sdk_common_checksum_method_restclient_delete_request() != 26893:
|
|
473
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
474
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_add_outgoing_change() != 18302:
|
|
475
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
476
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_complete_outgoing_sync() != 1608:
|
|
477
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
478
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_pending_outgoing_changes() != 43350:
|
|
479
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
480
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_last_revision() != 11560:
|
|
481
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
482
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_insert_incoming_records() != 65359:
|
|
483
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
484
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_delete_incoming_record() != 6222:
|
|
485
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
486
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_rebase_pending_outgoing_records() != 49312:
|
|
487
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
488
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_incoming_records() != 39529:
|
|
489
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
490
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_latest_outgoing_change() != 13979:
|
|
491
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
492
|
+
if lib.uniffi_breez_sdk_common_checksum_method_syncstorage_update_record_from_incoming() != 63333:
|
|
469
493
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
470
494
|
|
|
471
495
|
# A ctypes library to expose the extern-C FFI definitions.
|
|
@@ -573,19 +597,85 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure):
|
|
|
573
597
|
]
|
|
574
598
|
_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructVoid,
|
|
575
599
|
)
|
|
600
|
+
_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
601
|
+
)
|
|
602
|
+
_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
603
|
+
)
|
|
576
604
|
_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
577
605
|
)
|
|
578
606
|
_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
579
607
|
)
|
|
580
608
|
_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
581
609
|
)
|
|
610
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_U64,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
611
|
+
)
|
|
612
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
613
|
+
)
|
|
614
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint32,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
615
|
+
)
|
|
616
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_U64,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
617
|
+
)
|
|
618
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD4 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
619
|
+
)
|
|
620
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD5 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
621
|
+
)
|
|
622
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD6 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
623
|
+
)
|
|
624
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD7 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,ctypes.c_uint32,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
625
|
+
)
|
|
626
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD8 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
627
|
+
)
|
|
628
|
+
_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD9 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
629
|
+
)
|
|
630
|
+
class _UniffiVTableCallbackInterfaceFiatService(ctypes.Structure):
|
|
631
|
+
_fields_ = [
|
|
632
|
+
("fetch_fiat_currencies", _UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0),
|
|
633
|
+
("fetch_fiat_rates", _UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1),
|
|
634
|
+
("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
|
|
635
|
+
]
|
|
582
636
|
class _UniffiVTableCallbackInterfaceRestClient(ctypes.Structure):
|
|
583
637
|
_fields_ = [
|
|
584
|
-
("
|
|
585
|
-
("
|
|
586
|
-
("
|
|
638
|
+
("get_request", _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD0),
|
|
639
|
+
("post_request", _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD1),
|
|
640
|
+
("delete_request", _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD2),
|
|
641
|
+
("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
|
|
642
|
+
]
|
|
643
|
+
class _UniffiVTableCallbackInterfaceSyncStorage(ctypes.Structure):
|
|
644
|
+
_fields_ = [
|
|
645
|
+
("add_outgoing_change", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD0),
|
|
646
|
+
("complete_outgoing_sync", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD1),
|
|
647
|
+
("get_pending_outgoing_changes", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD2),
|
|
648
|
+
("get_last_revision", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD3),
|
|
649
|
+
("insert_incoming_records", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD4),
|
|
650
|
+
("delete_incoming_record", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD5),
|
|
651
|
+
("rebase_pending_outgoing_records", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD6),
|
|
652
|
+
("get_incoming_records", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD7),
|
|
653
|
+
("get_latest_outgoing_change", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD8),
|
|
654
|
+
("update_record_from_incoming", _UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD9),
|
|
587
655
|
("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
|
|
588
656
|
]
|
|
657
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice.argtypes = (
|
|
658
|
+
ctypes.c_void_p,
|
|
659
|
+
ctypes.POINTER(_UniffiRustCallStatus),
|
|
660
|
+
)
|
|
661
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice.restype = ctypes.c_void_p
|
|
662
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice.argtypes = (
|
|
663
|
+
ctypes.c_void_p,
|
|
664
|
+
ctypes.POINTER(_UniffiRustCallStatus),
|
|
665
|
+
)
|
|
666
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice.restype = None
|
|
667
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice.argtypes = (
|
|
668
|
+
ctypes.POINTER(_UniffiVTableCallbackInterfaceFiatService),
|
|
669
|
+
)
|
|
670
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice.restype = None
|
|
671
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies.argtypes = (
|
|
672
|
+
ctypes.c_void_p,
|
|
673
|
+
)
|
|
674
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies.restype = ctypes.c_uint64
|
|
675
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates.argtypes = (
|
|
676
|
+
ctypes.c_void_p,
|
|
677
|
+
)
|
|
678
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates.restype = ctypes.c_uint64
|
|
589
679
|
_UniffiLib.uniffi_breez_sdk_common_fn_clone_restclient.argtypes = (
|
|
590
680
|
ctypes.c_void_p,
|
|
591
681
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
@@ -600,26 +690,88 @@ _UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_restclient.argtypes =
|
|
|
600
690
|
ctypes.POINTER(_UniffiVTableCallbackInterfaceRestClient),
|
|
601
691
|
)
|
|
602
692
|
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_restclient.restype = None
|
|
603
|
-
_UniffiLib.
|
|
693
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_get_request.argtypes = (
|
|
694
|
+
ctypes.c_void_p,
|
|
695
|
+
_UniffiRustBuffer,
|
|
696
|
+
_UniffiRustBuffer,
|
|
697
|
+
)
|
|
698
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_get_request.restype = ctypes.c_uint64
|
|
699
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_post_request.argtypes = (
|
|
604
700
|
ctypes.c_void_p,
|
|
605
701
|
_UniffiRustBuffer,
|
|
606
702
|
_UniffiRustBuffer,
|
|
703
|
+
_UniffiRustBuffer,
|
|
607
704
|
)
|
|
608
|
-
_UniffiLib.
|
|
609
|
-
_UniffiLib.
|
|
705
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_post_request.restype = ctypes.c_uint64
|
|
706
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_delete_request.argtypes = (
|
|
610
707
|
ctypes.c_void_p,
|
|
611
708
|
_UniffiRustBuffer,
|
|
612
709
|
_UniffiRustBuffer,
|
|
613
710
|
_UniffiRustBuffer,
|
|
614
711
|
)
|
|
615
|
-
_UniffiLib.
|
|
616
|
-
_UniffiLib.
|
|
712
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_delete_request.restype = ctypes.c_uint64
|
|
713
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_clone_syncstorage.argtypes = (
|
|
714
|
+
ctypes.c_void_p,
|
|
715
|
+
ctypes.POINTER(_UniffiRustCallStatus),
|
|
716
|
+
)
|
|
717
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_clone_syncstorage.restype = ctypes.c_void_p
|
|
718
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_free_syncstorage.argtypes = (
|
|
719
|
+
ctypes.c_void_p,
|
|
720
|
+
ctypes.POINTER(_UniffiRustCallStatus),
|
|
721
|
+
)
|
|
722
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_free_syncstorage.restype = None
|
|
723
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_syncstorage.argtypes = (
|
|
724
|
+
ctypes.POINTER(_UniffiVTableCallbackInterfaceSyncStorage),
|
|
725
|
+
)
|
|
726
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_syncstorage.restype = None
|
|
727
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_add_outgoing_change.argtypes = (
|
|
728
|
+
ctypes.c_void_p,
|
|
729
|
+
_UniffiRustBuffer,
|
|
730
|
+
)
|
|
731
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_add_outgoing_change.restype = ctypes.c_uint64
|
|
732
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_complete_outgoing_sync.argtypes = (
|
|
733
|
+
ctypes.c_void_p,
|
|
734
|
+
_UniffiRustBuffer,
|
|
735
|
+
)
|
|
736
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_complete_outgoing_sync.restype = ctypes.c_uint64
|
|
737
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_pending_outgoing_changes.argtypes = (
|
|
738
|
+
ctypes.c_void_p,
|
|
739
|
+
ctypes.c_uint32,
|
|
740
|
+
)
|
|
741
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_pending_outgoing_changes.restype = ctypes.c_uint64
|
|
742
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_last_revision.argtypes = (
|
|
743
|
+
ctypes.c_void_p,
|
|
744
|
+
)
|
|
745
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_last_revision.restype = ctypes.c_uint64
|
|
746
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_insert_incoming_records.argtypes = (
|
|
617
747
|
ctypes.c_void_p,
|
|
618
748
|
_UniffiRustBuffer,
|
|
749
|
+
)
|
|
750
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_insert_incoming_records.restype = ctypes.c_uint64
|
|
751
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_delete_incoming_record.argtypes = (
|
|
752
|
+
ctypes.c_void_p,
|
|
619
753
|
_UniffiRustBuffer,
|
|
754
|
+
)
|
|
755
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_delete_incoming_record.restype = ctypes.c_uint64
|
|
756
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_rebase_pending_outgoing_records.argtypes = (
|
|
757
|
+
ctypes.c_void_p,
|
|
758
|
+
ctypes.c_uint64,
|
|
759
|
+
)
|
|
760
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_rebase_pending_outgoing_records.restype = ctypes.c_uint64
|
|
761
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_incoming_records.argtypes = (
|
|
762
|
+
ctypes.c_void_p,
|
|
763
|
+
ctypes.c_uint32,
|
|
764
|
+
)
|
|
765
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_incoming_records.restype = ctypes.c_uint64
|
|
766
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_latest_outgoing_change.argtypes = (
|
|
767
|
+
ctypes.c_void_p,
|
|
768
|
+
)
|
|
769
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_latest_outgoing_change.restype = ctypes.c_uint64
|
|
770
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_update_record_from_incoming.argtypes = (
|
|
771
|
+
ctypes.c_void_p,
|
|
620
772
|
_UniffiRustBuffer,
|
|
621
773
|
)
|
|
622
|
-
_UniffiLib.
|
|
774
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_update_record_from_incoming.restype = ctypes.c_uint64
|
|
623
775
|
_UniffiLib.ffi_breez_sdk_common_rustbuffer_alloc.argtypes = (
|
|
624
776
|
ctypes.c_uint64,
|
|
625
777
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
@@ -888,15 +1040,51 @@ _UniffiLib.ffi_breez_sdk_common_rust_future_complete_void.argtypes = (
|
|
|
888
1040
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
889
1041
|
)
|
|
890
1042
|
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_void.restype = None
|
|
891
|
-
_UniffiLib.
|
|
1043
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies.argtypes = (
|
|
1044
|
+
)
|
|
1045
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies.restype = ctypes.c_uint16
|
|
1046
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates.argtypes = (
|
|
1047
|
+
)
|
|
1048
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates.restype = ctypes.c_uint16
|
|
1049
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_get_request.argtypes = (
|
|
1050
|
+
)
|
|
1051
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_get_request.restype = ctypes.c_uint16
|
|
1052
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_post_request.argtypes = (
|
|
1053
|
+
)
|
|
1054
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_post_request.restype = ctypes.c_uint16
|
|
1055
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_delete_request.argtypes = (
|
|
1056
|
+
)
|
|
1057
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_delete_request.restype = ctypes.c_uint16
|
|
1058
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_add_outgoing_change.argtypes = (
|
|
1059
|
+
)
|
|
1060
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_add_outgoing_change.restype = ctypes.c_uint16
|
|
1061
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_complete_outgoing_sync.argtypes = (
|
|
892
1062
|
)
|
|
893
|
-
_UniffiLib.
|
|
894
|
-
_UniffiLib.
|
|
1063
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_complete_outgoing_sync.restype = ctypes.c_uint16
|
|
1064
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_pending_outgoing_changes.argtypes = (
|
|
895
1065
|
)
|
|
896
|
-
_UniffiLib.
|
|
897
|
-
_UniffiLib.
|
|
1066
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_pending_outgoing_changes.restype = ctypes.c_uint16
|
|
1067
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_last_revision.argtypes = (
|
|
898
1068
|
)
|
|
899
|
-
_UniffiLib.
|
|
1069
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_last_revision.restype = ctypes.c_uint16
|
|
1070
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_insert_incoming_records.argtypes = (
|
|
1071
|
+
)
|
|
1072
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_insert_incoming_records.restype = ctypes.c_uint16
|
|
1073
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_delete_incoming_record.argtypes = (
|
|
1074
|
+
)
|
|
1075
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_delete_incoming_record.restype = ctypes.c_uint16
|
|
1076
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_rebase_pending_outgoing_records.argtypes = (
|
|
1077
|
+
)
|
|
1078
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_rebase_pending_outgoing_records.restype = ctypes.c_uint16
|
|
1079
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_incoming_records.argtypes = (
|
|
1080
|
+
)
|
|
1081
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_incoming_records.restype = ctypes.c_uint16
|
|
1082
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_latest_outgoing_change.argtypes = (
|
|
1083
|
+
)
|
|
1084
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_get_latest_outgoing_change.restype = ctypes.c_uint16
|
|
1085
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_update_record_from_incoming.argtypes = (
|
|
1086
|
+
)
|
|
1087
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_syncstorage_update_record_from_incoming.restype = ctypes.c_uint16
|
|
900
1088
|
_UniffiLib.ffi_breez_sdk_common_uniffi_contract_version.argtypes = (
|
|
901
1089
|
)
|
|
902
1090
|
_UniffiLib.ffi_breez_sdk_common_uniffi_contract_version.restype = ctypes.c_uint32
|
|
@@ -1010,39 +1198,30 @@ class _UniffiConverterString:
|
|
|
1010
1198
|
|
|
1011
1199
|
|
|
1012
1200
|
|
|
1013
|
-
class
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
### Arguments
|
|
1018
|
-
- `url`: the URL on which GET will be called
|
|
1019
|
-
- `headers`: optional headers that will be set on the request
|
|
1020
|
-
"""
|
|
1201
|
+
class FiatService(typing.Protocol):
|
|
1202
|
+
"""
|
|
1203
|
+
Trait covering fiat-related functionality
|
|
1204
|
+
"""
|
|
1021
1205
|
|
|
1022
|
-
|
|
1023
|
-
def post(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]"):
|
|
1206
|
+
def fetch_fiat_currencies(self, ):
|
|
1024
1207
|
"""
|
|
1025
|
-
|
|
1026
|
-
### Arguments
|
|
1027
|
-
- `url`: the URL on which POST will be called
|
|
1028
|
-
- `headers`: the optional POST headers
|
|
1029
|
-
- `body`: the optional POST body
|
|
1208
|
+
List all supported fiat currencies for which there is a known exchange rate.
|
|
1030
1209
|
"""
|
|
1031
1210
|
|
|
1032
1211
|
raise NotImplementedError
|
|
1033
|
-
def
|
|
1212
|
+
def fetch_fiat_rates(self, ):
|
|
1034
1213
|
"""
|
|
1035
|
-
|
|
1036
|
-
### Arguments
|
|
1037
|
-
- `url`: the URL on which DELETE will be called
|
|
1038
|
-
- `headers`: the optional DELETE headers
|
|
1039
|
-
- `body`: the optional DELETE body
|
|
1214
|
+
Get the live rates from the server.
|
|
1040
1215
|
"""
|
|
1041
1216
|
|
|
1042
1217
|
raise NotImplementedError
|
|
1043
1218
|
|
|
1044
1219
|
|
|
1045
|
-
class
|
|
1220
|
+
class FiatServiceImpl:
|
|
1221
|
+
"""
|
|
1222
|
+
Trait covering fiat-related functionality
|
|
1223
|
+
"""
|
|
1224
|
+
|
|
1046
1225
|
_pointer: ctypes.c_void_p
|
|
1047
1226
|
|
|
1048
1227
|
def __init__(self, *args, **kwargs):
|
|
@@ -1052,10 +1231,10 @@ class RestClientImpl:
|
|
|
1052
1231
|
# In case of partial initialization of instances.
|
|
1053
1232
|
pointer = getattr(self, "_pointer", None)
|
|
1054
1233
|
if pointer is not None:
|
|
1055
|
-
_uniffi_rust_call(_UniffiLib.
|
|
1234
|
+
_uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice, pointer)
|
|
1056
1235
|
|
|
1057
1236
|
def _uniffi_clone_pointer(self):
|
|
1058
|
-
return _uniffi_rust_call(_UniffiLib.
|
|
1237
|
+
return _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice, self._pointer)
|
|
1059
1238
|
|
|
1060
1239
|
# Used by alternative constructors or any methods which return this type.
|
|
1061
1240
|
@classmethod
|
|
@@ -1066,64 +1245,20 @@ class RestClientImpl:
|
|
|
1066
1245
|
inst._pointer = pointer
|
|
1067
1246
|
return inst
|
|
1068
1247
|
|
|
1069
|
-
async def
|
|
1070
|
-
"""
|
|
1071
|
-
Makes a GET request and logs on DEBUG.
|
|
1072
|
-
### Arguments
|
|
1073
|
-
- `url`: the URL on which GET will be called
|
|
1074
|
-
- `headers`: optional headers that will be set on the request
|
|
1075
|
-
"""
|
|
1076
|
-
|
|
1077
|
-
_UniffiConverterString.check_lower(url)
|
|
1078
|
-
|
|
1079
|
-
_UniffiConverterOptionalMapStringString.check_lower(headers)
|
|
1080
|
-
|
|
1081
|
-
return await _uniffi_rust_call_async(
|
|
1082
|
-
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_get(
|
|
1083
|
-
self._uniffi_clone_pointer(),
|
|
1084
|
-
_UniffiConverterString.lower(url),
|
|
1085
|
-
_UniffiConverterOptionalMapStringString.lower(headers)
|
|
1086
|
-
),
|
|
1087
|
-
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1088
|
-
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1089
|
-
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1090
|
-
# lift function
|
|
1091
|
-
_UniffiConverterTypeRestResponse.lift,
|
|
1092
|
-
|
|
1093
|
-
# Error FFI converter
|
|
1094
|
-
_UniffiConverterTypeServiceConnectivityError,
|
|
1095
|
-
|
|
1096
|
-
)
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
async def post(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]") -> "RestResponse":
|
|
1248
|
+
async def fetch_fiat_currencies(self, ) -> "typing.List[FiatCurrency]":
|
|
1101
1249
|
"""
|
|
1102
|
-
|
|
1103
|
-
### Arguments
|
|
1104
|
-
- `url`: the URL on which POST will be called
|
|
1105
|
-
- `headers`: the optional POST headers
|
|
1106
|
-
- `body`: the optional POST body
|
|
1250
|
+
List all supported fiat currencies for which there is a known exchange rate.
|
|
1107
1251
|
"""
|
|
1108
1252
|
|
|
1109
|
-
_UniffiConverterString.check_lower(url)
|
|
1110
|
-
|
|
1111
|
-
_UniffiConverterOptionalMapStringString.check_lower(headers)
|
|
1112
|
-
|
|
1113
|
-
_UniffiConverterOptionalString.check_lower(body)
|
|
1114
|
-
|
|
1115
1253
|
return await _uniffi_rust_call_async(
|
|
1116
|
-
_UniffiLib.
|
|
1254
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies(
|
|
1117
1255
|
self._uniffi_clone_pointer(),
|
|
1118
|
-
_UniffiConverterString.lower(url),
|
|
1119
|
-
_UniffiConverterOptionalMapStringString.lower(headers),
|
|
1120
|
-
_UniffiConverterOptionalString.lower(body)
|
|
1121
1256
|
),
|
|
1122
1257
|
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1123
1258
|
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1124
1259
|
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1125
1260
|
# lift function
|
|
1126
|
-
|
|
1261
|
+
_UniffiConverterSequenceTypeFiatCurrency.lift,
|
|
1127
1262
|
|
|
1128
1263
|
# Error FFI converter
|
|
1129
1264
|
_UniffiConverterTypeServiceConnectivityError,
|
|
@@ -1132,33 +1267,20 @@ _UniffiConverterTypeServiceConnectivityError,
|
|
|
1132
1267
|
|
|
1133
1268
|
|
|
1134
1269
|
|
|
1135
|
-
async def
|
|
1270
|
+
async def fetch_fiat_rates(self, ) -> "typing.List[Rate]":
|
|
1136
1271
|
"""
|
|
1137
|
-
|
|
1138
|
-
### Arguments
|
|
1139
|
-
- `url`: the URL on which DELETE will be called
|
|
1140
|
-
- `headers`: the optional DELETE headers
|
|
1141
|
-
- `body`: the optional DELETE body
|
|
1272
|
+
Get the live rates from the server.
|
|
1142
1273
|
"""
|
|
1143
1274
|
|
|
1144
|
-
_UniffiConverterString.check_lower(url)
|
|
1145
|
-
|
|
1146
|
-
_UniffiConverterOptionalMapStringString.check_lower(headers)
|
|
1147
|
-
|
|
1148
|
-
_UniffiConverterOptionalString.check_lower(body)
|
|
1149
|
-
|
|
1150
1275
|
return await _uniffi_rust_call_async(
|
|
1151
|
-
_UniffiLib.
|
|
1276
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates(
|
|
1152
1277
|
self._uniffi_clone_pointer(),
|
|
1153
|
-
_UniffiConverterString.lower(url),
|
|
1154
|
-
_UniffiConverterOptionalMapStringString.lower(headers),
|
|
1155
|
-
_UniffiConverterOptionalString.lower(body)
|
|
1156
1278
|
),
|
|
1157
1279
|
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1158
1280
|
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1159
1281
|
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1160
1282
|
# lift function
|
|
1161
|
-
|
|
1283
|
+
_UniffiConverterSequenceTypeRate.lift,
|
|
1162
1284
|
|
|
1163
1285
|
# Error FFI converter
|
|
1164
1286
|
_UniffiConverterTypeServiceConnectivityError,
|
|
@@ -1174,48 +1296,1022 @@ _UNIFFI_CALLBACK_SUCCESS = 0
|
|
|
1174
1296
|
_UNIFFI_CALLBACK_ERROR = 1
|
|
1175
1297
|
_UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2
|
|
1176
1298
|
|
|
1177
|
-
class _UniffiCallbackInterfaceFfiConverter:
|
|
1178
|
-
_handle_map = _UniffiHandleMap()
|
|
1299
|
+
class _UniffiCallbackInterfaceFfiConverter:
|
|
1300
|
+
_handle_map = _UniffiHandleMap()
|
|
1301
|
+
|
|
1302
|
+
@classmethod
|
|
1303
|
+
def lift(cls, handle):
|
|
1304
|
+
return cls._handle_map.get(handle)
|
|
1305
|
+
|
|
1306
|
+
@classmethod
|
|
1307
|
+
def read(cls, buf):
|
|
1308
|
+
handle = buf.read_u64()
|
|
1309
|
+
cls.lift(handle)
|
|
1310
|
+
|
|
1311
|
+
@classmethod
|
|
1312
|
+
def check_lower(cls, cb):
|
|
1313
|
+
pass
|
|
1314
|
+
|
|
1315
|
+
@classmethod
|
|
1316
|
+
def lower(cls, cb):
|
|
1317
|
+
handle = cls._handle_map.insert(cb)
|
|
1318
|
+
return handle
|
|
1319
|
+
|
|
1320
|
+
@classmethod
|
|
1321
|
+
def write(cls, cb, buf):
|
|
1322
|
+
buf.write_u64(cls.lower(cb))
|
|
1323
|
+
|
|
1324
|
+
# Put all the bits inside a class to keep the top-level namespace clean
|
|
1325
|
+
class _UniffiTraitImplFiatService:
|
|
1326
|
+
# For each method, generate a callback function to pass to Rust
|
|
1327
|
+
|
|
1328
|
+
@_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0
|
|
1329
|
+
def fetch_fiat_currencies(
|
|
1330
|
+
uniffi_handle,
|
|
1331
|
+
uniffi_future_callback,
|
|
1332
|
+
uniffi_callback_data,
|
|
1333
|
+
uniffi_out_return,
|
|
1334
|
+
):
|
|
1335
|
+
uniffi_obj = _UniffiConverterTypeFiatService._handle_map.get(uniffi_handle)
|
|
1336
|
+
def make_call():
|
|
1337
|
+
args = ()
|
|
1338
|
+
method = uniffi_obj.fetch_fiat_currencies
|
|
1339
|
+
return method(*args)
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
def handle_success(return_value):
|
|
1343
|
+
uniffi_future_callback(
|
|
1344
|
+
uniffi_callback_data,
|
|
1345
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1346
|
+
_UniffiConverterSequenceTypeFiatCurrency.lower(return_value),
|
|
1347
|
+
_UniffiRustCallStatus.default()
|
|
1348
|
+
)
|
|
1349
|
+
)
|
|
1350
|
+
|
|
1351
|
+
def handle_error(status_code, rust_buffer):
|
|
1352
|
+
uniffi_future_callback(
|
|
1353
|
+
uniffi_callback_data,
|
|
1354
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1355
|
+
_UniffiRustBuffer.default(),
|
|
1356
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1357
|
+
)
|
|
1358
|
+
)
|
|
1359
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1360
|
+
|
|
1361
|
+
@_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1
|
|
1362
|
+
def fetch_fiat_rates(
|
|
1363
|
+
uniffi_handle,
|
|
1364
|
+
uniffi_future_callback,
|
|
1365
|
+
uniffi_callback_data,
|
|
1366
|
+
uniffi_out_return,
|
|
1367
|
+
):
|
|
1368
|
+
uniffi_obj = _UniffiConverterTypeFiatService._handle_map.get(uniffi_handle)
|
|
1369
|
+
def make_call():
|
|
1370
|
+
args = ()
|
|
1371
|
+
method = uniffi_obj.fetch_fiat_rates
|
|
1372
|
+
return method(*args)
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
def handle_success(return_value):
|
|
1376
|
+
uniffi_future_callback(
|
|
1377
|
+
uniffi_callback_data,
|
|
1378
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1379
|
+
_UniffiConverterSequenceTypeRate.lower(return_value),
|
|
1380
|
+
_UniffiRustCallStatus.default()
|
|
1381
|
+
)
|
|
1382
|
+
)
|
|
1383
|
+
|
|
1384
|
+
def handle_error(status_code, rust_buffer):
|
|
1385
|
+
uniffi_future_callback(
|
|
1386
|
+
uniffi_callback_data,
|
|
1387
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1388
|
+
_UniffiRustBuffer.default(),
|
|
1389
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1390
|
+
)
|
|
1391
|
+
)
|
|
1392
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1393
|
+
|
|
1394
|
+
@_UNIFFI_CALLBACK_INTERFACE_FREE
|
|
1395
|
+
def _uniffi_free(uniffi_handle):
|
|
1396
|
+
_UniffiConverterTypeFiatService._handle_map.remove(uniffi_handle)
|
|
1397
|
+
|
|
1398
|
+
# Generate the FFI VTable. This has a field for each callback interface method.
|
|
1399
|
+
_uniffi_vtable = _UniffiVTableCallbackInterfaceFiatService(
|
|
1400
|
+
fetch_fiat_currencies,
|
|
1401
|
+
fetch_fiat_rates,
|
|
1402
|
+
_uniffi_free
|
|
1403
|
+
)
|
|
1404
|
+
# Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever,
|
|
1405
|
+
# or else bad things will happen when Rust tries to access it.
|
|
1406
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice(ctypes.byref(_uniffi_vtable))
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
class _UniffiConverterTypeFiatService:
|
|
1411
|
+
_handle_map = _UniffiHandleMap()
|
|
1412
|
+
|
|
1413
|
+
@staticmethod
|
|
1414
|
+
def lift(value: int):
|
|
1415
|
+
return FiatServiceImpl._make_instance_(value)
|
|
1416
|
+
|
|
1417
|
+
@staticmethod
|
|
1418
|
+
def check_lower(value: FiatService):
|
|
1419
|
+
pass
|
|
1420
|
+
|
|
1421
|
+
@staticmethod
|
|
1422
|
+
def lower(value: FiatService):
|
|
1423
|
+
return _UniffiConverterTypeFiatService._handle_map.insert(value)
|
|
1424
|
+
|
|
1425
|
+
@classmethod
|
|
1426
|
+
def read(cls, buf: _UniffiRustBuffer):
|
|
1427
|
+
ptr = buf.read_u64()
|
|
1428
|
+
if ptr == 0:
|
|
1429
|
+
raise InternalError("Raw pointer value was null")
|
|
1430
|
+
return cls.lift(ptr)
|
|
1431
|
+
|
|
1432
|
+
@classmethod
|
|
1433
|
+
def write(cls, value: FiatService, buf: _UniffiRustBuffer):
|
|
1434
|
+
buf.write_u64(cls.lower(value))
|
|
1435
|
+
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
class RestClient(typing.Protocol):
|
|
1439
|
+
def get_request(self, url: "str",headers: "typing.Optional[dict[str, str]]"):
|
|
1440
|
+
"""
|
|
1441
|
+
Makes a GET request and logs on DEBUG.
|
|
1442
|
+
### Arguments
|
|
1443
|
+
- `url`: the URL on which GET will be called
|
|
1444
|
+
- `headers`: optional headers that will be set on the request
|
|
1445
|
+
"""
|
|
1446
|
+
|
|
1447
|
+
raise NotImplementedError
|
|
1448
|
+
def post_request(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]"):
|
|
1449
|
+
"""
|
|
1450
|
+
Makes a POST request, and logs on DEBUG.
|
|
1451
|
+
### Arguments
|
|
1452
|
+
- `url`: the URL on which POST will be called
|
|
1453
|
+
- `headers`: the optional POST headers
|
|
1454
|
+
- `body`: the optional POST body
|
|
1455
|
+
"""
|
|
1456
|
+
|
|
1457
|
+
raise NotImplementedError
|
|
1458
|
+
def delete_request(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]"):
|
|
1459
|
+
"""
|
|
1460
|
+
Makes a DELETE request, and logs on DEBUG.
|
|
1461
|
+
### Arguments
|
|
1462
|
+
- `url`: the URL on which DELETE will be called
|
|
1463
|
+
- `headers`: the optional DELETE headers
|
|
1464
|
+
- `body`: the optional DELETE body
|
|
1465
|
+
"""
|
|
1466
|
+
|
|
1467
|
+
raise NotImplementedError
|
|
1468
|
+
|
|
1469
|
+
|
|
1470
|
+
class RestClientImpl:
|
|
1471
|
+
_pointer: ctypes.c_void_p
|
|
1472
|
+
|
|
1473
|
+
def __init__(self, *args, **kwargs):
|
|
1474
|
+
raise ValueError("This class has no default constructor")
|
|
1475
|
+
|
|
1476
|
+
def __del__(self):
|
|
1477
|
+
# In case of partial initialization of instances.
|
|
1478
|
+
pointer = getattr(self, "_pointer", None)
|
|
1479
|
+
if pointer is not None:
|
|
1480
|
+
_uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_free_restclient, pointer)
|
|
1481
|
+
|
|
1482
|
+
def _uniffi_clone_pointer(self):
|
|
1483
|
+
return _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_clone_restclient, self._pointer)
|
|
1484
|
+
|
|
1485
|
+
# Used by alternative constructors or any methods which return this type.
|
|
1486
|
+
@classmethod
|
|
1487
|
+
def _make_instance_(cls, pointer):
|
|
1488
|
+
# Lightly yucky way to bypass the usual __init__ logic
|
|
1489
|
+
# and just create a new instance with the required pointer.
|
|
1490
|
+
inst = cls.__new__(cls)
|
|
1491
|
+
inst._pointer = pointer
|
|
1492
|
+
return inst
|
|
1493
|
+
|
|
1494
|
+
async def get_request(self, url: "str",headers: "typing.Optional[dict[str, str]]") -> "RestResponse":
|
|
1495
|
+
"""
|
|
1496
|
+
Makes a GET request and logs on DEBUG.
|
|
1497
|
+
### Arguments
|
|
1498
|
+
- `url`: the URL on which GET will be called
|
|
1499
|
+
- `headers`: optional headers that will be set on the request
|
|
1500
|
+
"""
|
|
1501
|
+
|
|
1502
|
+
_UniffiConverterString.check_lower(url)
|
|
1503
|
+
|
|
1504
|
+
_UniffiConverterOptionalMapStringString.check_lower(headers)
|
|
1505
|
+
|
|
1506
|
+
return await _uniffi_rust_call_async(
|
|
1507
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_get_request(
|
|
1508
|
+
self._uniffi_clone_pointer(),
|
|
1509
|
+
_UniffiConverterString.lower(url),
|
|
1510
|
+
_UniffiConverterOptionalMapStringString.lower(headers)
|
|
1511
|
+
),
|
|
1512
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1513
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1514
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1515
|
+
# lift function
|
|
1516
|
+
_UniffiConverterTypeRestResponse.lift,
|
|
1517
|
+
|
|
1518
|
+
# Error FFI converter
|
|
1519
|
+
_UniffiConverterTypeServiceConnectivityError,
|
|
1520
|
+
|
|
1521
|
+
)
|
|
1522
|
+
|
|
1523
|
+
|
|
1524
|
+
|
|
1525
|
+
async def post_request(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]") -> "RestResponse":
|
|
1526
|
+
"""
|
|
1527
|
+
Makes a POST request, and logs on DEBUG.
|
|
1528
|
+
### Arguments
|
|
1529
|
+
- `url`: the URL on which POST will be called
|
|
1530
|
+
- `headers`: the optional POST headers
|
|
1531
|
+
- `body`: the optional POST body
|
|
1532
|
+
"""
|
|
1533
|
+
|
|
1534
|
+
_UniffiConverterString.check_lower(url)
|
|
1535
|
+
|
|
1536
|
+
_UniffiConverterOptionalMapStringString.check_lower(headers)
|
|
1537
|
+
|
|
1538
|
+
_UniffiConverterOptionalString.check_lower(body)
|
|
1539
|
+
|
|
1540
|
+
return await _uniffi_rust_call_async(
|
|
1541
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_post_request(
|
|
1542
|
+
self._uniffi_clone_pointer(),
|
|
1543
|
+
_UniffiConverterString.lower(url),
|
|
1544
|
+
_UniffiConverterOptionalMapStringString.lower(headers),
|
|
1545
|
+
_UniffiConverterOptionalString.lower(body)
|
|
1546
|
+
),
|
|
1547
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1548
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1549
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1550
|
+
# lift function
|
|
1551
|
+
_UniffiConverterTypeRestResponse.lift,
|
|
1552
|
+
|
|
1553
|
+
# Error FFI converter
|
|
1554
|
+
_UniffiConverterTypeServiceConnectivityError,
|
|
1555
|
+
|
|
1556
|
+
)
|
|
1557
|
+
|
|
1558
|
+
|
|
1559
|
+
|
|
1560
|
+
async def delete_request(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]") -> "RestResponse":
|
|
1561
|
+
"""
|
|
1562
|
+
Makes a DELETE request, and logs on DEBUG.
|
|
1563
|
+
### Arguments
|
|
1564
|
+
- `url`: the URL on which DELETE will be called
|
|
1565
|
+
- `headers`: the optional DELETE headers
|
|
1566
|
+
- `body`: the optional DELETE body
|
|
1567
|
+
"""
|
|
1568
|
+
|
|
1569
|
+
_UniffiConverterString.check_lower(url)
|
|
1570
|
+
|
|
1571
|
+
_UniffiConverterOptionalMapStringString.check_lower(headers)
|
|
1572
|
+
|
|
1573
|
+
_UniffiConverterOptionalString.check_lower(body)
|
|
1574
|
+
|
|
1575
|
+
return await _uniffi_rust_call_async(
|
|
1576
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_delete_request(
|
|
1577
|
+
self._uniffi_clone_pointer(),
|
|
1578
|
+
_UniffiConverterString.lower(url),
|
|
1579
|
+
_UniffiConverterOptionalMapStringString.lower(headers),
|
|
1580
|
+
_UniffiConverterOptionalString.lower(body)
|
|
1581
|
+
),
|
|
1582
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1583
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1584
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1585
|
+
# lift function
|
|
1586
|
+
_UniffiConverterTypeRestResponse.lift,
|
|
1587
|
+
|
|
1588
|
+
# Error FFI converter
|
|
1589
|
+
_UniffiConverterTypeServiceConnectivityError,
|
|
1590
|
+
|
|
1591
|
+
)
|
|
1592
|
+
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
# Put all the bits inside a class to keep the top-level namespace clean
|
|
1597
|
+
class _UniffiTraitImplRestClient:
|
|
1598
|
+
# For each method, generate a callback function to pass to Rust
|
|
1599
|
+
|
|
1600
|
+
@_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD0
|
|
1601
|
+
def get_request(
|
|
1602
|
+
uniffi_handle,
|
|
1603
|
+
url,
|
|
1604
|
+
headers,
|
|
1605
|
+
uniffi_future_callback,
|
|
1606
|
+
uniffi_callback_data,
|
|
1607
|
+
uniffi_out_return,
|
|
1608
|
+
):
|
|
1609
|
+
uniffi_obj = _UniffiConverterTypeRestClient._handle_map.get(uniffi_handle)
|
|
1610
|
+
def make_call():
|
|
1611
|
+
args = (_UniffiConverterString.lift(url), _UniffiConverterOptionalMapStringString.lift(headers), )
|
|
1612
|
+
method = uniffi_obj.get_request
|
|
1613
|
+
return method(*args)
|
|
1614
|
+
|
|
1615
|
+
|
|
1616
|
+
def handle_success(return_value):
|
|
1617
|
+
uniffi_future_callback(
|
|
1618
|
+
uniffi_callback_data,
|
|
1619
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1620
|
+
_UniffiConverterTypeRestResponse.lower(return_value),
|
|
1621
|
+
_UniffiRustCallStatus.default()
|
|
1622
|
+
)
|
|
1623
|
+
)
|
|
1624
|
+
|
|
1625
|
+
def handle_error(status_code, rust_buffer):
|
|
1626
|
+
uniffi_future_callback(
|
|
1627
|
+
uniffi_callback_data,
|
|
1628
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1629
|
+
_UniffiRustBuffer.default(),
|
|
1630
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1631
|
+
)
|
|
1632
|
+
)
|
|
1633
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1634
|
+
|
|
1635
|
+
@_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD1
|
|
1636
|
+
def post_request(
|
|
1637
|
+
uniffi_handle,
|
|
1638
|
+
url,
|
|
1639
|
+
headers,
|
|
1640
|
+
body,
|
|
1641
|
+
uniffi_future_callback,
|
|
1642
|
+
uniffi_callback_data,
|
|
1643
|
+
uniffi_out_return,
|
|
1644
|
+
):
|
|
1645
|
+
uniffi_obj = _UniffiConverterTypeRestClient._handle_map.get(uniffi_handle)
|
|
1646
|
+
def make_call():
|
|
1647
|
+
args = (_UniffiConverterString.lift(url), _UniffiConverterOptionalMapStringString.lift(headers), _UniffiConverterOptionalString.lift(body), )
|
|
1648
|
+
method = uniffi_obj.post_request
|
|
1649
|
+
return method(*args)
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
def handle_success(return_value):
|
|
1653
|
+
uniffi_future_callback(
|
|
1654
|
+
uniffi_callback_data,
|
|
1655
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1656
|
+
_UniffiConverterTypeRestResponse.lower(return_value),
|
|
1657
|
+
_UniffiRustCallStatus.default()
|
|
1658
|
+
)
|
|
1659
|
+
)
|
|
1660
|
+
|
|
1661
|
+
def handle_error(status_code, rust_buffer):
|
|
1662
|
+
uniffi_future_callback(
|
|
1663
|
+
uniffi_callback_data,
|
|
1664
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1665
|
+
_UniffiRustBuffer.default(),
|
|
1666
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1667
|
+
)
|
|
1668
|
+
)
|
|
1669
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1670
|
+
|
|
1671
|
+
@_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD2
|
|
1672
|
+
def delete_request(
|
|
1673
|
+
uniffi_handle,
|
|
1674
|
+
url,
|
|
1675
|
+
headers,
|
|
1676
|
+
body,
|
|
1677
|
+
uniffi_future_callback,
|
|
1678
|
+
uniffi_callback_data,
|
|
1679
|
+
uniffi_out_return,
|
|
1680
|
+
):
|
|
1681
|
+
uniffi_obj = _UniffiConverterTypeRestClient._handle_map.get(uniffi_handle)
|
|
1682
|
+
def make_call():
|
|
1683
|
+
args = (_UniffiConverterString.lift(url), _UniffiConverterOptionalMapStringString.lift(headers), _UniffiConverterOptionalString.lift(body), )
|
|
1684
|
+
method = uniffi_obj.delete_request
|
|
1685
|
+
return method(*args)
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
def handle_success(return_value):
|
|
1689
|
+
uniffi_future_callback(
|
|
1690
|
+
uniffi_callback_data,
|
|
1691
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1692
|
+
_UniffiConverterTypeRestResponse.lower(return_value),
|
|
1693
|
+
_UniffiRustCallStatus.default()
|
|
1694
|
+
)
|
|
1695
|
+
)
|
|
1696
|
+
|
|
1697
|
+
def handle_error(status_code, rust_buffer):
|
|
1698
|
+
uniffi_future_callback(
|
|
1699
|
+
uniffi_callback_data,
|
|
1700
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1701
|
+
_UniffiRustBuffer.default(),
|
|
1702
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1703
|
+
)
|
|
1704
|
+
)
|
|
1705
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1706
|
+
|
|
1707
|
+
@_UNIFFI_CALLBACK_INTERFACE_FREE
|
|
1708
|
+
def _uniffi_free(uniffi_handle):
|
|
1709
|
+
_UniffiConverterTypeRestClient._handle_map.remove(uniffi_handle)
|
|
1710
|
+
|
|
1711
|
+
# Generate the FFI VTable. This has a field for each callback interface method.
|
|
1712
|
+
_uniffi_vtable = _UniffiVTableCallbackInterfaceRestClient(
|
|
1713
|
+
get_request,
|
|
1714
|
+
post_request,
|
|
1715
|
+
delete_request,
|
|
1716
|
+
_uniffi_free
|
|
1717
|
+
)
|
|
1718
|
+
# Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever,
|
|
1719
|
+
# or else bad things will happen when Rust tries to access it.
|
|
1720
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_restclient(ctypes.byref(_uniffi_vtable))
|
|
1721
|
+
|
|
1722
|
+
|
|
1723
|
+
|
|
1724
|
+
class _UniffiConverterTypeRestClient:
|
|
1725
|
+
_handle_map = _UniffiHandleMap()
|
|
1726
|
+
|
|
1727
|
+
@staticmethod
|
|
1728
|
+
def lift(value: int):
|
|
1729
|
+
return RestClientImpl._make_instance_(value)
|
|
1730
|
+
|
|
1731
|
+
@staticmethod
|
|
1732
|
+
def check_lower(value: RestClient):
|
|
1733
|
+
pass
|
|
1734
|
+
|
|
1735
|
+
@staticmethod
|
|
1736
|
+
def lower(value: RestClient):
|
|
1737
|
+
return _UniffiConverterTypeRestClient._handle_map.insert(value)
|
|
1738
|
+
|
|
1739
|
+
@classmethod
|
|
1740
|
+
def read(cls, buf: _UniffiRustBuffer):
|
|
1741
|
+
ptr = buf.read_u64()
|
|
1742
|
+
if ptr == 0:
|
|
1743
|
+
raise InternalError("Raw pointer value was null")
|
|
1744
|
+
return cls.lift(ptr)
|
|
1745
|
+
|
|
1746
|
+
@classmethod
|
|
1747
|
+
def write(cls, value: RestClient, buf: _UniffiRustBuffer):
|
|
1748
|
+
buf.write_u64(cls.lower(value))
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
class SyncStorage(typing.Protocol):
|
|
1753
|
+
def add_outgoing_change(self, record: "UnversionedRecordChange"):
|
|
1754
|
+
raise NotImplementedError
|
|
1755
|
+
def complete_outgoing_sync(self, record: "Record"):
|
|
1756
|
+
raise NotImplementedError
|
|
1757
|
+
def get_pending_outgoing_changes(self, limit: "int"):
|
|
1758
|
+
raise NotImplementedError
|
|
1759
|
+
def get_last_revision(self, ):
|
|
1760
|
+
"""
|
|
1761
|
+
Get the revision number of the last synchronized record
|
|
1762
|
+
"""
|
|
1763
|
+
|
|
1764
|
+
raise NotImplementedError
|
|
1765
|
+
def insert_incoming_records(self, records: "typing.List[Record]"):
|
|
1766
|
+
"""
|
|
1767
|
+
Insert incoming records from remote sync
|
|
1768
|
+
"""
|
|
1769
|
+
|
|
1770
|
+
raise NotImplementedError
|
|
1771
|
+
def delete_incoming_record(self, record: "Record"):
|
|
1772
|
+
"""
|
|
1773
|
+
Delete an incoming record after it has been processed
|
|
1774
|
+
"""
|
|
1775
|
+
|
|
1776
|
+
raise NotImplementedError
|
|
1777
|
+
def rebase_pending_outgoing_records(self, revision: "int"):
|
|
1778
|
+
"""
|
|
1779
|
+
Update revision numbers of pending outgoing records to be higher than the given revision
|
|
1780
|
+
"""
|
|
1781
|
+
|
|
1782
|
+
raise NotImplementedError
|
|
1783
|
+
def get_incoming_records(self, limit: "int"):
|
|
1784
|
+
"""
|
|
1785
|
+
Get incoming records that need to be processed, up to the specified limit
|
|
1786
|
+
"""
|
|
1787
|
+
|
|
1788
|
+
raise NotImplementedError
|
|
1789
|
+
def get_latest_outgoing_change(self, ):
|
|
1790
|
+
"""
|
|
1791
|
+
Get the latest outgoing record if any exists
|
|
1792
|
+
"""
|
|
1793
|
+
|
|
1794
|
+
raise NotImplementedError
|
|
1795
|
+
def update_record_from_incoming(self, record: "Record"):
|
|
1796
|
+
"""
|
|
1797
|
+
Update the sync state record from an incoming record
|
|
1798
|
+
"""
|
|
1799
|
+
|
|
1800
|
+
raise NotImplementedError
|
|
1801
|
+
|
|
1802
|
+
|
|
1803
|
+
class SyncStorageImpl:
|
|
1804
|
+
_pointer: ctypes.c_void_p
|
|
1805
|
+
|
|
1806
|
+
def __init__(self, *args, **kwargs):
|
|
1807
|
+
raise ValueError("This class has no default constructor")
|
|
1808
|
+
|
|
1809
|
+
def __del__(self):
|
|
1810
|
+
# In case of partial initialization of instances.
|
|
1811
|
+
pointer = getattr(self, "_pointer", None)
|
|
1812
|
+
if pointer is not None:
|
|
1813
|
+
_uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_free_syncstorage, pointer)
|
|
1814
|
+
|
|
1815
|
+
def _uniffi_clone_pointer(self):
|
|
1816
|
+
return _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_clone_syncstorage, self._pointer)
|
|
1817
|
+
|
|
1818
|
+
# Used by alternative constructors or any methods which return this type.
|
|
1819
|
+
@classmethod
|
|
1820
|
+
def _make_instance_(cls, pointer):
|
|
1821
|
+
# Lightly yucky way to bypass the usual __init__ logic
|
|
1822
|
+
# and just create a new instance with the required pointer.
|
|
1823
|
+
inst = cls.__new__(cls)
|
|
1824
|
+
inst._pointer = pointer
|
|
1825
|
+
return inst
|
|
1826
|
+
|
|
1827
|
+
async def add_outgoing_change(self, record: "UnversionedRecordChange") -> "int":
|
|
1828
|
+
_UniffiConverterTypeUnversionedRecordChange.check_lower(record)
|
|
1829
|
+
|
|
1830
|
+
return await _uniffi_rust_call_async(
|
|
1831
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_add_outgoing_change(
|
|
1832
|
+
self._uniffi_clone_pointer(),
|
|
1833
|
+
_UniffiConverterTypeUnversionedRecordChange.lower(record)
|
|
1834
|
+
),
|
|
1835
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_u64,
|
|
1836
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_u64,
|
|
1837
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_u64,
|
|
1838
|
+
# lift function
|
|
1839
|
+
_UniffiConverterUInt64.lift,
|
|
1840
|
+
|
|
1841
|
+
# Error FFI converter
|
|
1842
|
+
_UniffiConverterTypeSyncStorageError,
|
|
1843
|
+
|
|
1844
|
+
)
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
async def complete_outgoing_sync(self, record: "Record") -> None:
|
|
1849
|
+
|
|
1850
|
+
_UniffiConverterTypeRecord.check_lower(record)
|
|
1851
|
+
|
|
1852
|
+
return await _uniffi_rust_call_async(
|
|
1853
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_complete_outgoing_sync(
|
|
1854
|
+
self._uniffi_clone_pointer(),
|
|
1855
|
+
_UniffiConverterTypeRecord.lower(record)
|
|
1856
|
+
),
|
|
1857
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_void,
|
|
1858
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_void,
|
|
1859
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_void,
|
|
1860
|
+
# lift function
|
|
1861
|
+
lambda val: None,
|
|
1862
|
+
|
|
1863
|
+
|
|
1864
|
+
# Error FFI converter
|
|
1865
|
+
_UniffiConverterTypeSyncStorageError,
|
|
1866
|
+
|
|
1867
|
+
)
|
|
1868
|
+
|
|
1869
|
+
|
|
1870
|
+
|
|
1871
|
+
async def get_pending_outgoing_changes(self, limit: "int") -> "typing.List[OutgoingChange]":
|
|
1872
|
+
_UniffiConverterUInt32.check_lower(limit)
|
|
1873
|
+
|
|
1874
|
+
return await _uniffi_rust_call_async(
|
|
1875
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_pending_outgoing_changes(
|
|
1876
|
+
self._uniffi_clone_pointer(),
|
|
1877
|
+
_UniffiConverterUInt32.lower(limit)
|
|
1878
|
+
),
|
|
1879
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1880
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1881
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1882
|
+
# lift function
|
|
1883
|
+
_UniffiConverterSequenceTypeOutgoingChange.lift,
|
|
1884
|
+
|
|
1885
|
+
# Error FFI converter
|
|
1886
|
+
_UniffiConverterTypeSyncStorageError,
|
|
1887
|
+
|
|
1888
|
+
)
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+
|
|
1892
|
+
async def get_last_revision(self, ) -> "int":
|
|
1893
|
+
"""
|
|
1894
|
+
Get the revision number of the last synchronized record
|
|
1895
|
+
"""
|
|
1896
|
+
|
|
1897
|
+
return await _uniffi_rust_call_async(
|
|
1898
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_last_revision(
|
|
1899
|
+
self._uniffi_clone_pointer(),
|
|
1900
|
+
),
|
|
1901
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_u64,
|
|
1902
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_u64,
|
|
1903
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_u64,
|
|
1904
|
+
# lift function
|
|
1905
|
+
_UniffiConverterUInt64.lift,
|
|
1906
|
+
|
|
1907
|
+
# Error FFI converter
|
|
1908
|
+
_UniffiConverterTypeSyncStorageError,
|
|
1909
|
+
|
|
1910
|
+
)
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
|
|
1914
|
+
async def insert_incoming_records(self, records: "typing.List[Record]") -> None:
|
|
1915
|
+
|
|
1916
|
+
"""
|
|
1917
|
+
Insert incoming records from remote sync
|
|
1918
|
+
"""
|
|
1919
|
+
|
|
1920
|
+
_UniffiConverterSequenceTypeRecord.check_lower(records)
|
|
1921
|
+
|
|
1922
|
+
return await _uniffi_rust_call_async(
|
|
1923
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_insert_incoming_records(
|
|
1924
|
+
self._uniffi_clone_pointer(),
|
|
1925
|
+
_UniffiConverterSequenceTypeRecord.lower(records)
|
|
1926
|
+
),
|
|
1927
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_void,
|
|
1928
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_void,
|
|
1929
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_void,
|
|
1930
|
+
# lift function
|
|
1931
|
+
lambda val: None,
|
|
1932
|
+
|
|
1933
|
+
|
|
1934
|
+
# Error FFI converter
|
|
1935
|
+
_UniffiConverterTypeSyncStorageError,
|
|
1936
|
+
|
|
1937
|
+
)
|
|
1938
|
+
|
|
1939
|
+
|
|
1940
|
+
|
|
1941
|
+
async def delete_incoming_record(self, record: "Record") -> None:
|
|
1942
|
+
|
|
1943
|
+
"""
|
|
1944
|
+
Delete an incoming record after it has been processed
|
|
1945
|
+
"""
|
|
1946
|
+
|
|
1947
|
+
_UniffiConverterTypeRecord.check_lower(record)
|
|
1948
|
+
|
|
1949
|
+
return await _uniffi_rust_call_async(
|
|
1950
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_delete_incoming_record(
|
|
1951
|
+
self._uniffi_clone_pointer(),
|
|
1952
|
+
_UniffiConverterTypeRecord.lower(record)
|
|
1953
|
+
),
|
|
1954
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_void,
|
|
1955
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_void,
|
|
1956
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_void,
|
|
1957
|
+
# lift function
|
|
1958
|
+
lambda val: None,
|
|
1959
|
+
|
|
1960
|
+
|
|
1961
|
+
# Error FFI converter
|
|
1962
|
+
_UniffiConverterTypeSyncStorageError,
|
|
1963
|
+
|
|
1964
|
+
)
|
|
1965
|
+
|
|
1966
|
+
|
|
1967
|
+
|
|
1968
|
+
async def rebase_pending_outgoing_records(self, revision: "int") -> None:
|
|
1969
|
+
|
|
1970
|
+
"""
|
|
1971
|
+
Update revision numbers of pending outgoing records to be higher than the given revision
|
|
1972
|
+
"""
|
|
1973
|
+
|
|
1974
|
+
_UniffiConverterUInt64.check_lower(revision)
|
|
1975
|
+
|
|
1976
|
+
return await _uniffi_rust_call_async(
|
|
1977
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_rebase_pending_outgoing_records(
|
|
1978
|
+
self._uniffi_clone_pointer(),
|
|
1979
|
+
_UniffiConverterUInt64.lower(revision)
|
|
1980
|
+
),
|
|
1981
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_void,
|
|
1982
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_void,
|
|
1983
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_void,
|
|
1984
|
+
# lift function
|
|
1985
|
+
lambda val: None,
|
|
1986
|
+
|
|
1987
|
+
|
|
1988
|
+
# Error FFI converter
|
|
1989
|
+
_UniffiConverterTypeSyncStorageError,
|
|
1990
|
+
|
|
1991
|
+
)
|
|
1992
|
+
|
|
1993
|
+
|
|
1994
|
+
|
|
1995
|
+
async def get_incoming_records(self, limit: "int") -> "typing.List[IncomingChange]":
|
|
1996
|
+
"""
|
|
1997
|
+
Get incoming records that need to be processed, up to the specified limit
|
|
1998
|
+
"""
|
|
1999
|
+
|
|
2000
|
+
_UniffiConverterUInt32.check_lower(limit)
|
|
2001
|
+
|
|
2002
|
+
return await _uniffi_rust_call_async(
|
|
2003
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_incoming_records(
|
|
2004
|
+
self._uniffi_clone_pointer(),
|
|
2005
|
+
_UniffiConverterUInt32.lower(limit)
|
|
2006
|
+
),
|
|
2007
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
2008
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
2009
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
2010
|
+
# lift function
|
|
2011
|
+
_UniffiConverterSequenceTypeIncomingChange.lift,
|
|
2012
|
+
|
|
2013
|
+
# Error FFI converter
|
|
2014
|
+
_UniffiConverterTypeSyncStorageError,
|
|
2015
|
+
|
|
2016
|
+
)
|
|
2017
|
+
|
|
2018
|
+
|
|
2019
|
+
|
|
2020
|
+
async def get_latest_outgoing_change(self, ) -> "typing.Optional[OutgoingChange]":
|
|
2021
|
+
"""
|
|
2022
|
+
Get the latest outgoing record if any exists
|
|
2023
|
+
"""
|
|
2024
|
+
|
|
2025
|
+
return await _uniffi_rust_call_async(
|
|
2026
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_get_latest_outgoing_change(
|
|
2027
|
+
self._uniffi_clone_pointer(),
|
|
2028
|
+
),
|
|
2029
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
2030
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
2031
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
2032
|
+
# lift function
|
|
2033
|
+
_UniffiConverterOptionalTypeOutgoingChange.lift,
|
|
2034
|
+
|
|
2035
|
+
# Error FFI converter
|
|
2036
|
+
_UniffiConverterTypeSyncStorageError,
|
|
2037
|
+
|
|
2038
|
+
)
|
|
2039
|
+
|
|
2040
|
+
|
|
2041
|
+
|
|
2042
|
+
async def update_record_from_incoming(self, record: "Record") -> None:
|
|
2043
|
+
|
|
2044
|
+
"""
|
|
2045
|
+
Update the sync state record from an incoming record
|
|
2046
|
+
"""
|
|
2047
|
+
|
|
2048
|
+
_UniffiConverterTypeRecord.check_lower(record)
|
|
2049
|
+
|
|
2050
|
+
return await _uniffi_rust_call_async(
|
|
2051
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_syncstorage_update_record_from_incoming(
|
|
2052
|
+
self._uniffi_clone_pointer(),
|
|
2053
|
+
_UniffiConverterTypeRecord.lower(record)
|
|
2054
|
+
),
|
|
2055
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_void,
|
|
2056
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_void,
|
|
2057
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_void,
|
|
2058
|
+
# lift function
|
|
2059
|
+
lambda val: None,
|
|
2060
|
+
|
|
2061
|
+
|
|
2062
|
+
# Error FFI converter
|
|
2063
|
+
_UniffiConverterTypeSyncStorageError,
|
|
2064
|
+
|
|
2065
|
+
)
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
|
|
2069
|
+
|
|
2070
|
+
# Put all the bits inside a class to keep the top-level namespace clean
|
|
2071
|
+
class _UniffiTraitImplSyncStorage:
|
|
2072
|
+
# For each method, generate a callback function to pass to Rust
|
|
2073
|
+
|
|
2074
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD0
|
|
2075
|
+
def add_outgoing_change(
|
|
2076
|
+
uniffi_handle,
|
|
2077
|
+
record,
|
|
2078
|
+
uniffi_future_callback,
|
|
2079
|
+
uniffi_callback_data,
|
|
2080
|
+
uniffi_out_return,
|
|
2081
|
+
):
|
|
2082
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
2083
|
+
def make_call():
|
|
2084
|
+
args = (_UniffiConverterTypeUnversionedRecordChange.lift(record), )
|
|
2085
|
+
method = uniffi_obj.add_outgoing_change
|
|
2086
|
+
return method(*args)
|
|
2087
|
+
|
|
2088
|
+
|
|
2089
|
+
def handle_success(return_value):
|
|
2090
|
+
uniffi_future_callback(
|
|
2091
|
+
uniffi_callback_data,
|
|
2092
|
+
_UniffiForeignFutureStructU64(
|
|
2093
|
+
_UniffiConverterUInt64.lower(return_value),
|
|
2094
|
+
_UniffiRustCallStatus.default()
|
|
2095
|
+
)
|
|
2096
|
+
)
|
|
2097
|
+
|
|
2098
|
+
def handle_error(status_code, rust_buffer):
|
|
2099
|
+
uniffi_future_callback(
|
|
2100
|
+
uniffi_callback_data,
|
|
2101
|
+
_UniffiForeignFutureStructU64(
|
|
2102
|
+
0,
|
|
2103
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
2104
|
+
)
|
|
2105
|
+
)
|
|
2106
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
2107
|
+
|
|
2108
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD1
|
|
2109
|
+
def complete_outgoing_sync(
|
|
2110
|
+
uniffi_handle,
|
|
2111
|
+
record,
|
|
2112
|
+
uniffi_future_callback,
|
|
2113
|
+
uniffi_callback_data,
|
|
2114
|
+
uniffi_out_return,
|
|
2115
|
+
):
|
|
2116
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
2117
|
+
def make_call():
|
|
2118
|
+
args = (_UniffiConverterTypeRecord.lift(record), )
|
|
2119
|
+
method = uniffi_obj.complete_outgoing_sync
|
|
2120
|
+
return method(*args)
|
|
2121
|
+
|
|
2122
|
+
|
|
2123
|
+
def handle_success(return_value):
|
|
2124
|
+
uniffi_future_callback(
|
|
2125
|
+
uniffi_callback_data,
|
|
2126
|
+
_UniffiForeignFutureStructVoid(
|
|
2127
|
+
_UniffiRustCallStatus.default()
|
|
2128
|
+
)
|
|
2129
|
+
)
|
|
2130
|
+
|
|
2131
|
+
def handle_error(status_code, rust_buffer):
|
|
2132
|
+
uniffi_future_callback(
|
|
2133
|
+
uniffi_callback_data,
|
|
2134
|
+
_UniffiForeignFutureStructVoid(
|
|
2135
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
2136
|
+
)
|
|
2137
|
+
)
|
|
2138
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
2139
|
+
|
|
2140
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD2
|
|
2141
|
+
def get_pending_outgoing_changes(
|
|
2142
|
+
uniffi_handle,
|
|
2143
|
+
limit,
|
|
2144
|
+
uniffi_future_callback,
|
|
2145
|
+
uniffi_callback_data,
|
|
2146
|
+
uniffi_out_return,
|
|
2147
|
+
):
|
|
2148
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
2149
|
+
def make_call():
|
|
2150
|
+
args = (_UniffiConverterUInt32.lift(limit), )
|
|
2151
|
+
method = uniffi_obj.get_pending_outgoing_changes
|
|
2152
|
+
return method(*args)
|
|
2153
|
+
|
|
2154
|
+
|
|
2155
|
+
def handle_success(return_value):
|
|
2156
|
+
uniffi_future_callback(
|
|
2157
|
+
uniffi_callback_data,
|
|
2158
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
2159
|
+
_UniffiConverterSequenceTypeOutgoingChange.lower(return_value),
|
|
2160
|
+
_UniffiRustCallStatus.default()
|
|
2161
|
+
)
|
|
2162
|
+
)
|
|
2163
|
+
|
|
2164
|
+
def handle_error(status_code, rust_buffer):
|
|
2165
|
+
uniffi_future_callback(
|
|
2166
|
+
uniffi_callback_data,
|
|
2167
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
2168
|
+
_UniffiRustBuffer.default(),
|
|
2169
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
2170
|
+
)
|
|
2171
|
+
)
|
|
2172
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
2173
|
+
|
|
2174
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD3
|
|
2175
|
+
def get_last_revision(
|
|
2176
|
+
uniffi_handle,
|
|
2177
|
+
uniffi_future_callback,
|
|
2178
|
+
uniffi_callback_data,
|
|
2179
|
+
uniffi_out_return,
|
|
2180
|
+
):
|
|
2181
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
2182
|
+
def make_call():
|
|
2183
|
+
args = ()
|
|
2184
|
+
method = uniffi_obj.get_last_revision
|
|
2185
|
+
return method(*args)
|
|
2186
|
+
|
|
2187
|
+
|
|
2188
|
+
def handle_success(return_value):
|
|
2189
|
+
uniffi_future_callback(
|
|
2190
|
+
uniffi_callback_data,
|
|
2191
|
+
_UniffiForeignFutureStructU64(
|
|
2192
|
+
_UniffiConverterUInt64.lower(return_value),
|
|
2193
|
+
_UniffiRustCallStatus.default()
|
|
2194
|
+
)
|
|
2195
|
+
)
|
|
2196
|
+
|
|
2197
|
+
def handle_error(status_code, rust_buffer):
|
|
2198
|
+
uniffi_future_callback(
|
|
2199
|
+
uniffi_callback_data,
|
|
2200
|
+
_UniffiForeignFutureStructU64(
|
|
2201
|
+
0,
|
|
2202
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
2203
|
+
)
|
|
2204
|
+
)
|
|
2205
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
2206
|
+
|
|
2207
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD4
|
|
2208
|
+
def insert_incoming_records(
|
|
2209
|
+
uniffi_handle,
|
|
2210
|
+
records,
|
|
2211
|
+
uniffi_future_callback,
|
|
2212
|
+
uniffi_callback_data,
|
|
2213
|
+
uniffi_out_return,
|
|
2214
|
+
):
|
|
2215
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
2216
|
+
def make_call():
|
|
2217
|
+
args = (_UniffiConverterSequenceTypeRecord.lift(records), )
|
|
2218
|
+
method = uniffi_obj.insert_incoming_records
|
|
2219
|
+
return method(*args)
|
|
2220
|
+
|
|
2221
|
+
|
|
2222
|
+
def handle_success(return_value):
|
|
2223
|
+
uniffi_future_callback(
|
|
2224
|
+
uniffi_callback_data,
|
|
2225
|
+
_UniffiForeignFutureStructVoid(
|
|
2226
|
+
_UniffiRustCallStatus.default()
|
|
2227
|
+
)
|
|
2228
|
+
)
|
|
1179
2229
|
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
2230
|
+
def handle_error(status_code, rust_buffer):
|
|
2231
|
+
uniffi_future_callback(
|
|
2232
|
+
uniffi_callback_data,
|
|
2233
|
+
_UniffiForeignFutureStructVoid(
|
|
2234
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
2235
|
+
)
|
|
2236
|
+
)
|
|
2237
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
1183
2238
|
|
|
1184
|
-
@
|
|
1185
|
-
def
|
|
1186
|
-
|
|
1187
|
-
|
|
2239
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD5
|
|
2240
|
+
def delete_incoming_record(
|
|
2241
|
+
uniffi_handle,
|
|
2242
|
+
record,
|
|
2243
|
+
uniffi_future_callback,
|
|
2244
|
+
uniffi_callback_data,
|
|
2245
|
+
uniffi_out_return,
|
|
2246
|
+
):
|
|
2247
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
2248
|
+
def make_call():
|
|
2249
|
+
args = (_UniffiConverterTypeRecord.lift(record), )
|
|
2250
|
+
method = uniffi_obj.delete_incoming_record
|
|
2251
|
+
return method(*args)
|
|
1188
2252
|
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
2253
|
+
|
|
2254
|
+
def handle_success(return_value):
|
|
2255
|
+
uniffi_future_callback(
|
|
2256
|
+
uniffi_callback_data,
|
|
2257
|
+
_UniffiForeignFutureStructVoid(
|
|
2258
|
+
_UniffiRustCallStatus.default()
|
|
2259
|
+
)
|
|
2260
|
+
)
|
|
1192
2261
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
2262
|
+
def handle_error(status_code, rust_buffer):
|
|
2263
|
+
uniffi_future_callback(
|
|
2264
|
+
uniffi_callback_data,
|
|
2265
|
+
_UniffiForeignFutureStructVoid(
|
|
2266
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
2267
|
+
)
|
|
2268
|
+
)
|
|
2269
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
1197
2270
|
|
|
1198
|
-
@
|
|
1199
|
-
def
|
|
1200
|
-
|
|
2271
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD6
|
|
2272
|
+
def rebase_pending_outgoing_records(
|
|
2273
|
+
uniffi_handle,
|
|
2274
|
+
revision,
|
|
2275
|
+
uniffi_future_callback,
|
|
2276
|
+
uniffi_callback_data,
|
|
2277
|
+
uniffi_out_return,
|
|
2278
|
+
):
|
|
2279
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
2280
|
+
def make_call():
|
|
2281
|
+
args = (_UniffiConverterUInt64.lift(revision), )
|
|
2282
|
+
method = uniffi_obj.rebase_pending_outgoing_records
|
|
2283
|
+
return method(*args)
|
|
1201
2284
|
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
2285
|
+
|
|
2286
|
+
def handle_success(return_value):
|
|
2287
|
+
uniffi_future_callback(
|
|
2288
|
+
uniffi_callback_data,
|
|
2289
|
+
_UniffiForeignFutureStructVoid(
|
|
2290
|
+
_UniffiRustCallStatus.default()
|
|
2291
|
+
)
|
|
2292
|
+
)
|
|
1205
2293
|
|
|
1206
|
-
|
|
1207
|
-
|
|
2294
|
+
def handle_error(status_code, rust_buffer):
|
|
2295
|
+
uniffi_future_callback(
|
|
2296
|
+
uniffi_callback_data,
|
|
2297
|
+
_UniffiForeignFutureStructVoid(
|
|
2298
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
2299
|
+
)
|
|
2300
|
+
)
|
|
2301
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
2302
|
+
|
|
2303
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD7
|
|
2304
|
+
def get_incoming_records(
|
|
1208
2305
|
uniffi_handle,
|
|
1209
|
-
|
|
1210
|
-
headers,
|
|
2306
|
+
limit,
|
|
1211
2307
|
uniffi_future_callback,
|
|
1212
2308
|
uniffi_callback_data,
|
|
1213
2309
|
uniffi_out_return,
|
|
1214
2310
|
):
|
|
1215
|
-
uniffi_obj =
|
|
2311
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
1216
2312
|
def make_call():
|
|
1217
|
-
args = (
|
|
1218
|
-
method = uniffi_obj.
|
|
2313
|
+
args = (_UniffiConverterUInt32.lift(limit), )
|
|
2314
|
+
method = uniffi_obj.get_incoming_records
|
|
1219
2315
|
return method(*args)
|
|
1220
2316
|
|
|
1221
2317
|
|
|
@@ -1223,7 +2319,7 @@ class _UniffiTraitImplRestClient:
|
|
|
1223
2319
|
uniffi_future_callback(
|
|
1224
2320
|
uniffi_callback_data,
|
|
1225
2321
|
_UniffiForeignFutureStructRustBuffer(
|
|
1226
|
-
|
|
2322
|
+
_UniffiConverterSequenceTypeIncomingChange.lower(return_value),
|
|
1227
2323
|
_UniffiRustCallStatus.default()
|
|
1228
2324
|
)
|
|
1229
2325
|
)
|
|
@@ -1236,22 +2332,19 @@ class _UniffiTraitImplRestClient:
|
|
|
1236
2332
|
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1237
2333
|
)
|
|
1238
2334
|
)
|
|
1239
|
-
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error,
|
|
2335
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
1240
2336
|
|
|
1241
|
-
@
|
|
1242
|
-
def
|
|
2337
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD8
|
|
2338
|
+
def get_latest_outgoing_change(
|
|
1243
2339
|
uniffi_handle,
|
|
1244
|
-
url,
|
|
1245
|
-
headers,
|
|
1246
|
-
body,
|
|
1247
2340
|
uniffi_future_callback,
|
|
1248
2341
|
uniffi_callback_data,
|
|
1249
2342
|
uniffi_out_return,
|
|
1250
2343
|
):
|
|
1251
|
-
uniffi_obj =
|
|
2344
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
1252
2345
|
def make_call():
|
|
1253
|
-
args = (
|
|
1254
|
-
method = uniffi_obj.
|
|
2346
|
+
args = ()
|
|
2347
|
+
method = uniffi_obj.get_latest_outgoing_change
|
|
1255
2348
|
return method(*args)
|
|
1256
2349
|
|
|
1257
2350
|
|
|
@@ -1259,7 +2352,7 @@ class _UniffiTraitImplRestClient:
|
|
|
1259
2352
|
uniffi_future_callback(
|
|
1260
2353
|
uniffi_callback_data,
|
|
1261
2354
|
_UniffiForeignFutureStructRustBuffer(
|
|
1262
|
-
|
|
2355
|
+
_UniffiConverterOptionalTypeOutgoingChange.lower(return_value),
|
|
1263
2356
|
_UniffiRustCallStatus.default()
|
|
1264
2357
|
)
|
|
1265
2358
|
)
|
|
@@ -1272,30 +2365,27 @@ class _UniffiTraitImplRestClient:
|
|
|
1272
2365
|
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1273
2366
|
)
|
|
1274
2367
|
)
|
|
1275
|
-
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error,
|
|
2368
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
1276
2369
|
|
|
1277
|
-
@
|
|
1278
|
-
def
|
|
2370
|
+
@_UNIFFI_CALLBACK_INTERFACE_SYNC_STORAGE_METHOD9
|
|
2371
|
+
def update_record_from_incoming(
|
|
1279
2372
|
uniffi_handle,
|
|
1280
|
-
|
|
1281
|
-
headers,
|
|
1282
|
-
body,
|
|
2373
|
+
record,
|
|
1283
2374
|
uniffi_future_callback,
|
|
1284
2375
|
uniffi_callback_data,
|
|
1285
2376
|
uniffi_out_return,
|
|
1286
2377
|
):
|
|
1287
|
-
uniffi_obj =
|
|
2378
|
+
uniffi_obj = _UniffiConverterTypeSyncStorage._handle_map.get(uniffi_handle)
|
|
1288
2379
|
def make_call():
|
|
1289
|
-
args = (
|
|
1290
|
-
method = uniffi_obj.
|
|
2380
|
+
args = (_UniffiConverterTypeRecord.lift(record), )
|
|
2381
|
+
method = uniffi_obj.update_record_from_incoming
|
|
1291
2382
|
return method(*args)
|
|
1292
2383
|
|
|
1293
2384
|
|
|
1294
2385
|
def handle_success(return_value):
|
|
1295
2386
|
uniffi_future_callback(
|
|
1296
2387
|
uniffi_callback_data,
|
|
1297
|
-
|
|
1298
|
-
_UniffiConverterTypeRestResponse.lower(return_value),
|
|
2388
|
+
_UniffiForeignFutureStructVoid(
|
|
1299
2389
|
_UniffiRustCallStatus.default()
|
|
1300
2390
|
)
|
|
1301
2391
|
)
|
|
@@ -1303,44 +2393,50 @@ class _UniffiTraitImplRestClient:
|
|
|
1303
2393
|
def handle_error(status_code, rust_buffer):
|
|
1304
2394
|
uniffi_future_callback(
|
|
1305
2395
|
uniffi_callback_data,
|
|
1306
|
-
|
|
1307
|
-
_UniffiRustBuffer.default(),
|
|
2396
|
+
_UniffiForeignFutureStructVoid(
|
|
1308
2397
|
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1309
2398
|
)
|
|
1310
2399
|
)
|
|
1311
|
-
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error,
|
|
2400
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, SyncStorageError, _UniffiConverterTypeSyncStorageError.lower)
|
|
1312
2401
|
|
|
1313
2402
|
@_UNIFFI_CALLBACK_INTERFACE_FREE
|
|
1314
2403
|
def _uniffi_free(uniffi_handle):
|
|
1315
|
-
|
|
2404
|
+
_UniffiConverterTypeSyncStorage._handle_map.remove(uniffi_handle)
|
|
1316
2405
|
|
|
1317
2406
|
# Generate the FFI VTable. This has a field for each callback interface method.
|
|
1318
|
-
_uniffi_vtable =
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
2407
|
+
_uniffi_vtable = _UniffiVTableCallbackInterfaceSyncStorage(
|
|
2408
|
+
add_outgoing_change,
|
|
2409
|
+
complete_outgoing_sync,
|
|
2410
|
+
get_pending_outgoing_changes,
|
|
2411
|
+
get_last_revision,
|
|
2412
|
+
insert_incoming_records,
|
|
2413
|
+
delete_incoming_record,
|
|
2414
|
+
rebase_pending_outgoing_records,
|
|
2415
|
+
get_incoming_records,
|
|
2416
|
+
get_latest_outgoing_change,
|
|
2417
|
+
update_record_from_incoming,
|
|
1322
2418
|
_uniffi_free
|
|
1323
2419
|
)
|
|
1324
2420
|
# Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever,
|
|
1325
2421
|
# or else bad things will happen when Rust tries to access it.
|
|
1326
|
-
_UniffiLib.
|
|
2422
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_syncstorage(ctypes.byref(_uniffi_vtable))
|
|
1327
2423
|
|
|
1328
2424
|
|
|
1329
2425
|
|
|
1330
|
-
class
|
|
2426
|
+
class _UniffiConverterTypeSyncStorage:
|
|
1331
2427
|
_handle_map = _UniffiHandleMap()
|
|
1332
2428
|
|
|
1333
2429
|
@staticmethod
|
|
1334
2430
|
def lift(value: int):
|
|
1335
|
-
return
|
|
2431
|
+
return SyncStorageImpl._make_instance_(value)
|
|
1336
2432
|
|
|
1337
2433
|
@staticmethod
|
|
1338
|
-
def check_lower(value:
|
|
2434
|
+
def check_lower(value: SyncStorage):
|
|
1339
2435
|
pass
|
|
1340
2436
|
|
|
1341
2437
|
@staticmethod
|
|
1342
|
-
def lower(value:
|
|
1343
|
-
return
|
|
2438
|
+
def lower(value: SyncStorage):
|
|
2439
|
+
return _UniffiConverterTypeSyncStorage._handle_map.insert(value)
|
|
1344
2440
|
|
|
1345
2441
|
@classmethod
|
|
1346
2442
|
def read(cls, buf: _UniffiRustBuffer):
|
|
@@ -1350,7 +2446,7 @@ class _UniffiConverterTypeRestClient:
|
|
|
1350
2446
|
return cls.lift(ptr)
|
|
1351
2447
|
|
|
1352
2448
|
@classmethod
|
|
1353
|
-
def write(cls, value:
|
|
2449
|
+
def write(cls, value: SyncStorage, buf: _UniffiRustBuffer):
|
|
1354
2450
|
buf.write_u64(cls.lower(value))
|
|
1355
2451
|
|
|
1356
2452
|
|
|
@@ -2192,6 +3288,66 @@ class _UniffiConverterTypeCurrencyInfo(_UniffiConverterRustBuffer):
|
|
|
2192
3288
|
_UniffiConverterSequenceTypeLocaleOverrides.write(value.locale_overrides, buf)
|
|
2193
3289
|
|
|
2194
3290
|
|
|
3291
|
+
class ExternalInputParser:
|
|
3292
|
+
"""
|
|
3293
|
+
Configuration for an external input parser
|
|
3294
|
+
"""
|
|
3295
|
+
|
|
3296
|
+
provider_id: "str"
|
|
3297
|
+
"""
|
|
3298
|
+
An arbitrary parser provider id
|
|
3299
|
+
"""
|
|
3300
|
+
|
|
3301
|
+
input_regex: "str"
|
|
3302
|
+
"""
|
|
3303
|
+
The external parser will be used when an input conforms to this regex
|
|
3304
|
+
"""
|
|
3305
|
+
|
|
3306
|
+
parser_url: "str"
|
|
3307
|
+
"""
|
|
3308
|
+
The URL of the parser containing a placeholder `<input>` that will be replaced with the
|
|
3309
|
+
input to be parsed. The input is sanitized using percent encoding.
|
|
3310
|
+
"""
|
|
3311
|
+
|
|
3312
|
+
def __init__(self, *, provider_id: "str", input_regex: "str", parser_url: "str"):
|
|
3313
|
+
self.provider_id = provider_id
|
|
3314
|
+
self.input_regex = input_regex
|
|
3315
|
+
self.parser_url = parser_url
|
|
3316
|
+
|
|
3317
|
+
def __str__(self):
|
|
3318
|
+
return "ExternalInputParser(provider_id={}, input_regex={}, parser_url={})".format(self.provider_id, self.input_regex, self.parser_url)
|
|
3319
|
+
|
|
3320
|
+
def __eq__(self, other):
|
|
3321
|
+
if self.provider_id != other.provider_id:
|
|
3322
|
+
return False
|
|
3323
|
+
if self.input_regex != other.input_regex:
|
|
3324
|
+
return False
|
|
3325
|
+
if self.parser_url != other.parser_url:
|
|
3326
|
+
return False
|
|
3327
|
+
return True
|
|
3328
|
+
|
|
3329
|
+
class _UniffiConverterTypeExternalInputParser(_UniffiConverterRustBuffer):
|
|
3330
|
+
@staticmethod
|
|
3331
|
+
def read(buf):
|
|
3332
|
+
return ExternalInputParser(
|
|
3333
|
+
provider_id=_UniffiConverterString.read(buf),
|
|
3334
|
+
input_regex=_UniffiConverterString.read(buf),
|
|
3335
|
+
parser_url=_UniffiConverterString.read(buf),
|
|
3336
|
+
)
|
|
3337
|
+
|
|
3338
|
+
@staticmethod
|
|
3339
|
+
def check_lower(value):
|
|
3340
|
+
_UniffiConverterString.check_lower(value.provider_id)
|
|
3341
|
+
_UniffiConverterString.check_lower(value.input_regex)
|
|
3342
|
+
_UniffiConverterString.check_lower(value.parser_url)
|
|
3343
|
+
|
|
3344
|
+
@staticmethod
|
|
3345
|
+
def write(value, buf):
|
|
3346
|
+
_UniffiConverterString.write(value.provider_id, buf)
|
|
3347
|
+
_UniffiConverterString.write(value.input_regex, buf)
|
|
3348
|
+
_UniffiConverterString.write(value.parser_url, buf)
|
|
3349
|
+
|
|
3350
|
+
|
|
2195
3351
|
class FiatCurrency:
|
|
2196
3352
|
"""
|
|
2197
3353
|
Wrapper around the [`CurrencyInfo`] of a fiat currency
|
|
@@ -2232,6 +3388,42 @@ class _UniffiConverterTypeFiatCurrency(_UniffiConverterRustBuffer):
|
|
|
2232
3388
|
_UniffiConverterTypeCurrencyInfo.write(value.info, buf)
|
|
2233
3389
|
|
|
2234
3390
|
|
|
3391
|
+
class IncomingChange:
|
|
3392
|
+
new_state: "Record"
|
|
3393
|
+
old_state: "typing.Optional[Record]"
|
|
3394
|
+
def __init__(self, *, new_state: "Record", old_state: "typing.Optional[Record]"):
|
|
3395
|
+
self.new_state = new_state
|
|
3396
|
+
self.old_state = old_state
|
|
3397
|
+
|
|
3398
|
+
def __str__(self):
|
|
3399
|
+
return "IncomingChange(new_state={}, old_state={})".format(self.new_state, self.old_state)
|
|
3400
|
+
|
|
3401
|
+
def __eq__(self, other):
|
|
3402
|
+
if self.new_state != other.new_state:
|
|
3403
|
+
return False
|
|
3404
|
+
if self.old_state != other.old_state:
|
|
3405
|
+
return False
|
|
3406
|
+
return True
|
|
3407
|
+
|
|
3408
|
+
class _UniffiConverterTypeIncomingChange(_UniffiConverterRustBuffer):
|
|
3409
|
+
@staticmethod
|
|
3410
|
+
def read(buf):
|
|
3411
|
+
return IncomingChange(
|
|
3412
|
+
new_state=_UniffiConverterTypeRecord.read(buf),
|
|
3413
|
+
old_state=_UniffiConverterOptionalTypeRecord.read(buf),
|
|
3414
|
+
)
|
|
3415
|
+
|
|
3416
|
+
@staticmethod
|
|
3417
|
+
def check_lower(value):
|
|
3418
|
+
_UniffiConverterTypeRecord.check_lower(value.new_state)
|
|
3419
|
+
_UniffiConverterOptionalTypeRecord.check_lower(value.old_state)
|
|
3420
|
+
|
|
3421
|
+
@staticmethod
|
|
3422
|
+
def write(value, buf):
|
|
3423
|
+
_UniffiConverterTypeRecord.write(value.new_state, buf)
|
|
3424
|
+
_UniffiConverterOptionalTypeRecord.write(value.old_state, buf)
|
|
3425
|
+
|
|
3426
|
+
|
|
2235
3427
|
class LightningAddressDetails:
|
|
2236
3428
|
address: "str"
|
|
2237
3429
|
pay_request: "LnurlPayRequestDetails"
|
|
@@ -2694,6 +3886,42 @@ class _UniffiConverterTypeMessageSuccessActionData(_UniffiConverterRustBuffer):
|
|
|
2694
3886
|
_UniffiConverterString.write(value.message, buf)
|
|
2695
3887
|
|
|
2696
3888
|
|
|
3889
|
+
class OutgoingChange:
|
|
3890
|
+
change: "RecordChange"
|
|
3891
|
+
parent: "typing.Optional[Record]"
|
|
3892
|
+
def __init__(self, *, change: "RecordChange", parent: "typing.Optional[Record]"):
|
|
3893
|
+
self.change = change
|
|
3894
|
+
self.parent = parent
|
|
3895
|
+
|
|
3896
|
+
def __str__(self):
|
|
3897
|
+
return "OutgoingChange(change={}, parent={})".format(self.change, self.parent)
|
|
3898
|
+
|
|
3899
|
+
def __eq__(self, other):
|
|
3900
|
+
if self.change != other.change:
|
|
3901
|
+
return False
|
|
3902
|
+
if self.parent != other.parent:
|
|
3903
|
+
return False
|
|
3904
|
+
return True
|
|
3905
|
+
|
|
3906
|
+
class _UniffiConverterTypeOutgoingChange(_UniffiConverterRustBuffer):
|
|
3907
|
+
@staticmethod
|
|
3908
|
+
def read(buf):
|
|
3909
|
+
return OutgoingChange(
|
|
3910
|
+
change=_UniffiConverterTypeRecordChange.read(buf),
|
|
3911
|
+
parent=_UniffiConverterOptionalTypeRecord.read(buf),
|
|
3912
|
+
)
|
|
3913
|
+
|
|
3914
|
+
@staticmethod
|
|
3915
|
+
def check_lower(value):
|
|
3916
|
+
_UniffiConverterTypeRecordChange.check_lower(value.change)
|
|
3917
|
+
_UniffiConverterOptionalTypeRecord.check_lower(value.parent)
|
|
3918
|
+
|
|
3919
|
+
@staticmethod
|
|
3920
|
+
def write(value, buf):
|
|
3921
|
+
_UniffiConverterTypeRecordChange.write(value.change, buf)
|
|
3922
|
+
_UniffiConverterOptionalTypeRecord.write(value.parent, buf)
|
|
3923
|
+
|
|
3924
|
+
|
|
2697
3925
|
class PaymentRequestSource:
|
|
2698
3926
|
bip_21_uri: "typing.Optional[str]"
|
|
2699
3927
|
bip_353_address: "typing.Optional[str]"
|
|
@@ -2751,23 +3979,159 @@ class Rate:
|
|
|
2751
3979
|
return False
|
|
2752
3980
|
return True
|
|
2753
3981
|
|
|
2754
|
-
class _UniffiConverterTypeRate(_UniffiConverterRustBuffer):
|
|
3982
|
+
class _UniffiConverterTypeRate(_UniffiConverterRustBuffer):
|
|
3983
|
+
@staticmethod
|
|
3984
|
+
def read(buf):
|
|
3985
|
+
return Rate(
|
|
3986
|
+
coin=_UniffiConverterString.read(buf),
|
|
3987
|
+
value=_UniffiConverterDouble.read(buf),
|
|
3988
|
+
)
|
|
3989
|
+
|
|
3990
|
+
@staticmethod
|
|
3991
|
+
def check_lower(value):
|
|
3992
|
+
_UniffiConverterString.check_lower(value.coin)
|
|
3993
|
+
_UniffiConverterDouble.check_lower(value.value)
|
|
3994
|
+
|
|
3995
|
+
@staticmethod
|
|
3996
|
+
def write(value, buf):
|
|
3997
|
+
_UniffiConverterString.write(value.coin, buf)
|
|
3998
|
+
_UniffiConverterDouble.write(value.value, buf)
|
|
3999
|
+
|
|
4000
|
+
|
|
4001
|
+
class Record:
|
|
4002
|
+
id: "RecordId"
|
|
4003
|
+
revision: "int"
|
|
4004
|
+
schema_version: "str"
|
|
4005
|
+
data: "dict[str, str]"
|
|
4006
|
+
def __init__(self, *, id: "RecordId", revision: "int", schema_version: "str", data: "dict[str, str]"):
|
|
4007
|
+
self.id = id
|
|
4008
|
+
self.revision = revision
|
|
4009
|
+
self.schema_version = schema_version
|
|
4010
|
+
self.data = data
|
|
4011
|
+
|
|
4012
|
+
def __str__(self):
|
|
4013
|
+
return "Record(id={}, revision={}, schema_version={}, data={})".format(self.id, self.revision, self.schema_version, self.data)
|
|
4014
|
+
|
|
4015
|
+
def __eq__(self, other):
|
|
4016
|
+
if self.id != other.id:
|
|
4017
|
+
return False
|
|
4018
|
+
if self.revision != other.revision:
|
|
4019
|
+
return False
|
|
4020
|
+
if self.schema_version != other.schema_version:
|
|
4021
|
+
return False
|
|
4022
|
+
if self.data != other.data:
|
|
4023
|
+
return False
|
|
4024
|
+
return True
|
|
4025
|
+
|
|
4026
|
+
class _UniffiConverterTypeRecord(_UniffiConverterRustBuffer):
|
|
4027
|
+
@staticmethod
|
|
4028
|
+
def read(buf):
|
|
4029
|
+
return Record(
|
|
4030
|
+
id=_UniffiConverterTypeRecordId.read(buf),
|
|
4031
|
+
revision=_UniffiConverterUInt64.read(buf),
|
|
4032
|
+
schema_version=_UniffiConverterString.read(buf),
|
|
4033
|
+
data=_UniffiConverterMapStringString.read(buf),
|
|
4034
|
+
)
|
|
4035
|
+
|
|
4036
|
+
@staticmethod
|
|
4037
|
+
def check_lower(value):
|
|
4038
|
+
_UniffiConverterTypeRecordId.check_lower(value.id)
|
|
4039
|
+
_UniffiConverterUInt64.check_lower(value.revision)
|
|
4040
|
+
_UniffiConverterString.check_lower(value.schema_version)
|
|
4041
|
+
_UniffiConverterMapStringString.check_lower(value.data)
|
|
4042
|
+
|
|
4043
|
+
@staticmethod
|
|
4044
|
+
def write(value, buf):
|
|
4045
|
+
_UniffiConverterTypeRecordId.write(value.id, buf)
|
|
4046
|
+
_UniffiConverterUInt64.write(value.revision, buf)
|
|
4047
|
+
_UniffiConverterString.write(value.schema_version, buf)
|
|
4048
|
+
_UniffiConverterMapStringString.write(value.data, buf)
|
|
4049
|
+
|
|
4050
|
+
|
|
4051
|
+
class RecordChange:
|
|
4052
|
+
id: "RecordId"
|
|
4053
|
+
schema_version: "str"
|
|
4054
|
+
updated_fields: "dict[str, str]"
|
|
4055
|
+
revision: "int"
|
|
4056
|
+
def __init__(self, *, id: "RecordId", schema_version: "str", updated_fields: "dict[str, str]", revision: "int"):
|
|
4057
|
+
self.id = id
|
|
4058
|
+
self.schema_version = schema_version
|
|
4059
|
+
self.updated_fields = updated_fields
|
|
4060
|
+
self.revision = revision
|
|
4061
|
+
|
|
4062
|
+
def __str__(self):
|
|
4063
|
+
return "RecordChange(id={}, schema_version={}, updated_fields={}, revision={})".format(self.id, self.schema_version, self.updated_fields, self.revision)
|
|
4064
|
+
|
|
4065
|
+
def __eq__(self, other):
|
|
4066
|
+
if self.id != other.id:
|
|
4067
|
+
return False
|
|
4068
|
+
if self.schema_version != other.schema_version:
|
|
4069
|
+
return False
|
|
4070
|
+
if self.updated_fields != other.updated_fields:
|
|
4071
|
+
return False
|
|
4072
|
+
if self.revision != other.revision:
|
|
4073
|
+
return False
|
|
4074
|
+
return True
|
|
4075
|
+
|
|
4076
|
+
class _UniffiConverterTypeRecordChange(_UniffiConverterRustBuffer):
|
|
4077
|
+
@staticmethod
|
|
4078
|
+
def read(buf):
|
|
4079
|
+
return RecordChange(
|
|
4080
|
+
id=_UniffiConverterTypeRecordId.read(buf),
|
|
4081
|
+
schema_version=_UniffiConverterString.read(buf),
|
|
4082
|
+
updated_fields=_UniffiConverterMapStringString.read(buf),
|
|
4083
|
+
revision=_UniffiConverterUInt64.read(buf),
|
|
4084
|
+
)
|
|
4085
|
+
|
|
4086
|
+
@staticmethod
|
|
4087
|
+
def check_lower(value):
|
|
4088
|
+
_UniffiConverterTypeRecordId.check_lower(value.id)
|
|
4089
|
+
_UniffiConverterString.check_lower(value.schema_version)
|
|
4090
|
+
_UniffiConverterMapStringString.check_lower(value.updated_fields)
|
|
4091
|
+
_UniffiConverterUInt64.check_lower(value.revision)
|
|
4092
|
+
|
|
4093
|
+
@staticmethod
|
|
4094
|
+
def write(value, buf):
|
|
4095
|
+
_UniffiConverterTypeRecordId.write(value.id, buf)
|
|
4096
|
+
_UniffiConverterString.write(value.schema_version, buf)
|
|
4097
|
+
_UniffiConverterMapStringString.write(value.updated_fields, buf)
|
|
4098
|
+
_UniffiConverterUInt64.write(value.revision, buf)
|
|
4099
|
+
|
|
4100
|
+
|
|
4101
|
+
class RecordId:
|
|
4102
|
+
type: "str"
|
|
4103
|
+
data_id: "str"
|
|
4104
|
+
def __init__(self, *, type: "str", data_id: "str"):
|
|
4105
|
+
self.type = type
|
|
4106
|
+
self.data_id = data_id
|
|
4107
|
+
|
|
4108
|
+
def __str__(self):
|
|
4109
|
+
return "RecordId(type={}, data_id={})".format(self.type, self.data_id)
|
|
4110
|
+
|
|
4111
|
+
def __eq__(self, other):
|
|
4112
|
+
if self.type != other.type:
|
|
4113
|
+
return False
|
|
4114
|
+
if self.data_id != other.data_id:
|
|
4115
|
+
return False
|
|
4116
|
+
return True
|
|
4117
|
+
|
|
4118
|
+
class _UniffiConverterTypeRecordId(_UniffiConverterRustBuffer):
|
|
2755
4119
|
@staticmethod
|
|
2756
4120
|
def read(buf):
|
|
2757
|
-
return
|
|
2758
|
-
|
|
2759
|
-
|
|
4121
|
+
return RecordId(
|
|
4122
|
+
type=_UniffiConverterString.read(buf),
|
|
4123
|
+
data_id=_UniffiConverterString.read(buf),
|
|
2760
4124
|
)
|
|
2761
4125
|
|
|
2762
4126
|
@staticmethod
|
|
2763
4127
|
def check_lower(value):
|
|
2764
|
-
_UniffiConverterString.check_lower(value.
|
|
2765
|
-
|
|
4128
|
+
_UniffiConverterString.check_lower(value.type)
|
|
4129
|
+
_UniffiConverterString.check_lower(value.data_id)
|
|
2766
4130
|
|
|
2767
4131
|
@staticmethod
|
|
2768
4132
|
def write(value, buf):
|
|
2769
|
-
_UniffiConverterString.write(value.
|
|
2770
|
-
|
|
4133
|
+
_UniffiConverterString.write(value.type, buf)
|
|
4134
|
+
_UniffiConverterString.write(value.data_id, buf)
|
|
2771
4135
|
|
|
2772
4136
|
|
|
2773
4137
|
class RestResponse:
|
|
@@ -2806,35 +4170,6 @@ class _UniffiConverterTypeRestResponse(_UniffiConverterRustBuffer):
|
|
|
2806
4170
|
_UniffiConverterString.write(value.body, buf)
|
|
2807
4171
|
|
|
2808
4172
|
|
|
2809
|
-
class SatsPaymentDetails:
|
|
2810
|
-
amount: "typing.Optional[int]"
|
|
2811
|
-
def __init__(self, *, amount: "typing.Optional[int]"):
|
|
2812
|
-
self.amount = amount
|
|
2813
|
-
|
|
2814
|
-
def __str__(self):
|
|
2815
|
-
return "SatsPaymentDetails(amount={})".format(self.amount)
|
|
2816
|
-
|
|
2817
|
-
def __eq__(self, other):
|
|
2818
|
-
if self.amount != other.amount:
|
|
2819
|
-
return False
|
|
2820
|
-
return True
|
|
2821
|
-
|
|
2822
|
-
class _UniffiConverterTypeSatsPaymentDetails(_UniffiConverterRustBuffer):
|
|
2823
|
-
@staticmethod
|
|
2824
|
-
def read(buf):
|
|
2825
|
-
return SatsPaymentDetails(
|
|
2826
|
-
amount=_UniffiConverterOptionalUInt64.read(buf),
|
|
2827
|
-
)
|
|
2828
|
-
|
|
2829
|
-
@staticmethod
|
|
2830
|
-
def check_lower(value):
|
|
2831
|
-
_UniffiConverterOptionalUInt64.check_lower(value.amount)
|
|
2832
|
-
|
|
2833
|
-
@staticmethod
|
|
2834
|
-
def write(value, buf):
|
|
2835
|
-
_UniffiConverterOptionalUInt64.write(value.amount, buf)
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
4173
|
class SilentPaymentAddressDetails:
|
|
2839
4174
|
address: "str"
|
|
2840
4175
|
network: "BitcoinNetwork"
|
|
@@ -2878,161 +4213,168 @@ class _UniffiConverterTypeSilentPaymentAddressDetails(_UniffiConverterRustBuffer
|
|
|
2878
4213
|
_UniffiConverterTypePaymentRequestSource.write(value.source, buf)
|
|
2879
4214
|
|
|
2880
4215
|
|
|
2881
|
-
class
|
|
4216
|
+
class SparkAddressDetails:
|
|
4217
|
+
address: "str"
|
|
4218
|
+
"""
|
|
4219
|
+
The raw address string
|
|
4220
|
+
"""
|
|
4221
|
+
|
|
2882
4222
|
identity_public_key: "str"
|
|
4223
|
+
"""
|
|
4224
|
+
The identity public key of the address owner
|
|
4225
|
+
"""
|
|
4226
|
+
|
|
2883
4227
|
network: "BitcoinNetwork"
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
4228
|
+
source: "PaymentRequestSource"
|
|
4229
|
+
def __init__(self, *, address: "str", identity_public_key: "str", network: "BitcoinNetwork", source: "PaymentRequestSource"):
|
|
4230
|
+
self.address = address
|
|
2887
4231
|
self.identity_public_key = identity_public_key
|
|
2888
4232
|
self.network = network
|
|
2889
|
-
self.
|
|
2890
|
-
self.signature = signature
|
|
4233
|
+
self.source = source
|
|
2891
4234
|
|
|
2892
4235
|
def __str__(self):
|
|
2893
|
-
return "
|
|
4236
|
+
return "SparkAddressDetails(address={}, identity_public_key={}, network={}, source={})".format(self.address, self.identity_public_key, self.network, self.source)
|
|
2894
4237
|
|
|
2895
4238
|
def __eq__(self, other):
|
|
4239
|
+
if self.address != other.address:
|
|
4240
|
+
return False
|
|
2896
4241
|
if self.identity_public_key != other.identity_public_key:
|
|
2897
4242
|
return False
|
|
2898
4243
|
if self.network != other.network:
|
|
2899
4244
|
return False
|
|
2900
|
-
if self.
|
|
2901
|
-
return False
|
|
2902
|
-
if self.signature != other.signature:
|
|
4245
|
+
if self.source != other.source:
|
|
2903
4246
|
return False
|
|
2904
4247
|
return True
|
|
2905
4248
|
|
|
2906
|
-
class
|
|
4249
|
+
class _UniffiConverterTypeSparkAddressDetails(_UniffiConverterRustBuffer):
|
|
2907
4250
|
@staticmethod
|
|
2908
4251
|
def read(buf):
|
|
2909
|
-
return
|
|
4252
|
+
return SparkAddressDetails(
|
|
4253
|
+
address=_UniffiConverterString.read(buf),
|
|
2910
4254
|
identity_public_key=_UniffiConverterString.read(buf),
|
|
2911
4255
|
network=_UniffiConverterTypeBitcoinNetwork.read(buf),
|
|
2912
|
-
|
|
2913
|
-
signature=_UniffiConverterOptionalString.read(buf),
|
|
4256
|
+
source=_UniffiConverterTypePaymentRequestSource.read(buf),
|
|
2914
4257
|
)
|
|
2915
4258
|
|
|
2916
4259
|
@staticmethod
|
|
2917
4260
|
def check_lower(value):
|
|
4261
|
+
_UniffiConverterString.check_lower(value.address)
|
|
2918
4262
|
_UniffiConverterString.check_lower(value.identity_public_key)
|
|
2919
4263
|
_UniffiConverterTypeBitcoinNetwork.check_lower(value.network)
|
|
2920
|
-
|
|
2921
|
-
_UniffiConverterOptionalString.check_lower(value.signature)
|
|
4264
|
+
_UniffiConverterTypePaymentRequestSource.check_lower(value.source)
|
|
2922
4265
|
|
|
2923
4266
|
@staticmethod
|
|
2924
4267
|
def write(value, buf):
|
|
4268
|
+
_UniffiConverterString.write(value.address, buf)
|
|
2925
4269
|
_UniffiConverterString.write(value.identity_public_key, buf)
|
|
2926
4270
|
_UniffiConverterTypeBitcoinNetwork.write(value.network, buf)
|
|
2927
|
-
|
|
2928
|
-
_UniffiConverterOptionalString.write(value.signature, buf)
|
|
2929
|
-
|
|
4271
|
+
_UniffiConverterTypePaymentRequestSource.write(value.source, buf)
|
|
2930
4272
|
|
|
2931
|
-
class SparkAddressDetails:
|
|
2932
|
-
address: "str"
|
|
2933
|
-
decoded_address: "SparkAddress"
|
|
2934
|
-
source: "PaymentRequestSource"
|
|
2935
|
-
def __init__(self, *, address: "str", decoded_address: "SparkAddress", source: "PaymentRequestSource"):
|
|
2936
|
-
self.address = address
|
|
2937
|
-
self.decoded_address = decoded_address
|
|
2938
|
-
self.source = source
|
|
2939
4273
|
|
|
2940
|
-
|
|
2941
|
-
|
|
4274
|
+
class SparkInvoiceDetails:
|
|
4275
|
+
invoice: "str"
|
|
4276
|
+
"""
|
|
4277
|
+
The raw invoice string
|
|
4278
|
+
"""
|
|
2942
4279
|
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
return False
|
|
2948
|
-
if self.source != other.source:
|
|
2949
|
-
return False
|
|
2950
|
-
return True
|
|
4280
|
+
identity_public_key: "str"
|
|
4281
|
+
"""
|
|
4282
|
+
The identity public key of the invoice issuer
|
|
4283
|
+
"""
|
|
2951
4284
|
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
decoded_address=_UniffiConverterTypeSparkAddress.read(buf),
|
|
2958
|
-
source=_UniffiConverterTypePaymentRequestSource.read(buf),
|
|
2959
|
-
)
|
|
4285
|
+
network: "BitcoinNetwork"
|
|
4286
|
+
amount: "typing.Optional[CommonU128]"
|
|
4287
|
+
"""
|
|
4288
|
+
Optional amount denominated in sats if `token_identifier` is absent, otherwise in the token base units
|
|
4289
|
+
"""
|
|
2960
4290
|
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
_UniffiConverterTypePaymentRequestSource.check_lower(value.source)
|
|
4291
|
+
token_identifier: "typing.Optional[str]"
|
|
4292
|
+
"""
|
|
4293
|
+
The token identifier of the token payment. Absence indicates a Bitcoin payment.
|
|
4294
|
+
"""
|
|
2966
4295
|
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
_UniffiConverterTypePaymentRequestSource.write(value.source, buf)
|
|
4296
|
+
expiry_time: "typing.Optional[int]"
|
|
4297
|
+
"""
|
|
4298
|
+
Optional expiry time. If not provided, the invoice will never expire.
|
|
4299
|
+
"""
|
|
2972
4300
|
|
|
4301
|
+
description: "typing.Optional[str]"
|
|
4302
|
+
"""
|
|
4303
|
+
Optional description.
|
|
4304
|
+
"""
|
|
2973
4305
|
|
|
2974
|
-
class SparkInvoiceFields:
|
|
2975
|
-
id: "str"
|
|
2976
|
-
version: "int"
|
|
2977
|
-
memo: "typing.Optional[str]"
|
|
2978
4306
|
sender_public_key: "typing.Optional[str]"
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
self.
|
|
2985
|
-
self.
|
|
4307
|
+
"""
|
|
4308
|
+
If set, the invoice may only be fulfilled by a payer with this public key.
|
|
4309
|
+
"""
|
|
4310
|
+
|
|
4311
|
+
def __init__(self, *, invoice: "str", identity_public_key: "str", network: "BitcoinNetwork", amount: "typing.Optional[CommonU128]", token_identifier: "typing.Optional[str]", expiry_time: "typing.Optional[int]", description: "typing.Optional[str]", sender_public_key: "typing.Optional[str]"):
|
|
4312
|
+
self.invoice = invoice
|
|
4313
|
+
self.identity_public_key = identity_public_key
|
|
4314
|
+
self.network = network
|
|
4315
|
+
self.amount = amount
|
|
4316
|
+
self.token_identifier = token_identifier
|
|
2986
4317
|
self.expiry_time = expiry_time
|
|
2987
|
-
self.
|
|
4318
|
+
self.description = description
|
|
4319
|
+
self.sender_public_key = sender_public_key
|
|
2988
4320
|
|
|
2989
4321
|
def __str__(self):
|
|
2990
|
-
return "
|
|
4322
|
+
return "SparkInvoiceDetails(invoice={}, identity_public_key={}, network={}, amount={}, token_identifier={}, expiry_time={}, description={}, sender_public_key={})".format(self.invoice, self.identity_public_key, self.network, self.amount, self.token_identifier, self.expiry_time, self.description, self.sender_public_key)
|
|
2991
4323
|
|
|
2992
4324
|
def __eq__(self, other):
|
|
2993
|
-
if self.
|
|
4325
|
+
if self.invoice != other.invoice:
|
|
4326
|
+
return False
|
|
4327
|
+
if self.identity_public_key != other.identity_public_key:
|
|
2994
4328
|
return False
|
|
2995
|
-
if self.
|
|
4329
|
+
if self.network != other.network:
|
|
2996
4330
|
return False
|
|
2997
|
-
if self.
|
|
4331
|
+
if self.amount != other.amount:
|
|
2998
4332
|
return False
|
|
2999
|
-
if self.
|
|
4333
|
+
if self.token_identifier != other.token_identifier:
|
|
3000
4334
|
return False
|
|
3001
4335
|
if self.expiry_time != other.expiry_time:
|
|
3002
4336
|
return False
|
|
3003
|
-
if self.
|
|
4337
|
+
if self.description != other.description:
|
|
4338
|
+
return False
|
|
4339
|
+
if self.sender_public_key != other.sender_public_key:
|
|
3004
4340
|
return False
|
|
3005
4341
|
return True
|
|
3006
4342
|
|
|
3007
|
-
class
|
|
4343
|
+
class _UniffiConverterTypeSparkInvoiceDetails(_UniffiConverterRustBuffer):
|
|
3008
4344
|
@staticmethod
|
|
3009
4345
|
def read(buf):
|
|
3010
|
-
return
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
4346
|
+
return SparkInvoiceDetails(
|
|
4347
|
+
invoice=_UniffiConverterString.read(buf),
|
|
4348
|
+
identity_public_key=_UniffiConverterString.read(buf),
|
|
4349
|
+
network=_UniffiConverterTypeBitcoinNetwork.read(buf),
|
|
4350
|
+
amount=_UniffiConverterOptionalTypeCommonU128.read(buf),
|
|
4351
|
+
token_identifier=_UniffiConverterOptionalString.read(buf),
|
|
3015
4352
|
expiry_time=_UniffiConverterOptionalUInt64.read(buf),
|
|
3016
|
-
|
|
4353
|
+
description=_UniffiConverterOptionalString.read(buf),
|
|
4354
|
+
sender_public_key=_UniffiConverterOptionalString.read(buf),
|
|
3017
4355
|
)
|
|
3018
4356
|
|
|
3019
4357
|
@staticmethod
|
|
3020
4358
|
def check_lower(value):
|
|
3021
|
-
_UniffiConverterString.check_lower(value.
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
4359
|
+
_UniffiConverterString.check_lower(value.invoice)
|
|
4360
|
+
_UniffiConverterString.check_lower(value.identity_public_key)
|
|
4361
|
+
_UniffiConverterTypeBitcoinNetwork.check_lower(value.network)
|
|
4362
|
+
_UniffiConverterOptionalTypeCommonU128.check_lower(value.amount)
|
|
4363
|
+
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
3025
4364
|
_UniffiConverterOptionalUInt64.check_lower(value.expiry_time)
|
|
3026
|
-
|
|
4365
|
+
_UniffiConverterOptionalString.check_lower(value.description)
|
|
4366
|
+
_UniffiConverterOptionalString.check_lower(value.sender_public_key)
|
|
3027
4367
|
|
|
3028
4368
|
@staticmethod
|
|
3029
4369
|
def write(value, buf):
|
|
3030
|
-
_UniffiConverterString.write(value.
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
4370
|
+
_UniffiConverterString.write(value.invoice, buf)
|
|
4371
|
+
_UniffiConverterString.write(value.identity_public_key, buf)
|
|
4372
|
+
_UniffiConverterTypeBitcoinNetwork.write(value.network, buf)
|
|
4373
|
+
_UniffiConverterOptionalTypeCommonU128.write(value.amount, buf)
|
|
4374
|
+
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
3034
4375
|
_UniffiConverterOptionalUInt64.write(value.expiry_time, buf)
|
|
3035
|
-
|
|
4376
|
+
_UniffiConverterOptionalString.write(value.description, buf)
|
|
4377
|
+
_UniffiConverterOptionalString.write(value.sender_public_key, buf)
|
|
3036
4378
|
|
|
3037
4379
|
|
|
3038
4380
|
class Symbol:
|
|
@@ -3089,40 +4431,47 @@ class _UniffiConverterTypeSymbol(_UniffiConverterRustBuffer):
|
|
|
3089
4431
|
_UniffiConverterOptionalUInt32.write(value.position, buf)
|
|
3090
4432
|
|
|
3091
4433
|
|
|
3092
|
-
class
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
self.
|
|
4434
|
+
class UnversionedRecordChange:
|
|
4435
|
+
id: "RecordId"
|
|
4436
|
+
schema_version: "str"
|
|
4437
|
+
updated_fields: "dict[str, str]"
|
|
4438
|
+
def __init__(self, *, id: "RecordId", schema_version: "str", updated_fields: "dict[str, str]"):
|
|
4439
|
+
self.id = id
|
|
4440
|
+
self.schema_version = schema_version
|
|
4441
|
+
self.updated_fields = updated_fields
|
|
3098
4442
|
|
|
3099
4443
|
def __str__(self):
|
|
3100
|
-
return "
|
|
4444
|
+
return "UnversionedRecordChange(id={}, schema_version={}, updated_fields={})".format(self.id, self.schema_version, self.updated_fields)
|
|
3101
4445
|
|
|
3102
4446
|
def __eq__(self, other):
|
|
3103
|
-
if self.
|
|
4447
|
+
if self.id != other.id:
|
|
3104
4448
|
return False
|
|
3105
|
-
if self.
|
|
4449
|
+
if self.schema_version != other.schema_version:
|
|
4450
|
+
return False
|
|
4451
|
+
if self.updated_fields != other.updated_fields:
|
|
3106
4452
|
return False
|
|
3107
4453
|
return True
|
|
3108
4454
|
|
|
3109
|
-
class
|
|
4455
|
+
class _UniffiConverterTypeUnversionedRecordChange(_UniffiConverterRustBuffer):
|
|
3110
4456
|
@staticmethod
|
|
3111
4457
|
def read(buf):
|
|
3112
|
-
return
|
|
3113
|
-
|
|
3114
|
-
|
|
4458
|
+
return UnversionedRecordChange(
|
|
4459
|
+
id=_UniffiConverterTypeRecordId.read(buf),
|
|
4460
|
+
schema_version=_UniffiConverterString.read(buf),
|
|
4461
|
+
updated_fields=_UniffiConverterMapStringString.read(buf),
|
|
3115
4462
|
)
|
|
3116
4463
|
|
|
3117
4464
|
@staticmethod
|
|
3118
4465
|
def check_lower(value):
|
|
3119
|
-
|
|
3120
|
-
|
|
4466
|
+
_UniffiConverterTypeRecordId.check_lower(value.id)
|
|
4467
|
+
_UniffiConverterString.check_lower(value.schema_version)
|
|
4468
|
+
_UniffiConverterMapStringString.check_lower(value.updated_fields)
|
|
3121
4469
|
|
|
3122
4470
|
@staticmethod
|
|
3123
4471
|
def write(value, buf):
|
|
3124
|
-
|
|
3125
|
-
|
|
4472
|
+
_UniffiConverterTypeRecordId.write(value.id, buf)
|
|
4473
|
+
_UniffiConverterString.write(value.schema_version, buf)
|
|
4474
|
+
_UniffiConverterMapStringString.write(value.updated_fields, buf)
|
|
3126
4475
|
|
|
3127
4476
|
|
|
3128
4477
|
class UrlSuccessActionData:
|
|
@@ -3703,6 +5052,24 @@ class InputType:
|
|
|
3703
5052
|
if not other.is_spark_address():
|
|
3704
5053
|
return False
|
|
3705
5054
|
return self._values == other._values
|
|
5055
|
+
class SPARK_INVOICE:
|
|
5056
|
+
def __init__(self, *values):
|
|
5057
|
+
if len(values) != 1:
|
|
5058
|
+
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
5059
|
+
if not isinstance(values[0], SparkInvoiceDetails):
|
|
5060
|
+
raise TypeError(f"unexpected type for tuple element 0 - expected 'SparkInvoiceDetails', got '{type(values[0])}'")
|
|
5061
|
+
self._values = values
|
|
5062
|
+
|
|
5063
|
+
def __getitem__(self, index):
|
|
5064
|
+
return self._values[index]
|
|
5065
|
+
|
|
5066
|
+
def __str__(self):
|
|
5067
|
+
return f"InputType.SPARK_INVOICE{self._values!r}"
|
|
5068
|
+
|
|
5069
|
+
def __eq__(self, other):
|
|
5070
|
+
if not other.is_spark_invoice():
|
|
5071
|
+
return False
|
|
5072
|
+
return self._values == other._values
|
|
3706
5073
|
|
|
3707
5074
|
|
|
3708
5075
|
# For each variant, we have an `is_NAME` method for easily checking
|
|
@@ -3733,6 +5100,8 @@ class InputType:
|
|
|
3733
5100
|
return isinstance(self, InputType.LNURL_WITHDRAW)
|
|
3734
5101
|
def is_spark_address(self) -> bool:
|
|
3735
5102
|
return isinstance(self, InputType.SPARK_ADDRESS)
|
|
5103
|
+
def is_spark_invoice(self) -> bool:
|
|
5104
|
+
return isinstance(self, InputType.SPARK_INVOICE)
|
|
3736
5105
|
|
|
3737
5106
|
|
|
3738
5107
|
# Now, a little trick - we make each nested variant class be a subclass of the main
|
|
@@ -3751,6 +5120,7 @@ InputType.BIP21 = type("InputType.BIP21", (InputType.BIP21, InputType,), {}) #
|
|
|
3751
5120
|
InputType.BOLT12_INVOICE_REQUEST = type("InputType.BOLT12_INVOICE_REQUEST", (InputType.BOLT12_INVOICE_REQUEST, InputType,), {}) # type: ignore
|
|
3752
5121
|
InputType.LNURL_WITHDRAW = type("InputType.LNURL_WITHDRAW", (InputType.LNURL_WITHDRAW, InputType,), {}) # type: ignore
|
|
3753
5122
|
InputType.SPARK_ADDRESS = type("InputType.SPARK_ADDRESS", (InputType.SPARK_ADDRESS, InputType,), {}) # type: ignore
|
|
5123
|
+
InputType.SPARK_INVOICE = type("InputType.SPARK_INVOICE", (InputType.SPARK_INVOICE, InputType,), {}) # type: ignore
|
|
3754
5124
|
|
|
3755
5125
|
|
|
3756
5126
|
|
|
@@ -3811,6 +5181,10 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
|
|
|
3811
5181
|
return InputType.SPARK_ADDRESS(
|
|
3812
5182
|
_UniffiConverterTypeSparkAddressDetails.read(buf),
|
|
3813
5183
|
)
|
|
5184
|
+
if variant == 14:
|
|
5185
|
+
return InputType.SPARK_INVOICE(
|
|
5186
|
+
_UniffiConverterTypeSparkInvoiceDetails.read(buf),
|
|
5187
|
+
)
|
|
3814
5188
|
raise InternalError("Raw enum value doesn't match any cases")
|
|
3815
5189
|
|
|
3816
5190
|
@staticmethod
|
|
@@ -3854,6 +5228,9 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
|
|
|
3854
5228
|
if value.is_spark_address():
|
|
3855
5229
|
_UniffiConverterTypeSparkAddressDetails.check_lower(value._values[0])
|
|
3856
5230
|
return
|
|
5231
|
+
if value.is_spark_invoice():
|
|
5232
|
+
_UniffiConverterTypeSparkInvoiceDetails.check_lower(value._values[0])
|
|
5233
|
+
return
|
|
3857
5234
|
raise ValueError(value)
|
|
3858
5235
|
|
|
3859
5236
|
@staticmethod
|
|
@@ -3897,6 +5274,9 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
|
|
|
3897
5274
|
if value.is_spark_address():
|
|
3898
5275
|
buf.write_i32(13)
|
|
3899
5276
|
_UniffiConverterTypeSparkAddressDetails.write(value._values[0], buf)
|
|
5277
|
+
if value.is_spark_invoice():
|
|
5278
|
+
buf.write_i32(14)
|
|
5279
|
+
_UniffiConverterTypeSparkInvoiceDetails.write(value._values[0], buf)
|
|
3900
5280
|
|
|
3901
5281
|
|
|
3902
5282
|
|
|
@@ -4273,120 +5653,21 @@ class _UniffiConverterTypeServiceConnectivityError(_UniffiConverterRustBuffer):
|
|
|
4273
5653
|
if isinstance(value, ServiceConnectivityError.Request):
|
|
4274
5654
|
buf.write_i32(5)
|
|
4275
5655
|
_UniffiConverterString.write(value._values[0], buf)
|
|
4276
|
-
if isinstance(value, ServiceConnectivityError.Connect):
|
|
4277
|
-
buf.write_i32(6)
|
|
4278
|
-
_UniffiConverterString.write(value._values[0], buf)
|
|
4279
|
-
if isinstance(value, ServiceConnectivityError.Body):
|
|
4280
|
-
buf.write_i32(7)
|
|
4281
|
-
_UniffiConverterString.write(value._values[0], buf)
|
|
4282
|
-
if isinstance(value, ServiceConnectivityError.Decode):
|
|
4283
|
-
buf.write_i32(8)
|
|
4284
|
-
_UniffiConverterString.write(value._values[0], buf)
|
|
4285
|
-
if isinstance(value, ServiceConnectivityError.Json):
|
|
4286
|
-
buf.write_i32(9)
|
|
4287
|
-
_UniffiConverterString.write(value._values[0], buf)
|
|
4288
|
-
if isinstance(value, ServiceConnectivityError.Other):
|
|
4289
|
-
buf.write_i32(10)
|
|
4290
|
-
_UniffiConverterString.write(value._values[0], buf)
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
class SparkAddressPaymentType:
|
|
4297
|
-
def __init__(self):
|
|
4298
|
-
raise RuntimeError("SparkAddressPaymentType cannot be instantiated directly")
|
|
4299
|
-
|
|
4300
|
-
# Each enum variant is a nested class of the enum itself.
|
|
4301
|
-
class TOKENS_PAYMENT:
|
|
4302
|
-
def __init__(self, *values):
|
|
4303
|
-
if len(values) != 1:
|
|
4304
|
-
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
4305
|
-
if not isinstance(values[0], TokensPaymentDetails):
|
|
4306
|
-
raise TypeError(f"unexpected type for tuple element 0 - expected 'TokensPaymentDetails', got '{type(values[0])}'")
|
|
4307
|
-
self._values = values
|
|
4308
|
-
|
|
4309
|
-
def __getitem__(self, index):
|
|
4310
|
-
return self._values[index]
|
|
4311
|
-
|
|
4312
|
-
def __str__(self):
|
|
4313
|
-
return f"SparkAddressPaymentType.TOKENS_PAYMENT{self._values!r}"
|
|
4314
|
-
|
|
4315
|
-
def __eq__(self, other):
|
|
4316
|
-
if not other.is_tokens_payment():
|
|
4317
|
-
return False
|
|
4318
|
-
return self._values == other._values
|
|
4319
|
-
class SATS_PAYMENT:
|
|
4320
|
-
def __init__(self, *values):
|
|
4321
|
-
if len(values) != 1:
|
|
4322
|
-
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
4323
|
-
if not isinstance(values[0], SatsPaymentDetails):
|
|
4324
|
-
raise TypeError(f"unexpected type for tuple element 0 - expected 'SatsPaymentDetails', got '{type(values[0])}'")
|
|
4325
|
-
self._values = values
|
|
4326
|
-
|
|
4327
|
-
def __getitem__(self, index):
|
|
4328
|
-
return self._values[index]
|
|
4329
|
-
|
|
4330
|
-
def __str__(self):
|
|
4331
|
-
return f"SparkAddressPaymentType.SATS_PAYMENT{self._values!r}"
|
|
4332
|
-
|
|
4333
|
-
def __eq__(self, other):
|
|
4334
|
-
if not other.is_sats_payment():
|
|
4335
|
-
return False
|
|
4336
|
-
return self._values == other._values
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
# For each variant, we have an `is_NAME` method for easily checking
|
|
4340
|
-
# whether an instance is that variant.
|
|
4341
|
-
def is_tokens_payment(self) -> bool:
|
|
4342
|
-
return isinstance(self, SparkAddressPaymentType.TOKENS_PAYMENT)
|
|
4343
|
-
def is_sats_payment(self) -> bool:
|
|
4344
|
-
return isinstance(self, SparkAddressPaymentType.SATS_PAYMENT)
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
# Now, a little trick - we make each nested variant class be a subclass of the main
|
|
4348
|
-
# enum class, so that method calls and instance checks etc will work intuitively.
|
|
4349
|
-
# We might be able to do this a little more neatly with a metaclass, but this'll do.
|
|
4350
|
-
SparkAddressPaymentType.TOKENS_PAYMENT = type("SparkAddressPaymentType.TOKENS_PAYMENT", (SparkAddressPaymentType.TOKENS_PAYMENT, SparkAddressPaymentType,), {}) # type: ignore
|
|
4351
|
-
SparkAddressPaymentType.SATS_PAYMENT = type("SparkAddressPaymentType.SATS_PAYMENT", (SparkAddressPaymentType.SATS_PAYMENT, SparkAddressPaymentType,), {}) # type: ignore
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
class _UniffiConverterTypeSparkAddressPaymentType(_UniffiConverterRustBuffer):
|
|
4357
|
-
@staticmethod
|
|
4358
|
-
def read(buf):
|
|
4359
|
-
variant = buf.read_i32()
|
|
4360
|
-
if variant == 1:
|
|
4361
|
-
return SparkAddressPaymentType.TOKENS_PAYMENT(
|
|
4362
|
-
_UniffiConverterTypeTokensPaymentDetails.read(buf),
|
|
4363
|
-
)
|
|
4364
|
-
if variant == 2:
|
|
4365
|
-
return SparkAddressPaymentType.SATS_PAYMENT(
|
|
4366
|
-
_UniffiConverterTypeSatsPaymentDetails.read(buf),
|
|
4367
|
-
)
|
|
4368
|
-
raise InternalError("Raw enum value doesn't match any cases")
|
|
4369
|
-
|
|
4370
|
-
@staticmethod
|
|
4371
|
-
def check_lower(value):
|
|
4372
|
-
if value.is_tokens_payment():
|
|
4373
|
-
_UniffiConverterTypeTokensPaymentDetails.check_lower(value._values[0])
|
|
4374
|
-
return
|
|
4375
|
-
if value.is_sats_payment():
|
|
4376
|
-
_UniffiConverterTypeSatsPaymentDetails.check_lower(value._values[0])
|
|
4377
|
-
return
|
|
4378
|
-
raise ValueError(value)
|
|
4379
|
-
|
|
4380
|
-
@staticmethod
|
|
4381
|
-
def write(value, buf):
|
|
4382
|
-
if value.is_tokens_payment():
|
|
4383
|
-
buf.write_i32(1)
|
|
4384
|
-
_UniffiConverterTypeTokensPaymentDetails.write(value._values[0], buf)
|
|
4385
|
-
if value.is_sats_payment():
|
|
4386
|
-
buf.write_i32(2)
|
|
4387
|
-
_UniffiConverterTypeSatsPaymentDetails.write(value._values[0], buf)
|
|
4388
|
-
|
|
4389
|
-
|
|
5656
|
+
if isinstance(value, ServiceConnectivityError.Connect):
|
|
5657
|
+
buf.write_i32(6)
|
|
5658
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
5659
|
+
if isinstance(value, ServiceConnectivityError.Body):
|
|
5660
|
+
buf.write_i32(7)
|
|
5661
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
5662
|
+
if isinstance(value, ServiceConnectivityError.Decode):
|
|
5663
|
+
buf.write_i32(8)
|
|
5664
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
5665
|
+
if isinstance(value, ServiceConnectivityError.Json):
|
|
5666
|
+
buf.write_i32(9)
|
|
5667
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
5668
|
+
if isinstance(value, ServiceConnectivityError.Other):
|
|
5669
|
+
buf.write_i32(10)
|
|
5670
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
4390
5671
|
|
|
4391
5672
|
|
|
4392
5673
|
|
|
@@ -4676,6 +5957,123 @@ class _UniffiConverterTypeSuccessActionProcessed(_UniffiConverterRustBuffer):
|
|
|
4676
5957
|
|
|
4677
5958
|
|
|
4678
5959
|
|
|
5960
|
+
# SyncStorageError
|
|
5961
|
+
# We want to define each variant as a nested class that's also a subclass,
|
|
5962
|
+
# which is tricky in Python. To accomplish this we're going to create each
|
|
5963
|
+
# class separately, then manually add the child classes to the base class's
|
|
5964
|
+
# __dict__. All of this happens in dummy class to avoid polluting the module
|
|
5965
|
+
# namespace.
|
|
5966
|
+
class SyncStorageError(Exception):
|
|
5967
|
+
"""
|
|
5968
|
+
Errors that can occur during storage operations
|
|
5969
|
+
"""
|
|
5970
|
+
|
|
5971
|
+
pass
|
|
5972
|
+
|
|
5973
|
+
_UniffiTempSyncStorageError = SyncStorageError
|
|
5974
|
+
|
|
5975
|
+
class SyncStorageError: # type: ignore
|
|
5976
|
+
"""
|
|
5977
|
+
Errors that can occur during storage operations
|
|
5978
|
+
"""
|
|
5979
|
+
|
|
5980
|
+
class Implementation(_UniffiTempSyncStorageError):
|
|
5981
|
+
def __init__(self, *values):
|
|
5982
|
+
if len(values) != 1:
|
|
5983
|
+
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
5984
|
+
if not isinstance(values[0], str):
|
|
5985
|
+
raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
|
|
5986
|
+
super().__init__(", ".join(map(repr, values)))
|
|
5987
|
+
self._values = values
|
|
5988
|
+
|
|
5989
|
+
def __getitem__(self, index):
|
|
5990
|
+
return self._values[index]
|
|
5991
|
+
|
|
5992
|
+
def __repr__(self):
|
|
5993
|
+
return "SyncStorageError.Implementation({})".format(str(self))
|
|
5994
|
+
_UniffiTempSyncStorageError.Implementation = Implementation # type: ignore
|
|
5995
|
+
class InitializationError(_UniffiTempSyncStorageError):
|
|
5996
|
+
"""
|
|
5997
|
+
Database initialization error
|
|
5998
|
+
"""
|
|
5999
|
+
|
|
6000
|
+
def __init__(self, *values):
|
|
6001
|
+
if len(values) != 1:
|
|
6002
|
+
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
6003
|
+
if not isinstance(values[0], str):
|
|
6004
|
+
raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
|
|
6005
|
+
super().__init__(", ".join(map(repr, values)))
|
|
6006
|
+
self._values = values
|
|
6007
|
+
|
|
6008
|
+
def __getitem__(self, index):
|
|
6009
|
+
return self._values[index]
|
|
6010
|
+
|
|
6011
|
+
def __repr__(self):
|
|
6012
|
+
return "SyncStorageError.InitializationError({})".format(str(self))
|
|
6013
|
+
_UniffiTempSyncStorageError.InitializationError = InitializationError # type: ignore
|
|
6014
|
+
class Serialization(_UniffiTempSyncStorageError):
|
|
6015
|
+
def __init__(self, *values):
|
|
6016
|
+
if len(values) != 1:
|
|
6017
|
+
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
6018
|
+
if not isinstance(values[0], str):
|
|
6019
|
+
raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
|
|
6020
|
+
super().__init__(", ".join(map(repr, values)))
|
|
6021
|
+
self._values = values
|
|
6022
|
+
|
|
6023
|
+
def __getitem__(self, index):
|
|
6024
|
+
return self._values[index]
|
|
6025
|
+
|
|
6026
|
+
def __repr__(self):
|
|
6027
|
+
return "SyncStorageError.Serialization({})".format(str(self))
|
|
6028
|
+
_UniffiTempSyncStorageError.Serialization = Serialization # type: ignore
|
|
6029
|
+
|
|
6030
|
+
SyncStorageError = _UniffiTempSyncStorageError # type: ignore
|
|
6031
|
+
del _UniffiTempSyncStorageError
|
|
6032
|
+
|
|
6033
|
+
|
|
6034
|
+
class _UniffiConverterTypeSyncStorageError(_UniffiConverterRustBuffer):
|
|
6035
|
+
@staticmethod
|
|
6036
|
+
def read(buf):
|
|
6037
|
+
variant = buf.read_i32()
|
|
6038
|
+
if variant == 1:
|
|
6039
|
+
return SyncStorageError.Implementation(
|
|
6040
|
+
_UniffiConverterString.read(buf),
|
|
6041
|
+
)
|
|
6042
|
+
if variant == 2:
|
|
6043
|
+
return SyncStorageError.InitializationError(
|
|
6044
|
+
_UniffiConverterString.read(buf),
|
|
6045
|
+
)
|
|
6046
|
+
if variant == 3:
|
|
6047
|
+
return SyncStorageError.Serialization(
|
|
6048
|
+
_UniffiConverterString.read(buf),
|
|
6049
|
+
)
|
|
6050
|
+
raise InternalError("Raw enum value doesn't match any cases")
|
|
6051
|
+
|
|
6052
|
+
@staticmethod
|
|
6053
|
+
def check_lower(value):
|
|
6054
|
+
if isinstance(value, SyncStorageError.Implementation):
|
|
6055
|
+
_UniffiConverterString.check_lower(value._values[0])
|
|
6056
|
+
return
|
|
6057
|
+
if isinstance(value, SyncStorageError.InitializationError):
|
|
6058
|
+
_UniffiConverterString.check_lower(value._values[0])
|
|
6059
|
+
return
|
|
6060
|
+
if isinstance(value, SyncStorageError.Serialization):
|
|
6061
|
+
_UniffiConverterString.check_lower(value._values[0])
|
|
6062
|
+
return
|
|
6063
|
+
|
|
6064
|
+
@staticmethod
|
|
6065
|
+
def write(value, buf):
|
|
6066
|
+
if isinstance(value, SyncStorageError.Implementation):
|
|
6067
|
+
buf.write_i32(1)
|
|
6068
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
6069
|
+
if isinstance(value, SyncStorageError.InitializationError):
|
|
6070
|
+
buf.write_i32(2)
|
|
6071
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
6072
|
+
if isinstance(value, SyncStorageError.Serialization):
|
|
6073
|
+
buf.write_i32(3)
|
|
6074
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
6075
|
+
|
|
6076
|
+
|
|
4679
6077
|
|
|
4680
6078
|
class _UniffiConverterOptionalUInt32(_UniffiConverterRustBuffer):
|
|
4681
6079
|
@classmethod
|
|
@@ -4785,11 +6183,38 @@ class _UniffiConverterOptionalString(_UniffiConverterRustBuffer):
|
|
|
4785
6183
|
|
|
4786
6184
|
|
|
4787
6185
|
|
|
4788
|
-
class
|
|
6186
|
+
class _UniffiConverterOptionalTypeOutgoingChange(_UniffiConverterRustBuffer):
|
|
6187
|
+
@classmethod
|
|
6188
|
+
def check_lower(cls, value):
|
|
6189
|
+
if value is not None:
|
|
6190
|
+
_UniffiConverterTypeOutgoingChange.check_lower(value)
|
|
6191
|
+
|
|
6192
|
+
@classmethod
|
|
6193
|
+
def write(cls, value, buf):
|
|
6194
|
+
if value is None:
|
|
6195
|
+
buf.write_u8(0)
|
|
6196
|
+
return
|
|
6197
|
+
|
|
6198
|
+
buf.write_u8(1)
|
|
6199
|
+
_UniffiConverterTypeOutgoingChange.write(value, buf)
|
|
6200
|
+
|
|
6201
|
+
@classmethod
|
|
6202
|
+
def read(cls, buf):
|
|
6203
|
+
flag = buf.read_u8()
|
|
6204
|
+
if flag == 0:
|
|
6205
|
+
return None
|
|
6206
|
+
elif flag == 1:
|
|
6207
|
+
return _UniffiConverterTypeOutgoingChange.read(buf)
|
|
6208
|
+
else:
|
|
6209
|
+
raise InternalError("Unexpected flag byte for optional type")
|
|
6210
|
+
|
|
6211
|
+
|
|
6212
|
+
|
|
6213
|
+
class _UniffiConverterOptionalTypeRecord(_UniffiConverterRustBuffer):
|
|
4789
6214
|
@classmethod
|
|
4790
6215
|
def check_lower(cls, value):
|
|
4791
6216
|
if value is not None:
|
|
4792
|
-
|
|
6217
|
+
_UniffiConverterTypeRecord.check_lower(value)
|
|
4793
6218
|
|
|
4794
6219
|
@classmethod
|
|
4795
6220
|
def write(cls, value, buf):
|
|
@@ -4798,7 +6223,7 @@ class _UniffiConverterOptionalTypeSparkInvoiceFields(_UniffiConverterRustBuffer)
|
|
|
4798
6223
|
return
|
|
4799
6224
|
|
|
4800
6225
|
buf.write_u8(1)
|
|
4801
|
-
|
|
6226
|
+
_UniffiConverterTypeRecord.write(value, buf)
|
|
4802
6227
|
|
|
4803
6228
|
@classmethod
|
|
4804
6229
|
def read(cls, buf):
|
|
@@ -4806,7 +6231,7 @@ class _UniffiConverterOptionalTypeSparkInvoiceFields(_UniffiConverterRustBuffer)
|
|
|
4806
6231
|
if flag == 0:
|
|
4807
6232
|
return None
|
|
4808
6233
|
elif flag == 1:
|
|
4809
|
-
return
|
|
6234
|
+
return _UniffiConverterTypeRecord.read(buf)
|
|
4810
6235
|
else:
|
|
4811
6236
|
raise InternalError("Unexpected flag byte for optional type")
|
|
4812
6237
|
|
|
@@ -4866,11 +6291,11 @@ class _UniffiConverterOptionalTypeAmount(_UniffiConverterRustBuffer):
|
|
|
4866
6291
|
|
|
4867
6292
|
|
|
4868
6293
|
|
|
4869
|
-
class
|
|
6294
|
+
class _UniffiConverterOptionalMapStringString(_UniffiConverterRustBuffer):
|
|
4870
6295
|
@classmethod
|
|
4871
6296
|
def check_lower(cls, value):
|
|
4872
6297
|
if value is not None:
|
|
4873
|
-
|
|
6298
|
+
_UniffiConverterMapStringString.check_lower(value)
|
|
4874
6299
|
|
|
4875
6300
|
@classmethod
|
|
4876
6301
|
def write(cls, value, buf):
|
|
@@ -4879,7 +6304,7 @@ class _UniffiConverterOptionalTypeSparkAddressPaymentType(_UniffiConverterRustBu
|
|
|
4879
6304
|
return
|
|
4880
6305
|
|
|
4881
6306
|
buf.write_u8(1)
|
|
4882
|
-
|
|
6307
|
+
_UniffiConverterMapStringString.write(value, buf)
|
|
4883
6308
|
|
|
4884
6309
|
@classmethod
|
|
4885
6310
|
def read(cls, buf):
|
|
@@ -4887,17 +6312,17 @@ class _UniffiConverterOptionalTypeSparkAddressPaymentType(_UniffiConverterRustBu
|
|
|
4887
6312
|
if flag == 0:
|
|
4888
6313
|
return None
|
|
4889
6314
|
elif flag == 1:
|
|
4890
|
-
return
|
|
6315
|
+
return _UniffiConverterMapStringString.read(buf)
|
|
4891
6316
|
else:
|
|
4892
6317
|
raise InternalError("Unexpected flag byte for optional type")
|
|
4893
6318
|
|
|
4894
6319
|
|
|
4895
6320
|
|
|
4896
|
-
class
|
|
6321
|
+
class _UniffiConverterOptionalTypeCommonU128(_UniffiConverterRustBuffer):
|
|
4897
6322
|
@classmethod
|
|
4898
6323
|
def check_lower(cls, value):
|
|
4899
6324
|
if value is not None:
|
|
4900
|
-
|
|
6325
|
+
_UniffiConverterTypeCommonU128.check_lower(value)
|
|
4901
6326
|
|
|
4902
6327
|
@classmethod
|
|
4903
6328
|
def write(cls, value, buf):
|
|
@@ -4906,7 +6331,7 @@ class _UniffiConverterOptionalMapStringString(_UniffiConverterRustBuffer):
|
|
|
4906
6331
|
return
|
|
4907
6332
|
|
|
4908
6333
|
buf.write_u8(1)
|
|
4909
|
-
|
|
6334
|
+
_UniffiConverterTypeCommonU128.write(value, buf)
|
|
4910
6335
|
|
|
4911
6336
|
@classmethod
|
|
4912
6337
|
def read(cls, buf):
|
|
@@ -4914,7 +6339,7 @@ class _UniffiConverterOptionalMapStringString(_UniffiConverterRustBuffer):
|
|
|
4914
6339
|
if flag == 0:
|
|
4915
6340
|
return None
|
|
4916
6341
|
elif flag == 1:
|
|
4917
|
-
return
|
|
6342
|
+
return _UniffiConverterTypeCommonU128.read(buf)
|
|
4918
6343
|
else:
|
|
4919
6344
|
raise InternalError("Unexpected flag byte for optional type")
|
|
4920
6345
|
|
|
@@ -5045,6 +6470,56 @@ class _UniffiConverterSequenceTypeBolt12OfferBlindedPath(_UniffiConverterRustBuf
|
|
|
5045
6470
|
|
|
5046
6471
|
|
|
5047
6472
|
|
|
6473
|
+
class _UniffiConverterSequenceTypeFiatCurrency(_UniffiConverterRustBuffer):
|
|
6474
|
+
@classmethod
|
|
6475
|
+
def check_lower(cls, value):
|
|
6476
|
+
for item in value:
|
|
6477
|
+
_UniffiConverterTypeFiatCurrency.check_lower(item)
|
|
6478
|
+
|
|
6479
|
+
@classmethod
|
|
6480
|
+
def write(cls, value, buf):
|
|
6481
|
+
items = len(value)
|
|
6482
|
+
buf.write_i32(items)
|
|
6483
|
+
for item in value:
|
|
6484
|
+
_UniffiConverterTypeFiatCurrency.write(item, buf)
|
|
6485
|
+
|
|
6486
|
+
@classmethod
|
|
6487
|
+
def read(cls, buf):
|
|
6488
|
+
count = buf.read_i32()
|
|
6489
|
+
if count < 0:
|
|
6490
|
+
raise InternalError("Unexpected negative sequence length")
|
|
6491
|
+
|
|
6492
|
+
return [
|
|
6493
|
+
_UniffiConverterTypeFiatCurrency.read(buf) for i in range(count)
|
|
6494
|
+
]
|
|
6495
|
+
|
|
6496
|
+
|
|
6497
|
+
|
|
6498
|
+
class _UniffiConverterSequenceTypeIncomingChange(_UniffiConverterRustBuffer):
|
|
6499
|
+
@classmethod
|
|
6500
|
+
def check_lower(cls, value):
|
|
6501
|
+
for item in value:
|
|
6502
|
+
_UniffiConverterTypeIncomingChange.check_lower(item)
|
|
6503
|
+
|
|
6504
|
+
@classmethod
|
|
6505
|
+
def write(cls, value, buf):
|
|
6506
|
+
items = len(value)
|
|
6507
|
+
buf.write_i32(items)
|
|
6508
|
+
for item in value:
|
|
6509
|
+
_UniffiConverterTypeIncomingChange.write(item, buf)
|
|
6510
|
+
|
|
6511
|
+
@classmethod
|
|
6512
|
+
def read(cls, buf):
|
|
6513
|
+
count = buf.read_i32()
|
|
6514
|
+
if count < 0:
|
|
6515
|
+
raise InternalError("Unexpected negative sequence length")
|
|
6516
|
+
|
|
6517
|
+
return [
|
|
6518
|
+
_UniffiConverterTypeIncomingChange.read(buf) for i in range(count)
|
|
6519
|
+
]
|
|
6520
|
+
|
|
6521
|
+
|
|
6522
|
+
|
|
5048
6523
|
class _UniffiConverterSequenceTypeLocaleOverrides(_UniffiConverterRustBuffer):
|
|
5049
6524
|
@classmethod
|
|
5050
6525
|
def check_lower(cls, value):
|
|
@@ -5095,6 +6570,81 @@ class _UniffiConverterSequenceTypeLocalizedName(_UniffiConverterRustBuffer):
|
|
|
5095
6570
|
|
|
5096
6571
|
|
|
5097
6572
|
|
|
6573
|
+
class _UniffiConverterSequenceTypeOutgoingChange(_UniffiConverterRustBuffer):
|
|
6574
|
+
@classmethod
|
|
6575
|
+
def check_lower(cls, value):
|
|
6576
|
+
for item in value:
|
|
6577
|
+
_UniffiConverterTypeOutgoingChange.check_lower(item)
|
|
6578
|
+
|
|
6579
|
+
@classmethod
|
|
6580
|
+
def write(cls, value, buf):
|
|
6581
|
+
items = len(value)
|
|
6582
|
+
buf.write_i32(items)
|
|
6583
|
+
for item in value:
|
|
6584
|
+
_UniffiConverterTypeOutgoingChange.write(item, buf)
|
|
6585
|
+
|
|
6586
|
+
@classmethod
|
|
6587
|
+
def read(cls, buf):
|
|
6588
|
+
count = buf.read_i32()
|
|
6589
|
+
if count < 0:
|
|
6590
|
+
raise InternalError("Unexpected negative sequence length")
|
|
6591
|
+
|
|
6592
|
+
return [
|
|
6593
|
+
_UniffiConverterTypeOutgoingChange.read(buf) for i in range(count)
|
|
6594
|
+
]
|
|
6595
|
+
|
|
6596
|
+
|
|
6597
|
+
|
|
6598
|
+
class _UniffiConverterSequenceTypeRate(_UniffiConverterRustBuffer):
|
|
6599
|
+
@classmethod
|
|
6600
|
+
def check_lower(cls, value):
|
|
6601
|
+
for item in value:
|
|
6602
|
+
_UniffiConverterTypeRate.check_lower(item)
|
|
6603
|
+
|
|
6604
|
+
@classmethod
|
|
6605
|
+
def write(cls, value, buf):
|
|
6606
|
+
items = len(value)
|
|
6607
|
+
buf.write_i32(items)
|
|
6608
|
+
for item in value:
|
|
6609
|
+
_UniffiConverterTypeRate.write(item, buf)
|
|
6610
|
+
|
|
6611
|
+
@classmethod
|
|
6612
|
+
def read(cls, buf):
|
|
6613
|
+
count = buf.read_i32()
|
|
6614
|
+
if count < 0:
|
|
6615
|
+
raise InternalError("Unexpected negative sequence length")
|
|
6616
|
+
|
|
6617
|
+
return [
|
|
6618
|
+
_UniffiConverterTypeRate.read(buf) for i in range(count)
|
|
6619
|
+
]
|
|
6620
|
+
|
|
6621
|
+
|
|
6622
|
+
|
|
6623
|
+
class _UniffiConverterSequenceTypeRecord(_UniffiConverterRustBuffer):
|
|
6624
|
+
@classmethod
|
|
6625
|
+
def check_lower(cls, value):
|
|
6626
|
+
for item in value:
|
|
6627
|
+
_UniffiConverterTypeRecord.check_lower(item)
|
|
6628
|
+
|
|
6629
|
+
@classmethod
|
|
6630
|
+
def write(cls, value, buf):
|
|
6631
|
+
items = len(value)
|
|
6632
|
+
buf.write_i32(items)
|
|
6633
|
+
for item in value:
|
|
6634
|
+
_UniffiConverterTypeRecord.write(item, buf)
|
|
6635
|
+
|
|
6636
|
+
@classmethod
|
|
6637
|
+
def read(cls, buf):
|
|
6638
|
+
count = buf.read_i32()
|
|
6639
|
+
if count < 0:
|
|
6640
|
+
raise InternalError("Unexpected negative sequence length")
|
|
6641
|
+
|
|
6642
|
+
return [
|
|
6643
|
+
_UniffiConverterTypeRecord.read(buf) for i in range(count)
|
|
6644
|
+
]
|
|
6645
|
+
|
|
6646
|
+
|
|
6647
|
+
|
|
5098
6648
|
class _UniffiConverterSequenceTypeInputType(_UniffiConverterRustBuffer):
|
|
5099
6649
|
@classmethod
|
|
5100
6650
|
def check_lower(cls, value):
|
|
@@ -5151,6 +6701,34 @@ class _UniffiConverterMapStringString(_UniffiConverterRustBuffer):
|
|
|
5151
6701
|
d[key] = val
|
|
5152
6702
|
return d
|
|
5153
6703
|
|
|
6704
|
+
|
|
6705
|
+
class _UniffiConverterTypeCommonU128:
|
|
6706
|
+
@staticmethod
|
|
6707
|
+
def write(value, buf):
|
|
6708
|
+
builtin_value = str(value)
|
|
6709
|
+
_UniffiConverterString.write(builtin_value, buf)
|
|
6710
|
+
|
|
6711
|
+
@staticmethod
|
|
6712
|
+
def read(buf):
|
|
6713
|
+
builtin_value = _UniffiConverterString.read(buf)
|
|
6714
|
+
return int(builtin_value)
|
|
6715
|
+
|
|
6716
|
+
@staticmethod
|
|
6717
|
+
def lift(value):
|
|
6718
|
+
builtin_value = _UniffiConverterString.lift(value)
|
|
6719
|
+
return int(builtin_value)
|
|
6720
|
+
|
|
6721
|
+
@staticmethod
|
|
6722
|
+
def check_lower(value):
|
|
6723
|
+
builtin_value = str(value)
|
|
6724
|
+
return _UniffiConverterString.check_lower(builtin_value)
|
|
6725
|
+
|
|
6726
|
+
@staticmethod
|
|
6727
|
+
def lower(value):
|
|
6728
|
+
builtin_value = str(value)
|
|
6729
|
+
return _UniffiConverterString.lower(builtin_value)
|
|
6730
|
+
CommonU128 = str
|
|
6731
|
+
|
|
5154
6732
|
# Async support# RustFuturePoll values
|
|
5155
6733
|
_UNIFFI_RUST_FUTURE_POLL_READY = 0
|
|
5156
6734
|
_UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1
|
|
@@ -5271,9 +6849,9 @@ __all__ = [
|
|
|
5271
6849
|
"InputType",
|
|
5272
6850
|
"LnurlCallbackStatus",
|
|
5273
6851
|
"ServiceConnectivityError",
|
|
5274
|
-
"SparkAddressPaymentType",
|
|
5275
6852
|
"SuccessAction",
|
|
5276
6853
|
"SuccessActionProcessed",
|
|
6854
|
+
"SyncStorageError",
|
|
5277
6855
|
"AesSuccessActionData",
|
|
5278
6856
|
"AesSuccessActionDataDecrypted",
|
|
5279
6857
|
"Bip21Details",
|
|
@@ -5290,7 +6868,9 @@ __all__ = [
|
|
|
5290
6868
|
"Bolt12OfferBlindedPath",
|
|
5291
6869
|
"Bolt12OfferDetails",
|
|
5292
6870
|
"CurrencyInfo",
|
|
6871
|
+
"ExternalInputParser",
|
|
5293
6872
|
"FiatCurrency",
|
|
6873
|
+
"IncomingChange",
|
|
5294
6874
|
"LightningAddressDetails",
|
|
5295
6875
|
"LnurlAuthRequestDetails",
|
|
5296
6876
|
"LnurlErrorDetails",
|
|
@@ -5299,17 +6879,21 @@ __all__ = [
|
|
|
5299
6879
|
"LocaleOverrides",
|
|
5300
6880
|
"LocalizedName",
|
|
5301
6881
|
"MessageSuccessActionData",
|
|
6882
|
+
"OutgoingChange",
|
|
5302
6883
|
"PaymentRequestSource",
|
|
5303
6884
|
"Rate",
|
|
6885
|
+
"Record",
|
|
6886
|
+
"RecordChange",
|
|
6887
|
+
"RecordId",
|
|
5304
6888
|
"RestResponse",
|
|
5305
|
-
"SatsPaymentDetails",
|
|
5306
6889
|
"SilentPaymentAddressDetails",
|
|
5307
|
-
"SparkAddress",
|
|
5308
6890
|
"SparkAddressDetails",
|
|
5309
|
-
"
|
|
6891
|
+
"SparkInvoiceDetails",
|
|
5310
6892
|
"Symbol",
|
|
5311
|
-
"
|
|
6893
|
+
"UnversionedRecordChange",
|
|
5312
6894
|
"UrlSuccessActionData",
|
|
6895
|
+
"FiatService",
|
|
5313
6896
|
"RestClient",
|
|
6897
|
+
"SyncStorage",
|
|
5314
6898
|
]
|
|
5315
6899
|
|