Stop using singleton instance on Dart bindings

Apply changes to test cases on Dart plugin
This commit is contained in:
Erdem Yerebasmaz
2024-05-22 14:59:39 +03:00
parent f18f3cb9a6
commit 1fe5bb353c
21 changed files with 1482 additions and 1508 deletions

View File

@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.35.
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
@@ -20,8 +20,22 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
required super.portManager,
});
CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BindingLiquidSdkPtr => wire
._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr;
@protected
AnyhowException dco_decode_AnyhowException(dynamic raw);
BindingLiquidSdk
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
dynamic raw);
@protected
BindingLiquidSdk
dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
dynamic raw);
@protected
BindingLiquidSdk dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
dynamic raw);
@protected
String dco_decode_String(dynamic raw);
@@ -50,9 +64,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RestoreRequest dco_decode_box_autoadd_restore_request(dynamic raw);
@protected
int dco_decode_box_autoadd_u_64(dynamic raw);
@protected
ConnectRequest dco_decode_connect_request(dynamic raw);
@@ -66,7 +77,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
int dco_decode_i_32(dynamic raw);
@protected
List<Payment> dco_decode_list_payment(dynamic raw);
LiquidSdkError dco_decode_liquid_sdk_error(dynamic raw);
@protected
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
@@ -77,21 +88,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
String? dco_decode_opt_String(dynamic raw);
@protected
int? dco_decode_opt_box_autoadd_u_64(dynamic raw);
@protected
Payment dco_decode_payment(dynamic raw);
@protected
PaymentError dco_decode_payment_error(dynamic raw);
@protected
PaymentState dco_decode_payment_state(dynamic raw);
@protected
PaymentType dco_decode_payment_type(dynamic raw);
@protected
PrepareReceiveRequest dco_decode_prepare_receive_request(dynamic raw);
@@ -113,9 +112,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
SendPaymentResponse dco_decode_send_payment_response(dynamic raw);
@protected
int dco_decode_u_32(dynamic raw);
@protected
int dco_decode_u_64(dynamic raw);
@@ -126,7 +122,21 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void dco_decode_unit(dynamic raw);
@protected
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer);
int dco_decode_usize(dynamic raw);
@protected
BindingLiquidSdk
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
SseDeserializer deserializer);
@protected
BindingLiquidSdk
sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
SseDeserializer deserializer);
@protected
BindingLiquidSdk sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
SseDeserializer deserializer);
@protected
String sse_decode_String(SseDeserializer deserializer);
@@ -155,9 +165,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
RestoreRequest sse_decode_box_autoadd_restore_request(SseDeserializer deserializer);
@protected
int sse_decode_box_autoadd_u_64(SseDeserializer deserializer);
@protected
ConnectRequest sse_decode_connect_request(SseDeserializer deserializer);
@@ -171,7 +178,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
int sse_decode_i_32(SseDeserializer deserializer);
@protected
List<Payment> sse_decode_list_payment(SseDeserializer deserializer);
LiquidSdkError sse_decode_liquid_sdk_error(SseDeserializer deserializer);
@protected
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
@@ -182,21 +189,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
String? sse_decode_opt_String(SseDeserializer deserializer);
@protected
int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer);
@protected
Payment sse_decode_payment(SseDeserializer deserializer);
@protected
PaymentError sse_decode_payment_error(SseDeserializer deserializer);
@protected
PaymentState sse_decode_payment_state(SseDeserializer deserializer);
@protected
PaymentType sse_decode_payment_type(SseDeserializer deserializer);
@protected
PrepareReceiveRequest sse_decode_prepare_receive_request(SseDeserializer deserializer);
@@ -218,9 +213,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
SendPaymentResponse sse_decode_send_payment_response(SseDeserializer deserializer);
@protected
int sse_decode_u_32(SseDeserializer deserializer);
@protected
int sse_decode_u_64(SseDeserializer deserializer);
@@ -231,10 +223,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_decode_unit(SseDeserializer deserializer);
@protected
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_encode_AnyhowException(AnyhowException raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
throw UnimplementedError();
}
int sse_decode_usize(SseDeserializer deserializer);
@protected
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_encode_String(String raw) {
@@ -302,22 +291,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
return ptr;
}
@protected
ffi.Pointer<ffi.Uint64> cst_encode_box_autoadd_u_64(int raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
return wire.cst_new_box_autoadd_u_64(cst_encode_u_64(raw));
}
@protected
ffi.Pointer<wire_cst_list_payment> cst_encode_list_payment(List<Payment> raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
final ans = wire.cst_new_list_payment(raw.length);
for (var i = 0; i < raw.length; ++i) {
cst_api_fill_to_wire_payment(raw[i], ans.ref.ptr[i]);
}
return ans;
}
@protected
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_encode_list_prim_u_8_strict(Uint8List raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
@@ -332,12 +305,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
return raw == null ? ffi.nullptr : cst_encode_String(raw);
}
@protected
ffi.Pointer<ffi.Uint64> cst_encode_opt_box_autoadd_u_64(int? raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_64(raw);
}
@protected
int cst_encode_u_64(int raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
@@ -401,20 +368,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void cst_api_fill_to_wire_get_info_response(GetInfoResponse apiObj, wire_cst_get_info_response wireObj) {
wireObj.balance_sat = cst_encode_u_64(apiObj.balanceSat);
wireObj.pending_send_sat = cst_encode_u_64(apiObj.pendingSendSat);
wireObj.pending_receive_sat = cst_encode_u_64(apiObj.pendingReceiveSat);
wireObj.pubkey = cst_encode_String(apiObj.pubkey);
}
@protected
void cst_api_fill_to_wire_payment(Payment apiObj, wire_cst_payment wireObj) {
wireObj.tx_id = cst_encode_String(apiObj.txId);
wireObj.swap_id = cst_encode_opt_String(apiObj.swapId);
wireObj.timestamp = cst_encode_u_32(apiObj.timestamp);
wireObj.amount_sat = cst_encode_u_64(apiObj.amountSat);
wireObj.fees_sat = cst_encode_opt_box_autoadd_u_64(apiObj.feesSat);
wireObj.payment_type = cst_encode_payment_type(apiObj.paymentType);
wireObj.status = cst_encode_payment_state(apiObj.status);
void cst_api_fill_to_wire_liquid_sdk_error(LiquidSdkError apiObj, wire_cst_liquid_sdk_error wireObj) {
if (apiObj is LiquidSdkError_Generic) {
var pre_err = cst_encode_String(apiObj.err);
wireObj.tag = 0;
wireObj.kind.Generic.err = pre_err;
return;
}
}
@protected
@@ -465,10 +429,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
}
if (apiObj is PaymentError_Refunded) {
var pre_err = cst_encode_String(apiObj.err);
var pre_refund_tx_id = cst_encode_String(apiObj.refundTxId);
var pre_txid = cst_encode_String(apiObj.txid);
wireObj.tag = 10;
wireObj.kind.Refunded.err = pre_err;
wireObj.kind.Refunded.refund_tx_id = pre_refund_tx_id;
wireObj.kind.Refunded.txid = pre_txid;
return;
}
if (apiObj is PaymentError_SendError) {
@@ -529,6 +493,18 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
wireObj.txid = cst_encode_String(apiObj.txid);
}
@protected
int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
BindingLiquidSdk raw);
@protected
int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
BindingLiquidSdk raw);
@protected
int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
BindingLiquidSdk raw);
@protected
bool cst_encode_bool(bool raw);
@@ -538,15 +514,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
int cst_encode_network(Network raw);
@protected
int cst_encode_payment_state(PaymentState raw);
@protected
int cst_encode_payment_type(PaymentType raw);
@protected
int cst_encode_u_32(int raw);
@protected
int cst_encode_u_8(int raw);
@@ -554,7 +521,19 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void cst_encode_unit(void raw);
@protected
void sse_encode_AnyhowException(AnyhowException self, SseSerializer serializer);
int cst_encode_usize(int raw);
@protected
void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
BindingLiquidSdk self, SseSerializer serializer);
@protected
void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
BindingLiquidSdk self, SseSerializer serializer);
@protected
void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
BindingLiquidSdk self, SseSerializer serializer);
@protected
void sse_encode_String(String self, SseSerializer serializer);
@@ -583,9 +562,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_box_autoadd_restore_request(RestoreRequest self, SseSerializer serializer);
@protected
void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer);
@protected
void sse_encode_connect_request(ConnectRequest self, SseSerializer serializer);
@@ -599,7 +575,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
void sse_encode_i_32(int self, SseSerializer serializer);
@protected
void sse_encode_list_payment(List<Payment> self, SseSerializer serializer);
void sse_encode_liquid_sdk_error(LiquidSdkError self, SseSerializer serializer);
@protected
void sse_encode_list_prim_u_8_strict(Uint8List self, SseSerializer serializer);
@@ -610,21 +586,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_opt_String(String? self, SseSerializer serializer);
@protected
void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer);
@protected
void sse_encode_payment(Payment self, SseSerializer serializer);
@protected
void sse_encode_payment_error(PaymentError self, SseSerializer serializer);
@protected
void sse_encode_payment_state(PaymentState self, SseSerializer serializer);
@protected
void sse_encode_payment_type(PaymentType self, SseSerializer serializer);
@protected
void sse_encode_prepare_receive_request(PrepareReceiveRequest self, SseSerializer serializer);
@@ -646,9 +610,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_send_payment_response(SendPaymentResponse self, SseSerializer serializer);
@protected
void sse_encode_u_32(int self, SseSerializer serializer);
@protected
void sse_encode_u_64(int self, SseSerializer serializer);
@@ -657,6 +618,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_encode_unit(void self, SseSerializer serializer);
@protected
void sse_encode_usize(int self, SseSerializer serializer);
}
// Section: wire_class
@@ -694,153 +658,189 @@ class RustLibWire implements BaseWire {
late final _store_dart_post_cobject =
_store_dart_post_cobjectPtr.asFunction<void Function(DartPostCObjectFnType)>();
void wire_backup(
void wire__crate__bindings__BindingLiquidSdk_backup(
int port_,
int that,
) {
return _wire_backup(
return _wire__crate__bindings__BindingLiquidSdk_backup(
port_,
that,
);
}
late final _wire_backupPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>('frbgen_breez_liquid_wire_backup');
late final _wire_backup = _wire_backupPtr.asFunction<void Function(int)>();
late final _wire__crate__bindings__BindingLiquidSdk_backupPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup');
late final _wire__crate__bindings__BindingLiquidSdk_backup =
_wire__crate__bindings__BindingLiquidSdk_backupPtr.asFunction<void Function(int, int)>();
void wire_connect(
void wire__crate__bindings__BindingLiquidSdk_get_info(
int port_,
int that,
ffi.Pointer<wire_cst_get_info_request> req,
) {
return _wire__crate__bindings__BindingLiquidSdk_get_info(
port_,
that,
req,
);
}
late final _wire__crate__bindings__BindingLiquidSdk_get_infoPtr = _lookup<
ffi
.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_get_info_request>)>>(
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info');
late final _wire__crate__bindings__BindingLiquidSdk_get_info =
_wire__crate__bindings__BindingLiquidSdk_get_infoPtr
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_get_info_request>)>();
void wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
int port_,
int that,
ffi.Pointer<wire_cst_prepare_receive_request> req,
) {
return _wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
port_,
that,
req,
);
}
late final _wire__crate__bindings__BindingLiquidSdk_prepare_receive_paymentPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_receive_request>)>>(
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment');
late final _wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment =
_wire__crate__bindings__BindingLiquidSdk_prepare_receive_paymentPtr
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_receive_request>)>();
void wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(
int port_,
int that,
ffi.Pointer<wire_cst_prepare_send_request> req,
) {
return _wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(
port_,
that,
req,
);
}
late final _wire__crate__bindings__BindingLiquidSdk_prepare_send_paymentPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_send_request>)>>(
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment');
late final _wire__crate__bindings__BindingLiquidSdk_prepare_send_payment =
_wire__crate__bindings__BindingLiquidSdk_prepare_send_paymentPtr
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_send_request>)>();
void wire__crate__bindings__BindingLiquidSdk_receive_payment(
int port_,
int that,
ffi.Pointer<wire_cst_prepare_receive_response> req,
) {
return _wire__crate__bindings__BindingLiquidSdk_receive_payment(
port_,
that,
req,
);
}
late final _wire__crate__bindings__BindingLiquidSdk_receive_paymentPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_receive_response>)>>(
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment');
late final _wire__crate__bindings__BindingLiquidSdk_receive_payment =
_wire__crate__bindings__BindingLiquidSdk_receive_paymentPtr
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_receive_response>)>();
void wire__crate__bindings__BindingLiquidSdk_restore(
int port_,
int that,
ffi.Pointer<wire_cst_restore_request> req,
) {
return _wire__crate__bindings__BindingLiquidSdk_restore(
port_,
that,
req,
);
}
late final _wire__crate__bindings__BindingLiquidSdk_restorePtr = _lookup<
ffi
.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_restore_request>)>>(
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore');
late final _wire__crate__bindings__BindingLiquidSdk_restore =
_wire__crate__bindings__BindingLiquidSdk_restorePtr
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_restore_request>)>();
void wire__crate__bindings__BindingLiquidSdk_send_payment(
int port_,
int that,
ffi.Pointer<wire_cst_prepare_send_response> req,
) {
return _wire__crate__bindings__BindingLiquidSdk_send_payment(
port_,
that,
req,
);
}
late final _wire__crate__bindings__BindingLiquidSdk_send_paymentPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_send_response>)>>(
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment');
late final _wire__crate__bindings__BindingLiquidSdk_send_payment =
_wire__crate__bindings__BindingLiquidSdk_send_paymentPtr
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_send_response>)>();
void wire__crate__bindings__connect(
int port_,
ffi.Pointer<wire_cst_connect_request> req,
) {
return _wire_connect(
return _wire__crate__bindings__connect(
port_,
req,
);
}
late final _wire_connectPtr =
late final _wire__crate__bindings__connectPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_connect_request>)>>(
'frbgen_breez_liquid_wire_connect');
late final _wire_connect =
_wire_connectPtr.asFunction<void Function(int, ffi.Pointer<wire_cst_connect_request>)>();
'frbgen_breez_liquid_wire__crate__bindings__connect');
late final _wire__crate__bindings__connect = _wire__crate__bindings__connectPtr
.asFunction<void Function(int, ffi.Pointer<wire_cst_connect_request>)>();
void wire_empty_wallet_cache(
int port_,
void
rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
ffi.Pointer<ffi.Void> ptr,
) {
return _wire_empty_wallet_cache(
port_,
return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
ptr,
);
}
late final _wire_empty_wallet_cachePtr = _lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
'frbgen_breez_liquid_wire_empty_wallet_cache');
late final _wire_empty_wallet_cache = _wire_empty_wallet_cachePtr.asFunction<void Function(int)>();
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
'frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk');
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk =
_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
void wire_get_info(
int port_,
ffi.Pointer<wire_cst_get_info_request> req,
void
rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
ffi.Pointer<ffi.Void> ptr,
) {
return _wire_get_info(
port_,
req,
return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
ptr,
);
}
late final _wire_get_infoPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_get_info_request>)>>(
'frbgen_breez_liquid_wire_get_info');
late final _wire_get_info =
_wire_get_infoPtr.asFunction<void Function(int, ffi.Pointer<wire_cst_get_info_request>)>();
void wire_list_payments(
int port_,
) {
return _wire_list_payments(
port_,
);
}
late final _wire_list_paymentsPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>('frbgen_breez_liquid_wire_list_payments');
late final _wire_list_payments = _wire_list_paymentsPtr.asFunction<void Function(int)>();
void wire_prepare_receive_payment(
int port_,
ffi.Pointer<wire_cst_prepare_receive_request> req,
) {
return _wire_prepare_receive_payment(
port_,
req,
);
}
late final _wire_prepare_receive_paymentPtr = _lookup<
ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_receive_request>)>>(
'frbgen_breez_liquid_wire_prepare_receive_payment');
late final _wire_prepare_receive_payment = _wire_prepare_receive_paymentPtr
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_receive_request>)>();
void wire_prepare_send_payment(
int port_,
ffi.Pointer<wire_cst_prepare_send_request> req,
) {
return _wire_prepare_send_payment(
port_,
req,
);
}
late final _wire_prepare_send_paymentPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_send_request>)>>(
'frbgen_breez_liquid_wire_prepare_send_payment');
late final _wire_prepare_send_payment = _wire_prepare_send_paymentPtr
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_send_request>)>();
void wire_receive_payment(
int port_,
ffi.Pointer<wire_cst_prepare_receive_response> req,
) {
return _wire_receive_payment(
port_,
req,
);
}
late final _wire_receive_paymentPtr = _lookup<
ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_receive_response>)>>(
'frbgen_breez_liquid_wire_receive_payment');
late final _wire_receive_payment = _wire_receive_paymentPtr
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_receive_response>)>();
void wire_restore(
int port_,
ffi.Pointer<wire_cst_restore_request> req,
) {
return _wire_restore(
port_,
req,
);
}
late final _wire_restorePtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_restore_request>)>>(
'frbgen_breez_liquid_wire_restore');
late final _wire_restore =
_wire_restorePtr.asFunction<void Function(int, ffi.Pointer<wire_cst_restore_request>)>();
void wire_send_payment(
int port_,
ffi.Pointer<wire_cst_prepare_send_response> req,
) {
return _wire_send_payment(
port_,
req,
);
}
late final _wire_send_paymentPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_send_response>)>>(
'frbgen_breez_liquid_wire_send_payment');
late final _wire_send_payment =
_wire_send_paymentPtr.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_send_response>)>();
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
'frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk');
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk =
_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
ffi.Pointer<wire_cst_connect_request> cst_new_box_autoadd_connect_request() {
return _cst_new_box_autoadd_connect_request();
@@ -912,34 +912,6 @@ class RustLibWire implements BaseWire {
late final _cst_new_box_autoadd_restore_request =
_cst_new_box_autoadd_restore_requestPtr.asFunction<ffi.Pointer<wire_cst_restore_request> Function()>();
ffi.Pointer<ffi.Uint64> cst_new_box_autoadd_u_64(
int value,
) {
return _cst_new_box_autoadd_u_64(
value,
);
}
late final _cst_new_box_autoadd_u_64Ptr =
_lookup<ffi.NativeFunction<ffi.Pointer<ffi.Uint64> Function(ffi.Uint64)>>(
'frbgen_breez_liquid_cst_new_box_autoadd_u_64');
late final _cst_new_box_autoadd_u_64 =
_cst_new_box_autoadd_u_64Ptr.asFunction<ffi.Pointer<ffi.Uint64> Function(int)>();
ffi.Pointer<wire_cst_list_payment> cst_new_list_payment(
int len,
) {
return _cst_new_list_payment(
len,
);
}
late final _cst_new_list_paymentPtr =
_lookup<ffi.NativeFunction<ffi.Pointer<wire_cst_list_payment> Function(ffi.Int32)>>(
'frbgen_breez_liquid_cst_new_list_payment');
late final _cst_new_list_payment =
_cst_new_list_paymentPtr.asFunction<ffi.Pointer<wire_cst_list_payment> Function(int)>();
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_new_list_prim_u_8_strict(
int len,
) {
@@ -971,22 +943,6 @@ typedef DartDartPostCObjectFnTypeFunction = bool Function(
typedef DartPort = ffi.Int64;
typedef DartDartPort = int;
final class wire_cst_list_prim_u_8_strict extends ffi.Struct {
external ffi.Pointer<ffi.Uint8> ptr;
@ffi.Int32()
external int len;
}
final class wire_cst_connect_request extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> mnemonic;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> data_dir;
@ffi.Int32()
external int network;
}
final class wire_cst_get_info_request extends ffi.Struct {
@ffi.Bool()
external bool with_scan;
@@ -997,6 +953,13 @@ final class wire_cst_prepare_receive_request extends ffi.Struct {
external int payer_amount_sat;
}
final class wire_cst_list_prim_u_8_strict extends ffi.Struct {
external ffi.Pointer<ffi.Uint8> ptr;
@ffi.Int32()
external int len;
}
final class wire_cst_prepare_send_request extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> invoice;
}
@@ -1020,46 +983,37 @@ final class wire_cst_prepare_send_response extends ffi.Struct {
external int fees_sat;
}
final class wire_cst_payment extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> tx_id;
final class wire_cst_connect_request extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> mnemonic;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> swap_id;
@ffi.Uint32()
external int timestamp;
@ffi.Uint64()
external int amount_sat;
external ffi.Pointer<ffi.Uint64> fees_sat;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> data_dir;
@ffi.Int32()
external int payment_type;
@ffi.Int32()
external int status;
}
final class wire_cst_list_payment extends ffi.Struct {
external ffi.Pointer<wire_cst_payment> ptr;
@ffi.Int32()
external int len;
external int network;
}
final class wire_cst_get_info_response extends ffi.Struct {
@ffi.Uint64()
external int balance_sat;
@ffi.Uint64()
external int pending_send_sat;
@ffi.Uint64()
external int pending_receive_sat;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> pubkey;
}
final class wire_cst_LiquidSdkError_Generic extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
}
final class LiquidSdkErrorKind extends ffi.Union {
external wire_cst_LiquidSdkError_Generic Generic;
}
final class wire_cst_liquid_sdk_error extends ffi.Struct {
@ffi.Int32()
external int tag;
external LiquidSdkErrorKind kind;
}
final class wire_cst_PaymentError_Generic extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
}
@@ -1071,7 +1025,7 @@ final class wire_cst_PaymentError_LwkError extends ffi.Struct {
final class wire_cst_PaymentError_Refunded extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> refund_tx_id;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> txid;
}
final class wire_cst_PaymentError_SendError extends ffi.Struct {