breez-sdk-spark 0.2.6__cp311-cp311-win32.whl → 0.3.0rc2__cp311-cp311-win32.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.

@@ -525,6 +525,8 @@ def _uniffi_check_api_checksums(lib):
525
525
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
526
526
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment() != 11540:
527
527
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
528
+ if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata() != 40125:
529
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
528
530
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies() != 63366:
529
531
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
530
532
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates() != 5904:
@@ -535,32 +537,20 @@ def _uniffi_check_api_checksums(lib):
535
537
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
536
538
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() != 10147:
537
539
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
538
- if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() != 57601:
539
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
540
540
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() != 37691:
541
541
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
542
542
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment() != 34185:
543
543
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
544
544
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment() != 36984:
545
545
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
546
- if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address() != 43367:
547
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
548
546
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit() != 33646:
549
547
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
550
548
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_register_lightning_address() != 530:
551
549
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
552
550
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener() != 41066:
553
551
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
554
- if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bitcoin_address() != 5926:
555
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
556
- if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bolt11_invoice() != 21785:
557
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
558
552
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() != 54349:
559
553
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
560
- if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal() != 37855:
561
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
562
- if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_spark_address() != 63147:
563
- raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
564
554
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() != 30368:
565
555
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
566
556
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment() != 64922:
@@ -583,7 +573,7 @@ def _uniffi_check_api_checksums(lib):
583
573
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
584
574
  if lib.uniffi_breez_sdk_spark_checksum_method_storage_set_cached_item() != 7970:
585
575
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
586
- if lib.uniffi_breez_sdk_spark_checksum_method_storage_list_payments() != 35678:
576
+ if lib.uniffi_breez_sdk_spark_checksum_method_storage_list_payments() != 19728:
587
577
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
588
578
  if lib.uniffi_breez_sdk_spark_checksum_method_storage_insert_payment() != 28075:
589
579
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
@@ -732,7 +722,7 @@ _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint
732
722
  )
733
723
  _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
734
724
  )
735
- _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
725
+ _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD3 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
736
726
  )
737
727
  _UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD4 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
738
728
  )
@@ -865,6 +855,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_payment.argtypes = (
865
855
  _UniffiRustBuffer,
866
856
  )
867
857
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_payment.restype = ctypes.c_uint64
858
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_tokens_metadata.argtypes = (
859
+ ctypes.c_void_p,
860
+ _UniffiRustBuffer,
861
+ )
862
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_tokens_metadata.restype = ctypes.c_uint64
868
863
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_currencies.argtypes = (
869
864
  ctypes.c_void_p,
870
865
  )
@@ -888,13 +883,6 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.argtypes = (
888
883
  _UniffiRustBuffer,
889
884
  )
890
885
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.restype = ctypes.c_uint64
891
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment.argtypes = (
892
- ctypes.c_void_p,
893
- _UniffiRustBuffer,
894
- _UniffiRustBuffer,
895
- ctypes.POINTER(_UniffiRustCallStatus),
896
- )
897
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment.restype = None
898
886
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_prepare_lnurl_pay.argtypes = (
899
887
  ctypes.c_void_p,
900
888
  _UniffiRustBuffer,
@@ -910,10 +898,6 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_receive_payment.argtypes =
910
898
  _UniffiRustBuffer,
911
899
  )
912
900
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_receive_payment.restype = ctypes.c_uint64
913
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address.argtypes = (
914
- ctypes.c_void_p,
915
- )
916
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address.restype = ctypes.c_uint64
917
901
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_refund_deposit.argtypes = (
918
902
  ctypes.c_void_p,
919
903
  _UniffiRustBuffer,
@@ -929,38 +913,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener.argty
929
913
  _UniffiRustBuffer,
930
914
  )
931
915
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_remove_event_listener.restype = ctypes.c_uint64
932
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_bitcoin_address.argtypes = (
933
- ctypes.c_void_p,
934
- _UniffiRustBufferBitcoinAddressDetails,
935
- _UniffiRustBuffer,
936
- _UniffiRustBuffer,
937
- )
938
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_bitcoin_address.restype = ctypes.c_uint64
939
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_bolt11_invoice.argtypes = (
940
- ctypes.c_void_p,
941
- _UniffiRustBufferBolt11InvoiceDetails,
942
- _UniffiRustBuffer,
943
- ctypes.c_uint64,
944
- _UniffiRustBuffer,
945
- )
946
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_bolt11_invoice.restype = ctypes.c_uint64
947
916
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment.argtypes = (
948
917
  ctypes.c_void_p,
949
918
  _UniffiRustBuffer,
950
919
  )
