breez-sdk-spark 0.1.9.dev2__cp312-cp312-macosx_11_0_universal2.whl → 0.2.0__cp312-cp312-macosx_11_0_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of breez-sdk-spark might be problematic. Click here for more details.

@@ -461,6 +461,10 @@ def _uniffi_check_contract_api_version(lib):
461
461
  raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
462
462
 
463
463
  def _uniffi_check_api_checksums(lib):
464
+ if lib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies() != 63089:
465
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
466
+ if lib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates() != 48636:
467
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
464
468
  if lib.uniffi_breez_sdk_common_checksum_method_restclient_get_request() != 1702:
465
469
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
466
470
  if lib.uniffi_breez_sdk_common_checksum_method_restclient_post_request() != 38998:
@@ -573,12 +577,22 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure):
573
577
  ]
574
578
  _UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructVoid,
575
579
  )
580
+ _UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
581
+ )
582
+ _UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
583
+ )
576
584
  _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
577
585
  )
578
586
  _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
579
587
  )
580
588
  _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
581
589
  )
590
+ class _UniffiVTableCallbackInterfaceFiatService(ctypes.Structure):
591
+ _fields_ = [
592
+ ("fetch_fiat_currencies", _UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0),
593
+ ("fetch_fiat_rates", _UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1),
594
+ ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
595
+ ]
582
596
  class _UniffiVTableCallbackInterfaceRestClient(ctypes.Structure):
