breez-sdk-spark 0.3.2__cp313-cp313-manylinux_2_31_aarch64.whl → 0.3.4__cp313-cp313-manylinux_2_31_aarch64.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 +129 -313
- breez_sdk_spark/breez_sdk_spark.py +806 -36
- breez_sdk_spark/libbreez_sdk_spark_bindings.so +0 -0
- {breez_sdk_spark-0.3.2.dist-info → breez_sdk_spark-0.3.4.dist-info}/METADATA +1 -1
- breez_sdk_spark-0.3.4.dist-info/RECORD +9 -0
- breez_sdk_spark-0.3.2.dist-info/RECORD +0 -9
- {breez_sdk_spark-0.3.2.dist-info → breez_sdk_spark-0.3.4.dist-info}/WHEEL +0 -0
- {breez_sdk_spark-0.3.2.dist-info → breez_sdk_spark-0.3.4.dist-info}/top_level.txt +0 -0
|
@@ -36,8 +36,10 @@ from .breez_sdk_common import FiatCurrency
|
|
|
36
36
|
from .breez_sdk_common import FiatService
|
|
37
37
|
from .breez_sdk_common import InputType
|
|
38
38
|
from .breez_sdk_common import LnurlPayRequestDetails
|
|
39
|
+
from .breez_sdk_common import LnurlWithdrawRequestDetails
|
|
39
40
|
from .breez_sdk_common import Rate
|
|
40
41
|
from .breez_sdk_common import RestClient
|
|
42
|
+
from .breez_sdk_common import SparkInvoiceDetails
|
|
41
43
|
from .breez_sdk_common import SuccessAction
|
|
42
44
|
from .breez_sdk_common import SuccessActionProcessed
|
|
43
45
|
from .breez_sdk_common import _UniffiConverterTypeBitcoinAddressDetails
|
|
@@ -47,8 +49,10 @@ from .breez_sdk_common import _UniffiConverterTypeFiatCurrency
|
|
|
47
49
|
from .breez_sdk_common import _UniffiConverterTypeFiatService
|
|
48
50
|
from .breez_sdk_common import _UniffiConverterTypeInputType
|
|
49
51
|
from .breez_sdk_common import _UniffiConverterTypeLnurlPayRequestDetails
|
|
52
|
+
from .breez_sdk_common import _UniffiConverterTypeLnurlWithdrawRequestDetails
|
|
50
53
|
from .breez_sdk_common import _UniffiConverterTypeRate
|
|
51
54
|
from .breez_sdk_common import _UniffiConverterTypeRestClient
|
|
55
|
+
from .breez_sdk_common import _UniffiConverterTypeSparkInvoiceDetails
|
|
52
56
|
from .breez_sdk_common import _UniffiConverterTypeSuccessAction
|
|
53
57
|
from .breez_sdk_common import _UniffiConverterTypeSuccessActionProcessed
|
|
54
58
|
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferBitcoinAddressDetails
|
|
@@ -58,8 +62,10 @@ from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferFiatCurrency
|
|
|
58
62
|
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferFiatService
|
|
59
63
|
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferInputType
|
|
60
64
|
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferLnurlPayRequestDetails
|
|
65
|
+
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferLnurlWithdrawRequestDetails
|
|
61
66
|
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferRate
|
|
62
67
|
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferRestClient
|
|
68
|
+
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferSparkInvoiceDetails
|
|
63
69
|
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferSuccessAction
|
|
64
70
|
from .breez_sdk_common import _UniffiRustBuffer as _UniffiRustBufferSuccessActionProcessed
|
|
65
71
|
|
|
@@ -514,6 +520,8 @@ def _uniffi_check_api_checksums(lib):
|
|
|
514
520
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
515
521
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available() != 31624:
|
|
516
522
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
523
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_message() != 4385:
|
|
524
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
517
525
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_deposit() != 43529:
|
|
518
526
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
519
527
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_delete_lightning_address() != 44132:
|
|
@@ -538,6 +546,8 @@ def _uniffi_check_api_checksums(lib):
|
|
|
538
546
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
539
547
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay() != 10147:
|
|
540
548
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
549
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_withdraw() != 45652:
|
|
550
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
541
551
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_parse() != 195:
|
|
542
552
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
543
553
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_prepare_lnurl_pay() != 37691:
|
|
@@ -554,6 +564,8 @@ def _uniffi_check_api_checksums(lib):
|
|
|
554
564
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
555
565
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment() != 54349:
|
|
556
566
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
567
|
+
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sign_message() != 57563:
|
|
568
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
557
569
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet() != 30368:
|
|
558
570
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
559
571
|
if lib.uniffi_breez_sdk_spark_checksum_method_breezsdk_wait_for_payment() != 64922:
|
|
@@ -842,6 +854,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_lightning_address_ava
|
|
|
842
854
|
_UniffiRustBuffer,
|
|
843
855
|
)
|
|
844
856
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_lightning_address_available.restype = ctypes.c_uint64
|
|
857
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_message.argtypes = (
|
|
858
|
+
ctypes.c_void_p,
|
|
859
|
+
_UniffiRustBuffer,
|
|
860
|
+
)
|
|
861
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_message.restype = ctypes.c_uint64
|
|
845
862
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_claim_deposit.argtypes = (
|
|
846
863
|
ctypes.c_void_p,
|
|
847
864
|
_UniffiRustBuffer,
|
|
@@ -897,6 +914,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.argtypes = (
|
|
|
897
914
|
_UniffiRustBuffer,
|
|
898
915
|
)
|
|
899
916
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_pay.restype = ctypes.c_uint64
|
|
917
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_withdraw.argtypes = (
|
|
918
|
+
ctypes.c_void_p,
|
|
919
|
+
_UniffiRustBuffer,
|
|
920
|
+
)
|
|
921
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_withdraw.restype = ctypes.c_uint64
|
|
900
922
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_parse.argtypes = (
|
|
901
923
|
ctypes.c_void_p,
|
|
902
924
|
_UniffiRustBuffer,
|
|
@@ -937,6 +959,11 @@ _UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment.argtypes = (
|
|
|
937
959
|
_UniffiRustBuffer,
|
|
938
960
|
)
|
|
939
961
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_send_payment.restype = ctypes.c_uint64
|
|
962
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sign_message.argtypes = (
|
|
963
|
+
ctypes.c_void_p,
|
|
964
|
+
_UniffiRustBuffer,
|
|
965
|
+
)
|
|
966
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sign_message.restype = ctypes.c_uint64
|
|
940
967
|
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sync_wallet.argtypes = (
|
|
941
968
|
ctypes.c_void_p,
|
|
942
969
|
_UniffiRustBuffer,
|
|
@@ -1427,6 +1454,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_add_event_listener.re
|
|
|
1427
1454
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available.argtypes = (
|
|
1428
1455
|
)
|
|
1429
1456
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_lightning_address_available.restype = ctypes.c_uint16
|
|
1457
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_message.argtypes = (
|
|
1458
|
+
)
|
|
1459
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_check_message.restype = ctypes.c_uint16
|
|
1430
1460
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_deposit.argtypes = (
|
|
1431
1461
|
)
|
|
1432
1462
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_claim_deposit.restype = ctypes.c_uint16
|
|
@@ -1463,6 +1493,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_list_unclaimed_deposi
|
|
|
1463
1493
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay.argtypes = (
|
|
1464
1494
|
)
|
|
1465
1495
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_pay.restype = ctypes.c_uint16
|
|
1496
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_withdraw.argtypes = (
|
|
1497
|
+
)
|
|
1498
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_lnurl_withdraw.restype = ctypes.c_uint16
|
|
1466
1499
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_parse.argtypes = (
|
|
1467
1500
|
)
|
|
1468
1501
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_parse.restype = ctypes.c_uint16
|
|
@@ -1487,6 +1520,9 @@ _UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_remove_event_listener
|
|
|
1487
1520
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment.argtypes = (
|
|
1488
1521
|
)
|
|
1489
1522
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_send_payment.restype = ctypes.c_uint16
|
|
1523
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sign_message.argtypes = (
|
|
1524
|
+
)
|
|
1525
|
+
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sign_message.restype = ctypes.c_uint16
|
|
1490
1526
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet.argtypes = (
|
|
1491
1527
|
)
|
|
1492
1528
|
_UniffiLib.uniffi_breez_sdk_spark_checksum_method_breezsdk_sync_wallet.restype = ctypes.c_uint16
|
|
@@ -2031,6 +2067,14 @@ class BreezSdkProtocol(typing.Protocol):
|
|
|
2031
2067
|
|
|
2032
2068
|
raise NotImplementedError
|
|
2033
2069
|
def check_lightning_address_available(self, req: "CheckLightningAddressRequest"):
|
|
2070
|
+
raise NotImplementedError
|
|
2071
|
+
def check_message(self, request: "CheckMessageRequest"):
|
|
2072
|
+
"""
|
|
2073
|
+
Verifies a message signature against the provided public key. The message
|
|
2074
|
+
is SHA256 hashed before verification. The signature can be hex encoded
|
|
2075
|
+
in either DER or compact format.
|
|
2076
|
+
"""
|
|
2077
|
+
|
|
2034
2078
|
raise NotImplementedError
|
|
2035
2079
|
def claim_deposit(self, request: "ClaimDepositRequest"):
|
|
2036
2080
|
raise NotImplementedError
|
|
@@ -2105,6 +2149,36 @@ class BreezSdkProtocol(typing.Protocol):
|
|
|
2105
2149
|
def list_unclaimed_deposits(self, request: "ListUnclaimedDepositsRequest"):
|
|
2106
2150
|
raise NotImplementedError
|
|
2107
2151
|
def lnurl_pay(self, request: "LnurlPayRequest"):
|
|
2152
|
+
raise NotImplementedError
|
|
2153
|
+
def lnurl_withdraw(self, request: "LnurlWithdrawRequest"):
|
|
2154
|
+
"""
|
|
2155
|
+
Performs an LNURL withdraw operation for the amount of satoshis to
|
|
2156
|
+
withdraw and the LNURL withdraw request details. The LNURL withdraw request
|
|
2157
|
+
details can be obtained from calling [`BreezSdk::parse`].
|
|
2158
|
+
|
|
2159
|
+
The method generates a Lightning invoice for the withdraw amount, stores
|
|
2160
|
+
the LNURL withdraw metadata, and performs the LNURL withdraw using the generated
|
|
2161
|
+
invoice.
|
|
2162
|
+
|
|
2163
|
+
If the `completion_timeout_secs` parameter is provided and greater than 0, the
|
|
2164
|
+
method will wait for the payment to be completed within that period. If the
|
|
2165
|
+
withdraw is completed within the timeout, the `payment` field in the response
|
|
2166
|
+
will be set with the payment details. If the `completion_timeout_secs`
|
|
2167
|
+
parameter is not provided or set to 0, the method will not wait for the payment
|
|
2168
|
+
to be completed. If the withdraw is not completed within the
|
|
2169
|
+
timeout, the `payment` field will be empty.
|
|
2170
|
+
|
|
2171
|
+
# Arguments
|
|
2172
|
+
|
|
2173
|
+
* `request` - The LNURL withdraw request
|
|
2174
|
+
|
|
2175
|
+
# Returns
|
|
2176
|
+
|
|
2177
|
+
Result containing either:
|
|
2178
|
+
* `LnurlWithdrawResponse` - The payment details if the withdraw request was successful
|
|
2179
|
+
* `SdkError` - If there was an error during the withdraw process
|
|
2180
|
+
"""
|
|
2181
|
+
|
|
2108
2182
|
raise NotImplementedError
|
|
2109
2183
|
def parse(self, input: "str"):
|
|
2110
2184
|
raise NotImplementedError
|
|
@@ -2133,6 +2207,14 @@ class BreezSdkProtocol(typing.Protocol):
|
|
|
2133
2207
|
|
|
2134
2208
|
raise NotImplementedError
|
|
2135
2209
|
def send_payment(self, request: "SendPaymentRequest"):
|
|
2210
|
+
raise NotImplementedError
|
|
2211
|
+
def sign_message(self, request: "SignMessageRequest"):
|
|
2212
|
+
"""
|
|
2213
|
+
Signs a message with the wallet's identity key. The message is SHA256
|
|
2214
|
+
hashed before signing. The returned signature will be hex encoded in
|
|
2215
|
+
DER format by default, or compact format if specified.
|
|
2216
|
+
"""
|
|
2217
|
+
|
|
2136
2218
|
raise NotImplementedError
|
|
2137
2219
|
def sync_wallet(self, request: "SyncWalletRequest"):
|
|
2138
2220
|
"""
|
|
@@ -2228,6 +2310,33 @@ _UniffiConverterTypeSdkError,
|
|
|
2228
2310
|
|
|
2229
2311
|
|
|
2230
2312
|
|
|
2313
|
+
async def check_message(self, request: "CheckMessageRequest") -> "CheckMessageResponse":
|
|
2314
|
+
"""
|
|
2315
|
+
Verifies a message signature against the provided public key. The message
|
|
2316
|
+
is SHA256 hashed before verification. The signature can be hex encoded
|
|
2317
|
+
in either DER or compact format.
|
|
2318
|
+
"""
|
|
2319
|
+
|
|
2320
|
+
_UniffiConverterTypeCheckMessageRequest.check_lower(request)
|
|
2321
|
+
|
|
2322
|
+
return await _uniffi_rust_call_async(
|
|
2323
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_check_message(
|
|
2324
|
+
self._uniffi_clone_pointer(),
|
|
2325
|
+
_UniffiConverterTypeCheckMessageRequest.lower(request)
|
|
2326
|
+
),
|
|
2327
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
2328
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
2329
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
2330
|
+
# lift function
|
|
2331
|
+
_UniffiConverterTypeCheckMessageResponse.lift,
|
|
2332
|
+
|
|
2333
|
+
# Error FFI converter
|
|
2334
|
+
_UniffiConverterTypeSdkError,
|
|
2335
|
+
|
|
2336
|
+
)
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
|
|
2231
2340
|
async def claim_deposit(self, request: "ClaimDepositRequest") -> "ClaimDepositResponse":
|
|
2232
2341
|
_UniffiConverterTypeClaimDepositRequest.check_lower(request)
|
|
2233
2342
|
|
|
@@ -2519,6 +2628,55 @@ _UniffiConverterTypeSdkError,
|
|
|
2519
2628
|
|
|
2520
2629
|
|
|
2521
2630
|
|
|
2631
|
+
async def lnurl_withdraw(self, request: "LnurlWithdrawRequest") -> "LnurlWithdrawResponse":
|
|
2632
|
+
"""
|
|
2633
|
+
Performs an LNURL withdraw operation for the amount of satoshis to
|
|
2634
|
+
withdraw and the LNURL withdraw request details. The LNURL withdraw request
|
|
2635
|
+
details can be obtained from calling [`BreezSdk::parse`].
|
|
2636
|
+
|
|
2637
|
+
The method generates a Lightning invoice for the withdraw amount, stores
|
|
2638
|
+
the LNURL withdraw metadata, and performs the LNURL withdraw using the generated
|
|
2639
|
+
invoice.
|
|
2640
|
+
|
|
2641
|
+
If the `completion_timeout_secs` parameter is provided and greater than 0, the
|
|
2642
|
+
method will wait for the payment to be completed within that period. If the
|
|
2643
|
+
withdraw is completed within the timeout, the `payment` field in the response
|
|
2644
|
+
will be set with the payment details. If the `completion_timeout_secs`
|
|
2645
|
+
parameter is not provided or set to 0, the method will not wait for the payment
|
|
2646
|
+
to be completed. If the withdraw is not completed within the
|
|
2647
|
+
timeout, the `payment` field will be empty.
|
|
2648
|
+
|
|
2649
|
+
# Arguments
|
|
2650
|
+
|
|
2651
|
+
* `request` - The LNURL withdraw request
|
|
2652
|
+
|
|
2653
|
+
# Returns
|
|
2654
|
+
|
|
2655
|
+
Result containing either:
|
|
2656
|
+
* `LnurlWithdrawResponse` - The payment details if the withdraw request was successful
|
|
2657
|
+
* `SdkError` - If there was an error during the withdraw process
|
|
2658
|
+
"""
|
|
2659
|
+
|
|
2660
|
+
_UniffiConverterTypeLnurlWithdrawRequest.check_lower(request)
|
|
2661
|
+
|
|
2662
|
+
return await _uniffi_rust_call_async(
|
|
2663
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_lnurl_withdraw(
|
|
2664
|
+
self._uniffi_clone_pointer(),
|
|
2665
|
+
_UniffiConverterTypeLnurlWithdrawRequest.lower(request)
|
|
2666
|
+
),
|
|
2667
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
2668
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
2669
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
2670
|
+
# lift function
|
|
2671
|
+
_UniffiConverterTypeLnurlWithdrawResponse.lift,
|
|
2672
|
+
|
|
2673
|
+
# Error FFI converter
|
|
2674
|
+
_UniffiConverterTypeSdkError,
|
|
2675
|
+
|
|
2676
|
+
)
|
|
2677
|
+
|
|
2678
|
+
|
|
2679
|
+
|
|
2522
2680
|
async def parse(self, input: "str") -> "InputType":
|
|
2523
2681
|
_UniffiConverterString.check_lower(input)
|
|
2524
2682
|
|
|
@@ -2700,6 +2858,33 @@ _UniffiConverterTypeSdkError,
|
|
|
2700
2858
|
|
|
2701
2859
|
|
|
2702
2860
|
|
|
2861
|
+
async def sign_message(self, request: "SignMessageRequest") -> "SignMessageResponse":
|
|
2862
|
+
"""
|
|
2863
|
+
Signs a message with the wallet's identity key. The message is SHA256
|
|
2864
|
+
hashed before signing. The returned signature will be hex encoded in
|
|
2865
|
+
DER format by default, or compact format if specified.
|
|
2866
|
+
"""
|
|
2867
|
+
|
|
2868
|
+
_UniffiConverterTypeSignMessageRequest.check_lower(request)
|
|
2869
|
+
|
|
2870
|
+
return await _uniffi_rust_call_async(
|
|
2871
|
+
_UniffiLib.uniffi_breez_sdk_spark_fn_method_breezsdk_sign_message(
|
|
2872
|
+
self._uniffi_clone_pointer(),
|
|
2873
|
+
_UniffiConverterTypeSignMessageRequest.lower(request)
|
|
2874
|
+
),
|
|
2875
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_poll_rust_buffer,
|
|
2876
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_complete_rust_buffer,
|
|
2877
|
+
_UniffiLib.ffi_breez_sdk_spark_rust_future_free_rust_buffer,
|
|
2878
|
+
# lift function
|
|
2879
|
+
_UniffiConverterTypeSignMessageResponse.lift,
|
|
2880
|
+
|
|
2881
|
+
# Error FFI converter
|
|
2882
|
+
_UniffiConverterTypeSdkError,
|
|
2883
|
+
|
|
2884
|
+
)
|
|
2885
|
+
|
|
2886
|
+
|
|
2887
|
+
|
|
2703
2888
|
async def sync_wallet(self, request: "SyncWalletRequest") -> "SyncWalletResponse":
|
|
2704
2889
|
"""
|
|
2705
2890
|
Synchronizes the wallet with the Spark network
|
|
@@ -4304,6 +4489,90 @@ class _UniffiConverterTypeCheckLightningAddressRequest(_UniffiConverterRustBuffe
|
|
|
4304
4489
|
_UniffiConverterString.write(value.username, buf)
|
|
4305
4490
|
|
|
4306
4491
|
|
|
4492
|
+
class CheckMessageRequest:
|
|
4493
|
+
message: "str"
|
|
4494
|
+
"""
|
|
4495
|
+
The message that was signed
|
|
4496
|
+
"""
|
|
4497
|
+
|
|
4498
|
+
pubkey: "str"
|
|
4499
|
+
"""
|
|
4500
|
+
The public key that signed the message
|
|
4501
|
+
"""
|
|
4502
|
+
|
|
4503
|
+
signature: "str"
|
|
4504
|
+
"""
|
|
4505
|
+
The DER or compact hex encoded signature
|
|
4506
|
+
"""
|
|
4507
|
+
|
|
4508
|
+
def __init__(self, *, message: "str", pubkey: "str", signature: "str"):
|
|
4509
|
+
self.message = message
|
|
4510
|
+
self.pubkey = pubkey
|
|
4511
|
+
self.signature = signature
|
|
4512
|
+
|
|
4513
|
+
def __str__(self):
|
|
4514
|
+
return "CheckMessageRequest(message={}, pubkey={}, signature={})".format(self.message, self.pubkey, self.signature)
|
|
4515
|
+
|
|
4516
|
+
def __eq__(self, other):
|
|
4517
|
+
if self.message != other.message:
|
|
4518
|
+
return False
|
|
4519
|
+
if self.pubkey != other.pubkey:
|
|
4520
|
+
return False
|
|
4521
|
+
if self.signature != other.signature:
|
|
4522
|
+
return False
|
|
4523
|
+
return True
|
|
4524
|
+
|
|
4525
|
+
class _UniffiConverterTypeCheckMessageRequest(_UniffiConverterRustBuffer):
|
|
4526
|
+
@staticmethod
|
|
4527
|
+
def read(buf):
|
|
4528
|
+
return CheckMessageRequest(
|
|
4529
|
+
message=_UniffiConverterString.read(buf),
|
|
4530
|
+
pubkey=_UniffiConverterString.read(buf),
|
|
4531
|
+
signature=_UniffiConverterString.read(buf),
|
|
4532
|
+
)
|
|
4533
|
+
|
|
4534
|
+
@staticmethod
|
|
4535
|
+
def check_lower(value):
|
|
4536
|
+
_UniffiConverterString.check_lower(value.message)
|
|
4537
|
+
_UniffiConverterString.check_lower(value.pubkey)
|
|
4538
|
+
_UniffiConverterString.check_lower(value.signature)
|
|
4539
|
+
|
|
4540
|
+
@staticmethod
|
|
4541
|
+
def write(value, buf):
|
|
4542
|
+
_UniffiConverterString.write(value.message, buf)
|
|
4543
|
+
_UniffiConverterString.write(value.pubkey, buf)
|
|
4544
|
+
_UniffiConverterString.write(value.signature, buf)
|
|
4545
|
+
|
|
4546
|
+
|
|
4547
|
+
class CheckMessageResponse:
|
|
4548
|
+
is_valid: "bool"
|
|
4549
|
+
def __init__(self, *, is_valid: "bool"):
|
|
4550
|
+
self.is_valid = is_valid
|
|
4551
|
+
|
|
4552
|
+
def __str__(self):
|
|
4553
|
+
return "CheckMessageResponse(is_valid={})".format(self.is_valid)
|
|
4554
|
+
|
|
4555
|
+
def __eq__(self, other):
|
|
4556
|
+
if self.is_valid != other.is_valid:
|
|
4557
|
+
return False
|
|
4558
|
+
return True
|
|
4559
|
+
|
|
4560
|
+
class _UniffiConverterTypeCheckMessageResponse(_UniffiConverterRustBuffer):
|
|
4561
|
+
@staticmethod
|
|
4562
|
+
def read(buf):
|
|
4563
|
+
return CheckMessageResponse(
|
|
4564
|
+
is_valid=_UniffiConverterBool.read(buf),
|
|
4565
|
+
)
|
|
4566
|
+
|
|
4567
|
+
@staticmethod
|
|
4568
|
+
def check_lower(value):
|
|
4569
|
+
_UniffiConverterBool.check_lower(value.is_valid)
|
|
4570
|
+
|
|
4571
|
+
@staticmethod
|
|
4572
|
+
def write(value, buf):
|
|
4573
|
+
_UniffiConverterBool.write(value.is_valid, buf)
|
|
4574
|
+
|
|
4575
|
+
|
|
4307
4576
|
class ClaimDepositRequest:
|
|
4308
4577
|
txid: "str"
|
|
4309
4578
|
vout: "int"
|
|
@@ -5287,6 +5556,136 @@ class _UniffiConverterTypeLnurlPayResponse(_UniffiConverterRustBuffer):
|
|
|
5287
5556
|
_UniffiConverterOptionalTypeSuccessActionProcessed.write(value.success_action, buf)
|
|
5288
5557
|
|
|
5289
5558
|
|
|
5559
|
+
class LnurlWithdrawInfo:
|
|
5560
|
+
"""
|
|
5561
|
+
Represents the withdraw LNURL info
|
|
5562
|
+
"""
|
|
5563
|
+
|
|
5564
|
+
withdraw_url: "str"
|
|
5565
|
+
def __init__(self, *, withdraw_url: "str"):
|
|
5566
|
+
self.withdraw_url = withdraw_url
|
|
5567
|
+
|
|
5568
|
+
def __str__(self):
|
|
5569
|
+
return "LnurlWithdrawInfo(withdraw_url={})".format(self.withdraw_url)
|
|
5570
|
+
|
|
5571
|
+
def __eq__(self, other):
|
|
5572
|
+
if self.withdraw_url != other.withdraw_url:
|
|
5573
|
+
return False
|
|
5574
|
+
return True
|
|
5575
|
+
|
|
5576
|
+
class _UniffiConverterTypeLnurlWithdrawInfo(_UniffiConverterRustBuffer):
|
|
5577
|
+
@staticmethod
|
|
5578
|
+
def read(buf):
|
|
5579
|
+
return LnurlWithdrawInfo(
|
|
5580
|
+
withdraw_url=_UniffiConverterString.read(buf),
|
|
5581
|
+
)
|
|
5582
|
+
|
|
5583
|
+
@staticmethod
|
|
5584
|
+
def check_lower(value):
|
|
5585
|
+
_UniffiConverterString.check_lower(value.withdraw_url)
|
|
5586
|
+
|
|
5587
|
+
@staticmethod
|
|
5588
|
+
def write(value, buf):
|
|
5589
|
+
_UniffiConverterString.write(value.withdraw_url, buf)
|
|
5590
|
+
|
|
5591
|
+
|
|
5592
|
+
class LnurlWithdrawRequest:
|
|
5593
|
+
amount_sats: "int"
|
|
5594
|
+
"""
|
|
5595
|
+
The amount to withdraw in satoshis
|
|
5596
|
+
Must be within the min and max withdrawable limits
|
|
5597
|
+
"""
|
|
5598
|
+
|
|
5599
|
+
withdraw_request: "LnurlWithdrawRequestDetails"
|
|
5600
|
+
completion_timeout_secs: "typing.Optional[int]"
|
|
5601
|
+
"""
|
|
5602
|
+
If set, the function will return the payment if it is still pending after this
|
|
5603
|
+
number of seconds. If unset, the function will return immediately after
|
|
5604
|
+
initiating the LNURL withdraw.
|
|
5605
|
+
"""
|
|
5606
|
+
|
|
5607
|
+
def __init__(self, *, amount_sats: "int", withdraw_request: "LnurlWithdrawRequestDetails", completion_timeout_secs: "typing.Optional[int]" = _DEFAULT):
|
|
5608
|
+
self.amount_sats = amount_sats
|
|
5609
|
+
self.withdraw_request = withdraw_request
|
|
5610
|
+
if completion_timeout_secs is _DEFAULT:
|
|
5611
|
+
self.completion_timeout_secs = None
|
|
5612
|
+
else:
|
|
5613
|
+
self.completion_timeout_secs = completion_timeout_secs
|
|
5614
|
+
|
|
5615
|
+
def __str__(self):
|
|
5616
|
+
return "LnurlWithdrawRequest(amount_sats={}, withdraw_request={}, completion_timeout_secs={})".format(self.amount_sats, self.withdraw_request, self.completion_timeout_secs)
|
|
5617
|
+
|
|
5618
|
+
def __eq__(self, other):
|
|
5619
|
+
if self.amount_sats != other.amount_sats:
|
|
5620
|
+
return False
|
|
5621
|
+
if self.withdraw_request != other.withdraw_request:
|
|
5622
|
+
return False
|
|
5623
|
+
if self.completion_timeout_secs != other.completion_timeout_secs:
|
|
5624
|
+
return False
|
|
5625
|
+
return True
|
|
5626
|
+
|
|
5627
|
+
class _UniffiConverterTypeLnurlWithdrawRequest(_UniffiConverterRustBuffer):
|
|
5628
|
+
@staticmethod
|
|
5629
|
+
def read(buf):
|
|
5630
|
+
return LnurlWithdrawRequest(
|
|
5631
|
+
amount_sats=_UniffiConverterUInt64.read(buf),
|
|
5632
|
+
withdraw_request=_UniffiConverterTypeLnurlWithdrawRequestDetails.read(buf),
|
|
5633
|
+
completion_timeout_secs=_UniffiConverterOptionalUInt32.read(buf),
|
|
5634
|
+
)
|
|
5635
|
+
|
|
5636
|
+
@staticmethod
|
|
5637
|
+
def check_lower(value):
|
|
5638
|
+
_UniffiConverterUInt64.check_lower(value.amount_sats)
|
|
5639
|
+
_UniffiConverterTypeLnurlWithdrawRequestDetails.check_lower(value.withdraw_request)
|
|
5640
|
+
_UniffiConverterOptionalUInt32.check_lower(value.completion_timeout_secs)
|
|
5641
|
+
|
|
5642
|
+
@staticmethod
|
|
5643
|
+
def write(value, buf):
|
|
5644
|
+
_UniffiConverterUInt64.write(value.amount_sats, buf)
|
|
5645
|
+
_UniffiConverterTypeLnurlWithdrawRequestDetails.write(value.withdraw_request, buf)
|
|
5646
|
+
_UniffiConverterOptionalUInt32.write(value.completion_timeout_secs, buf)
|
|
5647
|
+
|
|
5648
|
+
|
|
5649
|
+
class LnurlWithdrawResponse:
|
|
5650
|
+
payment_request: "str"
|
|
5651
|
+
"""
|
|
5652
|
+
The Lightning invoice generated for the LNURL withdraw
|
|
5653
|
+
"""
|
|
5654
|
+
|
|
5655
|
+
payment: "typing.Optional[Payment]"
|
|
5656
|
+
def __init__(self, *, payment_request: "str", payment: "typing.Optional[Payment]"):
|
|
5657
|
+
self.payment_request = payment_request
|
|
5658
|
+
self.payment = payment
|
|
5659
|
+
|
|
5660
|
+
def __str__(self):
|
|
5661
|
+
return "LnurlWithdrawResponse(payment_request={}, payment={})".format(self.payment_request, self.payment)
|
|
5662
|
+
|
|
5663
|
+
def __eq__(self, other):
|
|
5664
|
+
if self.payment_request != other.payment_request:
|
|
5665
|
+
return False
|
|
5666
|
+
if self.payment != other.payment:
|
|
5667
|
+
return False
|
|
5668
|
+
return True
|
|
5669
|
+
|
|
5670
|
+
class _UniffiConverterTypeLnurlWithdrawResponse(_UniffiConverterRustBuffer):
|
|
5671
|
+
@staticmethod
|
|
5672
|
+
def read(buf):
|
|
5673
|
+
return LnurlWithdrawResponse(
|
|
5674
|
+
payment_request=_UniffiConverterString.read(buf),
|
|
5675
|
+
payment=_UniffiConverterOptionalTypePayment.read(buf),
|
|
5676
|
+
)
|
|
5677
|
+
|
|
5678
|
+
@staticmethod
|
|
5679
|
+
def check_lower(value):
|
|
5680
|
+
_UniffiConverterString.check_lower(value.payment_request)
|
|
5681
|
+
_UniffiConverterOptionalTypePayment.check_lower(value.payment)
|
|
5682
|
+
|
|
5683
|
+
@staticmethod
|
|
5684
|
+
def write(value, buf):
|
|
5685
|
+
_UniffiConverterString.write(value.payment_request, buf)
|
|
5686
|
+
_UniffiConverterOptionalTypePayment.write(value.payment, buf)
|
|
5687
|
+
|
|
5688
|
+
|
|
5290
5689
|
class LogEntry:
|
|
5291
5690
|
line: "str"
|
|
5292
5691
|
level: "str"
|
|
@@ -5444,17 +5843,21 @@ class PaymentMetadata:
|
|
|
5444
5843
|
"""
|
|
5445
5844
|
|
|
5446
5845
|
lnurl_pay_info: "typing.Optional[LnurlPayInfo]"
|
|
5846
|
+
lnurl_withdraw_info: "typing.Optional[LnurlWithdrawInfo]"
|
|
5447
5847
|
lnurl_description: "typing.Optional[str]"
|
|
5448
|
-
def __init__(self, *, lnurl_pay_info: "typing.Optional[LnurlPayInfo]", lnurl_description: "typing.Optional[str]"):
|
|
5848
|
+
def __init__(self, *, lnurl_pay_info: "typing.Optional[LnurlPayInfo]", lnurl_withdraw_info: "typing.Optional[LnurlWithdrawInfo]", lnurl_description: "typing.Optional[str]"):
|
|
5449
5849
|
self.lnurl_pay_info = lnurl_pay_info
|
|
5850
|
+
self.lnurl_withdraw_info = lnurl_withdraw_info
|
|
5450
5851
|
self.lnurl_description = lnurl_description
|
|
5451
5852
|
|
|
5452
5853
|
def __str__(self):
|
|
5453
|
-
return "PaymentMetadata(lnurl_pay_info={}, lnurl_description={})".format(self.lnurl_pay_info, self.lnurl_description)
|
|
5854
|
+
return "PaymentMetadata(lnurl_pay_info={}, lnurl_withdraw_info={}, lnurl_description={})".format(self.lnurl_pay_info, self.lnurl_withdraw_info, self.lnurl_description)
|
|
5454
5855
|
|
|
5455
5856
|
def __eq__(self, other):
|
|
5456
5857
|
if self.lnurl_pay_info != other.lnurl_pay_info:
|
|
5457
5858
|
return False
|
|
5859
|
+
if self.lnurl_withdraw_info != other.lnurl_withdraw_info:
|
|
5860
|
+
return False
|
|
5458
5861
|
if self.lnurl_description != other.lnurl_description:
|
|
5459
5862
|
return False
|
|
5460
5863
|
return True
|
|
@@ -5464,17 +5867,20 @@ class _UniffiConverterTypePaymentMetadata(_UniffiConverterRustBuffer):
|
|
|
5464
5867
|
def read(buf):
|
|
5465
5868
|
return PaymentMetadata(
|
|
5466
5869
|
lnurl_pay_info=_UniffiConverterOptionalTypeLnurlPayInfo.read(buf),
|
|
5870
|
+
lnurl_withdraw_info=_UniffiConverterOptionalTypeLnurlWithdrawInfo.read(buf),
|
|
5467
5871
|
lnurl_description=_UniffiConverterOptionalString.read(buf),
|
|
5468
5872
|
)
|
|
5469
5873
|
|
|
5470
5874
|
@staticmethod
|
|
5471
5875
|
def check_lower(value):
|
|
5472
5876
|
_UniffiConverterOptionalTypeLnurlPayInfo.check_lower(value.lnurl_pay_info)
|
|
5877
|
+
_UniffiConverterOptionalTypeLnurlWithdrawInfo.check_lower(value.lnurl_withdraw_info)
|
|
5473
5878
|
_UniffiConverterOptionalString.check_lower(value.lnurl_description)
|
|
5474
5879
|
|
|
5475
5880
|
@staticmethod
|
|
5476
5881
|
def write(value, buf):
|
|
5477
5882
|
_UniffiConverterOptionalTypeLnurlPayInfo.write(value.lnurl_pay_info, buf)
|
|
5883
|
+
_UniffiConverterOptionalTypeLnurlWithdrawInfo.write(value.lnurl_withdraw_info, buf)
|
|
5478
5884
|
_UniffiConverterOptionalString.write(value.lnurl_description, buf)
|
|
5479
5885
|
|
|
5480
5886
|
|
|
@@ -5796,18 +6202,23 @@ class _UniffiConverterTypeReceivePaymentRequest(_UniffiConverterRustBuffer):
|
|
|
5796
6202
|
|
|
5797
6203
|
class ReceivePaymentResponse:
|
|
5798
6204
|
payment_request: "str"
|
|
5799
|
-
|
|
5800
|
-
|
|
6205
|
+
fee: "U128"
|
|
6206
|
+
"""
|
|
6207
|
+
Fee to pay to receive the payment
|
|
6208
|
+
Denominated in sats or token base units
|
|
6209
|
+
"""
|
|
6210
|
+
|
|
6211
|
+
def __init__(self, *, payment_request: "str", fee: "U128"):
|
|
5801
6212
|
self.payment_request = payment_request
|
|
5802
|
-
self.
|
|
6213
|
+
self.fee = fee
|
|
5803
6214
|
|
|
5804
6215
|
def __str__(self):
|
|
5805
|
-
return "ReceivePaymentResponse(payment_request={},
|
|
6216
|
+
return "ReceivePaymentResponse(payment_request={}, fee={})".format(self.payment_request, self.fee)
|
|
5806
6217
|
|
|
5807
6218
|
def __eq__(self, other):
|
|
5808
6219
|
if self.payment_request != other.payment_request:
|
|
5809
6220
|
return False
|
|
5810
|
-
if self.
|
|
6221
|
+
if self.fee != other.fee:
|
|
5811
6222
|
return False
|
|
5812
6223
|
return True
|
|
5813
6224
|
|
|
@@ -5816,18 +6227,18 @@ class _UniffiConverterTypeReceivePaymentResponse(_UniffiConverterRustBuffer):
|
|
|
5816
6227
|
def read(buf):
|
|
5817
6228
|
return ReceivePaymentResponse(
|
|
5818
6229
|
payment_request=_UniffiConverterString.read(buf),
|
|
5819
|
-
|
|
6230
|
+
fee=_UniffiConverterTypeU128.read(buf),
|
|
5820
6231
|
)
|
|
5821
6232
|
|
|
5822
6233
|
@staticmethod
|
|
5823
6234
|
def check_lower(value):
|
|
5824
6235
|
_UniffiConverterString.check_lower(value.payment_request)
|
|
5825
|
-
|
|
6236
|
+
_UniffiConverterTypeU128.check_lower(value.fee)
|
|
5826
6237
|
|
|
5827
6238
|
@staticmethod
|
|
5828
6239
|
def write(value, buf):
|
|
5829
6240
|
_UniffiConverterString.write(value.payment_request, buf)
|
|
5830
|
-
|
|
6241
|
+
_UniffiConverterTypeU128.write(value.fee, buf)
|
|
5831
6242
|
|
|
5832
6243
|
|
|
5833
6244
|
class RefundDepositRequest:
|
|
@@ -6116,6 +6527,130 @@ class _UniffiConverterTypeSendPaymentResponse(_UniffiConverterRustBuffer):
|
|
|
6116
6527
|
_UniffiConverterTypePayment.write(value.payment, buf)
|
|
6117
6528
|
|
|
6118
6529
|
|
|
6530
|
+
class SignMessageRequest:
|
|
6531
|
+
message: "str"
|
|
6532
|
+
compact: "bool"
|
|
6533
|
+
"""
|
|
6534
|
+
If true, the signature will be encoded in compact format instead of DER format
|
|
6535
|
+
"""
|
|
6536
|
+
|
|
6537
|
+
def __init__(self, *, message: "str", compact: "bool"):
|
|
6538
|
+
self.message = message
|
|
6539
|
+
self.compact = compact
|
|
6540
|
+
|
|
6541
|
+
def __str__(self):
|
|
6542
|
+
return "SignMessageRequest(message={}, compact={})".format(self.message, self.compact)
|
|
6543
|
+
|
|
6544
|
+
def __eq__(self, other):
|
|
6545
|
+
if self.message != other.message:
|
|
6546
|
+
return False
|
|
6547
|
+
if self.compact != other.compact:
|
|
6548
|
+
return False
|
|
6549
|
+
return True
|
|
6550
|
+
|
|
6551
|
+
class _UniffiConverterTypeSignMessageRequest(_UniffiConverterRustBuffer):
|
|
6552
|
+
@staticmethod
|
|
6553
|
+
def read(buf):
|
|
6554
|
+
return SignMessageRequest(
|
|
6555
|
+
message=_UniffiConverterString.read(buf),
|
|
6556
|
+
compact=_UniffiConverterBool.read(buf),
|
|
6557
|
+
)
|
|
6558
|
+
|
|
6559
|
+
@staticmethod
|
|
6560
|
+
def check_lower(value):
|
|
6561
|
+
_UniffiConverterString.check_lower(value.message)
|
|
6562
|
+
_UniffiConverterBool.check_lower(value.compact)
|
|
6563
|
+
|
|
6564
|
+
@staticmethod
|
|
6565
|
+
def write(value, buf):
|
|
6566
|
+
_UniffiConverterString.write(value.message, buf)
|
|
6567
|
+
_UniffiConverterBool.write(value.compact, buf)
|
|
6568
|
+
|
|
6569
|
+
|
|
6570
|
+
class SignMessageResponse:
|
|
6571
|
+
pubkey: "str"
|
|
6572
|
+
signature: "str"
|
|
6573
|
+
"""
|
|
6574
|
+
The DER or compact hex encoded signature
|
|
6575
|
+
"""
|
|
6576
|
+
|
|
6577
|
+
def __init__(self, *, pubkey: "str", signature: "str"):
|
|
6578
|
+
self.pubkey = pubkey
|
|
6579
|
+
self.signature = signature
|
|
6580
|
+
|
|
6581
|
+
def __str__(self):
|
|
6582
|
+
return "SignMessageResponse(pubkey={}, signature={})".format(self.pubkey, self.signature)
|
|
6583
|
+
|
|
6584
|
+
def __eq__(self, other):
|
|
6585
|
+
if self.pubkey != other.pubkey:
|
|
6586
|
+
return False
|
|
6587
|
+
if self.signature != other.signature:
|
|
6588
|
+
return False
|
|
6589
|
+
return True
|
|
6590
|
+
|
|
6591
|
+
class _UniffiConverterTypeSignMessageResponse(_UniffiConverterRustBuffer):
|
|
6592
|
+
@staticmethod
|
|
6593
|
+
def read(buf):
|
|
6594
|
+
return SignMessageResponse(
|
|
6595
|
+
pubkey=_UniffiConverterString.read(buf),
|
|
6596
|
+
signature=_UniffiConverterString.read(buf),
|
|
6597
|
+
)
|
|
6598
|
+
|
|
6599
|
+
@staticmethod
|
|
6600
|
+
def check_lower(value):
|
|
6601
|
+
_UniffiConverterString.check_lower(value.pubkey)
|
|
6602
|
+
_UniffiConverterString.check_lower(value.signature)
|
|
6603
|
+
|
|
6604
|
+
@staticmethod
|
|
6605
|
+
def write(value, buf):
|
|
6606
|
+
_UniffiConverterString.write(value.pubkey, buf)
|
|
6607
|
+
_UniffiConverterString.write(value.signature, buf)
|
|
6608
|
+
|
|
6609
|
+
|
|
6610
|
+
class SparkInvoicePaymentDetails:
|
|
6611
|
+
description: "typing.Optional[str]"
|
|
6612
|
+
"""
|
|
6613
|
+
Represents the spark invoice description
|
|
6614
|
+
"""
|
|
6615
|
+
|
|
6616
|
+
invoice: "str"
|
|
6617
|
+
"""
|
|
6618
|
+
The raw spark invoice string
|
|
6619
|
+
"""
|
|
6620
|
+
|
|
6621
|
+
def __init__(self, *, description: "typing.Optional[str]", invoice: "str"):
|
|
6622
|
+
self.description = description
|
|
6623
|
+
self.invoice = invoice
|
|
6624
|
+
|
|
6625
|
+
def __str__(self):
|
|
6626
|
+
return "SparkInvoicePaymentDetails(description={}, invoice={})".format(self.description, self.invoice)
|
|
6627
|
+
|
|
6628
|
+
def __eq__(self, other):
|
|
6629
|
+
if self.description != other.description:
|
|
6630
|
+
return False
|
|
6631
|
+
if self.invoice != other.invoice:
|
|
6632
|
+
return False
|
|
6633
|
+
return True
|
|
6634
|
+
|
|
6635
|
+
class _UniffiConverterTypeSparkInvoicePaymentDetails(_UniffiConverterRustBuffer):
|
|
6636
|
+
@staticmethod
|
|
6637
|
+
def read(buf):
|
|
6638
|
+
return SparkInvoicePaymentDetails(
|
|
6639
|
+
description=_UniffiConverterOptionalString.read(buf),
|
|
6640
|
+
invoice=_UniffiConverterString.read(buf),
|
|
6641
|
+
)
|
|
6642
|
+
|
|
6643
|
+
@staticmethod
|
|
6644
|
+
def check_lower(value):
|
|
6645
|
+
_UniffiConverterOptionalString.check_lower(value.description)
|
|
6646
|
+
_UniffiConverterString.check_lower(value.invoice)
|
|
6647
|
+
|
|
6648
|
+
@staticmethod
|
|
6649
|
+
def write(value, buf):
|
|
6650
|
+
_UniffiConverterOptionalString.write(value.description, buf)
|
|
6651
|
+
_UniffiConverterString.write(value.invoice, buf)
|
|
6652
|
+
|
|
6653
|
+
|
|
6119
6654
|
class SyncWalletRequest:
|
|
6120
6655
|
"""
|
|
6121
6656
|
Request to sync the wallet with the Spark network
|
|
@@ -7040,28 +7575,41 @@ class PaymentDetails:
|
|
|
7040
7575
|
|
|
7041
7576
|
# Each enum variant is a nested class of the enum itself.
|
|
7042
7577
|
class SPARK:
|
|
7578
|
+
invoice_details: "typing.Optional[SparkInvoicePaymentDetails]"
|
|
7579
|
+
"""
|
|
7580
|
+
The invoice details if the payment fulfilled a spark invoice
|
|
7581
|
+
"""
|
|
7043
7582
|
|
|
7044
|
-
|
|
7045
|
-
|
|
7583
|
+
|
|
7584
|
+
def __init__(self,invoice_details: "typing.Optional[SparkInvoicePaymentDetails]"):
|
|
7585
|
+
self.invoice_details = invoice_details
|
|
7046
7586
|
|
|
7047
7587
|
def __str__(self):
|
|
7048
|
-
return "PaymentDetails.SPARK()".format()
|
|
7588
|
+
return "PaymentDetails.SPARK(invoice_details={})".format(self.invoice_details)
|
|
7049
7589
|
|
|
7050
7590
|
def __eq__(self, other):
|
|
7051
7591
|
if not other.is_spark():
|
|
7052
7592
|
return False
|
|
7593
|
+
if self.invoice_details != other.invoice_details:
|
|
7594
|
+
return False
|
|
7053
7595
|
return True
|
|
7054
7596
|
|
|
7055
7597
|
class TOKEN:
|
|
7056
7598
|
metadata: "TokenMetadata"
|
|
7057
7599
|
tx_hash: "str"
|
|
7600
|
+
invoice_details: "typing.Optional[SparkInvoicePaymentDetails]"
|
|
7601
|
+
"""
|
|
7602
|
+
The invoice details if the payment fulfilled a spark invoice
|
|
7603
|
+
"""
|
|
7604
|
+
|
|
7058
7605
|
|
|
7059
|
-
def __init__(self,metadata: "TokenMetadata", tx_hash: "str"):
|
|
7606
|
+
def __init__(self,metadata: "TokenMetadata", tx_hash: "str", invoice_details: "typing.Optional[SparkInvoicePaymentDetails]"):
|
|
7060
7607
|
self.metadata = metadata
|
|
7061
7608
|
self.tx_hash = tx_hash
|
|
7609
|
+
self.invoice_details = invoice_details
|
|
7062
7610
|
|
|
7063
7611
|
def __str__(self):
|
|
7064
|
-
return "PaymentDetails.TOKEN(metadata={}, tx_hash={})".format(self.metadata, self.tx_hash)
|
|
7612
|
+
return "PaymentDetails.TOKEN(metadata={}, tx_hash={}, invoice_details={})".format(self.metadata, self.tx_hash, self.invoice_details)
|
|
7065
7613
|
|
|
7066
7614
|
def __eq__(self, other):
|
|
7067
7615
|
if not other.is_token():
|
|
@@ -7070,6 +7618,8 @@ class PaymentDetails:
|
|
|
7070
7618
|
return False
|
|
7071
7619
|
if self.tx_hash != other.tx_hash:
|
|
7072
7620
|
return False
|
|
7621
|
+
if self.invoice_details != other.invoice_details:
|
|
7622
|
+
return False
|
|
7073
7623
|
return True
|
|
7074
7624
|
|
|
7075
7625
|
class LIGHTNING:
|
|
@@ -7105,17 +7655,23 @@ class PaymentDetails:
|
|
|
7105
7655
|
Lnurl payment information if this was an lnurl payment.
|
|
7106
7656
|
"""
|
|
7107
7657
|
|
|
7658
|
+
lnurl_withdraw_info: "typing.Optional[LnurlWithdrawInfo]"
|
|
7659
|
+
"""
|
|
7660
|
+
Lnurl withdrawal information if this was an lnurl payment.
|
|
7661
|
+
"""
|
|
7108
7662
|
|
|
7109
|
-
|
|
7663
|
+
|
|
7664
|
+
def __init__(self,description: "typing.Optional[str]", preimage: "typing.Optional[str]", invoice: "str", payment_hash: "str", destination_pubkey: "str", lnurl_pay_info: "typing.Optional[LnurlPayInfo]", lnurl_withdraw_info: "typing.Optional[LnurlWithdrawInfo]"):
|
|
7110
7665
|
self.description = description
|
|
7111
7666
|
self.preimage = preimage
|
|
7112
7667
|
self.invoice = invoice
|
|
7113
7668
|
self.payment_hash = payment_hash
|
|
7114
7669
|
self.destination_pubkey = destination_pubkey
|
|
7115
7670
|
self.lnurl_pay_info = lnurl_pay_info
|
|
7671
|
+
self.lnurl_withdraw_info = lnurl_withdraw_info
|
|
7116
7672
|
|
|
7117
7673
|
def __str__(self):
|
|
7118
|
-
return "PaymentDetails.LIGHTNING(description={}, preimage={}, invoice={}, payment_hash={}, destination_pubkey={}, lnurl_pay_info={})".format(self.description, self.preimage, self.invoice, self.payment_hash, self.destination_pubkey, self.lnurl_pay_info)
|
|
7674
|
+
return "PaymentDetails.LIGHTNING(description={}, preimage={}, invoice={}, payment_hash={}, destination_pubkey={}, lnurl_pay_info={}, lnurl_withdraw_info={})".format(self.description, self.preimage, self.invoice, self.payment_hash, self.destination_pubkey, self.lnurl_pay_info, self.lnurl_withdraw_info)
|
|
7119
7675
|
|
|
7120
7676
|
def __eq__(self, other):
|
|
7121
7677
|
if not other.is_lightning():
|
|
@@ -7132,6 +7688,8 @@ class PaymentDetails:
|
|
|
7132
7688
|
return False
|
|
7133
7689
|
if self.lnurl_pay_info != other.lnurl_pay_info:
|
|
7134
7690
|
return False
|
|
7691
|
+
if self.lnurl_withdraw_info != other.lnurl_withdraw_info:
|
|
7692
|
+
return False
|
|
7135
7693
|
return True
|
|
7136
7694
|
|
|
7137
7695
|
class WITHDRAW:
|
|
@@ -7200,11 +7758,13 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
7200
7758
|
variant = buf.read_i32()
|
|
7201
7759
|
if variant == 1:
|
|
7202
7760
|
return PaymentDetails.SPARK(
|
|
7761
|
+
_UniffiConverterOptionalTypeSparkInvoicePaymentDetails.read(buf),
|
|
7203
7762
|
)
|
|
7204
7763
|
if variant == 2:
|
|
7205
7764
|
return PaymentDetails.TOKEN(
|
|
7206
7765
|
_UniffiConverterTypeTokenMetadata.read(buf),
|
|
7207
7766
|
_UniffiConverterString.read(buf),
|
|
7767
|
+
_UniffiConverterOptionalTypeSparkInvoicePaymentDetails.read(buf),
|
|
7208
7768
|
)
|
|
7209
7769
|
if variant == 3:
|
|
7210
7770
|
return PaymentDetails.LIGHTNING(
|
|
@@ -7214,6 +7774,7 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
7214
7774
|
_UniffiConverterString.read(buf),
|
|
7215
7775
|
_UniffiConverterString.read(buf),
|
|
7216
7776
|
_UniffiConverterOptionalTypeLnurlPayInfo.read(buf),
|
|
7777
|
+
_UniffiConverterOptionalTypeLnurlWithdrawInfo.read(buf),
|
|
7217
7778
|
)
|
|
7218
7779
|
if variant == 4:
|
|
7219
7780
|
return PaymentDetails.WITHDRAW(
|
|
@@ -7228,10 +7789,12 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
7228
7789
|
@staticmethod
|
|
7229
7790
|
def check_lower(value):
|
|
7230
7791
|
if value.is_spark():
|
|
7792
|
+
_UniffiConverterOptionalTypeSparkInvoicePaymentDetails.check_lower(value.invoice_details)
|
|
7231
7793
|
return
|
|
7232
7794
|
if value.is_token():
|
|
7233
7795
|
_UniffiConverterTypeTokenMetadata.check_lower(value.metadata)
|
|
7234
7796
|
_UniffiConverterString.check_lower(value.tx_hash)
|
|
7797
|
+
_UniffiConverterOptionalTypeSparkInvoicePaymentDetails.check_lower(value.invoice_details)
|
|
7235
7798
|
return
|
|
7236
7799
|
if value.is_lightning():
|
|
7237
7800
|
_UniffiConverterOptionalString.check_lower(value.description)
|
|
@@ -7240,6 +7803,7 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
7240
7803
|
_UniffiConverterString.check_lower(value.payment_hash)
|
|
7241
7804
|
_UniffiConverterString.check_lower(value.destination_pubkey)
|
|
7242
7805
|
_UniffiConverterOptionalTypeLnurlPayInfo.check_lower(value.lnurl_pay_info)
|
|
7806
|
+
_UniffiConverterOptionalTypeLnurlWithdrawInfo.check_lower(value.lnurl_withdraw_info)
|
|
7243
7807
|
return
|
|
7244
7808
|
if value.is_withdraw():
|
|
7245
7809
|
_UniffiConverterString.check_lower(value.tx_id)
|
|
@@ -7253,10 +7817,12 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
7253
7817
|
def write(value, buf):
|
|
7254
7818
|
if value.is_spark():
|
|
7255
7819
|
buf.write_i32(1)
|
|
7820
|
+
_UniffiConverterOptionalTypeSparkInvoicePaymentDetails.write(value.invoice_details, buf)
|
|
7256
7821
|
if value.is_token():
|
|
7257
7822
|
buf.write_i32(2)
|
|
7258
7823
|
_UniffiConverterTypeTokenMetadata.write(value.metadata, buf)
|
|
7259
7824
|
_UniffiConverterString.write(value.tx_hash, buf)
|
|
7825
|
+
_UniffiConverterOptionalTypeSparkInvoicePaymentDetails.write(value.invoice_details, buf)
|
|
7260
7826
|
if value.is_lightning():
|
|
7261
7827
|
buf.write_i32(3)
|
|
7262
7828
|
_UniffiConverterOptionalString.write(value.description, buf)
|
|
@@ -7265,6 +7831,7 @@ class _UniffiConverterTypePaymentDetails(_UniffiConverterRustBuffer):
|
|
|
7265
7831
|
_UniffiConverterString.write(value.payment_hash, buf)
|
|
7266
7832
|
_UniffiConverterString.write(value.destination_pubkey, buf)
|
|
7267
7833
|
_UniffiConverterOptionalTypeLnurlPayInfo.write(value.lnurl_pay_info, buf)
|
|
7834
|
+
_UniffiConverterOptionalTypeLnurlWithdrawInfo.write(value.lnurl_withdraw_info, buf)
|
|
7268
7835
|
if value.is_withdraw():
|
|
7269
7836
|
buf.write_i32(4)
|
|
7270
7837
|
_UniffiConverterString.write(value.tx_id, buf)
|
|
@@ -7586,22 +8153,22 @@ class ProvisionalPaymentDetails:
|
|
|
7586
8153
|
return True
|
|
7587
8154
|
|
|
7588
8155
|
class SPARK:
|
|
7589
|
-
|
|
8156
|
+
pay_request: "str"
|
|
7590
8157
|
"""
|
|
7591
|
-
Spark
|
|
8158
|
+
Spark pay request being paid (either a Spark address or a Spark invoice)
|
|
7592
8159
|
"""
|
|
7593
8160
|
|
|
7594
8161
|
|
|
7595
|
-
def __init__(self,
|
|
7596
|
-
self.
|
|
8162
|
+
def __init__(self,pay_request: "str"):
|
|
8163
|
+
self.pay_request = pay_request
|
|
7597
8164
|
|
|
7598
8165
|
def __str__(self):
|
|
7599
|
-
return "ProvisionalPaymentDetails.SPARK(
|
|
8166
|
+
return "ProvisionalPaymentDetails.SPARK(pay_request={})".format(self.pay_request)
|
|
7600
8167
|
|
|
7601
8168
|
def __eq__(self, other):
|
|
7602
8169
|
if not other.is_spark():
|
|
7603
8170
|
return False
|
|
7604
|
-
if self.
|
|
8171
|
+
if self.pay_request != other.pay_request:
|
|
7605
8172
|
return False
|
|
7606
8173
|
return True
|
|
7607
8174
|
|
|
@@ -7611,25 +8178,25 @@ class ProvisionalPaymentDetails:
|
|
|
7611
8178
|
Token identifier
|
|
7612
8179
|
"""
|
|
7613
8180
|
|
|
7614
|
-
|
|
8181
|
+
pay_request: "str"
|
|
7615
8182
|
"""
|
|
7616
|
-
Spark
|
|
8183
|
+
Spark pay request being paid (either a Spark address or a Spark invoice)
|
|
7617
8184
|
"""
|
|
7618
8185
|
|
|
7619
8186
|
|
|
7620
|
-
def __init__(self,token_id: "str",
|
|
8187
|
+
def __init__(self,token_id: "str", pay_request: "str"):
|
|
7621
8188
|
self.token_id = token_id
|
|
7622
|
-
self.
|
|
8189
|
+
self.pay_request = pay_request
|
|
7623
8190
|
|
|
7624
8191
|
def __str__(self):
|
|
7625
|
-
return "ProvisionalPaymentDetails.TOKEN(token_id={},
|
|
8192
|
+
return "ProvisionalPaymentDetails.TOKEN(token_id={}, pay_request={})".format(self.token_id, self.pay_request)
|
|
7626
8193
|
|
|
7627
8194
|
def __eq__(self, other):
|
|
7628
8195
|
if not other.is_token():
|
|
7629
8196
|
return False
|
|
7630
8197
|
if self.token_id != other.token_id:
|
|
7631
8198
|
return False
|
|
7632
|
-
if self.
|
|
8199
|
+
if self.pay_request != other.pay_request:
|
|
7633
8200
|
return False
|
|
7634
8201
|
return True
|
|
7635
8202
|
|
|
@@ -7690,11 +8257,11 @@ class _UniffiConverterTypeProvisionalPaymentDetails(_UniffiConverterRustBuffer):
|
|
|
7690
8257
|
_UniffiConverterString.check_lower(value.invoice)
|
|
7691
8258
|
return
|
|
7692
8259
|
if value.is_spark():
|
|
7693
|
-
_UniffiConverterString.check_lower(value.
|
|
8260
|
+
_UniffiConverterString.check_lower(value.pay_request)
|
|
7694
8261
|
return
|
|
7695
8262
|
if value.is_token():
|
|
7696
8263
|
_UniffiConverterString.check_lower(value.token_id)
|
|
7697
|
-
_UniffiConverterString.check_lower(value.
|
|
8264
|
+
_UniffiConverterString.check_lower(value.pay_request)
|
|
7698
8265
|
return
|
|
7699
8266
|
raise ValueError(value)
|
|
7700
8267
|
|
|
@@ -7708,11 +8275,11 @@ class _UniffiConverterTypeProvisionalPaymentDetails(_UniffiConverterRustBuffer):
|
|
|
7708
8275
|
_UniffiConverterString.write(value.invoice, buf)
|
|
7709
8276
|
if value.is_spark():
|
|
7710
8277
|
buf.write_i32(3)
|
|
7711
|
-
_UniffiConverterString.write(value.
|
|
8278
|
+
_UniffiConverterString.write(value.pay_request, buf)
|
|
7712
8279
|
if value.is_token():
|
|
7713
8280
|
buf.write_i32(4)
|
|
7714
8281
|
_UniffiConverterString.write(value.token_id, buf)
|
|
7715
|
-
_UniffiConverterString.write(value.
|
|
8282
|
+
_UniffiConverterString.write(value.pay_request, buf)
|
|
7716
8283
|
|
|
7717
8284
|
|
|
7718
8285
|
|
|
@@ -7738,6 +8305,59 @@ class ReceivePaymentMethod:
|
|
|
7738
8305
|
return False
|
|
7739
8306
|
return True
|
|
7740
8307
|
|
|
8308
|
+
class SPARK_INVOICE:
|
|
8309
|
+
amount: "typing.Optional[U128]"
|
|
8310
|
+
"""
|
|
8311
|
+
Amount to receive. Denominated in sats if token identifier is empty, otherwise in the token base units
|
|
8312
|
+
"""
|
|
8313
|
+
|
|
8314
|
+
token_identifier: "typing.Optional[str]"
|
|
8315
|
+
"""
|
|
8316
|
+
The presence of this field indicates that the payment is for a token
|
|
8317
|
+
If empty, it is a Bitcoin payment
|
|
8318
|
+
"""
|
|
8319
|
+
|
|
8320
|
+
expiry_time: "typing.Optional[int]"
|
|
8321
|
+
"""
|
|
8322
|
+
The expiry time of the invoice in seconds since the Unix epoch
|
|
8323
|
+
"""
|
|
8324
|
+
|
|
8325
|
+
description: "typing.Optional[str]"
|
|
8326
|
+
"""
|
|
8327
|
+
A description to embed in the invoice.
|
|
8328
|
+
"""
|
|
8329
|
+
|
|
8330
|
+
sender_public_key: "typing.Optional[str]"
|
|
8331
|
+
"""
|
|
8332
|
+
If set, the invoice may only be fulfilled by a payer with this public key
|
|
8333
|
+
"""
|
|
8334
|
+
|
|
8335
|
+
|
|
8336
|
+
def __init__(self,amount: "typing.Optional[U128]", token_identifier: "typing.Optional[str]", expiry_time: "typing.Optional[int]", description: "typing.Optional[str]", sender_public_key: "typing.Optional[str]"):
|
|
8337
|
+
self.amount = amount
|
|
8338
|
+
self.token_identifier = token_identifier
|
|
8339
|
+
self.expiry_time = expiry_time
|
|
8340
|
+
self.description = description
|
|
8341
|
+
self.sender_public_key = sender_public_key
|
|
8342
|
+
|
|
8343
|
+
def __str__(self):
|
|
8344
|
+
return "ReceivePaymentMethod.SPARK_INVOICE(amount={}, token_identifier={}, expiry_time={}, description={}, sender_public_key={})".format(self.amount, self.token_identifier, self.expiry_time, self.description, self.sender_public_key)
|
|
8345
|
+
|
|
8346
|
+
def __eq__(self, other):
|
|
8347
|
+
if not other.is_spark_invoice():
|
|
8348
|
+
return False
|
|
8349
|
+
if self.amount != other.amount:
|
|
8350
|
+
return False
|
|
8351
|
+
if self.token_identifier != other.token_identifier:
|
|
8352
|
+
return False
|
|
8353
|
+
if self.expiry_time != other.expiry_time:
|
|
8354
|
+
return False
|
|
8355
|
+
if self.description != other.description:
|
|
8356
|
+
return False
|
|
8357
|
+
if self.sender_public_key != other.sender_public_key:
|
|
8358
|
+
return False
|
|
8359
|
+
return True
|
|
8360
|
+
|
|
7741
8361
|
class BITCOIN_ADDRESS:
|
|
7742
8362
|
|
|
7743
8363
|
def __init__(self,):
|
|
@@ -7777,6 +8397,8 @@ class ReceivePaymentMethod:
|
|
|
7777
8397
|
# whether an instance is that variant.
|
|
7778
8398
|
def is_spark_address(self) -> bool:
|
|
7779
8399
|
return isinstance(self, ReceivePaymentMethod.SPARK_ADDRESS)
|
|
8400
|
+
def is_spark_invoice(self) -> bool:
|
|
8401
|
+
return isinstance(self, ReceivePaymentMethod.SPARK_INVOICE)
|
|
7780
8402
|
def is_bitcoin_address(self) -> bool:
|
|
7781
8403
|
return isinstance(self, ReceivePaymentMethod.BITCOIN_ADDRESS)
|
|
7782
8404
|
def is_bolt11_invoice(self) -> bool:
|
|
@@ -7787,6 +8409,7 @@ class ReceivePaymentMethod:
|
|
|
7787
8409
|
# enum class, so that method calls and instance checks etc will work intuitively.
|
|
7788
8410
|
# We might be able to do this a little more neatly with a metaclass, but this'll do.
|
|
7789
8411
|
ReceivePaymentMethod.SPARK_ADDRESS = type("ReceivePaymentMethod.SPARK_ADDRESS", (ReceivePaymentMethod.SPARK_ADDRESS, ReceivePaymentMethod,), {}) # type: ignore
|
|
8412
|
+
ReceivePaymentMethod.SPARK_INVOICE = type("ReceivePaymentMethod.SPARK_INVOICE", (ReceivePaymentMethod.SPARK_INVOICE, ReceivePaymentMethod,), {}) # type: ignore
|
|
7790
8413
|
ReceivePaymentMethod.BITCOIN_ADDRESS = type("ReceivePaymentMethod.BITCOIN_ADDRESS", (ReceivePaymentMethod.BITCOIN_ADDRESS, ReceivePaymentMethod,), {}) # type: ignore
|
|
7791
8414
|
ReceivePaymentMethod.BOLT11_INVOICE = type("ReceivePaymentMethod.BOLT11_INVOICE", (ReceivePaymentMethod.BOLT11_INVOICE, ReceivePaymentMethod,), {}) # type: ignore
|
|
7792
8415
|
|
|
@@ -7801,9 +8424,17 @@ class _UniffiConverterTypeReceivePaymentMethod(_UniffiConverterRustBuffer):
|
|
|
7801
8424
|
return ReceivePaymentMethod.SPARK_ADDRESS(
|
|
7802
8425
|
)
|
|
7803
8426
|
if variant == 2:
|
|
7804
|
-
return ReceivePaymentMethod.
|
|
8427
|
+
return ReceivePaymentMethod.SPARK_INVOICE(
|
|
8428
|
+
_UniffiConverterOptionalTypeU128.read(buf),
|
|
8429
|
+
_UniffiConverterOptionalString.read(buf),
|
|
8430
|
+
_UniffiConverterOptionalUInt64.read(buf),
|
|
8431
|
+
_UniffiConverterOptionalString.read(buf),
|
|
8432
|
+
_UniffiConverterOptionalString.read(buf),
|
|
7805
8433
|
)
|
|
7806
8434
|
if variant == 3:
|
|
8435
|
+
return ReceivePaymentMethod.BITCOIN_ADDRESS(
|
|
8436
|
+
)
|
|
8437
|
+
if variant == 4:
|
|
7807
8438
|
return ReceivePaymentMethod.BOLT11_INVOICE(
|
|
7808
8439
|
_UniffiConverterString.read(buf),
|
|
7809
8440
|
_UniffiConverterOptionalUInt64.read(buf),
|
|
@@ -7814,6 +8445,13 @@ class _UniffiConverterTypeReceivePaymentMethod(_UniffiConverterRustBuffer):
|
|
|
7814
8445
|
def check_lower(value):
|
|
7815
8446
|
if value.is_spark_address():
|
|
7816
8447
|
return
|
|
8448
|
+
if value.is_spark_invoice():
|
|
8449
|
+
_UniffiConverterOptionalTypeU128.check_lower(value.amount)
|
|
8450
|
+
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
8451
|
+
_UniffiConverterOptionalUInt64.check_lower(value.expiry_time)
|
|
8452
|
+
_UniffiConverterOptionalString.check_lower(value.description)
|
|
8453
|
+
_UniffiConverterOptionalString.check_lower(value.sender_public_key)
|
|
8454
|
+
return
|
|
7817
8455
|
if value.is_bitcoin_address():
|
|
7818
8456
|
return
|
|
7819
8457
|
if value.is_bolt11_invoice():
|
|
@@ -7826,10 +8464,17 @@ class _UniffiConverterTypeReceivePaymentMethod(_UniffiConverterRustBuffer):
|
|
|
7826
8464
|
def write(value, buf):
|
|
7827
8465
|
if value.is_spark_address():
|
|
7828
8466
|
buf.write_i32(1)
|
|
7829
|
-
if value.
|
|
8467
|
+
if value.is_spark_invoice():
|
|
7830
8468
|
buf.write_i32(2)
|
|
7831
|
-
|
|
8469
|
+
_UniffiConverterOptionalTypeU128.write(value.amount, buf)
|
|
8470
|
+
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
8471
|
+
_UniffiConverterOptionalUInt64.write(value.expiry_time, buf)
|
|
8472
|
+
_UniffiConverterOptionalString.write(value.description, buf)
|
|
8473
|
+
_UniffiConverterOptionalString.write(value.sender_public_key, buf)
|
|
8474
|
+
if value.is_bitcoin_address():
|
|
7832
8475
|
buf.write_i32(3)
|
|
8476
|
+
if value.is_bolt11_invoice():
|
|
8477
|
+
buf.write_i32(4)
|
|
7833
8478
|
_UniffiConverterString.write(value.description, buf)
|
|
7834
8479
|
_UniffiConverterOptionalUInt64.write(value.amount_sats, buf)
|
|
7835
8480
|
|
|
@@ -8545,6 +9190,40 @@ class SendPaymentMethod:
|
|
|
8545
9190
|
return False
|
|
8546
9191
|
return True
|
|
8547
9192
|
|
|
9193
|
+
class SPARK_INVOICE:
|
|
9194
|
+
spark_invoice_details: "SparkInvoiceDetails"
|
|
9195
|
+
fee: "U128"
|
|
9196
|
+
"""
|
|
9197
|
+
Fee to pay for the transaction
|
|
9198
|
+
Denominated in sats if token identifier is empty, otherwise in the token base units
|
|
9199
|
+
"""
|
|
9200
|
+
|
|
9201
|
+
token_identifier: "typing.Optional[str]"
|
|
9202
|
+
"""
|
|
9203
|
+
The presence of this field indicates that the payment is for a token
|
|
9204
|
+
If empty, it is a Bitcoin payment
|
|
9205
|
+
"""
|
|
9206
|
+
|
|
9207
|
+
|
|
9208
|
+
def __init__(self,spark_invoice_details: "SparkInvoiceDetails", fee: "U128", token_identifier: "typing.Optional[str]"):
|
|
9209
|
+
self.spark_invoice_details = spark_invoice_details
|
|
9210
|
+
self.fee = fee
|
|
9211
|
+
self.token_identifier = token_identifier
|
|
9212
|
+
|
|
9213
|
+
def __str__(self):
|
|
9214
|
+
return "SendPaymentMethod.SPARK_INVOICE(spark_invoice_details={}, fee={}, token_identifier={})".format(self.spark_invoice_details, self.fee, self.token_identifier)
|
|
9215
|
+
|
|
9216
|
+
def __eq__(self, other):
|
|
9217
|
+
if not other.is_spark_invoice():
|
|
9218
|
+
return False
|
|
9219
|
+
if self.spark_invoice_details != other.spark_invoice_details:
|
|
9220
|
+
return False
|
|
9221
|
+
if self.fee != other.fee:
|
|
9222
|
+
return False
|
|
9223
|
+
if self.token_identifier != other.token_identifier:
|
|
9224
|
+
return False
|
|
9225
|
+
return True
|
|
9226
|
+
|
|
8548
9227
|
|
|
8549
9228
|
|
|
8550
9229
|
# For each variant, we have an `is_NAME` method for easily checking
|
|
@@ -8555,6 +9234,8 @@ class SendPaymentMethod:
|
|
|
8555
9234
|
return isinstance(self, SendPaymentMethod.BOLT11_INVOICE)
|
|
8556
9235
|
def is_spark_address(self) -> bool:
|
|
8557
9236
|
return isinstance(self, SendPaymentMethod.SPARK_ADDRESS)
|
|
9237
|
+
def is_spark_invoice(self) -> bool:
|
|
9238
|
+
return isinstance(self, SendPaymentMethod.SPARK_INVOICE)
|
|
8558
9239
|
|
|
8559
9240
|
|
|
8560
9241
|
# Now, a little trick - we make each nested variant class be a subclass of the main
|
|
@@ -8563,6 +9244,7 @@ class SendPaymentMethod:
|
|
|
8563
9244
|
SendPaymentMethod.BITCOIN_ADDRESS = type("SendPaymentMethod.BITCOIN_ADDRESS", (SendPaymentMethod.BITCOIN_ADDRESS, SendPaymentMethod,), {}) # type: ignore
|
|
8564
9245
|
SendPaymentMethod.BOLT11_INVOICE = type("SendPaymentMethod.BOLT11_INVOICE", (SendPaymentMethod.BOLT11_INVOICE, SendPaymentMethod,), {}) # type: ignore
|
|
8565
9246
|
SendPaymentMethod.SPARK_ADDRESS = type("SendPaymentMethod.SPARK_ADDRESS", (SendPaymentMethod.SPARK_ADDRESS, SendPaymentMethod,), {}) # type: ignore
|
|
9247
|
+
SendPaymentMethod.SPARK_INVOICE = type("SendPaymentMethod.SPARK_INVOICE", (SendPaymentMethod.SPARK_INVOICE, SendPaymentMethod,), {}) # type: ignore
|
|
8566
9248
|
|
|
8567
9249
|
|
|
8568
9250
|
|
|
@@ -8588,6 +9270,12 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
|
|
|
8588
9270
|
_UniffiConverterTypeU128.read(buf),
|
|
8589
9271
|
_UniffiConverterOptionalString.read(buf),
|
|
8590
9272
|
)
|
|
9273
|
+
if variant == 4:
|
|
9274
|
+
return SendPaymentMethod.SPARK_INVOICE(
|
|
9275
|
+
_UniffiConverterTypeSparkInvoiceDetails.read(buf),
|
|
9276
|
+
_UniffiConverterTypeU128.read(buf),
|
|
9277
|
+
_UniffiConverterOptionalString.read(buf),
|
|
9278
|
+
)
|
|
8591
9279
|
raise InternalError("Raw enum value doesn't match any cases")
|
|
8592
9280
|
|
|
8593
9281
|
@staticmethod
|
|
@@ -8606,6 +9294,11 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
|
|
|
8606
9294
|
_UniffiConverterTypeU128.check_lower(value.fee)
|
|
8607
9295
|
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
8608
9296
|
return
|
|
9297
|
+
if value.is_spark_invoice():
|
|
9298
|
+
_UniffiConverterTypeSparkInvoiceDetails.check_lower(value.spark_invoice_details)
|
|
9299
|
+
_UniffiConverterTypeU128.check_lower(value.fee)
|
|
9300
|
+
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
9301
|
+
return
|
|
8609
9302
|
raise ValueError(value)
|
|
8610
9303
|
|
|
8611
9304
|
@staticmethod
|
|
@@ -8624,6 +9317,11 @@ class _UniffiConverterTypeSendPaymentMethod(_UniffiConverterRustBuffer):
|
|
|
8624
9317
|
_UniffiConverterString.write(value.address, buf)
|
|
8625
9318
|
_UniffiConverterTypeU128.write(value.fee, buf)
|
|
8626
9319
|
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
9320
|
+
if value.is_spark_invoice():
|
|
9321
|
+
buf.write_i32(4)
|
|
9322
|
+
_UniffiConverterTypeSparkInvoiceDetails.write(value.spark_invoice_details, buf)
|
|
9323
|
+
_UniffiConverterTypeU128.write(value.fee, buf)
|
|
9324
|
+
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
8627
9325
|
|
|
8628
9326
|
|
|
8629
9327
|
|
|
@@ -9358,6 +10056,33 @@ class _UniffiConverterOptionalTypeLnurlPayInfo(_UniffiConverterRustBuffer):
|
|
|
9358
10056
|
|
|
9359
10057
|
|
|
9360
10058
|
|
|
10059
|
+
class _UniffiConverterOptionalTypeLnurlWithdrawInfo(_UniffiConverterRustBuffer):
|
|
10060
|
+
@classmethod
|
|
10061
|
+
def check_lower(cls, value):
|
|
10062
|
+
if value is not None:
|
|
10063
|
+
_UniffiConverterTypeLnurlWithdrawInfo.check_lower(value)
|
|
10064
|
+
|
|
10065
|
+
@classmethod
|
|
10066
|
+
def write(cls, value, buf):
|
|
10067
|
+
if value is None:
|
|
10068
|
+
buf.write_u8(0)
|
|
10069
|
+
return
|
|
10070
|
+
|
|
10071
|
+
buf.write_u8(1)
|
|
10072
|
+
_UniffiConverterTypeLnurlWithdrawInfo.write(value, buf)
|
|
10073
|
+
|
|
10074
|
+
@classmethod
|
|
10075
|
+
def read(cls, buf):
|
|
10076
|
+
flag = buf.read_u8()
|
|
10077
|
+
if flag == 0:
|
|
10078
|
+
return None
|
|
10079
|
+
elif flag == 1:
|
|
10080
|
+
return _UniffiConverterTypeLnurlWithdrawInfo.read(buf)
|
|
10081
|
+
else:
|
|
10082
|
+
raise InternalError("Unexpected flag byte for optional type")
|
|
10083
|
+
|
|
10084
|
+
|
|
10085
|
+
|
|
9361
10086
|
class _UniffiConverterOptionalTypePayment(_UniffiConverterRustBuffer):
|
|
9362
10087
|
@classmethod
|
|
9363
10088
|
def check_lower(cls, value):
|
|
@@ -9385,6 +10110,33 @@ class _UniffiConverterOptionalTypePayment(_UniffiConverterRustBuffer):
|
|
|
9385
10110
|
|
|
9386
10111
|
|
|
9387
10112
|
|
|
10113
|
+
class _UniffiConverterOptionalTypeSparkInvoicePaymentDetails(_UniffiConverterRustBuffer):
|
|
10114
|
+
@classmethod
|
|
10115
|
+
def check_lower(cls, value):
|
|
10116
|
+
if value is not None:
|
|
10117
|
+
_UniffiConverterTypeSparkInvoicePaymentDetails.check_lower(value)
|
|
10118
|
+
|
|
10119
|
+
@classmethod
|
|
10120
|
+
def write(cls, value, buf):
|
|
10121
|
+
if value is None:
|
|
10122
|
+
buf.write_u8(0)
|
|
10123
|
+
return
|
|
10124
|
+
|
|
10125
|
+
buf.write_u8(1)
|
|
10126
|
+
_UniffiConverterTypeSparkInvoicePaymentDetails.write(value, buf)
|
|
10127
|
+
|
|
10128
|
+
@classmethod
|
|
10129
|
+
def read(cls, buf):
|
|
10130
|
+
flag = buf.read_u8()
|
|
10131
|
+
if flag == 0:
|
|
10132
|
+
return None
|
|
10133
|
+
elif flag == 1:
|
|
10134
|
+
return _UniffiConverterTypeSparkInvoicePaymentDetails.read(buf)
|
|
10135
|
+
else:
|
|
10136
|
+
raise InternalError("Unexpected flag byte for optional type")
|
|
10137
|
+
|
|
10138
|
+
|
|
10139
|
+
|
|
9388
10140
|
class _UniffiConverterOptionalTypeAssetFilter(_UniffiConverterRustBuffer):
|
|
9389
10141
|
@classmethod
|
|
9390
10142
|
def check_lower(cls, value):
|
|
@@ -10050,6 +10802,11 @@ class _UniffiConverterMapStringTypeTokenBalance(_UniffiConverterRustBuffer):
|
|
|
10050
10802
|
|
|
10051
10803
|
|
|
10052
10804
|
|
|
10805
|
+
# External type LnurlWithdrawRequestDetails is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
10806
|
+
|
|
10807
|
+
|
|
10808
|
+
|
|
10809
|
+
|
|
10053
10810
|
# External type Rate is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
10054
10811
|
|
|
10055
10812
|
|
|
@@ -10060,6 +10817,11 @@ class _UniffiConverterMapStringTypeTokenBalance(_UniffiConverterRustBuffer):
|
|
|
10060
10817
|
|
|
10061
10818
|
|
|
10062
10819
|
|
|
10820
|
+
# External type SparkInvoiceDetails is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
10821
|
+
|
|
10822
|
+
|
|
10823
|
+
|
|
10824
|
+
|
|
10063
10825
|
# External type SuccessAction is in namespace "breez_sdk_common", crate breez_sdk_common
|
|
10064
10826
|
|
|
10065
10827
|
|
|
@@ -10291,6 +11053,8 @@ __all__ = [
|
|
|
10291
11053
|
"UpdateDepositPayload",
|
|
10292
11054
|
"WaitForPaymentIdentifier",
|
|
10293
11055
|
"CheckLightningAddressRequest",
|
|
11056
|
+
"CheckMessageRequest",
|
|
11057
|
+
"CheckMessageResponse",
|
|
10294
11058
|
"ClaimDepositRequest",
|
|
10295
11059
|
"ClaimDepositResponse",
|
|
10296
11060
|
"Config",
|
|
@@ -10313,6 +11077,9 @@ __all__ = [
|
|
|
10313
11077
|
"LnurlPayInfo",
|
|
10314
11078
|
"LnurlPayRequest",
|
|
10315
11079
|
"LnurlPayResponse",
|
|
11080
|
+
"LnurlWithdrawInfo",
|
|
11081
|
+
"LnurlWithdrawRequest",
|
|
11082
|
+
"LnurlWithdrawResponse",
|
|
10316
11083
|
"LogEntry",
|
|
10317
11084
|
"Payment",
|
|
10318
11085
|
"PaymentMetadata",
|
|
@@ -10330,6 +11097,9 @@ __all__ = [
|
|
|
10330
11097
|
"SendOnchainSpeedFeeQuote",
|
|
10331
11098
|
"SendPaymentRequest",
|
|
10332
11099
|
"SendPaymentResponse",
|
|
11100
|
+
"SignMessageRequest",
|
|
11101
|
+
"SignMessageResponse",
|
|
11102
|
+
"SparkInvoicePaymentDetails",
|
|
10333
11103
|
"SyncWalletRequest",
|
|
10334
11104
|
"SyncWalletResponse",
|
|
10335
11105
|
"TokenBalance",
|