breez-sdk-spark 0.1.9__cp310-cp310-win32.whl → 0.2.0__cp310-cp310-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.
- breez_sdk_spark/breez_sdk_common.py +366 -67
- breez_sdk_spark/breez_sdk_spark.py +616 -42
- breez_sdk_spark/breez_sdk_spark_bindings.dll +0 -0
- {breez_sdk_spark-0.1.9.dist-info → breez_sdk_spark-0.2.0.dist-info}/METADATA +1 -1
- breez_sdk_spark-0.2.0.dist-info/RECORD +11 -0
- breez_sdk_spark-0.1.9.dist-info/RECORD +0 -11
- {breez_sdk_spark-0.1.9.dist-info → breez_sdk_spark-0.2.0.dist-info}/WHEEL +0 -0
- {breez_sdk_spark-0.1.9.dist-info → breez_sdk_spark-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -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
|
|
@@ -486,7 +495,7 @@ def _uniffi_check_api_checksums(lib):
|
|
|
486
495
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
487
496
|
if lib.uniffi_breez_sdk_spark_checksum_func_default_config() != 62194:
|
|
488
497
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
489
|
-
if lib.uniffi_breez_sdk_spark_checksum_func_default_storage() !=
|
|
498
|
+
if lib.uniffi_breez_sdk_spark_checksum_func_default_storage() != 46285:
|
|
490
499
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
491
500
|
if lib.uniffi_breez_sdk_spark_checksum_func_init_logging() != 8518:
|
|
492
501
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
@@ -514,13 +523,17 @@ 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:
|
|
520
533
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
521
534
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() != 10147:
|
|
522
535
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
523
|
-
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() !=
|
|
536
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_poll_lightning_send_payment() != 57601:
|
|
524
537
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
525
538
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() != 37691:
|
|
526
539
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
@@ -546,6 +559,10 @@ 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")
|
|
564
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set() != 55523:
|
|
565
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
549
566
|
if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client() != 61720:
|
|
550
567
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
551
568
|
if lib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_rest_chain_service() != 56288:
|
|
@@ -572,7 +589,7 @@ def _uniffi_check_api_checksums(lib):
|
|
|
572
589
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
573
590
|
if lib.uniffi_breez_sdk_spark_checksum_method_storage_update_deposit() != 48478:
|
|
574
591
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
575
|
-
if lib.uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() !=
|
|
592
|
+
if lib.uniffi_breez_sdk_spark_checksum_constructor_sdkbuilder_new() != 53882:
|
|
576
593
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
577
594
|
if lib.uniffi_breez_sdk_spark_checksum_method_eventlistener_on_event() != 10824:
|
|
578
595
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
@@ -828,6 +845,14 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_get_payment.argtypes = (
|
|
|
828
845
|
_UniffiRustBuffer,
|
|
829
846
|
)
|
|
830
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
|
|
831
856
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_list_payments.argtypes = (
|
|
832
857
|
ctypes.c_void_p,
|
|
833
858
|
_UniffiRustBuffer,
|
|
@@ -846,6 +871,7 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.restype = ctypes.
|
|
|
846
871
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment.argtypes = (
|
|
847
872
|
ctypes.c_void_p,
|
|
848
873
|
_UniffiRustBuffer,
|
|
874
|
+
_UniffiRustBuffer,
|
|
849
875
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
850
876
|
)
|
|
851
877
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment.restype = None
|
|
@@ -927,6 +953,17 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_chain_service.argtyp
|
|
|
927
953
|
ctypes.c_void_p,
|
|
928
954
|
)
|
|
929
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
|
|
961
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set.argtypes = (
|
|
962
|
+
ctypes.c_void_p,
|
|
963
|
+
_UniffiRustBuffer,
|
|
964
|
+
ctypes.c_int8,
|
|
965
|
+
)
|
|
966
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set.restype = ctypes.c_uint64
|
|
930
967
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_lnurl_client.argtypes = (
|
|
931
968
|
ctypes.c_void_p,
|
|
932
969
|
ctypes.c_void_p,
|
|
@@ -1033,8 +1070,9 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_func_default_config.argtypes = (
|
|
|
1033
1070
|
_UniffiLib.uniffi_breez_sdk_spark_fn_func_default_config.restype = _UniffiRustBuffer
|
|
1034
1071
|
_UniffiLib.uniffi_breez_sdk_spark_fn_func_default_storage.argtypes = (
|
|
1035
1072
|
_UniffiRustBuffer,
|
|
1073
|
+
ctypes.POINTER(_UniffiRustCallStatus),
|
|
1036
1074
|
)
|
|
1037
|
-
_UniffiLib.uniffi_breez_sdk_spark_fn_func_default_storage.restype = ctypes.
|
|
1075
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_func_default_storage.restype = ctypes.c_void_p
|
|
1038
1076
|
_UniffiLib.uniffi_breez_sdk_spark_fn_func_init_logging.argtypes = (
|
|
1039
1077
|
_UniffiRustBuffer,
|
|
1040
1078
|
_UniffiRustBuffer,
|
|
@@ -1362,6 +1400,12 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_lightning_address
|
|
|
1362
1400
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_get_payment.argtypes = (
|
|
1363
1401
|
)
|
|
1364
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
|
|
1365
1409
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments.argtypes = (
|
|
1366
1410
|
)
|
|
1367
1411
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_payments.restype = ctypes.c_uint16
|
|
@@ -1410,6 +1454,12 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_build.restype = cty
|
|
|
1410
1454
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_chain_service.argtypes = (
|
|
1411
1455
|
)
|
|
1412
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
|
|
1460
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set.argtypes = (
|
|
1461
|
+
)
|
|
1462
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_key_set.restype = ctypes.c_uint16
|
|
1413
1463
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client.argtypes = (
|
|
1414
1464
|
)
|
|
1415
1465
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_sdkbuilder_with_lnurl_client.restype = ctypes.c_uint16
|
|
@@ -1547,6 +1597,26 @@ class _UniffiConverterString:
|
|
|
1547
1597
|
builder.write(value.encode("utf-8"))
|
|
1548
1598
|
return builder.finalize()
|
|
1549
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
|
+
|
|
1550
1620
|
|
|
1551
1621
|
|
|
1552
1622
|
class BitcoinChainService(typing.Protocol):
|
|
@@ -1876,6 +1946,19 @@ class BreezSdkProtocol(typing.Protocol):
|
|
|
1876
1946
|
def get_lightning_address(self, ):
|
|
1877
1947
|
raise NotImplementedError
|
|
1878
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
|
+
|
|
1879
1962
|
raise NotImplementedError
|
|
1880
1963
|
def list_payments(self, request: "ListPaymentsRequest"):
|
|
1881
1964
|
"""
|
|
@@ -1900,7 +1983,7 @@ class BreezSdkProtocol(typing.Protocol):
|
|
|
1900
1983
|
raise NotImplementedError
|
|
1901
1984
|
def lnurl_pay(self, request: "LnurlPayRequest"):
|
|
1902
1985
|
raise NotImplementedError
|
|
1903
|
-
def poll_lightning_send_payment(self,
|
|
1986
|
+
def poll_lightning_send_payment(self, payment: "Payment",ssp_id: "str"):
|
|
1904
1987
|
raise NotImplementedError
|
|
1905
1988
|
def prepare_lnurl_pay(self, request: "PrepareLnurlPayRequest"):
|
|
1906
1989
|
raise NotImplementedError
|
|
@@ -2142,6 +2225,51 @@ _UniffiConverterTypeSdkError,
|
|
|
2142
2225
|
|
|
2143
2226
|
|
|
2144
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
|
+
|
|
2145
2273
|
async def list_payments(self, request: "ListPaymentsRequest") -> "ListPaymentsResponse":
|
|
2146
2274
|
"""
|
|
2147
2275
|
Lists payments from the storage with pagination
|
|
@@ -2223,11 +2351,14 @@ _UniffiConverterTypeSdkError,
|
|
|
2223
2351
|
|
|
2224
2352
|
|
|
2225
2353
|
|
|
2226
|
-
def poll_lightning_send_payment(self,
|
|
2227
|
-
|
|
2354
|
+
def poll_lightning_send_payment(self, payment: "Payment",ssp_id: "str") -> None:
|
|
2355
|
+
_UniffiConverterTypePayment.check_lower(payment)
|
|
2356
|
+
|
|
2357
|
+
_UniffiConverterString.check_lower(ssp_id)
|
|
2228
2358
|
|
|
2229
2359
|
_uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_poll_lightning_send_payment,self._uniffi_clone_pointer(),
|
|
2230
|
-
|
|
2360
|
+
_UniffiConverterTypePayment.lower(payment),
|
|
2361
|
+
_UniffiConverterString.lower(ssp_id))
|
|
2231
2362
|
|
|
2232
2363
|
|
|
2233
2364
|
|
|
@@ -2495,6 +2626,23 @@ class SdkBuilderProtocol(typing.Protocol):
|
|
|
2495
2626
|
- `chain_service`: The chain service to be used.
|
|
2496
2627
|
"""
|
|
2497
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
|
+
|
|
2637
|
+
raise NotImplementedError
|
|
2638
|
+
def with_key_set(self, key_set_type: "KeySetType",use_address_index: "bool"):
|
|
2639
|
+
"""
|
|
2640
|
+
Sets the key set type to be used by the SDK.
|
|
2641
|
+
Arguments:
|
|
2642
|
+
- `key_set_type`: The key set type which determines the derivation path.
|
|
2643
|
+
- `use_address_index`: Controls the structure of the BIP derivation path.
|
|
2644
|
+
"""
|
|
2645
|
+
|
|
2498
2646
|
raise NotImplementedError
|
|
2499
2647
|
def with_lnurl_client(self, lnurl_client: "RestClient"):
|
|
2500
2648
|
raise NotImplementedError
|
|
@@ -2515,24 +2663,24 @@ class SdkBuilder:
|
|
|
2515
2663
|
"""
|
|
2516
2664
|
|
|
2517
2665
|
_pointer: ctypes.c_void_p
|
|
2518
|
-
def __init__(self, config: "Config",
|
|
2666
|
+
def __init__(self, config: "Config",seed: "Seed",storage: "Storage"):
|
|
2519
2667
|
"""
|
|
2520
2668
|
Creates a new `SdkBuilder` with the provided configuration.
|
|
2521
2669
|
Arguments:
|
|
2522
2670
|
- `config`: The configuration to be used.
|
|
2523
|
-
- `
|
|
2671
|
+
- `seed`: The seed for wallet generation.
|
|
2524
2672
|
- `storage`: The storage backend to be used.
|
|
2525
2673
|
"""
|
|
2526
2674
|
|
|
2527
2675
|
_UniffiConverterTypeConfig.check_lower(config)
|
|
2528
2676
|
|
|
2529
|
-
|
|
2677
|
+
_UniffiConverterTypeSeed.check_lower(seed)
|
|
2530
2678
|
|
|
2531
2679
|
_UniffiConverterTypeStorage.check_lower(storage)
|
|
2532
2680
|
|
|
2533
2681
|
self._pointer = _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_constructor_sdkbuilder_new,
|
|
2534
2682
|
_UniffiConverterTypeConfig.lower(config),
|
|
2535
|
-
|
|
2683
|
+
_UniffiConverterTypeSeed.lower(seed),
|
|
2536
2684
|
_UniffiConverterTypeStorage.lower(storage))
|
|
2537
2685
|
|
|
2538
2686
|
def __del__(self):
|
|
@@ -2605,6 +2753,70 @@ _UniffiConverterTypeSdkError,
|
|
|
2605
2753
|
|
|
2606
2754
|
|
|
2607
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
|
+
|
|
2786
|
+
async def with_key_set(self, key_set_type: "KeySetType",use_address_index: "bool") -> None:
|
|
2787
|
+
|
|
2788
|
+
"""
|
|
2789
|
+
Sets the key set type to be used by the SDK.
|
|
2790
|
+
Arguments:
|
|
2791
|
+
- `key_set_type`: The key set type which determines the derivation path.
|
|
2792
|
+
- `use_address_index`: Controls the structure of the BIP derivation path.
|
|
2793
|
+
"""
|
|
2794
|
+
|
|
2795
|
+
_UniffiConverterTypeKeySetType.check_lower(key_set_type)
|
|
2796
|
+
|
|
2797
|
+
_UniffiConverterBool.check_lower(use_address_index)
|
|
2798
|
+
|
|
2799
|
+
return await _uniffi_rust_call_async(
|
|
2800
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_sdkbuilder_with_key_set(
|
|
2801
|
+
self._uniffi_clone_pointer(),
|
|
2802
|
+
_UniffiConverterTypeKeySetType.lower(key_set_type),
|
|
2803
|
+
_UniffiConverterBool.lower(use_address_index)
|
|
2804
|
+
),
|
|
2805
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_void,
|
|
2806
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_void,
|
|
2807
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_void,
|
|
2808
|
+
# lift function
|
|
2809
|
+
lambda val: None,
|
|
2810
|
+
|
|
2811
|
+
|
|
2812
|
+
# Error FFI converter
|
|
2813
|
+
|
|
2814
|
+
None,
|
|
2815
|
+
|
|
2816
|
+
)
|
|
2817
|
+
|
|
2818
|
+
|
|
2819
|
+
|
|
2608
2820
|
async def with_lnurl_client(self, lnurl_client: "RestClient") -> None:
|
|
2609
2821
|
|
|
2610
2822
|
_UniffiConverterTypeRestClient.check_lower(lnurl_client)
|
|
@@ -3744,15 +3956,23 @@ class Config:
|
|
|
3744
3956
|
The domain used for receiving through lnurl-pay and lightning address.
|
|
3745
3957
|
"""
|
|
3746
3958
|
|
|
3747
|
-
|
|
3959
|
+
prefer_spark_over_lightning: "bool"
|
|
3960
|
+
"""
|
|
3961
|
+
When this is set to `true` we will prefer to use spark payments over
|
|
3962
|
+
lightning when sending and receiving. This has the benefit of lower fees
|
|
3963
|
+
but is at the cost of privacy.
|
|
3964
|
+
"""
|
|
3965
|
+
|
|
3966
|
+
def __init__(self, *, api_key: "typing.Optional[str]", network: "Network", sync_interval_secs: "int", max_deposit_claim_fee: "typing.Optional[Fee]", lnurl_domain: "typing.Optional[str]", prefer_spark_over_lightning: "bool"):
|
|
3748
3967
|
self.api_key = api_key
|
|
3749
3968
|
self.network = network
|
|
3750
3969
|
self.sync_interval_secs = sync_interval_secs
|
|
3751
3970
|
self.max_deposit_claim_fee = max_deposit_claim_fee
|
|
3752
3971
|
self.lnurl_domain = lnurl_domain
|
|
3972
|
+
self.prefer_spark_over_lightning = prefer_spark_over_lightning
|
|
3753
3973
|
|
|
3754
3974
|
def __str__(self):
|
|
3755
|
-
return "Config(api_key={}, network={}, sync_interval_secs={}, max_deposit_claim_fee={}, lnurl_domain={})".format(self.api_key, self.network, self.sync_interval_secs, self.max_deposit_claim_fee, self.lnurl_domain)
|
|
3975
|
+
return "Config(api_key={}, network={}, sync_interval_secs={}, max_deposit_claim_fee={}, lnurl_domain={}, prefer_spark_over_lightning={})".format(self.api_key, self.network, self.sync_interval_secs, self.max_deposit_claim_fee, self.lnurl_domain, self.prefer_spark_over_lightning)
|
|
3756
3976
|
|
|
3757
3977
|
def __eq__(self, other):
|
|
3758
3978
|
if self.api_key != other.api_key:
|
|
@@ -3765,6 +3985,8 @@ class Config:
|
|
|
3765
3985
|
return False
|
|
3766
3986
|
if self.lnurl_domain != other.lnurl_domain:
|
|
3767
3987
|
return False
|
|
3988
|
+
if self.prefer_spark_over_lightning != other.prefer_spark_over_lightning:
|
|
3989
|
+
return False
|
|
3768
3990
|
return True
|
|
3769
3991
|
|
|
3770
3992
|
class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
|
|
@@ -3776,6 +3998,7 @@ class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
|
|
|
3776
3998
|
sync_interval_secs=_UniffiConverterUInt32.read(buf),
|
|
3777
3999
|
max_deposit_claim_fee=_UniffiConverterOptionalTypeFee.read(buf),
|
|
3778
4000
|
lnurl_domain=_UniffiConverterOptionalString.read(buf),
|
|
4001
|
+
prefer_spark_over_lightning=_UniffiConverterBool.read(buf),
|
|
3779
4002
|
)
|
|
3780
4003
|
|
|
3781
4004
|
@staticmethod
|
|
@@ -3785,6 +4008,7 @@ class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
|
|
|
3785
4008
|
_UniffiConverterUInt32.check_lower(value.sync_interval_secs)
|
|
3786
4009
|
_UniffiConverterOptionalTypeFee.check_lower(value.max_deposit_claim_fee)
|
|
3787
4010
|
_UniffiConverterOptionalString.check_lower(value.lnurl_domain)
|
|
4011
|
+
_UniffiConverterBool.check_lower(value.prefer_spark_over_lightning)
|
|
3788
4012
|
|
|
3789
4013
|
@staticmethod
|
|
3790
4014
|
def write(value, buf):
|
|
@@ -3793,24 +4017,25 @@ class _UniffiConverterTypeConfig(_UniffiConverterRustBuffer):
|
|
|
3793
4017
|
_UniffiConverterUInt32.write(value.sync_interval_secs, buf)
|
|
3794
4018
|
_UniffiConverterOptionalTypeFee.write(value.max_deposit_claim_fee, buf)
|
|
3795
4019
|
_UniffiConverterOptionalString.write(value.lnurl_domain, buf)
|
|
4020
|
+
_UniffiConverterBool.write(value.prefer_spark_over_lightning, buf)
|
|
3796
4021
|
|
|
3797
4022
|
|
|
3798
4023
|
class ConnectRequest:
|
|
3799
4024
|
config: "Config"
|
|
3800
|
-
|
|
4025
|
+
seed: "Seed"
|
|
3801
4026
|
storage_dir: "str"
|
|
3802
|
-
def __init__(self, *, config: "Config",
|
|
4027
|
+
def __init__(self, *, config: "Config", seed: "Seed", storage_dir: "str"):
|
|
3803
4028
|
self.config = config
|
|
3804
|
-
self.
|
|
4029
|
+
self.seed = seed
|
|
3805
4030
|
self.storage_dir = storage_dir
|
|
3806
4031
|
|
|
3807
4032
|
def __str__(self):
|
|
3808
|
-
return "ConnectRequest(config={},
|
|
4033
|
+
return "ConnectRequest(config={}, seed={}, storage_dir={})".format(self.config, self.seed, self.storage_dir)
|
|
3809
4034
|
|
|
3810
4035
|
def __eq__(self, other):
|
|
3811
4036
|
if self.config != other.config:
|
|
3812
4037
|
return False
|
|
3813
|
-
if self.
|
|
4038
|
+
if self.seed != other.seed:
|
|
3814
4039
|
return False
|
|
3815
4040
|
if self.storage_dir != other.storage_dir:
|
|
3816
4041
|
return False
|
|
@@ -3821,20 +4046,20 @@ class _UniffiConverterTypeConnectRequest(_UniffiConverterRustBuffer):
|
|
|
3821
4046
|
def read(buf):
|
|
3822
4047
|
return ConnectRequest(
|
|
3823
4048
|
config=_UniffiConverterTypeConfig.read(buf),
|
|
3824
|
-
|
|
4049
|
+
seed=_UniffiConverterTypeSeed.read(buf),
|
|
3825
4050
|
storage_dir=_UniffiConverterString.read(buf),
|
|
3826
4051
|
)
|
|
3827
4052
|
|
|
3828
4053
|
@staticmethod
|
|
3829
4054
|
def check_lower(value):
|
|
3830
4055
|
_UniffiConverterTypeConfig.check_lower(value.config)
|
|
3831
|
-
|
|
4056
|
+
_UniffiConverterTypeSeed.check_lower(value.seed)
|
|
3832
4057
|
_UniffiConverterString.check_lower(value.storage_dir)
|
|
3833
4058
|
|
|
3834
4059
|
@staticmethod
|
|
3835
4060
|
def write(value, buf):
|
|
3836
4061
|
_UniffiConverterTypeConfig.write(value.config, buf)
|
|
3837
|
-
|
|
4062
|
+
_UniffiConverterTypeSeed.write(value.seed, buf)
|
|
3838
4063
|
_UniffiConverterString.write(value.storage_dir, buf)
|
|
3839
4064
|
|
|
3840
4065
|
|
|
@@ -4110,6 +4335,80 @@ class _UniffiConverterTypeLightningAddressInfo(_UniffiConverterRustBuffer):
|
|
|
4110
4335
|
_UniffiConverterString.write(value.username, buf)
|
|
4111
4336
|
|
|
4112
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
|
+
|
|
4113
4412
|
class ListPaymentsRequest:
|
|
4114
4413
|
"""
|
|
4115
4414
|
Request to list payments with pagination
|
|
@@ -5615,6 +5914,68 @@ class _UniffiConverterTypeFee(_UniffiConverterRustBuffer):
|
|
|
5615
5914
|
|
|
5616
5915
|
|
|
5617
5916
|
|
|
5917
|
+
class KeySetType(enum.Enum):
|
|
5918
|
+
DEFAULT = 0
|
|
5919
|
+
|
|
5920
|
+
TAPROOT = 1
|
|
5921
|
+
|
|
5922
|
+
NATIVE_SEGWIT = 2
|
|
5923
|
+
|
|
5924
|
+
WRAPPED_SEGWIT = 3
|
|
5925
|
+
|
|
5926
|
+
LEGACY = 4
|
|
5927
|
+
|
|
5928
|
+
|
|
5929
|
+
|
|
5930
|
+
class _UniffiConverterTypeKeySetType(_UniffiConverterRustBuffer):
|
|
5931
|
+
@staticmethod
|
|
5932
|
+
def read(buf):
|
|
5933
|
+
variant = buf.read_i32()
|
|
5934
|
+
if variant == 1:
|
|
5935
|
+
return KeySetType.DEFAULT
|
|
5936
|
+
if variant == 2:
|
|
5937
|
+
return KeySetType.TAPROOT
|
|
5938
|
+
if variant == 3:
|
|
5939
|
+
return KeySetType.NATIVE_SEGWIT
|
|
5940
|
+
if variant == 4:
|
|
5941
|
+
return KeySetType.WRAPPED_SEGWIT
|
|
5942
|
+
if variant == 5:
|
|
5943
|
+
return KeySetType.LEGACY
|
|
5944
|
+
raise InternalError("Raw enum value doesn't match any cases")
|
|
5945
|
+
|
|
5946
|
+
@staticmethod
|
|
5947
|
+
def check_lower(value):
|
|
5948
|
+
if value == KeySetType.DEFAULT:
|
|
5949
|
+
return
|
|
5950
|
+
if value == KeySetType.TAPROOT:
|
|
5951
|
+
return
|
|
5952
|
+
if value == KeySetType.NATIVE_SEGWIT:
|
|
5953
|
+
return
|
|
5954
|
+
if value == KeySetType.WRAPPED_SEGWIT:
|
|
5955
|
+
return
|
|
5956
|
+
if value == KeySetType.LEGACY:
|
|
5957
|
+
return
|
|
5958
|
+
raise ValueError(value)
|
|
5959
|
+
|
|
5960
|
+
@staticmethod
|
|
5961
|
+
def write(value, buf):
|
|
5962
|
+
if value == KeySetType.DEFAULT:
|
|
5963
|
+
buf.write_i32(1)
|
|
5964
|
+
if value == KeySetType.TAPROOT:
|
|
5965
|
+
buf.write_i32(2)
|
|
5966
|
+
if value == KeySetType.NATIVE_SEGWIT:
|
|
5967
|
+
buf.write_i32(3)
|
|
5968
|
+
if value == KeySetType.WRAPPED_SEGWIT:
|
|
5969
|
+
buf.write_i32(4)
|
|
5970
|
+
if value == KeySetType.LEGACY:
|
|
5971
|
+
buf.write_i32(5)
|
|
5972
|
+
|
|
5973
|
+
|
|
5974
|
+
|
|
5975
|
+
|
|
5976
|
+
|
|
5977
|
+
|
|
5978
|
+
|
|
5618
5979
|
class Network(enum.Enum):
|
|
5619
5980
|
MAINNET = 0
|
|
5620
5981
|
|
|
@@ -6588,6 +6949,22 @@ class SdkEvent:
|
|
|
6588
6949
|
return False
|
|
6589
6950
|
return True
|
|
6590
6951
|
|
|
6952
|
+
class PAYMENT_FAILED:
|
|
6953
|
+
payment: "Payment"
|
|
6954
|
+
|
|
6955
|
+
def __init__(self,payment: "Payment"):
|
|
6956
|
+
self.payment = payment
|
|
6957
|
+
|
|
6958
|
+
def __str__(self):
|
|
6959
|
+
return "SdkEvent.PAYMENT_FAILED(payment={})".format(self.payment)
|
|
6960
|
+
|
|
6961
|
+
def __eq__(self, other):
|
|
6962
|
+
if not other.is_payment_failed():
|
|
6963
|
+
return False
|
|
6964
|
+
if self.payment != other.payment:
|
|
6965
|
+
return False
|
|
6966
|
+
return True
|
|
6967
|
+
|
|
6591
6968
|
|
|
6592
6969
|
|
|
6593
6970
|
# For each variant, we have an `is_NAME` method for easily checking
|
|
@@ -6600,6 +6977,8 @@ class SdkEvent:
|
|
|
6600
6977
|
return isinstance(self, SdkEvent.CLAIM_DEPOSITS_SUCCEEDED)
|
|
6601
6978
|
def is_payment_succeeded(self) -> bool:
|
|
6602
6979
|
return isinstance(self, SdkEvent.PAYMENT_SUCCEEDED)
|
|
6980
|
+
def is_payment_failed(self) -> bool:
|
|
6981
|
+
return isinstance(self, SdkEvent.PAYMENT_FAILED)
|
|
6603
6982
|
|
|
6604
6983
|
|
|
6605
6984
|
# Now, a little trick - we make each nested variant class be a subclass of the main
|
|
@@ -6609,6 +6988,7 @@ SdkEvent.SYNCED = type("SdkEvent.SYNCED", (SdkEvent.SYNCED, SdkEvent,), {}) # t
|
|
|
6609
6988
|
SdkEvent.CLAIM_DEPOSITS_FAILED = type("SdkEvent.CLAIM_DEPOSITS_FAILED", (SdkEvent.CLAIM_DEPOSITS_FAILED, SdkEvent,), {}) # type: ignore
|
|
6610
6989
|
SdkEvent.CLAIM_DEPOSITS_SUCCEEDED = type("SdkEvent.CLAIM_DEPOSITS_SUCCEEDED", (SdkEvent.CLAIM_DEPOSITS_SUCCEEDED, SdkEvent,), {}) # type: ignore
|
|
6611
6990
|
SdkEvent.PAYMENT_SUCCEEDED = type("SdkEvent.PAYMENT_SUCCEEDED", (SdkEvent.PAYMENT_SUCCEEDED, SdkEvent,), {}) # type: ignore
|
|
6991
|
+
SdkEvent.PAYMENT_FAILED = type("SdkEvent.PAYMENT_FAILED", (SdkEvent.PAYMENT_FAILED, SdkEvent,), {}) # type: ignore
|
|
6612
6992
|
|
|
6613
6993
|
|
|
6614
6994
|
|
|
@@ -6632,6 +7012,10 @@ class _UniffiConverterTypeSdkEvent(_UniffiConverterRustBuffer):
|
|
|
6632
7012
|
return SdkEvent.PAYMENT_SUCCEEDED(
|
|
6633
7013
|
_UniffiConverterTypePayment.read(buf),
|
|
6634
7014
|
)
|
|
7015
|
+
if variant == 5:
|
|
7016
|
+
return SdkEvent.PAYMENT_FAILED(
|
|
7017
|
+
_UniffiConverterTypePayment.read(buf),
|
|
7018
|
+
)
|
|
6635
7019
|
raise InternalError("Raw enum value doesn't match any cases")
|
|
6636
7020
|
|
|
6637
7021
|
@staticmethod
|
|
@@ -6647,6 +7031,9 @@ class _UniffiConverterTypeSdkEvent(_UniffiConverterRustBuffer):
|
|
|
6647
7031
|
if value.is_payment_succeeded():
|
|
6648
7032
|
_UniffiConverterTypePayment.check_lower(value.payment)
|
|
6649
7033
|
return
|
|
7034
|
+
if value.is_payment_failed():
|
|
7035
|
+
_UniffiConverterTypePayment.check_lower(value.payment)
|
|
7036
|
+
return
|
|
6650
7037
|
raise ValueError(value)
|
|
6651
7038
|
|
|
6652
7039
|
@staticmethod
|
|
@@ -6662,6 +7049,134 @@ class _UniffiConverterTypeSdkEvent(_UniffiConverterRustBuffer):
|
|
|
6662
7049
|
if value.is_payment_succeeded():
|
|
6663
7050
|
buf.write_i32(4)
|
|
6664
7051
|
_UniffiConverterTypePayment.write(value.payment, buf)
|
|
7052
|
+
if value.is_payment_failed():
|
|
7053
|
+
buf.write_i32(5)
|
|
7054
|
+
_UniffiConverterTypePayment.write(value.payment, buf)
|
|
7055
|
+
|
|
7056
|
+
|
|
7057
|
+
|
|
7058
|
+
|
|
7059
|
+
|
|
7060
|
+
|
|
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)
|
|
6665
7180
|
|
|
6666
7181
|
|
|
6667
7182
|
|
|
@@ -6843,18 +7358,18 @@ class SendPaymentOptions:
|
|
|
6843
7358
|
return True
|
|
6844
7359
|
|
|
6845
7360
|
class BOLT11_INVOICE:
|
|
6846
|
-
|
|
7361
|
+
prefer_spark: "bool"
|
|
6847
7362
|
|
|
6848
|
-
def __init__(self,
|
|
6849
|
-
self.
|
|
7363
|
+
def __init__(self,prefer_spark: "bool"):
|
|
7364
|
+
self.prefer_spark = prefer_spark
|
|
6850
7365
|
|
|
6851
7366
|
def __str__(self):
|
|
6852
|
-
return "SendPaymentOptions.BOLT11_INVOICE(
|
|
7367
|
+
return "SendPaymentOptions.BOLT11_INVOICE(prefer_spark={})".format(self.prefer_spark)
|
|
6853
7368
|
|
|
6854
7369
|
def __eq__(self, other):
|
|
6855
7370
|
if not other.is_bolt11_invoice():
|
|
6856
7371
|
return False
|
|
6857
|
-
if self.
|
|
7372
|
+
if self.prefer_spark != other.prefer_spark:
|
|
6858
7373
|
return False
|
|
6859
7374
|
return True
|
|
6860
7375
|
|
|
@@ -6897,7 +7412,7 @@ class _UniffiConverterTypeSendPaymentOptions(_UniffiConverterRustBuffer):
|
|
|
6897
7412
|
_UniffiConverterTypeOnchainConfirmationSpeed.check_lower(value.confirmation_speed)
|
|
6898
7413
|
return
|
|
6899
7414
|
if value.is_bolt11_invoice():
|
|
6900
|
-
_UniffiConverterBool.check_lower(value.
|
|
7415
|
+
_UniffiConverterBool.check_lower(value.prefer_spark)
|
|
6901
7416
|
return
|
|
6902
7417
|
raise ValueError(value)
|
|
6903
7418
|
|
|
@@ -6908,7 +7423,7 @@ class _UniffiConverterTypeSendPaymentOptions(_UniffiConverterRustBuffer):
|
|
|
6908
7423
|
_UniffiConverterTypeOnchainConfirmationSpeed.write(value.confirmation_speed, buf)
|
|
6909
7424
|
if value.is_bolt11_invoice():
|
|
6910
7425
|
buf.write_i32(2)
|
|
6911
|
-
_UniffiConverterBool.write(value.
|
|
7426
|
+
_UniffiConverterBool.write(value.prefer_spark, buf)
|
|
6912
7427
|
|
|
6913
7428
|
|
|
6914
7429
|
|
|
@@ -7688,6 +8203,56 @@ class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
|
|
|
7688
8203
|
_UniffiConverterTypeUtxo.read(buf) for i in range(count)
|
|
7689
8204
|
]
|
|
7690
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
|
+
|
|
7691
8256
|
# External type BitcoinAddressDetails is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
7692
8257
|
|
|
7693
8258
|
|
|
@@ -7698,6 +8263,16 @@ class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
|
|
|
7698
8263
|
|
|
7699
8264
|
|
|
7700
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
|
+
|
|
7701
8276
|
# External type InputType is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
7702
8277
|
|
|
7703
8278
|
|
|
@@ -7708,6 +8283,11 @@ class _UniffiConverterSequenceTypeUtxo(_UniffiConverterRustBuffer):
|
|
|
7708
8283
|
|
|
7709
8284
|
|
|
7710
8285
|
|
|
8286
|
+
# External type Rate is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
8287
|
+
|
|
8288
|
+
|
|
8289
|
+
|
|
8290
|
+
|
|
7711
8291
|
# External type RestClient is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
7712
8292
|
|
|
7713
8293
|
|
|
@@ -7870,23 +8450,13 @@ def default_config(network: "Network") -> "Config":
|
|
|
7870
8450
|
return _UniffiConverterTypeConfig.lift(_uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_spark_fn_func_default_config,
|
|
7871
8451
|
_UniffiConverterTypeNetwork.lower(network)))
|
|
7872
8452
|
|
|
7873
|
-
async def default_storage(data_dir: "str") -> "Storage":
|
|
7874
8453
|
|
|
8454
|
+
def default_storage(data_dir: "str") -> "Storage":
|
|
7875
8455
|
_UniffiConverterString.check_lower(data_dir)
|
|
7876
8456
|
|
|
7877
|
-
return
|
|
7878
|
-
|
|
7879
|
-
_UniffiConverterString.lower(data_dir)),
|
|
7880
|
-
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_pointer,
|
|
7881
|
-
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_pointer,
|
|
7882
|
-
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_pointer,
|
|
7883
|
-
# lift function
|
|
7884
|
-
_UniffiConverterTypeStorage.lift,
|
|
7885
|
-
|
|
7886
|
-
# Error FFI converter
|
|
7887
|
-
_UniffiConverterTypeSdkError,
|
|
8457
|
+
return _UniffiConverterTypeStorage.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeSdkError,_UniffiLib.uniffi_breez_sdk_spark_fn_func_default_storage,
|
|
8458
|
+
_UniffiConverterString.lower(data_dir)))
|
|
7888
8459
|
|
|
7889
|
-
)
|
|
7890
8460
|
|
|
7891
8461
|
def init_logging(log_dir: "typing.Optional[str]",app_logger: "typing.Optional[Logger]",log_filter: "typing.Optional[str]") -> None:
|
|
7892
8462
|
_UniffiConverterOptionalString.check_lower(log_dir)
|
|
@@ -7923,6 +8493,7 @@ __all__ = [
|
|
|
7923
8493
|
"ChainServiceError",
|
|
7924
8494
|
"DepositClaimError",
|
|
7925
8495
|
"Fee",
|
|
8496
|
+
"KeySetType",
|
|
7926
8497
|
"Network",
|
|
7927
8498
|
"OnchainConfirmationSpeed",
|
|
7928
8499
|
"PaymentDetails",
|
|
@@ -7932,6 +8503,7 @@ __all__ = [
|
|
|
7932
8503
|
"ReceivePaymentMethod",
|
|
7933
8504
|
"SdkError",
|
|
7934
8505
|
"SdkEvent",
|
|
8506
|
+
"Seed",
|
|
7935
8507
|
"SendPaymentMethod",
|
|
7936
8508
|
"SendPaymentOptions",
|
|
7937
8509
|
"StorageError",
|
|
@@ -7948,6 +8520,8 @@ __all__ = [
|
|
|
7948
8520
|
"GetPaymentRequest",
|
|
7949
8521
|
"GetPaymentResponse",
|
|
7950
8522
|
"LightningAddressInfo",
|
|
8523
|
+
"ListFiatCurrenciesResponse",
|
|
8524
|
+
"ListFiatRatesResponse",
|
|
7951
8525
|
"ListPaymentsRequest",
|
|
7952
8526
|
"ListPaymentsResponse",
|
|
7953
8527
|
"ListUnclaimedDepositsRequest",
|