Update flutter bindings

This commit is contained in:
ok300
2024-05-15 09:41:06 +02:00
parent 8cfba8a247
commit 177127d376
9 changed files with 390 additions and 664 deletions

View File

@@ -20,22 +20,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
required super.portManager,
});
CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_LBtcReverseRecoveryPtr => wire
._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecoveryPtr;
@protected
AnyhowException dco_decode_AnyhowException(dynamic raw);
@protected
LBtcReverseRecovery
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
dynamic raw);
@protected
LBtcReverseRecovery
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
dynamic raw);
@protected
String dco_decode_String(dynamic raw);
@@ -141,22 +128,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void dco_decode_unit(dynamic raw);
@protected
int dco_decode_usize(dynamic raw);
@protected
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer);
@protected
LBtcReverseRecovery
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
SseDeserializer deserializer);
@protected
LBtcReverseRecovery
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
SseDeserializer deserializer);
@protected
String sse_decode_String(SseDeserializer deserializer);
@@ -262,9 +236,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void sse_decode_unit(SseDeserializer deserializer);
@protected
int sse_decode_usize(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
@@ -463,11 +434,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void cst_api_fill_to_wire_payment_error(PaymentError apiObj, wire_cst_payment_error wireObj) {
if (apiObj is PaymentError_AmountOutOfRange) {
if (apiObj is PaymentError_AlreadyClaimed) {
wireObj.tag = 0;
return;
}
if (apiObj is PaymentError_AlreadyClaimed) {
if (apiObj is PaymentError_AmountOutOfRange) {
wireObj.tag = 1;
return;
}
@@ -477,37 +448,53 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
wireObj.kind.Generic.err = pre_err;
return;
}
if (apiObj is PaymentError_InvalidInvoice) {
if (apiObj is PaymentError_InvalidOrExpiredFees) {
wireObj.tag = 3;
return;
}
if (apiObj is PaymentError_InvalidPreimage) {
if (apiObj is PaymentError_InsufficientFunds) {
wireObj.tag = 4;
return;
}
if (apiObj is PaymentError_InvalidInvoice) {
wireObj.tag = 5;
return;
}
if (apiObj is PaymentError_InvalidPreimage) {
wireObj.tag = 6;
return;
}
if (apiObj is PaymentError_LwkError) {
var pre_err = cst_encode_String(apiObj.err);
wireObj.tag = 5;
wireObj.tag = 7;
wireObj.kind.LwkError.err = pre_err;
return;
}
if (apiObj is PaymentError_PairsNotFound) {
wireObj.tag = 6;
wireObj.tag = 8;
return;
}
if (apiObj is PaymentError_PersistError) {
wireObj.tag = 7;
wireObj.tag = 9;
return;
}
if (apiObj is PaymentError_Refunded) {
var pre_err = cst_encode_String(apiObj.err);
var pre_txid = cst_encode_String(apiObj.txid);
wireObj.tag = 10;
wireObj.kind.Refunded.err = pre_err;
wireObj.kind.Refunded.txid = pre_txid;
return;
}
if (apiObj is PaymentError_SendError) {
var pre_err = cst_encode_String(apiObj.err);
wireObj.tag = 8;
wireObj.tag = 11;
wireObj.kind.SendError.err = pre_err;
return;
}
if (apiObj is PaymentError_SignerError) {
var pre_err = cst_encode_String(apiObj.err);
wireObj.tag = 9;
wireObj.tag = 12;
wireObj.kind.SignerError.err = pre_err;
return;
}
@@ -522,7 +509,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void cst_api_fill_to_wire_prepare_receive_response(
PrepareReceiveResponse apiObj, wire_cst_prepare_receive_response wireObj) {
wireObj.pair_hash = cst_encode_String(apiObj.pairHash);
wireObj.payer_amount_sat = cst_encode_u_64(apiObj.payerAmountSat);
wireObj.fees_sat = cst_encode_u_64(apiObj.feesSat);
}
@@ -536,12 +522,8 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void cst_api_fill_to_wire_prepare_send_response(
PrepareSendResponse apiObj, wire_cst_prepare_send_response wireObj) {
wireObj.id = cst_encode_String(apiObj.id);
wireObj.payer_amount_sat = cst_encode_u_64(apiObj.payerAmountSat);
wireObj.receiver_amount_sat = cst_encode_u_64(apiObj.receiverAmountSat);
wireObj.total_fees = cst_encode_u_64(apiObj.totalFees);
wireObj.funding_address = cst_encode_String(apiObj.fundingAddress);
wireObj.invoice = cst_encode_String(apiObj.invoice);
wireObj.fees_sat = cst_encode_u_64(apiObj.feesSat);
}
@protected
@@ -562,14 +544,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
wireObj.txid = cst_encode_String(apiObj.txid);
}
@protected
int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
LBtcReverseRecovery raw);
@protected
int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
LBtcReverseRecovery raw);
@protected
bool cst_encode_bool(bool raw);
@@ -591,21 +565,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected
void cst_encode_unit(void raw);
@protected
int cst_encode_usize(int raw);
@protected
void sse_encode_AnyhowException(AnyhowException self, SseSerializer serializer);
@protected
void
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
LBtcReverseRecovery self, SseSerializer serializer);
@protected
void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
LBtcReverseRecovery self, SseSerializer serializer);
@protected
void sse_encode_String(String self, SseSerializer serializer);
@@ -710,9 +672,6 @@ 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
@@ -871,20 +830,6 @@ class RustLibWire implements BaseWire {
late final _wire_receive_payment = _wire_receive_paymentPtr
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_receive_response>)>();
void wire_recover_funds(
int port_,
int recovery,
) {
return _wire_recover_funds(
port_,
recovery,
);
}
late final _wire_recover_fundsPtr = _lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
'frbgen_breez_liquid_wire_recover_funds');
late final _wire_recover_funds = _wire_recover_fundsPtr.asFunction<void Function(int, int)>();
void wire_restore(
int port_,
ffi.Pointer<wire_cst_restore_request> req,
@@ -917,38 +862,6 @@ class RustLibWire implements BaseWire {
late final _wire_send_payment =
_wire_send_paymentPtr.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_send_response>)>();
void
rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
ffi.Pointer<ffi.Void> ptr,
) {
return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
ptr,
);
}
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecoveryPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
'frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery');
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery =
_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecoveryPtr
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
void
rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
ffi.Pointer<ffi.Void> ptr,
) {
return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
ptr,
);
}
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecoveryPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
'frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery');
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery =
_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecoveryPtr
.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();
}
@@ -1123,8 +1036,6 @@ final class wire_cst_prepare_send_request extends ffi.Struct {
}
final class wire_cst_prepare_receive_response extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> pair_hash;
@ffi.Uint64()
external int payer_amount_sat;
@@ -1137,20 +1048,10 @@ final class wire_cst_restore_request extends ffi.Struct {
}
final class wire_cst_prepare_send_response extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> id;
@ffi.Uint64()
external int payer_amount_sat;
@ffi.Uint64()
external int receiver_amount_sat;
@ffi.Uint64()
external int total_fees;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> funding_address;
external ffi.Pointer<wire_cst_list_prim_u_8_strict> invoice;
@ffi.Uint64()
external int fees_sat;
}
final class wire_cst_payment extends ffi.Struct {
@@ -1191,6 +1092,12 @@ final class wire_cst_PaymentError_LwkError extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
}
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> txid;
}
final class wire_cst_PaymentError_SendError extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
}
@@ -1204,6 +1111,8 @@ final class PaymentErrorKind extends ffi.Union {
external wire_cst_PaymentError_LwkError LwkError;
external wire_cst_PaymentError_Refunded Refunded;
external wire_cst_PaymentError_SendError SendError;
external wire_cst_PaymentError_SignerError SignerError;
@@ -1226,4 +1135,4 @@ final class wire_cst_send_payment_response extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> txid;
}
const double LIQUID_CLAIM_TX_FEERATE = 0.1;
const double LIQUID_CLAIM_TX_FEERATE_MSAT = 100.0;