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

@@ -18,7 +18,7 @@ typedef struct _Dart_Handle* Dart_Handle;
* Claim tx feerate, in sats per vbyte. * Claim tx feerate, in sats per vbyte.
* Since the Liquid blocks are consistently empty for now, we hardcode the minimum feerate. * Since the Liquid blocks are consistently empty for now, we hardcode the minimum feerate.
*/ */
#define LIQUID_CLAIM_TX_FEERATE 0.1 #define LIQUID_CLAIM_TX_FEERATE_MSAT 100.0
typedef struct wire_cst_list_prim_u_8_strict { typedef struct wire_cst_list_prim_u_8_strict {
uint8_t *ptr; uint8_t *ptr;
@@ -76,11 +76,6 @@ typedef struct wire_cst_get_info_response {
struct wire_cst_list_prim_u_8_strict *pubkey; struct wire_cst_list_prim_u_8_strict *pubkey;
} wire_cst_get_info_response; } wire_cst_get_info_response;
typedef struct wire_cst_PaymentError_Refunded {
struct wire_cst_list_prim_u_8_strict *err;
struct wire_cst_list_prim_u_8_strict *txid;
} wire_cst_PaymentError_Refunded;
typedef struct wire_cst_PaymentError_Generic { typedef struct wire_cst_PaymentError_Generic {
struct wire_cst_list_prim_u_8_strict *err; struct wire_cst_list_prim_u_8_strict *err;
} wire_cst_PaymentError_Generic; } wire_cst_PaymentError_Generic;
@@ -89,6 +84,11 @@ typedef struct wire_cst_PaymentError_LwkError {
struct wire_cst_list_prim_u_8_strict *err; struct wire_cst_list_prim_u_8_strict *err;
} wire_cst_PaymentError_LwkError; } wire_cst_PaymentError_LwkError;
typedef struct wire_cst_PaymentError_Refunded {
struct wire_cst_list_prim_u_8_strict *err;
struct wire_cst_list_prim_u_8_strict *txid;
} wire_cst_PaymentError_Refunded;
typedef struct wire_cst_PaymentError_SendError { typedef struct wire_cst_PaymentError_SendError {
struct wire_cst_list_prim_u_8_strict *err; struct wire_cst_list_prim_u_8_strict *err;
} wire_cst_PaymentError_SendError; } wire_cst_PaymentError_SendError;
@@ -98,9 +98,9 @@ typedef struct wire_cst_PaymentError_SignerError {
} wire_cst_PaymentError_SignerError; } wire_cst_PaymentError_SignerError;
typedef union PaymentErrorKind { typedef union PaymentErrorKind {
struct wire_cst_PaymentError_Refunded Refunded;
struct wire_cst_PaymentError_Generic Generic; struct wire_cst_PaymentError_Generic Generic;
struct wire_cst_PaymentError_LwkError LwkError; struct wire_cst_PaymentError_LwkError LwkError;
struct wire_cst_PaymentError_Refunded Refunded;
struct wire_cst_PaymentError_SendError SendError; struct wire_cst_PaymentError_SendError SendError;
struct wire_cst_PaymentError_SignerError SignerError; struct wire_cst_PaymentError_SignerError SignerError;
} PaymentErrorKind; } PaymentErrorKind;

View File