583
597
  _fields_ = [
584
598
  ("get_request", _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD0),
@@ -586,6 +600,28 @@ class _UniffiVTableCallbackInterfaceRestClient(ctypes.Structure):
586
600
  ("delete_request", _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD2),
587
601
  ("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
588
602
  ]
603
+ _UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice.argtypes = (
604
+ ctypes.c_void_p,
605
+ ctypes.POINTER(_UniffiRustCallStatus),
606
+ )
607
+ _UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice.restype = ctypes.c_void_p
608
+ _UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice.argtypes = (
609
+ ctypes.c_void_p,
610
+ ctypes.POINTER(_UniffiRustCallStatus),
611
+ )
612
+ _UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice.restype = None
613
+ _UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice.argtypes = (
614
+ ctypes.POINTER(_UniffiVTableCallbackInterfaceFiatService),
615
+ )
616
+ _UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice.restype = None
617
+ _UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies.argtypes = (
618
+ ctypes.c_void_p,
619
+ )
620
+ _UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies.restype = ctypes.c_uint64
621
+ _UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates.argtypes = (
622
+ ctypes.c_void_p,
623
+ )
624
+ _UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates.restype = ctypes.c_uint64
589
625
  _UniffiLib.uniffi_breez_sdk_common_fn_clone_restclient.argtypes = (
590
626
  ctypes.c_void_p,
591
627
  ctypes.POINTER(_UniffiRustCallStatus),
@@ -888,6 +924,12 @@ _UniffiLib.ffi_breez_sdk_common_rust_future_complete_void.argtypes = (
888
924
  ctypes.POINTER(_UniffiRustCallStatus),
889
925
  )
890
926
  _UniffiLib.ffi_breez_sdk_common_rust_future_complete_void.restype = None
927
+ _UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies.argtypes = (
928
+ )
929
+ _UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies.restype = ctypes.c_uint16
930
+ _UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates.argtypes = (
931
+ )
932
+ _UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates.restype = ctypes.c_uint16
891
933
  _UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_get_request.argtypes = (
892
934
  )
893
935
  _UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_get_request.restype = ctypes.c_uint16
@@ -1010,6 +1052,243 @@ class _UniffiConverterString:
1010
1052
 
1011
1053
 
1012
1054
 
1055
+ class FiatService(typing.Protocol):
1056
+ """
1057
+ Trait covering fiat-related functionality
1058
+ """
1059
+
1060
+ def fetch_fiat_currencies(self, ):
1061
+ """
1062
+ List all supported fiat currencies for which there is a known exchange rate.
1063
+ """
1064
+
1065
+ raise NotImplementedError
1066
+ def fetch_fiat_rates(self, ):
1067
+ """
1068
+ Get the live rates from the server.
1069
+ """
1070
+
1071
+ raise NotImplementedError
1072
+
1073
+
1074
+ class FiatServiceImpl:
1075
+ """
1076
+ Trait covering fiat-related functionality
1077
+ """
1078
+
1079
+ _pointer: ctypes.c_void_p
1080
+
1081
+ def __init__(self, *args, **kwargs):
1082
+ raise ValueError("This class has no default constructor")
1083
+
1084
+ def __del__(self):
1085
+ # In case of partial initialization of instances.
1086
+ pointer = getattr(self, "_pointer", None)
1087
+ if pointer is not None:
1088
+ _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice, pointer)
1089
+
1090
+ def _uniffi_clone_pointer(self):
1091
+ return _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice, self._pointer)
1092
+
1093
+ # Used by alternative constructors or any methods which return this type.
1094
+ @classmethod
1095
+ def _make_instance_(cls, pointer):
1096
+ # Lightly yucky way to bypass the usual __init__ logic
1097
+ # and just create a new instance with the required pointer.
1098
+ inst = cls.__new__(cls)
1099
+ inst._pointer = pointer
1100
+ return inst
1101
+
1102
+ async def fetch_fiat_currencies(self, ) -> "typing.List[FiatCurrency]":
1103
+ """
1104
+ List all supported fiat currencies for which there is a known exchange rate.
1105
+ """
1106
+
1107
+ return await _uniffi_rust_call_async(
1108
+ _UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies(
1109
+ self._uniffi_clone_pointer(),
1110
+ ),
1111
+ _UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
1112
+ _UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
1113
+ _UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
1114
+ # lift function
1115
+ _UniffiConverterSequenceTypeFiatCurrency.lift,
1116
+
1117
+ # Error FFI converter
1118
+ _UniffiConverterTypeServiceConnectivityError,
1119
+
1120
+ )
1121
+
1122
+
1123
+
1124
+ async def fetch_fiat_rates(self, ) -> "typing.List[Rate]":
1125
+ """
1126
+ Get the live rates from the server.
1127
+ """
1128
+
1129
+ return await _uniffi_rust_call_async(
1130
+ _UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates(
1131
+ self._uniffi_clone_pointer(),
1132
+ ),
1133
+ _UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
1134
+ _UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
1135
+ _UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
1136
+ # lift function
1137
+ _UniffiConverterSequenceTypeRate.lift,
1138
+
1139
+ # Error FFI converter
1140
+ _UniffiConverterTypeServiceConnectivityError,
1141
+
1142
+ )
1143
+
1144
+
1145
+ # Magic number for the Rust proxy to call using the same mechanism as every other method,
1146
+ # to free the callback once it's dropped by Rust.
1147
+ _UNIFFI_IDX_CALLBACK_FREE = 0
1148
+ # Return codes for callback calls
1149
+ _UNIFFI_CALLBACK_SUCCESS = 0
1150
+ _UNIFFI_CALLBACK_ERROR = 1
1151
+ _UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2
1152
+
1153
+ class _UniffiCallbackInterfaceFfiConverter:
1154
+ _handle_map = _UniffiHandleMap()
1155
+
1156
+ @classmethod
1157
+ def lift(cls, handle):
1158
+ return cls._handle_map.get(handle)
1159
+
1160
+ @classmethod
1161
+ def read(cls, buf):
1162
+ handle = buf.read_u64()
1163
+ cls.lift(handle)
1164
+
1165
+ @classmethod
1166
+ def check_lower(cls, cb):
1167
+ pass
1168
+
1169
+ @classmethod
1170
+ def lower(cls, cb):
1171
+ handle = cls._handle_map.insert(cb)
1172
+ return handle
1173
+
1174
+ @classmethod
1175
+ def write(cls, cb, buf):
1176
+ buf.write_u64(cls.lower(cb))
1177
+
1178
+ # Put all the bits inside a class to keep the top-level namespace clean
1179
+ class _UniffiTraitImplFiatService:
1180
+ # For each method, generate a callback function to pass to Rust
1181
+
1182
+ @_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0
1183
+ def fetch_fiat_currencies(
1184
+ uniffi_handle,
1185
+ uniffi_future_callback,
1186
+ uniffi_callback_data,
1187
+ uniffi_out_return,
1188
+ ):
1189
+ uniffi_obj = _UniffiConverterTypeFiatService._handle_map.get(uniffi_handle)
1190
+ def make_call():
1191
+ args = ()
1192
+ method = uniffi_obj.fetch_fiat_currencies
1193
+ return method(*args)
1194
+
1195
+
1196
+ def handle_success(return_value):
1197
+ uniffi_future_callback(
1198
+ uniffi_callback_data,
1199
+ _UniffiForeignFutureStructRustBuffer(
1200
+ _UniffiConverterSequenceTypeFiatCurrency.lower(return_value),
1201
+ _UniffiRustCallStatus.default()
1202
+ )
1203
+ )
1204
+
1205
+ def handle_error(status_code, rust_buffer):
1206
+ uniffi_future_callback(
1207
+ uniffi_callback_data,
1208
+ _UniffiForeignFutureStructRustBuffer(
1209
+ _UniffiRustBuffer.default(),
1210
+ _UniffiRustCallStatus(status_code, rust_buffer),
1211
+ )
1212
+ )
1213
+ uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
1214
+
1215
+ @_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1
1216
+ def fetch_fiat_rates(
1217
+ uniffi_handle,
1218
+ uniffi_future_callback,
1219
+ uniffi_callback_data,
1220
+ uniffi_out_return,
1221
+ ):
1222
+ uniffi_obj = _UniffiConverterTypeFiatService._handle_map.get(uniffi_handle)
1223
+ def make_call():
1224
+ args = ()
1225
+ method = uniffi_obj.fetch_fiat_rates
1226
+ return method(*args)
1227
+
1228
+
1229
+ def handle_success(return_value):
1230
+ uniffi_future_callback(
1231
+ uniffi_callback_data,
1232
+ _UniffiForeignFutureStructRustBuffer(
1233
+ _UniffiConverterSequenceTypeRate.lower(return_value),
1234
+ _UniffiRustCallStatus.default()
1235
+ )
1236
+ )
1237
+
1238
+ def handle_error(status_code, rust_buffer):
1239
+ uniffi_future_callback(
1240
+ uniffi_callback_data,
1241
+ _UniffiForeignFutureStructRustBuffer(
1242
+ _UniffiRustBuffer.default(),
1243
+ _UniffiRustCallStatus(status_code, rust_buffer),
1244
+ )
1245
+ )
1246
+ uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
1247
+
1248
+ @_UNIFFI_CALLBACK_INTERFACE_FREE
1249
+ def _uniffi_free(uniffi_handle):
1250
+ _UniffiConverterTypeFiatService._handle_map.remove(uniffi_handle)
1251
+
1252
+ # Generate the FFI VTable. This has a field for each callback interface method.
1253
+ _uniffi_vtable = _UniffiVTableCallbackInterfaceFiatService(
1254
+ fetch_fiat_currencies,
1255
+ fetch_fiat_rates,
1256
+ _uniffi_free
1257
+ )
1258
+ # Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever,
1259
+ # or else bad things will happen when Rust tries to access it.
1260
+ _UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice(ctypes.byref(_uniffi_vtable))
1261
+
1262
+
1263
+
1264
+ class _UniffiConverterTypeFiatService:
1265
+ _handle_map = _UniffiHandleMap()
1266
+
1267
+ @staticmethod
1268
+ def lift(value: int):
1269
+ return FiatServiceImpl._make_instance_(value)
1270
+
1271
+ @staticmethod
1272
+ def check_lower(value: FiatService):
1273
+ pass
1274
+
1275
+ @staticmethod
1276
+ def lower(value: FiatService):
1277
+ return _UniffiConverterTypeFiatService._handle_map.insert(value)
1278
+
1279
+ @classmethod
1280
+ def read(cls, buf: _UniffiRustBuffer):
1281
+ ptr = buf.read_u64()
1282
+ if ptr == 0:
1283
+ raise InternalError("Raw pointer value was null")
1284
+ return cls.lift(ptr)
1285
+
1286
+ @classmethod
1287
+ def write(cls, value: FiatService, buf: _UniffiRustBuffer):
1288
+ buf.write_u64(cls.lower(value))
1289
+
1290
+
1291
+
1013
1292
  class RestClient(typing.Protocol):
