breez-sdk-spark 0.3.1__cp311-cp311-win_amd64.whl → 0.3.3__cp311-cp311-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.

@@ -31,32 +31,41 @@ import asyncio
31
31
  import platform
32
32
  from .breez_sdk_common import BitcoinAddressDetails
33
33
  from .breez_sdk_common import Bolt11InvoiceDetails
34
+ from .breez_sdk_common import ExternalInputParser
34
35
  from .breez_sdk_common import FiatCurrency
35
36
  from .breez_sdk_common import FiatService
36
37
  from .breez_sdk_common import InputType
37
38
  from .breez_sdk_common import LnurlPayRequestDetails
39
+ from .breez_sdk_common import LnurlWithdrawRequestDetails
38
40
  from .breez_sdk_common import Rate
39
41
  from .breez_sdk_common import RestClient
42
+ from .breez_sdk_common import SparkInvoiceDetails
40
43
  from .breez_sdk_common import SuccessAction
41
44
  from .breez_sdk_common import SuccessActionProcessed
42
45
  from .breez_sdk_common import _UniffiConverterTypeBitcoinAddressDetails
43
46
  from .breez_sdk_common import _UniffiConverterTypeBolt11InvoiceDetails
47
+ from .breez_sdk_common import _UniffiConverterTypeExternalInputParser
44
48
  from .breez_sdk_common import _UniffiConverterTypeFiatCurrency
45
49
  from .breez_sdk_common import _UniffiConverterTypeFiatService
46
50
  from .breez_sdk_common import _UniffiConverterTypeInputType
47
51
  from .breez_sdk_common import _UniffiConverterTypeLnurlPayRequestDetails
52
+ from .breez_sdk_common import _UniffiConverterTypeLnurlWithdrawRequestDetails
48
53
  from .breez_sdk_common import _UniffiConverterTypeRate
49
54
  from .breez_sdk_common import _UniffiConverterTypeRestClient
55
+ from .breez_sdk_common import _UniffiConverterTypeSparkInvoiceDetails
50
56
  from .breez_sdk_common import _UniffiConverterTypeSuccessAction
51
57
  from .breez_sdk_common import _UniffiConverterTypeSuccessActionProcessed
52
58
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferBitcoinAddressDetails
53
59
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferBolt11InvoiceDetails
60
+ from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferExternalInputParser
54
61
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferFiatCurrency
55
62
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferFiatService
56
63
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferInputType
57
64
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferLnurlPayRequestDetails
65
+ from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferLnurlWithdrawRequestDetails
58
66
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferRate
59
67
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferRestClient
68
+ from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferSparkInvoiceDetails
60
69
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferSuccessAction
61
70
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferSuccessActionProcessed
62
71
 
@@ -499,8 +508,6 @@ def _uniffi_check_api_checksums(lib):
499
508
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
500
509
  if lib.uniffi_breez_sdk_spark_checksum_func_init_logging() != 8518:
501
510
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
502
- if lib.uniffi_breez_sdk_spark_checksum_func_parse() != 58372:
503
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
504
511
  if lib.uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos() != 20959:
505
512
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
506
513
  if lib.uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_transaction_status() != 23018:
@@ -513,6 +520,8 @@ def _uniffi_check_api_checksums(lib):
513
520
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
514
521
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available() != 31624:
515
522
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
523
+ if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_message() != 4385:
524
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
516
525
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_deposit() != 43529:
517
526
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
518
527
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_delete_lightning_address() != 44132:
@@ -537,6 +546,10 @@ def _uniffi_check_api_checksums(lib):
537
546
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
538
547
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() != 10147:
539
548
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
549
+ if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_withdraw() != 45652:
550
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
551
+ if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_parse() != 195:
552
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
540
553
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() != 37691:
541
554
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
542
555
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment() != 34185:
@@ -551,10 +564,14 @@ def _uniffi_check_api_checksums(lib):
551
564
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
552
565
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() != 54349:
553
566
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
567
+ if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sign_message() != 57563:
568
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
554
569
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() != 30368:
555
570
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
556
571
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment() != 64922:
557
572
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
573
+ if lib.uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send() != 30686:
574
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
558
575
  if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build() != 8126:
559
576
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
560
577
  if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service() != 2848:
@@ -565,6 +582,8 @@ def _uniffi_check_api_checksums(lib):
565
582
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
566
583
  if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client() != 61720:
567
584
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
585
+ if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer() != 21617:
586
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
568
587
  if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service() != 56288:
569
588
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
570
589
  if lib.uniffi_breez_sdk_spark_checksum_method_storage_delete_cached_item() != 6883:
@@ -716,6 +735,8 @@ _UNIFFI_CALLBACK_INTERFACE_BITCOIN_CHAIN_SERVICE_METHOD2 = ctypes.CFUNCTYPE(None
716
735
  )
717
736
  _UNIFFI_CALLBACK_INTERFACE_BITCOIN_CHAIN_SERVICE_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
718
737
  )
738
+ _UNIFFI_CALLBACK_INTERFACE_PAYMENT_OBSERVER_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
739
+ )
719
740
  _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
720
741
  )
721
742
  _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
@@ -758,6 +779,11 @@ class _UniffiVTableCallbackInterfaceBitcoinChainService(ctypes.Structure):
758
779
  ("broadcast_transaction", _UNIFFI_CALLBACK_INTERFACE_BITCOIN_CHAIN_SERVICE_METHOD3),
759
780
  ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
760
781
  ]
782
+ class _UniffiVTableCallbackInterfacePaymentObserver(ctypes.Structure):
783
+ _fields_ = [
784
+ ("before_send", _UNIFFI_CALLBACK_INTERFACE_PAYMENT_OBSERVER_METHOD0),
785
+ ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
786
+ ]
761
787
  class _UniffiVTableCallbackInterfaceStorage(ctypes.Structure):
762
788
  _fields_ = [
763
789
  ("delete_cached_item", _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD0),
@@ -828,6 +854,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_lightning_address_ava
828
854
  _UniffiRustBuffer,
829
855
  )
