breez-sdk-spark 0.2.5.dev1__cp39-cp39-win_amd64.whl → 0.3.0rc1__cp39-cp39-win_amd64.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 +60 -5
- breez_sdk_spark/breez_sdk_spark.py +1277 -238
- breez_sdk_spark/breez_sdk_spark_bindings.dll +0 -0
- {breez_sdk_spark-0.2.5.dev1.dist-info → breez_sdk_spark-0.3.0rc1.dist-info}/METADATA +1 -1
- breez_sdk_spark-0.3.0rc1.dist-info/RECORD +12 -0
- breez_sdk_spark-0.2.5.dev1.dist-info/RECORD +0 -12
- {breez_sdk_spark-0.2.5.dev1.dist-info → breez_sdk_spark-0.3.0rc1.dist-info}/WHEEL +0 -0
- {breez_sdk_spark-0.2.5.dev1.dist-info → breez_sdk_spark-0.3.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -509,7 +509,7 @@ def _uniffi_check_api_checksums(lib):
|
|
|
509
509
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
510
510
|
if lib.uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_broadcast_transaction() != 65179:
|
|
511
511
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
512
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener() !=
|
|
512
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener() != 37737:
|
|
513
513
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
514
514
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available() != 31624:
|
|
515
515
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
@@ -517,7 +517,7 @@ def _uniffi_check_api_checksums(lib):
|
|
|
517
517
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
518
518
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_delete_lightning_address() != 44132:
|
|
519
519
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
520
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect() !=
|
|
520
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_disconnect() != 330:
|
|
521
521
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
522
522
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_info() != 6771:
|
|
523
523
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
@@ -525,6 +525,8 @@ def _uniffi_check_api_checksums(lib):
|
|
|
525
525
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
526
526
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment() != 11540:
|
|
527
527
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
528
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata() != 40125:
|
|
529
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
528
530
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies() != 63366:
|
|
529
531
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
530
532
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates() != 5904:
|
|
@@ -535,27 +537,23 @@ def _uniffi_check_api_checksums(lib):
|
|
|
535
537
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
536
538
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() != 10147:
|
|
537
539
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
538
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() != 57601:
|
|
539
|
-
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
540
540
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() != 37691:
|
|
541
541
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
542
542
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment() != 34185:
|
|
543
543
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
544
544
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment() != 36984:
|
|
545
545
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
546
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address() != 43367:
|
|
547
|
-
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
548
546
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit() != 33646:
|
|
549
547
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
550
548
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_register_lightning_address() != 530:
|
|
551
549
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
552
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener() !=
|
|
550
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener() != 41066:
|
|
553
551
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
554
552
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() != 54349:
|
|
555
553
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
556
|
-
if lib.
|
|
554
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() != 30368:
|
|
557
555
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
558
|
-
if lib.
|
|
556
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment() != 64922:
|
|
559
557
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
560
558
|
if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build() != 8126:
|
|
561
559
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
@@ -575,7 +573,7 @@ def _uniffi_check_api_checksums(lib):
|
|
|
575
573
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
576
574
|
if lib.uniffi_breez_sdk_spark_checksum_method_storage_set_cached_item() != 7970:
|
|
577
575
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
578
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_storage_list_payments() !=
|
|
576
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_storage_list_payments() != 19728:
|
|
579
577
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
580
578
|
if lib.uniffi_breez_sdk_spark_checksum_method_storage_insert_payment() != 28075:
|
|
581
579
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
@@ -583,17 +581,19 @@ def _uniffi_check_api_checksums(lib):
|
|
|
583
581
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
584
582
|
if lib.uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_id() != 35394:
|
|
585
583
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
586
|
-
if lib.
|
|
584
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice() != 57075:
|
|
585
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
586
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_storage_add_deposit() != 60240:
|
|
587
587
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
588
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit() !=
|
|
588
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_storage_delete_deposit() != 60586:
|
|
589
589
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
590
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_storage_list_deposits() !=
|
|
590
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_storage_list_deposits() != 54118:
|
|
591
591
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
592
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() !=
|
|
592
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() != 39803:
|
|
593
593
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
594
594
|
if lib.uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() != 53882:
|
|
595
595
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
596
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event() !=
|
|
596
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event() != 24807:
|
|
597
597
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
598
598
|
if lib.uniffi_breez_sdk_spark_checksum_method_logger_log() != 11839:
|
|
599
599
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
@@ -703,8 +703,7 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure):
|
|
|
703
703
|
]
|
|
704
704
|
_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructVoid,
|
|
705
705
|
)
|
|
706
|
-
_UNIFFI_CALLBACK_INTERFACE_EVENT_LISTENER_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.
|
|
707
|
-
ctypes.POINTER(_UniffiRustCallStatus),
|
|
706
|
+
_UNIFFI_CALLBACK_INTERFACE_EVENT_LISTENER_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
708
707
|
)
|
|
709
708
|
_UNIFFI_CALLBACK_INTERFACE_LOGGER_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_void_p,
|
|
710
709
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
@@ -723,7 +722,7 @@ _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint
|
|
|
723
722
|
)
|
|
724
723
|
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
725
724
|
)
|
|
726
|
-
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,
|
|
725
|
+
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
727
726
|
)
|
|
728
727
|
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD4 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
729
728
|
)
|
|
@@ -731,13 +730,15 @@ _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD5 = ctypes.CFUNCTYPE(None,ctypes.c_uint
|
|
|
731
730
|
)
|
|
732
731
|
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD6 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
733
732
|
)
|
|
734
|
-
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD7 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,
|
|
733
|
+
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD7 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
734
|
+
)
|
|
735
|
+
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD8 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_uint32,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
735
736
|
)
|
|
736
|
-
|
|
737
|
+
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD9 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_uint32,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
737
738
|
)
|
|
738
|
-
|
|
739
|
+
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD10 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
739
740
|
)
|
|
740
|
-
|
|
741
|
+
_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD11 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,ctypes.c_uint32,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
741
742
|
)
|
|
742
743
|
class _UniffiVTableCallbackInterfaceEventListener(ctypes.Structure):
|
|
743
744
|
_fields_ = [
|
|
@@ -766,10 +767,11 @@ class _UniffiVTableCallbackInterfaceStorage(ctypes.Structure):
|
|
|
766
767
|
("insert_payment", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD4),
|
|
767
768
|
("set_payment_metadata", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD5),
|
|
768
769
|
("get_payment_by_id", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD6),
|
|
769
|
-
("
|
|
770
|
-
("
|
|
771
|
-
("
|
|
772
|
-
("
|
|
770
|
+
("get_payment_by_invoice", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD7),
|
|
771
|
+
("add_deposit", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD8),
|
|
772
|
+
("delete_deposit", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD9),
|
|
773
|
+
("list_deposits", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD10),
|
|
774
|
+
("update_deposit", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD11),
|
|
773
775
|
("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
|
|
774
776
|
]
|
|
775
777
|
_UniffiLib.uniffi_breez_sdk_spark_fn_clone_bitcoinchainservice.argtypes = (
|
|
@@ -819,9 +821,8 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_free_breezsdk.restype = None
|
|
|
819
821
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener.argtypes = (
|
|
820
822
|
ctypes.c_void_p,
|
|
821
823
|
ctypes.c_uint64,
|
|
822
|
-
ctypes.POINTER(_UniffiRustCallStatus),
|
|
823
824
|
)
|
|
824
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener.restype =
|
|
825
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener.restype = ctypes.c_uint64
|
|
825
826
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_lightning_address_available.argtypes = (
|
|
826
827
|
ctypes.c_void_p,
|
|
827
828
|
_UniffiRustBuffer,
|
|
@@ -838,9 +839,8 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_delete_lightning_address.ar
|
|
|
838
839
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_delete_lightning_address.restype = ctypes.c_uint64
|
|
839
840
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect.argtypes = (
|
|
840
841
|
ctypes.c_void_p,
|
|
841
|
-
ctypes.POINTER(_UniffiRustCallStatus),
|
|
842
842
|
)
|
|
843
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect.restype =
|
|
843
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect.restype = ctypes.c_uint64
|
|
844
844
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_info.argtypes = (
|
|
845
845
|
ctypes.c_void_p,
|
|
846
846
|
_UniffiRustBuffer,
|
|
@@ -855,6 +855,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_payment.argtypes = (
|
|
|
855
855
|
_UniffiRustBuffer,
|
|
856
856
|
)
|
|
857
857
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_payment.restype = ctypes.c_uint64
|
|
858
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_tokens_metadata.argtypes = (
|
|
859
|
+
ctypes.c_void_p,
|
|
860
|
+
_UniffiRustBuffer,
|
|
861
|
+
)
|
|
862
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_tokens_metadata.restype = ctypes.c_uint64
|
|
858
863
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_currencies.argtypes = (
|
|
859
864
|
ctypes.c_void_p,
|
|
860
865
|
)
|
|
@@ -878,13 +883,6 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.argtypes = (
|
|
|
878
883
|
_UniffiRustBuffer,
|
|
879
884
|
)
|
|
880
885
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.restype = ctypes.c_uint64
|
|
881
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment.argtypes = (
|
|
882
|
-
ctypes.c_void_p,
|
|
883
|
-
_UniffiRustBuffer,
|
|
884
|
-
_UniffiRustBuffer,
|
|
885
|
-
ctypes.POINTER(_UniffiRustCallStatus),
|
|
886
|
-
)
|
|
887
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment.restype = None
|
|
888
886
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_lnurl_pay.argtypes = (
|
|
889
887
|
ctypes.c_void_p,
|
|
890
888
|
_UniffiRustBuffer,
|
|
@@ -900,10 +898,6 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_receive_payment.argtypes =
|
|
|
900
898
|
_UniffiRustBuffer,
|
|
901
899
|
)
|
|
902
900
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_receive_payment.restype = ctypes.c_uint64
|
|
903
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address.argtypes = (
|
|
904
|
-
ctypes.c_void_p,
|
|
905
|
-
)
|
|
906
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address.restype = ctypes.c_uint64
|
|
907
901
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_refund_deposit.argtypes = (
|
|
908
902
|
ctypes.c_void_p,
|
|
909
903
|
_UniffiRustBuffer,
|
|
@@ -917,26 +911,23 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_register_lightning_address.
|
|
|
917
911
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener.argtypes = (
|
|
918
912
|
ctypes.c_void_p,
|
|
919
913
|
_UniffiRustBuffer,
|
|
920
|
-
ctypes.POINTER(_UniffiRustCallStatus),
|
|
921
914
|
)
|
|
922
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener.restype = ctypes.
|
|
915
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener.restype = ctypes.c_uint64
|
|
923
916
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment.argtypes = (
|
|
924
917
|
ctypes.c_void_p,
|
|
925
918
|
_UniffiRustBuffer,
|
|
926
919
|
)
|
|
927
920
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment.restype = ctypes.c_uint64
|
|
928
|
-
_UniffiLib.
|
|
921
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet.argtypes = (
|
|
929
922
|
ctypes.c_void_p,
|
|
930
923
|
_UniffiRustBuffer,
|
|
931
|
-
ctypes.c_int8,
|
|
932
924
|
)
|
|
933
|
-
_UniffiLib.
|
|
934
|
-
_UniffiLib.
|
|
925
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet.restype = ctypes.c_uint64
|
|
926
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment.argtypes = (
|
|
935
927
|
ctypes.c_void_p,
|
|
936
928
|
_UniffiRustBuffer,
|
|
937
|
-
ctypes.POINTER(_UniffiRustCallStatus),
|
|
938
929
|
)
|
|
939
|
-
_UniffiLib.
|
|
930
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment.restype = ctypes.c_uint64
|
|
940
931
|
_UniffiLib.uniffi_breez_sdk_spark_fn_clone_sdkbuilder.argtypes = (
|
|
941
932
|
ctypes.c_void_p,
|
|
942
933
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
@@ -1019,7 +1010,6 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_set_cached_item.restype = ct
|
|
|
1019
1010
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_list_payments.argtypes = (
|
|
1020
1011
|
ctypes.c_void_p,
|
|
1021
1012
|
_UniffiRustBuffer,
|
|
1022
|
-
_UniffiRustBuffer,
|
|
1023
1013
|
)
|
|
1024
1014
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_list_payments.restype = ctypes.c_uint64
|
|
1025
1015
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_insert_payment.argtypes = (
|
|
@@ -1038,6 +1028,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_get_payment_by_id.argtypes =
|
|
|
1038
1028
|
_UniffiRustBuffer,
|
|
1039
1029
|
)
|
|
1040
1030
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_get_payment_by_id.restype = ctypes.c_uint64
|
|
1031
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_get_payment_by_invoice.argtypes = (
|
|
1032
|
+
ctypes.c_void_p,
|
|
1033
|
+
_UniffiRustBuffer,
|
|
1034
|
+
)
|
|
1035
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_get_payment_by_invoice.restype = ctypes.c_uint64
|
|
1041
1036
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_add_deposit.argtypes = (
|
|
1042
1037
|
ctypes.c_void_p,
|
|
1043
1038
|
_UniffiRustBuffer,
|
|
@@ -1414,6 +1409,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_lightning_address
|
|
|
1414
1409
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment.argtypes = (
|
|
1415
1410
|
)
|
|
1416
1411
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment.restype = ctypes.c_uint16
|
|
1412
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata.argtypes = (
|
|
1413
|
+
)
|
|
1414
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata.restype = ctypes.c_uint16
|
|
1417
1415
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies.argtypes = (
|
|
1418
1416
|
)
|
|
1419
1417
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies.restype = ctypes.c_uint16
|
|
@@ -1429,9 +1427,6 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_unclaimed_deposi
|
|
|
1429
1427
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay.argtypes = (
|
|
1430
1428
|
)
|
|
1431
1429
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay.restype = ctypes.c_uint16
|
|
1432
|
-
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment.argtypes = (
|
|
1433
|
-
)
|
|
1434
|
-
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment.restype = ctypes.c_uint16
|
|
1435
1430
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay.argtypes = (
|
|
1436
1431
|
)
|
|
1437
1432
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay.restype = ctypes.c_uint16
|
|
@@ -1441,9 +1436,6 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment.
|
|
|
1441
1436
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment.argtypes = (
|
|
1442
1437
|
)
|
|
1443
1438
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment.restype = ctypes.c_uint16
|
|
1444
|
-
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address.argtypes = (
|
|
1445
|
-
)
|
|
1446
|
-
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address.restype = ctypes.c_uint16
|
|
1447
1439
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit.argtypes = (
|
|
1448
1440
|
)
|
|
1449
1441
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit.restype = ctypes.c_uint16
|
|
@@ -1456,12 +1448,12 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener
|
|
|
1456
1448
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment.argtypes = (
|
|
1457
1449
|
)
|
|
1458
1450
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment.restype = ctypes.c_uint16
|
|
1459
|
-
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal.argtypes = (
|
|
1460
|
-
)
|
|
1461
|
-
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal.restype = ctypes.c_uint16
|
|
1462
1451
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet.argtypes = (
|
|
1463
1452
|
)
|
|
1464
1453
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet.restype = ctypes.c_uint16
|
|
1454
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment.argtypes = (
|
|
1455
|
+
)
|
|
1456
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment.restype = ctypes.c_uint16
|
|
1465
1457
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build.argtypes = (
|
|
1466
1458
|
)
|
|
1467
1459
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build.restype = ctypes.c_uint16
|
|
@@ -1501,6 +1493,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_storage_set_payment_metadata.r
|
|
|
1501
1493
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_id.argtypes = (
|
|
1502
1494
|
)
|
|
1503
1495
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_id.restype = ctypes.c_uint16
|
|
1496
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice.argtypes = (
|
|
1497
|
+
)
|
|
1498
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_storage_get_payment_by_invoice.restype = ctypes.c_uint16
|
|
1504
1499
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_storage_add_deposit.argtypes = (
|
|
1505
1500
|
)
|
|
1506
1501
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_storage_add_deposit.restype = ctypes.c_uint16
|
|
@@ -2018,6 +2013,17 @@ class BreezSdkProtocol(typing.Protocol):
|
|
|
2018
2013
|
def get_lightning_address(self, ):
|
|
2019
2014
|
raise NotImplementedError
|
|
2020
2015
|
def get_payment(self, request: "GetPaymentRequest"):
|
|
2016
|
+
raise NotImplementedError
|
|
2017
|
+
def get_tokens_metadata(self, request: "GetTokensMetadataRequest"):
|
|
2018
|
+
"""
|
|
2019
|
+
Returns the metadata for the given token identifiers.
|
|
2020
|
+
|
|
2021
|
+
Results are not guaranteed to be in the same order as the input token identifiers.
|
|
2022
|
+
|
|
2023
|
+
If the metadata is not found locally in cache, it will be queried from
|
|
2024
|
+
the Spark network and then cached.
|
|
2025
|
+
"""
|
|
2026
|
+
|
|
2021
2027
|
raise NotImplementedError
|
|
2022
2028
|
def list_fiat_currencies(self, ):
|
|
2023
2029
|
"""
|
|
@@ -2055,19 +2061,11 @@ class BreezSdkProtocol(typing.Protocol):
|
|
|
2055
2061
|
raise NotImplementedError
|
|
2056
2062
|
def lnurl_pay(self, request: "LnurlPayRequest"):
|
|
2057
2063
|
raise NotImplementedError
|
|
2058
|
-
def poll_lightning_send_payment(self, payment: "Payment",ssp_id: "str"):
|
|
2059
|
-
raise NotImplementedError
|
|
2060
2064
|
def prepare_lnurl_pay(self, request: "PrepareLnurlPayRequest"):
|
|
2061
2065
|
raise NotImplementedError
|
|
2062
2066
|
def prepare_send_payment(self, request: "PrepareSendPaymentRequest"):
|
|
2063
2067
|
raise NotImplementedError
|
|
2064
2068
|
def receive_payment(self, request: "ReceivePaymentRequest"):
|
|
2065
|
-
raise NotImplementedError
|
|
2066
|
-
def recover_lightning_address(self, ):
|
|
2067
|
-
"""
|
|
2068
|
-
Attempts to recover a lightning address from the lnurl server.
|
|
2069
|
-
"""
|
|
2070
|
-
|
|
2071
2069
|
raise NotImplementedError
|
|
2072
2070
|
def refund_deposit(self, request: "RefundDepositRequest"):
|
|
2073
2071
|
raise NotImplementedError
|
|
@@ -2089,14 +2087,14 @@ class BreezSdkProtocol(typing.Protocol):
|
|
|
2089
2087
|
raise NotImplementedError
|
|
2090
2088
|
def send_payment(self, request: "SendPaymentRequest"):
|
|
2091
2089
|
raise NotImplementedError
|
|
2092
|
-
def send_payment_internal(self, request: "SendPaymentRequest",suppress_payment_event: "bool"):
|
|
2093
|
-
raise NotImplementedError
|
|
2094
2090
|
def sync_wallet(self, request: "SyncWalletRequest"):
|
|
2095
2091
|
"""
|
|
2096
2092
|
Synchronizes the wallet with the Spark network
|
|
2097
2093
|
"""
|
|
2098
2094
|
|
|
2099
2095
|
raise NotImplementedError
|
|
2096
|
+
def wait_for_payment(self, request: "WaitForPaymentRequest"):
|
|
2097
|
+
raise NotImplementedError
|
|
2100
2098
|
|
|
2101
2099
|
|
|
2102
2100
|
class BreezSdk:
|
|
@@ -2128,8 +2126,7 @@ class BreezSdk:
|
|
|
2128
2126
|
inst._pointer = pointer
|
|
2129
2127
|
return inst
|
|
2130
2128
|
|
|
2131
|
-
|
|
2132
|
-
def add_event_listener(self, listener: "EventListener") -> "str":
|
|
2129
|
+
async def add_event_listener(self, listener: "EventListener") -> "str":
|
|
2133
2130
|
"""
|
|
2134
2131
|
Registers a listener to receive SDK events
|
|
2135
2132
|
|
|
@@ -2144,11 +2141,22 @@ class BreezSdk:
|
|
|
2144
2141
|
|
|
2145
2142
|
_UniffiConverterTypeEventListener.check_lower(listener)
|
|
2146
2143
|
|
|
2147
|
-
return
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
)
|
|
2144
|
+
return await _uniffi_rust_call_async(
|
|
2145
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_add_event_listener(
|
|
2146
|
+
self._uniffi_clone_pointer(),
|
|
2147
|
+
_UniffiConverterTypeEventListener.lower(listener)
|
|
2148
|
+
),
|
|
2149
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
2150
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
2151
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
2152
|
+
# lift function
|
|
2153
|
+
_UniffiConverterString.lift,
|
|
2154
|
+
|
|
2155
|
+
# Error FFI converter
|
|
2156
|
+
|
|
2157
|
+
None,
|
|
2151
2158
|
|
|
2159
|
+
)
|
|
2152
2160
|
|
|
2153
2161
|
|
|
2154
2162
|
|
|
@@ -2214,8 +2222,8 @@ _UniffiConverterTypeSdkError,
|
|
|
2214
2222
|
|
|
2215
2223
|
|
|
2216
2224
|
|
|
2225
|
+
async def disconnect(self, ) -> None:
|
|
2217
2226
|
|
|
2218
|
-
def disconnect(self, ) -> None:
|
|
2219
2227
|
"""
|
|
2220
2228
|
Stops the SDK's background tasks
|
|
2221
2229
|
|
|
@@ -2227,9 +2235,21 @@ _UniffiConverterTypeSdkError,
|
|
|
2227
2235
|
Result containing either success or an `SdkError` if the background task couldn't be stopped
|
|
2228
2236
|
"""
|
|
2229
2237
|
|
|
2230
|
-
|
|
2231
|
-
|
|
2238
|
+
return await _uniffi_rust_call_async(
|
|
2239
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_disconnect(
|
|
2240
|
+
self._uniffi_clone_pointer(),
|
|
2241
|
+
),
|
|
2242
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_void,
|
|
2243
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_void,
|
|
2244
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_void,
|
|
2245
|
+
# lift function
|
|
2246
|
+
lambda val: None,
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
# Error FFI converter
|
|
2250
|
+
_UniffiConverterTypeSdkError,
|
|
2232
2251
|
|
|
2252
|
+
)
|
|
2233
2253
|
|
|
2234
2254
|
|
|
2235
2255
|
|
|
@@ -2297,6 +2317,36 @@ _UniffiConverterTypeSdkError,
|
|
|
2297
2317
|
|
|
2298
2318
|
|
|
2299
2319
|
|
|
2320
|
+
async def get_tokens_metadata(self, request: "GetTokensMetadataRequest") -> "GetTokensMetadataResponse":
|
|
2321
|
+
"""
|
|
2322
|
+
Returns the metadata for the given token identifiers.
|
|
2323
|
+
|
|
2324
|
+
Results are not guaranteed to be in the same order as the input token identifiers.
|
|
2325
|
+
|
|
2326
|
+
If the metadata is not found locally in cache, it will be queried from
|
|
2327
|
+
the Spark network and then cached.
|
|
2328
|
+
"""
|
|
2329
|
+
|
|
2330
|
+
_UniffiConverterTypeGetTokensMetadataRequest.check_lower(request)
|
|
2331
|
+
|
|
2332
|
+
return await _uniffi_rust_call_async(
|
|
2333
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_tokens_metadata(
|
|
2334
|
+
self._uniffi_clone_pointer(),
|
|
2335
|
+
_UniffiConverterTypeGetTokensMetadataRequest.lower(request)
|
|
2336
|
+
),
|
|
2337
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
2338
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
2339
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
2340
|
+
# lift function
|
|
2341
|
+
_UniffiConverterTypeGetTokensMetadataResponse.lift,
|
|
2342
|
+
|
|
2343
|
+
# Error FFI converter
|
|
2344
|
+
_UniffiConverterTypeSdkError,
|
|
2345
|
+
|
|
2346
|
+
)
|
|
2347
|
+
|
|
2348
|
+
|
|
2349
|
+
|
|
2300
2350
|
async def list_fiat_currencies(self, ) -> "ListFiatCurrenciesResponse":
|
|
2301
2351
|
"""
|
|
2302
2352
|
List fiat currencies for which there is a known exchange rate,
|
|
@@ -2422,20 +2472,6 @@ _UniffiConverterTypeSdkError,
|
|
|
2422
2472
|
|
|
2423
2473
|
|
|
2424
2474
|
|
|
2425
|
-
|
|
2426
|
-
def poll_lightning_send_payment(self, payment: "Payment",ssp_id: "str") -> None:
|
|
2427
|
-
_UniffiConverterTypePayment.check_lower(payment)
|
|
2428
|
-
|
|
2429
|
-
_UniffiConverterString.check_lower(ssp_id)
|
|
2430
|
-
|
|
2431
|
-
_uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment,self._uniffi_clone_pointer(),
|
|
2432
|
-
_UniffiConverterTypePayment.lower(payment),
|
|
2433
|
-
_UniffiConverterString.lower(ssp_id))
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
2475
|
async def prepare_lnurl_pay(self, request: "PrepareLnurlPayRequest") -> "PrepareLnurlPayResponse":
|
|
2440
2476
|
_UniffiConverterTypePrepareLnurlPayRequest.check_lower(request)
|
|
2441
2477
|
|
|
@@ -2499,28 +2535,6 @@ _UniffiConverterTypeSdkError,
|
|
|
2499
2535
|
|
|
2500
2536
|
|
|
2501
2537
|
|
|
2502
|
-
async def recover_lightning_address(self, ) -> "typing.Optional[LightningAddressInfo]":
|
|
2503
|
-
"""
|
|
2504
|
-
Attempts to recover a lightning address from the lnurl server.
|
|
2505
|
-
"""
|
|
2506
|
-
|
|
2507
|
-
return await _uniffi_rust_call_async(
|
|
2508
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address(
|
|
2509
|
-
self._uniffi_clone_pointer(),
|
|
2510
|
-
),
|
|
2511
|
-
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
2512
|
-
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
2513
|
-
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
2514
|
-
# lift function
|
|
2515
|
-
_UniffiConverterOptionalTypeLightningAddressInfo.lift,
|
|
2516
|
-
|
|
2517
|
-
# Error FFI converter
|
|
2518
|
-
_UniffiConverterTypeSdkError,
|
|
2519
|
-
|
|
2520
|
-
)
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
2538
|
async def refund_deposit(self, request: "RefundDepositRequest") -> "RefundDepositResponse":
|
|
2525
2539
|
_UniffiConverterTypeRefundDepositRequest.check_lower(request)
|
|
2526
2540
|
|
|
@@ -2563,8 +2577,7 @@ _UniffiConverterTypeSdkError,
|
|
|
2563
2577
|
|
|
2564
2578
|
|
|
2565
2579
|
|
|
2566
|
-
|
|
2567
|
-
def remove_event_listener(self, id: "str") -> "bool":
|
|
2580
|
+
async def remove_event_listener(self, id: "str") -> "bool":
|
|
2568
2581
|
"""
|
|
2569
2582
|
Removes a previously registered event listener
|
|
2570
2583
|
|
|
@@ -2579,11 +2592,22 @@ _UniffiConverterTypeSdkError,
|
|
|
2579
2592
|
|
|
2580
2593
|
_UniffiConverterString.check_lower(id)
|
|
2581
2594
|
|
|
2582
|
-
return
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
)
|
|
2595
|
+
return await _uniffi_rust_call_async(
|
|
2596
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener(
|
|
2597
|
+
self._uniffi_clone_pointer(),
|
|
2598
|
+
_UniffiConverterString.lower(id)
|
|
2599
|
+
),
|
|
2600
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_i8,
|
|
2601
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_i8,
|
|
2602
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_i8,
|
|
2603
|
+
# lift function
|
|
2604
|
+
_UniffiConverterBool.lift,
|
|
2605
|
+
|
|
2606
|
+
# Error FFI converter
|
|
2607
|
+
|
|
2608
|
+
None,
|
|
2586
2609
|
|
|
2610
|
+
)
|
|
2587
2611
|
|
|
2588
2612
|
|
|
2589
2613
|
|
|
@@ -2608,22 +2632,23 @@ _UniffiConverterTypeSdkError,
|
|
|
2608
2632
|
|
|
2609
2633
|
|
|
2610
2634
|
|
|
2611
|
-
async def
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2635
|
+
async def sync_wallet(self, request: "SyncWalletRequest") -> "SyncWalletResponse":
|
|
2636
|
+
"""
|
|
2637
|
+
Synchronizes the wallet with the Spark network
|
|
2638
|
+
"""
|
|
2639
|
+
|
|
2640
|
+
_UniffiConverterTypeSyncWalletRequest.check_lower(request)
|
|
2615
2641
|
|
|
2616
2642
|
return await _uniffi_rust_call_async(
|
|
2617
|
-
_UniffiLib.
|
|
2643
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet(
|
|
2618
2644
|
self._uniffi_clone_pointer(),
|
|
2619
|
-
|
|
2620
|
-
_UniffiConverterBool.lower(suppress_payment_event)
|
|
2645
|
+
_UniffiConverterTypeSyncWalletRequest.lower(request)
|
|
2621
2646
|
),
|
|
2622
2647
|
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
2623
2648
|
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
2624
2649
|
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
2625
2650
|
# lift function
|
|
2626
|
-
|
|
2651
|
+
_UniffiConverterTypeSyncWalletResponse.lift,
|
|
2627
2652
|
|
|
2628
2653
|
# Error FFI converter
|
|
2629
2654
|
_UniffiConverterTypeSdkError,
|
|
@@ -2632,19 +2657,24 @@ _UniffiConverterTypeSdkError,
|
|
|
2632
2657
|
|
|
2633
2658
|
|
|
2634
2659
|
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
"""
|
|
2638
|
-
Synchronizes the wallet with the Spark network
|
|
2639
|
-
"""
|
|
2640
|
-
|
|
2641
|
-
_UniffiConverterTypeSyncWalletRequest.check_lower(request)
|
|
2660
|
+
async def wait_for_payment(self, request: "WaitForPaymentRequest") -> "WaitForPaymentResponse":
|
|
2661
|
+
_UniffiConverterTypeWaitForPaymentRequest.check_lower(request)
|
|
2642
2662
|
|
|
2643
|
-
return
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
)
|
|
2663
|
+
return await _uniffi_rust_call_async(
|
|
2664
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment(
|
|
2665
|
+
self._uniffi_clone_pointer(),
|
|
2666
|
+
_UniffiConverterTypeWaitForPaymentRequest.lower(request)
|
|
2667
|
+
),
|
|
2668
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
2669
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
2670
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
2671
|
+
# lift function
|
|
2672
|
+
_UniffiConverterTypeWaitForPaymentResponse.lift,
|
|
2673
|
+
|
|
2674
|
+
# Error FFI converter
|
|
2675
|
+
_UniffiConverterTypeSdkError,
|
|
2647
2676
|
|
|
2677
|
+
)
|
|
2648
2678
|
|
|
2649
2679
|
|
|
2650
2680
|
|
|
@@ -2993,14 +3023,13 @@ class Storage(typing.Protocol):
|
|
|
2993
3023
|
raise NotImplementedError
|
|
2994
3024
|
def set_cached_item(self, key: "str",value: "str"):
|
|
2995
3025
|
raise NotImplementedError
|
|
2996
|
-
def list_payments(self,
|
|
3026
|
+
def list_payments(self, request: "ListPaymentsRequest"):
|
|
2997
3027
|
"""
|
|
2998
|
-
Lists payments with pagination
|
|
3028
|
+
Lists payments with optional filters and pagination
|
|
2999
3029
|
|
|
3000
3030
|
# Arguments
|
|
3001
3031
|
|
|
3002
|
-
* `
|
|
3003
|
-
* `limit` - Maximum number of records to return
|
|
3032
|
+
* `list_payments_request` - The request to list payments
|
|
3004
3033
|
|
|
3005
3034
|
# Returns
|
|
3006
3035
|
|
|
@@ -3049,6 +3078,18 @@ class Storage(typing.Protocol):
|
|
|
3049
3078
|
The payment if found or None if not found
|
|
3050
3079
|
"""
|
|
3051
3080
|
|
|
3081
|
+
raise NotImplementedError
|
|
3082
|
+
def get_payment_by_invoice(self, invoice: "str"):
|
|
3083
|
+
"""
|
|
3084
|
+
Gets a payment by its invoice
|
|
3085
|
+
# Arguments
|
|
3086
|
+
|
|
3087
|
+
* `invoice` - The invoice of the payment to retrieve
|
|
3088
|
+
# Returns
|
|
3089
|
+
|
|
3090
|
+
The payment if found or None if not found
|
|
3091
|
+
"""
|
|
3092
|
+
|
|
3052
3093
|
raise NotImplementedError
|
|
3053
3094
|
def add_deposit(self, txid: "str",vout: "int",amount_sats: "int"):
|
|
3054
3095
|
"""
|
|
@@ -3203,29 +3244,25 @@ _UniffiConverterTypeStorageError,
|
|
|
3203
3244
|
|
|
3204
3245
|
|
|
3205
3246
|
|
|
3206
|
-
async def list_payments(self,
|
|
3247
|
+
async def list_payments(self, request: "ListPaymentsRequest") -> "typing.List[Payment]":
|
|
3207
3248
|
"""
|
|
3208
|
-
Lists payments with pagination
|
|
3249
|
+
Lists payments with optional filters and pagination
|
|
3209
3250
|
|
|
3210
3251
|
# Arguments
|
|
3211
3252
|
|
|
3212
|
-
* `
|
|
3213
|
-
* `limit` - Maximum number of records to return
|
|
3253
|
+
* `list_payments_request` - The request to list payments
|
|
3214
3254
|
|
|
3215
3255
|
# Returns
|
|
3216
3256
|
|
|
3217
3257
|
A vector of payments or a `StorageError`
|
|
3218
3258
|
"""
|
|
3219
3259
|
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
_UniffiConverterOptionalUInt32.check_lower(limit)
|
|
3260
|
+
_UniffiConverterTypeListPaymentsRequest.check_lower(request)
|
|
3223
3261
|
|
|
3224
3262
|
return await _uniffi_rust_call_async(
|
|
3225
3263
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_list_payments(
|
|
3226
3264
|
self._uniffi_clone_pointer(),
|
|
3227
|
-
|
|
3228
|
-
_UniffiConverterOptionalUInt32.lower(limit)
|
|
3265
|
+
_UniffiConverterTypeListPaymentsRequest.lower(request)
|
|
3229
3266
|
),
|
|
3230
3267
|
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
3231
3268
|
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
@@ -3346,6 +3383,37 @@ _UniffiConverterTypeStorageError,
|
|
|
3346
3383
|
|
|
3347
3384
|
|
|
3348
3385
|
|
|
3386
|
+
async def get_payment_by_invoice(self, invoice: "str") -> "typing.Optional[Payment]":
|
|
3387
|
+
"""
|
|
3388
|
+
Gets a payment by its invoice
|
|
3389
|
+
# Arguments
|
|
3390
|
+
|
|
3391
|
+
* `invoice` - The invoice of the payment to retrieve
|
|
3392
|
+
# Returns
|
|
3393
|
+
|
|
3394
|
+
The payment if found or None if not found
|
|
3395
|
+
"""
|
|
3396
|
+
|
|
3397
|
+
_UniffiConverterString.check_lower(invoice)
|
|
3398
|
+
|
|
3399
|
+
return await _uniffi_rust_call_async(
|
|
3400
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_get_payment_by_invoice(
|
|
3401
|
+
self._uniffi_clone_pointer(),
|
|
3402
|
+
_UniffiConverterString.lower(invoice)
|
|
3403
|
+
),
|
|
3404
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
3405
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
3406
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
3407
|
+
# lift function
|
|
3408
|
+
_UniffiConverterOptionalTypePayment.lift,
|
|
3409
|
+
|
|
3410
|
+
# Error FFI converter
|
|
3411
|
+
_UniffiConverterTypeStorageError,
|
|
3412
|
+
|
|
3413
|
+
)
|
|
3414
|
+
|
|
3415
|
+
|
|
3416
|
+
|
|
3349
3417
|
async def add_deposit(self, txid: "str",vout: "int",amount_sats: "int") -> None:
|
|
3350
3418
|
|
|
3351
3419
|
"""
|
|
@@ -3600,15 +3668,14 @@ class _UniffiTraitImplStorage:
|
|
|
3600
3668
|
@_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD3
|
|
3601
3669
|
def list_payments(
|
|
3602
3670
|
uniffi_handle,
|
|
3603
|
-
|
|
3604
|
-
limit,
|
|
3671
|
+
request,
|
|
3605
3672
|
uniffi_future_callback,
|
|
3606
3673
|
uniffi_callback_data,
|
|
3607
3674
|
uniffi_out_return,
|
|
3608
3675
|
):
|
|
3609
3676
|
uniffi_obj = _UniffiConverterTypeStorage._handle_map.get(uniffi_handle)
|
|
3610
3677
|
def make_call():
|
|
3611
|
-
args = (
|
|
3678
|
+
args = (_UniffiConverterTypeListPaymentsRequest.lift(request), )
|
|
3612
3679
|
method = uniffi_obj.list_payments
|
|
3613
3680
|
return method(*args)
|
|
3614
3681
|
|
|
@@ -3732,6 +3799,40 @@ class _UniffiTraitImplStorage:
|
|
|
3732
3799
|
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, StorageError, _UniffiConverterTypeStorageError.lower)
|
|
3733
3800
|
|
|
3734
3801
|
@_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD7
|
|
3802
|
+
def get_payment_by_invoice(
|
|
3803
|
+
uniffi_handle,
|
|
3804
|
+
invoice,
|
|
3805
|
+
uniffi_future_callback,
|
|
3806
|
+
uniffi_callback_data,
|
|
3807
|
+
uniffi_out_return,
|
|
3808
|
+
):
|
|
3809
|
+
uniffi_obj = _UniffiConverterTypeStorage._handle_map.get(uniffi_handle)
|
|
3810
|
+
def make_call():
|
|
3811
|
+
args = (_UniffiConverterString.lift(invoice), )
|
|
3812
|
+
method = uniffi_obj.get_payment_by_invoice
|
|
3813
|
+
return method(*args)
|
|
3814
|
+
|
|
3815
|
+
|
|
3816
|
+
def handle_success(return_value):
|
|
3817
|
+
uniffi_future_callback(
|
|
3818
|
+
uniffi_callback_data,
|
|
3819
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
3820
|
+
_UniffiConverterOptionalTypePayment.lower(return_value),
|
|
3821
|
+
_UniffiRustCallStatus.default()
|
|
3822
|
+
)
|
|
3823
|
+
)
|
|
3824
|
+
|
|
3825
|
+
def handle_error(status_code, rust_buffer):
|
|
3826
|
+
uniffi_future_callback(
|
|
3827
|
+
uniffi_callback_data,
|
|
3828
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
3829
|
+
_UniffiRustBuffer.default(),
|
|
3830
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
3831
|
+
)
|
|
3832
|
+
)
|
|
3833
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, StorageError, _UniffiConverterTypeStorageError.lower)
|
|
3834
|
+
|
|
3835
|
+
@_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD8
|
|
3735
3836
|
def add_deposit(
|
|
3736
3837
|
uniffi_handle,
|
|
3737
3838
|
txid,
|
|
@@ -3765,7 +3866,7 @@ class _UniffiTraitImplStorage:
|
|
|
3765
3866
|
)
|
|
3766
3867
|
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, StorageError, _UniffiConverterTypeStorageError.lower)
|
|
3767
3868
|
|
|
3768
|
-
@
|
|
3869
|
+
@_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD9
|
|
3769
3870
|
def delete_deposit(
|
|
3770
3871
|
uniffi_handle,
|
|
3771
3872
|
txid,
|
|
@@ -3798,7 +3899,7 @@ class _UniffiTraitImplStorage:
|
|
|
3798
3899
|
)
|
|
3799
3900
|
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, StorageError, _UniffiConverterTypeStorageError.lower)
|
|
3800
3901
|
|
|
3801
|
-
@
|
|
3902
|
+
@_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD10
|
|
3802
3903
|
def list_deposits(
|
|
3803
3904
|
uniffi_handle,
|
|
3804
3905
|
uniffi_future_callback,
|
|
@@ -3831,7 +3932,7 @@ class _UniffiTraitImplStorage:
|
|
|
3831
3932
|
)
|
|
3832
3933
|
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, StorageError, _UniffiConverterTypeStorageError.lower)
|
|
3833
3934
|
|
|
3834
|
-
@
|
|
3935
|
+
@_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD11
|
|
3835
3936
|
def update_deposit(
|
|
3836
3937
|
uniffi_handle,
|
|
3837
3938
|
txid,
|
|
@@ -3878,6 +3979,7 @@ class _UniffiTraitImplStorage:
|
|
|
3878
3979
|
insert_payment,
|
|
3879
3980
|
set_payment_metadata,
|
|
3880
3981
|
get_payment_by_id,
|
|
3982
|
+
get_payment_by_invoice,
|
|
3881
3983
|
add_deposit,
|
|
3882
3984
|
delete_deposit,
|
|
3883
3985
|
list_deposits,
|
|
@@ -4243,26 +4345,32 @@ class GetInfoRequest:
|
|
|
4243
4345
|
Request to get the balance of the wallet
|
|
4244
4346
|
"""
|
|
4245
4347
|
|
|
4348
|
+
ensure_synced: "typing.Optional[bool]"
|
|
4349
|
+
def __init__(self, *, ensure_synced: "typing.Optional[bool]"):
|
|
4350
|
+
self.ensure_synced = ensure_synced
|
|
4246
4351
|
|
|
4247
4352
|
def __str__(self):
|
|
4248
|
-
return "GetInfoRequest()".format()
|
|
4353
|
+
return "GetInfoRequest(ensure_synced={})".format(self.ensure_synced)
|
|
4249
4354
|
|
|
4250
4355
|
def __eq__(self, other):
|
|
4356
|
+
if self.ensure_synced != other.ensure_synced:
|
|
4357
|
+
return False
|
|
4251
4358
|
return True
|
|
4252
4359
|
|
|
4253
4360
|
class _UniffiConverterTypeGetInfoRequest(_UniffiConverterRustBuffer):
|
|
4254
4361
|
@staticmethod
|
|
4255
4362
|
def read(buf):
|
|
4256
4363
|
return GetInfoRequest(
|
|
4364
|
+
ensure_synced=_UniffiConverterOptionalBool.read(buf),
|
|
4257
4365
|
)
|
|
4258
4366
|
|
|
4259
4367
|
@staticmethod
|
|
4260
4368
|
def check_lower(value):
|
|
4261
|
-
|
|
4369
|
+
_UniffiConverterOptionalBool.check_lower(value.ensure_synced)
|
|
4262
4370
|
|
|
4263
4371
|
@staticmethod
|
|
4264
4372
|
def write(value, buf):
|
|
4265
|
-
|
|
4373
|
+
_UniffiConverterOptionalBool.write(value.ensure_synced, buf)
|
|
4266
4374
|
|
|
4267
4375
|
|
|
4268
4376
|
class GetInfoResponse:
|
|
@@ -4275,15 +4383,23 @@ class GetInfoResponse:
|
|
|
4275
4383
|
The balance in satoshis
|
|
4276
4384
|
"""
|
|
4277
4385
|
|
|
4278
|
-
|
|
4386
|
+
token_balances: "dict[str, TokenBalance]"
|
|
4387
|
+
"""
|
|
4388
|
+
The balances of the tokens in the wallet keyed by the token identifier
|
|
4389
|
+
"""
|
|
4390
|
+
|
|
4391
|
+
def __init__(self, *, balance_sats: "int", token_balances: "dict[str, TokenBalance]"):
|
|
4279
4392
|
self.balance_sats = balance_sats
|
|
4393
|
+
self.token_balances = token_balances
|
|
4280
4394
|
|
|
4281
4395
|
def __str__(self):
|
|
4282
|
-
return "GetInfoResponse(balance_sats={})".format(self.balance_sats)
|
|
4396
|
+
return "GetInfoResponse(balance_sats={}, token_balances={})".format(self.balance_sats, self.token_balances)
|
|
4283
4397
|
|
|
4284
4398
|
def __eq__(self, other):
|
|
4285
4399
|
if self.balance_sats != other.balance_sats:
|
|
4286
4400
|
return False
|
|
4401
|
+
if self.token_balances != other.token_balances:
|
|
4402
|
+
return False
|
|
4287
4403
|
return True
|
|
4288
4404
|
|
|
4289
4405
|
class _UniffiConverterTypeGetInfoResponse(_UniffiConverterRustBuffer):
|
|
@@ -4291,15 +4407,18 @@ class _UniffiConverterTypeGetInfoResponse(_UniffiConverterRustBuffer):
|
|
|
4291
4407
|
def read(buf):
|
|
4292
4408
|
return GetInfoResponse(
|
|
4293
4409
|
balance_sats=_UniffiConverterUInt64.read(buf),
|
|
4410
|
+
token_balances=_UniffiConverterMapStringTypeTokenBalance.read(buf),
|
|
4294
4411
|
)
|
|
4295
4412
|
|
|
4296
4413
|
@staticmethod
|
|
4297
4414
|
def check_lower(value):
|
|
4298
4415
|
_UniffiConverterUInt64.check_lower(value.balance_sats)
|
|
4416
|
+
_UniffiConverterMapStringTypeTokenBalance.check_lower(value.token_balances)
|
|
4299
4417
|
|
|
4300
4418
|
@staticmethod
|
|
4301
4419
|
def write(value, buf):
|
|
4302
4420
|
_UniffiConverterUInt64.write(value.balance_sats, buf)
|
|
4421
|
+
_UniffiConverterMapStringTypeTokenBalance.write(value.token_balances, buf)
|
|
4303
4422
|
|
|
4304
4423
|
|
|
4305
4424
|
class GetPaymentRequest:
|
|
@@ -4360,22 +4479,80 @@ class _UniffiConverterTypeGetPaymentResponse(_UniffiConverterRustBuffer):
|
|
|
4360
4479
|
_UniffiConverterTypePayment.write(value.payment, buf)
|
|
4361
4480
|
|
|
4362
4481
|
|
|
4363
|
-
class
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
username: "str"
|
|
4368
|
-
def __init__(self, *, description: "str", lightning_address: "str", lnurl: "str", username: "str"):
|
|
4369
|
-
self.description = description
|
|
4370
|
-
self.lightning_address = lightning_address
|
|
4371
|
-
self.lnurl = lnurl
|
|
4372
|
-
self.username = username
|
|
4482
|
+
class GetTokensMetadataRequest:
|
|
4483
|
+
token_identifiers: "typing.List[str]"
|
|
4484
|
+
def __init__(self, *, token_identifiers: "typing.List[str]"):
|
|
4485
|
+
self.token_identifiers = token_identifiers
|
|
4373
4486
|
|
|
4374
4487
|
def __str__(self):
|
|
4375
|
-
return "
|
|
4488
|
+
return "GetTokensMetadataRequest(token_identifiers={})".format(self.token_identifiers)
|
|
4376
4489
|
|
|
4377
4490
|
def __eq__(self, other):
|
|
4378
|
-
if self.
|
|
4491
|
+
if self.token_identifiers != other.token_identifiers:
|
|
4492
|
+
return False
|
|
4493
|
+
return True
|
|
4494
|
+
|
|
4495
|
+
class _UniffiConverterTypeGetTokensMetadataRequest(_UniffiConverterRustBuffer):
|
|
4496
|
+
@staticmethod
|
|
4497
|
+
def read(buf):
|
|
4498
|
+
return GetTokensMetadataRequest(
|
|
4499
|
+
token_identifiers=_UniffiConverterSequenceString.read(buf),
|
|
4500
|
+
)
|
|
4501
|
+
|
|
4502
|
+
@staticmethod
|
|
4503
|
+
def check_lower(value):
|
|
4504
|
+
_UniffiConverterSequenceString.check_lower(value.token_identifiers)
|
|
4505
|
+
|
|
4506
|
+
@staticmethod
|
|
4507
|
+
def write(value, buf):
|
|
4508
|
+
_UniffiConverterSequenceString.write(value.token_identifiers, buf)
|
|
4509
|
+
|
|
4510
|
+
|
|
4511
|
+
class GetTokensMetadataResponse:
|
|
4512
|
+
tokens_metadata: "typing.List[TokenMetadata]"
|
|
4513
|
+
def __init__(self, *, tokens_metadata: "typing.List[TokenMetadata]"):
|
|
4514
|
+
self.tokens_metadata = tokens_metadata
|
|
4515
|
+
|
|
4516
|
+
def __str__(self):
|
|
4517
|
+
return "GetTokensMetadataResponse(tokens_metadata={})".format(self.tokens_metadata)
|
|
4518
|
+
|
|
4519
|
+
def __eq__(self, other):
|
|
4520
|
+
if self.tokens_metadata != other.tokens_metadata:
|
|
4521
|
+
return False
|
|
4522
|
+
return True
|
|
4523
|
+
|
|
4524
|
+
class _UniffiConverterTypeGetTokensMetadataResponse(_UniffiConverterRustBuffer):
|
|
4525
|
+
@staticmethod
|
|
4526
|
+
def read(buf):
|
|
4527
|
+
return GetTokensMetadataResponse(
|
|
4528
|
+
tokens_metadata=_UniffiConverterSequenceTypeTokenMetadata.read(buf),
|
|
4529
|
+
)
|
|
4530
|
+
|
|
4531
|
+
@staticmethod
|
|
4532
|
+
def check_lower(value):
|
|
4533
|
+
_UniffiConverterSequenceTypeTokenMetadata.check_lower(value.tokens_metadata)
|
|
4534
|
+
|
|
4535
|
+
@staticmethod
|
|
4536
|
+
def write(value, buf):
|
|
4537
|
+
_UniffiConverterSequenceTypeTokenMetadata.write(value.tokens_metadata, buf)
|
|
4538
|
+
|
|
4539
|
+
|
|
4540
|
+
class LightningAddressInfo:
|
|
4541
|
+
description: "str"
|
|
4542
|
+
lightning_address: "str"
|
|
4543
|
+
lnurl: "str"
|
|
4544
|
+
username: "str"
|
|
4545
|
+
def __init__(self, *, description: "str", lightning_address: "str", lnurl: "str", username: "str"):
|
|
4546
|
+
self.description = description
|
|
4547
|
+
self.lightning_address = lightning_address
|
|
4548
|
+
self.lnurl = lnurl
|
|
4549
|
+
self.username = username
|
|
4550
|
+
|
|
4551
|
+
def __str__(self):
|
|
4552
|
+
return "LightningAddressInfo(description={}, lightning_address={}, lnurl={}, username={})".format(self.description, self.lightning_address, self.lnurl, self.username)
|
|
4553
|
+
|
|
4554
|
+
def __eq__(self, other):
|
|
4555
|
+
if self.description != other.description:
|
|
4379
4556
|
return False
|
|
4380
4557
|
if self.lightning_address != other.lightning_address:
|
|
4381
4558
|
return False
|
|
@@ -4486,7 +4663,20 @@ class _UniffiConverterTypeListFiatRatesResponse(_UniffiConverterRustBuffer):
|
|
|
4486
4663
|
|
|
4487
4664
|
class ListPaymentsRequest:
|
|
4488
4665
|
"""
|
|
4489
|
-
Request to list payments with pagination
|
|
4666
|
+
Request to list payments with optional filters and pagination
|
|
4667
|
+
"""
|
|
4668
|
+
|
|
4669
|
+
type_filter: "typing.Optional[typing.List[PaymentType]]"
|
|
4670
|
+
status_filter: "typing.Optional[typing.List[PaymentStatus]]"
|
|
4671
|
+
asset_filter: "typing.Optional[AssetFilter]"
|
|
4672
|
+
from_timestamp: "typing.Optional[int]"
|
|
4673
|
+
"""
|
|
4674
|
+
Only include payments created after this timestamp (inclusive)
|
|
4675
|
+
"""
|
|
4676
|
+
|
|
4677
|
+
to_timestamp: "typing.Optional[int]"
|
|
4678
|
+
"""
|
|
4679
|
+
Only include payments created before this timestamp (exclusive)
|
|
4490
4680
|
"""
|
|
4491
4681
|
|
|
4492
4682
|
offset: "typing.Optional[int]"
|
|
@@ -4499,7 +4689,28 @@ class ListPaymentsRequest:
|
|
|
4499
4689
|
Maximum number of records to return
|
|
4500
4690
|
"""
|
|
4501
4691
|
|
|
4502
|
-
|
|
4692
|
+
sort_ascending: "typing.Optional[bool]"
|
|
4693
|
+
def __init__(self, *, type_filter: "typing.Optional[typing.List[PaymentType]]" = _DEFAULT, status_filter: "typing.Optional[typing.List[PaymentStatus]]" = _DEFAULT, asset_filter: "typing.Optional[AssetFilter]" = _DEFAULT, from_timestamp: "typing.Optional[int]" = _DEFAULT, to_timestamp: "typing.Optional[int]" = _DEFAULT, offset: "typing.Optional[int]" = _DEFAULT, limit: "typing.Optional[int]" = _DEFAULT, sort_ascending: "typing.Optional[bool]" = _DEFAULT):
|
|
4694
|
+
if type_filter is _DEFAULT:
|
|
4695
|
+
self.type_filter = None
|
|
4696
|
+
else:
|
|
4697
|
+
self.type_filter = type_filter
|
|
4698
|
+
if status_filter is _DEFAULT:
|
|
4699
|
+
self.status_filter = None
|
|
4700
|
+
else:
|
|
4701
|
+
self.status_filter = status_filter
|
|
4702
|
+
if asset_filter is _DEFAULT:
|
|
4703
|
+
self.asset_filter = None
|
|
4704
|
+
else:
|
|
4705
|
+
self.asset_filter = asset_filter
|
|
4706
|
+
if from_timestamp is _DEFAULT:
|
|
4707
|
+
self.from_timestamp = None
|
|
4708
|
+
else:
|
|
4709
|
+
self.from_timestamp = from_timestamp
|
|
4710
|
+
if to_timestamp is _DEFAULT:
|
|
4711
|
+
self.to_timestamp = None
|
|
4712
|
+
else:
|
|
4713
|
+
self.to_timestamp = to_timestamp
|
|
4503
4714
|
if offset is _DEFAULT:
|
|
4504
4715
|
self.offset = None
|
|
4505
4716
|
else:
|
|
@@ -4508,34 +4719,68 @@ class ListPaymentsRequest:
|
|
|
4508
4719
|
self.limit = None
|
|
4509
4720
|
else:
|
|
4510
4721
|
self.limit = limit
|
|
4722
|
+
if sort_ascending is _DEFAULT:
|
|
4723
|
+
self.sort_ascending = None
|
|
4724
|
+
else:
|
|
4725
|
+
self.sort_ascending = sort_ascending
|
|
4511
4726
|
|
|
4512
4727
|
def __str__(self):
|
|
4513
|
-
return "ListPaymentsRequest(offset={}, limit={})".format(self.offset, self.limit)
|
|
4728
|
+
return "ListPaymentsRequest(type_filter={}, status_filter={}, asset_filter={}, from_timestamp={}, to_timestamp={}, offset={}, limit={}, sort_ascending={})".format(self.type_filter, self.status_filter, self.asset_filter, self.from_timestamp, self.to_timestamp, self.offset, self.limit, self.sort_ascending)
|
|
4514
4729
|
|
|
4515
4730
|
def __eq__(self, other):
|
|
4731
|
+
if self.type_filter != other.type_filter:
|
|
4732
|
+
return False
|
|
4733
|
+
if self.status_filter != other.status_filter:
|
|
4734
|
+
return False
|
|
4735
|
+
if self.asset_filter != other.asset_filter:
|
|
4736
|
+
return False
|
|
4737
|
+
if self.from_timestamp != other.from_timestamp:
|
|
4738
|
+
return False
|
|
4739
|
+
if self.to_timestamp != other.to_timestamp:
|
|
4740
|
+
return False
|
|
4516
4741
|
if self.offset != other.offset:
|
|
4517
4742
|
return False
|
|
4518
4743
|
if self.limit != other.limit:
|
|
4519
4744
|
return False
|
|
4745
|
+
if self.sort_ascending != other.sort_ascending:
|
|
4746
|
+
return False
|
|
4520
4747
|
return True
|
|
4521
4748
|
|
|
4522
4749
|
class _UniffiConverterTypeListPaymentsRequest(_UniffiConverterRustBuffer):
|
|
4523
4750
|
@staticmethod
|
|
4524
4751
|
def read(buf):
|
|
4525
4752
|
return ListPaymentsRequest(
|
|
4753
|
+
type_filter=_UniffiConverterOptionalSequenceTypePaymentType.read(buf),
|
|
4754
|
+
status_filter=_UniffiConverterOptionalSequenceTypePaymentStatus.read(buf),
|
|
4755
|
+
asset_filter=_UniffiConverterOptionalTypeAssetFilter.read(buf),
|
|
4756
|
+
from_timestamp=_UniffiConverterOptionalUInt64.read(buf),
|
|
4757
|
+
to_timestamp=_UniffiConverterOptionalUInt64.read(buf),
|
|
4526
4758
|
offset=_UniffiConverterOptionalUInt32.read(buf),
|
|
4527
4759
|
limit=_UniffiConverterOptionalUInt32.read(buf),
|
|
4760
|
+
sort_ascending=_UniffiConverterOptionalBool.read(buf),
|
|
4528
4761
|
)
|
|
4529
4762
|
|
|
4530
4763
|
@staticmethod
|
|
4531
4764
|
def check_lower(value):
|
|
4765
|
+
_UniffiConverterOptionalSequenceTypePaymentType.check_lower(value.type_filter)
|
|
4766
|
+
_UniffiConverterOptionalSequenceTypePaymentStatus.check_lower(value.status_filter)
|
|
4767
|
+
_UniffiConverterOptionalTypeAssetFilter.check_lower(value.asset_filter)
|
|
4768
|
+
_UniffiConverterOptionalUInt64.check_lower(value.from_timestamp)
|
|
4769
|
+
_UniffiConverterOptionalUInt64.check_lower(value.to_timestamp)
|
|
4532
4770
|
_UniffiConverterOptionalUInt32.check_lower(value.offset)
|
|
4533
4771
|
_UniffiConverterOptionalUInt32.check_lower(value.limit)
|
|
4772
|
+
_UniffiConverterOptionalBool.check_lower(value.sort_ascending)
|
|
4534
4773
|
|
|
4535
4774
|
@staticmethod
|
|
4536
4775
|
def write(value, buf):
|
|
4776
|
+
_UniffiConverterOptionalSequenceTypePaymentType.write(value.type_filter, buf)
|
|
4777
|
+
_UniffiConverterOptionalSequenceTypePaymentStatus.write(value.status_filter, buf)
|
|
4778
|
+
_UniffiConverterOptionalTypeAssetFilter.write(value.asset_filter, buf)
|
|
4779
|
+
_UniffiConverterOptionalUInt64.write(value.from_timestamp, buf)
|
|
4780
|
+
_UniffiConverterOptionalUInt64.write(value.to_timestamp, buf)
|
|
4537
4781
|
_UniffiConverterOptionalUInt32.write(value.offset, buf)
|
|
4538
4782
|
_UniffiConverterOptionalUInt32.write(value.limit, buf)
|
|
4783
|
+
_UniffiConverterOptionalBool.write(value.sort_ascending, buf)
|
|
4539
4784
|
|
|
4540
4785
|
|
|
4541
4786
|
class ListPaymentsResponse:
|
|
@@ -4816,12 +5061,12 @@ class Payment:
|
|
|
4816
5061
|
Status of the payment
|
|
4817
5062
|
"""
|
|
4818
5063
|
|
|
4819
|
-
amount: "
|
|
5064
|
+
amount: "U128"
|
|
4820
5065
|
"""
|
|
4821
5066
|
Amount in satoshis
|
|
4822
5067
|
"""
|
|
4823
5068
|
|
|
4824
|
-
fees: "
|
|
5069
|
+
fees: "U128"
|
|
4825
5070
|
"""
|
|
4826
5071
|
Fee paid in satoshis
|
|
4827
5072
|
"""
|
|
@@ -4842,7 +5087,7 @@ class Payment:
|
|
|
4842
5087
|
Details of the payment
|
|
4843
5088
|
"""
|
|
4844
5089
|
|
|
4845
|
-
def __init__(self, *, id: "str", payment_type: "PaymentType", status: "PaymentStatus", amount: "
|
|
5090
|
+
def __init__(self, *, id: "str", payment_type: "PaymentType", status: "PaymentStatus", amount: "U128", fees: "U128", timestamp: "int", method: "PaymentMethod", details: "typing.Optional[PaymentDetails]"):
|
|
4846
5091
|
self.id = id
|
|
4847
5092
|
self.payment_type = payment_type
|
|
4848
5093
|
self.status = status
|
|
@@ -4881,8 +5126,8 @@ class _UniffiConverterTypePayment(_UniffiConverterRustBuffer):
|
|
|
4881
5126
|
id=_UniffiConverterString.read(buf),
|
|
4882
5127
|
payment_type=_UniffiConverterTypePaymentType.read(buf),
|
|
4883
5128
|
status=_UniffiConverterTypePaymentStatus.read(buf),
|
|
4884
|
-
amount=
|
|
4885
|
-
fees=
|
|
5129
|
+
amount=_UniffiConverterTypeU128.read(buf),
|
|
5130
|
+
fees=_UniffiConverterTypeU128.read(buf),
|
|
4886
5131
|
timestamp=_UniffiConverterUInt64.read(buf),
|
|
4887
5132
|
method=_UniffiConverterTypePaymentMethod.read(buf),
|
|
4888
5133
|
details=_UniffiConverterOptionalTypePaymentDetails.read(buf),
|
|
@@ -4893,8 +5138,8 @@ class _UniffiConverterTypePayment(_UniffiConverterRustBuffer):
|
|
|
4893
5138
|
_UniffiConverterString.check_lower(value.id)
|
|
4894
5139
|
_UniffiConverterTypePaymentType.check_lower(value.payment_type)
|
|
4895
5140
|
_UniffiConverterTypePaymentStatus.check_lower(value.status)
|
|
4896
|
-
|
|
4897
|
-
|
|
5141
|
+
_UniffiConverterTypeU128.check_lower(value.amount)
|
|
5142
|
+
_UniffiConverterTypeU128.check_lower(value.fees)
|
|
4898
5143
|
_UniffiConverterUInt64.check_lower(value.timestamp)
|
|
4899
5144
|
_UniffiConverterTypePaymentMethod.check_lower(value.method)
|
|
4900
5145
|
_UniffiConverterOptionalTypePaymentDetails.check_lower(value.details)
|
|
@@ -4904,8 +5149,8 @@ class _UniffiConverterTypePayment(_UniffiConverterRustBuffer):
|
|
|
4904
5149
|
_UniffiConverterString.write(value.id, buf)
|
|
4905
5150
|
_UniffiConverterTypePaymentType.write(value.payment_type, buf)
|
|
4906
5151
|
_UniffiConverterTypePaymentStatus.write(value.status, buf)
|
|
4907
|
-
|
|
4908
|
-
|
|
5152
|
+
_UniffiConverterTypeU128.write(value.amount, buf)
|
|
5153
|
+
_UniffiConverterTypeU128.write(value.fees, buf)
|
|
4909
5154
|
_UniffiConverterUInt64.write(value.timestamp, buf)
|
|
4910
5155
|
_UniffiConverterTypePaymentMethod.write(value.method, buf)
|
|
4911
5156
|
_UniffiConverterOptionalTypePaymentDetails.write(value.details, buf)
|
|
@@ -5073,21 +5318,38 @@ class _UniffiConverterTypePrepareLnurlPayResponse(_UniffiConverterRustBuffer):
|
|
|
5073
5318
|
|
|
5074
5319
|
class PrepareSendPaymentRequest:
|
|
5075
5320
|
payment_request: "str"
|
|
5076
|
-
|
|
5077
|
-
|
|
5321
|
+
amount: "typing.Optional[U128]"
|
|
5322
|
+
"""
|
|
5323
|
+
Amount to send. By default is denominated in sats.
|
|
5324
|
+
If a token identifier is provided, the amount will be denominated in the token base units.
|
|
5325
|
+
"""
|
|
5326
|
+
|
|
5327
|
+
token_identifier: "typing.Optional[str]"
|
|
5328
|
+
"""
|
|
5329
|
+
If provided, the payment will be for a token
|
|
5330
|
+
May only be provided if the payment request is a spark address
|
|
5331
|
+
"""
|
|
5332
|
+
|
|
5333
|
+
def __init__(self, *, payment_request: "str", amount: "typing.Optional[U128]" = _DEFAULT, token_identifier: "typing.Optional[str]" = _DEFAULT):
|
|
5078
5334
|
self.payment_request = payment_request
|
|
5079
|
-
if
|
|
5080
|
-
self.
|
|
5335
|
+
if amount is _DEFAULT:
|
|
5336
|
+
self.amount = None
|
|
5081
5337
|
else:
|
|
5082
|
-
self.
|
|
5338
|
+
self.amount = amount
|
|
5339
|
+
if token_identifier is _DEFAULT:
|
|
5340
|
+
self.token_identifier = None
|
|
5341
|
+
else:
|
|
5342
|
+
self.token_identifier = token_identifier
|
|
5083
5343
|
|
|
5084
5344
|
def __str__(self):
|
|
5085
|
-
return "PrepareSendPaymentRequest(payment_request={},
|
|
5345
|
+
return "PrepareSendPaymentRequest(payment_request={}, amount={}, token_identifier={})".format(self.payment_request, self.amount, self.token_identifier)
|
|
5086
5346
|
|
|
5087
5347
|
def __eq__(self, other):
|
|
5088
5348
|
if self.payment_request != other.payment_request:
|
|
5089
5349
|
return False
|
|
5090
|
-
if self.
|
|
5350
|
+
if self.amount != other.amount:
|
|
5351
|
+
return False
|
|
5352
|
+
if self.token_identifier != other.token_identifier:
|
|
5091
5353
|
return False
|
|
5092
5354
|
return True
|
|
5093
5355
|
|
|
@@ -5096,34 +5358,51 @@ class _UniffiConverterTypePrepareSendPaymentRequest(_UniffiConverterRustBuffer):
|
|
|
5096
5358
|
def read(buf):
|
|
5097
5359
|
return PrepareSendPaymentRequest(
|
|
5098
5360
|
payment_request=_UniffiConverterString.read(buf),
|
|
5099
|
-
|
|
5361
|
+
amount=_UniffiConverterOptionalTypeU128.read(buf),
|
|
5362
|
+
token_identifier=_UniffiConverterOptionalString.read(buf),
|
|
5100
5363
|
)
|
|
5101
5364
|
|
|
5102
5365
|
@staticmethod
|
|
5103
5366
|
def check_lower(value):
|
|
5104
5367
|
_UniffiConverterString.check_lower(value.payment_request)
|
|
5105
|
-
|
|
5368
|
+
_UniffiConverterOptionalTypeU128.check_lower(value.amount)
|
|
5369
|
+
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
5106
5370
|
|
|
5107
5371
|
@staticmethod
|
|
5108
5372
|
def write(value, buf):
|
|
5109
5373
|
_UniffiConverterString.write(value.payment_request, buf)
|
|
5110
|
-
|
|
5374
|
+
_UniffiConverterOptionalTypeU128.write(value.amount, buf)
|
|
5375
|
+
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
5111
5376
|
|
|
5112
5377
|
|
|
5113
5378
|
class PrepareSendPaymentResponse:
|
|
5114
5379
|
payment_method: "SendPaymentMethod"
|
|
5115
|
-
|
|
5116
|
-
|
|
5380
|
+
amount: "U128"
|
|
5381
|
+
"""
|
|
5382
|
+
Amount to send. By default is denominated in sats.
|
|
5383
|
+
If a token identifier is provided, the amount will be denominated in the token base units.
|
|
5384
|
+
"""
|
|
5385
|
+
|
|
5386
|
+
token_identifier: "typing.Optional[str]"
|
|
5387
|
+
"""
|
|
5388
|
+
The presence of this field indicates that the payment is for a token
|
|
5389
|
+
If empty, it is a Bitcoin payment
|
|
5390
|
+
"""
|
|
5391
|
+
|
|
5392
|
+
def __init__(self, *, payment_method: "SendPaymentMethod", amount: "U128", token_identifier: "typing.Optional[str]"):
|
|
5117
5393
|
self.payment_method = payment_method
|
|
5118
|
-
self.
|
|
5394
|
+
self.amount = amount
|
|
5395
|
+
self.token_identifier = token_identifier
|
|
5119
5396
|
|
|
5120
5397
|
def __str__(self):
|
|
5121
|
-
return "PrepareSendPaymentResponse(payment_method={},
|
|
5398
|
+
return "PrepareSendPaymentResponse(payment_method={}, amount={}, token_identifier={})".format(self.payment_method, self.amount, self.token_identifier)
|
|
5122
5399
|
|
|
5123
5400
|
def __eq__(self, other):
|
|
5124
5401
|
if self.payment_method != other.payment_method:
|
|
5125
5402
|
return False
|
|
5126
|
-
if self.
|
|
5403
|
+
if self.amount != other.amount:
|
|
5404
|
+
return False
|
|
5405
|
+
if self.token_identifier != other.token_identifier:
|
|
5127
5406
|
return False
|
|
5128
5407
|
return True
|
|
5129
5408
|
|
|
@@ -5132,18 +5411,21 @@ class _UniffiConverterTypePrepareSendPaymentResponse(_UniffiConverterRustBuffer)
|
|
|
5132
5411
|
def read(buf):
|
|
5133
5412
|
return PrepareSendPaymentResponse(
|
|
5134
5413
|
payment_method=_UniffiConverterTypeSendPaymentMethod.read(buf),
|
|
5135
|
-
|
|
5414
|
+
amount=_UniffiConverterTypeU128.read(buf),
|
|
5415
|
+
token_identifier=_UniffiConverterOptionalString.read(buf),
|
|
5136
5416
|
)
|
|
5137
5417
|
|
|
5138
5418
|
@staticmethod
|
|
5139
5419
|
def check_lower(value):
|
|
5140
5420
|
_UniffiConverterTypeSendPaymentMethod.check_lower(value.payment_method)
|
|
5141
|
-
|
|
5421
|
+
_UniffiConverterTypeU128.check_lower(value.amount)
|
|
5422
|
+
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
5142
5423
|
|
|
5143
5424
|
@staticmethod
|
|
5144
5425
|
def write(value, buf):
|
|
5145
5426
|
_UniffiConverterTypeSendPaymentMethod.write(value.payment_method, buf)
|
|
5146
|
-
|
|
5427
|
+
_UniffiConverterTypeU128.write(value.amount, buf)
|
|
5428
|
+
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
5147
5429
|
|
|
5148
5430
|
|
|
5149
5431
|
class ReceivePaymentRequest:
|
|
@@ -5551,6 +5833,121 @@ class _UniffiConverterTypeSyncWalletResponse(_UniffiConverterRustBuffer):
|
|
|
5551
5833
|
pass
|
|
5552
5834
|
|
|
5553
5835
|
|
|
5836
|
+
class TokenBalance:
|
|
5837
|
+
balance: "U128"
|
|
5838
|
+
token_metadata: "TokenMetadata"
|
|
5839
|
+
def __init__(self, *, balance: "U128", token_metadata: "TokenMetadata"):
|
|
5840
|
+
self.balance = balance
|
|
5841
|
+
self.token_metadata = token_metadata
|
|
5842
|
+
|
|
5843
|
+
def __str__(self):
|
|
5844
|
+
return "TokenBalance(balance={}, token_metadata={})".format(self.balance, self.token_metadata)
|
|
5845
|
+
|
|
5846
|
+
def __eq__(self, other):
|
|
5847
|
+
if self.balance != other.balance:
|
|
5848
|
+
return False
|
|
5849
|
+
if self.token_metadata != other.token_metadata:
|
|
5850
|
+
return False
|
|
5851
|
+
return True
|
|
5852
|
+
|
|
5853
|
+
class _UniffiConverterTypeTokenBalance(_UniffiConverterRustBuffer):
|
|
5854
|
+
@staticmethod
|
|
5855
|
+
def read(buf):
|
|
5856
|
+
return TokenBalance(
|
|
5857
|
+
balance=_UniffiConverterTypeU128.read(buf),
|
|
5858
|
+
token_metadata=_UniffiConverterTypeTokenMetadata.read(buf),
|
|
5859
|
+
)
|
|
5860
|
+
|
|
5861
|
+
@staticmethod
|
|
5862
|
+
def check_lower(value):
|
|
5863
|
+
_UniffiConverterTypeU128.check_lower(value.balance)
|
|
5864
|
+
_UniffiConverterTypeTokenMetadata.check_lower(value.token_metadata)
|
|
5865
|
+
|
|
5866
|
+
@staticmethod
|
|
5867
|
+
def write(value, buf):
|
|
5868
|
+
_UniffiConverterTypeU128.write(value.balance, buf)
|
|
5869
|
+
_UniffiConverterTypeTokenMetadata.write(value.token_metadata, buf)
|
|
5870
|
+
|
|
5871
|
+
|
|
5872
|
+
class TokenMetadata:
|
|
5873
|
+
identifier: "str"
|
|
5874
|
+
issuer_public_key: "str"
|
|
5875
|
+
"""
|
|
5876
|
+
Hex representation of the issuer public key
|
|
5877
|
+
"""
|
|
5878
|
+
|
|
5879
|
+
name: "str"
|
|
5880
|
+
ticker: "str"
|
|
5881
|
+
decimals: "int"
|
|
5882
|
+
"""
|
|
5883
|
+
Number of decimals the token uses
|
|
5884
|
+
"""
|
|
5885
|
+
|
|
5886
|
+
max_supply: "U128"
|
|
5887
|
+
is_freezable: "bool"
|
|
5888
|
+
def __init__(self, *, identifier: "str", issuer_public_key: "str", name: "str", ticker: "str", decimals: "int", max_supply: "U128", is_freezable: "bool"):
|
|
5889
|
+
self.identifier = identifier
|
|
5890
|
+
self.issuer_public_key = issuer_public_key
|
|
5891
|
+
self.name = name
|
|
5892
|
+
self.ticker = ticker
|
|
5893
|
+
self.decimals = decimals
|
|
5894
|
+
self.max_supply = max_supply
|
|
5895
|
+
self.is_freezable = is_freezable
|
|
5896
|
+
|
|
5897
|
+
def __str__(self):
|
|
5898
|
+
return "TokenMetadata(identifier={}, issuer_public_key={}, name={}, ticker={}, decimals={}, max_supply={}, is_freezable={})".format(self.identifier, self.issuer_public_key, self.name, self.ticker, self.decimals, self.max_supply, self.is_freezable)
|
|
5899
|
+
|
|
5900
|
+
def __eq__(self, other):
|
|
5901
|
+
if self.identifier != other.identifier:
|
|
5902
|
+
return False
|
|
5903
|
+
if self.issuer_public_key != other.issuer_public_key:
|
|
5904
|
+
return False
|
|
5905
|
+
if self.name != other.name:
|
|
5906
|
+
return False
|
|
5907
|
+
if self.ticker != other.ticker:
|
|
5908
|
+
return False
|
|
5909
|
+
if self.decimals != other.decimals:
|
|
5910
|
+
return False
|
|
5911
|
+
if self.max_supply != other.max_supply:
|
|
5912
|
+
return False
|
|
5913
|
+
if self.is_freezable != other.is_freezable:
|
|
5914
|
+
return False
|
|
5915
|
+
return True
|
|
5916
|
+
|
|
5917
|
+
class _UniffiConverterTypeTokenMetadata(_UniffiConverterRustBuffer):
|
|
5918
|
+
@staticmethod
|
|
5919
|
+
def read(buf):
|
|
5920
|
+
return TokenMetadata(
|
|
5921
|
+
identifier=_UniffiConverterString.read(buf),
|
|
5922
|
+
issuer_public_key=_UniffiConverterString.read(buf),
|
|
5923
|
+
name=_UniffiConverterString.read(buf),
|
|
5924
|
+
ticker=_UniffiConverterString.read(buf),
|
|
5925
|
+
decimals=_UniffiConverterUInt32.read(buf),
|
|
5926
|
+
max_supply=_UniffiConverterTypeU128.read(buf),
|
|
5927
|
+
is_freezable=_UniffiConverterBool.read(buf),
|
|
5928
|
+
)
|
|
5929
|
+
|
|
5930
|
+
@staticmethod
|
|
5931
|
+
def check_lower(value):
|
|
5932
|
+
_UniffiConverterString.check_lower(value.identifier)
|
|
5933
|
+
_UniffiConverterString.check_lower(value.issuer_public_key)
|
|
5934
|
+
_UniffiConverterString.check_lower(value.name)
|
|
5935
|
+
_UniffiConverterString.check_lower(value.ticker)
|
|
5936
|
+
_UniffiConverterUInt32.check_lower(value.decimals)
|
|
5937
|
+
_UniffiConverterTypeU128.check_lower(value.max_supply)
|
|
5938
|
+
_UniffiConverterBool.check_lower(value.is_freezable)
|
|
5939
|
+
|
|
5940
|
+
@staticmethod
|
|
5941
|
+
def write(value, buf):
|
|
5942
|
+
_UniffiConverterString.write(value.identifier, buf)
|
|
5943
|
+
_UniffiConverterString.write(value.issuer_public_key, buf)
|
|
5944
|
+
_UniffiConverterString.write(value.name, buf)
|
|
5945
|
+
_UniffiConverterString.write(value.ticker, buf)
|
|
5946
|
+
_UniffiConverterUInt32.write(value.decimals, buf)
|
|
5947
|
+
_UniffiConverterTypeU128.write(value.max_supply, buf)
|
|
5948
|
+
_UniffiConverterBool.write(value.is_freezable, buf)
|
|
5949
|
+
|
|
5950
|
+
|
|
5554
5951
|
class TxStatus:
|
|
5555
5952
|
confirmed: "bool"
|
|
5556
5953
|
block_height: "typing.Optional[int]"
|
|
@@ -5644,6 +6041,161 @@ class _UniffiConverterTypeUtxo(_UniffiConverterRustBuffer):
|
|
|
5644
6041
|
_UniffiConverterTypeTxStatus.write(value.status, buf)
|
|
5645
6042
|
|
|
5646
6043
|
|
|
6044
|
+
class WaitForPaymentRequest:
|
|
6045
|
+
identifier: "WaitForPaymentIdentifier"
|
|
6046
|
+
def __init__(self, *, identifier: "WaitForPaymentIdentifier"):
|
|
6047
|
+
self.identifier = identifier
|
|
6048
|
+
|
|
6049
|
+
def __str__(self):
|
|
6050
|
+
return "WaitForPaymentRequest(identifier={})".format(self.identifier)
|
|
6051
|
+
|
|
6052
|
+
def __eq__(self, other):
|
|
6053
|
+
if self.identifier != other.identifier:
|
|
6054
|
+
return False
|
|
6055
|
+
return True
|
|
6056
|
+
|
|
6057
|
+
class _UniffiConverterTypeWaitForPaymentRequest(_UniffiConverterRustBuffer):
|
|
6058
|
+
@staticmethod
|
|
6059
|
+
def read(buf):
|
|
6060
|
+
return WaitForPaymentRequest(
|
|
6061
|
+
identifier=_UniffiConverterTypeWaitForPaymentIdentifier.read(buf),
|
|
6062
|
+
)
|
|
6063
|
+
|
|
6064
|
+
@staticmethod
|
|
6065
|
+
def check_lower(value):
|
|
6066
|
+
_UniffiConverterTypeWaitForPaymentIdentifier.check_lower(value.identifier)
|
|
6067
|
+
|
|
6068
|
+
@staticmethod
|
|
6069
|
+
def write(value, buf):
|
|
6070
|
+
_UniffiConverterTypeWaitForPaymentIdentifier.write(value.identifier, buf)
|
|
6071
|
+
|
|
6072
|
+
|
|
6073
|
+
class WaitForPaymentResponse:
|
|
6074
|
+
payment: "Payment"
|
|
6075
|
+
def __init__(self, *, payment: "Payment"):
|
|
6076
|
+
self.payment = payment
|
|
6077
|
+
|
|
6078
|
+
def __str__(self):
|
|
6079
|
+
return "WaitForPaymentResponse(payment={})".format(self.payment)
|
|
6080
|
+
|
|
6081
|
+
def __eq__(self, other):
|
|
6082
|
+
if self.payment != other.payment:
|
|
6083
|
+
return False
|
|
6084
|
+
return True
|
|
6085
|
+
|
|
6086
|
+
class _UniffiConverterTypeWaitForPaymentResponse(_UniffiConverterRustBuffer):
|
|
6087
|
+
@staticmethod
|
|
6088
|
+
def read(buf):
|
|
6089
|
+
return WaitForPaymentResponse(
|
|
6090
|
+
payment=_UniffiConverterTypePayment.read(buf),
|
|
6091
|
+
)
|
|
6092
|
+
|
|
6093
|
+
@staticmethod
|
|
6094
|
+
def check_lower(value):
|
|
6095
|
+
_UniffiConverterTypePayment.check_lower(value.payment)
|
|
6096
|
+
|
|
6097
|
+
@staticmethod
|
|
6098
|
+
def write(value, buf):
|
|
6099
|
+
_UniffiConverterTypePayment.write(value.payment, buf)
|
|
6100
|
+
|
|
6101
|
+
|
|
6102
|
+
|
|
6103
|
+
|
|
6104
|
+
|
|
6105
|
+
class AssetFilter:
|
|
6106
|
+
"""
|
|
6107
|
+
A field of [`ListPaymentsRequest`] when listing payments filtered by asset
|
|
6108
|
+
"""
|
|
6109
|
+
|
|
6110
|
+
def __init__(self):
|
|
6111
|
+
raise RuntimeError("AssetFilter cannot be instantiated directly")
|
|
6112
|
+
|
|
6113
|
+
# Each enum variant is a nested class of the enum itself.
|
|
6114
|
+
class BITCOIN:
|
|
6115
|
+
|
|
6116
|
+
def __init__(self,):
|
|
6117
|
+
pass
|
|
6118
|
+
|
|
6119
|
+
def __str__(self):
|
|
6120
|
+
return "AssetFilter.BITCOIN()".format()
|
|
6121
|
+
|
|
6122
|
+
def __eq__(self, other):
|
|
6123
|
+
if not other.is_bitcoin():
|
|
6124
|
+
return False
|
|
6125
|
+
return True
|
|
6126
|
+
|
|
6127
|
+
class TOKEN:
|
|
6128
|
+
token_identifier: "typing.Optional[str]"
|
|
6129
|
+
"""
|
|
6130
|
+
Optional token identifier to filter by
|
|
6131
|
+
"""
|
|
6132
|
+
|
|
6133
|
+
|
|
6134
|
+
def __init__(self,token_identifier: "typing.Optional[str]"):
|
|
6135
|
+
self.token_identifier = token_identifier
|
|
6136
|
+
|
|
6137
|
+
def __str__(self):
|
|
6138
|
+
return "AssetFilter.TOKEN(token_identifier={})".format(self.token_identifier)
|
|
6139
|
+
|
|
6140
|
+
def __eq__(self, other):
|
|
6141
|
+
if not other.is_token():
|
|
6142
|
+
return False
|
|
6143
|
+
if self.token_identifier != other.token_identifier:
|
|
6144
|
+
return False
|
|
6145
|
+
return True
|
|
6146
|
+
|
|
6147
|
+
|
|
6148
|
+
|
|
6149
|
+
# For each variant, we have an `is_NAME` method for easily checking
|
|
6150
|
+
# whether an instance is that variant.
|
|
6151
|
+
def is_bitcoin(self) -> bool:
|
|
6152
|
+
return isinstance(self, AssetFilter.BITCOIN)
|
|
6153
|
+
def is_token(self) -> bool:
|
|
6154
|
+
return isinstance(self, AssetFilter.TOKEN)
|
|
6155
|
+
|
|
6156
|
+
|
|
6157
|
+
# Now, a little trick - we make each nested variant class be a subclass of the main
|
|
6158
|
+
# enum class, so that method calls and instance checks etc will work intuitively.
|
|
6159
|
+
# We might be able to do this a little more neatly with a metaclass, but this'll do.
|
|
6160
|
+
AssetFilter.BITCOIN = type("AssetFilter.BITCOIN", (AssetFilter.BITCOIN, AssetFilter,), {}) # type: ignore
|
|
6161
|
+
AssetFilter.TOKEN = type("AssetFilter.TOKEN", (AssetFilter.TOKEN, AssetFilter,), {}) # type: ignore
|
|
6162
|
+
|
|
6163
|
+
|
|
6164
|
+
|
|
6165
|
+
|
|
6166
|
+
class _UniffiConverterTypeAssetFilter(_UniffiConverterRustBuffer):
|
|
6167
|
+
@staticmethod
|
|
6168
|
+
def read(buf):
|
|
6169
|
+
variant = buf.read_i32()
|
|
6170
|
+
if variant == 1:
|
|
6171
|
+
return AssetFilter.BITCOIN(
|
|
6172
|
+
)
|
|
6173
|
+
if variant == 2:
|
|
6174
|
+
return AssetFilter.TOKEN(
|
|
6175
|
+
_UniffiConverterOptionalString.read(buf),
|
|
6176
|
+
)
|
|
6177
|
+
raise InternalError("Raw enum value doesn't match any cases")
|
|
6178
|
+
|
|
6179
|
+
@staticmethod
|
|
6180
|
+
def check_lower(value):
|
|
6181
|
+
if value.is_bitcoin():
|
|
6182
|
+
return
|
|
6183
|
+
if value.is_token():
|
|
6184
|
+
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
6185
|
+
return
|
|
6186
|
+
raise ValueError(value)
|
|
6187
|
+
|
|
6188
|
+
@staticmethod
|
|
6189
|
+
def write(value, buf):
|
|
6190
|
+
if value.is_bitcoin():
|
|
6191
|
+
buf.write_i32(1)
|
|
6192
|
+
if value.is_token():
|
|
6193
|
+
buf.write_i32(2)
|
|
6194
|
+
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
6195
|
+
|
|
6196
|
+
|
|
6197
|
+
|
|
6198
|
+
|
|
5647
6199
|
# ChainServiceError
|
|
5648
6200
|
# We want to define each variant as a nested class that's also a subclass,
|
|
5649
6201
|
# which is tricky in Python. To accomplish this we're going to create each
|
|
@@ -6163,9 +6715,29 @@ class PaymentDetails:
|
|
|
6163
6715
|
return False
|
|
6164
6716
|
return True
|
|
6165
6717
|
|
|
6166
|
-
class
|
|
6167
|
-
|
|
6168
|
-
""
|
|
6718
|
+
class TOKEN:
|
|
6719
|
+
metadata: "TokenMetadata"
|
|
6720
|
+
tx_hash: "str"
|
|
6721
|
+
|
|
6722
|
+
def __init__(self,metadata: "TokenMetadata", tx_hash: "str"):
|
|
6723
|
+
self.metadata = metadata
|
|
6724
|
+
self.tx_hash = tx_hash
|
|
6725
|
+
|
|
6726
|
+
def __str__(self):
|
|
6727
|
+
return "PaymentDetails.TOKEN(metadata={}, tx_hash={})".format(self.metadata, self.tx_hash)
|
|
6728
|
+
|
|
6729
|
+
def __eq__(self, other):
|
|
6730
|
+
if not other.is_token():
|
|
6731
|
+
return False
|
|
6732
|
+
if self.metadata != other.metadata:
|
|
6733
|
+
return False
|
|
6734
|
+
if self.tx_hash != other.tx_hash:
|
|
6735
|
+
return False
|
|
6736
|
+
return True
|
|
6737
|
+
|
|
6738
|
+
class LIGHTNING:
|
|
6739
|
+
description: "typing.Optional[str]"
|
|
6740
|
+
"""
|
|
6169
6741
|
Represents the invoice description
|
|
6170
6742
|
"""
|
|
6171
6743
|
|
|
@@ -6263,6 +6835,8 @@ class PaymentDetails:
|
|
|
6263
6835
|
# whether an instance is that variant.
|
|
6264
6836
|
def is_spark(self) -> bool:
|
|
6265
6837
|
return isinstance(self, PaymentDetails.SPARK)
|
|
6838
|
+
def is_token(self) -> bool:
|
|
6839
|
+
return isinstance(self, PaymentDetails.TOKEN)
|
|
6266
6840
|
def is_lightning(self) -> bool:
|
|
6267
6841
|
return isinstance(self, PaymentDetails.LIGHTNING)
|
|
6268
6842
|
def is_withdraw(self) -> bool:
|
|
@@ -6275,6 +6849,7 @@ class PaymentDetails:
|
|
|
6275
6849
|
# enum class, so that method calls and instance checks etc will work intuitively.
|
|
6276
6850
|
# We might be able to do this a little more neatly with a metaclass, but this'll do.
|
|
6277
6851
|
PaymentDetails.SPARK = type("PaymentDetails.SPARK", (PaymentDetails.SPARK, PaymentDetails,), {}) # type: ignore
|
|
6852
|
+
PaymentDetails.TOKEN = type("PaymentDetails.TOKEN", (PaymentDetails.TOKEN, PaymentDetails,), {}) # type: ignore
|
|
6278
6853
|
PaymentDetails.LIGHTNING = type("PaymentDetails.LIGHTNING", (PaymentDetails.LIGHTNING, PaymentDetails,), {}) # type: ignore
|
|
6279
6854
|
PaymentDetails.WITHDRAW = type("PaymentDetails.WITHDRAW", (PaymentDetails.WITHDRAW, PaymentDetails,), {}) # type: ignore
|
|
6280
6855
|
PaymentDetails.DEPOSIT = type("PaymentDetails.DEPOSIT", (PaymentDetails.DEPOSIT, PaymentDetails,), {}) # type: ignore
|
|
@@ -6290,6 +6865,11 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
6290
6865
|
return PaymentDetails.SPARK(
|
|
6291
6866
|
)
|
|
6292
6867
|
if variant == 2:
|
|
6868
|
+
return PaymentDetails.TOKEN(
|
|
6869
|
+
_UniffiConverterTypeTokenMetadata.read(buf),
|
|
6870
|
+
_UniffiConverterString.read(buf),
|
|
6871
|
+
)
|
|
6872
|
+
if variant == 3:
|
|
6293
6873
|
return PaymentDetails.LIGHTNING(
|
|
6294
6874
|
_UniffiConverterOptionalString.read(buf),
|
|
6295
6875
|
_UniffiConverterOptionalString.read(buf),
|
|
@@ -6298,11 +6878,11 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
6298
6878
|
_UniffiConverterString.read(buf),
|
|
6299
6879
|
_UniffiConverterOptionalTypeLnurlPayInfo.read(buf),
|
|
6300
6880
|
)
|
|
6301
|
-
if variant ==
|
|
6881
|
+
if variant == 4:
|
|
6302
6882
|
return PaymentDetails.WITHDRAW(
|
|
6303
6883
|
_UniffiConverterString.read(buf),
|
|
6304
6884
|
)
|
|
6305
|
-
if variant ==
|
|
6885
|
+
if variant == 5:
|
|
6306
6886
|
return PaymentDetails.DEPOSIT(
|
|
6307
6887
|
_UniffiConverterString.read(buf),
|
|
6308
6888
|
)
|
|
@@ -6312,6 +6892,10 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
6312
6892
|
def check_lower(value):
|
|
6313
6893
|
if value.is_spark():
|
|
6314
6894
|
return
|
|
6895
|
+
if value.is_token():
|
|
6896
|
+
_UniffiConverterTypeTokenMetadata.check_lower(value.metadata)
|
|
6897
|
+
_UniffiConverterString.check_lower(value.tx_hash)
|
|
6898
|
+
return
|
|
6315
6899
|
if value.is_lightning():
|
|
6316
6900
|
_UniffiConverterOptionalString.check_lower(value.description)
|
|
6317
6901
|
_UniffiConverterOptionalString.check_lower(value.preimage)
|
|
@@ -6332,8 +6916,12 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
6332
6916
|
def write(value, buf):
|
|
6333
6917
|
if value.is_spark():
|
|
6334
6918
|
buf.write_i32(1)
|
|
6335
|
-
if value.
|
|
6919
|
+
if value.is_token():
|
|
6336
6920
|
buf.write_i32(2)
|
|
6921
|
+
_UniffiConverterTypeTokenMetadata.write(value.metadata, buf)
|
|
6922
|
+
_UniffiConverterString.write(value.tx_hash, buf)
|
|
6923
|
+
if value.is_lightning():
|
|
6924
|
+
buf.write_i32(3)
|
|
6337
6925
|
_UniffiConverterOptionalString.write(value.description, buf)
|
|
6338
6926
|
_UniffiConverterOptionalString.write(value.preimage, buf)
|
|
6339
6927
|
_UniffiConverterString.write(value.invoice, buf)
|
|
@@ -6341,10 +6929,10 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
6341
6929
|
_UniffiConverterString.write(value.destination_pubkey, buf)
|
|
6342
6930
|
_UniffiConverterOptionalTypeLnurlPayInfo.write(value.lnurl_pay_info, buf)
|
|
6343
6931
|
if value.is_withdraw():
|
|
6344
|
-
buf.write_i32(
|
|
6932
|
+
buf.write_i32(4)
|
|
6345
6933
|
_UniffiConverterString.write(value.tx_id, buf)
|
|
6346
6934
|
if value.is_deposit():
|
|
6347
|
-
buf.write_i32(
|
|
6935
|
+
buf.write_i32(5)
|
|
6348
6936
|
_UniffiConverterString.write(value.tx_id, buf)
|
|
6349
6937
|
|
|
6350
6938
|
|
|
@@ -6358,11 +6946,13 @@ class PaymentMethod(enum.Enum):
|
|
|
6358
6946
|
|
|
6359
6947
|
SPARK = 1
|
|
6360
6948
|
|
|
6361
|
-
|
|
6949
|
+
TOKEN = 2
|
|
6950
|
+
|
|
6951
|
+
DEPOSIT = 3
|
|
6362
6952
|
|
|
6363
|
-
WITHDRAW =
|
|
6953
|
+
WITHDRAW = 4
|
|
6364
6954
|
|
|
6365
|
-
UNKNOWN =
|
|
6955
|
+
UNKNOWN = 5
|
|
6366
6956
|
|
|
6367
6957
|
|
|
6368
6958
|
|
|
@@ -6375,10 +6965,12 @@ class _UniffiConverterTypePaymentMethod(_UniffiConverterRustBuffer):
|
|
|
6375
6965
|
if variant == 2:
|
|
6376
6966
|
return PaymentMethod.SPARK
|
|
6377
6967
|
if variant == 3:
|
|
6378
|
-
return PaymentMethod.
|
|
6968
|
+
return PaymentMethod.TOKEN
|
|
6379
6969
|
if variant == 4:
|
|
6380
|
-
return PaymentMethod.
|
|
6970
|
+
return PaymentMethod.DEPOSIT
|
|
6381
6971
|
if variant == 5:
|
|
6972
|
+
return PaymentMethod.WITHDRAW
|
|
6973
|
+
if variant == 6:
|
|
6382
6974
|
return PaymentMethod.UNKNOWN
|
|
6383
6975
|
raise InternalError("Raw enum value doesn't match any cases")
|
|
6384
6976
|
|
|
@@ -6388,6 +6980,8 @@ class _UniffiConverterTypePaymentMethod(_UniffiConverterRustBuffer):
|
|
|
6388
6980
|
return
|
|
6389
6981
|
if value == PaymentMethod.SPARK:
|
|
6390
6982
|
return
|
|
6983
|
+
if value == PaymentMethod.TOKEN:
|
|
6984
|
+
return
|
|
6391
6985
|
if value == PaymentMethod.DEPOSIT:
|
|
6392
6986
|
return
|
|
6393
6987
|
if value == PaymentMethod.WITHDRAW:
|
|
@@ -6402,12 +6996,14 @@ class _UniffiConverterTypePaymentMethod(_UniffiConverterRustBuffer):
|
|
|
6402
6996
|
buf.write_i32(1)
|
|
6403
6997
|
if value == PaymentMethod.SPARK:
|
|
6404
6998
|
buf.write_i32(2)
|
|
6405
|
-
if value == PaymentMethod.
|
|
6999
|
+
if value == PaymentMethod.TOKEN:
|
|
6406
7000
|
buf.write_i32(3)
|
|
6407
|
-
if value == PaymentMethod.
|
|
7001
|
+
if value == PaymentMethod.DEPOSIT:
|
|
6408
7002
|
buf.write_i32(4)
|
|
6409
|
-
if value == PaymentMethod.
|
|
7003
|
+
if value == PaymentMethod.WITHDRAW:
|
|
6410
7004
|
buf.write_i32(5)
|
|
7005
|
+
if value == PaymentMethod.UNKNOWN:
|
|
7006
|
+
buf.write_i32(6)
|
|
6411
7007
|
|
|
6412
7008
|
|
|
6413
7009
|
|
|
@@ -7320,21 +7916,35 @@ class SendPaymentMethod:
|
|
|
7320
7916
|
|
|
7321
7917
|
class SPARK_ADDRESS:
|
|
7322
7918
|
address: "str"
|
|
7323
|
-
|
|
7919
|
+
fee: "U128"
|
|
7920
|
+
"""
|
|
7921
|
+
Fee to pay for the transaction
|
|
7922
|
+
Denominated in sats if token identifier is empty, otherwise in the token base units
|
|
7923
|
+
"""
|
|
7924
|
+
|
|
7925
|
+
token_identifier: "typing.Optional[str]"
|
|
7926
|
+
"""
|
|
7927
|
+
The presence of this field indicates that the payment is for a token
|
|
7928
|
+
If empty, it is a Bitcoin payment
|
|
7929
|
+
"""
|
|
7930
|
+
|
|
7324
7931
|
|
|
7325
|
-
def __init__(self,address: "str",
|
|
7932
|
+
def __init__(self,address: "str", fee: "U128", token_identifier: "typing.Optional[str]"):
|
|
7326
7933
|
self.address = address
|
|
7327
|
-
self.
|
|
7934
|
+
self.fee = fee
|
|
7935
|
+
self.token_identifier = token_identifier
|
|
7328
7936
|
|
|
7329
7937
|
def __str__(self):
|
|
7330
|
-
return "SendPaymentMethod.SPARK_ADDRESS(address={},
|
|
7938
|
+
return "SendPaymentMethod.SPARK_ADDRESS(address={}, fee={}, token_identifier={})".format(self.address, self.fee, self.token_identifier)
|
|
7331
7939
|
|
|
7332
7940
|
def __eq__(self, other):
|
|
7333
7941
|
if not other.is_spark_address():
|
|
7334
7942
|
return False
|
|
7335
7943
|
if self.address != other.address:
|
|
7336
7944
|
return False
|
|
7337
|
-
if self.
|
|
7945
|
+
if self.fee != other.fee:
|
|
7946
|
+
return False
|
|
7947
|
+
if self.token_identifier != other.token_identifier:
|
|
7338
7948
|
return False
|
|
7339
7949
|
return True
|
|
7340
7950
|
|
|
@@ -7378,7 +7988,8 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
|
|
|
7378
7988
|
if variant == 3:
|
|
7379
7989
|
return SendPaymentMethod.SPARK_ADDRESS(
|
|
7380
7990
|
_UniffiConverterString.read(buf),
|
|
7381
|
-
|
|
7991
|
+
_UniffiConverterTypeU128.read(buf),
|
|
7992
|
+
_UniffiConverterOptionalString.read(buf),
|
|
7382
7993
|
)
|
|
7383
7994
|
raise InternalError("Raw enum value doesn't match any cases")
|
|
7384
7995
|
|
|
@@ -7395,7 +8006,8 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
|
|
|
7395
8006
|
return
|
|
7396
8007
|
if value.is_spark_address():
|
|
7397
8008
|
_UniffiConverterString.check_lower(value.address)
|
|
7398
|
-
|
|
8009
|
+
_UniffiConverterTypeU128.check_lower(value.fee)
|
|
8010
|
+
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
7399
8011
|
return
|
|
7400
8012
|
raise ValueError(value)
|
|
7401
8013
|
|
|
@@ -7413,7 +8025,8 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
|
|
|
7413
8025
|
if value.is_spark_address():
|
|
7414
8026
|
buf.write_i32(3)
|
|
7415
8027
|
_UniffiConverterString.write(value.address, buf)
|
|
7416
|
-
|
|
8028
|
+
_UniffiConverterTypeU128.write(value.fee, buf)
|
|
8029
|
+
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
7417
8030
|
|
|
7418
8031
|
|
|
7419
8032
|
|
|
@@ -7444,18 +8057,27 @@ class SendPaymentOptions:
|
|
|
7444
8057
|
|
|
7445
8058
|
class BOLT11_INVOICE:
|
|
7446
8059
|
prefer_spark: "bool"
|
|
8060
|
+
completion_timeout_secs: "typing.Optional[int]"
|
|
8061
|
+
"""
|
|
8062
|
+
If set, the function will return the payment if it is still pending after this
|
|
8063
|
+
number of seconds. If unset, the function will return immediately after initiating the payment.
|
|
8064
|
+
"""
|
|
8065
|
+
|
|
7447
8066
|
|
|
7448
|
-
def __init__(self,prefer_spark: "bool"):
|
|
8067
|
+
def __init__(self,prefer_spark: "bool", completion_timeout_secs: "typing.Optional[int]"):
|
|
7449
8068
|
self.prefer_spark = prefer_spark
|
|
8069
|
+
self.completion_timeout_secs = completion_timeout_secs
|
|
7450
8070
|
|
|
7451
8071
|
def __str__(self):
|
|
7452
|
-
return "SendPaymentOptions.BOLT11_INVOICE(prefer_spark={})".format(self.prefer_spark)
|
|
8072
|
+
return "SendPaymentOptions.BOLT11_INVOICE(prefer_spark={}, completion_timeout_secs={})".format(self.prefer_spark, self.completion_timeout_secs)
|
|
7453
8073
|
|
|
7454
8074
|
def __eq__(self, other):
|
|
7455
8075
|
if not other.is_bolt11_invoice():
|
|
7456
8076
|
return False
|
|
7457
8077
|
if self.prefer_spark != other.prefer_spark:
|
|
7458
8078
|
return False
|
|
8079
|
+
if self.completion_timeout_secs != other.completion_timeout_secs:
|
|
8080
|
+
return False
|
|
7459
8081
|
return True
|
|
7460
8082
|
|
|
7461
8083
|
|
|
@@ -7488,6 +8110,7 @@ class _UniffiConverterTypeSendPaymentOptions(_UniffiConverterRustBuffer):
|
|
|
7488
8110
|
if variant == 2:
|
|
7489
8111
|
return SendPaymentOptions.BOLT11_INVOICE(
|
|
7490
8112
|
_UniffiConverterBool.read(buf),
|
|
8113
|
+
_UniffiConverterOptionalUInt32.read(buf),
|
|
7491
8114
|
)
|
|
7492
8115
|
raise InternalError("Raw enum value doesn't match any cases")
|
|
7493
8116
|
|
|
@@ -7498,6 +8121,7 @@ class _UniffiConverterTypeSendPaymentOptions(_UniffiConverterRustBuffer):
|
|
|
7498
8121
|
return
|
|
7499
8122
|
if value.is_bolt11_invoice():
|
|
7500
8123
|
_UniffiConverterBool.check_lower(value.prefer_spark)
|
|
8124
|
+
_UniffiConverterOptionalUInt32.check_lower(value.completion_timeout_secs)
|
|
7501
8125
|
return
|
|
7502
8126
|
raise ValueError(value)
|
|
7503
8127
|
|
|
@@ -7509,6 +8133,7 @@ class _UniffiConverterTypeSendPaymentOptions(_UniffiConverterRustBuffer):
|
|
|
7509
8133
|
if value.is_bolt11_invoice():
|
|
7510
8134
|
buf.write_i32(2)
|
|
7511
8135
|
_UniffiConverterBool.write(value.prefer_spark, buf)
|
|
8136
|
+
_UniffiConverterOptionalUInt32.write(value.completion_timeout_secs, buf)
|
|
7512
8137
|
|
|
7513
8138
|
|
|
7514
8139
|
|
|
@@ -7733,6 +8358,105 @@ class _UniffiConverterTypeUpdateDepositPayload(_UniffiConverterRustBuffer):
|
|
|
7733
8358
|
|
|
7734
8359
|
|
|
7735
8360
|
|
|
8361
|
+
|
|
8362
|
+
|
|
8363
|
+
class WaitForPaymentIdentifier:
|
|
8364
|
+
def __init__(self):
|
|
8365
|
+
raise RuntimeError("WaitForPaymentIdentifier cannot be instantiated directly")
|
|
8366
|
+
|
|
8367
|
+
# Each enum variant is a nested class of the enum itself.
|
|
8368
|
+
class PAYMENT_ID:
|
|
8369
|
+
def __init__(self, *values):
|
|
8370
|
+
if len(values) != 1:
|
|
8371
|
+
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
8372
|
+
if not isinstance(values[0], str):
|
|
8373
|
+
raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
|
|
8374
|
+
self._values = values
|
|
8375
|
+
|
|
8376
|
+
def __getitem__(self, index):
|
|
8377
|
+
return self._values[index]
|
|
8378
|
+
|
|
8379
|
+
def __str__(self):
|
|
8380
|
+
return f"WaitForPaymentIdentifier.PAYMENT_ID{self._values!r}"
|
|
8381
|
+
|
|
8382
|
+
def __eq__(self, other):
|
|
8383
|
+
if not other.is_payment_id():
|
|
8384
|
+
return False
|
|
8385
|
+
return self._values == other._values
|
|
8386
|
+
class PAYMENT_REQUEST:
|
|
8387
|
+
def __init__(self, *values):
|
|
8388
|
+
if len(values) != 1:
|
|
8389
|
+
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
8390
|
+
if not isinstance(values[0], str):
|
|
8391
|
+
raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
|
|
8392
|
+
self._values = values
|
|
8393
|
+
|
|
8394
|
+
def __getitem__(self, index):
|
|
8395
|
+
return self._values[index]
|
|
8396
|
+
|
|
8397
|
+
def __str__(self):
|
|
8398
|
+
return f"WaitForPaymentIdentifier.PAYMENT_REQUEST{self._values!r}"
|
|
8399
|
+
|
|
8400
|
+
def __eq__(self, other):
|
|
8401
|
+
if not other.is_payment_request():
|
|
8402
|
+
return False
|
|
8403
|
+
return self._values == other._values
|
|
8404
|
+
|
|
8405
|
+
|
|
8406
|
+
# For each variant, we have an `is_NAME` method for easily checking
|
|
8407
|
+
# whether an instance is that variant.
|
|
8408
|
+
def is_payment_id(self) -> bool:
|
|
8409
|
+
return isinstance(self, WaitForPaymentIdentifier.PAYMENT_ID)
|
|
8410
|
+
def is_payment_request(self) -> bool:
|
|
8411
|
+
return isinstance(self, WaitForPaymentIdentifier.PAYMENT_REQUEST)
|
|
8412
|
+
|
|
8413
|
+
|
|
8414
|
+
# Now, a little trick - we make each nested variant class be a subclass of the main
|
|
8415
|
+
# enum class, so that method calls and instance checks etc will work intuitively.
|
|
8416
|
+
# We might be able to do this a little more neatly with a metaclass, but this'll do.
|
|
8417
|
+
WaitForPaymentIdentifier.PAYMENT_ID = type("WaitForPaymentIdentifier.PAYMENT_ID", (WaitForPaymentIdentifier.PAYMENT_ID, WaitForPaymentIdentifier,), {}) # type: ignore
|
|
8418
|
+
WaitForPaymentIdentifier.PAYMENT_REQUEST = type("WaitForPaymentIdentifier.PAYMENT_REQUEST", (WaitForPaymentIdentifier.PAYMENT_REQUEST, WaitForPaymentIdentifier,), {}) # type: ignore
|
|
8419
|
+
|
|
8420
|
+
|
|
8421
|
+
|
|
8422
|
+
|
|
8423
|
+
class _UniffiConverterTypeWaitForPaymentIdentifier(_UniffiConverterRustBuffer):
|
|
8424
|
+
@staticmethod
|
|
8425
|
+
def read(buf):
|
|
8426
|
+
variant = buf.read_i32()
|
|
8427
|
+
if variant == 1:
|
|
8428
|
+
return WaitForPaymentIdentifier.PAYMENT_ID(
|
|
8429
|
+
_UniffiConverterString.read(buf),
|
|
8430
|
+
)
|
|
8431
|
+
if variant == 2:
|
|
8432
|
+
return WaitForPaymentIdentifier.PAYMENT_REQUEST(
|
|
8433
|
+
_UniffiConverterString.read(buf),
|
|
8434
|
+
)
|
|
8435
|
+
raise InternalError("Raw enum value doesn't match any cases")
|
|
8436
|
+
|
|
8437
|
+
@staticmethod
|
|
8438
|
+
def check_lower(value):
|
|
8439
|
+
if value.is_payment_id():
|
|
8440
|
+
_UniffiConverterString.check_lower(value._values[0])
|
|
8441
|
+
return
|
|
8442
|
+
if value.is_payment_request():
|
|
8443
|
+
_UniffiConverterString.check_lower(value._values[0])
|
|
8444
|
+
return
|
|
8445
|
+
raise ValueError(value)
|
|
8446
|
+
|
|
8447
|
+
@staticmethod
|
|
8448
|
+
def write(value, buf):
|
|
8449
|
+
if value.is_payment_id():
|
|
8450
|
+
buf.write_i32(1)
|
|
8451
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
8452
|
+
if value.is_payment_request():
|
|
8453
|
+
buf.write_i32(2)
|
|
8454
|
+
_UniffiConverterString.write(value._values[0], buf)
|
|
8455
|
+
|
|
8456
|
+
|
|
8457
|
+
|
|
8458
|
+
|
|
8459
|
+
|
|
7736
8460
|
class EventListener(typing.Protocol):
|
|
7737
8461
|
"""
|
|
7738
8462
|
Trait for event listeners
|
|
@@ -7754,8 +8478,9 @@ class _UniffiTraitImplEventListener:
|
|
|
7754
8478
|
def on_event(
|
|
7755
8479
|
uniffi_handle,
|
|
7756
8480
|
event,
|
|
8481
|
+
uniffi_future_callback,
|
|
8482
|
+
uniffi_callback_data,
|
|
7757
8483
|
uniffi_out_return,
|
|
7758
|
-
uniffi_call_status_ptr,
|
|
7759
8484
|
):
|
|
7760
8485
|
uniffi_obj = _UniffiConverterTypeEventListener._handle_map.get(uniffi_handle)
|
|
7761
8486
|
def make_call():
|
|
@@ -7764,12 +8489,22 @@ class _UniffiTraitImplEventListener:
|
|
|
7764
8489
|
return method(*args)
|
|
7765
8490
|
|
|
7766
8491
|
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
8492
|
+
def handle_success(return_value):
|
|
8493
|
+
uniffi_future_callback(
|
|
8494
|
+
uniffi_callback_data,
|
|
8495
|
+
_UniffiForeignFutureStructVoid(
|
|
8496
|
+
_UniffiRustCallStatus.default()
|
|
8497
|
+
)
|
|
8498
|
+
)
|
|
8499
|
+
|
|
8500
|
+
def handle_error(status_code, rust_buffer):
|
|
8501
|
+
uniffi_future_callback(
|
|
8502
|
+
uniffi_callback_data,
|
|
8503
|
+
_UniffiForeignFutureStructVoid(
|
|
8504
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
8505
|
+
)
|
|
8506
|
+
)
|
|
8507
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async(make_call, handle_success, handle_error)
|
|
7773
8508
|
|
|
7774
8509
|
@_UNIFFI_CALLBACK_INTERFACE_FREE
|
|
7775
8510
|
def _uniffi_free(uniffi_handle):
|
|
@@ -8026,6 +8761,60 @@ class _UniffiConverterOptionalTypeLnurlPayInfo(_UniffiConverterRustBuffer):
|
|
|
8026
8761
|
|
|
8027
8762
|
|
|
8028
8763
|
|
|
8764
|
+
class _UniffiConverterOptionalTypePayment(_UniffiConverterRustBuffer):
|
|
8765
|
+
@classmethod
|
|
8766
|
+
def check_lower(cls, value):
|
|
8767
|
+
if value is not None:
|
|
8768
|
+
_UniffiConverterTypePayment.check_lower(value)
|
|
8769
|
+
|
|
8770
|
+
@classmethod
|
|
8771
|
+
def write(cls, value, buf):
|
|
8772
|
+
if value is None:
|
|
8773
|
+
buf.write_u8(0)
|
|
8774
|
+
return
|
|
8775
|
+
|
|
8776
|
+
buf.write_u8(1)
|
|
8777
|
+
_UniffiConverterTypePayment.write(value, buf)
|
|
8778
|
+
|
|
8779
|
+
@classmethod
|
|
8780
|
+
def read(cls, buf):
|
|
8781
|
+
flag = buf.read_u8()
|
|
8782
|
+
if flag == 0:
|
|
8783
|
+
return None
|
|
8784
|
+
elif flag == 1:
|
|
8785
|
+
return _UniffiConverterTypePayment.read(buf)
|
|
8786
|
+
else:
|
|
8787
|
+
raise InternalError("Unexpected flag byte for optional type")
|
|
8788
|
+
|
|
8789
|
+
|
|
8790
|
+
|
|
8791
|
+
class _UniffiConverterOptionalTypeAssetFilter(_UniffiConverterRustBuffer):
|
|
8792
|
+
@classmethod
|
|
8793
|
+
def check_lower(cls, value):
|
|
8794
|
+
if value is not None:
|
|
8795
|
+
_UniffiConverterTypeAssetFilter.check_lower(value)
|
|
8796
|
+
|
|
8797
|
+
@classmethod
|
|
8798
|
+
def write(cls, value, buf):
|
|
8799
|
+
if value is None:
|
|
8800
|
+
buf.write_u8(0)
|
|
8801
|
+
return
|
|
8802
|
+
|
|
8803
|
+
buf.write_u8(1)
|
|
8804
|
+
_UniffiConverterTypeAssetFilter.write(value, buf)
|
|
8805
|
+
|
|
8806
|
+
@classmethod
|
|
8807
|
+
def read(cls, buf):
|
|
8808
|
+
flag = buf.read_u8()
|
|
8809
|
+
if flag == 0:
|
|
8810
|
+
return None
|
|
8811
|
+
elif flag == 1:
|
|
8812
|
+
return _UniffiConverterTypeAssetFilter.read(buf)
|
|
8813
|
+
else:
|
|
8814
|
+
raise InternalError("Unexpected flag byte for optional type")
|
|
8815
|
+
|
|
8816
|
+
|
|
8817
|
+
|
|
8029
8818
|
class _UniffiConverterOptionalTypeDepositClaimError(_UniffiConverterRustBuffer):
|
|
8030
8819
|
@classmethod
|
|
8031
8820
|
def check_lower(cls, value):
|
|
@@ -8161,6 +8950,60 @@ class _UniffiConverterOptionalTypeLogger(_UniffiConverterRustBuffer):
|
|
|
8161
8950
|
|
|
8162
8951
|
|
|
8163
8952
|
|
|
8953
|
+
class _UniffiConverterOptionalSequenceTypePaymentStatus(_UniffiConverterRustBuffer):
|
|
8954
|
+
@classmethod
|
|
8955
|
+
def check_lower(cls, value):
|
|
8956
|
+
if value is not None:
|
|
8957
|
+
_UniffiConverterSequenceTypePaymentStatus.check_lower(value)
|
|
8958
|
+
|
|
8959
|
+
@classmethod
|
|
8960
|
+
def write(cls, value, buf):
|
|
8961
|
+
if value is None:
|
|
8962
|
+
buf.write_u8(0)
|
|
8963
|
+
return
|
|
8964
|
+
|
|
8965
|
+
buf.write_u8(1)
|
|
8966
|
+
_UniffiConverterSequenceTypePaymentStatus.write(value, buf)
|
|
8967
|
+
|
|
8968
|
+
@classmethod
|
|
8969
|
+
def read(cls, buf):
|
|
8970
|
+
flag = buf.read_u8()
|
|
8971
|
+
if flag == 0:
|
|
8972
|
+
return None
|
|
8973
|
+
elif flag == 1:
|
|
8974
|
+
return _UniffiConverterSequenceTypePaymentStatus.read(buf)
|
|
8975
|
+
else:
|
|
8976
|
+
raise InternalError("Unexpected flag byte for optional type")
|
|
8977
|
+
|
|
8978
|
+
|
|
8979
|
+
|
|
8980
|
+
class _UniffiConverterOptionalSequenceTypePaymentType(_UniffiConverterRustBuffer):
|
|
8981
|
+
@classmethod
|
|
8982
|
+
def check_lower(cls, value):
|
|
8983
|
+
if value is not None:
|
|
8984
|
+
_UniffiConverterSequenceTypePaymentType.check_lower(value)
|
|
8985
|
+
|
|
8986
|
+
@classmethod
|
|
8987
|
+
def write(cls, value, buf):
|
|
8988
|
+
if value is None:
|
|
8989
|
+
buf.write_u8(0)
|
|
8990
|
+
return
|
|
8991
|
+
|
|
8992
|
+
buf.write_u8(1)
|
|
8993
|
+
_UniffiConverterSequenceTypePaymentType.write(value, buf)
|
|
8994
|
+
|
|
8995
|
+
@classmethod
|
|
8996
|
+
def read(cls, buf):
|
|
8997
|
+
flag = buf.read_u8()
|
|
8998
|
+
if flag == 0:
|
|
8999
|
+
return None
|
|
9000
|
+
elif flag == 1:
|
|
9001
|
+
return _UniffiConverterSequenceTypePaymentType.read(buf)
|
|
9002
|
+
else:
|
|
9003
|
+
raise InternalError("Unexpected flag byte for optional type")
|
|
9004
|
+
|
|
9005
|
+
|
|
9006
|
+
|
|
8164
9007
|
class _UniffiConverterOptionalTypeSuccessAction(_UniffiConverterRustBuffer):
|
|
8165
9008
|
@classmethod
|
|
8166
9009
|
def check_lower(cls, value):
|
|
@@ -8215,6 +9058,58 @@ class _UniffiConverterOptionalTypeSuccessActionProcessed(_UniffiConverterRustBuf
|
|
|
8215
9058
|
|
|
8216
9059
|
|
|
8217
9060
|
|
|
9061
|
+
class _UniffiConverterOptionalTypeU128(_UniffiConverterRustBuffer):
|
|
9062
|
+
@classmethod
|
|
9063
|
+
def check_lower(cls, value):
|
|
9064
|
+
if value is not None:
|
|
9065
|
+
_UniffiConverterTypeU128.check_lower(value)
|
|
9066
|
+
|
|
9067
|
+
@classmethod
|
|
9068
|
+
def write(cls, value, buf):
|
|
9069
|
+
if value is None:
|
|
9070
|
+
buf.write_u8(0)
|
|
9071
|
+
return
|
|
9072
|
+
|
|
9073
|
+
buf.write_u8(1)
|
|
9074
|
+
_UniffiConverterTypeU128.write(value, buf)
|
|
9075
|
+
|
|
9076
|
+
@classmethod
|
|
9077
|
+
def read(cls, buf):
|
|
9078
|
+
flag = buf.read_u8()
|
|
9079
|
+
if flag == 0:
|
|
9080
|
+
return None
|
|
9081
|
+
elif flag == 1:
|
|
9082
|
+
return _UniffiConverterTypeU128.read(buf)
|
|
9083
|
+
else:
|
|
9084
|
+
raise InternalError("Unexpected flag byte for optional type")
|
|
9085
|
+
|
|
9086
|
+
|
|
9087
|
+
|
|
9088
|
+
class _UniffiConverterSequenceString(_UniffiConverterRustBuffer):
|
|
9089
|
+
@classmethod
|
|
9090
|
+
def check_lower(cls, value):
|
|
9091
|
+
for item in value:
|
|
9092
|
+
_UniffiConverterString.check_lower(item)
|
|
9093
|
+
|
|
9094
|
+
@classmethod
|
|
9095
|
+
def write(cls, value, buf):
|
|
9096
|
+
items = len(value)
|
|
9097
|
+
buf.write_i32(items)
|
|
9098
|
+
for item in value:
|
|
9099
|
+
_UniffiConverterString.write(item, buf)
|
|
9100
|
+
|
|
9101
|
+
@classmethod
|
|
9102
|
+
def read(cls, buf):
|
|
9103
|
+
count = buf.read_i32()
|
|
9104
|
+
if count < 0:
|
|
9105
|
+
raise InternalError("Unexpected negative sequence length")
|
|
9106
|
+
|
|
9107
|
+
return [
|
|
9108
|
+
_UniffiConverterString.read(buf) for i in range(count)
|
|
9109
|
+
]
|
|
9110
|
+
|
|
9111
|
+
|
|
9112
|
+
|
|
8218
9113
|
class _UniffiConverterSequenceTypeDepositInfo(_UniffiConverterRustBuffer):
|
|
8219
9114
|
@classmethod
|
|
8220
9115
|
def check_lower(cls, value):
|
|
@@ -8265,6 +9160,31 @@ class _UniffiConverterSequenceTypePayment(_UniffiConverterRustBuffer):
|
|
|
8265
9160
|
|
|
8266
9161
|
|
|
8267
9162
|
|
|
9163
|
+
class _UniffiConverterSequenceTypeTokenMetadata(_UniffiConverterRustBuffer):
|
|
9164
|
+
@classmethod
|
|
9165
|
+
def check_lower(cls, value):
|
|
9166
|
+
for item in value:
|
|
9167
|
+
_UniffiConverterTypeTokenMetadata.check_lower(item)
|
|
9168
|
+
|
|
9169
|
+
@classmethod
|
|
9170
|
+
def write(cls, value, buf):
|
|
9171
|
+
items = len(value)
|
|
9172
|
+
buf.write_i32(items)
|
|
9173
|
+
for item in value:
|
|
9174
|
+
_UniffiConverterTypeTokenMetadata.write(item, buf)
|
|
9175
|
+
|
|
9176
|
+
@classmethod
|
|
9177
|
+
def read(cls, buf):
|
|
9178
|
+
count = buf.read_i32()
|
|
9179
|
+
if count < 0:
|
|
9180
|
+
raise InternalError("Unexpected negative sequence length")
|
|
9181
|
+
|
|
9182
|
+
return [
|
|
9183
|
+
_UniffiConverterTypeTokenMetadata.read(buf) for i in range(count)
|
|
9184
|
+
]
|
|
9185
|
+
|
|
9186
|
+
|
|
9187
|
+
|
|
8268
9188
|
class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
|
|
8269
9189
|
@classmethod
|
|
8270
9190
|
def check_lower(cls, value):
|
|
@@ -8290,6 +9210,56 @@ class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
|
|
|
8290
9210
|
|
|
8291
9211
|
|
|
8292
9212
|
|
|
9213
|
+
class _UniffiConverterSequenceTypePaymentStatus(_UniffiConverterRustBuffer):
|
|
9214
|
+
@classmethod
|
|
9215
|
+
def check_lower(cls, value):
|
|
9216
|
+
for item in value:
|
|
9217
|
+
_UniffiConverterTypePaymentStatus.check_lower(item)
|
|
9218
|
+
|
|
9219
|
+
@classmethod
|
|
9220
|
+
def write(cls, value, buf):
|
|
9221
|
+
items = len(value)
|
|
9222
|
+
buf.write_i32(items)
|
|
9223
|
+
for item in value:
|
|
9224
|
+
_UniffiConverterTypePaymentStatus.write(item, buf)
|
|
9225
|
+
|
|
9226
|
+
@classmethod
|
|
9227
|
+
def read(cls, buf):
|
|
9228
|
+
count = buf.read_i32()
|
|
9229
|
+
if count < 0:
|
|
9230
|
+
raise InternalError("Unexpected negative sequence length")
|
|
9231
|
+
|
|
9232
|
+
return [
|
|
9233
|
+
_UniffiConverterTypePaymentStatus.read(buf) for i in range(count)
|
|
9234
|
+
]
|
|
9235
|
+
|
|
9236
|
+
|
|
9237
|
+
|
|
9238
|
+
class _UniffiConverterSequenceTypePaymentType(_UniffiConverterRustBuffer):
|
|
9239
|
+
@classmethod
|
|
9240
|
+
def check_lower(cls, value):
|
|
9241
|
+
for item in value:
|
|
9242
|
+
_UniffiConverterTypePaymentType.check_lower(item)
|
|
9243
|
+
|
|
9244
|
+
@classmethod
|
|
9245
|
+
def write(cls, value, buf):
|
|
9246
|
+
items = len(value)
|
|
9247
|
+
buf.write_i32(items)
|
|
9248
|
+
for item in value:
|
|
9249
|
+
_UniffiConverterTypePaymentType.write(item, buf)
|
|
9250
|
+
|
|
9251
|
+
@classmethod
|
|
9252
|
+
def read(cls, buf):
|
|
9253
|
+
count = buf.read_i32()
|
|
9254
|
+
if count < 0:
|
|
9255
|
+
raise InternalError("Unexpected negative sequence length")
|
|
9256
|
+
|
|
9257
|
+
return [
|
|
9258
|
+
_UniffiConverterTypePaymentType.read(buf) for i in range(count)
|
|
9259
|
+
]
|
|
9260
|
+
|
|
9261
|
+
|
|
9262
|
+
|
|
8293
9263
|
class _UniffiConverterSequenceTypeFiatCurrency(_UniffiConverterRustBuffer):
|
|
8294
9264
|
@classmethod
|
|
8295
9265
|
def check_lower(cls, value):
|
|
@@ -8338,6 +9308,39 @@ class _UniffiConverterSequenceTypeRate(_UniffiConverterRustBuffer):
|
|
|
8338
9308
|
_UniffiConverterTypeRate.read(buf) for i in range(count)
|
|
8339
9309
|
]
|
|
8340
9310
|
|
|
9311
|
+
|
|
9312
|
+
|
|
9313
|
+
class _UniffiConverterMapStringTypeTokenBalance(_UniffiConverterRustBuffer):
|
|
9314
|
+
@classmethod
|
|
9315
|
+
def check_lower(cls, items):
|
|
9316
|
+
for (key, value) in items.items():
|
|
9317
|
+
_UniffiConverterString.check_lower(key)
|
|
9318
|
+
_UniffiConverterTypeTokenBalance.check_lower(value)
|
|
9319
|
+
|
|
9320
|
+
@classmethod
|
|
9321
|
+
def write(cls, items, buf):
|
|
9322
|
+
buf.write_i32(len(items))
|
|
9323
|
+
for (key, value) in items.items():
|
|
9324
|
+
_UniffiConverterString.write(key, buf)
|
|
9325
|
+
_UniffiConverterTypeTokenBalance.write(value, buf)
|
|
9326
|
+
|
|
9327
|
+
@classmethod
|
|
9328
|
+
def read(cls, buf):
|
|
9329
|
+
count = buf.read_i32()
|
|
9330
|
+
if count < 0:
|
|
9331
|
+
raise InternalError("Unexpected negative map size")
|
|
9332
|
+
|
|
9333
|
+
# It would be nice to use a dict comprehension,
|
|
9334
|
+
# but in Python 3.7 and before the evaluation order is not according to spec,
|
|
9335
|
+
# so we we're reading the value before the key.
|
|
9336
|
+
# This loop makes the order explicit: first reading the key, then the value.
|
|
9337
|
+
d = {}
|
|
9338
|
+
for i in range(count):
|
|
9339
|
+
key = _UniffiConverterString.read(buf)
|
|
9340
|
+
val = _UniffiConverterTypeTokenBalance.read(buf)
|
|
9341
|
+
d[key] = val
|
|
9342
|
+
return d
|
|
9343
|
+
|
|
8341
9344
|
# External type BitcoinAddressDetails is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
8342
9345
|
|
|
8343
9346
|
|
|
@@ -8388,6 +9391,34 @@ class _UniffiConverterSequenceTypeRate(_UniffiConverterRustBuffer):
|
|
|
8388
9391
|
|
|
8389
9392
|
|
|
8390
9393
|
|
|
9394
|
+
|
|
9395
|
+
class _UniffiConverterTypeU128:
|
|
9396
|
+
@staticmethod
|
|
9397
|
+
def write(value, buf):
|
|
9398
|
+
builtin_value = str(value)
|
|
9399
|
+
_UniffiConverterString.write(builtin_value, buf)
|
|
9400
|
+
|
|
9401
|
+
@staticmethod
|
|
9402
|
+
def read(buf):
|
|
9403
|
+
builtin_value = _UniffiConverterString.read(buf)
|
|
9404
|
+
return int(builtin_value)
|
|
9405
|
+
|
|
9406
|
+
@staticmethod
|
|
9407
|
+
def lift(value):
|
|
9408
|
+
builtin_value = _UniffiConverterString.lift(value)
|
|
9409
|
+
return int(builtin_value)
|
|
9410
|
+
|
|
9411
|
+
@staticmethod
|
|
9412
|
+
def check_lower(value):
|
|
9413
|
+
builtin_value = str(value)
|
|
9414
|
+
return _UniffiConverterString.check_lower(builtin_value)
|
|
9415
|
+
|
|
9416
|
+
@staticmethod
|
|
9417
|
+
def lower(value):
|
|
9418
|
+
builtin_value = str(value)
|
|
9419
|
+
return _UniffiConverterString.lower(builtin_value)
|
|
9420
|
+
U128 = str
|
|
9421
|
+
|
|
8391
9422
|
# Async support# RustFuturePoll values
|
|
8392
9423
|
_UNIFFI_RUST_FUTURE_POLL_READY = 0
|
|
8393
9424
|
_UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1
|
|
@@ -8575,6 +9606,7 @@ _UniffiConverterTypeSdkError,
|
|
|
8575
9606
|
|
|
8576
9607
|
__all__ = [
|
|
8577
9608
|
"InternalError",
|
|
9609
|
+
"AssetFilter",
|
|
8578
9610
|
"ChainServiceError",
|
|
8579
9611
|
"DepositClaimError",
|
|
8580
9612
|
"Fee",
|
|
@@ -8593,6 +9625,7 @@ __all__ = [
|
|
|
8593
9625
|
"SendPaymentOptions",
|
|
8594
9626
|
"StorageError",
|
|
8595
9627
|
"UpdateDepositPayload",
|
|
9628
|
+
"WaitForPaymentIdentifier",
|
|
8596
9629
|
"CheckLightningAddressRequest",
|
|
8597
9630
|
"ClaimDepositRequest",
|
|
8598
9631
|
"ClaimDepositResponse",
|
|
@@ -8604,6 +9637,8 @@ __all__ = [
|
|
|
8604
9637
|
"GetInfoResponse",
|
|
8605
9638
|
"GetPaymentRequest",
|
|
8606
9639
|
"GetPaymentResponse",
|
|
9640
|
+
"GetTokensMetadataRequest",
|
|
9641
|
+
"GetTokensMetadataResponse",
|
|
8607
9642
|
"LightningAddressInfo",
|
|
8608
9643
|
"ListFiatCurrenciesResponse",
|
|
8609
9644
|
"ListFiatRatesResponse",
|
|
@@ -8632,8 +9667,12 @@ __all__ = [
|
|
|
8632
9667
|
"SendPaymentResponse",
|
|
8633
9668
|
"SyncWalletRequest",
|
|
8634
9669
|
"SyncWalletResponse",
|
|
9670
|
+
"TokenBalance",
|
|
9671
|
+
"TokenMetadata",
|
|
8635
9672
|
"TxStatus",
|
|
8636
9673
|
"Utxo",
|
|
9674
|
+
"WaitForPaymentRequest",
|
|
9675
|
+
"WaitForPaymentResponse",
|
|
8637
9676
|
"connect",
|
|
8638
9677
|
"default_config",
|
|
8639
9678
|
"default_storage",
|