1014
1293
  def get_request(self, url: "str",headers: "typing.Optional[dict[str, str]]"):
1015
1294
  """
@@ -1166,38 +1445,7 @@ _UniffiConverterTypeServiceConnectivityError,
1166
1445
  )
1167
1446
 
1168
1447
 
1169
- # Magic number for the Rust proxy to call using the same mechanism as every other method,
1170
- # to free the callback once it's dropped by Rust.
1171
- _UNIFFI_IDX_CALLBACK_FREE = 0
1172
- # Return codes for callback calls
1173
- _UNIFFI_CALLBACK_SUCCESS = 0
1174
- _UNIFFI_CALLBACK_ERROR = 1
1175
- _UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2
1176
-
1177
- class _UniffiCallbackInterfaceFfiConverter:
1178
- _handle_map = _UniffiHandleMap()
1179
-
1180
- @classmethod
1181
- def lift(cls, handle):
1182
- return cls._handle_map.get(handle)
1183
-
1184
- @classmethod
1185
- def read(cls, buf):
1186
- handle = buf.read_u64()
1187
- cls.lift(handle)
1188
-
1189
- @classmethod
1190
- def check_lower(cls, cb):
1191
- pass
1192
-
1193
- @classmethod
1194
- def lower(cls, cb):
1195
- handle = cls._handle_map.insert(cb)
1196
- return handle
1197
1448
 
1198
- @classmethod
1199
- def write(cls, cb, buf):
1200
- buf.write_u64(cls.lower(cb))
1201
1449
 
1202
1450
  # Put all the bits inside a class to keep the top-level namespace clean
1203
1451
  class _UniffiTraitImplRestClient:
@@ -5045,6 +5293,31 @@ class _UniffiConverterSequenceTypeBolt12OfferBlindedPath(_UniffiConverterRustBuf
5045
5293
 
5046
5294
 
5047
5295
 
5296
+ class _UniffiConverterSequenceTypeFiatCurrency(_UniffiConverterRustBuffer):
5297
+ @classmethod
5298
+ def check_lower(cls, value):
5299
+ for item in value:
5300
+ _UniffiConverterTypeFiatCurrency.check_lower(item)
5301
+
5302
+ @classmethod
5303
+ def write(cls, value, buf):
5304
+ items = len(value)
5305
+ buf.write_i32(items)
5306
+ for item in value:
5307
+ _UniffiConverterTypeFiatCurrency.write(item, buf)
5308
+
5309
+ @classmethod
5310
+ def read(cls, buf):
5311
+ count = buf.read_i32()
5312
+ if count < 0:
5313
+ raise InternalError("Unexpected negative sequence length")
5314
+
5315
+ return [
5316
+ _UniffiConverterTypeFiatCurrency.read(buf) for i in range(count)
5317
+ ]
5318
+
5319
+
5320
+
5048
5321
  class _UniffiConverterSequenceTypeLocaleOverrides(_UniffiConverterRustBuffer):
5049
5322
  @classmethod
5050
5323
  def check_lower(cls, value):
@@ -5095,6 +5368,31 @@ class _UniffiConverterSequenceTypeLocalizedName(_UniffiConverterRustBuffer):
5095
5368
 
5096
5369
 
5097
5370
 
5371
+ class _UniffiConverterSequenceTypeRate(_UniffiConverterRustBuffer):
5372
+ @classmethod
5373
+ def check_lower(cls, value):
5374
+ for item in value:
5375
+ _UniffiConverterTypeRate.check_lower(item)
5376
+
5377
+ @classmethod
5378
+ def write(cls, value, buf):
5379
+ items = len(value)
5380
+ buf.write_i32(items)
5381
+ for item in value:
5382
+ _UniffiConverterTypeRate.write(item, buf)
5383
+
5384
+ @classmethod
5385
+ def read(cls, buf):
5386
+ count = buf.read_i32()
5387
+ if count < 0:
5388
+ raise InternalError("Unexpected negative sequence length")
5389
+
5390
+ return [
5391
+ _UniffiConverterTypeRate.read(buf) for i in range(count)
5392
+ ]
5393
+
5394
+
5395
+
5098
5396
  class _UniffiConverterSequenceTypeInputType(_UniffiConverterRustBuffer):
5099
5397
  @classmethod
5100
5398
  def check_lower(cls, value):
@@ -5310,6 +5608,7 @@ __all__ = [
5310
5608
  "Symbol",
5311
5609
  "TokensPaymentDetails",
5312
5610
  "UrlSuccessActionData",
5611
+ "FiatService",
5313
5612
  "RestClient",
5314
5613
  ]
5315
5614
 
@@ -31,22 +31,31 @@ 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 FiatCurrency
35
+ from .breez_sdk_common import FiatService
34
36
  from .breez_sdk_common import InputType
35
37
  from .breez_sdk_common import LnurlPayRequestDetails
38
+ from .breez_sdk_common import Rate
36
39
  from .breez_sdk_common import RestClient
37
40
  from .breez_sdk_common import SuccessAction
38
41
  from .breez_sdk_common import SuccessActionProcessed
39
42
  from .breez_sdk_common import _UniffiConverterTypeBitcoinAddressDetails
40
43
  from .breez_sdk_common import _UniffiConverterTypeBolt11InvoiceDetails
44
+ from .breez_sdk_common import _UniffiConverterTypeFiatCurrency
45
+ from .breez_sdk_common import _UniffiConverterTypeFiatService
41
46
  from .breez_sdk_common import _UniffiConverterTypeInputType
42
47
  from .breez_sdk_common import _UniffiConverterTypeLnurlPayRequestDetails
48
+ from .breez_sdk_common import _UniffiConverterTypeRate
43
49
  from .breez_sdk_common import _UniffiConverterTypeRestClient
44
50
  from .breez_sdk_common import _UniffiConverterTypeSuccessAction
45
51
  from .breez_sdk_common import _UniffiConverterTypeSuccessActionProcessed
46
52
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferBitcoinAddressDetails
47
53
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferBolt11InvoiceDetails
54
+ from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferFiatCurrency
55
+ from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferFiatService
48
56
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferInputType
49
57
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferLnurlPayRequestDetails
58
+ from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferRate
50
59
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferRestClient
51
60
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferSuccessAction
52
61
  from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferSuccessActionProcessed
@@ -514,6 +523,10 @@ def _uniffi_check_api_checksums(lib):
514
523
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
515
524
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment() != 11540:
516
525
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
526
+ if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies() != 63366:
527
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
528
+ if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates() != 5904:
529
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
517
530
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments() != 16156:
518
531
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
519
532
  if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_unclaimed_deposits() != 22486:
@@ -546,6 +559,8 @@ def _uniffi_check_api_checksums(lib):
546
559
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
547
560
  if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service() != 2848:
548
561
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
562
+ if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service() != 41113:
563
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
549
564
  if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set() != 55523:
550
565
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
551
566
  if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client() != 61720:
@@ -574,7 +589,7 @@ def _uniffi_check_api_checksums(lib):
574
589
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
575
590
  if lib.uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() != 48478:
576
591
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
577
- if lib.uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() != 52744:
592
+ if lib.uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() != 53882:
578
593
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
579
594
  if lib.uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event() != 10824:
580
595
  raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
@@ -830,6 +845,14 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_payment.argtypes = (
830
845
  _UniffiRustBuffer,
831
846
  )
832
847
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_payment.restype = ctypes.c_uint64
848
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_currencies.argtypes = (
849
+ ctypes.c_void_p,
850
+ )
851
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_currencies.restype = ctypes.c_uint64
852
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_rates.argtypes = (
853
+ ctypes.c_void_p,
854
+ )
855
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_rates.restype = ctypes.c_uint64
833
856
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_payments.argtypes = (
834
857
  ctypes.c_void_p,
835
858
  _UniffiRustBuffer,
@@ -930,6 +953,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_chain_service.argtyp
930
953
  ctypes.c_void_p,
931
954
  )
932
955
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_chain_service.restype = ctypes.c_uint64
956
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service.argtypes = (
957
+ ctypes.c_void_p,
958
+ ctypes.c_void_p,
959
+ )
960
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service.restype = ctypes.c_uint64
933
961
  _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set.argtypes = (
934
962
  ctypes.c_void_p,
935
963
  _UniffiRustBuffer,
@@ -1372,6 +1400,12 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_lightning_address
1372
1400
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment.argtypes = (
1373
1401
  )
1374
1402
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment.restype = ctypes.c_uint16
1403
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies.argtypes = (
1404
+ )
1405
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_currencies.restype = ctypes.c_uint16
1406
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates.argtypes = (
1407
+ )
1408
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_fiat_rates.restype = ctypes.c_uint16
1375
1409
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments.argtypes = (
1376
1410
  )
1377
1411
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments.restype = ctypes.c_uint16
@@ -1420,6 +1454,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build.restype = cty
1420
1454
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service.argtypes = (
1421
1455
  )
1422
1456
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service.restype = ctypes.c_uint16
1457
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service.argtypes = (
1458
+ )
1459
+ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_fiat_service.restype = ctypes.c_uint16
1423
1460
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set.argtypes = (
1424
1461
  )
1425
1462
  _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set.restype = ctypes.c_uint16
@@ -1560,6 +1597,26 @@ class _UniffiConverterString:
1560
1597
  builder.write(value.encode("utf-8"))
1561
1598
  return builder.finalize()
1562
1599
 
1600
+ class _UniffiConverterBytes(_UniffiConverterRustBuffer):
1601
+ @staticmethod
1602
+ def read(buf):
1603
+ size = buf.read_i32()
1604
+ if size < 0:
1605
+ raise InternalError("Unexpected negative byte string length")
1606
+ return buf.read(size)
1607
+
1608
+ @staticmethod
1609
+ def check_lower(value):
1610
+ try:
1611
+ memoryview(value)
1612
+ except TypeError:
1613
+ raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__))
1614
+
1615
+ @staticmethod
1616
+ def write(value, buf):
1617
+ buf.write_i32(len(value))
1618
+ buf.write(value)
1619
+
1563
1620
 
1564
1621
 
1565
1622
  class BitcoinChainService(typing.Protocol):
@@ -1889,6 +1946,19 @@ class BreezSdkProtocol(typing.Protocol):
1889
1946
  def get_lightning_address(self, ):
1890
1947
  raise NotImplementedError
1891
1948
  def get_payment(self, request: "GetPaymentRequest"):
1949
+ raise NotImplementedError
1950
+ def list_fiat_currencies(self, ):
1951
+ """
1952
+ List fiat currencies for which there is a known exchange rate,
1953
+ sorted by the canonical name of the currency.
1954
+ """
1955
+
1956
+ raise NotImplementedError
1957
+ def list_fiat_rates(self, ):
1958
+ """
1959
+ List the latest rates of fiat currencies, sorted by name.
1960
+ """
1961
+
1892
1962
  raise NotImplementedError
1893
1963
  def list_payments(self, request: "ListPaymentsRequest"):
1894
1964
  """