951
920
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment.restype = ctypes.c_uint64
952
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment_internal.argtypes = (
953
- ctypes.c_void_p,
954
- _UniffiRustBuffer,
955
- ctypes.c_int8,
956
- )
957
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment_internal.restype = ctypes.c_uint64
958
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_spark_address.argtypes = (
959
- ctypes.c_void_p,
960
- _UniffiRustBuffer,
961
- _UniffiRustBuffer,
962
- )
963
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_spark_address.restype = ctypes.c_uint64
964
921
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet.argtypes = (
965
922
  ctypes.c_void_p,
966
923
  _UniffiRustBuffer,
@@ -1053,7 +1010,6 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_set_cached_item.restype = ct
1053
1010
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_list_payments.argtypes = (
1054
1011
  ctypes.c_void_p,
1055
1012
  _UniffiRustBuffer,
1056
- _UniffiRustBuffer,
1057
1013
  )
1058
1014
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_list_payments.restype = ctypes.c_uint64
1059
1015
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_insert_payment.argtypes = (
@@ -1453,6 +1409,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_lightning_address
1453
1409
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment.argtypes = (
1454
1410
  )
1455
1411
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment.restype = ctypes.c_uint16
1412
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata.argtypes = (
1413
+ )
1414
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_tokens_metadata.restype = ctypes.c_uint16
1456
1415
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies.argtypes = (
1457
1416
  )
1458
1417
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies.restype = ctypes.c_uint16
@@ -1468,9 +1427,6 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_unclaimed_deposi
1468
1427
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay.argtypes = (
1469
1428
  )
1470
1429
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay.restype = ctypes.c_uint16
1471
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment.argtypes = (
1472
- )
1473
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment.restype = ctypes.c_uint16
1474
1430
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay.argtypes = (
1475
1431
  )
1476
1432
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay.restype = ctypes.c_uint16
@@ -1480,9 +1436,6 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_send_payment.
1480
1436
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment.argtypes = (
1481
1437
  )
1482
1438
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_receive_payment.restype = ctypes.c_uint16
1483
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address.argtypes = (
1484
- )
1485
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_recover_lightning_address.restype = ctypes.c_uint16
1486
1439
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit.argtypes = (
1487
1440
  )
1488
1441
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_refund_deposit.restype = ctypes.c_uint16
@@ -1492,21 +1445,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_register_lightning_ad
1492
1445
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener.argtypes = (
1493
1446
  )
1494
1447
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener.restype = ctypes.c_uint16
1495
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bitcoin_address.argtypes = (
1496
- )
1497
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bitcoin_address.restype = ctypes.c_uint16
1498
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bolt11_invoice.argtypes = (
1499
- )
1500
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_bolt11_invoice.restype = ctypes.c_uint16
1501
1448
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment.argtypes = (
1502
1449
  )
1503
1450
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment.restype = ctypes.c_uint16
1504
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal.argtypes = (
1505
- )
1506
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment_internal.restype = ctypes.c_uint16
1507
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_spark_address.argtypes = (
1508
- )
1509
- _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_spark_address.restype = ctypes.c_uint16
1510
1451
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet.argtypes = (
1511
1452
  )
1512
1453
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet.restype = ctypes.c_uint16
@@ -2072,6 +2013,17 @@ class BreezSdkProtocol(typing.Protocol):
2072
2013
  def get_lightning_address(self, ):
2073
2014
  raise NotImplementedError
2074
2015
  def get_payment(self, request: "GetPaymentRequest"):
2016
+ raise NotImplementedError
2017
+ def get_tokens_metadata(self, request: "GetTokensMetadataRequest"):
2018
+ """
2019
+ Returns the metadata for the given token identifiers.
2020
+
2021
+ Results are not guaranteed to be in the same order as the input token identifiers.
2022
+
2023
+ If the metadata is not found locally in cache, it will be queried from
2024
+ the Spark network and then cached.
2025
+ """
2026
+
2075
2027
  raise NotImplementedError
2076
2028
  def list_fiat_currencies(self, ):
2077
2029
  """
@@ -2109,19 +2061,11 @@ class BreezSdkProtocol(typing.Protocol):
2109
2061
  raise NotImplementedError
2110
2062
  def lnurl_pay(self, request: "LnurlPayRequest"):
2111
2063
  raise NotImplementedError
2112
- def poll_lightning_send_payment(self, payment: "Payment",ssp_id: "str"):
2113
- raise NotImplementedError
2114
2064
  def prepare_lnurl_pay(self, request: "PrepareLnurlPayRequest"):
2115
2065
  raise NotImplementedError
2116
2066
  def prepare_send_payment(self, request: "PrepareSendPaymentRequest"):
2117
2067
  raise NotImplementedError
2118
2068
  def receive_payment(self, request: "ReceivePaymentRequest"):
2119
- raise NotImplementedError
2120
- def recover_lightning_address(self, ):
2121
- """
2122
- Attempts to recover a lightning address from the lnurl server.
2123
- """
2124
-
2125
2069
  raise NotImplementedError
2126
2070
  def refund_deposit(self, request: "RefundDepositRequest"):
2127
2071
  raise NotImplementedError
@@ -2140,17 +2084,9 @@ class BreezSdkProtocol(typing.Protocol):
2140
2084
  `true` if the listener was found and removed, `false` otherwise
2141
2085
  """
2142
2086
 
2143
- raise NotImplementedError
2144
- def send_bitcoin_address(self, address: "BitcoinAddressDetails",fee_quote: "SendOnchainFeeQuote",request: "SendPaymentRequest"):
2145
- raise NotImplementedError
2146
- def send_bolt11_invoice(self, invoice_details: "Bolt11InvoiceDetails",spark_transfer_fee_sats: "typing.Optional[int]",lightning_fee_sats: "int",request: "SendPaymentRequest"):
2147
2087
  raise NotImplementedError
2148
2088
  def send_payment(self, request: "SendPaymentRequest"):
2149
2089
  raise NotImplementedError
2150
- def send_payment_internal(self, request: "SendPaymentRequest",suppress_payment_event: "bool"):
2151
- raise NotImplementedError
2152
- def send_spark_address(self, address: "str",request: "SendPaymentRequest"):
2153
- raise NotImplementedError
2154
2090
  def sync_wallet(self, request: "SyncWalletRequest"):
2155
2091
  """
2156
2092
  Synchronizes the wallet with the Spark network
@@ -2381,6 +2317,36 @@ _UniffiConverterTypeSdkError,
2381
2317
 
2382
2318
 
2383
2319
 
2320
+ async def get_tokens_metadata(self, request: "GetTokensMetadataRequest") -> "GetTokensMetadataResponse":
2321
+ """
2322
+ Returns the metadata for the given token identifiers.
2323
+
2324
+ Results are not guaranteed to be in the same order as the input token identifiers.
2325
+
2326
+ If the metadata is not found locally in cache, it will be queried from
2327
+ the Spark network and then cached.
2328
+ """
2329
+
2330
+ _UniffiConverterTypeGetTokensMetadataRequest.check_lower(request)
2331
+
2332
+ return await _uniffi_rust_call_async(
2333
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_tokens_metadata(
2334
+ self._uniffi_clone_pointer(),
2335
+ _UniffiConverterTypeGetTokensMetadataRequest.lower(request)
2336
+ ),
2337
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2338
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2339
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2340
+ # lift function
2341
+ _UniffiConverterTypeGetTokensMetadataResponse.lift,
2342
+
2343
+ # Error FFI converter
2344
+ _UniffiConverterTypeSdkError,
2345
+
2346
+ )
2347
+
2348
+
2349
+
2384
2350
  async def list_fiat_currencies(self, ) -> "ListFiatCurrenciesResponse":
2385
2351
  """
2386
2352
  List fiat currencies for which there is a known exchange rate,
@@ -2506,20 +2472,6 @@ _UniffiConverterTypeSdkError,
2506
2472
 
2507
2473
 
2508
2474
 
2509
-
2510
- def poll_lightning_send_payment(self, payment: "Payment",ssp_id: "str") -> None:
2511
- _UniffiConverterTypePayment.check_lower(payment)
2512
-
2513
- _UniffiConverterString.check_lower(ssp_id)
2514
-
2515
- _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment,self._uniffi_clone_pointer(),
2516
- _UniffiConverterTypePayment.lower(payment),
2517
- _UniffiConverterString.lower(ssp_id))
2518
-
2519
-
2520
-
2521
-
2522
-
2523
2475
  async def prepare_lnurl_pay(self, request: "PrepareLnurlPayRequest") -> "PrepareLnurlPayResponse":
2524
2476
  _UniffiConverterTypePrepareLnurlPayRequest.check_lower(request)
2525
2477
 
@@ -2583,28 +2535,6 @@ _UniffiConverterTypeSdkError,
2583
2535
 
2584
2536
 
2585
2537
 
2586
- async def recover_lightning_address(self, ) -> "typing.Optional[LightningAddressInfo]":
2587
- """
2588
- Attempts to recover a lightning address from the lnurl server.
2589
- """
2590
-
2591
- return await _uniffi_rust_call_async(
2592
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_recover_lightning_address(
2593
- self._uniffi_clone_pointer(),
2594
- ),
2595
- _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2596
- _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2597
- _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2598
- # lift function
2599
- _UniffiConverterOptionalTypeLightningAddressInfo.lift,
2600
-
2601
- # Error FFI converter
2602
- _UniffiConverterTypeSdkError,
2603
-
2604
- )
2605
-
2606
-
2607
-
2608
2538
  async def refund_deposit(self, request: "RefundDepositRequest") -> "RefundDepositResponse":
2609
2539
  _UniffiConverterTypeRefundDepositRequest.check_lower(request)
2610
2540
 
@@ -2681,63 +2611,6 @@ _UniffiConverterTypeSdkError,
2681
2611
 
2682
2612
 
2683
2613
 
2684
- async def send_bitcoin_address(self, address: "BitcoinAddressDetails",fee_quote: "SendOnchainFeeQuote",request: "SendPaymentRequest") -> "SendPaymentResponse":
2685
- _UniffiConverterTypeBitcoinAddressDetails.check_lower(address)
2686
-
2687
- _UniffiConverterTypeSendOnchainFeeQuote.check_lower(fee_quote)
2688
-
2689
- _UniffiConverterTypeSendPaymentRequest.check_lower(request)
2690
-
2691
- return await _uniffi_rust_call_async(
2692
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_bitcoin_address(
2693
- self._uniffi_clone_pointer(),
2694
- _UniffiConverterTypeBitcoinAddressDetails.lower(address),
2695
- _UniffiConverterTypeSendOnchainFeeQuote.lower(fee_quote),
2696
- _UniffiConverterTypeSendPaymentRequest.lower(request)
2697
- ),
2698
- _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2699
- _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2700
- _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2701
- # lift function
2702
- _UniffiConverterTypeSendPaymentResponse.lift,
2703
-
2704
- # Error FFI converter
2705
- _UniffiConverterTypeSdkError,
2706
-
2707
- )
2708
-
2709
-
2710
-
2711
- async def send_bolt11_invoice(self, invoice_details: "Bolt11InvoiceDetails",spark_transfer_fee_sats: "typing.Optional[int]",lightning_fee_sats: "int",request: "SendPaymentRequest") -> "SendPaymentResponse":
2712
- _UniffiConverterTypeBolt11InvoiceDetails.check_lower(invoice_details)
2713
-
2714
- _UniffiConverterOptionalUInt64.check_lower(spark_transfer_fee_sats)
2715
-
2716
- _UniffiConverterUInt64.check_lower(lightning_fee_sats)
2717
-
2718
- _UniffiConverterTypeSendPaymentRequest.check_lower(request)
2719
-
2720
- return await _uniffi_rust_call_async(
2721
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_bolt11_invoice(
2722
- self._uniffi_clone_pointer(),
2723
- _UniffiConverterTypeBolt11InvoiceDetails.lower(invoice_details),
2724
- _UniffiConverterOptionalUInt64.lower(spark_transfer_fee_sats),
2725
- _UniffiConverterUInt64.lower(lightning_fee_sats),
2726
- _UniffiConverterTypeSendPaymentRequest.lower(request)
2727
- ),
2728
- _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2729
- _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2730
- _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2731
- # lift function
2732
- _UniffiConverterTypeSendPaymentResponse.lift,
2733
-
2734
- # Error FFI converter
2735
- _UniffiConverterTypeSdkError,
2736
-
2737
- )
2738
-
2739
-
2740
-
2741
2614
  async def send_payment(self, request: "SendPaymentRequest") -> "SendPaymentResponse":
2742
2615
  _UniffiConverterTypeSendPaymentRequest.check_lower(request)
2743
2616
 
@@ -2759,54 +2632,6 @@ _UniffiConverterTypeSdkError,
2759
2632
 
2760
2633
 
2761
2634
 
2762
- async def send_payment_internal(self, request: "SendPaymentRequest",suppress_payment_event: "bool") -> "SendPaymentResponse":
2763
- _UniffiConverterTypeSendPaymentRequest.check_lower(request)
2764
-
2765
- _UniffiConverterBool.check_lower(suppress_payment_event)
2766
-
2767
- return await _uniffi_rust_call_async(
2768
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment_internal(
2769
- self._uniffi_clone_pointer(),
2770
- _UniffiConverterTypeSendPaymentRequest.lower(request),
2771
- _UniffiConverterBool.lower(suppress_payment_event)
2772
- ),
2773
- _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2774
- _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2775
- _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2776
- # lift function
2777
- _UniffiConverterTypeSendPaymentResponse.lift,
2778
-
2779
- # Error FFI converter
2780
- _UniffiConverterTypeSdkError,
2781
-
2782
- )
2783
-
2784
-
2785
-
2786
- async def send_spark_address(self, address: "str",request: "SendPaymentRequest") -> "SendPaymentResponse":
2787
- _UniffiConverterString.check_lower(address)
2788
-
2789
- _UniffiConverterTypeSendPaymentRequest.check_lower(request)
2790
-
2791
- return await _uniffi_rust_call_async(
2792
- _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_spark_address(
2793
- self._uniffi_clone_pointer(),
2794
- _UniffiConverterString.lower(address),
2795
- _UniffiConverterTypeSendPaymentRequest.lower(request)
2796
- ),
2797
- _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2798
- _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2799
- _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2800
- # lift function
2801
- _UniffiConverterTypeSendPaymentResponse.lift,
2802
-
2803
- # Error FFI converter
2804
- _UniffiConverterTypeSdkError,
2805
-
2806
- )
2807
-
2808
-
2809
-
2810
2635
  async def sync_wallet(self, request: "SyncWalletRequest") -> "SyncWalletResponse":
2811
2636
  """
2812
2637
  Synchronizes the wallet with the Spark network
@@ -3198,14 +3023,13 @@ class Storage(typing.Protocol):
3198
3023
  raise NotImplementedError
3199
3024
  def set_cached_item(self, key: "str",value: "str"):
3200
3025
  raise NotImplementedError
3201
- def list_payments(self, offset: "typing.Optional[int]",limit: "typing.Optional[int]"):
3026
+ def list_payments(self, request: "ListPaymentsRequest"):
3202
3027
  """
3203
- Lists payments with pagination
3028
+ Lists payments with optional filters and pagination
3204
3029
 
3205
3030
  # Arguments
3206
3031
 
3207
- * `offset` - Number of records to skip
3208
- * `limit` - Maximum number of records to return
3032
+ * `list_payments_request` - The request to list payments
3209
3033
 
3210
3034
  # Returns
3211
3035
 
@@ -3420,29 +3244,25 @@ _UniffiConverterTypeStorageError,
3420
3244
 
3421
3245
 
3422
3246
 
3423
- async def list_payments(self, offset: "typing.Optional[int]",limit: "typing.Optional[int]") -> "typing.List[Payment]":
3247
+ async def list_payments(self, request: "ListPaymentsRequest") -> "typing.List[Payment]":
3424
3248
  """
3425
- Lists payments with pagination
3249
+ Lists payments with optional filters and pagination
3426
3250
 
3427
3251
  # Arguments
3428
3252
 
3429
- * `offset` - Number of records to skip
3430
- * `limit` - Maximum number of records to return
3253
+ * `list_payments_request` - The request to list payments
3431
3254
 
3432
3255
  # Returns
3433
3256
 
3434
3257
  A vector of payments or a `StorageError`
3435
3258
  """
3436
3259
 
3437
- _UniffiConverterOptionalUInt32.check_lower(offset)
3438
-
3439
- _UniffiConverterOptionalUInt32.check_lower(limit)
3260
+ _UniffiConverterTypeListPaymentsRequest.check_lower(request)
3440
3261
 
3441
3262
  return await _uniffi_rust_call_async(
3442
3263
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_storage_list_payments(
3443
3264
  self._uniffi_clone_pointer(),
3444
- _UniffiConverterOptionalUInt32.lower(offset),
3445
- _UniffiConverterOptionalUInt32.lower(limit)
3265
+ _UniffiConverterTypeListPaymentsRequest.lower(request)
3446
3266
  ),
3447
3267
  _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
3448
3268
  _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
@@ -3848,15 +3668,14 @@ class _UniffiTraitImplStorage:
3848
3668
  @_UNIFFI_CALLBACK_INTERFACE_STORAGE_METHOD3
3849
3669
  def list_payments(
3850
3670
  uniffi_handle,
3851
- offset,
3852
- limit,
3671
+ request,
3853
3672
  uniffi_future_callback,
3854
3673
  uniffi_callback_data,
3855
3674
  uniffi_out_return,
3856
3675
  ):
3857
3676
  uniffi_obj = _UniffiConverterTypeStorage._handle_map.get(uniffi_handle)
3858
3677
  def make_call():
3859
- args = (_UniffiConverterOptionalUInt32.lift(offset), _UniffiConverterOptionalUInt32.lift(limit), )
3678
+ args = (_UniffiConverterTypeListPaymentsRequest.lift(request), )
3860
3679
  method = uniffi_obj.list_payments
3861
3680
  return method(*args)
3862
3681
 
@@ -4564,15 +4383,23 @@ class GetInfoResponse:
4564
4383
  The balance in satoshis
4565
4384
  """
4566
4385
 
4567
- def __init__(self, *, balance_sats: "int"):
4386
+ token_balances: "dict[str, TokenBalance]"
4387
+ """
4388
+ The balances of the tokens in the wallet keyed by the token identifier
4389
+ """
4390
+
4391
+ def __init__(self, *, balance_sats: "int", token_balances: "dict[str, TokenBalance]"):
4568
4392
  self.balance_sats = balance_sats
4393
+ self.token_balances = token_balances
4569
4394
 
4570
4395
  def __str__(self):
4571
- return "GetInfoResponse(balance_sats={})".format(self.balance_sats)
4396
+ return "GetInfoResponse(balance_sats={}, token_balances={})".format(self.balance_sats, self.token_balances)
4572
4397
 
4573
4398
  def __eq__(self, other):
4574
4399
  if self.balance_sats != other.balance_sats:
4575
4400
  return False
4401
+ if self.token_balances != other.token_balances:
4402
+ return False
4576
4403
  return True
4577
4404
 
4578
4405
  class _UniffiConverterTypeGetInfoResponse(_UniffiConverterRustBuffer):
@@ -4580,15 +4407,18 @@ class _UniffiConverterTypeGetInfoResponse(_UniffiConverterRustBuffer):
4580
4407
  def read(buf):
4581
4408
  return GetInfoResponse(
4582
4409
  balance_sats=_UniffiConverterUInt64.read(buf),
4410
+ token_balances=_UniffiConverterMapStringTypeTokenBalance.read(buf),
4583
4411
  )
4584
4412
 
4585
4413
  @staticmethod
4586
4414
  def check_lower(value):
4587
4415
  _UniffiConverterUInt64.check_lower(value.balance_sats)
4416
+ _UniffiConverterMapStringTypeTokenBalance.check_lower(value.token_balances)
4588
4417
 
4589
4418
  @staticmethod
4590
4419
  def write(value, buf):
4591
4420
  _UniffiConverterUInt64.write(value.balance_sats, buf)
4421
+ _UniffiConverterMapStringTypeTokenBalance.write(value.token_balances, buf)
4592
4422
 
4593
4423
 
4594
4424
  class GetPaymentRequest:
@@ -4649,6 +4479,64 @@ class _UniffiConverterTypeGetPaymentResponse(_UniffiConverterRustBuffer):
4649
4479
  _UniffiConverterTypePayment.write(value.payment, buf)
4650
4480
 
4651
4481
 
4482
+ class GetTokensMetadataRequest:
4483
+ token_identifiers: "typing.List[str]"
4484
+ def __init__(self, *, token_identifiers: "typing.List[str]"):
4485
+ self.token_identifiers = token_identifiers
4486
+
4487
+ def __str__(self):
4488
+ return "GetTokensMetadataRequest(token_identifiers={})".format(self.token_identifiers)
4489
+
4490
+ def __eq__(self, other):
4491
+ if self.token_identifiers != other.token_identifiers:
4492
+ return False
4493
+ return True
4494
+
4495
+ class _UniffiConverterTypeGetTokensMetadataRequest(_UniffiConverterRustBuffer):
4496
+ @staticmethod
4497
+ def read(buf):
4498
+ return GetTokensMetadataRequest(
4499
+ token_identifiers=_UniffiConverterSequenceString.read(buf),
4500
+ )
4501
+
4502
+ @staticmethod
4503
+ def check_lower(value):
4504
+ _UniffiConverterSequenceString.check_lower(value.token_identifiers)
4505
+
4506
+ @staticmethod
4507
+ def write(value, buf):
4508
+ _UniffiConverterSequenceString.write(value.token_identifiers, buf)
4509
+
4510
+
4511
+ class GetTokensMetadataResponse:
4512
+ tokens_metadata: "typing.List[TokenMetadata]"
4513
+ def __init__(self, *, tokens_metadata: "typing.List[TokenMetadata]"):
4514
+ self.tokens_metadata = tokens_metadata
4515
+
4516
+ def __str__(self):
4517
+ return "GetTokensMetadataResponse(tokens_metadata={})".format(self.tokens_metadata)
4518
+
4519
+ def __eq__(self, other):
4520
+ if self.tokens_metadata != other.tokens_metadata:
4521
+ return False
4522
+ return True
4523
+
4524
+ class _UniffiConverterTypeGetTokensMetadataResponse(_UniffiConverterRustBuffer):
4525
+ @staticmethod
4526
+ def read(buf):
4527
+ return GetTokensMetadataResponse(
4528
+ tokens_metadata=_UniffiConverterSequenceTypeTokenMetadata.read(buf),
4529
+ )
4530
+
4531
+ @staticmethod
4532
+ def check_lower(value):
4533
+ _UniffiConverterSequenceTypeTokenMetadata.check_lower(value.tokens_metadata)
4534
+
4535
+ @staticmethod
4536
+ def write(value, buf):
4537
+ _UniffiConverterSequenceTypeTokenMetadata.write(value.tokens_metadata, buf)
4538
+
4539
+
4652
4540
  class LightningAddressInfo:
4653
4541
  description: "str"
4654
4542
  lightning_address: "str"
@@ -4775,7 +4663,20 @@ class _UniffiConverterTypeListFiatRatesResponse(_UniffiConverterRustBuffer):
4775
4663
 
4776
4664
  class ListPaymentsRequest:
4777
4665
  """
4778
- Request to list payments with pagination
4666
+ Request to list payments with optional filters and pagination
4667
+ """
4668
+
4669
+ type_filter: "typing.Optional[typing.List[PaymentType]]"
4670
+ status_filter: "typing.Optional[typing.List[PaymentStatus]]"
4671
+ asset_filter: "typing.Optional[AssetFilter]"
4672
+ from_timestamp: "typing.Optional[int]"
4673
+ """
4674
+ Only include payments created after this timestamp (inclusive)
4675
+ """
4676
+
4677
+ to_timestamp: "typing.Optional[int]"
4678
+ """
4679
+ Only include payments created before this timestamp (exclusive)
4779
4680
  """
4780
4681
 
4781
4682
  offset: "typing.Optional[int]"
@@ -4788,7 +4689,28 @@ class ListPaymentsRequest:
4788
4689
  Maximum number of records to return
4789
4690
  """
4790
4691
 
4791
- def __init__(self, *, offset: "typing.Optional[int]" = _DEFAULT, limit: "typing.Optional[int]" = _DEFAULT):
4692
+ sort_ascending: "typing.Optional[bool]"
4693
+ def __init__(self, *, type_filter: "typing.Optional[typing.List[PaymentType]]" = _DEFAULT, status_filter: "typing.Optional[typing.List[PaymentStatus]]" = _DEFAULT, asset_filter: "typing.Optional[AssetFilter]" = _DEFAULT, from_timestamp: "typing.Optional[int]" = _DEFAULT, to_timestamp: "typing.Optional[int]" = _DEFAULT, offset: "typing.Optional[int]" = _DEFAULT, limit: "typing.Optional[int]" = _DEFAULT, sort_ascending: "typing.Optional[bool]" = _DEFAULT):
4694
+ if type_filter is _DEFAULT:
4695
+ self.type_filter = None
4696
+ else:
4697
+ self.type_filter = type_filter
4698
+ if status_filter is _DEFAULT:
4699
+ self.status_filter = None
4700
+ else:
4701
+ self.status_filter = status_filter
4702
+ if asset_filter is _DEFAULT:
4703
+ self.asset_filter = None
4704
+ else:
4705
+ self.asset_filter = asset_filter
4706
+ if from_timestamp is _DEFAULT:
4707
+ self.from_timestamp = None
4708
+ else:
4709
+ self.from_timestamp = from_timestamp
4710
+ if to_timestamp is _DEFAULT:
4711
+ self.to_timestamp = None
4712
+ else:
4713
+ self.to_timestamp = to_timestamp
4792
4714
  if offset is _DEFAULT:
4793
4715
  self.offset = None
4794
4716
  else:
@@ -4797,34 +4719,68 @@ class ListPaymentsRequest:
4797
4719
  self.limit = None
4798
4720
  else:
4799
4721
  self.limit = limit
4722
+ if sort_ascending is _DEFAULT:
4723
+ self.sort_ascending = None
4724
+ else:
4725
+ self.sort_ascending = sort_ascending
4800
4726
 
4801
4727
  def __str__(self):
4802
- return "ListPaymentsRequest(offset={}, limit={})".format(self.offset, self.limit)
4728
+ return "ListPaymentsRequest(type_filter={}, status_filter={}, asset_filter={}, from_timestamp={}, to_timestamp={}, offset={}, limit={}, sort_ascending={})".format(self.type_filter, self.status_filter, self.asset_filter, self.from_timestamp, self.to_timestamp, self.offset, self.limit, self.sort_ascending)
4803
4729
 
4804
4730
  def __eq__(self, other):
4731
+ if self.type_filter != other.type_filter:
4732
+ return False
4733
+ if self.status_filter != other.status_filter:
4734
+ return False
4735
+ if self.asset_filter != other.asset_filter:
4736
+ return False
4737
+ if self.from_timestamp != other.from_timestamp:
4738
+ return False
4739
+ if self.to_timestamp != other.to_timestamp:
4740
+ return False
4805
4741
  if self.offset != other.offset:
4806
4742
  return False
4807
4743
  if self.limit != other.limit:
4808
4744
  return False
4745
+ if self.sort_ascending != other.sort_ascending:
4746
+ return False
4809
4747
  return True
4810
4748
 
4811
4749
  class _UniffiConverterTypeListPaymentsRequest(_UniffiConverterRustBuffer):
4812
4750
  @staticmethod
4813
4751
  def read(buf):
4814
4752
  return ListPaymentsRequest(
4753
+ type_filter=_UniffiConverterOptionalSequenceTypePaymentType.read(buf),
4754
+ status_filter=_UniffiConverterOptionalSequenceTypePaymentStatus.read(buf),
4755
+ asset_filter=_UniffiConverterOptionalTypeAssetFilter.read(buf),
4756
+ from_timestamp=_UniffiConverterOptionalUInt64.read(buf),
4757
+ to_timestamp=_UniffiConverterOptionalUInt64.read(buf),
4815
4758
  offset=_UniffiConverterOptionalUInt32.read(buf),
4816
4759
  limit=_UniffiConverterOptionalUInt32.read(buf),
4760
+ sort_ascending=_UniffiConverterOptionalBool.read(buf),
4817
4761
  )
4818
4762
 
4819
4763
  @staticmethod
4820
4764
  def check_lower(value):
4765
+ _UniffiConverterOptionalSequenceTypePaymentType.check_lower(value.type_filter)
4766
+ _UniffiConverterOptionalSequenceTypePaymentStatus.check_lower(value.status_filter)
4767
+ _UniffiConverterOptionalTypeAssetFilter.check_lower(value.asset_filter)
4768
+ _UniffiConverterOptionalUInt64.check_lower(value.from_timestamp)
4769
+ _UniffiConverterOptionalUInt64.check_lower(value.to_timestamp)
4821
4770
  _UniffiConverterOptionalUInt32.check_lower(value.offset)
4822
4771
  _UniffiConverterOptionalUInt32.check_lower(value.limit)
4772
+ _UniffiConverterOptionalBool.check_lower(value.sort_ascending)
4823
4773
 
4824
4774
  @staticmethod
4825
4775
  def write(value, buf):
4776
+ _UniffiConverterOptionalSequenceTypePaymentType.write(value.type_filter, buf)
4777
+ _UniffiConverterOptionalSequenceTypePaymentStatus.write(value.status_filter, buf)
4778
+ _UniffiConverterOptionalTypeAssetFilter.write(value.asset_filter, buf)
4779
+ _UniffiConverterOptionalUInt64.write(value.from_timestamp, buf)
4780
+ _UniffiConverterOptionalUInt64.write(value.to_timestamp, buf)
4826
4781
  _UniffiConverterOptionalUInt32.write(value.offset, buf)
4827
4782
  _UniffiConverterOptionalUInt32.write(value.limit, buf)
4783
+ _UniffiConverterOptionalBool.write(value.sort_ascending, buf)
4828
4784
 
4829
4785
 
4830
4786
  class ListPaymentsResponse:
@@ -5105,12 +5061,12 @@ class Payment:
5105
5061
  Status of the payment
5106
5062
  """
5107
5063
 
5108
- amount: "int"
5064
+ amount: "U128"
5109
5065
  """
5110
5066
  Amount in satoshis
5111
5067
  """
5112
5068
 
5113
- fees: "int"
5069
+ fees: "U128"
5114
5070
  """
5115
5071
  Fee paid in satoshis
5116
5072
  """
@@ -5131,7 +5087,7 @@ class Payment:
5131
5087
  Details of the payment
5132
5088
  """
5133
5089
 
5134
- def __init__(self, *, id: "str", payment_type: "PaymentType", status: "PaymentStatus", amount: "int", fees: "int", timestamp: "int", method: "PaymentMethod", details: "typing.Optional[PaymentDetails]"):
5090
+ def __init__(self, *, id: "str", payment_type: "PaymentType", status: "PaymentStatus", amount: "U128", fees: "U128", timestamp: "int", method: "PaymentMethod", details: "typing.Optional[PaymentDetails]"):
5135
5091
  self.id = id
5136
5092
  self.payment_type = payment_type
5137
5093
  self.status = status
@@ -5170,8 +5126,8 @@ class _UniffiConverterTypePayment(_UniffiConverterRustBuffer):
5170
5126
  id=_UniffiConverterString.read(buf),
5171
5127
  payment_type=_UniffiConverterTypePaymentType.read(buf),
5172
5128
  status=_UniffiConverterTypePaymentStatus.read(buf),
5173
- amount=_UniffiConverterUInt64.read(buf),
5174
- fees=_UniffiConverterUInt64.read(buf),
5129
+ amount=_UniffiConverterTypeU128.read(buf),
5130
+ fees=_UniffiConverterTypeU128.read(buf),
5175
5131
  timestamp=_UniffiConverterUInt64.read(buf),
5176
5132
  method=_UniffiConverterTypePaymentMethod.read(buf),
5177
5133
  details=_UniffiConverterOptionalTypePaymentDetails.read(buf),
@@ -5182,8 +5138,8 @@ class _UniffiConverterTypePayment(_UniffiConverterRustBuffer):
5182
5138
  _UniffiConverterString.check_lower(value.id)
5183
5139
  _UniffiConverterTypePaymentType.check_lower(value.payment_type)
5184
5140
  _UniffiConverterTypePaymentStatus.check_lower(value.status)
5185
- _UniffiConverterUInt64.check_lower(value.amount)
5186
- _UniffiConverterUInt64.check_lower(value.fees)
5141
+ _UniffiConverterTypeU128.check_lower(value.amount)
5142
+ _UniffiConverterTypeU128.check_lower(value.fees)
5187
5143
  _UniffiConverterUInt64.check_lower(value.timestamp)
5188
5144
  _UniffiConverterTypePaymentMethod.check_lower(value.method)
5189
5145
  _UniffiConverterOptionalTypePaymentDetails.check_lower(value.details)
@@ -5193,8 +5149,8 @@ class _UniffiConverterTypePayment(_UniffiConverterRustBuffer):
5193
5149
  _UniffiConverterString.write(value.id, buf)
5194
5150
  _UniffiConverterTypePaymentType.write(value.payment_type, buf)
5195
5151
  _UniffiConverterTypePaymentStatus.write(value.status, buf)
5196
- _UniffiConverterUInt64.write(value.amount, buf)
5197
- _UniffiConverterUInt64.write(value.fees, buf)
5152
+ _UniffiConverterTypeU128.write(value.amount, buf)
5153
+ _UniffiConverterTypeU128.write(value.fees, buf)
5198
5154
  _UniffiConverterUInt64.write(value.timestamp, buf)
5199
5155
  _UniffiConverterTypePaymentMethod.write(value.method, buf)
5200
5156
  _UniffiConverterOptionalTypePaymentDetails.write(value.details, buf)
@@ -5362,21 +5318,38 @@ class _UniffiConverterTypePrepareLnurlPayResponse(_UniffiConverterRustBuffer):
5362
5318
 
5363
5319
  class PrepareSendPaymentRequest:
5364
5320
  payment_request: "str"
5365
- amount_sats: "typing.Optional[int]"
5366
- def __init__(self, *, payment_request: "str", amount_sats: "typing.Optional[int]" = _DEFAULT):
5367
- self.payment_request = payment_request
5368
- if amount_sats is _DEFAULT:
5369
- self.amount_sats = None
5370
- else:
5371
- self.amount_sats = amount_sats
5321
+ amount: "typing.Optional[U128]"
5322
+ """
5323
+ Amount to send. By default is denominated in sats.
5324
+ If a token identifier is provided, the amount will be denominated in the token base units.
5325
+ """
5326
+
5327
+ token_identifier: "typing.Optional[str]"
5328
+ """
5329
+ If provided, the payment will be for a token
5330
+ May only be provided if the payment request is a spark address
5331
+ """
5332
+
5333
+ def __init__(self, *, payment_request: "str", amount: "typing.Optional[U128]" = _DEFAULT, token_identifier: "typing.Optional[str]" = _DEFAULT):
5334
+ self.payment_request = payment_request
5335
+ if amount is _DEFAULT:
5336
+ self.amount = None
5337
+ else:
5338
+ self.amount = amount
5339
+ if token_identifier is _DEFAULT:
5340
+ self.token_identifier = None
5341
+ else:
5342
+ self.token_identifier = token_identifier
5372
5343
 
5373
5344
  def __str__(self):
5374
- return "PrepareSendPaymentRequest(payment_request={}, amount_sats={})".format(self.payment_request, self.amount_sats)
5345
+ return "PrepareSendPaymentRequest(payment_request={}, amount={}, token_identifier={})".format(self.payment_request, self.amount, self.token_identifier)
5375
5346
 
5376
5347
  def __eq__(self, other):
5377
5348
  if self.payment_request != other.payment_request:
5378
5349
  return False
5379
- if self.amount_sats != other.amount_sats:
5350
+ if self.amount != other.amount:
5351
+ return False
5352
+ if self.token_identifier != other.token_identifier:
5380
5353
  return False
5381
5354
  return True
5382
5355
 
@@ -5385,34 +5358,51 @@ class _UniffiConverterTypePrepareSendPaymentRequest(_UniffiConverterRustBuffer):
5385
5358
  def read(buf):
5386
5359
  return PrepareSendPaymentRequest(
5387
5360
  payment_request=_UniffiConverterString.read(buf),
5388
- amount_sats=_UniffiConverterOptionalUInt64.read(buf),
5361
+ amount=_UniffiConverterOptionalTypeU128.read(buf),
5362
+ token_identifier=_UniffiConverterOptionalString.read(buf),
5389
5363
  )
5390
5364
 
5391
5365
  @staticmethod
5392
5366
  def check_lower(value):
5393
5367
  _UniffiConverterString.check_lower(value.payment_request)
5394
- _UniffiConverterOptionalUInt64.check_lower(value.amount_sats)
5368
+ _UniffiConverterOptionalTypeU128.check_lower(value.amount)
5369
+ _UniffiConverterOptionalString.check_lower(value.token_identifier)
5395
5370
 
5396
5371
  @staticmethod
5397
5372
  def write(value, buf):
5398
5373
  _UniffiConverterString.write(value.payment_request, buf)
5399
- _UniffiConverterOptionalUInt64.write(value.amount_sats, buf)
5374
+ _UniffiConverterOptionalTypeU128.write(value.amount, buf)
5375
+ _UniffiConverterOptionalString.write(value.token_identifier, buf)
5400
5376
 
5401
5377
 
5402
5378
  class PrepareSendPaymentResponse:
5403
5379
  payment_method: "SendPaymentMethod"
5404
- amount_sats: "int"
5405
- def __init__(self, *, payment_method: "SendPaymentMethod", amount_sats: "int"):
5380
+ amount: "U128"
5381
+ """
5382
+ Amount to send. By default is denominated in sats.
5383
+ If a token identifier is provided, the amount will be denominated in the token base units.
5384
+ """
5385
+
5386
+ token_identifier: "typing.Optional[str]"
5387
+ """
5388
+ The presence of this field indicates that the payment is for a token
5389
+ If empty, it is a Bitcoin payment
5390
+ """
5391
+
5392
+ def __init__(self, *, payment_method: "SendPaymentMethod", amount: "U128", token_identifier: "typing.Optional[str]"):
5406
5393
  self.payment_method = payment_method
5407
- self.amount_sats = amount_sats
5394
+ self.amount = amount
5395
+ self.token_identifier = token_identifier
5408
5396
 
5409
5397
  def __str__(self):
5410
- return "PrepareSendPaymentResponse(payment_method={}, amount_sats={})".format(self.payment_method, self.amount_sats)
5398
+ return "PrepareSendPaymentResponse(payment_method={}, amount={}, token_identifier={})".format(self.payment_method, self.amount, self.token_identifier)
5411
5399
 
5412
5400
  def __eq__(self, other):
5413
5401
  if self.payment_method != other.payment_method:
5414
5402
  return False
5415
- if self.amount_sats != other.amount_sats:
5403
+ if self.amount != other.amount:
5404
+ return False
5405
+ if self.token_identifier != other.token_identifier:
5416
5406
  return False
5417
5407
  return True
5418
5408
 
@@ -5421,18 +5411,21 @@ class _UniffiConverterTypePrepareSendPaymentResponse(_UniffiConverterRustBuffer)
5421
5411
  def read(buf):
5422
5412
  return PrepareSendPaymentResponse(
5423
5413
  payment_method=_UniffiConverterTypeSendPaymentMethod.read(buf),
5424
- amount_sats=_UniffiConverterUInt64.read(buf),
5414
+ amount=_UniffiConverterTypeU128.read(buf),
5415
+ token_identifier=_UniffiConverterOptionalString.read(buf),
5425
5416
  )
5426
5417
 
5427
5418
  @staticmethod
5428
5419
  def check_lower(value):
5429
5420
  _UniffiConverterTypeSendPaymentMethod.check_lower(value.payment_method)
5430
- _UniffiConverterUInt64.check_lower(value.amount_sats)
5421
+ _UniffiConverterTypeU128.check_lower(value.amount)
5422
+ _UniffiConverterOptionalString.check_lower(value.token_identifier)
5431
5423
 
5432
5424
  @staticmethod
5433
5425
  def write(value, buf):
5434
5426
  _UniffiConverterTypeSendPaymentMethod.write(value.payment_method, buf)
5435
- _UniffiConverterUInt64.write(value.amount_sats, buf)
5427
+ _UniffiConverterTypeU128.write(value.amount, buf)
5428
+ _UniffiConverterOptionalString.write(value.token_identifier, buf)
5436
5429
 
5437
5430
 
5438
5431
  class ReceivePaymentRequest:
@@ -5840,6 +5833,121 @@ class _UniffiConverterTypeSyncWalletResponse(_UniffiConverterRustBuffer):
5840
5833
  pass
5841
5834
 
5842
5835
 
5836
+ class TokenBalance:
5837
+ balance: "U128"
5838
+ token_metadata: "TokenMetadata"
5839
+ def __init__(self, *, balance: "U128", token_metadata: "TokenMetadata"):
5840
+ self.balance = balance
5841
+ self.token_metadata = token_metadata
5842
+
5843
+ def __str__(self):
5844
+ return "TokenBalance(balance={}, token_metadata={})".format(self.balance, self.token_metadata)
5845
+
5846
+ def __eq__(self, other):
5847
+ if self.balance != other.balance:
5848
+ return False
5849
+ if self.token_metadata != other.token_metadata:
5850
+ return False
5851
+ return True
5852
+
5853
+ class _UniffiConverterTypeTokenBalance(_UniffiConverterRustBuffer):
5854
+ @staticmethod
5855
+ def read(buf):
5856
+ return TokenBalance(
5857
+ balance=_UniffiConverterTypeU128.read(buf),
5858
+ token_metadata=_UniffiConverterTypeTokenMetadata.read(buf),
5859
+ )
5860
+
5861
+ @staticmethod
5862
+ def check_lower(value):
5863
+ _UniffiConverterTypeU128.check_lower(value.balance)
5864
+ _UniffiConverterTypeTokenMetadata.check_lower(value.token_metadata)
5865
+
5866
+ @staticmethod
5867
+ def write(value, buf):
5868
+ _UniffiConverterTypeU128.write(value.balance, buf)
5869
+ _UniffiConverterTypeTokenMetadata.write(value.token_metadata, buf)
5870
+
5871
+
5872
+ class TokenMetadata:
5873
+ identifier: "str"
5874
+ issuer_public_key: "str"
5875
+ """
5876
+ Hex representation of the issuer public key
5877
+ """
5878
+
5879
+ name: "str"
5880
+ ticker: "str"
5881
+ decimals: "int"
5882
+ """
5883
+ Number of decimals the token uses
5884
+ """
5885
+
5886
+ max_supply: "U128"
5887
+ is_freezable: "bool"
5888
+ def __init__(self, *, identifier: "str", issuer_public_key: "str", name: "str", ticker: "str", decimals: "int", max_supply: "U128", is_freezable: "bool"):
5889
+ self.identifier = identifier
5890
+ self.issuer_public_key = issuer_public_key
5891
+ self.name = name
5892
+ self.ticker = ticker
5893
+ self.decimals = decimals
5894
+ self.max_supply = max_supply
5895
+ self.is_freezable = is_freezable
5896
+
5897
+ def __str__(self):
5898
+ return "TokenMetadata(identifier={}, issuer_public_key={}, name={}, ticker={}, decimals={}, max_supply={}, is_freezable={})".format(self.identifier, self.issuer_public_key, self.name, self.ticker, self.decimals, self.max_supply, self.is_freezable)
5899
+
5900
+ def __eq__(self, other):
5901
+ if self.identifier != other.identifier:
5902
+ return False
5903
+ if self.issuer_public_key != other.issuer_public_key:
5904
+ return False
5905
+ if self.name != other.name:
5906
+ return False
5907
+ if self.ticker != other.ticker:
5908
+ return False
5909
+ if self.decimals != other.decimals:
5910
+ return False
5911
+ if self.max_supply != other.max_supply:
5912
+ return False
5913
+ if self.is_freezable != other.is_freezable:
5914
+ return False
5915
+ return True
5916
+
5917
+ class _UniffiConverterTypeTokenMetadata(_UniffiConverterRustBuffer):
5918
+ @staticmethod
5919
+ def read(buf):
5920
+ return TokenMetadata(
5921
+ identifier=_UniffiConverterString.read(buf),
5922
+ issuer_public_key=_UniffiConverterString.read(buf),
5923
+ name=_UniffiConverterString.read(buf),
5924
+ ticker=_UniffiConverterString.read(buf),
5925
+ decimals=_UniffiConverterUInt32.read(buf),
5926
+ max_supply=_UniffiConverterTypeU128.read(buf),
5927
+ is_freezable=_UniffiConverterBool.read(buf),
5928
+ )
5929
+
5930
+ @staticmethod
5931
+ def check_lower(value):
5932
+ _UniffiConverterString.check_lower(value.identifier)
5933
+ _UniffiConverterString.check_lower(value.issuer_public_key)
5934
+ _UniffiConverterString.check_lower(value.name)
5935
+ _UniffiConverterString.check_lower(value.ticker)
5936
+ _UniffiConverterUInt32.check_lower(value.decimals)
5937
+ _UniffiConverterTypeU128.check_lower(value.max_supply)
5938
+ _UniffiConverterBool.check_lower(value.is_freezable)
5939
+
5940
+ @staticmethod
5941
+ def write(value, buf):
5942
+ _UniffiConverterString.write(value.identifier, buf)
5943
+ _UniffiConverterString.write(value.issuer_public_key, buf)
5944
+ _UniffiConverterString.write(value.name, buf)
5945
+ _UniffiConverterString.write(value.ticker, buf)
5946
+ _UniffiConverterUInt32.write(value.decimals, buf)
5947
+ _UniffiConverterTypeU128.write(value.max_supply, buf)
5948
+ _UniffiConverterBool.write(value.is_freezable, buf)
5949
+
5950
+
5843
5951
  class TxStatus:
5844
5952
  confirmed: "bool"
5845
5953
  block_height: "typing.Optional[int]"
@@ -5991,6 +6099,103 @@ class _UniffiConverterTypeWaitForPaymentResponse(_UniffiConverterRustBuffer):
5991
6099
  _UniffiConverterTypePayment.write(value.payment, buf)
5992
6100
 
5993
6101
 
6102
+
6103
+
6104
+
6105
+ class AssetFilter:
6106
+ """
6107
+ A field of [`ListPaymentsRequest`] when listing payments filtered by asset
6108
+ """
6109
+
6110
+ def __init__(self):
6111
+ raise RuntimeError("AssetFilter cannot be instantiated directly")
6112
+
6113
+ # Each enum variant is a nested class of the enum itself.
6114
+ class BITCOIN:
6115
+
6116
+ def __init__(self,):
6117
+ pass
6118
+
6119
+ def __str__(self):
6120
+ return "AssetFilter.BITCOIN()".format()
6121
+
6122
+ def __eq__(self, other):
6123
+ if not other.is_bitcoin():
6124
+ return False
6125
+ return True
6126
+
6127
+ class TOKEN:
6128
+ token_identifier: "typing.Optional[str]"
6129
+ """
6130
+ Optional token identifier to filter by
6131
+ """
6132
+
6133
+
6134
+ def __init__(self,token_identifier: "typing.Optional[str]"):
6135
+ self.token_identifier = token_identifier
6136
+
6137
+ def __str__(self):
6138
+ return "AssetFilter.TOKEN(token_identifier={})".format(self.token_identifier)
6139
+
6140
+ def __eq__(self, other):
6141
+ if not other.is_token():
6142
+ return False
6143
+ if self.token_identifier != other.token_identifier:
6144
+ return False
6145
+ return True
6146
+
6147
+
6148
+
6149
+ # For each variant, we have an `is_NAME` method for easily checking
6150
+ # whether an instance is that variant.
6151
+ def is_bitcoin(self) -> bool:
6152
+ return isinstance(self, AssetFilter.BITCOIN)
6153
+ def is_token(self) -> bool:
6154
+ return isinstance(self, AssetFilter.TOKEN)
6155
+
6156
+
6157
+ # Now, a little trick - we make each nested variant class be a subclass of the main
6158
+ # enum class, so that method calls and instance checks etc will work intuitively.
6159
+ # We might be able to do this a little more neatly with a metaclass, but this'll do.
6160
+ AssetFilter.BITCOIN = type("AssetFilter.BITCOIN", (AssetFilter.BITCOIN, AssetFilter,), {}) # type: ignore
6161
+ AssetFilter.TOKEN = type("AssetFilter.TOKEN", (AssetFilter.TOKEN, AssetFilter,), {}) # type: ignore
6162
+
6163
+
6164
+
6165
+
6166
+ class _UniffiConverterTypeAssetFilter(_UniffiConverterRustBuffer):
6167
+ @staticmethod
6168
+ def read(buf):
6169
+ variant = buf.read_i32()
6170
+ if variant == 1:
6171
+ return AssetFilter.BITCOIN(
6172
+ )
6173
+ if variant == 2:
6174
+ return AssetFilter.TOKEN(
6175
+ _UniffiConverterOptionalString.read(buf),
6176
+ )
6177
+ raise InternalError("Raw enum value doesn't match any cases")
6178
+
6179
+ @staticmethod
6180
+ def check_lower(value):
6181
+ if value.is_bitcoin():
6182
+ return
6183
+ if value.is_token():
6184
+ _UniffiConverterOptionalString.check_lower(value.token_identifier)
6185
+ return
6186
+ raise ValueError(value)
6187
+
6188
+ @staticmethod
6189
+ def write(value, buf):
6190
+ if value.is_bitcoin():
6191
+ buf.write_i32(1)
6192
+ if value.is_token():
6193
+ buf.write_i32(2)
6194
+ _UniffiConverterOptionalString.write(value.token_identifier, buf)
6195
+
6196
+
6197
+
6198
+
5994
6199
  # ChainServiceError
5995
6200
  # We want to define each variant as a nested class that's also a subclass,
5996
6201
  # which is tricky in Python. To accomplish this we're going to create each
@@ -6510,6 +6715,26 @@ class PaymentDetails:
6510
6715
  return False
6511
6716
  return True
6512
6717
 
6718
+ class TOKEN:
6719
+ metadata: "TokenMetadata"
6720
+ tx_hash: "str"
6721
+
6722
+ def __init__(self,metadata: "TokenMetadata", tx_hash: "str"):
6723
+ self.metadata = metadata
6724
+ self.tx_hash = tx_hash
6725
+
6726
+ def __str__(self):
6727
+ return "PaymentDetails.TOKEN(metadata={}, tx_hash={})".format(self.metadata, self.tx_hash)
6728
+
6729
+ def __eq__(self, other):
6730
+ if not other.is_token():
6731
+ return False
6732
+ if self.metadata != other.metadata:
6733
+ return False
6734
+ if self.tx_hash != other.tx_hash:
6735
+ return False
6736
+ return True
6737
+
6513
6738
  class LIGHTNING:
6514
6739
  description: "typing.Optional[str]"
6515
6740
  """
@@ -6610,6 +6835,8 @@ class PaymentDetails:
6610
6835
  # whether an instance is that variant.
6611
6836
  def is_spark(self) -> bool:
6612
6837
  return isinstance(self, PaymentDetails.SPARK)
6838
+ def is_token(self) -> bool:
6839
+ return isinstance(self, PaymentDetails.TOKEN)
6613
6840
  def is_lightning(self) -> bool:
6614
6841
  return isinstance(self, PaymentDetails.LIGHTNING)
6615
6842
  def is_withdraw(self) -> bool:
@@ -6622,6 +6849,7 @@ class PaymentDetails:
6622
6849
  # enum class, so that method calls and instance checks etc will work intuitively.
6623
6850
  # We might be able to do this a little more neatly with a metaclass, but this'll do.
6624
6851
  PaymentDetails.SPARK = type("PaymentDetails.SPARK", (PaymentDetails.SPARK, PaymentDetails,), {}) # type: ignore
6852
+ PaymentDetails.TOKEN = type("PaymentDetails.TOKEN", (PaymentDetails.TOKEN, PaymentDetails,), {}) # type: ignore
6625
6853
  PaymentDetails.LIGHTNING = type("PaymentDetails.LIGHTNING", (PaymentDetails.LIGHTNING, PaymentDetails,), {}) # type: ignore
6626
6854
  PaymentDetails.WITHDRAW = type("PaymentDetails.WITHDRAW", (PaymentDetails.WITHDRAW, PaymentDetails,), {}) # type: ignore
6627
6855
  PaymentDetails.DEPOSIT = type("PaymentDetails.DEPOSIT", (PaymentDetails.DEPOSIT, PaymentDetails,), {}) # type: ignore
@@ -6637,6 +6865,11 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6637
6865
  return PaymentDetails.SPARK(
6638
6866
  )
6639
6867
  if variant == 2:
6868
+ return PaymentDetails.TOKEN(
6869
+ _UniffiConverterTypeTokenMetadata.read(buf),
6870
+ _UniffiConverterString.read(buf),
6871
+ )
6872
+ if variant == 3:
6640
6873
  return PaymentDetails.LIGHTNING(
6641
6874
  _UniffiConverterOptionalString.read(buf),
6642
6875
  _UniffiConverterOptionalString.read(buf),
@@ -6645,11 +6878,11 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6645
6878
  _UniffiConverterString.read(buf),
6646
6879
  _UniffiConverterOptionalTypeLnurlPayInfo.read(buf),
6647
6880
  )
6648
- if variant == 3:
6881
+ if variant == 4:
6649
6882
  return PaymentDetails.WITHDRAW(
6650
6883
  _UniffiConverterString.read(buf),
6651
6884
  )
6652
- if variant == 4:
6885
+ if variant == 5:
6653
6886
  return PaymentDetails.DEPOSIT(
6654
6887
  _UniffiConverterString.read(buf),
6655
6888
  )
@@ -6659,6 +6892,10 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6659
6892
  def check_lower(value):
6660
6893
  if value.is_spark():
6661
6894
  return
6895
+ if value.is_token():
6896
+ _UniffiConverterTypeTokenMetadata.check_lower(value.metadata)
6897
+ _UniffiConverterString.check_lower(value.tx_hash)
6898
+ return
6662
6899
  if value.is_lightning():
6663
6900
  _UniffiConverterOptionalString.check_lower(value.description)
6664
6901
  _UniffiConverterOptionalString.check_lower(value.preimage)
@@ -6679,8 +6916,12 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6679
6916
  def write(value, buf):
6680
6917
  if value.is_spark():
6681
6918
  buf.write_i32(1)
6682
- if value.is_lightning():
6919
+ if value.is_token():
6683
6920
  buf.write_i32(2)
6921
+ _UniffiConverterTypeTokenMetadata.write(value.metadata, buf)
6922
+ _UniffiConverterString.write(value.tx_hash, buf)
6923
+ if value.is_lightning():
6924
+ buf.write_i32(3)
6684
6925
  _UniffiConverterOptionalString.write(value.description, buf)
6685
6926
  _UniffiConverterOptionalString.write(value.preimage, buf)
6686
6927
  _UniffiConverterString.write(value.invoice, buf)
@@ -6688,10 +6929,10 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
6688
6929
  _UniffiConverterString.write(value.destination_pubkey, buf)
6689
6930
  _UniffiConverterOptionalTypeLnurlPayInfo.write(value.lnurl_pay_info, buf)
6690
6931
  if value.is_withdraw():
6691
- buf.write_i32(3)
6932
+ buf.write_i32(4)
6692
6933
  _UniffiConverterString.write(value.tx_id, buf)
6693
6934
  if value.is_deposit():
6694
- buf.write_i32(4)
6935
+ buf.write_i32(5)
6695
6936
  _UniffiConverterString.write(value.tx_id, buf)
6696
6937
 
6697
6938
 
@@ -6705,11 +6946,13 @@ class PaymentMethod(enum.Enum):
6705
6946
 
6706
6947
  SPARK = 1
6707
6948
 
6708
- DEPOSIT = 2
6949
+ TOKEN = 2
6950
+
6951
+ DEPOSIT = 3
6709
6952
 
6710
- WITHDRAW = 3
6953
+ WITHDRAW = 4
6711
6954
 
6712
- UNKNOWN = 4
6955
+ UNKNOWN = 5
6713
6956
 
6714
6957
 
6715
6958
 
@@ -6722,10 +6965,12 @@ class _UniffiConverterTypePaymentMethod(_UniffiConverterRustBuffer):
6722
6965
  if variant == 2:
6723
6966
  return PaymentMethod.SPARK
6724
6967
  if variant == 3:
6725
- return PaymentMethod.DEPOSIT
6968
+ return PaymentMethod.TOKEN
6726
6969
  if variant == 4:
6727
- return PaymentMethod.WITHDRAW
6970
+ return PaymentMethod.DEPOSIT
6728
6971
  if variant == 5:
6972
+ return PaymentMethod.WITHDRAW
6973
+ if variant == 6:
6729
6974
  return PaymentMethod.UNKNOWN
6730
6975
  raise InternalError("Raw enum value doesn't match any cases")
6731
6976
 
@@ -6735,6 +6980,8 @@ class _UniffiConverterTypePaymentMethod(_UniffiConverterRustBuffer):
6735
6980
  return
6736
6981
  if value == PaymentMethod.SPARK:
6737
6982
  return
6983
+ if value == PaymentMethod.TOKEN:
6984
+ return
6738
6985
  if value == PaymentMethod.DEPOSIT:
6739
6986
  return
6740
6987
  if value == PaymentMethod.WITHDRAW:
@@ -6749,12 +6996,14 @@ class _UniffiConverterTypePaymentMethod(_UniffiConverterRustBuffer):
6749
6996
  buf.write_i32(1)
6750
6997
  if value == PaymentMethod.SPARK:
6751
6998
  buf.write_i32(2)
6752
- if value == PaymentMethod.DEPOSIT:
6999
+ if value == PaymentMethod.TOKEN:
6753
7000
  buf.write_i32(3)
6754
- if value == PaymentMethod.WITHDRAW:
7001
+ if value == PaymentMethod.DEPOSIT:
6755
7002
  buf.write_i32(4)
6756
- if value == PaymentMethod.UNKNOWN:
7003
+ if value == PaymentMethod.WITHDRAW:
6757
7004
  buf.write_i32(5)
7005
+ if value == PaymentMethod.UNKNOWN:
7006
+ buf.write_i32(6)
6758
7007
 
6759
7008
 
6760
7009
 
@@ -7667,21 +7916,35 @@ class SendPaymentMethod:
7667
7916
 
7668
7917
  class SPARK_ADDRESS:
7669
7918
  address: "str"
7670
- fee_sats: "int"
7919
+ fee: "U128"
7920
+ """
7921
+ Fee to pay for the transaction
7922
+ Denominated in sats if token identifier is empty, otherwise in the token base units
7923
+ """
7671
7924
 
7672
- def __init__(self,address: "str", fee_sats: "int"):
7925
+ token_identifier: "typing.Optional[str]"
7926
+ """
7927
+ The presence of this field indicates that the payment is for a token
7928
+ If empty, it is a Bitcoin payment
7929
+ """
7930
+
7931
+
7932
+ def __init__(self,address: "str", fee: "U128", token_identifier: "typing.Optional[str]"):
7673
7933
  self.address = address
7674
- self.fee_sats = fee_sats
7934
+ self.fee = fee
7935
+ self.token_identifier = token_identifier
7675
7936
 
7676
7937
  def __str__(self):
7677
- return "SendPaymentMethod.SPARK_ADDRESS(address={}, fee_sats={})".format(self.address, self.fee_sats)
7938
+ return "SendPaymentMethod.SPARK_ADDRESS(address={}, fee={}, token_identifier={})".format(self.address, self.fee, self.token_identifier)
7678
7939
 
7679
7940
  def __eq__(self, other):
7680
7941
  if not other.is_spark_address():
7681
7942
  return False
7682
7943
  if self.address != other.address:
7683
7944
  return False
7684
- if self.fee_sats != other.fee_sats:
7945
+ if self.fee != other.fee:
7946
+ return False
7947
+ if self.token_identifier != other.token_identifier:
7685
7948
  return False
7686
7949
  return True
7687
7950
 
@@ -7725,7 +7988,8 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
7725
7988
  if variant == 3:
7726
7989
  return SendPaymentMethod.SPARK_ADDRESS(
7727
7990
  _UniffiConverterString.read(buf),
7728
- _UniffiConverterUInt64.read(buf),
7991
+ _UniffiConverterTypeU128.read(buf),
7992
+ _UniffiConverterOptionalString.read(buf),
7729
7993
  )
7730
7994
  raise InternalError("Raw enum value doesn't match any cases")
7731
7995
 
@@ -7742,7 +8006,8 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
7742
8006
  return
7743
8007
  if value.is_spark_address():
7744
8008
  _UniffiConverterString.check_lower(value.address)
7745
- _UniffiConverterUInt64.check_lower(value.fee_sats)
8009
+ _UniffiConverterTypeU128.check_lower(value.fee)
8010
+ _UniffiConverterOptionalString.check_lower(value.token_identifier)
7746
8011
  return
7747
8012
  raise ValueError(value)
7748
8013
 
@@ -7760,7 +8025,8 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
7760
8025
  if value.is_spark_address():
7761
8026
  buf.write_i32(3)
7762
8027
  _UniffiConverterString.write(value.address, buf)
7763
- _UniffiConverterUInt64.write(value.fee_sats, buf)
8028
+ _UniffiConverterTypeU128.write(value.fee, buf)
8029
+ _UniffiConverterOptionalString.write(value.token_identifier, buf)
7764
8030
 
7765
8031
 
7766
8032
 
@@ -8522,6 +8788,33 @@ class _UniffiConverterOptionalTypePayment(_UniffiConverterRustBuffer):
8522
8788
 
8523
8789
 
8524
8790
 
8791
+ class _UniffiConverterOptionalTypeAssetFilter(_UniffiConverterRustBuffer):
8792
+ @classmethod
8793
+ def check_lower(cls, value):
8794
+ if value is not None:
8795
+ _UniffiConverterTypeAssetFilter.check_lower(value)
8796
+
8797
+ @classmethod
8798
+ def write(cls, value, buf):
8799
+ if value is None:
8800
+ buf.write_u8(0)
8801
+ return
8802
+
8803
+ buf.write_u8(1)
8804
+ _UniffiConverterTypeAssetFilter.write(value, buf)
8805
+
8806
+ @classmethod
8807
+ def read(cls, buf):
8808
+ flag = buf.read_u8()
8809
+ if flag == 0:
8810
+ return None
8811
+ elif flag == 1:
8812
+ return _UniffiConverterTypeAssetFilter.read(buf)
8813
+ else:
8814
+ raise InternalError("Unexpected flag byte for optional type")
8815
+
8816
+
8817
+
8525
8818
  class _UniffiConverterOptionalTypeDepositClaimError(_UniffiConverterRustBuffer):
8526
8819
  @classmethod
8527
8820
  def check_lower(cls, value):
@@ -8657,6 +8950,60 @@ class _UniffiConverterOptionalTypeLogger(_UniffiConverterRustBuffer):
8657
8950
 
8658
8951
 
8659
8952
 
8953
+ class _UniffiConverterOptionalSequenceTypePaymentStatus(_UniffiConverterRustBuffer):
8954
+ @classmethod
8955
+ def check_lower(cls, value):
8956
+ if value is not None:
8957
+ _UniffiConverterSequenceTypePaymentStatus.check_lower(value)
8958
+
8959
+ @classmethod
8960
+ def write(cls, value, buf):
8961
+ if value is None:
8962
+ buf.write_u8(0)
8963
+ return
8964
+
8965
+ buf.write_u8(1)
8966
+ _UniffiConverterSequenceTypePaymentStatus.write(value, buf)
8967
+
8968
+ @classmethod
8969
+ def read(cls, buf):
8970
+ flag = buf.read_u8()
8971
+ if flag == 0:
8972
+ return None
8973
+ elif flag == 1:
8974
+ return _UniffiConverterSequenceTypePaymentStatus.read(buf)
8975
+ else:
8976
+ raise InternalError("Unexpected flag byte for optional type")
8977
+
8978
+
8979
+
8980
+ class _UniffiConverterOptionalSequenceTypePaymentType(_UniffiConverterRustBuffer):
8981
+ @classmethod
8982
+ def check_lower(cls, value):
8983
+ if value is not None:
8984
+ _UniffiConverterSequenceTypePaymentType.check_lower(value)
8985
+
8986
+ @classmethod
8987
+ def write(cls, value, buf):
8988
+ if value is None:
8989
+ buf.write_u8(0)
8990
+ return
8991
+
8992
+ buf.write_u8(1)
8993
+ _UniffiConverterSequenceTypePaymentType.write(value, buf)
8994
+
8995
+ @classmethod
8996
+ def read(cls, buf):
8997
+ flag = buf.read_u8()
8998
+ if flag == 0:
8999
+ return None
9000
+ elif flag == 1:
9001
+ return _UniffiConverterSequenceTypePaymentType.read(buf)
9002
+ else:
9003
+ raise InternalError("Unexpected flag byte for optional type")
9004
+
9005
+
9006
+
8660
9007
  class _UniffiConverterOptionalTypeSuccessAction(_UniffiConverterRustBuffer):
8661
9008
  @classmethod
8662
9009
  def check_lower(cls, value):
@@ -8711,6 +9058,58 @@ class _UniffiConverterOptionalTypeSuccessActionProcessed(_UniffiConverterRustBuf
8711
9058
 
8712
9059
 
8713
9060
 
9061
+ class _UniffiConverterOptionalTypeU128(_UniffiConverterRustBuffer):
9062
+ @classmethod
9063
+ def check_lower(cls, value):
9064
+ if value is not None:
9065
+ _UniffiConverterTypeU128.check_lower(value)
9066
+
9067
+ @classmethod
9068
+ def write(cls, value, buf):
9069
+ if value is None:
9070
+ buf.write_u8(0)
9071
+ return
9072
+
9073
+ buf.write_u8(1)
9074
+ _UniffiConverterTypeU128.write(value, buf)
9075
+
9076
+ @classmethod
9077
+ def read(cls, buf):
9078
+ flag = buf.read_u8()
9079
+ if flag == 0:
9080
+ return None
9081
+ elif flag == 1:
9082
+ return _UniffiConverterTypeU128.read(buf)
9083
+ else:
9084
+ raise InternalError("Unexpected flag byte for optional type")
9085
+
9086
+
9087
+
9088
+ class _UniffiConverterSequenceString(_UniffiConverterRustBuffer):
9089
+ @classmethod
9090
+ def check_lower(cls, value):
9091
+ for item in value:
9092
+ _UniffiConverterString.check_lower(item)
9093
+
9094
+ @classmethod
9095
+ def write(cls, value, buf):
9096
+ items = len(value)
9097
+ buf.write_i32(items)
9098
+ for item in value:
9099
+ _UniffiConverterString.write(item, buf)
9100
+
9101
+ @classmethod
9102
+ def read(cls, buf):
9103
+ count = buf.read_i32()
9104
+ if count < 0:
9105
+ raise InternalError("Unexpected negative sequence length")
9106
+
9107
+ return [
9108
+ _UniffiConverterString.read(buf) for i in range(count)
9109
+ ]
9110
+
9111
+
9112
+
8714
9113
  class _UniffiConverterSequenceTypeDepositInfo(_UniffiConverterRustBuffer):
8715
9114
  @classmethod
8716
9115
  def check_lower(cls, value):
@@ -8761,6 +9160,31 @@ class _UniffiConverterSequenceTypePayment(_UniffiConverterRustBuffer):
8761
9160
 
8762
9161
 
8763
9162
 
9163
+ class _UniffiConverterSequenceTypeTokenMetadata(_UniffiConverterRustBuffer):
9164
+ @classmethod
9165
+ def check_lower(cls, value):
9166
+ for item in value:
9167
+ _UniffiConverterTypeTokenMetadata.check_lower(item)
9168
+
9169
+ @classmethod
9170
+ def write(cls, value, buf):
9171
+ items = len(value)
9172
+ buf.write_i32(items)
9173
+ for item in value:
9174
+ _UniffiConverterTypeTokenMetadata.write(item, buf)
9175
+
9176
+ @classmethod
9177
+ def read(cls, buf):
9178
+ count = buf.read_i32()
9179
+ if count < 0:
9180
+ raise InternalError("Unexpected negative sequence length")
9181
+
9182
+ return [
9183
+ _UniffiConverterTypeTokenMetadata.read(buf) for i in range(count)
9184
+ ]
9185
+
9186
+
9187
+
8764
9188
  class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
8765
9189
  @classmethod
8766
9190
  def check_lower(cls, value):
@@ -8786,6 +9210,56 @@ class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
8786
9210
 
8787
9211
 
8788
9212
 
9213
+ class _UniffiConverterSequenceTypePaymentStatus(_UniffiConverterRustBuffer):
9214
+ @classmethod
9215
+ def check_lower(cls, value):
9216
+ for item in value:
9217
+ _UniffiConverterTypePaymentStatus.check_lower(item)
9218
+
9219
+ @classmethod
9220
+ def write(cls, value, buf):
9221
+ items = len(value)
9222
+ buf.write_i32(items)
9223
+ for item in value:
9224
+ _UniffiConverterTypePaymentStatus.write(item, buf)
9225
+
9226
+ @classmethod
9227
+ def read(cls, buf):
9228
+ count = buf.read_i32()
9229
+ if count < 0:
9230
+ raise InternalError("Unexpected negative sequence length")
9231
+
9232
+ return [
9233
+ _UniffiConverterTypePaymentStatus.read(buf) for i in range(count)
9234
+ ]
9235
+
9236
+
9237
+
9238
+ class _UniffiConverterSequenceTypePaymentType(_UniffiConverterRustBuffer):
9239
+ @classmethod
9240
+ def check_lower(cls, value):
9241
+ for item in value:
9242
+ _UniffiConverterTypePaymentType.check_lower(item)
9243
+
9244
+ @classmethod
9245
+ def write(cls, value, buf):
9246
+ items = len(value)
9247
+ buf.write_i32(items)
9248
+ for item in value:
9249
+ _UniffiConverterTypePaymentType.write(item, buf)
9250
+
9251
+ @classmethod
9252
+ def read(cls, buf):
9253
+ count = buf.read_i32()
9254
+ if count < 0:
9255
+ raise InternalError("Unexpected negative sequence length")
9256
+
9257
+ return [
9258
+ _UniffiConverterTypePaymentType.read(buf) for i in range(count)
9259
+ ]
9260
+
9261
+
9262
+
8789
9263
  class _UniffiConverterSequenceTypeFiatCurrency(_UniffiConverterRustBuffer):
8790
9264
  @classmethod
8791
9265
  def check_lower(cls, value):
@@ -8834,6 +9308,39 @@ class _UniffiConverterSequenceTypeRate(_UniffiConverterRustBuffer):
8834
9308
  _UniffiConverterTypeRate.read(buf) for i in range(count)
8835
9309
  ]
8836
9310
 
9311
+
9312
+
9313
+ class _UniffiConverterMapStringTypeTokenBalance(_UniffiConverterRustBuffer):
9314
+ @classmethod
9315
+ def check_lower(cls, items):
9316
+ for (key, value) in items.items():
9317
+ _UniffiConverterString.check_lower(key)
9318
+ _UniffiConverterTypeTokenBalance.check_lower(value)
9319
+
9320
+ @classmethod
9321
+ def write(cls, items, buf):
9322
+ buf.write_i32(len(items))
9323
+ for (key, value) in items.items():
9324
+ _UniffiConverterString.write(key, buf)
9325
+ _UniffiConverterTypeTokenBalance.write(value, buf)
9326
+
9327
+ @classmethod
9328
+ def read(cls, buf):
9329
+ count = buf.read_i32()
9330
+ if count < 0:
9331
+ raise InternalError("Unexpected negative map size")
9332
+
9333
+ # It would be nice to use a dict comprehension,
9334
+ # but in Python 3.7 and before the evaluation order is not according to spec,
9335
+ # so we we're reading the value before the key.
9336
+ # This loop makes the order explicit: first reading the key, then the value.
9337
+ d = {}
9338
+ for i in range(count):
9339
+ key = _UniffiConverterString.read(buf)
9340
+ val = _UniffiConverterTypeTokenBalance.read(buf)
9341
+ d[key] = val
9342
+ return d
9343
+
8837
9344
  # External type BitcoinAddressDetails is in namespace "breez_sdk_common", crate breez_sdk_common
8838
9345
 
8839
9346
 
@@ -8884,6 +9391,34 @@ class _UniffiConverterSequenceTypeRate(_UniffiConverterRustBuffer):
8884
9391
 
8885
9392
 
8886
9393
 
9394
+
9395
+ class _UniffiConverterTypeU128:
9396
+ @staticmethod
9397
+ def write(value, buf):
9398
+ builtin_value = str(value)
9399
+ _UniffiConverterString.write(builtin_value, buf)
9400
+
9401
+ @staticmethod
9402
+ def read(buf):
9403
+ builtin_value = _UniffiConverterString.read(buf)
9404
+ return int(builtin_value)
9405
+
9406
+ @staticmethod
9407
+ def lift(value):
9408
+ builtin_value = _UniffiConverterString.lift(value)
9409
+ return int(builtin_value)
9410
+
9411
+ @staticmethod
9412
+ def check_lower(value):
9413
+ builtin_value = str(value)
9414
+ return _UniffiConverterString.check_lower(builtin_value)
9415
+
9416
+ @staticmethod
9417
+ def lower(value):
9418
+ builtin_value = str(value)
9419
+ return _UniffiConverterString.lower(builtin_value)
9420
+ U128 = str
9421
+
8887
9422
  # Async support# RustFuturePoll values
8888
9423
  _UNIFFI_RUST_FUTURE_POLL_READY = 0
8889
9424
  _UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1
@@ -9071,6 +9606,7 @@ _UniffiConverterTypeSdkError,
9071
9606
 
9072
9607
  __all__ = [
9073
9608
  "InternalError",
9609
+ "AssetFilter",
9074
9610
  "ChainServiceError",
9075
9611
  "DepositClaimError",
9076
9612
  "Fee",
@@ -9101,6 +9637,8 @@ __all__ = [
9101
9637
  "GetInfoResponse",
9102
9638
  "GetPaymentRequest",
9103
9639
  "GetPaymentResponse",
9640
+ "GetTokensMetadataRequest",
9641
+ "GetTokensMetadataResponse",
9104
9642
  "LightningAddressInfo",
9105
9643
  "ListFiatCurrenciesResponse",
9106
9644
  "ListFiatRatesResponse",
@@ -9129,6 +9667,8 @@ __all__ = [
9129
9667
  "SendPaymentResponse",
9130
9668
  "SyncWalletRequest",
9131
9669
  "SyncWalletResponse",
9670
+ "TokenBalance",
9671
+ "TokenMetadata",
9132
9672
  "TxStatus",
9133
9673
  "Utxo",
9134
9674
  "WaitForPaymentRequest",