mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2026-01-06 07:34:24 +01:00
Generate Bindings
- Fix list_payments API on bindings
This commit is contained in:
@@ -57,8 +57,25 @@ typedef struct wire_cst_connect_request {
|
||||
int32_t network;
|
||||
} wire_cst_connect_request;
|
||||
|
||||
typedef struct wire_cst_payment {
|
||||
struct wire_cst_list_prim_u_8_strict *tx_id;
|
||||
struct wire_cst_list_prim_u_8_strict *swap_id;
|
||||
uint32_t timestamp;
|
||||
uint64_t amount_sat;
|
||||
uint64_t *fees_sat;
|
||||
int32_t payment_type;
|
||||
int32_t status;
|
||||
} wire_cst_payment;
|
||||
|
||||
typedef struct wire_cst_list_payment {
|
||||
struct wire_cst_payment *ptr;
|
||||
int32_t len;
|
||||
} wire_cst_list_payment;
|
||||
|
||||
typedef struct wire_cst_get_info_response {
|
||||
uint64_t balance_sat;
|
||||
uint64_t pending_send_sat;
|
||||
uint64_t pending_receive_sat;
|
||||
struct wire_cst_list_prim_u_8_strict *pubkey;
|
||||
} wire_cst_get_info_response;
|
||||
|
||||
@@ -85,7 +102,7 @@ typedef struct 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;
|
||||
struct wire_cst_list_prim_u_8_strict *refund_tx_id;
|
||||
} wire_cst_PaymentError_Refunded;
|
||||
|
||||
typedef struct wire_cst_PaymentError_SendError {
|
||||
@@ -125,6 +142,9 @@ void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info(int64_
|
||||
uintptr_t that,
|
||||
struct wire_cst_get_info_request *req);
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments(int64_t port_,
|
||||
uintptr_t that);
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(int64_t port_,
|
||||
uintptr_t that,
|
||||
struct wire_cst_prepare_receive_request *req);
|
||||
@@ -166,6 +186,10 @@ struct wire_cst_prepare_send_response *frbgen_breez_liquid_cst_new_box_autoadd_p
|
||||
|
||||
struct wire_cst_restore_request *frbgen_breez_liquid_cst_new_box_autoadd_restore_request(void);
|
||||
|
||||
uint64_t *frbgen_breez_liquid_cst_new_box_autoadd_u_64(uint64_t value);
|
||||
|
||||
struct wire_cst_list_payment *frbgen_breez_liquid_cst_new_list_payment(int32_t len);
|
||||
|
||||
struct wire_cst_list_prim_u_8_strict *frbgen_breez_liquid_cst_new_list_prim_u_8_strict(int32_t len);
|
||||
static int64_t dummy_method_to_enforce_bundling(void) {
|
||||
int64_t dummy_var = 0;
|
||||
@@ -176,11 +200,14 @@ static int64_t dummy_method_to_enforce_bundling(void) {
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_prepare_send_request);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_prepare_send_response);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_restore_request);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_u_64);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_payment);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_prim_u_8_strict);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment);
|
||||
|
||||
@@ -44,7 +44,7 @@ impl BindingLiquidSdk {
|
||||
self.sdk.receive_payment(&req)
|
||||
}
|
||||
|
||||
pub fn list_payments() -> Result<Vec<Payment>> {
|
||||
pub fn list_payments(&self) -> Result<Vec<Payment>, PaymentError> {
|
||||
self.sdk.list_payments()
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,12 @@ impl CstDecode<crate::model::RestoreRequest> for *mut wire_cst_restore_request {
|
||||
CstDecode::<crate::model::RestoreRequest>::cst_decode(*wrap).into()
|
||||
}
|
||||
}
|
||||
impl CstDecode<u64> for *mut u64 {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> u64 {
|
||||
unsafe { *flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::ConnectRequest> for wire_cst_connect_request {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::ConnectRequest {
|
||||
@@ -118,6 +124,8 @@ impl CstDecode<crate::model::GetInfoResponse> for wire_cst_get_info_response {
|
||||
fn cst_decode(self) -> crate::model::GetInfoResponse {
|
||||
crate::model::GetInfoResponse {
|
||||
balance_sat: self.balance_sat.cst_decode(),
|
||||
pending_send_sat: self.pending_send_sat.cst_decode(),
|
||||
pending_receive_sat: self.pending_receive_sat.cst_decode(),
|
||||
pubkey: self.pubkey.cst_decode(),
|
||||
}
|
||||
}
|
||||
@@ -136,6 +144,16 @@ impl CstDecode<crate::error::LiquidSdkError> for wire_cst_liquid_sdk_error {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<Vec<crate::model::Payment>> for *mut wire_cst_list_payment {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> Vec<crate::model::Payment> {
|
||||
let vec = unsafe {
|
||||
let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self);
|
||||
flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len)
|
||||
};
|
||||
vec.into_iter().map(CstDecode::cst_decode).collect()
|
||||
}
|
||||
}
|
||||
impl CstDecode<Vec<u8>> for *mut wire_cst_list_prim_u_8_strict {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> Vec<u8> {
|
||||
@@ -145,6 +163,20 @@ impl CstDecode<Vec<u8>> for *mut wire_cst_list_prim_u_8_strict {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::Payment> for wire_cst_payment {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::Payment {
|
||||
crate::model::Payment {
|
||||
tx_id: self.tx_id.cst_decode(),
|
||||
swap_id: self.swap_id.cst_decode(),
|
||||
timestamp: self.timestamp.cst_decode(),
|
||||
amount_sat: self.amount_sat.cst_decode(),
|
||||
fees_sat: self.fees_sat.cst_decode(),
|
||||
payment_type: self.payment_type.cst_decode(),
|
||||
status: self.status.cst_decode(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::error::PaymentError> for wire_cst_payment_error {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::error::PaymentError {
|
||||
@@ -173,7 +205,7 @@ impl CstDecode<crate::error::PaymentError> for wire_cst_payment_error {
|
||||
let ans = unsafe { self.kind.Refunded };
|
||||
crate::error::PaymentError::Refunded {
|
||||
err: ans.err.cst_decode(),
|
||||
txid: ans.txid.cst_decode(),
|
||||
refund_tx_id: ans.refund_tx_id.cst_decode(),
|
||||
}
|
||||
}
|
||||
11 => {
|
||||
@@ -281,6 +313,8 @@ impl NewWithNullPtr for wire_cst_get_info_response {
|
||||
fn new_with_null_ptr() -> Self {
|
||||
Self {
|
||||
balance_sat: Default::default(),
|
||||
pending_send_sat: Default::default(),
|
||||
pending_receive_sat: Default::default(),
|
||||
pubkey: core::ptr::null_mut(),
|
||||
}
|
||||
}
|
||||
@@ -303,6 +337,24 @@ impl Default for wire_cst_liquid_sdk_error {
|
||||
Self::new_with_null_ptr()
|
||||
}
|
||||
}
|
||||
impl NewWithNullPtr for wire_cst_payment {
|
||||
fn new_with_null_ptr() -> Self {
|
||||
Self {
|
||||
tx_id: core::ptr::null_mut(),
|
||||
swap_id: core::ptr::null_mut(),
|
||||
timestamp: Default::default(),
|
||||
amount_sat: Default::default(),
|
||||
fees_sat: core::ptr::null_mut(),
|
||||
payment_type: Default::default(),
|
||||
status: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Default for wire_cst_payment {
|
||||
fn default() -> Self {
|
||||
Self::new_with_null_ptr()
|
||||
}
|
||||
}
|
||||
impl NewWithNullPtr for wire_cst_payment_error {
|
||||
fn new_with_null_ptr() -> Self {
|
||||
Self {
|
||||
@@ -421,6 +473,14 @@ pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_ge
|
||||
wire__crate__bindings__BindingLiquidSdk_get_info_impl(port_, that, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
) {
|
||||
wire__crate__bindings__BindingLiquidSdk_list_payments_impl(port_, that)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
|
||||
port_: i64,
|
||||
@@ -548,6 +608,23 @@ pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_restore_request(
|
||||
)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_u_64(value: u64) -> *mut u64 {
|
||||
flutter_rust_bridge::for_generated::new_leak_box_ptr(value)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_cst_new_list_payment(len: i32) -> *mut wire_cst_list_payment {
|
||||
let wrap = wire_cst_list_payment {
|
||||
ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(
|
||||
<wire_cst_payment>::new_with_null_ptr(),
|
||||
len,
|
||||
),
|
||||
len,
|
||||
};
|
||||
flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_cst_new_list_prim_u_8_strict(
|
||||
len: i32,
|
||||
@@ -575,6 +652,8 @@ pub struct wire_cst_get_info_request {
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_get_info_response {
|
||||
balance_sat: u64,
|
||||
pending_send_sat: u64,
|
||||
pending_receive_sat: u64,
|
||||
pubkey: *mut wire_cst_list_prim_u_8_strict,
|
||||
}
|
||||
#[repr(C)]
|
||||
@@ -596,12 +675,29 @@ pub struct wire_cst_LiquidSdkError_Generic {
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_list_payment {
|
||||
ptr: *mut wire_cst_payment,
|
||||
len: i32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_list_prim_u_8_strict {
|
||||
ptr: *mut u8,
|
||||
len: i32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_payment {
|
||||
tx_id: *mut wire_cst_list_prim_u_8_strict,
|
||||
swap_id: *mut wire_cst_list_prim_u_8_strict,
|
||||
timestamp: u32,
|
||||
amount_sat: u64,
|
||||
fees_sat: *mut u64,
|
||||
payment_type: i32,
|
||||
status: i32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_payment_error {
|
||||
tag: i32,
|
||||
kind: PaymentErrorKind,
|
||||
@@ -630,7 +726,7 @@ pub struct wire_cst_PaymentError_LwkError {
|
||||
#[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,
|
||||
refund_tx_id: *mut wire_cst_list_prim_u_8_strict,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
|
||||
@@ -33,7 +33,7 @@ flutter_rust_bridge::frb_generated_boilerplate!(
|
||||
default_rust_auto_opaque = RustAutoOpaqueNom,
|
||||
);
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.35";
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -855974711;
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -913565329;
|
||||
|
||||
// Section: executor
|
||||
|
||||
@@ -115,6 +115,42 @@ fn wire__crate__bindings__BindingLiquidSdk_get_info_impl(
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_list_payments_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>,
|
||||
>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "BindingLiquidSdk_list_payments",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_that = that.cst_decode();
|
||||
move |context| {
|
||||
transform_result_dco((move || {
|
||||
let mut api_that_decoded = None;
|
||||
let decode_indices_ =
|
||||
flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(
|
||||
vec![api_that.rust_auto_opaque_lock_order_info(0, false)],
|
||||
);
|
||||
for i in decode_indices_ {
|
||||
match i {
|
||||
0 => {
|
||||
api_that_decoded = Some(api_that.rust_auto_opaque_decode_sync_ref())
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
let api_that = api_that_decoded.unwrap();
|
||||
crate::bindings::BindingLiquidSdk::list_payments(&api_that)
|
||||
})())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
@@ -346,6 +382,34 @@ impl CstDecode<crate::model::Network> for i32 {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::PaymentState> for i32 {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::PaymentState {
|
||||
match self {
|
||||
0 => crate::model::PaymentState::Created,
|
||||
1 => crate::model::PaymentState::Pending,
|
||||
2 => crate::model::PaymentState::Complete,
|
||||
3 => crate::model::PaymentState::Failed,
|
||||
_ => unreachable!("Invalid variant for PaymentState: {}", self),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::PaymentType> for i32 {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::PaymentType {
|
||||
match self {
|
||||
0 => crate::model::PaymentType::Receive,
|
||||
1 => crate::model::PaymentType::Send,
|
||||
_ => unreachable!("Invalid variant for PaymentType: {}", self),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<u32> for u32 {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> u32 {
|
||||
self
|
||||
}
|
||||
}
|
||||
impl CstDecode<u64> for u64 {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> u64 {
|
||||
@@ -427,9 +491,13 @@ impl SseDecode for crate::model::GetInfoResponse {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut var_balanceSat = <u64>::sse_decode(deserializer);
|
||||
let mut var_pendingSendSat = <u64>::sse_decode(deserializer);
|
||||
let mut var_pendingReceiveSat = <u64>::sse_decode(deserializer);
|
||||
let mut var_pubkey = <String>::sse_decode(deserializer);
|
||||
return crate::model::GetInfoResponse {
|
||||
balance_sat: var_balanceSat,
|
||||
pending_send_sat: var_pendingSendSat,
|
||||
pending_receive_sat: var_pendingReceiveSat,
|
||||
pubkey: var_pubkey,
|
||||
};
|
||||
}
|
||||
@@ -458,6 +526,18 @@ impl SseDecode for crate::error::LiquidSdkError {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Vec<crate::model::Payment> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut len_ = <i32>::sse_decode(deserializer);
|
||||
let mut ans_ = vec![];
|
||||
for idx_ in 0..len_ {
|
||||
ans_.push(<crate::model::Payment>::sse_decode(deserializer));
|
||||
}
|
||||
return ans_;
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Vec<u8> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -493,6 +573,39 @@ impl SseDecode for Option<String> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Option<u64> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
if (<bool>::sse_decode(deserializer)) {
|
||||
return Some(<u64>::sse_decode(deserializer));
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::model::Payment {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut var_txId = <String>::sse_decode(deserializer);
|
||||
let mut var_swapId = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_timestamp = <u32>::sse_decode(deserializer);
|
||||
let mut var_amountSat = <u64>::sse_decode(deserializer);
|
||||
let mut var_feesSat = <Option<u64>>::sse_decode(deserializer);
|
||||
let mut var_paymentType = <crate::model::PaymentType>::sse_decode(deserializer);
|
||||
let mut var_status = <crate::model::PaymentState>::sse_decode(deserializer);
|
||||
return crate::model::Payment {
|
||||
tx_id: var_txId,
|
||||
swap_id: var_swapId,
|
||||
timestamp: var_timestamp,
|
||||
amount_sat: var_amountSat,
|
||||
fees_sat: var_feesSat,
|
||||
payment_type: var_paymentType,
|
||||
status: var_status,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::error::PaymentError {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -532,10 +645,10 @@ impl SseDecode for crate::error::PaymentError {
|
||||
}
|
||||
10 => {
|
||||
let mut var_err = <String>::sse_decode(deserializer);
|
||||
let mut var_txid = <String>::sse_decode(deserializer);
|
||||
let mut var_refundTxId = <String>::sse_decode(deserializer);
|
||||
return crate::error::PaymentError::Refunded {
|
||||
err: var_err,
|
||||
txid: var_txid,
|
||||
refund_tx_id: var_refundTxId,
|
||||
};
|
||||
}
|
||||
11 => {
|
||||
@@ -553,6 +666,32 @@ impl SseDecode for crate::error::PaymentError {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::model::PaymentState {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut inner = <i32>::sse_decode(deserializer);
|
||||
return match inner {
|
||||
0 => crate::model::PaymentState::Created,
|
||||
1 => crate::model::PaymentState::Pending,
|
||||
2 => crate::model::PaymentState::Complete,
|
||||
3 => crate::model::PaymentState::Failed,
|
||||
_ => unreachable!("Invalid variant for PaymentState: {}", inner),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::model::PaymentType {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut inner = <i32>::sse_decode(deserializer);
|
||||
return match inner {
|
||||
0 => crate::model::PaymentType::Receive,
|
||||
1 => crate::model::PaymentType::Send,
|
||||
_ => unreachable!("Invalid variant for PaymentType: {}", inner),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::model::PrepareReceiveRequest {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -627,6 +766,13 @@ impl SseDecode for crate::model::SendPaymentResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for u32 {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
deserializer.cursor.read_u32::<NativeEndian>().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for u64 {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -733,6 +879,8 @@ impl flutter_rust_bridge::IntoDart for crate::model::GetInfoResponse {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
[
|
||||
self.balance_sat.into_into_dart().into_dart(),
|
||||
self.pending_send_sat.into_into_dart().into_dart(),
|
||||
self.pending_receive_sat.into_into_dart().into_dart(),
|
||||
self.pubkey.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
@@ -780,6 +928,27 @@ impl flutter_rust_bridge::IntoIntoDart<crate::model::Network> for crate::model::
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::model::Payment {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
[
|
||||
self.tx_id.into_into_dart().into_dart(),
|
||||
self.swap_id.into_into_dart().into_dart(),
|
||||
self.timestamp.into_into_dart().into_dart(),
|
||||
self.amount_sat.into_into_dart().into_dart(),
|
||||
self.fees_sat.into_into_dart().into_dart(),
|
||||
self.payment_type.into_into_dart().into_dart(),
|
||||
self.status.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::model::Payment {}
|
||||
impl flutter_rust_bridge::IntoIntoDart<crate::model::Payment> for crate::model::Payment {
|
||||
fn into_into_dart(self) -> crate::model::Payment {
|
||||
self
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::error::PaymentError {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
match self {
|
||||
@@ -797,10 +966,10 @@ impl flutter_rust_bridge::IntoDart for crate::error::PaymentError {
|
||||
}
|
||||
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, refund_tx_id } => [
|
||||
10.into_dart(),
|
||||
err.into_into_dart().into_dart(),
|
||||
txid.into_into_dart().into_dart(),
|
||||
refund_tx_id.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart(),
|
||||
crate::error::PaymentError::SendError { err } => {
|
||||
@@ -819,6 +988,38 @@ impl flutter_rust_bridge::IntoIntoDart<crate::error::PaymentError> for crate::er
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::model::PaymentState {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
match self {
|
||||
Self::Created => 0.into_dart(),
|
||||
Self::Pending => 1.into_dart(),
|
||||
Self::Complete => 2.into_dart(),
|
||||
Self::Failed => 3.into_dart(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::model::PaymentState {}
|
||||
impl flutter_rust_bridge::IntoIntoDart<crate::model::PaymentState> for crate::model::PaymentState {
|
||||
fn into_into_dart(self) -> crate::model::PaymentState {
|
||||
self
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::model::PaymentType {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
match self {
|
||||
Self::Receive => 0.into_dart(),
|
||||
Self::Send => 1.into_dart(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::model::PaymentType {}
|
||||
impl flutter_rust_bridge::IntoIntoDart<crate::model::PaymentType> for crate::model::PaymentType {
|
||||
fn into_into_dart(self) -> crate::model::PaymentType {
|
||||
self
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::model::PrepareReceiveRequest {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
[self.payer_amount_sat.into_into_dart().into_dart()].into_dart()
|
||||
@@ -999,6 +1200,8 @@ impl SseEncode for crate::model::GetInfoResponse {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<u64>::sse_encode(self.balance_sat, serializer);
|
||||
<u64>::sse_encode(self.pending_send_sat, serializer);
|
||||
<u64>::sse_encode(self.pending_receive_sat, serializer);
|
||||
<String>::sse_encode(self.pubkey, serializer);
|
||||
}
|
||||
}
|
||||
@@ -1022,6 +1225,16 @@ impl SseEncode for crate::error::LiquidSdkError {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Vec<crate::model::Payment> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<i32>::sse_encode(self.len() as _, serializer);
|
||||
for item in self {
|
||||
<crate::model::Payment>::sse_encode(item, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Vec<u8> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
@@ -1058,6 +1271,29 @@ impl SseEncode for Option<String> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Option<u64> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<bool>::sse_encode(self.is_some(), serializer);
|
||||
if let Some(value) = self {
|
||||
<u64>::sse_encode(value, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::model::Payment {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<String>::sse_encode(self.tx_id, serializer);
|
||||
<Option<String>>::sse_encode(self.swap_id, serializer);
|
||||
<u32>::sse_encode(self.timestamp, serializer);
|
||||
<u64>::sse_encode(self.amount_sat, serializer);
|
||||
<Option<u64>>::sse_encode(self.fees_sat, serializer);
|
||||
<crate::model::PaymentType>::sse_encode(self.payment_type, serializer);
|
||||
<crate::model::PaymentState>::sse_encode(self.status, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::error::PaymentError {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
@@ -1094,10 +1330,10 @@ impl SseEncode for crate::error::PaymentError {
|
||||
crate::error::PaymentError::PersistError => {
|
||||
<i32>::sse_encode(9, serializer);
|
||||
}
|
||||
crate::error::PaymentError::Refunded { err, txid } => {
|
||||
crate::error::PaymentError::Refunded { err, refund_tx_id } => {
|
||||
<i32>::sse_encode(10, serializer);
|
||||
<String>::sse_encode(err, serializer);
|
||||
<String>::sse_encode(txid, serializer);
|
||||
<String>::sse_encode(refund_tx_id, serializer);
|
||||
}
|
||||
crate::error::PaymentError::SendError { err } => {
|
||||
<i32>::sse_encode(11, serializer);
|
||||
@@ -1111,6 +1347,40 @@ impl SseEncode for crate::error::PaymentError {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::model::PaymentState {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<i32>::sse_encode(
|
||||
match self {
|
||||
crate::model::PaymentState::Created => 0,
|
||||
crate::model::PaymentState::Pending => 1,
|
||||
crate::model::PaymentState::Complete => 2,
|
||||
crate::model::PaymentState::Failed => 3,
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
},
|
||||
serializer,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::model::PaymentType {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
<i32>::sse_encode(
|
||||
match self {
|
||||
crate::model::PaymentType::Receive => 0,
|
||||
crate::model::PaymentType::Send => 1,
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
},
|
||||
serializer,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::model::PrepareReceiveRequest {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
@@ -1163,6 +1433,13 @@ impl SseEncode for crate::model::SendPaymentResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for u32 {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
serializer.cursor.write_u32::<NativeEndian>(self).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for u64 {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
|
||||
@@ -31,6 +31,9 @@ class BindingLiquidSdk extends RustOpaque {
|
||||
Future<GetInfoResponse> getInfo({required GetInfoRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkGetInfo(that: this, req: req, hint: hint);
|
||||
|
||||
Future<List<Payment>> listPayments({dynamic hint}) =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkListPayments(that: this, hint: hint);
|
||||
|
||||
Future<PrepareReceiveResponse> prepareReceivePayment({required PrepareReceiveRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api
|
||||
.crateBindingsBindingLiquidSdkPrepareReceivePayment(that: this, req: req, hint: hint);
|
||||
|
||||
@@ -53,7 +53,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
||||
String get codegenVersion => '2.0.0-dev.35';
|
||||
|
||||
@override
|
||||
int get rustContentHash => -855974711;
|
||||
int get rustContentHash => -913565329;
|
||||
|
||||
static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig(
|
||||
stem: 'breez_liquid_sdk',
|
||||
@@ -68,6 +68,9 @@ abstract class RustLibApi extends BaseApi {
|
||||
Future<GetInfoResponse> crateBindingsBindingLiquidSdkGetInfo(
|
||||
{required BindingLiquidSdk that, required GetInfoRequest req, dynamic hint});
|
||||
|
||||
Future<List<Payment>> crateBindingsBindingLiquidSdkListPayments(
|
||||
{required BindingLiquidSdk that, dynamic hint});
|
||||
|
||||
Future<PrepareReceiveResponse> crateBindingsBindingLiquidSdkPrepareReceivePayment(
|
||||
{required BindingLiquidSdk that, required PrepareReceiveRequest req, dynamic hint});
|
||||
|
||||
@@ -152,6 +155,32 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
argNames: ["that", "req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<List<Payment>> crateBindingsBindingLiquidSdkListPayments(
|
||||
{required BindingLiquidSdk that, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_list_payments(port_, arg0);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_list_payment,
|
||||
decodeErrorData: dco_decode_payment_error,
|
||||
),
|
||||
constMeta: kCrateBindingsBindingLiquidSdkListPaymentsConstMeta,
|
||||
argValues: [that],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkListPaymentsConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_list_payments",
|
||||
argNames: ["that"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<PrepareReceiveResponse> crateBindingsBindingLiquidSdkPrepareReceivePayment(
|
||||
{required BindingLiquidSdk that, required PrepareReceiveRequest req, dynamic hint}) {
|
||||
@@ -394,6 +423,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return dco_decode_restore_request(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
int dco_decode_box_autoadd_u_64(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return dco_decode_u_64(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
ConnectRequest dco_decode_connect_request(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -420,10 +455,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
GetInfoResponse dco_decode_get_info_response(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
final arr = raw as List<dynamic>;
|
||||
if (arr.length != 2) throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
|
||||
if (arr.length != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
|
||||
return GetInfoResponse(
|
||||
balanceSat: dco_decode_u_64(arr[0]),
|
||||
pubkey: dco_decode_String(arr[1]),
|
||||
pendingSendSat: dco_decode_u_64(arr[1]),
|
||||
pendingReceiveSat: dco_decode_u_64(arr[2]),
|
||||
pubkey: dco_decode_String(arr[3]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -446,6 +483,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
List<Payment> dco_decode_list_payment(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return (raw as List<dynamic>).map(dco_decode_payment).toList();
|
||||
}
|
||||
|
||||
@protected
|
||||
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -464,6 +507,28 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return raw == null ? null : dco_decode_String(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
int? dco_decode_opt_box_autoadd_u_64(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return raw == null ? null : dco_decode_box_autoadd_u_64(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
Payment dco_decode_payment(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
final arr = raw as List<dynamic>;
|
||||
if (arr.length != 7) throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
|
||||
return Payment(
|
||||
txId: dco_decode_String(arr[0]),
|
||||
swapId: dco_decode_opt_String(arr[1]),
|
||||
timestamp: dco_decode_u_32(arr[2]),
|
||||
amountSat: dco_decode_u_64(arr[3]),
|
||||
feesSat: dco_decode_opt_box_autoadd_u_64(arr[4]),
|
||||
paymentType: dco_decode_payment_type(arr[5]),
|
||||
status: dco_decode_payment_state(arr[6]),
|
||||
);
|
||||
}
|
||||
|
||||
@protected
|
||||
PaymentError dco_decode_payment_error(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -495,7 +560,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
case 10:
|
||||
return PaymentError_Refunded(
|
||||
err: dco_decode_String(raw[1]),
|
||||
txid: dco_decode_String(raw[2]),
|
||||
refundTxId: dco_decode_String(raw[2]),
|
||||
);
|
||||
case 11:
|
||||
return PaymentError_SendError(
|
||||
@@ -510,6 +575,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
PaymentState dco_decode_payment_state(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return PaymentState.values[raw as int];
|
||||
}
|
||||
|
||||
@protected
|
||||
PaymentType dco_decode_payment_type(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return PaymentType.values[raw as int];
|
||||
}
|
||||
|
||||
@protected
|
||||
PrepareReceiveRequest dco_decode_prepare_receive_request(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -583,6 +660,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
);
|
||||
}
|
||||
|
||||
@protected
|
||||
int dco_decode_u_32(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return raw as int;
|
||||
}
|
||||
|
||||
@protected
|
||||
int dco_decode_u_64(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -685,6 +768,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return (sse_decode_restore_request(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
int sse_decode_box_autoadd_u_64(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return (sse_decode_u_64(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
ConnectRequest sse_decode_connect_request(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -705,8 +794,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
GetInfoResponse sse_decode_get_info_response(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
var var_balanceSat = sse_decode_u_64(deserializer);
|
||||
var var_pendingSendSat = sse_decode_u_64(deserializer);
|
||||
var var_pendingReceiveSat = sse_decode_u_64(deserializer);
|
||||
var var_pubkey = sse_decode_String(deserializer);
|
||||
return GetInfoResponse(balanceSat: var_balanceSat, pubkey: var_pubkey);
|
||||
return GetInfoResponse(
|
||||
balanceSat: var_balanceSat,
|
||||
pendingSendSat: var_pendingSendSat,
|
||||
pendingReceiveSat: var_pendingReceiveSat,
|
||||
pubkey: var_pubkey);
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -729,6 +824,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
List<Payment> sse_decode_list_payment(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
var len_ = sse_decode_i_32(deserializer);
|
||||
var ans_ = <Payment>[];
|
||||
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
||||
ans_.add(sse_decode_payment(deserializer));
|
||||
}
|
||||
return ans_;
|
||||
}
|
||||
|
||||
@protected
|
||||
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -754,6 +861,37 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
if (sse_decode_bool(deserializer)) {
|
||||
return (sse_decode_box_autoadd_u_64(deserializer));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
Payment sse_decode_payment(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
var var_txId = sse_decode_String(deserializer);
|
||||
var var_swapId = sse_decode_opt_String(deserializer);
|
||||
var var_timestamp = sse_decode_u_32(deserializer);
|
||||
var var_amountSat = sse_decode_u_64(deserializer);
|
||||
var var_feesSat = sse_decode_opt_box_autoadd_u_64(deserializer);
|
||||
var var_paymentType = sse_decode_payment_type(deserializer);
|
||||
var var_status = sse_decode_payment_state(deserializer);
|
||||
return Payment(
|
||||
txId: var_txId,
|
||||
swapId: var_swapId,
|
||||
timestamp: var_timestamp,
|
||||
amountSat: var_amountSat,
|
||||
feesSat: var_feesSat,
|
||||
paymentType: var_paymentType,
|
||||
status: var_status);
|
||||
}
|
||||
|
||||
@protected
|
||||
PaymentError sse_decode_payment_error(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -784,8 +922,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
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);
|
||||
var var_refundTxId = sse_decode_String(deserializer);
|
||||
return PaymentError_Refunded(err: var_err, refundTxId: var_refundTxId);
|
||||
case 11:
|
||||
var var_err = sse_decode_String(deserializer);
|
||||
return PaymentError_SendError(err: var_err);
|
||||
@@ -797,6 +935,20 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
PaymentState sse_decode_payment_state(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
var inner = sse_decode_i_32(deserializer);
|
||||
return PaymentState.values[inner];
|
||||
}
|
||||
|
||||
@protected
|
||||
PaymentType sse_decode_payment_type(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
var inner = sse_decode_i_32(deserializer);
|
||||
return PaymentType.values[inner];
|
||||
}
|
||||
|
||||
@protected
|
||||
PrepareReceiveRequest sse_decode_prepare_receive_request(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -849,6 +1001,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return SendPaymentResponse(txid: var_txid);
|
||||
}
|
||||
|
||||
@protected
|
||||
int sse_decode_u_32(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return deserializer.buffer.getUint32();
|
||||
}
|
||||
|
||||
@protected
|
||||
int sse_decode_u_64(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -914,6 +1072,24 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return cst_encode_i_32(raw.index);
|
||||
}
|
||||
|
||||
@protected
|
||||
int cst_encode_payment_state(PaymentState raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
return cst_encode_i_32(raw.index);
|
||||
}
|
||||
|
||||
@protected
|
||||
int cst_encode_payment_type(PaymentType raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
return cst_encode_i_32(raw.index);
|
||||
}
|
||||
|
||||
@protected
|
||||
int cst_encode_u_32(int raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
return raw;
|
||||
}
|
||||
|
||||
@protected
|
||||
int cst_encode_u_8(int raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
@@ -1008,6 +1184,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
sse_encode_restore_request(self, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_u_64(self, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_connect_request(ConnectRequest self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -1026,6 +1208,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
void sse_encode_get_info_response(GetInfoResponse self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_u_64(self.balanceSat, serializer);
|
||||
sse_encode_u_64(self.pendingSendSat, serializer);
|
||||
sse_encode_u_64(self.pendingReceiveSat, serializer);
|
||||
sse_encode_String(self.pubkey, serializer);
|
||||
}
|
||||
|
||||
@@ -1045,6 +1229,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_list_payment(List<Payment> self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_i_32(self.length, serializer);
|
||||
for (final item in self) {
|
||||
sse_encode_payment(item, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_list_prim_u_8_strict(Uint8List self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -1068,6 +1261,28 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
sse_encode_bool(self != null, serializer);
|
||||
if (self != null) {
|
||||
sse_encode_box_autoadd_u_64(self, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_payment(Payment self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_String(self.txId, serializer);
|
||||
sse_encode_opt_String(self.swapId, serializer);
|
||||
sse_encode_u_32(self.timestamp, serializer);
|
||||
sse_encode_u_64(self.amountSat, serializer);
|
||||
sse_encode_opt_box_autoadd_u_64(self.feesSat, serializer);
|
||||
sse_encode_payment_type(self.paymentType, serializer);
|
||||
sse_encode_payment_state(self.status, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_payment_error(PaymentError self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -1094,10 +1309,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
sse_encode_i_32(8, serializer);
|
||||
case PaymentError_PersistError():
|
||||
sse_encode_i_32(9, serializer);
|
||||
case PaymentError_Refunded(err: final err, txid: final txid):
|
||||
case PaymentError_Refunded(err: final err, refundTxId: final refundTxId):
|
||||
sse_encode_i_32(10, serializer);
|
||||
sse_encode_String(err, serializer);
|
||||
sse_encode_String(txid, serializer);
|
||||
sse_encode_String(refundTxId, serializer);
|
||||
case PaymentError_SendError(err: final err):
|
||||
sse_encode_i_32(11, serializer);
|
||||
sse_encode_String(err, serializer);
|
||||
@@ -1107,6 +1322,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_payment_state(PaymentState self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_i_32(self.index, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_payment_type(PaymentType self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_i_32(self.index, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_prepare_receive_request(PrepareReceiveRequest self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -1152,6 +1379,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
sse_encode_String(self.txid, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_u_32(int self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
serializer.buffer.putUint32(self);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_u_64(int self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
@@ -64,6 +64,9 @@ 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);
|
||||
|
||||
@@ -79,6 +82,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
LiquidSdkError dco_decode_liquid_sdk_error(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<Payment> dco_decode_list_payment(dynamic raw);
|
||||
|
||||
@protected
|
||||
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
|
||||
|
||||
@@ -88,9 +94,21 @@ 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);
|
||||
|
||||
@@ -112,6 +130,9 @@ 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);
|
||||
|
||||
@@ -165,6 +186,9 @@ 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);
|
||||
|
||||
@@ -180,6 +204,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
LiquidSdkError sse_decode_liquid_sdk_error(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
List<Payment> sse_decode_list_payment(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
|
||||
|
||||
@@ -189,9 +216,21 @@ 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);
|
||||
|
||||
@@ -213,6 +252,9 @@ 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);
|
||||
|
||||
@@ -291,6 +333,22 @@ 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
|
||||
@@ -305,6 +363,12 @@ 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
|
||||
@@ -368,6 +432,8 @@ 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);
|
||||
}
|
||||
|
||||
@@ -381,6 +447,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
}
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_payment_error(PaymentError apiObj, wire_cst_payment_error wireObj) {
|
||||
if (apiObj is PaymentError_AlreadyClaimed) {
|
||||
@@ -429,10 +506,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
}
|
||||
if (apiObj is PaymentError_Refunded) {
|
||||
var pre_err = cst_encode_String(apiObj.err);
|
||||
var pre_txid = cst_encode_String(apiObj.txid);
|
||||
var pre_refund_tx_id = cst_encode_String(apiObj.refundTxId);
|
||||
wireObj.tag = 10;
|
||||
wireObj.kind.Refunded.err = pre_err;
|
||||
wireObj.kind.Refunded.txid = pre_txid;
|
||||
wireObj.kind.Refunded.refund_tx_id = pre_refund_tx_id;
|
||||
return;
|
||||
}
|
||||
if (apiObj is PaymentError_SendError) {
|
||||
@@ -514,6 +591,15 @@ 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);
|
||||
|
||||
@@ -562,6 +648,9 @@ 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);
|
||||
|
||||
@@ -577,6 +666,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_liquid_sdk_error(LiquidSdkError self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_payment(List<Payment> self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_prim_u_8_strict(Uint8List self, SseSerializer serializer);
|
||||
|
||||
@@ -586,9 +678,21 @@ 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);
|
||||
|
||||
@@ -610,6 +714,9 @@ 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);
|
||||
|
||||
@@ -694,6 +801,22 @@ class RustLibWire implements BaseWire {
|
||||
_wire__crate__bindings__BindingLiquidSdk_get_infoPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_get_info_request>)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_list_payments(
|
||||
int port_,
|
||||
int that,
|
||||
) {
|
||||
return _wire__crate__bindings__BindingLiquidSdk_list_payments(
|
||||
port_,
|
||||
that,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_list_paymentsPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_list_payments =
|
||||
_wire__crate__bindings__BindingLiquidSdk_list_paymentsPtr.asFunction<void Function(int, int)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
|
||||
int port_,
|
||||
int that,
|
||||
@@ -912,6 +1035,34 @@ 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,
|
||||
) {
|
||||
@@ -992,10 +1143,43 @@ final class wire_cst_connect_request extends ffi.Struct {
|
||||
external int network;
|
||||
}
|
||||
|
||||
final class wire_cst_payment extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> tx_id;
|
||||
|
||||
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;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1025,7 +1209,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> txid;
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> refund_tx_id;
|
||||
}
|
||||
|
||||
final class wire_cst_PaymentError_SendError extends ffi.Struct {
|
||||
|
||||
@@ -74,6 +74,23 @@ class FlutterBreezLiquidBindings {
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_infoPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_get_info_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments(
|
||||
int port_,
|
||||
int that,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments(
|
||||
port_,
|
||||
that,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_paymentsPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_paymentsPtr
|
||||
.asFunction<void Function(int, int)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
|
||||
int port_,
|
||||
int that,
|
||||
@@ -304,6 +321,34 @@ class FlutterBreezLiquidBindings {
|
||||
_frbgen_breez_liquid_cst_new_box_autoadd_restore_requestPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_restore_request> Function()>();
|
||||
|
||||
ffi.Pointer<ffi.Uint64> frbgen_breez_liquid_cst_new_box_autoadd_u_64(
|
||||
int value,
|
||||
) {
|
||||
return _frbgen_breez_liquid_cst_new_box_autoadd_u_64(
|
||||
value,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_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 _frbgen_breez_liquid_cst_new_box_autoadd_u_64 =
|
||||
_frbgen_breez_liquid_cst_new_box_autoadd_u_64Ptr.asFunction<ffi.Pointer<ffi.Uint64> Function(int)>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_payment> frbgen_breez_liquid_cst_new_list_payment(
|
||||
int len,
|
||||
) {
|
||||
return _frbgen_breez_liquid_cst_new_list_payment(
|
||||
len,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_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 _frbgen_breez_liquid_cst_new_list_payment = _frbgen_breez_liquid_cst_new_list_paymentPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_list_payment> Function(int)>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> frbgen_breez_liquid_cst_new_list_prim_u_8_strict(
|
||||
int len,
|
||||
) {
|
||||
@@ -396,10 +441,43 @@ final class wire_cst_connect_request extends ffi.Struct {
|
||||
external int network;
|
||||
}
|
||||
|
||||
final class wire_cst_payment extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> tx_id;
|
||||
|
||||
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;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -429,7 +507,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> txid;
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> refund_tx_id;
|
||||
}
|
||||
|
||||
final class wire_cst_PaymentError_SendError extends ffi.Struct {
|
||||
|
||||
Reference in New Issue
Block a user