@@ -2155,6 +2225,51 @@ _UniffiConverterTypeSdkError,
2155
2225
 
2156
2226
 
2157
2227
 
2228
+ async def list_fiat_currencies(self, ) -> "ListFiatCurrenciesResponse":
2229
+ """
2230
+ List fiat currencies for which there is a known exchange rate,
2231
+ sorted by the canonical name of the currency.
2232
+ """
2233
+
2234
+ return await _uniffi_rust_call_async(
2235
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_currencies(
2236
+ self._uniffi_clone_pointer(),
2237
+ ),
2238
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2239
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2240
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2241
+ # lift function
2242
+ _UniffiConverterTypeListFiatCurrenciesResponse.lift,
2243
+
2244
+ # Error FFI converter
2245
+ _UniffiConverterTypeSdkError,
2246
+
2247
+ )
2248
+
2249
+
2250
+
2251
+ async def list_fiat_rates(self, ) -> "ListFiatRatesResponse":
2252
+ """
2253
+ List the latest rates of fiat currencies, sorted by name.
2254
+ """
2255
+
2256
+ return await _uniffi_rust_call_async(
2257
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_fiat_rates(
2258
+ self._uniffi_clone_pointer(),
2259
+ ),
2260
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
2261
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
2262
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
2263
+ # lift function
2264
+ _UniffiConverterTypeListFiatRatesResponse.lift,
2265
+
2266
+ # Error FFI converter
2267
+ _UniffiConverterTypeSdkError,
2268
+
2269
+ )
2270
+
2271
+
2272
+
2158
2273
  async def list_payments(self, request: "ListPaymentsRequest") -> "ListPaymentsResponse":