@@ -153,33 +153,33 @@ impl CstDecode<crate::error::PaymentError> for wire_cst_payment_error {
// Codec=Cst (C-struct based), see doc to use other codecs // Codec=Cst (C-struct based), see doc to use other codecs
fn cst_decode(self) -> crate::error::PaymentError { fn cst_decode(self) -> crate::error::PaymentError {
match self.tag { match self.tag {
0 => crate::error::PaymentError::AmountOutOfRange, 0 => crate::error::PaymentError::AlreadyClaimed,
1 => crate::error::PaymentError::InvalidOrExpiredFees, 1 => crate::error::PaymentError::AmountOutOfRange,
2 => crate::error::PaymentError::InsufficientFunds, 2 => {
3 => crate::error::PaymentError::AlreadyClaimed, let ans = unsafe { self.kind.Generic };
4 => { crate::error::PaymentError::Generic {
err: ans.err.cst_decode(),
}
}
3 => crate::error::PaymentError::InvalidOrExpiredFees,
4 => crate::error::PaymentError::InsufficientFunds,
5 => crate::error::PaymentError::InvalidInvoice,
6 => crate::error::PaymentError::InvalidPreimage,
7 => {
let ans = unsafe { self.kind.LwkError };
crate::error::PaymentError::LwkError {
err: ans.err.cst_decode(),
}
}
8 => crate::error::PaymentError::PairsNotFound,
9 => crate::error::PaymentError::PersistError,
10 => {
let ans = unsafe { self.kind.Refunded }; let ans = unsafe { self.kind.Refunded };
crate::error::PaymentError::Refunded { crate::error::PaymentError::Refunded {
err: ans.err.cst_decode(), err: ans.err.cst_decode(),
txid: ans.txid.cst_decode(), txid: ans.txid.cst_decode(),
} }
} }
5 => {
let ans = unsafe { self.kind.Generic };
crate::error::PaymentError::Generic {
err: ans.err.cst_decode(),
}
}
6 => crate::error::PaymentError::InvalidInvoice,
7 => crate::error::PaymentError::InvalidPreimage,
8 => {
let ans = unsafe { self.kind.LwkError };
crate::error::PaymentError::LwkError {
err: ans.err.cst_decode(),
}
}
9 => crate::error::PaymentError::PairsNotFound,
10 => crate::error::PaymentError::PersistError,
11 => { 11 => {
let ans = unsafe { self.kind.SendError }; let ans = unsafe { self.kind.SendError };
crate::error::PaymentError::SendError { crate::error::PaymentError::SendError {
@@ -619,21 +619,15 @@ pub struct wire_cst_payment_error {
#[repr(C)] #[repr(C)]
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
pub union PaymentErrorKind { pub union PaymentErrorKind {
Refunded: wire_cst_PaymentError_Refunded,
Generic: wire_cst_PaymentError_Generic, Generic: wire_cst_PaymentError_Generic,
LwkError: wire_cst_PaymentError_LwkError, LwkError: wire_cst_PaymentError_LwkError,
Refunded: wire_cst_PaymentError_Refunded,
SendError: wire_cst_PaymentError_SendError, SendError: wire_cst_PaymentError_SendError,
SignerError: wire_cst_PaymentError_SignerError, SignerError: wire_cst_PaymentError_SignerError,
nil__: (), nil__: (),
} }
#[repr(C)] #[repr(C)]
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
pub struct wire_cst_PaymentError_Refunded {
err: *mut wire_cst_list_prim_u_8_strict,
txid: *mut wire_cst_list_prim_u_8_strict,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct wire_cst_PaymentError_Generic { pub struct wire_cst_PaymentError_Generic {
err: *mut wire_cst_list_prim_u_8_strict, err: *mut wire_cst_list_prim_u_8_strict,
} }
@@ -644,6 +638,12 @@ pub struct wire_cst_PaymentError_LwkError {
} }
#[repr(C)] #[repr(C)]
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
pub struct wire_cst_PaymentError_Refunded {
err: *mut wire_cst_list_prim_u_8_strict,
txid: *mut wire_cst_list_prim_u_8_strict,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct wire_cst_PaymentError_SendError { pub struct wire_cst_PaymentError_SendError {
err: *mut wire_cst_list_prim_u_8_strict, err: *mut wire_cst_list_prim_u_8_strict,
} }

View File

@@ -416,18 +416,38 @@ impl SseDecode for crate::error::PaymentError {
let mut tag_ = <i32>::sse_decode(deserializer); let mut tag_ = <i32>::sse_decode(deserializer);
match tag_ { match tag_ {
0 => { 0 => {
return crate::error::PaymentError::AmountOutOfRange;
}
1 => {
return crate::error::PaymentError::InvalidOrExpiredFees;
}
2 => {
return crate::error::PaymentError::InsufficientFunds;
}
3 => {
return crate::error::PaymentError::AlreadyClaimed; return crate::error::PaymentError::AlreadyClaimed;
} }
1 => {
return crate::error::PaymentError::AmountOutOfRange;
}
2 => {
let mut var_err = <String>::sse_decode(deserializer);
return crate::error::PaymentError::Generic { err: var_err };
}
3 => {
return crate::error::PaymentError::InvalidOrExpiredFees;
}
4 => { 4 => {
return crate::error::PaymentError::InsufficientFunds;
}
5 => {
return crate::error::PaymentError::InvalidInvoice;
}
6 => {
return crate::error::PaymentError::InvalidPreimage;
}
7 => {
let mut var_err = <String>::sse_decode(deserializer);
return crate::error::PaymentError::LwkError { err: var_err };
}
8 => {
return crate::error::PaymentError::PairsNotFound;
}
9 => {
return crate::error::PaymentError::PersistError;
}
10 => {
let mut var_err = <String>::sse_decode(deserializer); let mut var_err = <String>::sse_decode(deserializer);
let mut var_txid = <String>::sse_decode(deserializer); let mut var_txid = <String>::sse_decode(deserializer);
return crate::error::PaymentError::Refunded { return crate::error::PaymentError::Refunded {
@@ -435,26 +455,6 @@ impl SseDecode for crate::error::PaymentError {
txid: var_txid, txid: var_txid,
}; };
} }
5 => {
let mut var_err = <String>::sse_decode(deserializer);
return crate::error::PaymentError::Generic { err: var_err };
}
6 => {
return crate::error::PaymentError::InvalidInvoice;
}
7 => {
return crate::error::PaymentError::InvalidPreimage;
}
8 => {
let mut var_err = <String>::sse_decode(deserializer);
return crate::error::PaymentError::LwkError { err: var_err };
}
9 => {
return crate::error::PaymentError::PairsNotFound;
}
10 => {
return crate::error::PaymentError::PersistError;
}
11 => { 11 => {
let mut var_err = <String>::sse_decode(deserializer); let mut var_err = <String>::sse_decode(deserializer);
return crate::error::PaymentError::SendError { err: var_err }; return crate::error::PaymentError::SendError { err: var_err };
@@ -701,26 +701,26 @@ impl flutter_rust_bridge::IntoIntoDart<crate::model::Payment> for crate::model::
impl flutter_rust_bridge::IntoDart for crate::error::PaymentError { impl flutter_rust_bridge::IntoDart for crate::error::PaymentError {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
match self { match self {
crate::error::PaymentError::AmountOutOfRange => [0.into_dart()].into_dart(), crate::error::PaymentError::AlreadyClaimed => [0.into_dart()].into_dart(),
crate::error::PaymentError::InvalidOrExpiredFees => [1.into_dart()].into_dart(), crate::error::PaymentError::AmountOutOfRange => [1.into_dart()].into_dart(),
crate::error::PaymentError::InsufficientFunds => [2.into_dart()].into_dart(), crate::error::PaymentError::Generic { err } => {
crate::error::PaymentError::AlreadyClaimed => [3.into_dart()].into_dart(), [2.into_dart(), err.into_into_dart().into_dart()].into_dart()
}
crate::error::PaymentError::InvalidOrExpiredFees => [3.into_dart()].into_dart(),
crate::error::PaymentError::InsufficientFunds => [4.into_dart()].into_dart(),
crate::error::PaymentError::InvalidInvoice => [5.into_dart()].into_dart(),
crate::error::PaymentError::InvalidPreimage => [6.into_dart()].into_dart(),
crate::error::PaymentError::LwkError { err } => {
[7.into_dart(), err.into_into_dart().into_dart()].into_dart()
}
crate::error::PaymentError::PairsNotFound => [8.into_dart()].into_dart(),
crate::error::PaymentError::PersistError => [9.into_dart()].into_dart(),
crate::error::PaymentError::Refunded { err, txid } => [ crate::error::PaymentError::Refunded { err, txid } => [
4.into_dart(), 10.into_dart(),
err.into_into_dart().into_dart(), err.into_into_dart().into_dart(),
txid.into_into_dart().into_dart(), txid.into_into_dart().into_dart(),
] ]
.into_dart(), .into_dart(),
crate::error::PaymentError::Generic { err } => {
[5.into_dart(), err.into_into_dart().into_dart()].into_dart()
}
crate::error::PaymentError::InvalidInvoice => [6.into_dart()].into_dart(),
crate::error::PaymentError::InvalidPreimage => [7.into_dart()].into_dart(),
crate::error::PaymentError::LwkError { err } => {
[8.into_dart(), err.into_into_dart().into_dart()].into_dart()
}
crate::error::PaymentError::PairsNotFound => [9.into_dart()].into_dart(),
crate::error::PaymentError::PersistError => [10.into_dart()].into_dart(),
crate::error::PaymentError::SendError { err } => { crate::error::PaymentError::SendError { err } => {
[11.into_dart(), err.into_into_dart().into_dart()].into_dart() [11.into_dart(), err.into_into_dart().into_dart()].into_dart()
} }
@@ -1016,42 +1016,42 @@ impl SseEncode for crate::error::PaymentError {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
match self { match self {
crate::error::PaymentError::AmountOutOfRange => { crate::error::PaymentError::AlreadyClaimed => {
<i32>::sse_encode(0, serializer); <i32>::sse_encode(0, serializer);
} }
crate::error::PaymentError::InvalidOrExpiredFees => { crate::error::PaymentError::AmountOutOfRange => {
<i32>::sse_encode(1, serializer); <i32>::sse_encode(1, serializer);
} }
crate::error::PaymentError::InsufficientFunds => { crate::error::PaymentError::Generic { err } => {
<i32>::sse_encode(2, serializer); <i32>::sse_encode(2, serializer);
<String>::sse_encode(err, serializer);
} }
crate::error::PaymentError::AlreadyClaimed => { crate::error::PaymentError::InvalidOrExpiredFees => {
<i32>::sse_encode(3, serializer); <i32>::sse_encode(3, serializer);
} }
crate::error::PaymentError::Refunded { err, txid } => { crate::error::PaymentError::InsufficientFunds => {
<i32>::sse_encode(4, serializer); <i32>::sse_encode(4, serializer);
<String>::sse_encode(err, serializer);
<String>::sse_encode(txid, serializer);
}
crate::error::PaymentError::Generic { err } => {
<i32>::sse_encode(5, serializer);
<String>::sse_encode(err, serializer);
} }
crate::error::PaymentError::InvalidInvoice => { crate::error::PaymentError::InvalidInvoice => {
<i32>::sse_encode(6, serializer); <i32>::sse_encode(5, serializer);
} }
crate::error::PaymentError::InvalidPreimage => { crate::error::PaymentError::InvalidPreimage => {
<i32>::sse_encode(7, serializer); <i32>::sse_encode(6, serializer);
} }
crate::error::PaymentError::LwkError { err } => { crate::error::PaymentError::LwkError { err } => {
<i32>::sse_encode(8, serializer); <i32>::sse_encode(7, serializer);
<String>::sse_encode(err, serializer); <String>::sse_encode(err, serializer);
} }
crate::error::PaymentError::PairsNotFound => { crate::error::PaymentError::PairsNotFound => {
<i32>::sse_encode(9, serializer); <i32>::sse_encode(8, serializer);
} }
crate::error::PaymentError::PersistError => { crate::error::PaymentError::PersistError => {
<i32>::sse_encode(9, serializer);
}
crate::error::PaymentError::Refunded { err, txid } => {
<i32>::sse_encode(10, serializer); <i32>::sse_encode(10, serializer);
<String>::sse_encode(err, serializer);
<String>::sse_encode(txid, serializer);
} }
crate::error::PaymentError::SendError { err } => { crate::error::PaymentError::SendError { err } => {
<i32>::sse_encode(11, serializer); <i32>::sse_encode(11, serializer);

View File

@@ -29,28 +29,9 @@ Future<ReceivePaymentResponse> receivePayment({required PrepareReceiveResponse r
Future<List<Payment>> listPayments({required bool withScan, required bool includePending, dynamic hint}) => Future<List<Payment>> listPayments({required bool withScan, required bool includePending, dynamic hint}) =>
RustLib.instance.api.listPayments(withScan: withScan, includePending: includePending, hint: hint); RustLib.instance.api.listPayments(withScan: withScan, includePending: includePending, hint: hint);
Future<String> recoverFunds({required LBtcReverseRecovery recovery, dynamic hint}) =>
RustLib.instance.api.recoverFunds(recovery: recovery, hint: hint);
Future<void> emptyWalletCache({dynamic hint}) => RustLib.instance.api.emptyWalletCache(hint: hint); Future<void> emptyWalletCache({dynamic hint}) => RustLib.instance.api.emptyWalletCache(hint: hint);
Future<void> backup({dynamic hint}) => RustLib.instance.api.backup(hint: hint); Future<void> backup({dynamic hint}) => RustLib.instance.api.backup(hint: hint);
Future<void> restore({required RestoreRequest req, dynamic hint}) => Future<void> restore({required RestoreRequest req, dynamic hint}) =>
RustLib.instance.api.restore(req: req, hint: hint); RustLib.instance.api.restore(req: req, hint: hint);
// Rust type: RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<LBtcReverseRecovery>>
@sealed
class LBtcReverseRecovery extends RustOpaque {
LBtcReverseRecovery.dcoDecode(List<dynamic> wire) : super.dcoDecode(wire, _kStaticData);
LBtcReverseRecovery.sseDecode(int ptr, int externalSizeOnNative)
: super.sseDecode(ptr, externalSizeOnNative, _kStaticData);
static final _kStaticData = RustArcStaticData(
rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_LBtcReverseRecovery,
rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_LBtcReverseRecovery,
rustArcDecrementStrongCountPtr:
RustLib.instance.api.rust_arc_decrement_strong_count_LBtcReverseRecoveryPtr,
);
}

View File

@@ -12,19 +12,13 @@ part 'error.freezed.dart';
sealed class PaymentError with _$PaymentError implements FrbException { sealed class PaymentError with _$PaymentError implements FrbException {
const PaymentError._(); const PaymentError._();
const factory PaymentError.amountOutOfRange() = PaymentError_AmountOutOfRange;
const factory PaymentError.invalidOrExpiredFees() =
PaymentError_InvalidOrExpiredFees;
const factory PaymentError.insufficientFunds() =
PaymentError_InsufficientFunds;
const factory PaymentError.alreadyClaimed() = PaymentError_AlreadyClaimed; const factory PaymentError.alreadyClaimed() = PaymentError_AlreadyClaimed;
const factory PaymentError.refunded({ const factory PaymentError.amountOutOfRange() = PaymentError_AmountOutOfRange;
required String err,
required String txid,
}) = PaymentError_Refunded;
const factory PaymentError.generic({ const factory PaymentError.generic({
required String err, required String err,
}) = PaymentError_Generic; }) = PaymentError_Generic;
const factory PaymentError.invalidOrExpiredFees() = PaymentError_InvalidOrExpiredFees;
const factory PaymentError.insufficientFunds() = PaymentError_InsufficientFunds;
const factory PaymentError.invalidInvoice() = PaymentError_InvalidInvoice; const factory PaymentError.invalidInvoice() = PaymentError_InvalidInvoice;
const factory PaymentError.invalidPreimage() = PaymentError_InvalidPreimage; const factory PaymentError.invalidPreimage() = PaymentError_InvalidPreimage;
const factory PaymentError.lwkError({ const factory PaymentError.lwkError({
@@ -32,6 +26,10 @@ sealed class PaymentError with _$PaymentError implements FrbException {
}) = PaymentError_LwkError; }) = PaymentError_LwkError;
const factory PaymentError.pairsNotFound() = PaymentError_PairsNotFound; const factory PaymentError.pairsNotFound() = PaymentError_PairsNotFound;
const factory PaymentError.persistError() = PaymentError_PersistError; const factory PaymentError.persistError() = PaymentError_PersistError;
const factory PaymentError.refunded({
required String err,
required String txid,
}) = PaymentError_Refunded;
const factory PaymentError.sendError({ const factory PaymentError.sendError({
required String err, required String err,
}) = PaymentError_SendError; }) = PaymentError_SendError;

View File

@@ -33,141 +33,6 @@ class _$PaymentErrorCopyWithImpl<$Res, $Val extends PaymentError> implements $Pa
final $Res Function($Val) _then; final $Res Function($Val) _then;
} }
/// @nodoc
abstract class _$$PaymentError_AmountOutOfRangeImplCopyWith<$Res> {
factory _$$PaymentError_AmountOutOfRangeImplCopyWith(_$PaymentError_AmountOutOfRangeImpl value,
$Res Function(_$PaymentError_AmountOutOfRangeImpl) then) =
__$$PaymentError_AmountOutOfRangeImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$PaymentError_AmountOutOfRangeImplCopyWithImpl<$Res>
extends _$PaymentErrorCopyWithImpl<$Res, _$PaymentError_AmountOutOfRangeImpl>
implements _$$PaymentError_AmountOutOfRangeImplCopyWith<$Res> {
__$$PaymentError_AmountOutOfRangeImplCopyWithImpl(
_$PaymentError_AmountOutOfRangeImpl _value, $Res Function(_$PaymentError_AmountOutOfRangeImpl) _then)
: super(_value, _then);
}
/// @nodoc
class _$PaymentError_AmountOutOfRangeImpl extends PaymentError_AmountOutOfRange {
const _$PaymentError_AmountOutOfRangeImpl() : super._();
@override
String toString() {
return 'PaymentError.amountOutOfRange()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType && other is _$PaymentError_AmountOutOfRangeImpl);
}
@override
int get hashCode => runtimeType.hashCode;
}
abstract class PaymentError_AmountOutOfRange extends PaymentError {
const factory PaymentError_AmountOutOfRange() = _$PaymentError_AmountOutOfRangeImpl;
const PaymentError_AmountOutOfRange._() : super._();
}
/// @nodoc
abstract class _$$PaymentError_InvalidOrExpiredFeesImplCopyWith<$Res> {
factory _$$PaymentError_InvalidOrExpiredFeesImplCopyWith(
_$PaymentError_InvalidOrExpiredFeesImpl value,
$Res Function(_$PaymentError_InvalidOrExpiredFeesImpl) then) =
__$$PaymentError_InvalidOrExpiredFeesImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$PaymentError_InvalidOrExpiredFeesImplCopyWithImpl<$Res>
extends _$PaymentErrorCopyWithImpl<$Res,
_$PaymentError_InvalidOrExpiredFeesImpl>
implements _$$PaymentError_InvalidOrExpiredFeesImplCopyWith<$Res> {
__$$PaymentError_InvalidOrExpiredFeesImplCopyWithImpl(
_$PaymentError_InvalidOrExpiredFeesImpl _value,
$Res Function(_$PaymentError_InvalidOrExpiredFeesImpl) _then)
: super(_value, _then);
}
/// @nodoc
class _$PaymentError_InvalidOrExpiredFeesImpl
extends PaymentError_InvalidOrExpiredFees {
const _$PaymentError_InvalidOrExpiredFeesImpl() : super._();
@override
String toString() {
return 'PaymentError.invalidOrExpiredFees()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PaymentError_InvalidOrExpiredFeesImpl);
}
@override
int get hashCode => runtimeType.hashCode;
}
abstract class PaymentError_InvalidOrExpiredFees extends PaymentError {
const factory PaymentError_InvalidOrExpiredFees() =
_$PaymentError_InvalidOrExpiredFeesImpl;
const PaymentError_InvalidOrExpiredFees._() : super._();
}
/// @nodoc
abstract class _$$PaymentError_InsufficientFundsImplCopyWith<$Res> {
factory _$$PaymentError_InsufficientFundsImplCopyWith(
_$PaymentError_InsufficientFundsImpl value,
$Res Function(_$PaymentError_InsufficientFundsImpl) then) =
__$$PaymentError_InsufficientFundsImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$PaymentError_InsufficientFundsImplCopyWithImpl<$Res>
extends _$PaymentErrorCopyWithImpl<$Res,
_$PaymentError_InsufficientFundsImpl>
implements _$$PaymentError_InsufficientFundsImplCopyWith<$Res> {
__$$PaymentError_InsufficientFundsImplCopyWithImpl(
_$PaymentError_InsufficientFundsImpl _value,
$Res Function(_$PaymentError_InsufficientFundsImpl) _then)
: super(_value, _then);
}
/// @nodoc
class _$PaymentError_InsufficientFundsImpl
extends PaymentError_InsufficientFunds {
const _$PaymentError_InsufficientFundsImpl() : super._();
@override
String toString() {
return 'PaymentError.insufficientFunds()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PaymentError_InsufficientFundsImpl);
}
@override
int get hashCode => runtimeType.hashCode;
}
abstract class PaymentError_InsufficientFunds extends PaymentError {
const factory PaymentError_InsufficientFunds() =
_$PaymentError_InsufficientFundsImpl;
const PaymentError_InsufficientFunds._() : super._();
}
/// @nodoc /// @nodoc
abstract class _$$PaymentError_AlreadyClaimedImplCopyWith<$Res> { abstract class _$$PaymentError_AlreadyClaimedImplCopyWith<$Res> {
factory _$$PaymentError_AlreadyClaimedImplCopyWith( factory _$$PaymentError_AlreadyClaimedImplCopyWith(
@@ -210,89 +75,44 @@ abstract class PaymentError_AlreadyClaimed extends PaymentError {
} }
/// @nodoc /// @nodoc
abstract class _$$PaymentError_RefundedImplCopyWith<$Res> { abstract class _$$PaymentError_AmountOutOfRangeImplCopyWith<$Res> {
factory _$$PaymentError_RefundedImplCopyWith( factory _$$PaymentError_AmountOutOfRangeImplCopyWith(_$PaymentError_AmountOutOfRangeImpl value,
_$PaymentError_RefundedImpl value, $Res Function(_$PaymentError_AmountOutOfRangeImpl) then) =
$Res Function(_$PaymentError_RefundedImpl) then) = __$$PaymentError_AmountOutOfRangeImplCopyWithImpl<$Res>;
__$$PaymentError_RefundedImplCopyWithImpl<$Res>;
@useResult
$Res call({String err, String txid});
} }
/// @nodoc /// @nodoc
class __$$PaymentError_RefundedImplCopyWithImpl<$Res> class __$$PaymentError_AmountOutOfRangeImplCopyWithImpl<$Res>
extends _$PaymentErrorCopyWithImpl<$Res, _$PaymentError_RefundedImpl> extends _$PaymentErrorCopyWithImpl<$Res, _$PaymentError_AmountOutOfRangeImpl>
implements _$$PaymentError_RefundedImplCopyWith<$Res> { implements _$$PaymentError_AmountOutOfRangeImplCopyWith<$Res> {
__$$PaymentError_RefundedImplCopyWithImpl(_$PaymentError_RefundedImpl _value, __$$PaymentError_AmountOutOfRangeImplCopyWithImpl(
$Res Function(_$PaymentError_RefundedImpl) _then) _$PaymentError_AmountOutOfRangeImpl _value, $Res Function(_$PaymentError_AmountOutOfRangeImpl) _then)
: super(_value, _then); : super(_value, _then);
@pragma('vm:prefer-inline')
@override
$Res call({
Object? err = null,
Object? txid = null,
}) {
return _then(_$PaymentError_RefundedImpl(
err: null == err
? _value.err
: err // ignore: cast_nullable_to_non_nullable
as String,
txid: null == txid
? _value.txid
: txid // ignore: cast_nullable_to_non_nullable
as String,
));
}
} }
/// @nodoc /// @nodoc
class _$PaymentError_RefundedImpl extends PaymentError_Refunded { class _$PaymentError_AmountOutOfRangeImpl extends PaymentError_AmountOutOfRange {
const _$PaymentError_RefundedImpl({required this.err, required this.txid}) const _$PaymentError_AmountOutOfRangeImpl() : super._();
: super._();
@override
final String err;
@override
final String txid;
@override @override
String toString() { String toString() {
return 'PaymentError.refunded(err: $err, txid: $txid)'; return 'PaymentError.amountOutOfRange()';
} }
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || return identical(this, other) ||
(other.runtimeType == runtimeType && (other.runtimeType == runtimeType && other is _$PaymentError_AmountOutOfRangeImpl);
other is _$PaymentError_RefundedImpl &&
(identical(other.err, err) || other.err == err) &&
(identical(other.txid, txid) || other.txid == txid));
} }
@override @override
int get hashCode => Object.hash(runtimeType, err, txid); int get hashCode => runtimeType.hashCode;
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$PaymentError_RefundedImplCopyWith<_$PaymentError_RefundedImpl>
get copyWith => __$$PaymentError_RefundedImplCopyWithImpl<
_$PaymentError_RefundedImpl>(this, _$identity);
} }
abstract class PaymentError_Refunded extends PaymentError { abstract class PaymentError_AmountOutOfRange extends PaymentError {
const factory PaymentError_Refunded( const factory PaymentError_AmountOutOfRange() = _$PaymentError_AmountOutOfRangeImpl;
{required final String err, const PaymentError_AmountOutOfRange._() : super._();
required final String txid}) = _$PaymentError_RefundedImpl;
const PaymentError_Refunded._() : super._();
String get err;
String get txid;
@JsonKey(ignore: true)
_$$PaymentError_RefundedImplCopyWith<_$PaymentError_RefundedImpl>
get copyWith => throw _privateConstructorUsedError;
} }
/// @nodoc /// @nodoc
@@ -367,6 +187,88 @@ abstract class PaymentError_Generic extends PaymentError {
throw _privateConstructorUsedError; throw _privateConstructorUsedError;
} }
/// @nodoc
abstract class _$$PaymentError_InvalidOrExpiredFeesImplCopyWith<$Res> {
factory _$$PaymentError_InvalidOrExpiredFeesImplCopyWith(_$PaymentError_InvalidOrExpiredFeesImpl value,
$Res Function(_$PaymentError_InvalidOrExpiredFeesImpl) then) =
__$$PaymentError_InvalidOrExpiredFeesImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$PaymentError_InvalidOrExpiredFeesImplCopyWithImpl<$Res>
extends _$PaymentErrorCopyWithImpl<$Res, _$PaymentError_InvalidOrExpiredFeesImpl>
implements _$$PaymentError_InvalidOrExpiredFeesImplCopyWith<$Res> {
__$$PaymentError_InvalidOrExpiredFeesImplCopyWithImpl(_$PaymentError_InvalidOrExpiredFeesImpl _value,
$Res Function(_$PaymentError_InvalidOrExpiredFeesImpl) _then)
: super(_value, _then);
}
/// @nodoc
class _$PaymentError_InvalidOrExpiredFeesImpl extends PaymentError_InvalidOrExpiredFees {
const _$PaymentError_InvalidOrExpiredFeesImpl() : super._();
@override
String toString() {
return 'PaymentError.invalidOrExpiredFees()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType && other is _$PaymentError_InvalidOrExpiredFeesImpl);
}
@override
int get hashCode => runtimeType.hashCode;
}
abstract class PaymentError_InvalidOrExpiredFees extends PaymentError {
const factory PaymentError_InvalidOrExpiredFees() = _$PaymentError_InvalidOrExpiredFeesImpl;
const PaymentError_InvalidOrExpiredFees._() : super._();
}
/// @nodoc
abstract class _$$PaymentError_InsufficientFundsImplCopyWith<$Res> {
factory _$$PaymentError_InsufficientFundsImplCopyWith(_$PaymentError_InsufficientFundsImpl value,
$Res Function(_$PaymentError_InsufficientFundsImpl) then) =
__$$PaymentError_InsufficientFundsImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$PaymentError_InsufficientFundsImplCopyWithImpl<$Res>
extends _$PaymentErrorCopyWithImpl<$Res, _$PaymentError_InsufficientFundsImpl>
implements _$$PaymentError_InsufficientFundsImplCopyWith<$Res> {
__$$PaymentError_InsufficientFundsImplCopyWithImpl(
_$PaymentError_InsufficientFundsImpl _value, $Res Function(_$PaymentError_InsufficientFundsImpl) _then)
: super(_value, _then);
}
/// @nodoc
class _$PaymentError_InsufficientFundsImpl extends PaymentError_InsufficientFunds {
const _$PaymentError_InsufficientFundsImpl() : super._();
@override
String toString() {
return 'PaymentError.insufficientFunds()';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType && other is _$PaymentError_InsufficientFundsImpl);
}
@override
int get hashCode => runtimeType.hashCode;
}
abstract class PaymentError_InsufficientFunds extends PaymentError {
const factory PaymentError_InsufficientFunds() = _$PaymentError_InsufficientFundsImpl;
const PaymentError_InsufficientFunds._() : super._();
}
/// @nodoc /// @nodoc
abstract class _$$PaymentError_InvalidInvoiceImplCopyWith<$Res> { abstract class _$$PaymentError_InvalidInvoiceImplCopyWith<$Res> {
factory _$$PaymentError_InvalidInvoiceImplCopyWith( factory _$$PaymentError_InvalidInvoiceImplCopyWith(
@@ -603,6 +505,88 @@ abstract class PaymentError_PersistError extends PaymentError {
const PaymentError_PersistError._() : super._(); const PaymentError_PersistError._() : super._();
} }
/// @nodoc
abstract class _$$PaymentError_RefundedImplCopyWith<$Res> {
factory _$$PaymentError_RefundedImplCopyWith(
_$PaymentError_RefundedImpl value, $Res Function(_$PaymentError_RefundedImpl) then) =
__$$PaymentError_RefundedImplCopyWithImpl<$Res>;
@useResult
$Res call({String err, String txid});
}
/// @nodoc
class __$$PaymentError_RefundedImplCopyWithImpl<$Res>
extends _$PaymentErrorCopyWithImpl<$Res, _$PaymentError_RefundedImpl>
implements _$$PaymentError_RefundedImplCopyWith<$Res> {
__$$PaymentError_RefundedImplCopyWithImpl(
_$PaymentError_RefundedImpl _value, $Res Function(_$PaymentError_RefundedImpl) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@override
$Res call({
Object? err = null,
Object? txid = null,
}) {
return _then(_$PaymentError_RefundedImpl(
err: null == err
? _value.err
: err // ignore: cast_nullable_to_non_nullable
as String,
txid: null == txid
? _value.txid
: txid // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
class _$PaymentError_RefundedImpl extends PaymentError_Refunded {
const _$PaymentError_RefundedImpl({required this.err, required this.txid}) : super._();
@override
final String err;
@override
final String txid;
@override
String toString() {
return 'PaymentError.refunded(err: $err, txid: $txid)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PaymentError_RefundedImpl &&
(identical(other.err, err) || other.err == err) &&
(identical(other.txid, txid) || other.txid == txid));
}
@override
int get hashCode => Object.hash(runtimeType, err, txid);
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$PaymentError_RefundedImplCopyWith<_$PaymentError_RefundedImpl> get copyWith =>
__$$PaymentError_RefundedImplCopyWithImpl<_$PaymentError_RefundedImpl>(this, _$identity);
}
abstract class PaymentError_Refunded extends PaymentError {
const factory PaymentError_Refunded({required final String err, required final String txid}) =
_$PaymentError_RefundedImpl;
const PaymentError_Refunded._() : super._();
String get err;
String get txid;
@JsonKey(ignore: true)
_$$PaymentError_RefundedImplCopyWith<_$PaymentError_RefundedImpl> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc /// @nodoc
abstract class _$$PaymentError_SendErrorImplCopyWith<$Res> { abstract class _$$PaymentError_SendErrorImplCopyWith<$Res> {
factory _$$PaymentError_SendErrorImplCopyWith( factory _$$PaymentError_SendErrorImplCopyWith(

View File

@@ -53,7 +53,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
String get codegenVersion => '2.0.0-dev.33'; String get codegenVersion => '2.0.0-dev.33';
@override @override
int get rustContentHash => -1225779344; int get rustContentHash => -451265040;
static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig(
stem: 'breez_liquid_sdk', stem: 'breez_liquid_sdk',
@@ -79,17 +79,9 @@ abstract class RustLibApi extends BaseApi {
Future<ReceivePaymentResponse> receivePayment({required PrepareReceiveResponse req, dynamic hint}); Future<ReceivePaymentResponse> receivePayment({required PrepareReceiveResponse req, dynamic hint});
Future<String> recoverFunds({required LBtcReverseRecovery recovery, dynamic hint});
Future<void> restore({required RestoreRequest req, dynamic hint}); Future<void> restore({required RestoreRequest req, dynamic hint});
Future<SendPaymentResponse> sendPayment({required PrepareSendResponse req, dynamic hint}); Future<SendPaymentResponse> sendPayment({required PrepareSendResponse req, dynamic hint});
RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_LBtcReverseRecovery;
RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_LBtcReverseRecovery;
CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_LBtcReverseRecoveryPtr;
} }
class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
@@ -283,31 +275,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
argNames: ["req"], argNames: ["req"],
); );
@override
Future<String> recoverFunds({required LBtcReverseRecovery recovery, dynamic hint}) {
return handler.executeNormal(NormalTask(
callFfi: (port_) {
var arg0 =
cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
recovery);
return wire.wire_recover_funds(port_, arg0);
},
codec: DcoCodec(
decodeSuccessData: dco_decode_String,
decodeErrorData: dco_decode_AnyhowException,
),
constMeta: kRecoverFundsConstMeta,
argValues: [recovery],
apiImpl: this,
hint: hint,
));
}
TaskConstMeta get kRecoverFundsConstMeta => const TaskConstMeta(
debugName: "recover_funds",
argNames: ["recovery"],
);
@override @override
Future<void> restore({required RestoreRequest req, dynamic hint}) { Future<void> restore({required RestoreRequest req, dynamic hint}) {
return handler.executeNormal(NormalTask( return handler.executeNormal(NormalTask(
@@ -354,34 +321,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
argNames: ["req"], argNames: ["req"],
); );
RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_LBtcReverseRecovery => wire
.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery;
RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_LBtcReverseRecovery => wire
.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery;
@protected @protected
AnyhowException dco_decode_AnyhowException(dynamic raw) { AnyhowException dco_decode_AnyhowException(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs // Codec=Dco (DartCObject based), see doc to use other codecs
return AnyhowException(raw as String); return AnyhowException(raw as String);
} }
@protected
LBtcReverseRecovery
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
return LBtcReverseRecovery.dcoDecode(raw as List<dynamic>);
}
@protected
LBtcReverseRecovery
dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
return LBtcReverseRecovery.dcoDecode(raw as List<dynamic>);
}
@protected @protected
String dco_decode_String(dynamic raw) { String dco_decode_String(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs // Codec=Dco (DartCObject based), see doc to use other codecs
@@ -543,30 +488,39 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
// Codec=Dco (DartCObject based), see doc to use other codecs // Codec=Dco (DartCObject based), see doc to use other codecs
switch (raw[0]) { switch (raw[0]) {
case 0: case 0:
return PaymentError_AmountOutOfRange();
case 1:
return PaymentError_AlreadyClaimed(); return PaymentError_AlreadyClaimed();
case 1:
return PaymentError_AmountOutOfRange();
case 2: case 2:
return PaymentError_Generic( return PaymentError_Generic(
err: dco_decode_String(raw[1]), err: dco_decode_String(raw[1]),
); );
case 3: case 3:
return PaymentError_InvalidInvoice(); return PaymentError_InvalidOrExpiredFees();
case 4: case 4:
return PaymentError_InvalidPreimage(); return PaymentError_InsufficientFunds();
case 5: case 5:
return PaymentError_InvalidInvoice();
case 6:
return PaymentError_InvalidPreimage();
case 7:
return PaymentError_LwkError( return PaymentError_LwkError(
err: dco_decode_String(raw[1]), err: dco_decode_String(raw[1]),
); );
case 6:
return PaymentError_PairsNotFound();
case 7:
return PaymentError_PersistError();
case 8: case 8:
return PaymentError_PairsNotFound();
case 9:
return PaymentError_PersistError();
case 10:
return PaymentError_Refunded(
err: dco_decode_String(raw[1]),
txid: dco_decode_String(raw[2]),
);
case 11:
return PaymentError_SendError( return PaymentError_SendError(
err: dco_decode_String(raw[1]), err: dco_decode_String(raw[1]),
); );
case 9: case 12:
return PaymentError_SignerError( return PaymentError_SignerError(
err: dco_decode_String(raw[1]), err: dco_decode_String(raw[1]),
); );
@@ -595,11 +549,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
PrepareReceiveResponse dco_decode_prepare_receive_response(dynamic raw) { PrepareReceiveResponse dco_decode_prepare_receive_response(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs // Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>; final arr = raw as List<dynamic>;
if (arr.length != 3) throw Exception('unexpected arr length: expect 3 but see ${arr.length}'); if (arr.length != 2) throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
return PrepareReceiveResponse( return PrepareReceiveResponse(
pairHash: dco_decode_String(arr[0]), payerAmountSat: dco_decode_u_64(arr[0]),
payerAmountSat: dco_decode_u_64(arr[1]), feesSat: dco_decode_u_64(arr[1]),
feesSat: dco_decode_u_64(arr[2]),
); );
} }
@@ -617,14 +570,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
PrepareSendResponse dco_decode_prepare_send_response(dynamic raw) { PrepareSendResponse dco_decode_prepare_send_response(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs // Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>; final arr = raw as List<dynamic>;
if (arr.length != 6) throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); if (arr.length != 2) throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
return PrepareSendResponse( return PrepareSendResponse(
id: dco_decode_String(arr[0]), invoice: dco_decode_String(arr[0]),
payerAmountSat: dco_decode_u_64(arr[1]), feesSat: dco_decode_u_64(arr[1]),
receiverAmountSat: dco_decode_u_64(arr[2]),
totalFees: dco_decode_u_64(arr[3]),
fundingAddress: dco_decode_String(arr[4]),
invoice: dco_decode_String(arr[5]),
); );
} }
@@ -683,12 +632,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return; return;
} }
@protected
int dco_decode_usize(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
return dcoDecodeI64OrU64(raw);
}
@protected @protected
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) { AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
@@ -696,22 +639,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return AnyhowException(inner); return AnyhowException(inner);
} }
@protected
LBtcReverseRecovery
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
return LBtcReverseRecovery.sseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
}
@protected
LBtcReverseRecovery
sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
return LBtcReverseRecovery.sseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
}
@protected @protected
String sse_decode_String(SseDeserializer deserializer) { String sse_decode_String(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
@@ -893,27 +820,35 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var tag_ = sse_decode_i_32(deserializer); var tag_ = sse_decode_i_32(deserializer);
switch (tag_) { switch (tag_) {
case 0: case 0:
return PaymentError_AmountOutOfRange();
case 1:
return PaymentError_AlreadyClaimed(); return PaymentError_AlreadyClaimed();
case 1:
return PaymentError_AmountOutOfRange();
case 2: case 2:
var var_err = sse_decode_String(deserializer); var var_err = sse_decode_String(deserializer);
return PaymentError_Generic(err: var_err); return PaymentError_Generic(err: var_err);
case 3: case 3:
return PaymentError_InvalidInvoice(); return PaymentError_InvalidOrExpiredFees();
case 4: case 4:
return PaymentError_InvalidPreimage(); return PaymentError_InsufficientFunds();
case 5: case 5:
return PaymentError_InvalidInvoice();
case 6:
return PaymentError_InvalidPreimage();
case 7:
var var_err = sse_decode_String(deserializer); var var_err = sse_decode_String(deserializer);
return PaymentError_LwkError(err: var_err); return PaymentError_LwkError(err: var_err);
case 6:
return PaymentError_PairsNotFound();
case 7:
return PaymentError_PersistError();
case 8: case 8:
return PaymentError_PairsNotFound();
case 9:
return PaymentError_PersistError();
case 10:
var var_err = sse_decode_String(deserializer);
var var_txid = sse_decode_String(deserializer);
return PaymentError_Refunded(err: var_err, txid: var_txid);
case 11:
var var_err = sse_decode_String(deserializer); var var_err = sse_decode_String(deserializer);
return PaymentError_SendError(err: var_err); return PaymentError_SendError(err: var_err);
case 9: case 12:
var var_err = sse_decode_String(deserializer); var var_err = sse_decode_String(deserializer);
return PaymentError_SignerError(err: var_err); return PaymentError_SignerError(err: var_err);
default: default:
@@ -938,11 +873,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
@protected @protected
PrepareReceiveResponse sse_decode_prepare_receive_response(SseDeserializer deserializer) { PrepareReceiveResponse sse_decode_prepare_receive_response(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
var var_pairHash = sse_decode_String(deserializer);
var var_payerAmountSat = sse_decode_u_64(deserializer); var var_payerAmountSat = sse_decode_u_64(deserializer);
var var_feesSat = sse_decode_u_64(deserializer); var var_feesSat = sse_decode_u_64(deserializer);
return PrepareReceiveResponse( return PrepareReceiveResponse(payerAmountSat: var_payerAmountSat, feesSat: var_feesSat);
pairHash: var_pairHash, payerAmountSat: var_payerAmountSat, feesSat: var_feesSat);
} }
@protected @protected
@@ -955,19 +888,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
@protected @protected
PrepareSendResponse sse_decode_prepare_send_response(SseDeserializer deserializer) { PrepareSendResponse sse_decode_prepare_send_response(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
var var_id = sse_decode_String(deserializer);
var var_payerAmountSat = sse_decode_u_64(deserializer);
var var_receiverAmountSat = sse_decode_u_64(deserializer);
var var_totalFees = sse_decode_u_64(deserializer);
var var_fundingAddress = sse_decode_String(deserializer);
var var_invoice = sse_decode_String(deserializer); var var_invoice = sse_decode_String(deserializer);
return PrepareSendResponse( var var_feesSat = sse_decode_u_64(deserializer);
id: var_id, return PrepareSendResponse(invoice: var_invoice, feesSat: var_feesSat);
payerAmountSat: var_payerAmountSat,
receiverAmountSat: var_receiverAmountSat,
totalFees: var_totalFees,
fundingAddress: var_fundingAddress,
invoice: var_invoice);
} }
@protected @protected
@@ -1015,28 +938,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
} }
@protected
int sse_decode_usize(SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
return deserializer.buffer.getUint64();
}
@protected
int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
LBtcReverseRecovery raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
// ignore: invalid_use_of_internal_member
return raw.cstEncode(move: true);
}
@protected
int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
LBtcReverseRecovery raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
// ignore: invalid_use_of_internal_member
return raw.cstEncode();
}
@protected @protected
bool cst_encode_bool(bool raw) { bool cst_encode_bool(bool raw) {
// Codec=Cst (C-struct based), see doc to use other codecs // Codec=Cst (C-struct based), see doc to use other codecs
@@ -1079,33 +980,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
return raw; return raw;
} }
@protected
int cst_encode_usize(int raw) {
// Codec=Cst (C-struct based), see doc to use other codecs
return raw;
}
@protected @protected
void sse_encode_AnyhowException(AnyhowException self, SseSerializer serializer) { void sse_encode_AnyhowException(AnyhowException self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
throw UnimplementedError('Unreachable ()'); throw UnimplementedError('Unreachable ()');
} }
@protected
void
sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
LBtcReverseRecovery self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_usize(self.sseEncode(move: true), serializer);
}
@protected
void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecovery(
LBtcReverseRecovery self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_usize(self.sseEncode(move: null), serializer);
}
@protected @protected
void sse_encode_String(String self, SseSerializer serializer) { void sse_encode_String(String self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
@@ -1267,29 +1147,37 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_payment_error(PaymentError self, SseSerializer serializer) { void sse_encode_payment_error(PaymentError self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
switch (self) { switch (self) {
case PaymentError_AmountOutOfRange():
sse_encode_i_32(0, serializer);
case PaymentError_AlreadyClaimed(): case PaymentError_AlreadyClaimed():
sse_encode_i_32(0, serializer);
case PaymentError_AmountOutOfRange():
sse_encode_i_32(1, serializer); sse_encode_i_32(1, serializer);
case PaymentError_Generic(err: final err): case PaymentError_Generic(err: final err):
sse_encode_i_32(2, serializer); sse_encode_i_32(2, serializer);
sse_encode_String(err, serializer); sse_encode_String(err, serializer);
case PaymentError_InvalidInvoice(): case PaymentError_InvalidOrExpiredFees():
sse_encode_i_32(3, serializer); sse_encode_i_32(3, serializer);
case PaymentError_InvalidPreimage(): case PaymentError_InsufficientFunds():
sse_encode_i_32(4, serializer); sse_encode_i_32(4, serializer);
case PaymentError_LwkError(err: final err): case PaymentError_InvalidInvoice():
sse_encode_i_32(5, serializer); sse_encode_i_32(5, serializer);
case PaymentError_InvalidPreimage():
sse_encode_i_32(6, serializer);
case PaymentError_LwkError(err: final err):
sse_encode_i_32(7, serializer);
sse_encode_String(err, serializer); sse_encode_String(err, serializer);
case PaymentError_PairsNotFound(): case PaymentError_PairsNotFound():
sse_encode_i_32(6, serializer);
case PaymentError_PersistError():
sse_encode_i_32(7, serializer);
case PaymentError_SendError(err: final err):
sse_encode_i_32(8, serializer); sse_encode_i_32(8, serializer);
case PaymentError_PersistError():
sse_encode_i_32(9, serializer);
case PaymentError_Refunded(err: final err, txid: final txid):
sse_encode_i_32(10, serializer);
sse_encode_String(err, serializer);
sse_encode_String(txid, serializer);
case PaymentError_SendError(err: final err):
sse_encode_i_32(11, serializer);
sse_encode_String(err, serializer); sse_encode_String(err, serializer);
case PaymentError_SignerError(err: final err): case PaymentError_SignerError(err: final err):
sse_encode_i_32(9, serializer); sse_encode_i_32(12, serializer);
sse_encode_String(err, serializer); sse_encode_String(err, serializer);
} }
} }
@@ -1309,7 +1197,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
@protected @protected
void sse_encode_prepare_receive_response(PrepareReceiveResponse self, SseSerializer serializer) { void sse_encode_prepare_receive_response(PrepareReceiveResponse self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.pairHash, serializer);
sse_encode_u_64(self.payerAmountSat, serializer); sse_encode_u_64(self.payerAmountSat, serializer);
sse_encode_u_64(self.feesSat, serializer); sse_encode_u_64(self.feesSat, serializer);
} }
@@ -1323,12 +1210,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
@protected @protected
void sse_encode_prepare_send_response(PrepareSendResponse self, SseSerializer serializer) { void sse_encode_prepare_send_response(PrepareSendResponse self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.id, serializer);
sse_encode_u_64(self.payerAmountSat, serializer);
sse_encode_u_64(self.receiverAmountSat, serializer);
sse_encode_u_64(self.totalFees, serializer);
sse_encode_String(self.fundingAddress, serializer);
sse_encode_String(self.invoice, serializer); sse_encode_String(self.invoice, serializer);
sse_encode_u_64(self.feesSat, serializer);
} }
@protected @protected
@@ -1372,10 +1255,4 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_unit(void self, SseSerializer serializer) { void sse_encode_unit(void self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs // Codec=Sse (Serialization based), see doc to use other codecs
} }
@protected
void sse_encode_usize(int self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
serializer.buffer.putUint64(self);
}
} }

View File

@@ -20,22 +20,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
required super.portManager, required super.portManager,
}); });
CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_LBtcReverseRecoveryPtr => wire
._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerLBtcReverseRecoveryPtr;
@protected @protected
AnyhowException dco_decode_AnyhowException(dynamic raw); 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 @protected
String dco_decode_String(dynamic raw); String dco_decode_String(dynamic raw);
@@ -141,22 +128,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected @protected
void dco_decode_unit(dynamic raw); void dco_decode_unit(dynamic raw);
@protected
int dco_decode_usize(dynamic raw);
@protected @protected
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer); 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 @protected
String sse_decode_String(SseDeserializer deserializer); String sse_decode_String(SseDeserializer deserializer);
@@ -262,9 +236,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected @protected
void sse_decode_unit(SseDeserializer deserializer); void sse_decode_unit(SseDeserializer deserializer);
@protected
int sse_decode_usize(SseDeserializer deserializer);
@protected @protected
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_encode_AnyhowException(AnyhowException raw) { 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 // Codec=Cst (C-struct based), see doc to use other codecs
@@ -463,11 +434,11 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected @protected
void cst_api_fill_to_wire_payment_error(PaymentError apiObj, wire_cst_payment_error wireObj) { 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; wireObj.tag = 0;
return; return;
} }
if (apiObj is PaymentError_AlreadyClaimed) { if (apiObj is PaymentError_AmountOutOfRange) {
wireObj.tag = 1; wireObj.tag = 1;
return; return;
} }
@@ -477,37 +448,53 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
wireObj.kind.Generic.err = pre_err; wireObj.kind.Generic.err = pre_err;
return; return;
} }
if (apiObj is PaymentError_InvalidInvoice) { if (apiObj is PaymentError_InvalidOrExpiredFees) {
wireObj.tag = 3; wireObj.tag = 3;
return; return;
} }
if (apiObj is PaymentError_InvalidPreimage) { if (apiObj is PaymentError_InsufficientFunds) {
wireObj.tag = 4; wireObj.tag = 4;
return; return;
} }
if (apiObj is PaymentError_InvalidInvoice) {
wireObj.tag = 5;
return;
}
if (apiObj is PaymentError_InvalidPreimage) {
wireObj.tag = 6;
return;
}
if (apiObj is PaymentError_LwkError) { if (apiObj is PaymentError_LwkError) {
var pre_err = cst_encode_String(apiObj.err); var pre_err = cst_encode_String(apiObj.err);
wireObj.tag = 5; wireObj.tag = 7;
wireObj.kind.LwkError.err = pre_err; wireObj.kind.LwkError.err = pre_err;
return; return;
} }
if (apiObj is PaymentError_PairsNotFound) { if (apiObj is PaymentError_PairsNotFound) {
wireObj.tag = 6; wireObj.tag = 8;
return; return;
} }
if (apiObj is PaymentError_PersistError) { 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; return;
} }
if (apiObj is PaymentError_SendError) { if (apiObj is PaymentError_SendError) {
var pre_err = cst_encode_String(apiObj.err); var pre_err = cst_encode_String(apiObj.err);
wireObj.tag = 8; wireObj.tag = 11;
wireObj.kind.SendError.err = pre_err; wireObj.kind.SendError.err = pre_err;
return; return;
} }
if (apiObj is PaymentError_SignerError) { if (apiObj is PaymentError_SignerError) {
var pre_err = cst_encode_String(apiObj.err); var pre_err = cst_encode_String(apiObj.err);
wireObj.tag = 9; wireObj.tag = 12;
wireObj.kind.SignerError.err = pre_err; wireObj.kind.SignerError.err = pre_err;
return; return;
} }
@@ -522,7 +509,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected @protected
void cst_api_fill_to_wire_prepare_receive_response( void cst_api_fill_to_wire_prepare_receive_response(
PrepareReceiveResponse apiObj, wire_cst_prepare_receive_response wireObj) { 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.payer_amount_sat = cst_encode_u_64(apiObj.payerAmountSat);
wireObj.fees_sat = cst_encode_u_64(apiObj.feesSat); wireObj.fees_sat = cst_encode_u_64(apiObj.feesSat);
} }
@@ -536,12 +522,8 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected @protected
void cst_api_fill_to_wire_prepare_send_response( void cst_api_fill_to_wire_prepare_send_response(
PrepareSendResponse apiObj, wire_cst_prepare_send_response wireObj) { 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.invoice = cst_encode_String(apiObj.invoice);
wireObj.fees_sat = cst_encode_u_64(apiObj.feesSat);
} }
@protected @protected
@@ -562,14 +544,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
wireObj.txid = cst_encode_String(apiObj.txid); 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 @protected
bool cst_encode_bool(bool raw); bool cst_encode_bool(bool raw);
@@ -591,21 +565,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected @protected
void cst_encode_unit(void raw); void cst_encode_unit(void raw);
@protected
int cst_encode_usize(int raw);
@protected @protected
void sse_encode_AnyhowException(AnyhowException self, SseSerializer serializer); 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 @protected
void sse_encode_String(String self, SseSerializer serializer); void sse_encode_String(String self, SseSerializer serializer);
@@ -710,9 +672,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
@protected @protected
void sse_encode_unit(void self, SseSerializer serializer); void sse_encode_unit(void self, SseSerializer serializer);
@protected
void sse_encode_usize(int self, SseSerializer serializer);
} }
// Section: wire_class // Section: wire_class
@@ -871,20 +830,6 @@ class RustLibWire implements BaseWire {
late final _wire_receive_payment = _wire_receive_paymentPtr late final _wire_receive_payment = _wire_receive_paymentPtr
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_receive_response>)>(); .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( void wire_restore(
int port_, int port_,
ffi.Pointer<wire_cst_restore_request> req, ffi.Pointer<wire_cst_restore_request> req,
@@ -917,38 +862,6 @@ class RustLibWire implements BaseWire {
late final _wire_send_payment = late final _wire_send_payment =
_wire_send_paymentPtr.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_send_response>)>(); _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() { ffi.Pointer<wire_cst_connect_request> cst_new_box_autoadd_connect_request() {
return _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 { final class wire_cst_prepare_receive_response extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> pair_hash;
@ffi.Uint64() @ffi.Uint64()
external int payer_amount_sat; 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 { 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; 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 { 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; 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 { final class wire_cst_PaymentError_SendError extends ffi.Struct {
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err; 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_LwkError LwkError;
external wire_cst_PaymentError_Refunded Refunded;
external wire_cst_PaymentError_SendError SendError; external wire_cst_PaymentError_SendError SendError;
external wire_cst_PaymentError_SignerError SignerError; 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; 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;

View File

@@ -79,8 +79,6 @@ class Payment {
final int amountSat; final int amountSat;
final int? feesSat; final int? feesSat;
final PaymentType paymentType; final PaymentType paymentType;
/// Only for [PaymentType::PendingReceive]
final String? invoice; final String? invoice;
const Payment({ const Payment({
@@ -141,25 +139,22 @@ class PrepareReceiveRequest {
} }
class PrepareReceiveResponse { class PrepareReceiveResponse {
final String pairHash;
final int payerAmountSat; final int payerAmountSat;
final int feesSat; final int feesSat;
const PrepareReceiveResponse({ const PrepareReceiveResponse({
required this.pairHash,
required this.payerAmountSat, required this.payerAmountSat,
required this.feesSat, required this.feesSat,
}); });
@override @override
int get hashCode => pairHash.hashCode ^ payerAmountSat.hashCode ^ feesSat.hashCode; int get hashCode => payerAmountSat.hashCode ^ feesSat.hashCode;
@override @override
bool operator ==(Object other) => bool operator ==(Object other) =>
identical(this, other) || identical(this, other) ||
other is PrepareReceiveResponse && other is PrepareReceiveResponse &&
runtimeType == other.runtimeType && runtimeType == other.runtimeType &&
pairHash == other.pairHash &&
payerAmountSat == other.payerAmountSat && payerAmountSat == other.payerAmountSat &&
feesSat == other.feesSat; feesSat == other.feesSat;
} }
@@ -181,42 +176,24 @@ class PrepareSendRequest {
} }
class PrepareSendResponse { class PrepareSendResponse {
final String id;
final int payerAmountSat;
final int receiverAmountSat;
final int totalFees;
final String fundingAddress;
final String invoice; final String invoice;
final int feesSat;
const PrepareSendResponse({ const PrepareSendResponse({
required this.id,
required this.payerAmountSat,
required this.receiverAmountSat,
required this.totalFees,
required this.fundingAddress,
required this.invoice, required this.invoice,
required this.feesSat,
}); });
@override @override
int get hashCode => int get hashCode => invoice.hashCode ^ feesSat.hashCode;
id.hashCode ^
payerAmountSat.hashCode ^
receiverAmountSat.hashCode ^
totalFees.hashCode ^
fundingAddress.hashCode ^
invoice.hashCode;
@override @override
bool operator ==(Object other) => bool operator ==(Object other) =>
identical(this, other) || identical(this, other) ||
other is PrepareSendResponse && other is PrepareSendResponse &&
runtimeType == other.runtimeType && runtimeType == other.runtimeType &&
id == other.id && invoice == other.invoice &&
payerAmountSat == other.payerAmountSat && feesSat == other.feesSat;
receiverAmountSat == other.receiverAmountSat &&
totalFees == other.totalFees &&
fundingAddress == other.fundingAddress &&
invoice == other.invoice;
} }
class ReceivePaymentResponse { class ReceivePaymentResponse {