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
|
@@ -461,11 +461,15 @@ def _uniffi_check_contract_api_version(lib):
|
|
|
461
461
|
raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
|
|
462
462
|
|
|
463
463
|
def _uniffi_check_api_checksums(lib):
|
|
464
|
-
if lib.
|
|
464
|
+
if lib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies() != 63089:
|
|
465
465
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
466
|
-
if lib.
|
|
466
|
+
if lib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates() != 48636:
|
|
467
467
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
468
|
-
if lib.
|
|
468
|
+
if lib.uniffi_breez_sdk_common_checksum_method_restclient_get_request() != 1702:
|
|
469
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
470
|
+
if lib.uniffi_breez_sdk_common_checksum_method_restclient_post_request() != 38998:
|
|
471
|
+
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
472
|
+
if lib.uniffi_breez_sdk_common_checksum_method_restclient_delete_request() != 26893:
|
|
469
473
|
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
|
470
474
|
|
|
471
475
|
# A ctypes library to expose the extern-C FFI definitions.
|
|
@@ -573,19 +577,51 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure):
|
|
|
573
577
|
]
|
|
574
578
|
_UNIFFI_FOREIGN_FUTURE_COMPLETE_VOID = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiForeignFutureStructVoid,
|
|
575
579
|
)
|
|
580
|
+
_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
581
|
+
)
|
|
582
|
+
_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
583
|
+
)
|
|
576
584
|
_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD0 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
577
585
|
)
|
|
578
586
|
_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD1 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
579
587
|
)
|
|
580
588
|
_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD2 = ctypes.CFUNCTYPE(None,ctypes.c_uint64,_UniffiRustBuffer,_UniffiRustBuffer,_UniffiRustBuffer,_UNIFFI_FOREIGN_FUTURE_COMPLETE_RUST_BUFFER,ctypes.c_uint64,ctypes.POINTER(_UniffiForeignFuture),
|
|
581
589
|
)
|
|
590
|
+
class _UniffiVTableCallbackInterfaceFiatService(ctypes.Structure):
|
|
591
|
+
_fields_ = [
|
|
592
|
+
("fetch_fiat_currencies", _UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0),
|
|
593
|
+
("fetch_fiat_rates", _UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1),
|
|
594
|
+
("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
|
|
595
|
+
]
|
|
582
596
|
class _UniffiVTableCallbackInterfaceRestClient(ctypes.Structure):
|
|
583
597
|
_fields_ = [
|
|
584
|
-
("
|
|
585
|
-
("
|
|
586
|
-
("
|
|
598
|
+
("get_request", _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD0),
|
|
599
|
+
("post_request", _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD1),
|
|
600
|
+
("delete_request", _UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD2),
|
|
587
601
|
("uniffi_free", _UNIFFI_CALLBACK_INTERFACE_FREE),
|
|
588
602
|
]
|
|
603
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice.argtypes = (
|
|
604
|
+
ctypes.c_void_p,
|
|
605
|
+
ctypes.POINTER(_UniffiRustCallStatus),
|
|
606
|
+
)
|
|
607
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice.restype = ctypes.c_void_p
|
|
608
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice.argtypes = (
|
|
609
|
+
ctypes.c_void_p,
|
|
610
|
+
ctypes.POINTER(_UniffiRustCallStatus),
|
|
611
|
+
)
|
|
612
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice.restype = None
|
|
613
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice.argtypes = (
|
|
614
|
+
ctypes.POINTER(_UniffiVTableCallbackInterfaceFiatService),
|
|
615
|
+
)
|
|
616
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice.restype = None
|
|
617
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies.argtypes = (
|
|
618
|
+
ctypes.c_void_p,
|
|
619
|
+
)
|
|
620
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies.restype = ctypes.c_uint64
|
|
621
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates.argtypes = (
|
|
622
|
+
ctypes.c_void_p,
|
|
623
|
+
)
|
|
624
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates.restype = ctypes.c_uint64
|
|
589
625
|
_UniffiLib.uniffi_breez_sdk_common_fn_clone_restclient.argtypes = (
|
|
590
626
|
ctypes.c_void_p,
|
|
591
627
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
@@ -600,26 +636,26 @@ _UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_restclient.argtypes =
|
|
|
600
636
|
ctypes.POINTER(_UniffiVTableCallbackInterfaceRestClient),
|
|
601
637
|
)
|
|
602
638
|
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_restclient.restype = None
|
|
603
|
-
_UniffiLib.
|
|
639
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_get_request.argtypes = (
|
|
604
640
|
ctypes.c_void_p,
|
|
605
641
|
_UniffiRustBuffer,
|
|
606
642
|
_UniffiRustBuffer,
|
|
607
643
|
)
|
|
608
|
-
_UniffiLib.
|
|
609
|
-
_UniffiLib.
|
|
644
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_get_request.restype = ctypes.c_uint64
|
|
645
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_post_request.argtypes = (
|
|
610
646
|
ctypes.c_void_p,
|
|
611
647
|
_UniffiRustBuffer,
|
|
612
648
|
_UniffiRustBuffer,
|
|
613
649
|
_UniffiRustBuffer,
|
|
614
650
|
)
|
|
615
|
-
_UniffiLib.
|
|
616
|
-
_UniffiLib.
|
|
651
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_post_request.restype = ctypes.c_uint64
|
|
652
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_delete_request.argtypes = (
|
|
617
653
|
ctypes.c_void_p,
|
|
618
654
|
_UniffiRustBuffer,
|
|
619
655
|
_UniffiRustBuffer,
|
|
620
656
|
_UniffiRustBuffer,
|
|
621
657
|
)
|
|
622
|
-
_UniffiLib.
|
|
658
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_delete_request.restype = ctypes.c_uint64
|
|
623
659
|
_UniffiLib.ffi_breez_sdk_common_rustbuffer_alloc.argtypes = (
|
|
624
660
|
ctypes.c_uint64,
|
|
625
661
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
@@ -888,15 +924,21 @@ _UniffiLib.ffi_breez_sdk_common_rust_future_complete_void.argtypes = (
|
|
|
888
924
|
ctypes.POINTER(_UniffiRustCallStatus),
|
|
889
925
|
)
|
|
890
926
|
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_void.restype = None
|
|
891
|
-
_UniffiLib.
|
|
927
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies.argtypes = (
|
|
892
928
|
)
|
|
893
|
-
_UniffiLib.
|
|
894
|
-
_UniffiLib.
|
|
929
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_currencies.restype = ctypes.c_uint16
|
|
930
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates.argtypes = (
|
|
895
931
|
)
|
|
896
|
-
_UniffiLib.
|
|
897
|
-
_UniffiLib.
|
|
932
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_fiatservice_fetch_fiat_rates.restype = ctypes.c_uint16
|
|
933
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_get_request.argtypes = (
|
|
898
934
|
)
|
|
899
|
-
_UniffiLib.
|
|
935
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_get_request.restype = ctypes.c_uint16
|
|
936
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_post_request.argtypes = (
|
|
937
|
+
)
|
|
938
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_post_request.restype = ctypes.c_uint16
|
|
939
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_delete_request.argtypes = (
|
|
940
|
+
)
|
|
941
|
+
_UniffiLib.uniffi_breez_sdk_common_checksum_method_restclient_delete_request.restype = ctypes.c_uint16
|
|
900
942
|
_UniffiLib.ffi_breez_sdk_common_uniffi_contract_version.argtypes = (
|
|
901
943
|
)
|
|
902
944
|
_UniffiLib.ffi_breez_sdk_common_uniffi_contract_version.restype = ctypes.c_uint32
|
|
@@ -1010,8 +1052,245 @@ class _UniffiConverterString:
|
|
|
1010
1052
|
|
|
1011
1053
|
|
|
1012
1054
|
|
|
1055
|
+
class FiatService(typing.Protocol):
|
|
1056
|
+
"""
|
|
1057
|
+
Trait covering fiat-related functionality
|
|
1058
|
+
"""
|
|
1059
|
+
|
|
1060
|
+
def fetch_fiat_currencies(self, ):
|
|
1061
|
+
"""
|
|
1062
|
+
List all supported fiat currencies for which there is a known exchange rate.
|
|
1063
|
+
"""
|
|
1064
|
+
|
|
1065
|
+
raise NotImplementedError
|
|
1066
|
+
def fetch_fiat_rates(self, ):
|
|
1067
|
+
"""
|
|
1068
|
+
Get the live rates from the server.
|
|
1069
|
+
"""
|
|
1070
|
+
|
|
1071
|
+
raise NotImplementedError
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
class FiatServiceImpl:
|
|
1075
|
+
"""
|
|
1076
|
+
Trait covering fiat-related functionality
|
|
1077
|
+
"""
|
|
1078
|
+
|
|
1079
|
+
_pointer: ctypes.c_void_p
|
|
1080
|
+
|
|
1081
|
+
def __init__(self, *args, **kwargs):
|
|
1082
|
+
raise ValueError("This class has no default constructor")
|
|
1083
|
+
|
|
1084
|
+
def __del__(self):
|
|
1085
|
+
# In case of partial initialization of instances.
|
|
1086
|
+
pointer = getattr(self, "_pointer", None)
|
|
1087
|
+
if pointer is not None:
|
|
1088
|
+
_uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_free_fiatservice, pointer)
|
|
1089
|
+
|
|
1090
|
+
def _uniffi_clone_pointer(self):
|
|
1091
|
+
return _uniffi_rust_call(_UniffiLib.uniffi_breez_sdk_common_fn_clone_fiatservice, self._pointer)
|
|
1092
|
+
|
|
1093
|
+
# Used by alternative constructors or any methods which return this type.
|
|
1094
|
+
@classmethod
|
|
1095
|
+
def _make_instance_(cls, pointer):
|
|
1096
|
+
# Lightly yucky way to bypass the usual __init__ logic
|
|
1097
|
+
# and just create a new instance with the required pointer.
|
|
1098
|
+
inst = cls.__new__(cls)
|
|
1099
|
+
inst._pointer = pointer
|
|
1100
|
+
return inst
|
|
1101
|
+
|
|
1102
|
+
async def fetch_fiat_currencies(self, ) -> "typing.List[FiatCurrency]":
|
|
1103
|
+
"""
|
|
1104
|
+
List all supported fiat currencies for which there is a known exchange rate.
|
|
1105
|
+
"""
|
|
1106
|
+
|
|
1107
|
+
return await _uniffi_rust_call_async(
|
|
1108
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_currencies(
|
|
1109
|
+
self._uniffi_clone_pointer(),
|
|
1110
|
+
),
|
|
1111
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1112
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1113
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1114
|
+
# lift function
|
|
1115
|
+
_UniffiConverterSequenceTypeFiatCurrency.lift,
|
|
1116
|
+
|
|
1117
|
+
# Error FFI converter
|
|
1118
|
+
_UniffiConverterTypeServiceConnectivityError,
|
|
1119
|
+
|
|
1120
|
+
)
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
async def fetch_fiat_rates(self, ) -> "typing.List[Rate]":
|
|
1125
|
+
"""
|
|
1126
|
+
Get the live rates from the server.
|
|
1127
|
+
"""
|
|
1128
|
+
|
|
1129
|
+
return await _uniffi_rust_call_async(
|
|
1130
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_fiatservice_fetch_fiat_rates(
|
|
1131
|
+
self._uniffi_clone_pointer(),
|
|
1132
|
+
),
|
|
1133
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_poll_rust_buffer,
|
|
1134
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_complete_rust_buffer,
|
|
1135
|
+
_UniffiLib.ffi_breez_sdk_common_rust_future_free_rust_buffer,
|
|
1136
|
+
# lift function
|
|
1137
|
+
_UniffiConverterSequenceTypeRate.lift,
|
|
1138
|
+
|
|
1139
|
+
# Error FFI converter
|
|
1140
|
+
_UniffiConverterTypeServiceConnectivityError,
|
|
1141
|
+
|
|
1142
|
+
)
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
# Magic number for the Rust proxy to call using the same mechanism as every other method,
|
|
1146
|
+
# to free the callback once it's dropped by Rust.
|
|
1147
|
+
_UNIFFI_IDX_CALLBACK_FREE = 0
|
|
1148
|
+
# Return codes for callback calls
|
|
1149
|
+
_UNIFFI_CALLBACK_SUCCESS = 0
|
|
1150
|
+
_UNIFFI_CALLBACK_ERROR = 1
|
|
1151
|
+
_UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2
|
|
1152
|
+
|
|
1153
|
+
class _UniffiCallbackInterfaceFfiConverter:
|
|
1154
|
+
_handle_map = _UniffiHandleMap()
|
|
1155
|
+
|
|
1156
|
+
@classmethod
|
|
1157
|
+
def lift(cls, handle):
|
|
1158
|
+
return cls._handle_map.get(handle)
|
|
1159
|
+
|
|
1160
|
+
@classmethod
|
|
1161
|
+
def read(cls, buf):
|
|
1162
|
+
handle = buf.read_u64()
|
|
1163
|
+
cls.lift(handle)
|
|
1164
|
+
|
|
1165
|
+
@classmethod
|
|
1166
|
+
def check_lower(cls, cb):
|
|
1167
|
+
pass
|
|
1168
|
+
|
|
1169
|
+
@classmethod
|
|
1170
|
+
def lower(cls, cb):
|
|
1171
|
+
handle = cls._handle_map.insert(cb)
|
|
1172
|
+
return handle
|
|
1173
|
+
|
|
1174
|
+
@classmethod
|
|
1175
|
+
def write(cls, cb, buf):
|
|
1176
|
+
buf.write_u64(cls.lower(cb))
|
|
1177
|
+
|
|
1178
|
+
# Put all the bits inside a class to keep the top-level namespace clean
|
|
1179
|
+
class _UniffiTraitImplFiatService:
|
|
1180
|
+
# For each method, generate a callback function to pass to Rust
|
|
1181
|
+
|
|
1182
|
+
@_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD0
|
|
1183
|
+
def fetch_fiat_currencies(
|
|
1184
|
+
uniffi_handle,
|
|
1185
|
+
uniffi_future_callback,
|
|
1186
|
+
uniffi_callback_data,
|
|
1187
|
+
uniffi_out_return,
|
|
1188
|
+
):
|
|
1189
|
+
uniffi_obj = _UniffiConverterTypeFiatService._handle_map.get(uniffi_handle)
|
|
1190
|
+
def make_call():
|
|
1191
|
+
args = ()
|
|
1192
|
+
method = uniffi_obj.fetch_fiat_currencies
|
|
1193
|
+
return method(*args)
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
def handle_success(return_value):
|
|
1197
|
+
uniffi_future_callback(
|
|
1198
|
+
uniffi_callback_data,
|
|
1199
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1200
|
+
_UniffiConverterSequenceTypeFiatCurrency.lower(return_value),
|
|
1201
|
+
_UniffiRustCallStatus.default()
|
|
1202
|
+
)
|
|
1203
|
+
)
|
|
1204
|
+
|
|
1205
|
+
def handle_error(status_code, rust_buffer):
|
|
1206
|
+
uniffi_future_callback(
|
|
1207
|
+
uniffi_callback_data,
|
|
1208
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1209
|
+
_UniffiRustBuffer.default(),
|
|
1210
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1211
|
+
)
|
|
1212
|
+
)
|
|
1213
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1214
|
+
|
|
1215
|
+
@_UNIFFI_CALLBACK_INTERFACE_FIAT_SERVICE_METHOD1
|
|
1216
|
+
def fetch_fiat_rates(
|
|
1217
|
+
uniffi_handle,
|
|
1218
|
+
uniffi_future_callback,
|
|
1219
|
+
uniffi_callback_data,
|
|
1220
|
+
uniffi_out_return,
|
|
1221
|
+
):
|
|
1222
|
+
uniffi_obj = _UniffiConverterTypeFiatService._handle_map.get(uniffi_handle)
|
|
1223
|
+
def make_call():
|
|
1224
|
+
args = ()
|
|
1225
|
+
method = uniffi_obj.fetch_fiat_rates
|
|
1226
|
+
return method(*args)
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
def handle_success(return_value):
|
|
1230
|
+
uniffi_future_callback(
|
|
1231
|
+
uniffi_callback_data,
|
|
1232
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1233
|
+
_UniffiConverterSequenceTypeRate.lower(return_value),
|
|
1234
|
+
_UniffiRustCallStatus.default()
|
|
1235
|
+
)
|
|
1236
|
+
)
|
|
1237
|
+
|
|
1238
|
+
def handle_error(status_code, rust_buffer):
|
|
1239
|
+
uniffi_future_callback(
|
|
1240
|
+
uniffi_callback_data,
|
|
1241
|
+
_UniffiForeignFutureStructRustBuffer(
|
|
1242
|
+
_UniffiRustBuffer.default(),
|
|
1243
|
+
_UniffiRustCallStatus(status_code, rust_buffer),
|
|
1244
|
+
)
|
|
1245
|
+
)
|
|
1246
|
+
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1247
|
+
|
|
1248
|
+
@_UNIFFI_CALLBACK_INTERFACE_FREE
|
|
1249
|
+
def _uniffi_free(uniffi_handle):
|
|
1250
|
+
_UniffiConverterTypeFiatService._handle_map.remove(uniffi_handle)
|
|
1251
|
+
|
|
1252
|
+
# Generate the FFI VTable. This has a field for each callback interface method.
|
|
1253
|
+
_uniffi_vtable = _UniffiVTableCallbackInterfaceFiatService(
|
|
1254
|
+
fetch_fiat_currencies,
|
|
1255
|
+
fetch_fiat_rates,
|
|
1256
|
+
_uniffi_free
|
|
1257
|
+
)
|
|
1258
|
+
# Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever,
|
|
1259
|
+
# or else bad things will happen when Rust tries to access it.
|
|
1260
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_init_callback_vtable_fiatservice(ctypes.byref(_uniffi_vtable))
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
class _UniffiConverterTypeFiatService:
|
|
1265
|
+
_handle_map = _UniffiHandleMap()
|
|
1266
|
+
|
|
1267
|
+
@staticmethod
|
|
1268
|
+
def lift(value: int):
|
|
1269
|
+
return FiatServiceImpl._make_instance_(value)
|
|
1270
|
+
|
|
1271
|
+
@staticmethod
|
|
1272
|
+
def check_lower(value: FiatService):
|
|
1273
|
+
pass
|
|
1274
|
+
|
|
1275
|
+
@staticmethod
|
|
1276
|
+
def lower(value: FiatService):
|
|
1277
|
+
return _UniffiConverterTypeFiatService._handle_map.insert(value)
|
|
1278
|
+
|
|
1279
|
+
@classmethod
|
|
1280
|
+
def read(cls, buf: _UniffiRustBuffer):
|
|
1281
|
+
ptr = buf.read_u64()
|
|
1282
|
+
if ptr == 0:
|
|
1283
|
+
raise InternalError("Raw pointer value was null")
|
|
1284
|
+
return cls.lift(ptr)
|
|
1285
|
+
|
|
1286
|
+
@classmethod
|
|
1287
|
+
def write(cls, value: FiatService, buf: _UniffiRustBuffer):
|
|
1288
|
+
buf.write_u64(cls.lower(value))
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
|
|
1013
1292
|
class RestClient(typing.Protocol):
|
|
1014
|
-
def
|
|
1293
|
+
def get_request(self, url: "str",headers: "typing.Optional[dict[str, str]]"):
|
|
1015
1294
|
"""
|
|
1016
1295
|
Makes a GET request and logs on DEBUG.
|
|
1017
1296
|
### Arguments
|
|
@@ -1020,7 +1299,7 @@ class RestClient(typing.Protocol):
|
|
|
1020
1299
|
"""
|
|
1021
1300
|
|
|
1022
1301
|
raise NotImplementedError
|
|
1023
|
-
def
|
|
1302
|
+
def post_request(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]"):
|
|
1024
1303
|
"""
|
|
1025
1304
|
Makes a POST request, and logs on DEBUG.
|
|
1026
1305
|
### Arguments
|
|
@@ -1030,7 +1309,7 @@ class RestClient(typing.Protocol):
|
|
|
1030
1309
|
"""
|
|
1031
1310
|
|
|
1032
1311
|
raise NotImplementedError
|
|
1033
|
-
def
|
|
1312
|
+
def delete_request(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]"):
|
|
1034
1313
|
"""
|
|
1035
1314
|
Makes a DELETE request, and logs on DEBUG.
|
|
1036
1315
|
### Arguments
|
|
@@ -1066,7 +1345,7 @@ class RestClientImpl:
|
|
|
1066
1345
|
inst._pointer = pointer
|
|
1067
1346
|
return inst
|
|
1068
1347
|
|
|
1069
|
-
async def
|
|
1348
|
+
async def get_request(self, url: "str",headers: "typing.Optional[dict[str, str]]") -> "RestResponse":
|
|
1070
1349
|
"""
|
|
1071
1350
|
Makes a GET request and logs on DEBUG.
|
|
1072
1351
|
### Arguments
|
|
@@ -1079,7 +1358,7 @@ class RestClientImpl:
|
|
|
1079
1358
|
_UniffiConverterOptionalMapStringString.check_lower(headers)
|
|
1080
1359
|
|
|
1081
1360
|
return await _uniffi_rust_call_async(
|
|
1082
|
-
_UniffiLib.
|
|
1361
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_get_request(
|
|
1083
1362
|
self._uniffi_clone_pointer(),
|
|
1084
1363
|
_UniffiConverterString.lower(url),
|
|
1085
1364
|
_UniffiConverterOptionalMapStringString.lower(headers)
|
|
@@ -1097,7 +1376,7 @@ _UniffiConverterTypeServiceConnectivityError,
|
|
|
1097
1376
|
|
|
1098
1377
|
|
|
1099
1378
|
|
|
1100
|
-
async def
|
|
1379
|
+
async def post_request(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]") -> "RestResponse":
|
|
1101
1380
|
"""
|
|
1102
1381
|
Makes a POST request, and logs on DEBUG.
|
|
1103
1382
|
### Arguments
|
|
@@ -1113,7 +1392,7 @@ _UniffiConverterTypeServiceConnectivityError,
|
|
|
1113
1392
|
_UniffiConverterOptionalString.check_lower(body)
|
|
1114
1393
|
|
|
1115
1394
|
return await _uniffi_rust_call_async(
|
|
1116
|
-
_UniffiLib.
|
|
1395
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_post_request(
|
|
1117
1396
|
self._uniffi_clone_pointer(),
|
|
1118
1397
|
_UniffiConverterString.lower(url),
|
|
1119
1398
|
_UniffiConverterOptionalMapStringString.lower(headers),
|
|
@@ -1132,7 +1411,7 @@ _UniffiConverterTypeServiceConnectivityError,
|
|
|
1132
1411
|
|
|
1133
1412
|
|
|
1134
1413
|
|
|
1135
|
-
async def
|
|
1414
|
+
async def delete_request(self, url: "str",headers: "typing.Optional[dict[str, str]]",body: "typing.Optional[str]") -> "RestResponse":
|
|
1136
1415
|
"""
|
|
1137
1416
|
Makes a DELETE request, and logs on DEBUG.
|
|
1138
1417
|
### Arguments
|
|
@@ -1148,7 +1427,7 @@ _UniffiConverterTypeServiceConnectivityError,
|
|
|
1148
1427
|
_UniffiConverterOptionalString.check_lower(body)
|
|
1149
1428
|
|
|
1150
1429
|
return await _uniffi_rust_call_async(
|
|
1151
|
-
_UniffiLib.
|
|
1430
|
+
_UniffiLib.uniffi_breez_sdk_common_fn_method_restclient_delete_request(
|
|
1152
1431
|
self._uniffi_clone_pointer(),
|
|
1153
1432
|
_UniffiConverterString.lower(url),
|
|
1154
1433
|
_UniffiConverterOptionalMapStringString.lower(headers),
|
|
@@ -1166,45 +1445,14 @@ _UniffiConverterTypeServiceConnectivityError,
|
|
|
1166
1445
|
)
|
|
1167
1446
|
|
|
1168
1447
|
|
|
1169
|
-
# Magic number for the Rust proxy to call using the same mechanism as every other method,
|
|
1170
|
-
# to free the callback once it's dropped by Rust.
|
|
1171
|
-
_UNIFFI_IDX_CALLBACK_FREE = 0
|
|
1172
|
-
# Return codes for callback calls
|
|
1173
|
-
_UNIFFI_CALLBACK_SUCCESS = 0
|
|
1174
|
-
_UNIFFI_CALLBACK_ERROR = 1
|
|
1175
|
-
_UNIFFI_CALLBACK_UNEXPECTED_ERROR = 2
|
|
1176
|
-
|
|
1177
|
-
class _UniffiCallbackInterfaceFfiConverter:
|
|
1178
|
-
_handle_map = _UniffiHandleMap()
|
|
1179
|
-
|
|
1180
|
-
@classmethod
|
|
1181
|
-
def lift(cls, handle):
|
|
1182
|
-
return cls._handle_map.get(handle)
|
|
1183
|
-
|
|
1184
|
-
@classmethod
|
|
1185
|
-
def read(cls, buf):
|
|
1186
|
-
handle = buf.read_u64()
|
|
1187
|
-
cls.lift(handle)
|
|
1188
|
-
|
|
1189
|
-
@classmethod
|
|
1190
|
-
def check_lower(cls, cb):
|
|
1191
|
-
pass
|
|
1192
|
-
|
|
1193
|
-
@classmethod
|
|
1194
|
-
def lower(cls, cb):
|
|
1195
|
-
handle = cls._handle_map.insert(cb)
|
|
1196
|
-
return handle
|
|
1197
1448
|
|
|
1198
|
-
@classmethod
|
|
1199
|
-
def write(cls, cb, buf):
|
|
1200
|
-
buf.write_u64(cls.lower(cb))
|
|
1201
1449
|
|
|
1202
1450
|
# Put all the bits inside a class to keep the top-level namespace clean
|
|
1203
1451
|
class _UniffiTraitImplRestClient:
|
|
1204
1452
|
# For each method, generate a callback function to pass to Rust
|
|
1205
1453
|
|
|
1206
1454
|
@_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD0
|
|
1207
|
-
def
|
|
1455
|
+
def get_request(
|
|
1208
1456
|
uniffi_handle,
|
|
1209
1457
|
url,
|
|
1210
1458
|
headers,
|
|
@@ -1215,7 +1463,7 @@ class _UniffiTraitImplRestClient:
|
|
|
1215
1463
|
uniffi_obj = _UniffiConverterTypeRestClient._handle_map.get(uniffi_handle)
|
|
1216
1464
|
def make_call():
|
|
1217
1465
|
args = (_UniffiConverterString.lift(url), _UniffiConverterOptionalMapStringString.lift(headers), )
|
|
1218
|
-
method = uniffi_obj.
|
|
1466
|
+
method = uniffi_obj.get_request
|
|
1219
1467
|
return method(*args)
|
|
1220
1468
|
|
|
1221
1469
|
|
|
@@ -1239,7 +1487,7 @@ class _UniffiTraitImplRestClient:
|
|
|
1239
1487
|
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1240
1488
|
|
|
1241
1489
|
@_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD1
|
|
1242
|
-
def
|
|
1490
|
+
def post_request(
|
|
1243
1491
|
uniffi_handle,
|
|
1244
1492
|
url,
|
|
1245
1493
|
headers,
|
|
@@ -1251,7 +1499,7 @@ class _UniffiTraitImplRestClient:
|
|
|
1251
1499
|
uniffi_obj = _UniffiConverterTypeRestClient._handle_map.get(uniffi_handle)
|
|
1252
1500
|
def make_call():
|
|
1253
1501
|
args = (_UniffiConverterString.lift(url), _UniffiConverterOptionalMapStringString.lift(headers), _UniffiConverterOptionalString.lift(body), )
|
|
1254
|
-
method = uniffi_obj.
|
|
1502
|
+
method = uniffi_obj.post_request
|
|
1255
1503
|
return method(*args)
|
|
1256
1504
|
|
|
1257
1505
|
|
|
@@ -1275,7 +1523,7 @@ class _UniffiTraitImplRestClient:
|
|
|
1275
1523
|
uniffi_out_return[0] = _uniffi_trait_interface_call_async_with_error(make_call, handle_success, handle_error, ServiceConnectivityError, _UniffiConverterTypeServiceConnectivityError.lower)
|
|
1276
1524
|
|
|
1277
1525
|
@_UNIFFI_CALLBACK_INTERFACE_REST_CLIENT_METHOD2
|
|
1278
|
-
def
|
|
1526
|
+
def delete_request(
|
|
1279
1527
|
uniffi_handle,
|
|
1280
1528
|
url,
|
|
1281
1529
|
headers,
|
|
@@ -1287,7 +1535,7 @@ class _UniffiTraitImplRestClient:
|
|
|
1287
1535
|
uniffi_obj = _UniffiConverterTypeRestClient._handle_map.get(uniffi_handle)
|
|
1288
1536
|
def make_call():
|
|
1289
1537
|
args = (_UniffiConverterString.lift(url), _UniffiConverterOptionalMapStringString.lift(headers), _UniffiConverterOptionalString.lift(body), )
|
|
1290
|
-
method = uniffi_obj.
|
|
1538
|
+
method = uniffi_obj.delete_request
|
|
1291
1539
|
return method(*args)
|
|
1292
1540
|
|
|
1293
1541
|
|
|
@@ -1316,9 +1564,9 @@ class _UniffiTraitImplRestClient:
|
|
|
1316
1564
|
|
|
1317
1565
|
# Generate the FFI VTable. This has a field for each callback interface method.
|
|
1318
1566
|
_uniffi_vtable = _UniffiVTableCallbackInterfaceRestClient(
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1567
|
+
get_request,
|
|
1568
|
+
post_request,
|
|
1569
|
+
delete_request,
|
|
1322
1570
|
_uniffi_free
|
|
1323
1571
|
)
|
|
1324
1572
|
# Send Rust a pointer to the VTable. Note: this means we need to keep the struct alive forever,
|
|
@@ -5045,6 +5293,31 @@ class _UniffiConverterSequenceTypeBolt12OfferBlindedPath(_UniffiConverterRustBuf
|
|
|
5045
5293
|
|
|
5046
5294
|
|
|
5047
5295
|
|
|
5296
|
+
class _UniffiConverterSequenceTypeFiatCurrency(_UniffiConverterRustBuffer):
|
|
5297
|
+
@classmethod
|
|
5298
|
+
def check_lower(cls, value):
|
|
5299
|
+
for item in value:
|
|
5300
|
+
_UniffiConverterTypeFiatCurrency.check_lower(item)
|
|
5301
|
+
|
|
5302
|
+
@classmethod
|
|
5303
|
+
def write(cls, value, buf):
|
|
5304
|
+
items = len(value)
|
|
5305
|
+
buf.write_i32(items)
|
|
5306
|
+
for item in value:
|
|
5307
|
+
_UniffiConverterTypeFiatCurrency.write(item, buf)
|
|
5308
|
+
|
|
5309
|
+
@classmethod
|
|
5310
|
+
def read(cls, buf):
|
|
5311
|
+
count = buf.read_i32()
|
|
5312
|
+
if count < 0:
|
|
5313
|
+
raise InternalError("Unexpected negative sequence length")
|
|
5314
|
+
|
|
5315
|
+
return [
|
|
5316
|
+
_UniffiConverterTypeFiatCurrency.read(buf) for i in range(count)
|
|
5317
|
+
]
|
|
5318
|
+
|
|
5319
|
+
|
|
5320
|
+
|
|
5048
5321
|
class _UniffiConverterSequenceTypeLocaleOverrides(_UniffiConverterRustBuffer):
|
|
5049
5322
|
@classmethod
|
|
5050
5323
|
def check_lower(cls, value):
|
|
@@ -5095,6 +5368,31 @@ class _UniffiConverterSequenceTypeLocalizedName(_UniffiConverterRustBuffer):
|
|
|
5095
5368
|
|
|
5096
5369
|
|
|
5097
5370
|
|
|
5371
|
+
class _UniffiConverterSequenceTypeRate(_UniffiConverterRustBuffer):
|
|
5372
|
+
@classmethod
|
|
5373
|
+
def check_lower(cls, value):
|
|
5374
|
+
for item in value:
|
|
5375
|
+
_UniffiConverterTypeRate.check_lower(item)
|
|
5376
|
+
|
|
5377
|
+
@classmethod
|
|
5378
|
+
def write(cls, value, buf):
|
|
5379
|
+
items = len(value)
|
|
5380
|
+
buf.write_i32(items)
|
|
5381
|
+
for item in value:
|
|
5382
|
+
_UniffiConverterTypeRate.write(item, buf)
|
|
5383
|
+
|
|
5384
|
+
@classmethod
|
|
5385
|
+
def read(cls, buf):
|
|
5386
|
+
count = buf.read_i32()
|
|
5387
|
+
if count < 0:
|
|
5388
|
+
raise InternalError("Unexpected negative sequence length")
|
|
5389
|
+
|
|
5390
|
+
return [
|
|
5391
|
+
_UniffiConverterTypeRate.read(buf) for i in range(count)
|
|
5392
|
+
]
|
|
5393
|
+
|
|
5394
|
+
|
|
5395
|
+
|
|
5098
5396
|
class _UniffiConverterSequenceTypeInputType(_UniffiConverterRustBuffer):
|
|
5099
5397
|
@classmethod
|
|
5100
5398
|
def check_lower(cls, value):
|
|
@@ -5310,6 +5608,7 @@ __all__ = [
|
|
|
5310
5608
|
"Symbol",
|
|
5311
5609
|
"TokensPaymentDetails",
|
|
5312
5610
|
"UrlSuccessActionData",
|
|
5611
|
+
"FiatService",
|
|
5313
5612
|
"RestClient",
|
|
5314
5613
|
]
|
|
5315
5614
|
|