2159
2274
  """
2160
2275
  Lists payments from the storage with pagination
@@ -2511,6 +2626,14 @@ class SdkBuilderProtocol(typing.Protocol):
2511
2626
  - `chain_service`: The chain service to be used.
2512
2627
  """
2513
2628
 
2629
+ raise NotImplementedError
2630
+ def with_fiat_service(self, fiat_service: "FiatService"):
2631
+ """
2632
+ Sets the fiat service to be used by the SDK.
2633
+ Arguments:
2634
+ - `fiat_service`: The fiat service to be used.
2635
+ """
2636
+
2514
2637
  raise NotImplementedError
2515
2638
  def with_key_set(self, key_set_type: "KeySetType",use_address_index: "bool"):
2516
2639
  """
@@ -2540,24 +2663,24 @@ class SdkBuilder:
2540
2663
  """
2541
2664
 
2542
2665
  _pointer: ctypes.c_void_p
2543
- def __init__(self, config: "Config",mnemonic: "str",storage: "Storage"):
2666
+ def __init__(self, config: "Config",seed: "Seed",storage: "Storage"):
2544
2667
  """
2545
2668
  Creates a new `SdkBuilder` with the provided configuration.
2546
2669
  Arguments:
2547
2670
  - `config`: The configuration to be used.
2548
- - `mnemonic`: The mnemonic phrase for the wallet.
2671
+ - `seed`: The seed for wallet generation.
2549
2672
  - `storage`: The storage backend to be used.
2550
2673
  """
2551
2674
 
2552
2675
  _UniffiConverterTypeConfig.check_lower(config)
2553
2676
 
2554
- _UniffiConverterString.check_lower(mnemonic)
2677
+ _UniffiConverterTypeSeed.check_lower(seed)
2555
2678
 
2556
2679
  _UniffiConverterTypeStorage.check_lower(storage)
2557
2680
 
2558
2681
  self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new,
2559
2682
  _UniffiConverterTypeConfig.lower(config),
2560
- _UniffiConverterString.lower(mnemonic),
2683
+ _UniffiConverterTypeSeed.lower(seed),
2561
2684
  _UniffiConverterTypeStorage.lower(storage))
2562
2685
 
2563
2686
  def __del__(self):
@@ -2630,6 +2753,36 @@ _UniffiConverterTypeSdkError,
2630
2753
 
2631
2754
 
2632
2755
 
2756
+ async def with_fiat_service(self, fiat_service: "FiatService") -> None:
2757
+
2758
+ """
2759
+ Sets the fiat service to be used by the SDK.
2760
+ Arguments:
2761
+ - `fiat_service`: The fiat service to be used.
2762
+ """
2763
+
2764
+ _UniffiConverterTypeFiatService.check_lower(fiat_service)
2765
+
2766
+ return await _uniffi_rust_call_async(
2767
+ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_fiat_service(
2768
+ self._uniffi_clone_pointer(),
2769
+ _UniffiConverterTypeFiatService.lower(fiat_service)
2770
+ ),
2771
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_poll_void,
2772
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_complete_void,
2773
+ _UniffiLib.ffi_breez_sdk_spark_rust_future_free_void,
2774
+ # lift function
2775
+ lambda val: None,
2776
+
2777
+
2778
+ # Error FFI converter
2779
+
2780
+ None,
2781
+
2782
+ )
2783
+
2784
+
2785
+
2633
2786
  async def with_key_set(self, key_set_type: "KeySetType",use_address_index: "bool") -> None:
2634
2787
 