830
856
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_lightning_address_available.restype = ctypes.c_uint64
857
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_message.argtypes = (
858
+ ctypes.c_void_p,
859
+ _UniffiRustBuffer,
860
+ )
861
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_message.restype = ctypes.c_uint64
831
862
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_claim_deposit.argtypes = (
832
863
  ctypes.c_void_p,
833
864
  _UniffiRustBuffer,
@@ -883,6 +914,16 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.argtypes = (
883
914
  _UniffiRustBuffer,
884
915
  )
885
916
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.restype = ctypes.c_uint64
917
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_withdraw.argtypes = (
918
+ ctypes.c_void_p,
919
+ _UniffiRustBuffer,
920
+ )
921
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_withdraw.restype = ctypes.c_uint64
922
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_parse.argtypes = (
923
+ ctypes.c_void_p,
924
+ _UniffiRustBuffer,
925
+ )
926
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_parse.restype = ctypes.c_uint64
886
927
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_lnurl_pay.argtypes = (
887
928
  ctypes.c_void_p,
888
929
  _UniffiRustBuffer,
@@ -918,6 +959,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment.argtypes = (
918
959
  _UniffiRustBuffer,
919
960
  )
920
961
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment.restype = ctypes.c_uint64
962
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sign_message.argtypes = (
963
+ ctypes.c_void_p,
964
+ _UniffiRustBuffer,
965
+ )
966
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sign_message.restype = ctypes.c_uint64
921
967
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet.argtypes = (
922
968
  ctypes.c_void_p,
923
969
  _UniffiRustBuffer,
@@ -928,6 +974,25 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment.argtypes =
928
974
  _UniffiRustBuffer,
929
975
  )
930
976
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_wait_for_payment.restype = ctypes.c_uint64
977
+ _UniffiLib.uniffi_breez_sdk_spark_fn_clone_paymentobserver.argtypes = (
978
+ ctypes.c_void_p,
979
+ ctypes.POINTER(_UniffiRustCallStatus),
980
+ )
981
+ _UniffiLib.uniffi_breez_sdk_spark_fn_clone_paymentobserver.restype = ctypes.c_void_p
982
+ _UniffiLib.uniffi_breez_sdk_spark_fn_free_paymentobserver.argtypes = (
983
+ ctypes.c_void_p,
984
+ ctypes.POINTER(_UniffiRustCallStatus),
985
+ )
986
+ _UniffiLib.uniffi_breez_sdk_spark_fn_free_paymentobserver.restype = None
987
+ _UniffiLib.uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver.argtypes = (
988
+ ctypes.POINTER(_UniffiVTableCallbackInterfacePaymentObserver),
989
+ )
990
+ _UniffiLib.uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver.restype = None
991
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send.argtypes = (
992
+ ctypes.c_void_p,
993
+ _UniffiRustBuffer,
994
+ )
995
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send.restype = ctypes.c_uint64
931
996
  _UniffiLib.uniffi_breez_sdk_spark_fn_clone_sdkbuilder.argtypes = (
932
997
  ctypes.c_void_p,
933
998
  ctypes.POINTER(_UniffiRustCallStatus),
@@ -971,6 +1036,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_lnurl_client.argtype
971
1036
  ctypes.c_void_p,
972
1037
  )
973
1038
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_lnurl_client.restype = ctypes.c_uint64
1039
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer.argtypes = (
1040
+ ctypes.c_void_p,
1041
+ ctypes.c_void_p,
1042
+ )
1043
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer.restype = ctypes.c_uint64
974
1044
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_rest_chain_service.argtypes = (
975
1045
  ctypes.c_void_p,
976
1046
  _UniffiRustBuffer,
@@ -1086,10 +1156,6 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_func_init_logging.argtypes = (
1086
1156
  ctypes.POINTER(_UniffiRustCallStatus),
1087
1157
  )
1088
1158
  _UniffiLib.uniffi_breez_sdk_spark_fn_func_init_logging.restype = None
1089
- _UniffiLib.uniffi_breez_sdk_spark_fn_func_parse.argtypes = (
1090
- _UniffiRustBuffer,
1091
- )
1092
- _UniffiLib.uniffi_breez_sdk_spark_fn_func_parse.restype = ctypes.c_uint64
1093
1159
  _UniffiLib.ffi_breez_sdk_spark_rustbuffer_alloc.argtypes = (
1094
1160
  ctypes.c_uint64,
1095
1161
  ctypes.POINTER(_UniffiRustCallStatus),
@@ -1370,9 +1436,6 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_func_default_storage.restype = ctypes
1370
1436
  _UniffiLib.uniffi_breez_sdk_spark_checksum_func_init_logging.argtypes = (
1371
1437
  )
1372
1438
  _UniffiLib.uniffi_breez_sdk_spark_checksum_func_init_logging.restype = ctypes.c_uint16
1373
- _UniffiLib.uniffi_breez_sdk_spark_checksum_func_parse.argtypes = (
1374
- )
1375
- _UniffiLib.uniffi_breez_sdk_spark_checksum_func_parse.restype = ctypes.c_uint16
1376
1439
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos.argtypes = (
1377
1440
  )
1378
1441
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_bitcoinchainservice_get_address_utxos.restype = ctypes.c_uint16
@@ -1391,6 +1454,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener.re
1391
1454
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available.argtypes = (
1392
1455
  )
1393
1456
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available.restype = ctypes.c_uint16
1457
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_message.argtypes = (
1458
+ )
1459
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_message.restype = ctypes.c_uint16
1394
1460
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_deposit.argtypes = (
1395
1461
  )
1396
1462
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_deposit.restype = ctypes.c_uint16
@@ -1427,6 +1493,12 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_unclaimed_deposi
1427
1493
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay.argtypes = (
1428
1494
  )
1429
1495
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay.restype = ctypes.c_uint16
1496
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_withdraw.argtypes = (
1497
+ )
1498
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_withdraw.restype = ctypes.c_uint16
1499
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_parse.argtypes = (
1500
+ )
1501
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_parse.restype = ctypes.c_uint16
1430
1502
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay.argtypes = (
1431
1503
  )
1432
1504
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay.restype = ctypes.c_uint16
@@ -1448,12 +1520,18 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener
1448
1520
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment.argtypes = (
1449
1521
  )
1450
1522
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment.restype = ctypes.c_uint16
1523
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sign_message.argtypes = (
1524
+ )
1525
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sign_message.restype = ctypes.c_uint16
1451
1526
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet.argtypes = (
1452
1527
  )
1453
1528
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet.restype = ctypes.c_uint16
1454
1529
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment.argtypes = (
1455
1530
  )
1456
1531
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment.restype = ctypes.c_uint16
1532
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send.argtypes = (
1533
+ )
1534
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_paymentobserver_before_send.restype = ctypes.c_uint16
1457
1535
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build.argtypes = (
1458
1536
  )
1459
1537
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build.restype = ctypes.c_uint16
@@ -1469,6 +1547,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set.restyp
1469
1547
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client.argtypes = (
1470
1548
  )
1471
1549
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client.restype = ctypes.c_uint16
1550
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer.argtypes = (
1551
+ )
1552
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_payment_observer.restype = ctypes.c_uint16
1472
1553
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service.argtypes = (
1473
1554
  )
1474
1555
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service.restype = ctypes.c_uint16
@@ -1986,6 +2067,14 @@ class BreezSdkProtocol(typing.Protocol):
1986
2067
 
1987
2068
  raise NotImplementedError
1988
2069
  def check_lightning_address_available(self, req: "CheckLightningAddressRequest"):
2070
+ raise NotImplementedError
2071
+ def check_message(self, request: "CheckMessageRequest"):
2072
+ """
2073
+ Verifies a message signature against the provided public key. The message
2074
+ is SHA256 hashed before verification. The signature can be hex encoded
2075
+ in either DER or compact format.
2076
+ """
2077
+
1989
2078
  raise NotImplementedError
1990
2079
  def claim_deposit(self, request: "ClaimDepositRequest"):
1991
2080
  raise NotImplementedError
@@ -2061,6 +2150,38 @@ class BreezSdkProtocol(typing.Protocol):
2061
2150
  raise NotImplementedError
2062
2151
  def lnurl_pay(self, request: "LnurlPayRequest"):
2063
2152
  raise NotImplementedError
2153
+ def lnurl_withdraw(self, request: "LnurlWithdrawRequest"):
2154
+ """
2155
+ Performs an LNURL withdraw operation for the amount of satoshis to
2156
+ withdraw and the LNURL withdraw request details. The LNURL withdraw request
2157
+ details can be obtained from calling [`BreezSdk::parse`].
2158
+
2159
+ The method generates a Lightning invoice for the withdraw amount, stores
2160
+ the LNURL withdraw metadata, and performs the LNURL withdraw using the generated
2161
+ invoice.
2162
+
2163
+ If the `completion_timeout_secs` parameter is provided and greater than 0, the
2164
+ method will wait for the payment to be completed within that period. If the
2165
+ withdraw is completed within the timeout, the `payment` field in the response
2166
+ will be set with the payment details. If the `completion_timeout_secs`
2167
+ parameter is not provided or set to 0, the method will not wait for the payment
2168
+ to be completed. If the withdraw is not completed within the
2169
+ timeout, the `payment` field will be empty.
2170
+
2171
+ # Arguments
2172
+
2173
+ * `request` - The LNURL withdraw request
2174
+
2175
+ # Returns
2176
+
2177
+ Result containing either:
2178
+ * `LnurlWithdrawResponse` - The payment details if the withdraw request was successful
2179
+ * `SdkError` - If there was an error during the withdraw process
2180
+ """
2181
+
2182
+ raise NotImplementedError
2183
+ def parse(self, input: "str"):
2184
+ raise NotImplementedError
2064
2185
  def prepare_lnurl_pay(self, request: "PrepareLnurlPayRequest"):
2065
2186
  raise NotImplementedError
2066
2187
  def prepare_send_payment(self, request: "PrepareSendPaymentRequest"):
@@ -2086,6 +2207,14 @@ class BreezSdkProtocol(typing.Protocol):
2086
2207
 
2087
2208
  raise NotImplementedError
2088
2209
  def send_payment(self, request: "SendPaymentRequest"):
2210
+ raise NotImplementedError
2211
+ def sign_message(self, request: "SignMessageRequest"):
2212
+ """
2213
+ Signs a message with the wallet's identity key. The message is SHA256
2214
+ hashed before signing. The returned signature will be hex encoded in
2215
+ DER format by default, or compact format if specified.
2216
+ """
2217
+
2089
2218
  raise NotImplementedError
2090
2219
  def sync_wallet(self, request: "SyncWalletRequest"):
2091
2220
  """
@@ -2181,6 +2310,33 @@ _UniffiConverterTypeSdkError,
2181
2310
 
2182
2311
 
2183
2312
 
2313
+ async def check_message(self, request: "CheckMessageRequest") -> "CheckMessageResponse":
2314
+ """
2315
+ Verifies a message signature against the provided public key. The message
2316
+ is SHA256 hashed before verification. The signature can be hex encoded
2317
+ in either DER or compact format.
2318
+ """
2319
+
2320
+ _UniffiConverterTypeCheckMessageRequest.check_lower(request)
2321
+
2322
+ return await _uniffi_rust_call_async(
2323
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_message(
2324
+ self._uniffi_clone_pointer(),
2325
+ _UniffiConverterTypeCheckMessageRequest.lower(request)
2326
+ ),
2327
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2328
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2329
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2330
+ # lift function
2331
+ _UniffiConverterTypeCheckMessageResponse.lift,
2332
+
2333
+ # Error FFI converter
2334
+ _UniffiConverterTypeSdkError,
2335
+
2336
+ )
2337
+
2338
+
2339
+
2184
2340
  async def claim_deposit(self, request: "ClaimDepositRequest") -> "ClaimDepositResponse":
2185
2341
  _UniffiConverterTypeClaimDepositRequest.check_lower(request)
2186
2342
 
@@ -2472,6 +2628,76 @@ _UniffiConverterTypeSdkError,
2472
2628
 
2473
2629
 
2474
2630
 
2631
+ async def lnurl_withdraw(self, request: "LnurlWithdrawRequest") -> "LnurlWithdrawResponse":
2632
+ """
2633
+ Performs an LNURL withdraw operation for the amount of satoshis to
2634
+ withdraw and the LNURL withdraw request details. The LNURL withdraw request
2635
+ details can be obtained from calling [`BreezSdk::parse`].
2636
+
2637
+ The method generates a Lightning invoice for the withdraw amount, stores
2638
+ the LNURL withdraw metadata, and performs the LNURL withdraw using the generated
2639
+ invoice.
2640
+
2641
+ If the `completion_timeout_secs` parameter is provided and greater than 0, the
2642
+ method will wait for the payment to be completed within that period. If the
2643
+ withdraw is completed within the timeout, the `payment` field in the response
2644
+ will be set with the payment details. If the `completion_timeout_secs`
2645
+ parameter is not provided or set to 0, the method will not wait for the payment
2646
+ to be completed. If the withdraw is not completed within the
2647
+ timeout, the `payment` field will be empty.
2648
+
2649
+ # Arguments
2650
+
2651
+ * `request` - The LNURL withdraw request
2652
+
2653
+ # Returns
2654
+
2655
+ Result containing either:
2656
+ * `LnurlWithdrawResponse` - The payment details if the withdraw request was successful
2657
+ * `SdkError` - If there was an error during the withdraw process
2658
+ """
2659
+
2660
+ _UniffiConverterTypeLnurlWithdrawRequest.check_lower(request)
2661
+
2662
+ return await _uniffi_rust_call_async(
2663
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_withdraw(
2664
+ self._uniffi_clone_pointer(),
2665
+ _UniffiConverterTypeLnurlWithdrawRequest.lower(request)
2666
+ ),
2667
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2668
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2669
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2670
+ # lift function
2671
+ _UniffiConverterTypeLnurlWithdrawResponse.lift,
2672
+
2673
+ # Error FFI converter
2674
+ _UniffiConverterTypeSdkError,
2675
+
2676
+ )
2677
+
2678
+
2679
+
2680
+ async def parse(self, input: "str") -> "InputType":
2681
+ _UniffiConverterString.check_lower(input)
2682
+
2683
+ return await _uniffi_rust_call_async(
2684
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_parse(
2685
+ self._uniffi_clone_pointer(),
2686
+ _UniffiConverterString.lower(input)
2687
+ ),
2688
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2689
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2690
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2691
+ # lift function
2692
+ _UniffiConverterTypeInputType.lift,
2693
+
2694
+ # Error FFI converter
2695
+ _UniffiConverterTypeSdkError,
2696
+
2697
+ )
2698
+
2699
+
2700
+
2475
2701
  async def prepare_lnurl_pay(self, request: "PrepareLnurlPayRequest") -> "PrepareLnurlPayResponse":
2476
2702
  _UniffiConverterTypePrepareLnurlPayRequest.check_lower(request)
2477
2703
 
@@ -2632,6 +2858,33 @@ _UniffiConverterTypeSdkError,
2632
2858
 
2633
2859
 
2634
2860
 
2861
+ async def sign_message(self, request: "SignMessageRequest") -> "SignMessageResponse":
2862
+ """
2863
+ Signs a message with the wallet's identity key. The message is SHA256
2864
+ hashed before signing. The returned signature will be hex encoded in
2865
+ DER format by default, or compact format if specified.
2866
+ """
2867
+
2868
+ _UniffiConverterTypeSignMessageRequest.check_lower(request)
2869
+
2870
+ return await _uniffi_rust_call_async(
2871
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sign_message(
2872
+ self._uniffi_clone_pointer(),
2873
+ _UniffiConverterTypeSignMessageRequest.lower(request)
2874
+ ),
2875
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2876
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2877
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2878
+ # lift function
2879
+ _UniffiConverterTypeSignMessageResponse.lift,
2880
+
2881
+ # Error FFI converter
2882
+ _UniffiConverterTypeSdkError,
2883
+
2884
+ )
2885
+
2886
+
2887
+
2635
2888
  async def sync_wallet(self, request: "SyncWalletRequest") -> "SyncWalletResponse":
2636
2889
  """
2637
2890
  Synchronizes the wallet with the Spark network
@@ -2710,89 +2963,39 @@ class _UniffiConverterTypeBreezSdk:
2710
2963
 
2711
2964
 
2712
2965
 
2713
- class SdkBuilderProtocol(typing.Protocol):
2966
+ class PaymentObserver(typing.Protocol):
2714
2967
  """
2715
- Builder for creating `BreezSdk` instances with customizable components.
2968
+ This interface is used to observe outgoing payments before Lightning, Spark and onchain Bitcoin payments.
2969
+ If the implementation returns an error, the payment is cancelled.
2716
2970
  """
2717
2971
 
2718
- def build(self, ):
2719
- """
2720
- Builds the `BreezSdk` instance with the configured components.
2721
- """
2722
-
2723
- raise NotImplementedError
2724
- def with_chain_service(self, chain_service: "BitcoinChainService"):
2725
- """
2726
- Sets the chain service to be used by the SDK.
2727
- Arguments:
2728
- - `chain_service`: The chain service to be used.
2729
- """
2730
-
2731
- raise NotImplementedError
2732
- def with_fiat_service(self, fiat_service: "FiatService"):
2733
- """
2734
- Sets the fiat service to be used by the SDK.
2735
- Arguments:
2736
- - `fiat_service`: The fiat service to be used.
2737
- """
2738
-
2739
- raise NotImplementedError
2740
- def with_key_set(self, key_set_type: "KeySetType",use_address_index: "bool",account_number: "typing.Optional[int]"):
2741
- """
2742
- Sets the key set type to be used by the SDK.
2743
- Arguments:
2744
- - `key_set_type`: The key set type which determines the derivation path.
2745
- - `use_address_index`: Controls the structure of the BIP derivation path.
2746
- """
2747
-
2748
- raise NotImplementedError
2749
- def with_lnurl_client(self, lnurl_client: "RestClient"):
2750
- raise NotImplementedError
2751
- def with_rest_chain_service(self, url: "str",credentials: "typing.Optional[Credentials]"):
2972
+ def before_send(self, payments: "typing.List[ProvisionalPayment]"):
2752
2973
  """
2753
- Sets the REST chain service to be used by the SDK.
2754
- Arguments:
2755
- - `url`: The base URL of the REST API.
2756
- - `credentials`: Optional credentials for basic authentication.
2974
+ Called before Lightning, Spark or onchain Bitcoin payments are made
2757
2975
  """
2758
2976
 
2759
2977
  raise NotImplementedError
2760
2978
 
2761
2979
 
2762
- class SdkBuilder:
2980
+ class PaymentObserverImpl:
2763
2981
  """
2764
- Builder for creating `BreezSdk` instances with customizable components.
2982
+ This interface is used to observe outgoing payments before Lightning, Spark and onchain Bitcoin payments.
2983
+ If the implementation returns an error, the payment is cancelled.
2765
2984
  """
2766
2985
 
2767
2986
  _pointer: ctypes.c_void_p
2768
- def __init__(self, config: "Config",seed: "Seed",storage: "Storage"):
2769
- """
2770
- Creates a new `SdkBuilder` with the provided configuration.
2771
- Arguments:
2772
- - `config`: The configuration to be used.
2773
- - `seed`: The seed for wallet generation.
2774
- - `storage`: The storage backend to be used.
2775
- """
2776
-
2777
- _UniffiConverterTypeConfig.check_lower(config)
2778
-
2779
- _UniffiConverterTypeSeed.check_lower(seed)
2780
-
2781
- _UniffiConverterTypeStorage.check_lower(storage)
2782
-
2783
- self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new,
2784
- _UniffiConverterTypeConfig.lower(config),
2785
- _UniffiConverterTypeSeed.lower(seed),
2786
- _UniffiConverterTypeStorage.lower(storage))
2987
+
2988
+ def __init__(self, *args, **kwargs):
2989
+ raise ValueError("This class has no default constructor")
2787
2990
 
2788
2991
  def __del__(self):
2789
2992
  # In case of partial initialization of instances.
2790
2993
  pointer = getattr(self, "_pointer", None)
2791
2994
  if pointer is not None:
2792
- _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_free_sdkbuilder, pointer)
2995
+ _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_free_paymentobserver, pointer)
2793
2996
 
2794
2997
  def _uniffi_clone_pointer(self):
2795
- return _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_clone_sdkbuilder, self._pointer)
2998
+ return _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_clone_paymentobserver, self._pointer)
2796
2999
 
2797
3000
  # Used by alternative constructors or any methods which return this type.
2798
3001
  @classmethod
@@ -2803,42 +3006,18 @@ class SdkBuilder:
2803
3006
  inst._pointer = pointer
2804
3007
  return inst
2805
3008
 
2806
- async def build(self, ) -> "BreezSdk":
2807
- """
2808
- Builds the `BreezSdk` instance with the configured components.
2809
- """
2810
-
2811
- return await _uniffi_rust_call_async(
2812
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_build(
2813
- self._uniffi_clone_pointer(),
2814
- ),
2815
- _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_pointer,
2816
- _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_pointer,
2817
- _UniffiLib.ffi_breez_sdk_spark_rust_future_free_pointer,
2818
- # lift function
2819
- _UniffiConverterTypeBreezSdk.lift,
2820
-
2821
- # Error FFI converter
2822
- _UniffiConverterTypeSdkError,
2823
-
2824
- )
2825
-
2826
-
2827
-
2828
- async def with_chain_service(self, chain_service: "BitcoinChainService") -> None:
3009
+ async def before_send(self, payments: "typing.List[ProvisionalPayment]") -> None:
2829
3010
 
2830
3011
  """
2831
- Sets the chain service to be used by the SDK.
2832
- Arguments:
2833
- - `chain_service`: The chain service to be used.
3012
+ Called before Lightning, Spark or onchain Bitcoin payments are made
2834
3013
  """
2835
3014
 
2836
- _UniffiConverterTypeBitcoinChainService.check_lower(chain_service)
3015
+ _UniffiConverterSequenceTypeProvisionalPayment.check_lower(payments)
2837
3016
 