2635
2788
  """
@@ -3869,20 +4022,20 @@ class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
3869
4022
 
3870
4023
  class ConnectRequest:
3871
4024
  config: "Config"
3872
- mnemonic: "str"
4025
+ seed: "Seed"
3873
4026
  storage_dir: "str"
3874
- def __init__(self, *, config: "Config", mnemonic: "str", storage_dir: "str"):
4027
+ def __init__(self, *, config: "Config", seed: "Seed", storage_dir: "str"):
3875
4028
  self.config = config
3876
- self.mnemonic = mnemonic
4029
+ self.seed = seed
3877
4030
  self.storage_dir = storage_dir
3878
4031
 
3879
4032
  def __str__(self):
3880
- return "ConnectRequest(config={}, mnemonic={}, storage_dir={})".format(self.config, self.mnemonic, self.storage_dir)
4033
+ return "ConnectRequest(config={}, seed={}, storage_dir={})".format(self.config, self.seed, self.storage_dir)
3881
4034
 
3882
4035
  def __eq__(self, other):
3883
4036
  if self.config != other.config:
3884
4037
  return False
3885
- if self.mnemonic != other.mnemonic:
4038
+ if self.seed != other.seed:
3886
4039
  return False
3887
4040
  if self.storage_dir != other.storage_dir:
3888
4041
  return False
@@ -3893,20 +4046,20 @@ class _UniffiConverterTypeConnectRequest(_UniffiConverterRustBuffer):
3893
4046
  def read(buf):
3894
4047
  return ConnectRequest(
3895
4048
  config=_UniffiConverterTypeConfig.read(buf),
3896
- mnemonic=_UniffiConverterString.read(buf),
4049
+ seed=_UniffiConverterTypeSeed.read(buf),
3897
4050
  storage_dir=_UniffiConverterString.read(buf),
3898
4051
  )
3899
4052
 
3900
4053
  @staticmethod
3901
4054
  def check_lower(value):
3902
4055
  _UniffiConverterTypeConfig.check_lower(value.config)
3903
- _UniffiConverterString.check_lower(value.mnemonic)
4056
+ _UniffiConverterTypeSeed.check_lower(value.seed)
3904
4057
  _UniffiConverterString.check_lower(value.storage_dir)
3905
4058
 
3906
4059
  @staticmethod
3907
4060
  def write(value, buf):
3908
4061
  _UniffiConverterTypeConfig.write(value.config, buf)
3909
- _UniffiConverterString.write(value.mnemonic, buf)
4062
+ _UniffiConverterTypeSeed.write(value.seed, buf)
3910
4063
  _UniffiConverterString.write(value.storage_dir, buf)
3911
4064
 
3912
4065
 
@@ -4182,6 +4335,80 @@ class _UniffiConverterTypeLightningAddressInfo(_UniffiConverterRustBuffer):
4182
4335
  _UniffiConverterString.write(value.username, buf)
4183
4336
 
4184
4337
 
4338
+ class ListFiatCurrenciesResponse:
4339
+ """
4340
+ Response from listing fiat currencies
4341
+ """
4342
+
4343
+ currencies: "typing.List[FiatCurrency]"
4344
+ """
4345
+ The list of fiat currencies
4346
+ """
4347
+
4348
+ def __init__(self, *, currencies: "typing.List[FiatCurrency]"):
4349
+ self.currencies = currencies
4350
+
4351
+ def __str__(self):
4352
+ return "ListFiatCurrenciesResponse(currencies={})".format(self.currencies)
4353
+
4354
+ def __eq__(self, other):
4355
+ if self.currencies != other.currencies:
4356
+ return False
4357
+ return True
4358
+
4359
+ class _UniffiConverterTypeListFiatCurrenciesResponse(_UniffiConverterRustBuffer):
4360
+ @staticmethod
4361
+ def read(buf):
4362
+ return ListFiatCurrenciesResponse(
4363
+ currencies=_UniffiConverterSequenceTypeFiatCurrency.read(buf),
4364
+ )
4365
+
4366
+ @staticmethod
4367
+ def check_lower(value):
4368
+ _UniffiConverterSequenceTypeFiatCurrency.check_lower(value.currencies)
4369
+
4370
+ @staticmethod
4371
+ def write(value, buf):
4372
+ _UniffiConverterSequenceTypeFiatCurrency.write(value.currencies, buf)
4373
+
4374
+
4375
+ class ListFiatRatesResponse:
4376
+ """
4377
+ Response from listing fiat rates
4378
+ """
4379
+
4380
+ rates: "typing.List[Rate]"
4381
+ """
4382
+ The list of fiat rates
4383
+ """
4384
+
4385
+ def __init__(self, *, rates: "typing.List[Rate]"):
4386
+ self.rates = rates
4387
+
4388
+ def __str__(self):
4389
+ return "ListFiatRatesResponse(rates={})".format(self.rates)
4390
+
4391
+ def __eq__(self, other):
4392
+ if self.rates != other.rates:
4393
+ return False
4394
+ return True
4395
+
4396
+ class _UniffiConverterTypeListFiatRatesResponse(_UniffiConverterRustBuffer):
4397
+ @staticmethod
4398
+ def read(buf):
4399
+ return ListFiatRatesResponse(
4400
+ rates=_UniffiConverterSequenceTypeRate.read(buf),
4401
+ )
4402
+
4403
+ @staticmethod
4404
+ def check_lower(value):
4405
+ _UniffiConverterSequenceTypeRate.check_lower(value.rates)
4406
+
4407
+ @staticmethod
4408
+ def write(value, buf):
4409
+ _UniffiConverterSequenceTypeRate.write(value.rates, buf)
4410
+
4411
+
4185
4412
  class ListPaymentsRequest:
4186
4413
  """
4187
4414
  Request to list payments with pagination
@@ -6832,6 +7059,131 @@ class _UniffiConverterTypeSdkEvent(_UniffiConverterRustBuffer):
6832
7059
 
6833
7060
 
6834
7061
 
7062
+ class Seed:
7063
+ """
7064
+ Represents the seed for wallet generation, either as a mnemonic phrase with an optional
7065
+ passphrase or as raw entropy bytes.
7066
+ """
7067
+
7068
+ def __init__(self):
7069
+ raise RuntimeError("Seed cannot be instantiated directly")
7070
+
7071
+ # Each enum variant is a nested class of the enum itself.
7072
+ class MNEMONIC:
7073
+ """
7074
+ A BIP-39 mnemonic phrase with an optional passphrase.
7075
+ """
7076
+
7077
+ mnemonic: "str"
7078
+ """
7079
+ The mnemonic phrase. 12 or 24 words.
7080
+ """
7081
+
7082
+ passphrase: "typing.Optional[str]"
7083
+ """
7084
+ An optional passphrase for the mnemonic.
7085
+ """
7086
+
7087
+
7088
+ def __init__(self,mnemonic: "str", passphrase: "typing.Optional[str]"):
7089
+ self.mnemonic = mnemonic
7090
+ self.passphrase = passphrase
7091
+
7092
+ def __str__(self):
7093
+ return "Seed.MNEMONIC(mnemonic={}, passphrase={})".format(self.mnemonic, self.passphrase)
7094
+
7095
+ def __eq__(self, other):
7096
+ if not other.is_mnemonic():
7097
+ return False
7098
+ if self.mnemonic != other.mnemonic:
7099
+ return False
7100
+ if self.passphrase != other.passphrase:
7101
+ return False
7102
+ return True
7103
+
7104
+ class ENTROPY:
7105
+ """
7106
+ Raw entropy bytes.
7107
+ """
7108
+
7109
+ def __init__(self, *values):
7110
+ if len(values) != 1:
7111
+ raise TypeError(f"Expected 1 arguments, found {len(values)}")
7112
+ if not isinstance(values[0], bytes):
7113
+ raise TypeError(f"unexpected type for tuple element 0 - expected 'bytes', got '{type(values[0])}'")
7114
+ self._values = values
7115
+
7116
+ def __getitem__(self, index):
7117
+ return self._values[index]
7118
+
7119
+ def __str__(self):
7120
+ return f"Seed.ENTROPY{self._values!r}"
7121
+
7122
+ def __eq__(self, other):
7123
+ if not other.is_entropy():
7124
+ return False
7125
+ return self._values == other._values
7126
+
7127
+
7128
+ # For each variant, we have an `is_NAME` method for easily checking
7129
+ # whether an instance is that variant.
7130
+ def is_mnemonic(self) -> bool:
7131
+ return isinstance(self, Seed.MNEMONIC)
7132
+ def is_entropy(self) -> bool:
7133
+ return isinstance(self, Seed.ENTROPY)
7134
+
7135
+
7136
+ # Now, a little trick - we make each nested variant class be a subclass of the main
7137
+ # enum class, so that method calls and instance checks etc will work intuitively.
7138
+ # We might be able to do this a little more neatly with a metaclass, but this'll do.
7139
+ Seed.MNEMONIC = type("Seed.MNEMONIC", (Seed.MNEMONIC, Seed,), {}) # type: ignore
7140
+ Seed.ENTROPY = type("Seed.ENTROPY", (Seed.ENTROPY, Seed,), {}) # type: ignore
7141
+
7142
+
7143
+
7144
+
7145
+ class _UniffiConverterTypeSeed(_UniffiConverterRustBuffer):
7146
+ @staticmethod
7147
+ def read(buf):
7148
+ variant = buf.read_i32()
7149
+ if variant == 1:
7150
+ return Seed.MNEMONIC(
7151
+ _UniffiConverterString.read(buf),
7152
+ _UniffiConverterOptionalString.read(buf),
7153
+ )
7154
+ if variant == 2:
7155
+ return Seed.ENTROPY(
7156
+ _UniffiConverterBytes.read(buf),
7157
+ )
7158
+ raise InternalError("Raw enum value doesn't match any cases")
7159
+
7160
+ @staticmethod
7161
+ def check_lower(value):
7162
+ if value.is_mnemonic():
7163
+ _UniffiConverterString.check_lower(value.mnemonic)
7164
+ _UniffiConverterOptionalString.check_lower(value.passphrase)
7165
+ return
7166
+ if value.is_entropy():
7167
+ _UniffiConverterBytes.check_lower(value._values[0])
7168
+ return
7169
+ raise ValueError(value)
7170
+
7171
+ @staticmethod
7172
+ def write(value, buf):
7173
+ if value.is_mnemonic():
7174
+ buf.write_i32(1)
7175
+ _UniffiConverterString.write(value.mnemonic, buf)
7176
+ _UniffiConverterOptionalString.write(value.passphrase, buf)
7177
+ if value.is_entropy():
7178
+ buf.write_i32(2)
7179
+ _UniffiConverterBytes.write(value._values[0], buf)
7180
+
7181
+
7182
+
7183
+
7184
+
7185
+
7186
+
6835
7187
  class SendPaymentMethod:
6836
7188
  def __init__(self):
6837
7189
  raise RuntimeError("SendPaymentMethod cannot be instantiated directly")
@@ -7006,18 +7358,18 @@ class SendPaymentOptions:
7006
7358
  return True
7007
7359
 
7008
7360
  class BOLT11_INVOICE:
7009
- use_spark: "bool"
7361
+ prefer_spark: "bool"
7010
7362
 
7011
- def __init__(self,use_spark: "bool"):
7012
- self.use_spark = use_spark
7363
+ def __init__(self,prefer_spark: "bool"):
7364
+ self.prefer_spark = prefer_spark
7013
7365
 
7014
7366
  def __str__(self):
7015
- return "SendPaymentOptions.BOLT11_INVOICE(use_spark={})".format(self.use_spark)
7367
+ return "SendPaymentOptions.BOLT11_INVOICE(prefer_spark={})".format(self.prefer_spark)
7016
7368
 
7017
7369
  def __eq__(self, other):
7018
7370
  if not other.is_bolt11_invoice():
7019
7371
  return False
7020
- if self.use_spark != other.use_spark:
7372
+ if self.prefer_spark != other.prefer_spark:
7021
7373
  return False
7022
7374
  return True
7023
7375
 
@@ -7060,7 +7412,7 @@ class _UniffiConverterTypeSendPaymentOptions(_UniffiConverterRustBuffer):
7060
7412
  _UniffiConverterTypeOnchainConfirmationSpeed.check_lower(value.confirmation_speed)
7061
7413
  return
7062
7414
  if value.is_bolt11_invoice():
7063
- _UniffiConverterBool.check_lower(value.use_spark)
7415
+ _UniffiConverterBool.check_lower(value.prefer_spark)
7064
7416
  return
7065
7417
  raise ValueError(value)
7066
7418
 
@@ -7071,7 +7423,7 @@ class _UniffiConverterTypeSendPaymentOptions(_UniffiConverterRustBuffer):
7071
7423
  _UniffiConverterTypeOnchainConfirmationSpeed.write(value.confirmation_speed, buf)
7072
7424
  if value.is_bolt11_invoice():
7073
7425
  buf.write_i32(2)
7074
- _UniffiConverterBool.write(value.use_spark, buf)
7426
+ _UniffiConverterBool.write(value.prefer_spark, buf)
7075
7427
 
7076
7428
 
7077
7429
 
@@ -7851,6 +8203,56 @@ class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
7851
8203
  _UniffiConverterTypeUtxo.read(buf) for i in range(count)
7852
8204
  ]
7853
8205
 
8206
+
8207
+
8208
+ class _UniffiConverterSequenceTypeFiatCurrency(_UniffiConverterRustBuffer):
8209
+ @classmethod
8210
+ def check_lower(cls, value):
8211
+ for item in value:
8212
+ _UniffiConverterTypeFiatCurrency.check_lower(item)
8213
+
8214
+ @classmethod
8215
+ def write(cls, value, buf):
8216
+ items = len(value)
8217
+ buf.write_i32(items)
8218
+ for item in value:
8219
+ _UniffiConverterTypeFiatCurrency.write(item, buf)
8220
+
8221
+ @classmethod
8222
+ def read(cls, buf):
8223
+ count = buf.read_i32()
8224
+ if count < 0:
8225
+ raise InternalError("Unexpected negative sequence length")
8226
+
8227
+ return [
8228
+ _UniffiConverterTypeFiatCurrency.read(buf) for i in range(count)
8229
+ ]
8230
+
8231
+
8232
+
8233
+ class _UniffiConverterSequenceTypeRate(_UniffiConverterRustBuffer):
8234
+ @classmethod
8235
+ def check_lower(cls, value):
8236
+ for item in value:
8237
+ _UniffiConverterTypeRate.check_lower(item)
8238
+
8239
+ @classmethod
8240
+ def write(cls, value, buf):
8241
+ items = len(value)
8242
+ buf.write_i32(items)
8243
+ for item in value:
8244
+ _UniffiConverterTypeRate.write(item, buf)
8245
+
8246
+ @classmethod
8247
+ def read(cls, buf):
8248
+ count = buf.read_i32()
8249
+ if count < 0:
8250
+ raise InternalError("Unexpected negative sequence length")
8251
+
8252
+ return [
8253
+ _UniffiConverterTypeRate.read(buf) for i in range(count)
8254
+ ]
8255
+
7854
8256
  # External type BitcoinAddressDetails is in namespace "breez_sdk_common", crate breez_sdk_common