2838
3017
  return await _uniffi_rust_call_async(
2839
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_chain_service(
3018
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_paymentobserver_before_send(
2840
3019
  self._uniffi_clone_pointer(),
2841
- _UniffiConverterTypeBitcoinChainService.lower(chain_service)
3020
+ _UniffiConverterSequenceTypeProvisionalPayment.lower(payments)
2842
3021
  ),
2843
3022
  _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_void,
2844
3023
  _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_void,
@@ -2848,25 +3027,257 @@ _UniffiConverterTypeSdkError,
2848
3027
 
2849
3028
 
2850
3029
  # Error FFI converter
2851
-
2852
- None,
3030
+ _UniffiConverterTypePaymentObserverError,
2853
3031
 
2854
3032
  )
2855
3033
 
2856
3034
 
2857
3035
 
2858
- async def with_fiat_service(self, fiat_service: "FiatService") -> None:
2859
3036
 
2860
- """
2861
- Sets the fiat service to be used by the SDK.
2862
- Arguments:
2863
- - `fiat_service`: The fiat service to be used.
2864
- """
3037
+ # Put all the bits inside a class to keep the top-level namespace clean
3038
+ class _UniffiTraitImplPaymentObserver:
3039
+ # For each method, generate a callback function to pass to Rust
2865
3040
 
2866
- _UniffiConverterTypeFiatService.check_lower(fiat_service)
2867
-
2868
- return await _uniffi_rust_call_async(
2869
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service(
3041
+ @_UNIFFI_CALLBACK_INTERFACE_PAYMENT_OBSERVER_METHOD0
3042
+ def before_send(
3043
+ uniffi_handle,
3044
+ payments,
3045
+ uniffi_future_callback,
3046
+ uniffi_callback_data,
3047
+ uniffi_out_return,
3048
+ ):
3049
+ uniffi_obj = _UniffiConverterTypePaymentObserver._handle_map.get(uniffi_handle)
3050
+ def make_call():
3051
+ args = (_UniffiConverterSequenceTypeProvisionalPayment.lift(payments), )
3052
+ method = uniffi_obj.before_send
3053
+ return method(*args)
3054
+
3055
+
3056
+ def handle_success(return_value):
3057
+ uniffi_future_callback(
3058
+ uniffi_callback_data,
3059
+ _UniffiForeignFutureStructVoid(
3060
+ _UniffiRustCallStatus.default()
3061
+ )
3062
+ )
3063
+
3064
+ def handle_error(status_code, rust_buffer):
3065
+ uniffi_future_callback(
3066
+ uniffi_callback_data,
3067
+ _UniffiForeignFutureStructVoid(
3068
+ _UniffiRustCallStatus(status_code, rust_buffer),
3069
+ )
3070
+ )
3071
+ uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, PaymentObserverError, _UniffiConverterTypePaymentObserverError.lower)
3072
+
3073
+ @_UNIFFI_CALLBACK_INTERFACE_FREE
3074
+ def _uniffi_free(uniffi_handle):
3075
+ _UniffiConverterTypePaymentObserver._handle_map.remove(uniffi_handle)
3076
+
3077
+ # Generate the FFI VTable. This has a field for each callback interface method.
3078
+ _uniffi_vtable = _UniffiVTableCallbackInterfacePaymentObserver(
3079
+ before_send,
3080
+ _uniffi_free
3081
+ )
3082
+ # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever,
3083
+ # or else bad things will happen when Rust tries to access it.
3084
+ _UniffiLib.uniffi_breez_sdk_spark_fn_init_callback_vtable_paymentobserver(ctypes.byref(_uniffi_vtable))
3085
+
3086
+
3087
+
3088
+ class _UniffiConverterTypePaymentObserver:
3089
+ _handle_map = _UniffiHandleMap()
3090
+
3091
+ @staticmethod
3092
+ def lift(value: int):
3093
+ return PaymentObserverImpl._make_instance_(value)
3094
+
3095
+ @staticmethod
3096
+ def check_lower(value: PaymentObserver):
3097
+ pass
3098
+
3099
+ @staticmethod
3100
+ def lower(value: PaymentObserver):
3101
+ return _UniffiConverterTypePaymentObserver._handle_map.insert(value)
3102
+
3103
+ @classmethod
3104
+ def read(cls, buf: _UniffiRustBuffer):
3105
+ ptr = buf.read_u64()
3106
+ if ptr == 0:
3107
+ raise InternalError("Raw pointer value was null")
3108
+ return cls.lift(ptr)
3109
+
3110
+ @classmethod
3111
+ def write(cls, value: PaymentObserver, buf: _UniffiRustBuffer):
3112
+ buf.write_u64(cls.lower(value))
3113
+
3114
+
3115
+
3116
+ class SdkBuilderProtocol(typing.Protocol):
3117
+ """
3118
+ Builder for creating `BreezSdk` instances with customizable components.
3119
+ """
3120
+
3121
+ def build(self, ):
3122
+ """
3123
+ Builds the `BreezSdk` instance with the configured components.
3124
+ """
3125
+
3126
+ raise NotImplementedError
3127
+ def with_chain_service(self, chain_service: "BitcoinChainService"):
3128
+ """
3129
+ Sets the chain service to be used by the SDK.
3130
+ Arguments:
3131
+ - `chain_service`: The chain service to be used.
3132
+ """
3133
+
3134
+ raise NotImplementedError
3135
+ def with_fiat_service(self, fiat_service: "FiatService"):
3136
+ """
3137
+ Sets the fiat service to be used by the SDK.
3138
+ Arguments:
3139
+ - `fiat_service`: The fiat service to be used.
3140
+ """
3141
+
3142
+ raise NotImplementedError
3143
+ def with_key_set(self, key_set_type: "KeySetType",use_address_index: "bool",account_number: "typing.Optional[int]"):
3144
+ """
3145
+ Sets the key set type to be used by the SDK.
3146
+ Arguments:
3147
+ - `key_set_type`: The key set type which determines the derivation path.
3148
+ - `use_address_index`: Controls the structure of the BIP derivation path.
3149
+ """
3150
+
3151
+ raise NotImplementedError
3152
+ def with_lnurl_client(self, lnurl_client: "RestClient"):
3153
+ raise NotImplementedError
3154
+ def with_payment_observer(self, payment_observer: "PaymentObserver"):
3155
+ """
3156
+ Sets the payment observer to be used by the SDK.
3157
+ Arguments:
3158
+ - `payment_observer`: The payment observer to be used.
3159
+ """
3160
+
3161
+ raise NotImplementedError
3162
+ def with_rest_chain_service(self, url: "str",credentials: "typing.Optional[Credentials]"):
3163
+ """
3164
+ Sets the REST chain service to be used by the SDK.
3165
+ Arguments:
3166
+ - `url`: The base URL of the REST API.
3167
+ - `credentials`: Optional credentials for basic authentication.
3168
+ """
3169
+
3170
+ raise NotImplementedError
3171
+
3172
+
3173
+ class SdkBuilder:
3174
+ """
3175
+ Builder for creating `BreezSdk` instances with customizable components.
3176
+ """
3177
+
3178
+ _pointer: ctypes.c_void_p
3179
+ def __init__(self, config: "Config",seed: "Seed",storage: "Storage"):
3180
+ """
3181
+ Creates a new `SdkBuilder` with the provided configuration.
3182
+ Arguments:
3183
+ - `config`: The configuration to be used.
3184
+ - `seed`: The seed for wallet generation.
3185
+ - `storage`: The storage backend to be used.
3186
+ """
3187
+
3188
+ _UniffiConverterTypeConfig.check_lower(config)
3189
+
3190
+ _UniffiConverterTypeSeed.check_lower(seed)
3191
+
3192
+ _UniffiConverterTypeStorage.check_lower(storage)
3193
+
3194
+ self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new,
3195
+ _UniffiConverterTypeConfig.lower(config),
3196
+ _UniffiConverterTypeSeed.lower(seed),
3197
+ _UniffiConverterTypeStorage.lower(storage))
3198
+
3199
+ def __del__(self):
3200
+ # In case of partial initialization of instances.
3201
+ pointer = getattr(self, "_pointer", None)
3202
+ if pointer is not None:
3203
+ _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_free_sdkbuilder, pointer)
3204
+
3205
+ def _uniffi_clone_pointer(self):
3206
+ return _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_clone_sdkbuilder, self._pointer)
3207
+
3208
+ # Used by alternative constructors or any methods which return this type.
3209
+ @classmethod
3210
+ def _make_instance_(cls, pointer):
3211
+ # Lightly yucky way to bypass the usual __init__ logic
3212
+ # and just create a new instance with the required pointer.
3213
+ inst = cls.__new__(cls)
3214
+ inst._pointer = pointer
3215
+ return inst
3216
+
3217
+ async def build(self, ) -> "BreezSdk":
3218
+ """
3219
+ Builds the `BreezSdk` instance with the configured components.
3220
+ """
3221
+
3222
+ return await _uniffi_rust_call_async(
3223
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_build(
3224
+ self._uniffi_clone_pointer(),
3225
+ ),
3226
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_pointer,
3227
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_pointer,
3228
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_pointer,
3229
+ # lift function
3230
+ _UniffiConverterTypeBreezSdk.lift,
3231
+
3232
+ # Error FFI converter
3233
+ _UniffiConverterTypeSdkError,
3234
+
3235
+ )
3236
+
3237
+
3238
+
3239
+ async def with_chain_service(self, chain_service: "BitcoinChainService") -> None:
3240
+
3241
+ """
3242
+ Sets the chain service to be used by the SDK.
3243
+ Arguments:
3244
+ - `chain_service`: The chain service to be used.
3245
+ """
3246
+
3247
+ _UniffiConverterTypeBitcoinChainService.check_lower(chain_service)
3248
+
3249
+ return await _uniffi_rust_call_async(
3250
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_chain_service(
3251
+ self._uniffi_clone_pointer(),
3252
+ _UniffiConverterTypeBitcoinChainService.lower(chain_service)
3253
+ ),
3254
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_void,
3255
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_void,
3256
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_void,
3257
+ # lift function
3258
+ lambda val: None,
3259
+
3260
+
3261
+ # Error FFI converter
3262
+
3263
+ None,
3264
+
3265
+ )
3266
+
3267
+
3268
+
3269
+ async def with_fiat_service(self, fiat_service: "FiatService") -> None:
3270
+
3271
+ """
3272
+ Sets the fiat service to be used by the SDK.
3273
+ Arguments:
3274
+ - `fiat_service`: The fiat service to be used.
3275
+ """
3276
+
3277
+ _UniffiConverterTypeFiatService.check_lower(fiat_service)
3278
+
3279
+ return await _uniffi_rust_call_async(
3280
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service(
2870
3281
  self._uniffi_clone_pointer(),
2871
3282
  _UniffiConverterTypeFiatService.lower(fiat_service)
2872
3283
  ),
@@ -2946,6 +3357,36 @@ _UniffiConverterTypeSdkError,
2946
3357
 
2947
3358
 
2948
3359
 
3360
+ async def with_payment_observer(self, payment_observer: "PaymentObserver") -> None:
3361
+
3362
+ """
3363
+ Sets the payment observer to be used by the SDK.
3364
+ Arguments:
3365
+ - `payment_observer`: The payment observer to be used.
3366
+ """
3367
+
3368
+ _UniffiConverterTypePaymentObserver.check_lower(payment_observer)
3369
+
3370
+ return await _uniffi_rust_call_async(
3371
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_payment_observer(
3372
+ self._uniffi_clone_pointer(),
3373
+ _UniffiConverterTypePaymentObserver.lower(payment_observer)
3374
+ ),
3375
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_void,
3376
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_void,
3377
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_void,
3378
+ # lift function
3379
+ lambda val: None,
3380
+
3381
+
3382
+ # Error FFI converter
3383
+
3384
+ None,
3385
+
3386
+ )
3387
+
3388
+
3389
+
2949
3390
  async def with_rest_chain_service(self, url: "str",credentials: "typing.Optional[Credentials]") -> None:
2950
3391
 
2951
3392
  """
@@ -4048,6 +4489,90 @@ class _UniffiConverterTypeCheckLightningAddressRequest(_UniffiConverterRustBuffe
4048
4489
  _UniffiConverterString.write(value.username, buf)
4049
4490
 
4050
4491
 
4492
+ class CheckMessageRequest:
4493
+ message: "str"
4494
+ """
4495
+ The message that was signed
4496
+ """
4497
+
4498
+ pubkey: "str"
4499
+ """
4500
+ The public key that signed the message
4501
+ """
4502
+
4503
+ signature: "str"
4504
+ """
4505
+ The DER or compact hex encoded signature
4506
+ """
4507
+
4508
+ def __init__(self, *, message: "str", pubkey: "str", signature: "str"):
4509
+ self.message = message
4510
+ self.pubkey = pubkey
4511
+ self.signature = signature
4512
+
4513
+ def __str__(self):
4514
+ return "CheckMessageRequest(message={}, pubkey={}, signature={})".format(self.message, self.pubkey, self.signature)
4515
+
4516
+ def __eq__(self, other):
4517
+ if self.message != other.message:
4518
+ return False
4519
+ if self.pubkey != other.pubkey:
4520
+ return False
4521
+ if self.signature != other.signature:
4522
+ return False
4523
+ return True
4524
+
4525
+ class _UniffiConverterTypeCheckMessageRequest(_UniffiConverterRustBuffer):
4526
+ @staticmethod
4527
+ def read(buf):
4528
+ return CheckMessageRequest(
4529
+ message=_UniffiConverterString.read(buf),
4530
+ pubkey=_UniffiConverterString.read(buf),
4531
+ signature=_UniffiConverterString.read(buf),
4532
+ )
4533
+
4534
+ @staticmethod
4535
+ def check_lower(value):
4536
+ _UniffiConverterString.check_lower(value.message)
4537
+ _UniffiConverterString.check_lower(value.pubkey)
4538
+ _UniffiConverterString.check_lower(value.signature)
4539
+
4540
+ @staticmethod
4541
+ def write(value, buf):
4542
+ _UniffiConverterString.write(value.message, buf)
4543
+ _UniffiConverterString.write(value.pubkey, buf)
4544
+ _UniffiConverterString.write(value.signature, buf)
4545
+
4546
+
4547
+ class CheckMessageResponse:
4548
+ is_valid: "bool"
4549
+ def __init__(self, *, is_valid: "bool"):
4550
+ self.is_valid = is_valid
4551
+
4552
+ def __str__(self):
4553
+ return "CheckMessageResponse(is_valid={})".format(self.is_valid)
4554
+
4555
+ def __eq__(self, other):
4556
+ if self.is_valid != other.is_valid:
4557
+ return False
4558
+ return True
4559
+
4560
+ class _UniffiConverterTypeCheckMessageResponse(_UniffiConverterRustBuffer):
4561
+ @staticmethod
4562
+ def read(buf):
4563
+ return CheckMessageResponse(
4564
+ is_valid=_UniffiConverterBool.read(buf),
4565
+ )
4566
+
4567
+ @staticmethod
4568
+ def check_lower(value):
4569
+ _UniffiConverterBool.check_lower(value.is_valid)
4570
+
4571
+ @staticmethod
4572
+ def write(value, buf):
4573
+ _UniffiConverterBool.write(value.is_valid, buf)
4574
+
4575
+
4051
4576
  class ClaimDepositRequest:
4052
4577
  txid: "str"
4053
4578
  vout: "int"
@@ -4130,26 +4655,42 @@ class Config:
4130
4655
  max_deposit_claim_fee: "typing.Optional[Fee]"
4131
4656
  lnurl_domain: "typing.Optional[str]"
4132
4657
  """
4133
- The domain used for receiving through lnurl-pay and lightning address.
4658
+ The domain used for receiving through lnurl-pay and lightning address.
4659
+ """
4660
+
4661
+ prefer_spark_over_lightning: "bool"
4662
+ """
4663
+ When this is set to `true` we will prefer to use spark payments over
4664
+ lightning when sending and receiving. This has the benefit of lower fees
4665
+ but is at the cost of privacy.
4666
+ """
4667
+
4668
+ external_input_parsers: "typing.Optional[typing.List[ExternalInputParser]]"
4669
+ """
4670
+ A set of external input parsers that are used by [`BreezSdk::parse`](crate::sdk::BreezSdk::parse) when the input
4671
+ is not recognized. See [`ExternalInputParser`] for more details on how to configure
4672
+ external parsing.
4134
4673
  """
4135
4674
 
4136
- prefer_spark_over_lightning: "bool"
4675
+ use_default_external_input_parsers: "bool"
4137
4676
  """
4138
- When this is set to `true` we will prefer to use spark payments over
4139
- lightning when sending and receiving. This has the benefit of lower fees
4140
- but is at the cost of privacy.
4677
+ The SDK includes some default external input parsers
4678
+ ([`DEFAULT_EXTERNAL_INPUT_PARSERS`]).
4679
+ Set this to false in order to prevent their use.
4141
4680
  """
4142
4681
 
4143
- def __init__(self, *, api_key: "typing.Optional[str]", network: "Network", sync_interval_secs: "int", max_deposit_claim_fee: "typing.Optional[Fee]", lnurl_domain: "typing.Optional[str]", prefer_spark_over_lightning: "bool"):
4682
+ def __init__(self, *, api_key: "typing.Optional[str]", network: "Network", sync_interval_secs: "int", max_deposit_claim_fee: "typing.Optional[Fee]", lnurl_domain: "typing.Optional[str]", prefer_spark_over_lightning: "bool", external_input_parsers: "typing.Optional[typing.List[ExternalInputParser]]", use_default_external_input_parsers: "bool"):
4144
4683
  self.api_key = api_key
4145
4684
  self.network = network
4146
4685
  self.sync_interval_secs = sync_interval_secs
4147
4686
  self.max_deposit_claim_fee = max_deposit_claim_fee
4148
4687
  self.lnurl_domain = lnurl_domain
4149
4688
  self.prefer_spark_over_lightning = prefer_spark_over_lightning
4689
+ self.external_input_parsers = external_input_parsers
4690
+ self.use_default_external_input_parsers = use_default_external_input_parsers
4150
4691
 
4151
4692
  def __str__(self):
4152
- return "Config(api_key={}, network={}, sync_interval_secs={}, max_deposit_claim_fee={}, lnurl_domain={}, prefer_spark_over_lightning={})".format(self.api_key, self.network, self.sync_interval_secs, self.max_deposit_claim_fee, self.lnurl_domain, self.prefer_spark_over_lightning)
4693
+ return "Config(api_key={}, network={}, sync_interval_secs={}, max_deposit_claim_fee={}, lnurl_domain={}, prefer_spark_over_lightning={}, external_input_parsers={}, use_default_external_input_parsers={})".format(self.api_key, self.network, self.sync_interval_secs, self.max_deposit_claim_fee, self.lnurl_domain, self.prefer_spark_over_lightning, self.external_input_parsers, self.use_default_external_input_parsers)
4153
4694
 
4154
4695
  def __eq__(self, other):
4155
4696
  if self.api_key != other.api_key:
@@ -4164,6 +4705,10 @@ class Config:
4164
4705
  return False
4165
4706
  if self.prefer_spark_over_lightning != other.prefer_spark_over_lightning:
4166
4707
  return False
4708
+ if self.external_input_parsers != other.external_input_parsers:
4709
+ return False
4710
+ if self.use_default_external_input_parsers != other.use_default_external_input_parsers:
4711
+ return False
4167
4712
  return True
4168
4713
 
4169
4714
  class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
@@ -4176,6 +4721,8 @@ class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
4176
4721
  max_deposit_claim_fee=_UniffiConverterOptionalTypeFee.read(buf),
4177
4722
  lnurl_domain=_UniffiConverterOptionalString.read(buf),
4178
4723
  prefer_spark_over_lightning=_UniffiConverterBool.read(buf),
4724
+ external_input_parsers=_UniffiConverterOptionalSequenceTypeExternalInputParser.read(buf),
4725
+ use_default_external_input_parsers=_UniffiConverterBool.read(buf),
4179
4726
  )
4180
4727
 
4181
4728
  @staticmethod
@@ -4186,6 +4733,8 @@ class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
4186
4733
  _UniffiConverterOptionalTypeFee.check_lower(value.max_deposit_claim_fee)
4187
4734
  _UniffiConverterOptionalString.check_lower(value.lnurl_domain)
4188
4735
  _UniffiConverterBool.check_lower(value.prefer_spark_over_lightning)
4736
+ _UniffiConverterOptionalSequenceTypeExternalInputParser.check_lower(value.external_input_parsers)
4737
+ _UniffiConverterBool.check_lower(value.use_default_external_input_parsers)
4189
4738
 
4190
4739
  @staticmethod
4191
4740
  def write(value, buf):
@@ -4195,6 +4744,8 @@ class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
4195
4744
  _UniffiConverterOptionalTypeFee.write(value.max_deposit_claim_fee, buf)
4196
4745
  _UniffiConverterOptionalString.write(value.lnurl_domain, buf)
4197
4746
  _UniffiConverterBool.write(value.prefer_spark_over_lightning, buf)
4747
+ _UniffiConverterOptionalSequenceTypeExternalInputParser.write(value.external_input_parsers, buf)
4748
+ _UniffiConverterBool.write(value.use_default_external_input_parsers, buf)
4198
4749
 
4199
4750
 
4200
4751
  class ConnectRequest:
@@ -5005,6 +5556,136 @@ class _UniffiConverterTypeLnurlPayResponse(_UniffiConverterRustBuffer):
5005
5556
  _UniffiConverterOptionalTypeSuccessActionProcessed.write(value.success_action, buf)
5006
5557
 
5007
5558
 
5559
+ class LnurlWithdrawInfo:
5560
+ """
5561
+ Represents the withdraw LNURL info
5562
+ """
5563
+
5564
+ withdraw_url: "str"
5565
+ def __init__(self, *, withdraw_url: "str"):
5566
+ self.withdraw_url = withdraw_url
5567
+
5568
+ def __str__(self):
5569
+ return "LnurlWithdrawInfo(withdraw_url={})".format(self.withdraw_url)
5570
+
5571
+ def __eq__(self, other):
5572
+ if self.withdraw_url != other.withdraw_url:
5573
+ return False
5574
+ return True
5575
+
5576
+ class _UniffiConverterTypeLnurlWithdrawInfo(_UniffiConverterRustBuffer):
5577
+ @staticmethod
5578
+ def read(buf):
5579
+ return LnurlWithdrawInfo(
5580
+ withdraw_url=_UniffiConverterString.read(buf),
5581
+ )
5582
+
5583
+ @staticmethod
5584
+ def check_lower(value):
5585
+ _UniffiConverterString.check_lower(value.withdraw_url)
5586
+
5587
+ @staticmethod
5588
+ def write(value, buf):
5589
+ _UniffiConverterString.write(value.withdraw_url, buf)
5590
+
5591
+
5592
+ class LnurlWithdrawRequest:
5593
+ amount_sats: "int"
5594
+ """
5595
+ The amount to withdraw in satoshis
5596
+ Must be within the min and max withdrawable limits
5597
+ """
5598
+
5599
+ withdraw_request: "LnurlWithdrawRequestDetails"
5600
+ completion_timeout_secs: "typing.Optional[int]"
5601
+ """
5602
+ If set, the function will return the payment if it is still pending after this
5603
+ number of seconds. If unset, the function will return immediately after
5604
+ initiating the LNURL withdraw.
5605
+ """
5606
+
5607
+ def __init__(self, *, amount_sats: "int", withdraw_request: "LnurlWithdrawRequestDetails", completion_timeout_secs: "typing.Optional[int]" = _DEFAULT):
5608
+ self.amount_sats = amount_sats
5609
+ self.withdraw_request = withdraw_request
5610
+ if completion_timeout_secs is _DEFAULT:
5611
+ self.completion_timeout_secs = None
5612
+ else:
5613
+ self.completion_timeout_secs = completion_timeout_secs
5614
+
5615
+ def __str__(self):
5616
+ return "LnurlWithdrawRequest(amount_sats={}, withdraw_request={}, completion_timeout_secs={})".format(self.amount_sats, self.withdraw_request, self.completion_timeout_secs)
5617
+
5618
+ def __eq__(self, other):
5619
+ if self.amount_sats != other.amount_sats:
5620
+ return False
5621
+ if self.withdraw_request != other.withdraw_request:
5622
+ return False
5623
+ if self.completion_timeout_secs != other.completion_timeout_secs:
5624
+ return False
5625
+ return True
5626
+
5627
+ class _UniffiConverterTypeLnurlWithdrawRequest(_UniffiConverterRustBuffer):
5628
+ @staticmethod
5629
+ def read(buf):
5630
+ return LnurlWithdrawRequest(
5631
+ amount_sats=_UniffiConverterUInt64.read(buf),
5632
+ withdraw_request=_UniffiConverterTypeLnurlWithdrawRequestDetails.read(buf),
5633
+ completion_timeout_secs=_UniffiConverterOptionalUInt32.read(buf),
5634
+ )
5635
+
5636
+ @staticmethod
5637
+ def check_lower(value):
5638
+ _UniffiConverterUInt64.check_lower(value.amount_sats)
5639
+ _UniffiConverterTypeLnurlWithdrawRequestDetails.check_lower(value.withdraw_request)
5640
+ _UniffiConverterOptionalUInt32.check_lower(value.completion_timeout_secs)
5641
+
5642
+ @staticmethod
5643
+ def write(value, buf):
5644
+ _UniffiConverterUInt64.write(value.amount_sats, buf)
5645
+ _UniffiConverterTypeLnurlWithdrawRequestDetails.write(value.withdraw_request, buf)
5646
+ _UniffiConverterOptionalUInt32.write(value.completion_timeout_secs, buf)
5647
+
5648
+
5649
+ class LnurlWithdrawResponse:
5650
+ payment_request: "str"
5651
+ """
5652
+ The Lightning invoice generated for the LNURL withdraw
5653
+ """
5654
+
5655
+ payment: "typing.Optional[Payment]"
5656
+ def __init__(self, *, payment_request: "str", payment: "typing.Optional[Payment]"):
5657
+ self.payment_request = payment_request
5658
+ self.payment = payment
5659
+
5660
+ def __str__(self):
5661
+ return "LnurlWithdrawResponse(payment_request={}, payment={})".format(self.payment_request, self.payment)
5662
+
5663
+ def __eq__(self, other):
5664
+ if self.payment_request != other.payment_request:
5665
+ return False
5666
+ if self.payment != other.payment:
5667
+ return False
5668
+ return True
5669
+
5670
+ class _UniffiConverterTypeLnurlWithdrawResponse(_UniffiConverterRustBuffer):
5671
+ @staticmethod
5672
+ def read(buf):
5673
+ return LnurlWithdrawResponse(
5674
+ payment_request=_UniffiConverterString.read(buf),
5675
+ payment=_UniffiConverterOptionalTypePayment.read(buf),
5676
+ )
5677
+
5678
+ @staticmethod
5679
+ def check_lower(value):
5680
+ _UniffiConverterString.check_lower(value.payment_request)
5681
+ _UniffiConverterOptionalTypePayment.check_lower(value.payment)
5682
+
5683
+ @staticmethod
5684
+ def write(value, buf):
5685
+ _UniffiConverterString.write(value.payment_request, buf)
5686
+ _UniffiConverterOptionalTypePayment.write(value.payment, buf)
5687
+
5688
+
5008
5689
  class LogEntry:
5009
5690
  line: "str"
5010
5691
  level: "str"
@@ -5063,12 +5744,12 @@ class Payment:
5063
5744
 
5064
5745
  amount: "U128"
5065
5746
  """
5066
- Amount in satoshis
5747
+ Amount in satoshis or token base units
5067
5748
  """
5068
5749
 
5069
5750
  fees: "U128"
5070
5751
  """
5071
- Fee paid in satoshis
5752
+ Fee paid in satoshis or token base units
5072
5753
  """
5073
5754
 
5074
5755
  timestamp: "int"
@@ -5162,17 +5843,21 @@ class PaymentMetadata:
5162
5843
  """
5163
5844
 
5164
5845
  lnurl_pay_info: "typing.Optional[LnurlPayInfo]"
5846
+ lnurl_withdraw_info: "typing.Optional[LnurlWithdrawInfo]"
5165
5847
  lnurl_description: "typing.Optional[str]"
5166
- def __init__(self, *, lnurl_pay_info: "typing.Optional[LnurlPayInfo]", lnurl_description: "typing.Optional[str]"):
5848
+ def __init__(self, *, lnurl_pay_info: "typing.Optional[LnurlPayInfo]", lnurl_withdraw_info: "typing.Optional[LnurlWithdrawInfo]", lnurl_description: "typing.Optional[str]"):
5167
5849
  self.lnurl_pay_info = lnurl_pay_info
5850
+ self.lnurl_withdraw_info = lnurl_withdraw_info
5168
5851
  self.lnurl_description = lnurl_description
5169
5852
 
5170
5853
  def __str__(self):
5171
- return "PaymentMetadata(lnurl_pay_info={}, lnurl_description={})".format(self.lnurl_pay_info, self.lnurl_description)
5854
+ return "PaymentMetadata(lnurl_pay_info={}, lnurl_withdraw_info={}, lnurl_description={})".format(self.lnurl_pay_info, self.lnurl_withdraw_info, self.lnurl_description)
5172
5855
 
5173
5856
  def __eq__(self, other):
5174
5857
  if self.lnurl_pay_info != other.lnurl_pay_info:
5175
5858
  return False
5859
+ if self.lnurl_withdraw_info != other.lnurl_withdraw_info:
5860
+ return False
5176
5861
  if self.lnurl_description != other.lnurl_description:
5177
5862
  return False
5178
5863
  return True
@@ -5182,17 +5867,20 @@ class _UniffiConverterTypePaymentMetadata(_UniffiConverterRustBuffer):
5182
5867
  def read(buf):
5183
5868
  return PaymentMetadata(
5184
5869
  lnurl_pay_info=_UniffiConverterOptionalTypeLnurlPayInfo.read(buf),
5870
+ lnurl_withdraw_info=_UniffiConverterOptionalTypeLnurlWithdrawInfo.read(buf),
5185
5871
  lnurl_description=_UniffiConverterOptionalString.read(buf),
5186
5872
  )
5187
5873
 
5188
5874
  @staticmethod
5189
5875
  def check_lower(value):
5190
5876
  _UniffiConverterOptionalTypeLnurlPayInfo.check_lower(value.lnurl_pay_info)
5877
+ _UniffiConverterOptionalTypeLnurlWithdrawInfo.check_lower(value.lnurl_withdraw_info)
5191
5878
  _UniffiConverterOptionalString.check_lower(value.lnurl_description)
5192
5879
 
5193
5880
  @staticmethod
5194
5881
  def write(value, buf):
5195
5882
  _UniffiConverterOptionalTypeLnurlPayInfo.write(value.lnurl_pay_info, buf)
5883
+ _UniffiConverterOptionalTypeLnurlWithdrawInfo.write(value.lnurl_withdraw_info, buf)
5196
5884
  _UniffiConverterOptionalString.write(value.lnurl_description, buf)
5197
5885
 
5198
5886
 
@@ -5428,6 +6116,61 @@ class _UniffiConverterTypePrepareSendPaymentResponse(_UniffiConverterRustBuffer)
5428
6116
  _UniffiConverterOptionalString.write(value.token_identifier, buf)
5429
6117
 
5430
6118
 
6119
+ class ProvisionalPayment:
6120
+ payment_id: "str"
6121
+ """
6122
+ Unique identifier for the payment
6123
+ """
6124
+
6125
+ amount: "U128"
6126
+ """
6127
+ Amount in satoshis or token base units
6128
+ """
6129
+
6130
+ details: "ProvisionalPaymentDetails"
6131
+ """
6132
+ Details of the payment
6133
+ """
6134
+
6135
+ def __init__(self, *, payment_id: "str", amount: "U128", details: "ProvisionalPaymentDetails"):
6136
+ self.payment_id = payment_id
6137
+ self.amount = amount
6138
+ self.details = details
6139
+
6140
+ def __str__(self):
6141
+ return "ProvisionalPayment(payment_id={}, amount={}, details={})".format(self.payment_id, self.amount, self.details)
6142
+
6143
+ def __eq__(self, other):
6144
+ if self.payment_id != other.payment_id:
6145
+ return False
6146
+ if self.amount != other.amount:
6147
+ return False
6148
+ if self.details != other.details:
6149
+ return False
6150
+ return True
6151
+
6152
+ class _UniffiConverterTypeProvisionalPayment(_UniffiConverterRustBuffer):
6153
+ @staticmethod
6154
+ def read(buf):
6155
+ return ProvisionalPayment(
6156
+ payment_id=_UniffiConverterString.read(buf),
6157
+ amount=_UniffiConverterTypeU128.read(buf),
6158
+ details=_UniffiConverterTypeProvisionalPaymentDetails.read(buf),
6159
+ )
6160
+
6161
+ @staticmethod
6162
+ def check_lower(value):
6163
+ _UniffiConverterString.check_lower(value.payment_id)
6164
+ _UniffiConverterTypeU128.check_lower(value.amount)
6165
+ _UniffiConverterTypeProvisionalPaymentDetails.check_lower(value.details)
6166
+
6167
+ @staticmethod
6168
+ def write(value, buf):
6169
+ _UniffiConverterString.write(value.payment_id, buf)
6170
+ _UniffiConverterTypeU128.write(value.amount, buf)
6171
+ _UniffiConverterTypeProvisionalPaymentDetails.write(value.details, buf)
6172
+
6173
+
5431
6174
  class ReceivePaymentRequest:
5432
6175
  payment_method: "ReceivePaymentMethod"
5433
6176
  def __init__(self, *, payment_method: "ReceivePaymentMethod"):
@@ -5459,18 +6202,23 @@ class _UniffiConverterTypeReceivePaymentRequest(_UniffiConverterRustBuffer):
5459
6202
 
5460
6203
  class ReceivePaymentResponse:
5461
6204
  payment_request: "str"
5462
- fee_sats: "int"
5463
- def __init__(self, *, payment_request: "str", fee_sats: "int"):
6205
+ fee: "U128"
6206
+ """
6207
+ Fee to pay to receive the payment
6208
+ Denominated in sats or token base units
6209
+ """
6210
+
6211
+ def __init__(self, *, payment_request: "str", fee: "U128"):
5464
6212
  self.payment_request = payment_request
5465
- self.fee_sats = fee_sats
6213
+ self.fee = fee
5466
6214
 
5467
6215
  def __str__(self):
5468
- return "ReceivePaymentResponse(payment_request={}, fee_sats={})".format(self.payment_request, self.fee_sats)
6216
+ return "ReceivePaymentResponse(payment_request={}, fee={})".format(self.payment_request, self.fee)
5469
6217
 
5470
6218
  def __eq__(self, other):
5471
6219
  if self.payment_request != other.payment_request:
5472
6220
  return False
5473
- if self.fee_sats != other.fee_sats:
6221
+ if self.fee != other.fee:
5474
6222
  return False
5475
6223
  return True
5476
6224
 
@@ -5479,18 +6227,18 @@ class _UniffiConverterTypeReceivePaymentResponse(_UniffiConverterRustBuffer):
5479
6227
  def read(buf):
5480
6228
  return ReceivePaymentResponse(
5481
6229
  payment_request=_UniffiConverterString.read(buf),
5482
- fee_sats=_UniffiConverterUInt64.read(buf),
6230
+ fee=_UniffiConverterTypeU128.read(buf),
5483
6231
  )
5484
6232
 
5485
6233
  @staticmethod
5486
6234
  def check_lower(value):
5487
6235
  _UniffiConverterString.check_lower(value.payment_request)
5488
- _UniffiConverterUInt64.check_lower(value.fee_sats)
6236
+ _UniffiConverterTypeU128.check_lower(value.fee)
5489
6237
 
5490
6238
  @staticmethod
5491
6239
  def write(value, buf):
5492
6240
  _UniffiConverterString.write(value.payment_request, buf)
5493
- _UniffiConverterUInt64.write(value.fee_sats, buf)
6241
+ _UniffiConverterTypeU128.write(value.fee, buf)
5494
6242
 
5495
6243
 
5496
6244
  class RefundDepositRequest:
@@ -5675,108 +6423,232 @@ class _UniffiConverterTypeSendOnchainFeeQuote(_UniffiConverterRustBuffer):
5675
6423
  _UniffiConverterTypeSendOnchainSpeedFeeQuote.write(value.speed_slow, buf)
5676
6424
 
5677
6425
 
5678
- class SendOnchainSpeedFeeQuote:
5679
- user_fee_sat: "int"
5680
- l1_broadcast_fee_sat: "int"
5681
- def __init__(self, *, user_fee_sat: "int", l1_broadcast_fee_sat: "int"):
5682
- self.user_fee_sat = user_fee_sat
5683
- self.l1_broadcast_fee_sat = l1_broadcast_fee_sat
6426
+ class SendOnchainSpeedFeeQuote:
6427
+ user_fee_sat: "int"
6428
+ l1_broadcast_fee_sat: "int"
6429
+ def __init__(self, *, user_fee_sat: "int", l1_broadcast_fee_sat: "int"):
6430
+ self.user_fee_sat = user_fee_sat
6431
+ self.l1_broadcast_fee_sat = l1_broadcast_fee_sat
6432
+
6433
+ def __str__(self):
6434
+ return "SendOnchainSpeedFeeQuote(user_fee_sat={}, l1_broadcast_fee_sat={})".format(self.user_fee_sat, self.l1_broadcast_fee_sat)
6435
+
6436
+ def __eq__(self, other):
6437
+ if self.user_fee_sat != other.user_fee_sat:
6438
+ return False
6439
+ if self.l1_broadcast_fee_sat != other.l1_broadcast_fee_sat:
6440
+ return False
6441
+ return True
6442
+
6443
+ class _UniffiConverterTypeSendOnchainSpeedFeeQuote(_UniffiConverterRustBuffer):
6444
+ @staticmethod
6445
+ def read(buf):
6446
+ return SendOnchainSpeedFeeQuote(
6447
+ user_fee_sat=_UniffiConverterUInt64.read(buf),
6448
+ l1_broadcast_fee_sat=_UniffiConverterUInt64.read(buf),
6449
+ )
6450
+
6451
+ @staticmethod
6452
+ def check_lower(value):
6453
+ _UniffiConverterUInt64.check_lower(value.user_fee_sat)
6454
+ _UniffiConverterUInt64.check_lower(value.l1_broadcast_fee_sat)
6455
+
6456
+ @staticmethod
6457
+ def write(value, buf):
6458
+ _UniffiConverterUInt64.write(value.user_fee_sat, buf)
6459
+ _UniffiConverterUInt64.write(value.l1_broadcast_fee_sat, buf)
6460
+
6461
+
6462
+ class SendPaymentRequest:
6463
+ prepare_response: "PrepareSendPaymentResponse"
6464
+ options: "typing.Optional[SendPaymentOptions]"
6465
+ def __init__(self, *, prepare_response: "PrepareSendPaymentResponse", options: "typing.Optional[SendPaymentOptions]" = _DEFAULT):
6466
+ self.prepare_response = prepare_response
6467
+ if options is _DEFAULT:
6468
+ self.options = None
6469
+ else:
6470
+ self.options = options
6471
+
6472
+ def __str__(self):
6473
+ return "SendPaymentRequest(prepare_response={}, options={})".format(self.prepare_response, self.options)
6474
+
6475
+ def __eq__(self, other):
6476
+ if self.prepare_response != other.prepare_response:
6477
+ return False
6478
+ if self.options != other.options:
6479
+ return False
6480
+ return True
6481
+
6482
+ class _UniffiConverterTypeSendPaymentRequest(_UniffiConverterRustBuffer):
6483
+ @staticmethod
6484
+ def read(buf):
6485
+ return SendPaymentRequest(
6486
+ prepare_response=_UniffiConverterTypePrepareSendPaymentResponse.read(buf),
6487
+ options=_UniffiConverterOptionalTypeSendPaymentOptions.read(buf),
6488
+ )
6489
+
6490
+ @staticmethod
6491
+ def check_lower(value):
6492
+ _UniffiConverterTypePrepareSendPaymentResponse.check_lower(value.prepare_response)
6493
+ _UniffiConverterOptionalTypeSendPaymentOptions.check_lower(value.options)
6494
+
6495
+ @staticmethod
6496
+ def write(value, buf):
6497
+ _UniffiConverterTypePrepareSendPaymentResponse.write(value.prepare_response, buf)
6498
+ _UniffiConverterOptionalTypeSendPaymentOptions.write(value.options, buf)
6499
+
6500
+
6501
+ class SendPaymentResponse:
6502
+ payment: "Payment"
6503
+ def __init__(self, *, payment: "Payment"):
6504
+ self.payment = payment
6505
+
6506
+ def __str__(self):
6507
+ return "SendPaymentResponse(payment={})".format(self.payment)
6508
+
6509
+ def __eq__(self, other):
6510
+ if self.payment != other.payment:
6511
+ return False
6512
+ return True
6513
+
6514
+ class _UniffiConverterTypeSendPaymentResponse(_UniffiConverterRustBuffer):
6515
+ @staticmethod
6516
+ def read(buf):
6517
+ return SendPaymentResponse(
6518
+ payment=_UniffiConverterTypePayment.read(buf),
6519
+ )
6520
+
6521
+ @staticmethod
6522
+ def check_lower(value):
6523
+ _UniffiConverterTypePayment.check_lower(value.payment)
6524
+
6525
+ @staticmethod
6526
+ def write(value, buf):
6527
+ _UniffiConverterTypePayment.write(value.payment, buf)
6528
+
6529
+
6530
+ class SignMessageRequest:
6531
+ message: "str"
6532
+ compact: "bool"
6533
+ """
6534
+ If true, the signature will be encoded in compact format instead of DER format
6535
+ """
6536
+
6537
+ def __init__(self, *, message: "str", compact: "bool"):
6538
+ self.message = message
6539
+ self.compact = compact
5684
6540
 
5685
6541
  def __str__(self):
5686
- return "SendOnchainSpeedFeeQuote(user_fee_sat={}, l1_broadcast_fee_sat={})".format(self.user_fee_sat, self.l1_broadcast_fee_sat)
6542
+ return "SignMessageRequest(message={}, compact={})".format(self.message, self.compact)
5687
6543
 
5688
6544
  def __eq__(self, other):
5689
- if self.user_fee_sat != other.user_fee_sat:
6545
+ if self.message != other.message:
5690
6546
  return False
5691
- if self.l1_broadcast_fee_sat != other.l1_broadcast_fee_sat:
6547
+ if self.compact != other.compact:
5692
6548
  return False
5693
6549
  return True
5694
6550
 
5695
- class _UniffiConverterTypeSendOnchainSpeedFeeQuote(_UniffiConverterRustBuffer):
6551
+ class _UniffiConverterTypeSignMessageRequest(_UniffiConverterRustBuffer):
5696
6552
  @staticmethod
5697
6553
  def read(buf):
5698
- return SendOnchainSpeedFeeQuote(
5699
- user_fee_sat=_UniffiConverterUInt64.read(buf),
5700
- l1_broadcast_fee_sat=_UniffiConverterUInt64.read(buf),
6554
+ return SignMessageRequest(
6555
+ message=_UniffiConverterString.read(buf),
6556
+ compact=_UniffiConverterBool.read(buf),
5701
6557
  )
5702
6558
 
5703
6559
  @staticmethod
5704
6560
  def check_lower(value):
5705
- _UniffiConverterUInt64.check_lower(value.user_fee_sat)
5706
- _UniffiConverterUInt64.check_lower(value.l1_broadcast_fee_sat)
6561
+ _UniffiConverterString.check_lower(value.message)
6562
+ _UniffiConverterBool.check_lower(value.compact)
5707
6563
 
5708
6564
  @staticmethod
5709
6565
  def write(value, buf):
5710
- _UniffiConverterUInt64.write(value.user_fee_sat, buf)
5711
- _UniffiConverterUInt64.write(value.l1_broadcast_fee_sat, buf)
6566
+ _UniffiConverterString.write(value.message, buf)
6567
+ _UniffiConverterBool.write(value.compact, buf)
5712
6568
 
5713
6569
 
5714
- class SendPaymentRequest:
5715
- prepare_response: "PrepareSendPaymentResponse"
5716
- options: "typing.Optional[SendPaymentOptions]"
5717
- def __init__(self, *, prepare_response: "PrepareSendPaymentResponse", options: "typing.Optional[SendPaymentOptions]" = _DEFAULT):
5718
- self.prepare_response = prepare_response
5719
- if options is _DEFAULT:
5720
- self.options = None
5721
- else:
5722
- self.options = options
6570
+ class SignMessageResponse:
6571
+ pubkey: "str"
6572
+ signature: "str"
6573
+ """
6574
+ The DER or compact hex encoded signature
6575
+ """
6576
+
6577
+ def __init__(self, *, pubkey: "str", signature: "str"):
6578
+ self.pubkey = pubkey
6579
+ self.signature = signature
5723
6580
 
5724
6581
  def __str__(self):
5725
- return "SendPaymentRequest(prepare_response={}, options={})".format(self.prepare_response, self.options)
6582
+ return "SignMessageResponse(pubkey={}, signature={})".format(self.pubkey, self.signature)
5726
6583
 
5727
6584
  def __eq__(self, other):
5728
- if self.prepare_response != other.prepare_response:
6585
+ if self.pubkey != other.pubkey:
5729
6586
  return False
5730
- if self.options != other.options:
6587
+ if self.signature != other.signature:
5731
6588
  return False
5732
6589
  return True
5733
6590
 
5734
- class _UniffiConverterTypeSendPaymentRequest(_UniffiConverterRustBuffer):
6591
+ class _UniffiConverterTypeSignMessageResponse(_UniffiConverterRustBuffer):
5735
6592
  @staticmethod
5736
6593
  def read(buf):
5737
- return SendPaymentRequest(
5738
- prepare_response=_UniffiConverterTypePrepareSendPaymentResponse.read(buf),
5739
- options=_UniffiConverterOptionalTypeSendPaymentOptions.read(buf),
6594
+ return SignMessageResponse(
6595
+ pubkey=_UniffiConverterString.read(buf),
6596
+ signature=_UniffiConverterString.read(buf),
5740
6597
  )
5741
6598
 
5742
6599
  @staticmethod
5743
6600
  def check_lower(value):
5744
- _UniffiConverterTypePrepareSendPaymentResponse.check_lower(value.prepare_response)
5745
- _UniffiConverterOptionalTypeSendPaymentOptions.check_lower(value.options)
6601
+ _UniffiConverterString.check_lower(value.pubkey)
6602
+ _UniffiConverterString.check_lower(value.signature)
5746
6603
 
5747
6604
  @staticmethod
5748
6605
  def write(value, buf):
5749
- _UniffiConverterTypePrepareSendPaymentResponse.write(value.prepare_response, buf)
5750
- _UniffiConverterOptionalTypeSendPaymentOptions.write(value.options, buf)
6606
+ _UniffiConverterString.write(value.pubkey, buf)
6607
+ _UniffiConverterString.write(value.signature, buf)
5751
6608
 
5752
6609
 
5753
- class SendPaymentResponse:
5754
- payment: "Payment"
5755
- def __init__(self, *, payment: "Payment"):
5756
- self.payment = payment
6610
+ class SparkInvoicePaymentDetails:
6611
+ description: "typing.Optional[str]"
6612
+ """
6613
+ Represents the spark invoice description
6614
+ """
6615
+
6616
+ invoice: "str"
6617
+ """
6618
+ The raw spark invoice string
6619
+ """
6620
+
6621
+ def __init__(self, *, description: "typing.Optional[str]", invoice: "str"):
6622
+ self.description = description
6623
+ self.invoice = invoice
5757
6624
 
5758
6625
  def __str__(self):
5759
- return "SendPaymentResponse(payment={})".format(self.payment)
6626
+ return "SparkInvoicePaymentDetails(description={}, invoice={})".format(self.description, self.invoice)
5760
6627
 
5761
6628
  def __eq__(self, other):
5762
- if self.payment != other.payment:
6629
+ if self.description != other.description:
6630
+ return False
6631
+ if self.invoice != other.invoice:
5763
6632
  return False
5764
6633
  return True
5765
6634
 
5766
- class _UniffiConverterTypeSendPaymentResponse(_UniffiConverterRustBuffer):
6635
+ class _UniffiConverterTypeSparkInvoicePaymentDetails(_UniffiConverterRustBuffer):
5767
6636
  @staticmethod
5768
6637
  def read(buf):
5769
- return SendPaymentResponse(
5770
- payment=_UniffiConverterTypePayment.read(buf),
6638
+ return SparkInvoicePaymentDetails(
6639
+ description=_UniffiConverterOptionalString.read(buf),
6640
+ invoice=_UniffiConverterString.read(buf),
5771
6641
  )
5772
6642
 
5773
6643
  @staticmethod
5774
6644
  def check_lower(value):
5775
- _UniffiConverterTypePayment.check_lower(value.payment)
6645
+ _UniffiConverterOptionalString.check_lower(value.description)
6646
+ _UniffiConverterString.check_lower(value.invoice)
5776
6647
 
5777
6648
  @staticmethod
5778
6649
  def write(value, buf):
5779
- _UniffiConverterTypePayment.write(value.payment, buf)
6650
+ _UniffiConverterOptionalString.write(value.description, buf)
6651
+ _UniffiConverterString.write(value.invoice, buf)
5780
6652
 
5781
6653
 
5782
6654
  class SyncWalletRequest:
@@ -6703,28 +7575,41 @@ class PaymentDetails:
6703
7575
 
6704
7576
  # Each enum variant is a nested class of the enum itself.
6705
7577
  class SPARK:
7578
+ invoice_details: "typing.Optional[SparkInvoicePaymentDetails]"
7579
+ """
7580
+ The invoice details if the payment fulfilled a spark invoice
7581
+ """
6706
7582
 
6707
- def __init__(self,):
6708
- pass
7583
+
7584
+ def __init__(self,invoice_details: "typing.Optional[SparkInvoicePaymentDetails]"):
7585
+ self.invoice_details = invoice_details
6709
7586
 
6710
7587
  def __str__(self):
6711
- return "PaymentDetails.SPARK()".format()
7588
+ return "PaymentDetails.SPARK(invoice_details={})".format(self.invoice_details)
6712
7589
 
6713
7590
  def __eq__(self, other):
6714
7591
  if not other.is_spark():
6715
7592
  return False
7593
+ if self.invoice_details != other.invoice_details:
7594
+ return False
6716
7595
  return True
6717
7596
 
6718
7597
  class TOKEN:
6719
7598
  metadata: "TokenMetadata"
6720
7599
  tx_hash: "str"
7600
+ invoice_details: "typing.Optional[SparkInvoicePaymentDetails]"
7601
+ """
7602
+ The invoice details if the payment fulfilled a spark invoice
7603
+ """
6721
7604
 
6722
- def __init__(self,metadata: "TokenMetadata", tx_hash: "str"):
7605
+
7606
+ def __init__(self,metadata: "TokenMetadata", tx_hash: "str", invoice_details: "typing.Optional[SparkInvoicePaymentDetails]"):
6723
7607
  self.metadata = metadata
6724
7608
  self.tx_hash = tx_hash
7609
+ self.invoice_details = invoice_details
6725
7610
 
6726
7611
  def __str__(self):
6727
- return "PaymentDetails.TOKEN(metadata={}, tx_hash={})".format(self.metadata, self.tx_hash)
7612
+ return "PaymentDetails.TOKEN(metadata={}, tx_hash={}, invoice_details={})".format(self.metadata, self.tx_hash, self.invoice_details)
6728
7613
 
6729
7614
  def __eq__(self, other):
6730
7615
  if not other.is_token():
@@ -6733,6 +7618,8 @@ class PaymentDetails:
6733
7618
  return False
6734
7619
  if self.tx_hash != other.tx_hash:
6735
7620
  return False
7621
+ if self.invoice_details != other.invoice_details:
7622
+ return False
6736
7623
  return True
6737
7624
 
6738
7625
  class LIGHTNING:
@@ -6768,17 +7655,23 @@ class PaymentDetails:
6768
7655
  Lnurl payment information if this was an lnurl payment.
6769
7656
  """
6770
7657
 
7658
+ lnurl_withdraw_info: "typing.Optional[LnurlWithdrawInfo]"
7659
+ """
7660
+ Lnurl withdrawal information if this was an lnurl payment.
7661
+ """
7662
+
6771
7663
 
6772
- def __init__(self,description: "typing.Optional[str]", preimage: "typing.Optional[str]", invoice: "str", payment_hash: "str", destination_pubkey: "str", lnurl_pay_info: "typing.Optional[LnurlPayInfo]"):
7664
+ def __init__(self,description: "typing.Optional[str]", preimage: "typing.Optional[str]", invoice: "str", payment_hash: "str", destination_pubkey: "str", lnurl_pay_info: "typing.Optional[LnurlPayInfo]", lnurl_withdraw_info: "typing.Optional[LnurlWithdrawInfo]"):
6773
7665
  self.description = description
6774
7666
  self.preimage = preimage
6775
7667
  self.invoice = invoice
6776
7668
  self.payment_hash = payment_hash
6777
7669
  self.destination_pubkey = destination_pubkey
6778
7670
  self.lnurl_pay_info = lnurl_pay_info
7671
+ self.lnurl_withdraw_info = lnurl_withdraw_info
6779
7672
 
6780
7673
  def __str__(self):
6781
- return "PaymentDetails.LIGHTNING(description={}, preimage={}, invoice={}, payment_hash={}, destination_pubkey={}, lnurl_pay_info={})".format(self.description, self.preimage, self.invoice, self.payment_hash, self.destination_pubkey, self.lnurl_pay_info)
7674
+ return "PaymentDetails.LIGHTNING(description={}, preimage={}, invoice={}, payment_hash={}, destination_pubkey={}, lnurl_pay_info={}, lnurl_withdraw_info={})".format(self.description, self.preimage, self.invoice, self.payment_hash, self.destination_pubkey, self.lnurl_pay_info, self.lnurl_withdraw_info)
6782
7675
 
6783
7676
  def __eq__(self, other):
6784
7677
  if not other.is_lightning():
@@ -6795,6 +7688,8 @@ class PaymentDetails:
6795
7688
  return False
6796
7689
  if self.lnurl_pay_info != other.lnurl_pay_info:
6797
7690
  return False
7691
+ if self.lnurl_withdraw_info != other.lnurl_withdraw_info:
7692
+ return False
6798
7693
  return True
6799
7694
 
6800
7695
  class WITHDRAW:
@@ -6863,11 +7758,13 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6863
7758
  variant = buf.read_i32()
6864
7759
  if variant == 1:
6865
7760
  return PaymentDetails.SPARK(
7761
+ _UniffiConverterOptionalTypeSparkInvoicePaymentDetails.read(buf),
6866
7762
  )
6867
7763
  if variant == 2:
6868
7764
  return PaymentDetails.TOKEN(
6869
7765
  _UniffiConverterTypeTokenMetadata.read(buf),
6870
7766
  _UniffiConverterString.read(buf),
7767
+ _UniffiConverterOptionalTypeSparkInvoicePaymentDetails.read(buf),
6871
7768
  )
6872
7769
  if variant == 3:
6873
7770
  return PaymentDetails.LIGHTNING(
@@ -6877,6 +7774,7 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6877
7774
  _UniffiConverterString.read(buf),
6878
7775
  _UniffiConverterString.read(buf),
6879
7776
  _UniffiConverterOptionalTypeLnurlPayInfo.read(buf),
7777
+ _UniffiConverterOptionalTypeLnurlWithdrawInfo.read(buf),
6880
7778
  )
6881
7779
  if variant == 4:
6882
7780
  return PaymentDetails.WITHDRAW(
@@ -6891,10 +7789,12 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6891
7789
  @staticmethod
6892
7790
  def check_lower(value):
6893
7791
  if value.is_spark():
7792
+ _UniffiConverterOptionalTypeSparkInvoicePaymentDetails.check_lower(value.invoice_details)
6894
7793
  return
6895
7794
  if value.is_token():
6896
7795
  _UniffiConverterTypeTokenMetadata.check_lower(value.metadata)
6897
7796
  _UniffiConverterString.check_lower(value.tx_hash)
7797
+ _UniffiConverterOptionalTypeSparkInvoicePaymentDetails.check_lower(value.invoice_details)
6898
7798
  return
6899
7799
  if value.is_lightning():
6900
7800
  _UniffiConverterOptionalString.check_lower(value.description)
@@ -6903,6 +7803,7 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6903
7803
  _UniffiConverterString.check_lower(value.payment_hash)
6904
7804
  _UniffiConverterString.check_lower(value.destination_pubkey)
6905
7805
  _UniffiConverterOptionalTypeLnurlPayInfo.check_lower(value.lnurl_pay_info)
7806
+ _UniffiConverterOptionalTypeLnurlWithdrawInfo.check_lower(value.lnurl_withdraw_info)
6906
7807
  return
6907
7808
  if value.is_withdraw():
6908
7809
  _UniffiConverterString.check_lower(value.tx_id)
@@ -6916,10 +7817,12 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6916
7817
  def write(value, buf):
6917
7818
  if value.is_spark():
6918
7819
  buf.write_i32(1)
7820
+ _UniffiConverterOptionalTypeSparkInvoicePaymentDetails.write(value.invoice_details, buf)
6919
7821
  if value.is_token():
6920
7822
  buf.write_i32(2)
6921
7823
  _UniffiConverterTypeTokenMetadata.write(value.metadata, buf)
6922
7824
  _UniffiConverterString.write(value.tx_hash, buf)
7825
+ _UniffiConverterOptionalTypeSparkInvoicePaymentDetails.write(value.invoice_details, buf)
6923
7826
  if value.is_lightning():
6924
7827
  buf.write_i32(3)
6925
7828
  _UniffiConverterOptionalString.write(value.description, buf)
@@ -6928,6 +7831,7 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6928
7831
  _UniffiConverterString.write(value.payment_hash, buf)
6929
7832
  _UniffiConverterString.write(value.destination_pubkey, buf)
6930
7833
  _UniffiConverterOptionalTypeLnurlPayInfo.write(value.lnurl_pay_info, buf)
7834
+ _UniffiConverterOptionalTypeLnurlWithdrawInfo.write(value.lnurl_withdraw_info, buf)
6931
7835
  if value.is_withdraw():
6932
7836
  buf.write_i32(4)
6933
7837
  _UniffiConverterString.write(value.tx_id, buf)
@@ -7008,6 +7912,86 @@ class _UniffiConverterTypePaymentMethod(_UniffiConverterRustBuffer):
7008
7912
 
7009
7913
 
7010
7914
 
7915
+ # PaymentObserverError
7916
+ # We want to define each variant as a nested class that's also a subclass,
7917
+ # which is tricky in Python. To accomplish this we're going to create each
7918
+ # class separately, then manually add the child classes to the base class's
7919
+ # __dict__. All of this happens in dummy class to avoid polluting the module
7920
+ # namespace.
7921
+ class PaymentObserverError(Exception):
7922
+ pass
7923
+
7924
+ _UniffiTempPaymentObserverError = PaymentObserverError
7925
+
7926
+ class PaymentObserverError: # type: ignore
7927
+ class ServiceConnectivity(_UniffiTempPaymentObserverError):
7928
+ def __init__(self, *values):
7929
+ if len(values) != 1:
7930
+ raise TypeError(f"Expected 1 arguments, found {len(values)}")
7931
+ if not isinstance(values[0], str):
7932
+ raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
7933
+ super().__init__(", ".join(map(repr, values)))
7934
+ self._values = values
7935
+
7936
+ def __getitem__(self, index):
7937
+ return self._values[index]
7938
+
7939
+ def __repr__(self):
7940
+ return "PaymentObserverError.ServiceConnectivity({})".format(str(self))
7941
+ _UniffiTempPaymentObserverError.ServiceConnectivity = ServiceConnectivity # type: ignore
7942
+ class Generic(_UniffiTempPaymentObserverError):
7943
+ def __init__(self, *values):
7944
+ if len(values) != 1:
7945
+ raise TypeError(f"Expected 1 arguments, found {len(values)}")
7946
+ if not isinstance(values[0], str):
7947
+ raise TypeError(f"unexpected type for tuple element 0 - expected 'str', got '{type(values[0])}'")
7948
+ super().__init__(", ".join(map(repr, values)))
7949
+ self._values = values
7950
+
7951
+ def __getitem__(self, index):
7952
+ return self._values[index]
7953
+
7954
+ def __repr__(self):
7955
+ return "PaymentObserverError.Generic({})".format(str(self))
7956
+ _UniffiTempPaymentObserverError.Generic = Generic # type: ignore
7957
+
7958
+ PaymentObserverError = _UniffiTempPaymentObserverError # type: ignore
7959
+ del _UniffiTempPaymentObserverError
7960
+
7961
+
7962
+ class _UniffiConverterTypePaymentObserverError(_UniffiConverterRustBuffer):
7963
+ @staticmethod
7964
+ def read(buf):
7965
+ variant = buf.read_i32()
7966
+ if variant == 1:
7967
+ return PaymentObserverError.ServiceConnectivity(
7968
+ _UniffiConverterString.read(buf),
7969
+ )
7970
+ if variant == 2:
7971
+ return PaymentObserverError.Generic(
7972
+ _UniffiConverterString.read(buf),
7973
+ )
7974
+ raise InternalError("Raw enum value doesn't match any cases")
7975
+
7976
+ @staticmethod
7977
+ def check_lower(value):
7978
+ if isinstance(value, PaymentObserverError.ServiceConnectivity):
7979
+ _UniffiConverterString.check_lower(value._values[0])
7980
+ return
7981
+ if isinstance(value, PaymentObserverError.Generic):
7982
+ _UniffiConverterString.check_lower(value._values[0])
7983
+ return
7984
+
7985
+ @staticmethod
7986
+ def write(value, buf):
7987
+ if isinstance(value, PaymentObserverError.ServiceConnectivity):
7988
+ buf.write_i32(1)
7989
+ _UniffiConverterString.write(value._values[0], buf)
7990
+ if isinstance(value, PaymentObserverError.Generic):
7991
+ buf.write_i32(2)
7992
+ _UniffiConverterString.write(value._values[0], buf)
7993
+
7994
+
7011
7995
 
7012
7996
 
7013
7997
 
@@ -7097,25 +8081,205 @@ class _UniffiConverterTypePaymentType(_UniffiConverterRustBuffer):
7097
8081
  def read(buf):
7098
8082
  variant = buf.read_i32()
7099
8083
  if variant == 1:
7100
- return PaymentType.SEND
8084
+ return PaymentType.SEND
8085
+ if variant == 2:
8086
+ return PaymentType.RECEIVE
8087
+ raise InternalError("Raw enum value doesn't match any cases")
8088
+
8089
+ @staticmethod
8090
+ def check_lower(value):
8091
+ if value == PaymentType.SEND:
8092
+ return
8093
+ if value == PaymentType.RECEIVE:
8094
+ return
8095
+ raise ValueError(value)
8096
+
8097
+ @staticmethod
8098
+ def write(value, buf):
8099
+ if value == PaymentType.SEND:
8100
+ buf.write_i32(1)
8101
+ if value == PaymentType.RECEIVE:
8102
+ buf.write_i32(2)
8103
+
8104
+
8105
+
8106
+
8107
+
8108
+
8109
+
8110
+ class ProvisionalPaymentDetails:
8111
+ def __init__(self):
8112
+ raise RuntimeError("ProvisionalPaymentDetails cannot be instantiated directly")
8113
+
8114
+ # Each enum variant is a nested class of the enum itself.
8115
+ class BITCOIN:
8116
+ withdrawal_address: "str"
8117
+ """
8118
+ Onchain Bitcoin address
8119
+ """
8120
+
8121
+
8122
+ def __init__(self,withdrawal_address: "str"):
8123
+ self.withdrawal_address = withdrawal_address
8124
+
8125
+ def __str__(self):
8126
+ return "ProvisionalPaymentDetails.BITCOIN(withdrawal_address={})".format(self.withdrawal_address)
8127
+
8128
+ def __eq__(self, other):
8129
+ if not other.is_bitcoin():
8130
+ return False
8131
+ if self.withdrawal_address != other.withdrawal_address:
8132
+ return False
8133
+ return True
8134
+
8135
+ class LIGHTNING:
8136
+ invoice: "str"
8137
+ """
8138
+ BOLT11 invoice
8139
+ """
8140
+
8141
+
8142
+ def __init__(self,invoice: "str"):
8143
+ self.invoice = invoice
8144
+
8145
+ def __str__(self):
8146
+ return "ProvisionalPaymentDetails.LIGHTNING(invoice={})".format(self.invoice)
8147
+
8148
+ def __eq__(self, other):
8149
+ if not other.is_lightning():
8150
+ return False
8151
+ if self.invoice != other.invoice:
8152
+ return False
8153
+ return True
8154
+
8155
+ class SPARK:
8156
+ pay_request: "str"
8157
+ """
8158
+ Spark pay request being paid (either a Spark address or a Spark invoice)
8159
+ """
8160
+
8161
+
8162
+ def __init__(self,pay_request: "str"):
8163
+ self.pay_request = pay_request
8164
+
8165
+ def __str__(self):
8166
+ return "ProvisionalPaymentDetails.SPARK(pay_request={})".format(self.pay_request)
8167
+
8168
+ def __eq__(self, other):
8169
+ if not other.is_spark():
8170
+ return False
8171
+ if self.pay_request != other.pay_request:
8172
+ return False
8173
+ return True
8174
+
8175
+ class TOKEN:
8176
+ token_id: "str"
8177
+ """
8178
+ Token identifier
8179
+ """
8180
+
8181
+ pay_request: "str"
8182
+ """
8183
+ Spark pay request being paid (either a Spark address or a Spark invoice)
8184
+ """
8185
+
8186
+
8187
+ def __init__(self,token_id: "str", pay_request: "str"):
8188
+ self.token_id = token_id
8189
+ self.pay_request = pay_request
8190
+
8191
+ def __str__(self):
8192
+ return "ProvisionalPaymentDetails.TOKEN(token_id={}, pay_request={})".format(self.token_id, self.pay_request)
8193
+
8194
+ def __eq__(self, other):
8195
+ if not other.is_token():
8196
+ return False
8197
+ if self.token_id != other.token_id:
8198
+ return False
8199
+ if self.pay_request != other.pay_request:
8200
+ return False
8201
+ return True
8202
+
8203
+
8204
+
8205
+ # For each variant, we have an `is_NAME` method for easily checking
8206
+ # whether an instance is that variant.
8207
+ def is_bitcoin(self) -> bool:
8208
+ return isinstance(self, ProvisionalPaymentDetails.BITCOIN)
8209
+ def is_lightning(self) -> bool:
8210
+ return isinstance(self, ProvisionalPaymentDetails.LIGHTNING)
8211
+ def is_spark(self) -> bool:
8212
+ return isinstance(self, ProvisionalPaymentDetails.SPARK)
8213
+ def is_token(self) -> bool:
8214
+ return isinstance(self, ProvisionalPaymentDetails.TOKEN)
8215
+
8216
+
8217
+ # Now, a little trick - we make each nested variant class be a subclass of the main
8218
+ # enum class, so that method calls and instance checks etc will work intuitively.
8219
+ # We might be able to do this a little more neatly with a metaclass, but this'll do.
8220
+ ProvisionalPaymentDetails.BITCOIN = type("ProvisionalPaymentDetails.BITCOIN", (ProvisionalPaymentDetails.BITCOIN, ProvisionalPaymentDetails,), {}) # type: ignore
8221
+ ProvisionalPaymentDetails.LIGHTNING = type("ProvisionalPaymentDetails.LIGHTNING", (ProvisionalPaymentDetails.LIGHTNING, ProvisionalPaymentDetails,), {}) # type: ignore
8222
+ ProvisionalPaymentDetails.SPARK = type("ProvisionalPaymentDetails.SPARK", (ProvisionalPaymentDetails.SPARK, ProvisionalPaymentDetails,), {}) # type: ignore
8223
+ ProvisionalPaymentDetails.TOKEN = type("ProvisionalPaymentDetails.TOKEN", (ProvisionalPaymentDetails.TOKEN, ProvisionalPaymentDetails,), {}) # type: ignore
8224
+
8225
+
8226
+
8227
+
8228
+ class _UniffiConverterTypeProvisionalPaymentDetails(_UniffiConverterRustBuffer):
8229
+ @staticmethod
8230
+ def read(buf):
8231
+ variant = buf.read_i32()
8232
+ if variant == 1:
8233
+ return ProvisionalPaymentDetails.BITCOIN(
8234
+ _UniffiConverterString.read(buf),
8235
+ )
7101
8236
  if variant == 2:
7102
- return PaymentType.RECEIVE
8237
+ return ProvisionalPaymentDetails.LIGHTNING(
8238
+ _UniffiConverterString.read(buf),
8239
+ )
8240
+ if variant == 3:
8241
+ return ProvisionalPaymentDetails.SPARK(
8242
+ _UniffiConverterString.read(buf),
8243
+ )
8244
+ if variant == 4:
8245
+ return ProvisionalPaymentDetails.TOKEN(
8246
+ _UniffiConverterString.read(buf),
8247
+ _UniffiConverterString.read(buf),
8248
+ )
7103
8249
  raise InternalError("Raw enum value doesn't match any cases")
7104
8250
 
7105
8251
  @staticmethod
7106
8252
  def check_lower(value):
7107
- if value == PaymentType.SEND:
8253
+ if value.is_bitcoin():
8254
+ _UniffiConverterString.check_lower(value.withdrawal_address)
7108
8255
  return
7109
- if value == PaymentType.RECEIVE:
8256
+ if value.is_lightning():
8257
+ _UniffiConverterString.check_lower(value.invoice)
8258
+ return
8259
+ if value.is_spark():
8260
+ _UniffiConverterString.check_lower(value.pay_request)
8261
+ return
8262
+ if value.is_token():
8263
+ _UniffiConverterString.check_lower(value.token_id)
8264
+ _UniffiConverterString.check_lower(value.pay_request)
7110
8265
  return
7111
8266
  raise ValueError(value)
7112
8267
 
7113
8268
  @staticmethod
7114
8269
  def write(value, buf):
7115
- if value == PaymentType.SEND:
8270
+ if value.is_bitcoin():
7116
8271
  buf.write_i32(1)
7117
- if value == PaymentType.RECEIVE:
8272
+ _UniffiConverterString.write(value.withdrawal_address, buf)
8273
+ if value.is_lightning():
7118
8274
  buf.write_i32(2)
8275
+ _UniffiConverterString.write(value.invoice, buf)
8276
+ if value.is_spark():
8277
+ buf.write_i32(3)
8278
+ _UniffiConverterString.write(value.pay_request, buf)
8279
+ if value.is_token():
8280
+ buf.write_i32(4)
8281
+ _UniffiConverterString.write(value.token_id, buf)
8282
+ _UniffiConverterString.write(value.pay_request, buf)
7119
8283
 
7120
8284
 
7121
8285
 
@@ -7141,6 +8305,59 @@ class ReceivePaymentMethod:
7141
8305
  return False
7142
8306
  return True
7143
8307
 
8308
+ class SPARK_INVOICE:
8309
+ amount: "typing.Optional[U128]"
8310
+ """
8311
+ Amount to receive. Denominated in sats if token identifier is empty, otherwise in the token base units
8312
+ """
8313
+
8314
+ token_identifier: "typing.Optional[str]"
8315
+ """
8316
+ The presence of this field indicates that the payment is for a token
8317
+ If empty, it is a Bitcoin payment
8318
+ """
8319
+
8320
+ expiry_time: "typing.Optional[int]"
8321
+ """
8322
+ The expiry time of the invoice in seconds since the Unix epoch
8323
+ """
8324
+
8325
+ description: "typing.Optional[str]"
8326
+ """
8327
+ A description to embed in the invoice.
8328
+ """
8329
+
8330
+ sender_public_key: "typing.Optional[str]"
8331
+ """
8332
+ If set, the invoice may only be fulfilled by a payer with this public key
8333
+ """
8334
+
8335
+
8336
+ def __init__(self,amount: "typing.Optional[U128]", token_identifier: "typing.Optional[str]", expiry_time: "typing.Optional[int]", description: "typing.Optional[str]", sender_public_key: "typing.Optional[str]"):
8337
+ self.amount = amount
8338
+ self.token_identifier = token_identifier
8339
+ self.expiry_time = expiry_time
8340
+ self.description = description
8341
+ self.sender_public_key = sender_public_key
8342
+
8343
+ def __str__(self):
8344
+ return "ReceivePaymentMethod.SPARK_INVOICE(amount={}, token_identifier={}, expiry_time={}, description={}, sender_public_key={})".format(self.amount, self.token_identifier, self.expiry_time, self.description, self.sender_public_key)
8345
+
8346
+ def __eq__(self, other):
8347
+ if not other.is_spark_invoice():
8348
+ return False
8349
+ if self.amount != other.amount:
8350
+ return False
8351
+ if self.token_identifier != other.token_identifier:
8352
+ return False
8353
+ if self.expiry_time != other.expiry_time:
8354
+ return False
8355
+ if self.description != other.description:
8356
+ return False
8357
+ if self.sender_public_key != other.sender_public_key:
8358
+ return False
8359
+ return True
8360
+
7144
8361
  class BITCOIN_ADDRESS:
7145
8362
 
7146
8363
  def __init__(self,):
@@ -7180,6 +8397,8 @@ class ReceivePaymentMethod:
7180
8397
  # whether an instance is that variant.
7181
8398
  def is_spark_address(self) -> bool:
7182
8399
  return isinstance(self, ReceivePaymentMethod.SPARK_ADDRESS)
8400
+ def is_spark_invoice(self) -> bool:
8401
+ return isinstance(self, ReceivePaymentMethod.SPARK_INVOICE)
7183
8402
  def is_bitcoin_address(self) -> bool:
7184
8403
  return isinstance(self, ReceivePaymentMethod.BITCOIN_ADDRESS)
7185
8404
  def is_bolt11_invoice(self) -> bool:
@@ -7190,6 +8409,7 @@ class ReceivePaymentMethod:
7190
8409
  # enum class, so that method calls and instance checks etc will work intuitively.
7191
8410
  # We might be able to do this a little more neatly with a metaclass, but this'll do.
7192
8411
  ReceivePaymentMethod.SPARK_ADDRESS = type("ReceivePaymentMethod.SPARK_ADDRESS", (ReceivePaymentMethod.SPARK_ADDRESS, ReceivePaymentMethod,), {}) # type: ignore
8412
+ ReceivePaymentMethod.SPARK_INVOICE = type("ReceivePaymentMethod.SPARK_INVOICE", (ReceivePaymentMethod.SPARK_INVOICE, ReceivePaymentMethod,), {}) # type: ignore
7193
8413
  ReceivePaymentMethod.BITCOIN_ADDRESS = type("ReceivePaymentMethod.BITCOIN_ADDRESS", (ReceivePaymentMethod.BITCOIN_ADDRESS, ReceivePaymentMethod,), {}) # type: ignore
7194
8414
  ReceivePaymentMethod.BOLT11_INVOICE = type("ReceivePaymentMethod.BOLT11_INVOICE", (ReceivePaymentMethod.BOLT11_INVOICE, ReceivePaymentMethod,), {}) # type: ignore
7195
8415
 
@@ -7204,9 +8424,17 @@ class _UniffiConverterTypeReceivePaymentMethod(_UniffiConverterRustBuffer):
7204
8424
  return ReceivePaymentMethod.SPARK_ADDRESS(
7205
8425
  )
7206
8426
  if variant == 2:
7207
- return ReceivePaymentMethod.BITCOIN_ADDRESS(
8427
+ return ReceivePaymentMethod.SPARK_INVOICE(
8428
+ _UniffiConverterOptionalTypeU128.read(buf),
8429
+ _UniffiConverterOptionalString.read(buf),
8430
+ _UniffiConverterOptionalUInt64.read(buf),
8431
+ _UniffiConverterOptionalString.read(buf),
8432
+ _UniffiConverterOptionalString.read(buf),
7208
8433
  )
7209
8434
  if variant == 3:
8435
+ return ReceivePaymentMethod.BITCOIN_ADDRESS(
8436
+ )
8437
+ if variant == 4:
7210
8438
  return ReceivePaymentMethod.BOLT11_INVOICE(
7211
8439
  _UniffiConverterString.read(buf),
7212
8440
  _UniffiConverterOptionalUInt64.read(buf),
@@ -7217,6 +8445,13 @@ class _UniffiConverterTypeReceivePaymentMethod(_UniffiConverterRustBuffer):
7217
8445
  def check_lower(value):
7218
8446
  if value.is_spark_address():
7219
8447
  return
8448
+ if value.is_spark_invoice():
8449
+ _UniffiConverterOptionalTypeU128.check_lower(value.amount)
8450
+ _UniffiConverterOptionalString.check_lower(value.token_identifier)
8451
+ _UniffiConverterOptionalUInt64.check_lower(value.expiry_time)
8452
+ _UniffiConverterOptionalString.check_lower(value.description)
8453
+ _UniffiConverterOptionalString.check_lower(value.sender_public_key)
8454
+ return
7220
8455
  if value.is_bitcoin_address():
7221
8456
  return
7222
8457
  if value.is_bolt11_invoice():
@@ -7229,10 +8464,17 @@ class _UniffiConverterTypeReceivePaymentMethod(_UniffiConverterRustBuffer):
7229
8464
  def write(value, buf):
7230
8465
  if value.is_spark_address():
7231
8466
  buf.write_i32(1)
7232
- if value.is_bitcoin_address():
8467
+ if value.is_spark_invoice():
7233
8468
  buf.write_i32(2)
7234
- if value.is_bolt11_invoice():
8469
+ _UniffiConverterOptionalTypeU128.write(value.amount, buf)
8470
+ _UniffiConverterOptionalString.write(value.token_identifier, buf)
8471
+ _UniffiConverterOptionalUInt64.write(value.expiry_time, buf)
8472
+ _UniffiConverterOptionalString.write(value.description, buf)
8473
+ _UniffiConverterOptionalString.write(value.sender_public_key, buf)
8474
+ if value.is_bitcoin_address():
7235
8475
  buf.write_i32(3)
8476
+ if value.is_bolt11_invoice():
8477
+ buf.write_i32(4)
7236
8478
  _UniffiConverterString.write(value.description, buf)
7237
8479
  _UniffiConverterOptionalUInt64.write(value.amount_sats, buf)
7238
8480
 
@@ -7948,6 +9190,40 @@ class SendPaymentMethod:
7948
9190
  return False
7949
9191
  return True
7950
9192
 
9193
+ class SPARK_INVOICE:
9194
+ spark_invoice_details: "SparkInvoiceDetails"
9195
+ fee: "U128"
9196
+ """
9197
+ Fee to pay for the transaction
9198
+ Denominated in sats if token identifier is empty, otherwise in the token base units
9199
+ """
9200
+
9201
+ token_identifier: "typing.Optional[str]"
9202
+ """
9203
+ The presence of this field indicates that the payment is for a token
9204
+ If empty, it is a Bitcoin payment
9205
+ """
9206
+
9207
+
9208
+ def __init__(self,spark_invoice_details: "SparkInvoiceDetails", fee: "U128", token_identifier: "typing.Optional[str]"):
9209
+ self.spark_invoice_details = spark_invoice_details
9210
+ self.fee = fee
9211
+ self.token_identifier = token_identifier
9212
+
9213
+ def __str__(self):
9214
+ return "SendPaymentMethod.SPARK_INVOICE(spark_invoice_details={}, fee={}, token_identifier={})".format(self.spark_invoice_details, self.fee, self.token_identifier)
9215
+
9216
+ def __eq__(self, other):
9217
+ if not other.is_spark_invoice():
9218
+ return False
9219
+ if self.spark_invoice_details != other.spark_invoice_details:
9220
+ return False
9221
+ if self.fee != other.fee:
9222
+ return False
9223
+ if self.token_identifier != other.token_identifier:
9224
+ return False
9225
+ return True
9226
+
7951
9227
 
7952
9228
 
7953
9229
  # For each variant, we have an `is_NAME` method for easily checking
@@ -7958,6 +9234,8 @@ class SendPaymentMethod:
7958
9234
  return isinstance(self, SendPaymentMethod.BOLT11_INVOICE)
7959
9235
  def is_spark_address(self) -> bool:
7960
9236
  return isinstance(self, SendPaymentMethod.SPARK_ADDRESS)
9237
+ def is_spark_invoice(self) -> bool:
9238
+ return isinstance(self, SendPaymentMethod.SPARK_INVOICE)
7961
9239
 
7962
9240
 
7963
9241
  # Now, a little trick - we make each nested variant class be a subclass of the main
@@ -7966,6 +9244,7 @@ class SendPaymentMethod:
7966
9244
  SendPaymentMethod.BITCOIN_ADDRESS = type("SendPaymentMethod.BITCOIN_ADDRESS", (SendPaymentMethod.BITCOIN_ADDRESS, SendPaymentMethod,), {}) # type: ignore
7967
9245
  SendPaymentMethod.BOLT11_INVOICE = type("SendPaymentMethod.BOLT11_INVOICE", (SendPaymentMethod.BOLT11_INVOICE, SendPaymentMethod,), {}) # type: ignore
7968
9246
  SendPaymentMethod.SPARK_ADDRESS = type("SendPaymentMethod.SPARK_ADDRESS", (SendPaymentMethod.SPARK_ADDRESS, SendPaymentMethod,), {}) # type: ignore
9247
+ SendPaymentMethod.SPARK_INVOICE = type("SendPaymentMethod.SPARK_INVOICE", (SendPaymentMethod.SPARK_INVOICE, SendPaymentMethod,), {}) # type: ignore
7969
9248
 
7970
9249
 
7971
9250
 
@@ -7991,6 +9270,12 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
7991
9270
  _UniffiConverterTypeU128.read(buf),
7992
9271
  _UniffiConverterOptionalString.read(buf),
7993
9272
  )
9273
+ if variant == 4:
9274
+ return SendPaymentMethod.SPARK_INVOICE(
9275
+ _UniffiConverterTypeSparkInvoiceDetails.read(buf),
9276
+ _UniffiConverterTypeU128.read(buf),
9277
+ _UniffiConverterOptionalString.read(buf),
9278
+ )
7994
9279
  raise InternalError("Raw enum value doesn't match any cases")
7995
9280
 
7996
9281
  @staticmethod
@@ -8009,6 +9294,11 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
8009
9294
  _UniffiConverterTypeU128.check_lower(value.fee)
8010
9295
  _UniffiConverterOptionalString.check_lower(value.token_identifier)
8011
9296
  return
9297
+ if value.is_spark_invoice():
9298
+ _UniffiConverterTypeSparkInvoiceDetails.check_lower(value.spark_invoice_details)
9299
+ _UniffiConverterTypeU128.check_lower(value.fee)
9300
+ _UniffiConverterOptionalString.check_lower(value.token_identifier)
9301
+ return
8012
9302
  raise ValueError(value)
8013
9303
 
8014
9304
  @staticmethod
@@ -8027,6 +9317,11 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
8027
9317
  _UniffiConverterString.write(value.address, buf)
8028
9318
  _UniffiConverterTypeU128.write(value.fee, buf)
8029
9319
  _UniffiConverterOptionalString.write(value.token_identifier, buf)
9320
+ if value.is_spark_invoice():
9321
+ buf.write_i32(4)
9322
+ _UniffiConverterTypeSparkInvoiceDetails.write(value.spark_invoice_details, buf)
9323
+ _UniffiConverterTypeU128.write(value.fee, buf)
9324
+ _UniffiConverterOptionalString.write(value.token_identifier, buf)
8030
9325
 
8031
9326
 
8032
9327
 
@@ -8761,6 +10056,33 @@ class _UniffiConverterOptionalTypeLnurlPayInfo(_UniffiConverterRustBuffer):
8761
10056
 
8762
10057
 
8763
10058
 
10059
+ class _UniffiConverterOptionalTypeLnurlWithdrawInfo(_UniffiConverterRustBuffer):
10060
+ @classmethod
10061
+ def check_lower(cls, value):
10062
+ if value is not None:
10063
+ _UniffiConverterTypeLnurlWithdrawInfo.check_lower(value)
10064
+
10065
+ @classmethod
10066
+ def write(cls, value, buf):
10067
+ if value is None:
10068
+ buf.write_u8(0)
10069
+ return
10070
+
10071
+ buf.write_u8(1)
10072
+ _UniffiConverterTypeLnurlWithdrawInfo.write(value, buf)
10073
+
10074
+ @classmethod
10075
+ def read(cls, buf):
10076
+ flag = buf.read_u8()
10077
+ if flag == 0:
10078
+ return None
10079
+ elif flag == 1:
10080
+ return _UniffiConverterTypeLnurlWithdrawInfo.read(buf)
10081
+ else:
10082
+ raise InternalError("Unexpected flag byte for optional type")
10083
+
10084
+
10085
+
8764
10086
  class _UniffiConverterOptionalTypePayment(_UniffiConverterRustBuffer):
8765
10087
  @classmethod
8766
10088
  def check_lower(cls, value):
@@ -8788,6 +10110,33 @@ class _UniffiConverterOptionalTypePayment(_UniffiConverterRustBuffer):
8788
10110
 
8789
10111
 
8790
10112
 
10113
+ class _UniffiConverterOptionalTypeSparkInvoicePaymentDetails(_UniffiConverterRustBuffer):
10114
+ @classmethod
10115
+ def check_lower(cls, value):
10116
+ if value is not None:
10117
+ _UniffiConverterTypeSparkInvoicePaymentDetails.check_lower(value)
10118
+
10119
+ @classmethod
10120
+ def write(cls, value, buf):
10121
+ if value is None:
10122
+ buf.write_u8(0)
10123
+ return
10124
+
10125
+ buf.write_u8(1)
10126
+ _UniffiConverterTypeSparkInvoicePaymentDetails.write(value, buf)
10127
+
10128
+ @classmethod
10129
+ def read(cls, buf):
10130
+ flag = buf.read_u8()
10131
+ if flag == 0:
10132
+ return None
10133
+ elif flag == 1:
10134
+ return _UniffiConverterTypeSparkInvoicePaymentDetails.read(buf)
10135
+ else:
10136
+ raise InternalError("Unexpected flag byte for optional type")
10137
+
10138
+
10139
+
8791
10140
  class _UniffiConverterOptionalTypeAssetFilter(_UniffiConverterRustBuffer):
8792
10141
  @classmethod
8793
10142
  def check_lower(cls, value):
@@ -9004,6 +10353,33 @@ class _UniffiConverterOptionalSequenceTypePaymentType(_UniffiConverterRustBuffer
9004
10353
 
9005
10354
 
9006
10355
 
10356
+ class _UniffiConverterOptionalSequenceTypeExternalInputParser(_UniffiConverterRustBuffer):
10357
+ @classmethod
10358
+ def check_lower(cls, value):
10359
+ if value is not None:
10360
+ _UniffiConverterSequenceTypeExternalInputParser.check_lower(value)
10361
+
10362
+ @classmethod
10363
+ def write(cls, value, buf):
10364
+ if value is None:
10365
+ buf.write_u8(0)
10366
+ return
10367
+
10368
+ buf.write_u8(1)
10369
+ _UniffiConverterSequenceTypeExternalInputParser.write(value, buf)
10370
+
10371
+ @classmethod
10372
+ def read(cls, buf):
10373
+ flag = buf.read_u8()
10374
+ if flag == 0:
10375
+ return None
10376
+ elif flag == 1:
10377
+ return _UniffiConverterSequenceTypeExternalInputParser.read(buf)
10378
+ else:
10379
+ raise InternalError("Unexpected flag byte for optional type")
10380
+
10381
+
10382
+
9007
10383
  class _UniffiConverterOptionalTypeSuccessAction(_UniffiConverterRustBuffer):
9008
10384
  @classmethod
9009
10385
  def check_lower(cls, value):
@@ -9160,6 +10536,31 @@ class _UniffiConverterSequenceTypePayment(_UniffiConverterRustBuffer):
9160
10536
 
9161
10537
 
9162
10538
 
10539
+ class _UniffiConverterSequenceTypeProvisionalPayment(_UniffiConverterRustBuffer):
10540
+ @classmethod
10541
+ def check_lower(cls, value):
10542
+ for item in value:
10543
+ _UniffiConverterTypeProvisionalPayment.check_lower(item)
10544
+
10545
+ @classmethod
10546
+ def write(cls, value, buf):
10547
+ items = len(value)
10548
+ buf.write_i32(items)
10549
+ for item in value:
10550
+ _UniffiConverterTypeProvisionalPayment.write(item, buf)
10551
+
10552
+ @classmethod
10553
+ def read(cls, buf):
10554
+ count = buf.read_i32()
10555
+ if count < 0:
10556
+ raise InternalError("Unexpected negative sequence length")
10557
+
10558
+ return [
10559
+ _UniffiConverterTypeProvisionalPayment.read(buf) for i in range(count)
10560
+ ]
10561
+
10562
+
10563
+
9163
10564
  class _UniffiConverterSequenceTypeTokenMetadata(_UniffiConverterRustBuffer):
9164
10565
  @classmethod
9165
10566
  def check_lower(cls, value):
@@ -9260,6 +10661,31 @@ class _UniffiConverterSequenceTypePaymentType(_UniffiConverterRustBuffer):
9260
10661
 
9261
10662
 
9262
10663
 
10664
+ class _UniffiConverterSequenceTypeExternalInputParser(_UniffiConverterRustBuffer):
10665
+ @classmethod
10666
+ def check_lower(cls, value):
10667
+ for item in value:
10668
+ _UniffiConverterTypeExternalInputParser.check_lower(item)
10669
+
10670
+ @classmethod
10671
+ def write(cls, value, buf):
10672
+ items = len(value)
10673
+ buf.write_i32(items)
10674
+ for item in value:
10675
+ _UniffiConverterTypeExternalInputParser.write(item, buf)
10676
+
10677
+ @classmethod
10678
+ def read(cls, buf):
10679
+ count = buf.read_i32()
10680
+ if count < 0:
10681
+ raise InternalError("Unexpected negative sequence length")
10682
+
10683
+ return [
10684
+ _UniffiConverterTypeExternalInputParser.read(buf) for i in range(count)
10685
+ ]
10686
+
10687
+
10688
+
9263
10689
  class _UniffiConverterSequenceTypeFiatCurrency(_UniffiConverterRustBuffer):
9264
10690
  @classmethod
9265
10691
  def check_lower(cls, value):
@@ -9351,6 +10777,11 @@ class _UniffiConverterMapStringTypeTokenBalance(_UniffiConverterRustBuffer):
9351
10777
 
9352
10778
 
9353
10779
 
10780
+ # External type ExternalInputParser is in namespace "breez_sdk_common", crate breez_sdk_common
10781
+
10782
+
10783
+
10784
+
9354
10785
  # External type FiatCurrency is in namespace "breez_sdk_common", crate breez_sdk_common
9355
10786
 
9356
10787
 
@@ -9371,6 +10802,11 @@ class _UniffiConverterMapStringTypeTokenBalance(_UniffiConverterRustBuffer):
9371
10802
 
9372
10803
 
9373
10804
 
10805
+ # External type LnurlWithdrawRequestDetails is in namespace "breez_sdk_common", crate breez_sdk_common
10806
+
10807
+
10808
+
10809
+
9374
10810
  # External type Rate is in namespace "breez_sdk_common", crate breez_sdk_common
9375
10811
 
9376
10812
 
@@ -9381,6 +10817,11 @@ class _UniffiConverterMapStringTypeTokenBalance(_UniffiConverterRustBuffer):
9381
10817
 
9382
10818
 
9383
10819
 
10820
+ # External type SparkInvoiceDetails is in namespace "breez_sdk_common", crate breez_sdk_common
10821
+
10822
+
10823
+
10824
+
9384
10825
  # External type SuccessAction is in namespace "breez_sdk_common", crate breez_sdk_common
9385
10826
 
9386
10827
 
@@ -9586,23 +11027,6 @@ def init_logging(log_dir: "typing.Optional[str]",app_logger: "typing.Optional[Lo
9586
11027
  _UniffiConverterOptionalTypeLogger.lower(app_logger),
9587
11028
  _UniffiConverterOptionalString.lower(log_filter))
9588
11029
 
9589
- async def parse(input: "str") -> "InputType":
9590
-
9591
- _UniffiConverterString.check_lower(input)
9592
-
9593
- return await _uniffi_rust_call_async(
9594
- _UniffiLib.uniffi_breez_sdk_spark_fn_func_parse(
9595
- _UniffiConverterString.lower(input)),
9596
- _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
9597
- _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
9598
- _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
9599
- # lift function
9600
- _UniffiConverterTypeInputType.lift,
9601
-
9602
- # Error FFI converter
9603
- _UniffiConverterTypeSdkError,
9604
-
9605
- )
9606
11030
 
9607
11031
  __all__ = [
9608
11032
  "InternalError",
@@ -9615,8 +11039,10 @@ __all__ = [
9615
11039
  "OnchainConfirmationSpeed",
9616
11040
  "PaymentDetails",
9617
11041
  "PaymentMethod",
11042
+ "PaymentObserverError",
9618
11043
  "PaymentStatus",
9619
11044
  "PaymentType",
11045
+ "ProvisionalPaymentDetails",
9620
11046
  "ReceivePaymentMethod",
9621
11047
  "SdkError",
9622
11048
  "SdkEvent",
@@ -9627,6 +11053,8 @@ __all__ = [
9627
11053
  "UpdateDepositPayload",
9628
11054
  "WaitForPaymentIdentifier",
9629
11055
  "CheckLightningAddressRequest",
11056
+ "CheckMessageRequest",
11057
+ "CheckMessageResponse",
9630
11058
  "ClaimDepositRequest",
9631
11059
  "ClaimDepositResponse",
9632
11060
  "Config",
@@ -9649,6 +11077,9 @@ __all__ = [
9649
11077
  "LnurlPayInfo",
9650
11078
  "LnurlPayRequest",
9651
11079
  "LnurlPayResponse",
11080
+ "LnurlWithdrawInfo",
11081
+ "LnurlWithdrawRequest",
11082
+ "LnurlWithdrawResponse",
9652
11083
  "LogEntry",
9653
11084
  "Payment",
9654
11085
  "PaymentMetadata",
@@ -9656,6 +11087,7 @@ __all__ = [
9656
11087
  "PrepareLnurlPayResponse",
9657
11088
  "PrepareSendPaymentRequest",
9658
11089
  "PrepareSendPaymentResponse",
11090
+ "ProvisionalPayment",
9659
11091
  "ReceivePaymentRequest",
9660
11092
  "ReceivePaymentResponse",
9661
11093
  "RefundDepositRequest",
@@ -9665,6 +11097,9 @@ __all__ = [
9665
11097
  "SendOnchainSpeedFeeQuote",
9666
11098
  "SendPaymentRequest",
9667
11099
  "SendPaymentResponse",
11100
+ "SignMessageRequest",
11101
+ "SignMessageResponse",
11102
+ "SparkInvoicePaymentDetails",
9668
11103
  "SyncWalletRequest",
9669
11104
  "SyncWalletResponse",
9670
11105
  "TokenBalance",
@@ -9677,9 +11112,9 @@ __all__ = [
9677
11112
  "default_config",
9678
11113
  "default_storage",
9679
11114
  "init_logging",
9680
- "parse",
9681
11115
  "BitcoinChainService",
9682
11116
  "BreezSdk",
11117
+ "PaymentObserver",
9683
11118
  "SdkBuilder",
9684
11119
  "Storage",
9685
11120
  "EventListener",