7855
8257
 
7856
8258
 
@@ -7861,6 +8263,16 @@ class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
7861
8263
 
7862
8264
 
7863
8265
 
8266
+ # External type FiatCurrency is in namespace "breez_sdk_common", crate breez_sdk_common
8267
+
8268
+
8269
+
8270
+
8271
+ # External type FiatService is in namespace "breez_sdk_common", crate breez_sdk_common
8272
+
8273
+
8274
+
8275
+
7864
8276
  # External type InputType is in namespace "breez_sdk_common", crate breez_sdk_common
7865
8277
 
7866
8278
 
@@ -7871,6 +8283,11 @@ class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
7871
8283
 
7872
8284
 
7873
8285
 
8286
+ # External type Rate is in namespace "breez_sdk_common", crate breez_sdk_common
8287
+
8288
+
8289
+
8290
+
7874
8291
  # External type RestClient is in namespace "breez_sdk_common", crate breez_sdk_common
7875
8292
 
7876
8293
 
@@ -8086,6 +8503,7 @@ __all__ = [
8086
8503
  "ReceivePaymentMethod",
8087
8504
  "SdkError",
8088
8505
  "SdkEvent",
8506
+ "Seed",
8089
8507
  "SendPaymentMethod",
8090
8508
  "SendPaymentOptions",
8091
8509
  "StorageError",
@@ -8102,6 +8520,8 @@ __all__ = [
8102
8520
  "GetPaymentRequest",
8103
8521
  "GetPaymentResponse",
8104
8522
  "LightningAddressInfo",
8523
+ "ListFiatCurrenciesResponse",
8524
+ "ListFiatRatesResponse",
8105
8525
  "ListPaymentsRequest",
8106
8526
  "ListPaymentsResponse",
8107
8527
  "ListUnclaimedDepositsRequest",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: breez_sdk_spark
3
- Version: 0.1.9.dev2
3
+ Version: 0.2.0
4
4
  Summary: Python language bindings for the Breez Spark SDK
5
5
  Home-page: https://github.com/breez/spark-sdk
6
6
  Author: Breez <contact@breez.technology>
@@ -0,0 +1,9 @@
1
+ breez_sdk_spark/__init__.py,sha256=Rmo1pY5ISvxSNwDo_RBCneMCfoYDNbB_4A7VCmQmtEI,148
2
+ breez_sdk_spark/breez_sdk_common.py,sha256=cdFqiHbDKhnyftMiQRJ30XPHUoGVHDu1gAyeM4EMg_w,202759
3
+ breez_sdk_spark/breez_sdk_spark.py,sha256=mcq6u6AUiv-o7QqAd7yjWw-p4IdY434tybmyeD2H4Ls,306414
4
+ breez_sdk_spark/breez_sdk_spark_bindings.py,sha256=ysAJqyrIhXUjJIBj856CADqim5MR38CgNEIdG1Fj4qg,32901
5
+ breez_sdk_spark/libbreez_sdk_spark_bindings.dylib,sha256=D5-AH_IQhux_d1Pd-YUZ9Jns7rCcxJSMa4guCWhk-T0,32227328
6
+ breez_sdk_spark-0.2.0.dist-info/METADATA,sha256=AWSgoX-8t6e-haC4ohp9h3SBPl16cUn3Sz-LFnomIHk,545
7
+ breez_sdk_spark-0.2.0.dist-info/WHEEL,sha256=o0zAoJUNILGJZxEeFPjb7OMHp_94eqIkZBeZ0gvgOpo,114
8
+ breez_sdk_spark-0.2.0.dist-info/top_level.txt,sha256=EWjZB7jCSH5bjyOrFhpRFW4Jfo8ykKdxJ7tqAOytwDU,16
9
+ breez_sdk_spark-0.2.0.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- breez_sdk_spark/__init__.py,sha256=Rmo1pY5ISvxSNwDo_RBCneMCfoYDNbB_4A7VCmQmtEI,148
2
- breez_sdk_spark/breez_sdk_common.py,sha256=4MjvVqRUxGdMOkWy_YXQ9hFaibt--rG2DfOgpBRl6ig,191744
3
- breez_sdk_spark/breez_sdk_spark.py,sha256=F195p-cfDw5NpXgxtrUBwDeRvvRoqKnzpR3wRP7d8fo,292946
4
- breez_sdk_spark/breez_sdk_spark_bindings.py,sha256=ysAJqyrIhXUjJIBj856CADqim5MR38CgNEIdG1Fj4qg,32901
5
- breez_sdk_spark/libbreez_sdk_spark_bindings.dylib,sha256=BkMfwodjAqUP3CmbC8R6ESA0AQDhGolUzruw5g7DYks,31917248
6
- breez_sdk_spark-0.1.9.dev2.dist-info/METADATA,sha256=fc-5mKAmq-LFN0QEqn0NF9qxfa5oYDNhJUGmmiPCvL8,550
7
- breez_sdk_spark-0.1.9.dev2.dist-info/WHEEL,sha256=o0zAoJUNILGJZxEeFPjb7OMHp_94eqIkZBeZ0gvgOpo,114
8
- breez_sdk_spark-0.1.9.dev2.dist-info/top_level.txt,sha256=EWjZB7jCSH5bjyOrFhpRFW4Jfo8ykKdxJ7tqAOytwDU,16
9
- breez_sdk_spark-0.1.9.dev2.dist-info/RECORD,,