mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-20 15:34:26 +01:00
Stop using singleton instance on Dart bindings
Apply changes to test cases on Dart plugin
This commit is contained in:
8
cli/Cargo.lock
generated
8
cli/Cargo.lock
generated
@@ -819,9 +819,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "flutter_rust_bridge"
|
||||
version = "2.0.0-dev.33"
|
||||
version = "2.0.0-dev.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "293c86d55bf9b6108482f8574517a8e7e032dd1d9260e1f4801c6180fdd2583c"
|
||||
checksum = "9b581435c54bcb7d6d4094e8dff83bc837977ca8f89fd55c8aef86a8d3315000"
|
||||
dependencies = [
|
||||
"allo-isolate",
|
||||
"android_logger",
|
||||
@@ -847,9 +847,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "flutter_rust_bridge_macros"
|
||||
version = "2.0.0-dev.33"
|
||||
version = "2.0.0-dev.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d852460bc16316c4491a60e1652612f717764d436f3a97f8f1cc7c3b54d9a0dc"
|
||||
checksum = "0a11f5b9e6453db2c6c8aaadb10592b5aa05eafd5fb1f409d6ec5c9dad9dbe1e"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"quote",
|
||||
|
||||
8
lib/Cargo.lock
generated
8
lib/Cargo.lock
generated
@@ -955,9 +955,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "flutter_rust_bridge"
|
||||
version = "2.0.0-dev.33"
|
||||
version = "2.0.0-dev.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "293c86d55bf9b6108482f8574517a8e7e032dd1d9260e1f4801c6180fdd2583c"
|
||||
checksum = "9b581435c54bcb7d6d4094e8dff83bc837977ca8f89fd55c8aef86a8d3315000"
|
||||
dependencies = [
|
||||
"allo-isolate",
|
||||
"android_logger",
|
||||
@@ -983,9 +983,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "flutter_rust_bridge_macros"
|
||||
version = "2.0.0-dev.33"
|
||||
version = "2.0.0-dev.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d852460bc16316c4491a60e1652612f717764d436f3a97f8f1cc7c3b54d9a0dc"
|
||||
checksum = "0a11f5b9e6453db2c6c8aaadb10592b5aa05eafd5fb1f409d6ec5c9dad9dbe1e"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"quote",
|
||||
|
||||
@@ -20,17 +20,6 @@ typedef struct _Dart_Handle* Dart_Handle;
|
||||
*/
|
||||
#define LIQUID_CLAIM_TX_FEERATE_MSAT 100.0
|
||||
|
||||
typedef struct wire_cst_list_prim_u_8_strict {
|
||||
uint8_t *ptr;
|
||||
int32_t len;
|
||||
} wire_cst_list_prim_u_8_strict;
|
||||
|
||||
typedef struct wire_cst_connect_request {
|
||||
struct wire_cst_list_prim_u_8_strict *mnemonic;
|
||||
struct wire_cst_list_prim_u_8_strict *data_dir;
|
||||
int32_t network;
|
||||
} wire_cst_connect_request;
|
||||
|
||||
typedef struct wire_cst_get_info_request {
|
||||
bool with_scan;
|
||||
} wire_cst_get_info_request;
|
||||
@@ -39,6 +28,11 @@ typedef struct wire_cst_prepare_receive_request {
|
||||
uint64_t payer_amount_sat;
|
||||
} wire_cst_prepare_receive_request;
|
||||
|
||||
typedef struct wire_cst_list_prim_u_8_strict {
|
||||
uint8_t *ptr;
|
||||
int32_t len;
|
||||
} wire_cst_list_prim_u_8_strict;
|
||||
|
||||
typedef struct wire_cst_prepare_send_request {
|
||||
struct wire_cst_list_prim_u_8_strict *invoice;
|
||||
} wire_cst_prepare_send_request;
|
||||
@@ -57,28 +51,30 @@ typedef struct wire_cst_prepare_send_response {
|
||||
uint64_t fees_sat;
|
||||
} wire_cst_prepare_send_response;
|
||||
|
||||
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_connect_request {
|
||||
struct wire_cst_list_prim_u_8_strict *mnemonic;
|
||||
struct wire_cst_list_prim_u_8_strict *data_dir;
|
||||
int32_t network;
|
||||
} wire_cst_connect_request;
|
||||
|
||||
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;
|
||||
|
||||
typedef struct wire_cst_LiquidSdkError_Generic {
|
||||
struct wire_cst_list_prim_u_8_strict *err;
|
||||
} wire_cst_LiquidSdkError_Generic;
|
||||
|
||||
typedef union LiquidSdkErrorKind {
|
||||
struct wire_cst_LiquidSdkError_Generic Generic;
|
||||
} LiquidSdkErrorKind;
|
||||
|
||||
typedef struct wire_cst_liquid_sdk_error {
|
||||
int32_t tag;
|
||||
union LiquidSdkErrorKind kind;
|
||||
} wire_cst_liquid_sdk_error;
|
||||
|
||||
typedef struct wire_cst_PaymentError_Generic {
|
||||
struct wire_cst_list_prim_u_8_strict *err;
|
||||
} wire_cst_PaymentError_Generic;
|
||||
@@ -89,7 +85,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 *refund_tx_id;
|
||||
struct wire_cst_list_prim_u_8_strict *txid;
|
||||
} wire_cst_PaymentError_Refunded;
|
||||
|
||||
typedef struct wire_cst_PaymentError_SendError {
|
||||
@@ -122,30 +118,40 @@ typedef struct wire_cst_send_payment_response {
|
||||
struct wire_cst_list_prim_u_8_strict *txid;
|
||||
} wire_cst_send_payment_response;
|
||||
|
||||
void frbgen_breez_liquid_wire_backup(int64_t port_);
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup(int64_t port_,
|
||||
uintptr_t that);
|
||||
|
||||
void frbgen_breez_liquid_wire_connect(int64_t port_, struct wire_cst_connect_request *req);
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info(int64_t port_,
|
||||
uintptr_t that,
|
||||
struct wire_cst_get_info_request *req);
|
||||
|
||||
void frbgen_breez_liquid_wire_empty_wallet_cache(int64_t port_);
|
||||
|
||||
void frbgen_breez_liquid_wire_get_info(int64_t port_, struct wire_cst_get_info_request *req);
|
||||
|
||||
void frbgen_breez_liquid_wire_list_payments(int64_t port_);
|
||||
|
||||
void frbgen_breez_liquid_wire_prepare_receive_payment(int64_t port_,
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(int64_t port_,
|
||||
uintptr_t that,
|
||||
struct wire_cst_prepare_receive_request *req);
|
||||
|
||||
void frbgen_breez_liquid_wire_prepare_send_payment(int64_t port_,
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(int64_t port_,
|
||||
uintptr_t that,
|
||||
struct wire_cst_prepare_send_request *req);
|
||||
|
||||
void frbgen_breez_liquid_wire_receive_payment(int64_t port_,
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment(int64_t port_,
|
||||
uintptr_t that,
|
||||
struct wire_cst_prepare_receive_response *req);
|
||||
|
||||
void frbgen_breez_liquid_wire_restore(int64_t port_, struct wire_cst_restore_request *req);
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore(int64_t port_,
|
||||
uintptr_t that,
|
||||
struct wire_cst_restore_request *req);
|
||||
|
||||
void frbgen_breez_liquid_wire_send_payment(int64_t port_,
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment(int64_t port_,
|
||||
uintptr_t that,
|
||||
struct wire_cst_prepare_send_response *req);
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__connect(int64_t port_,
|
||||
struct wire_cst_connect_request *req);
|
||||
|
||||
void frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(const void *ptr);
|
||||
|
||||
void frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(const void *ptr);
|
||||
|
||||
struct wire_cst_connect_request *frbgen_breez_liquid_cst_new_box_autoadd_connect_request(void);
|
||||
|
||||
struct wire_cst_get_info_request *frbgen_breez_liquid_cst_new_box_autoadd_get_info_request(void);
|
||||
@@ -160,10 +166,6 @@ 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;
|
||||
@@ -174,19 +176,17 @@ 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_wire_backup);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_connect);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_empty_wallet_cache);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_get_info);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_list_payments);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_prepare_receive_payment);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_prepare_send_payment);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_receive_payment);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_restore);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire_send_payment);
|
||||
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_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);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__connect);
|
||||
dummy_var ^= ((int64_t) (void*) store_dart_post_cobject);
|
||||
return dummy_var;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ bootstrap frb='true' build='false':
|
||||
# Install flutter_rust_bridge_codegen dependencies
|
||||
frb:
|
||||
cargo install cargo-expand
|
||||
cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.33
|
||||
cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.35
|
||||
dart pub global activate ffigen
|
||||
dart pub global activate ffi
|
||||
cargo install cargo-xcode
|
||||
|
||||
@@ -16,7 +16,7 @@ anyhow = { workspace = true }
|
||||
bip39 = { version = "2.0.0", features = ["serde"] }
|
||||
#boltz-client = { git = "https://github.com/SatoshiPortal/boltz-rust", rev = "a05731cc33030ada9ae14afcafe0cded22842ba6" }
|
||||
boltz-client = { git = "https://github.com/ok300/boltz-rust", branch = "ok300-breez-latest-05-21" }
|
||||
flutter_rust_bridge = { version = "=2.0.0-dev.33", features = ["chrono"], optional = true }
|
||||
flutter_rust_bridge = { version = "=2.0.0-dev.35", features = ["chrono"], optional = true }
|
||||
log = "0.4.20"
|
||||
lwk_common = "0.5.0"
|
||||
lwk_signer = "0.5.0"
|
||||
|
||||
@@ -1,90 +1,58 @@
|
||||
use std::sync::{Arc, OnceLock};
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
|
||||
use crate::{error::*, model::*, sdk::LiquidSdk};
|
||||
use anyhow::Result;
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::model::Payment;
|
||||
|
||||
static LIQUID_SDK_INSTANCE: OnceLock<Arc<LiquidSdk>> = OnceLock::new();
|
||||
|
||||
pub fn connect(req: ConnectRequest) -> Result<()> {
|
||||
let sdk = LiquidSdk::connect(req)?;
|
||||
LIQUID_SDK_INSTANCE.get_or_init(|| sdk);
|
||||
Ok(())
|
||||
pub fn connect(req: ConnectRequest) -> Result<BindingLiquidSdk, LiquidSdkError> {
|
||||
let ln_sdk = LiquidSdk::connect(req)?;
|
||||
Ok(BindingLiquidSdk { sdk: ln_sdk })
|
||||
}
|
||||
|
||||
pub fn get_info(req: GetInfoRequest) -> Result<GetInfoResponse> {
|
||||
LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))?
|
||||
.get_info(req)
|
||||
pub struct BindingLiquidSdk {
|
||||
sdk: Arc<LiquidSdk>,
|
||||
}
|
||||
|
||||
pub fn prepare_send_payment(req: PrepareSendRequest) -> Result<PrepareSendResponse, PaymentError> {
|
||||
LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))
|
||||
.map_err(|e| LiquidSdkError::Generic { err: e.to_string() })?
|
||||
.prepare_send_payment(&req)
|
||||
}
|
||||
impl BindingLiquidSdk {
|
||||
pub fn get_info(&self, req: GetInfoRequest) -> Result<GetInfoResponse, LiquidSdkError> {
|
||||
self.sdk.get_info(req).map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn send_payment(req: PrepareSendResponse) -> Result<SendPaymentResponse, PaymentError> {
|
||||
LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))
|
||||
.map_err(|e| LiquidSdkError::Generic { err: e.to_string() })?
|
||||
.send_payment(&req)
|
||||
}
|
||||
pub fn prepare_send_payment(
|
||||
&self,
|
||||
req: PrepareSendRequest,
|
||||
) -> Result<PrepareSendResponse, PaymentError> {
|
||||
self.sdk.prepare_send_payment(&req)
|
||||
}
|
||||
|
||||
pub fn prepare_receive_payment(
|
||||
pub fn send_payment(
|
||||
&self,
|
||||
req: PrepareSendResponse,
|
||||
) -> Result<SendPaymentResponse, PaymentError> {
|
||||
self.sdk.send_payment(&req)
|
||||
}
|
||||
|
||||
pub fn prepare_receive_payment(
|
||||
&self,
|
||||
req: PrepareReceiveRequest,
|
||||
) -> Result<PrepareReceiveResponse, PaymentError> {
|
||||
LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))
|
||||
.map_err(|e| LiquidSdkError::Generic { err: e.to_string() })?
|
||||
.prepare_receive_payment(&req)
|
||||
}
|
||||
) -> Result<PrepareReceiveResponse, PaymentError> {
|
||||
self.sdk.prepare_receive_payment(&req)
|
||||
}
|
||||
|
||||
pub fn receive_payment(
|
||||
pub fn receive_payment(
|
||||
&self,
|
||||
req: PrepareReceiveResponse,
|
||||
) -> Result<ReceivePaymentResponse, PaymentError> {
|
||||
LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))
|
||||
.map_err(|e| LiquidSdkError::Generic { err: e.to_string() })?
|
||||
.receive_payment(&req)
|
||||
}
|
||||
) -> Result<ReceivePaymentResponse, PaymentError> {
|
||||
self.sdk.receive_payment(&req)
|
||||
}
|
||||
|
||||
pub fn list_payments() -> Result<Vec<Payment>> {
|
||||
Ok(LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))
|
||||
.map_err(|e| LiquidSdkError::Generic { err: e.to_string() })?
|
||||
.list_payments()?)
|
||||
}
|
||||
pub fn list_payments() -> Result<Vec<Payment>> {
|
||||
self.sdk.list_payments()
|
||||
}
|
||||
|
||||
pub fn empty_wallet_cache() -> Result<()> {
|
||||
LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))
|
||||
.map_err(|e| LiquidSdkError::Generic { err: e.to_string() })?
|
||||
.empty_wallet_cache()
|
||||
}
|
||||
pub fn backup(&self) -> Result<(), LiquidSdkError> {
|
||||
self.sdk.backup().map_err(Into::into)
|
||||
}
|
||||
|
||||
pub fn backup() -> Result<()> {
|
||||
LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))
|
||||
.map_err(|e| LiquidSdkError::Generic { err: e.to_string() })?
|
||||
.backup()
|
||||
}
|
||||
|
||||
pub fn restore(req: RestoreRequest) -> Result<()> {
|
||||
LIQUID_SDK_INSTANCE
|
||||
.get()
|
||||
.ok_or(anyhow!("Not initialized"))
|
||||
.map_err(|e| LiquidSdkError::Generic { err: e.to_string() })?
|
||||
.restore(req)
|
||||
pub fn restore(&self, req: RestoreRequest) -> Result<(), LiquidSdkError> {
|
||||
self.sdk.restore(req).map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.35.
|
||||
|
||||
// Section: imports
|
||||
|
||||
use super::*;
|
||||
use crate::bindings::*;
|
||||
use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt};
|
||||
use flutter_rust_bridge::for_generated::transform_result_dco;
|
||||
use flutter_rust_bridge::{Handler, IntoIntoDart};
|
||||
@@ -14,12 +15,28 @@ flutter_rust_bridge::frb_generated_boilerplate_io!();
|
||||
|
||||
// Section: dart2rust
|
||||
|
||||
impl CstDecode<flutter_rust_bridge::for_generated::anyhow::Error>
|
||||
for *mut wire_cst_list_prim_u_8_strict
|
||||
impl CstDecode<BindingLiquidSdk> for usize {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> BindingLiquidSdk {
|
||||
CstDecode::<
|
||||
RustOpaqueNom<
|
||||
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>,
|
||||
>,
|
||||
>::cst_decode(self)
|
||||
.rust_auto_opaque_decode_owned()
|
||||
}
|
||||
}
|
||||
impl
|
||||
CstDecode<
|
||||
RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>,
|
||||
> for usize
|
||||
{
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> flutter_rust_bridge::for_generated::anyhow::Error {
|
||||
unimplemented!()
|
||||
fn cst_decode(
|
||||
self,
|
||||
) -> RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>
|
||||
{
|
||||
unsafe { decode_rust_opaque_nom(self as _) }
|
||||
}
|
||||
}
|
||||
impl CstDecode<String> for *mut wire_cst_list_prim_u_8_strict {
|
||||
@@ -78,12 +95,6 @@ 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 {
|
||||
@@ -107,20 +118,22 @@ 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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<Vec<crate::model::Payment>> for *mut wire_cst_list_payment {
|
||||
impl CstDecode<crate::error::LiquidSdkError> for wire_cst_liquid_sdk_error {
|
||||
// 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()
|
||||
fn cst_decode(self) -> crate::error::LiquidSdkError {
|
||||
match self.tag {
|
||||
0 => {
|
||||
let ans = unsafe { self.kind.Generic };
|
||||
crate::error::LiquidSdkError::Generic {
|
||||
err: ans.err.cst_decode(),
|
||||
}
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<Vec<u8>> for *mut wire_cst_list_prim_u_8_strict {
|
||||
@@ -132,20 +145,6 @@ 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 {
|
||||
@@ -174,7 +173,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(),
|
||||
refund_tx_id: ans.refund_tx_id.cst_decode(),
|
||||
txid: ans.txid.cst_decode(),
|
||||
}
|
||||
}
|
||||
11 => {
|
||||
@@ -282,8 +281,6 @@ 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(),
|
||||
}
|
||||
}
|
||||
@@ -293,20 +290,15 @@ impl Default for wire_cst_get_info_response {
|
||||
Self::new_with_null_ptr()
|
||||
}
|
||||
}
|
||||
impl NewWithNullPtr for wire_cst_payment {
|
||||
impl NewWithNullPtr for wire_cst_liquid_sdk_error {
|
||||
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(),
|
||||
tag: -1,
|
||||
kind: LiquidSdkErrorKind { nil__: () },
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Default for wire_cst_payment {
|
||||
impl Default for wire_cst_liquid_sdk_error {
|
||||
fn default() -> Self {
|
||||
Self::new_with_null_ptr()
|
||||
}
|
||||
@@ -413,68 +405,91 @@ impl Default for wire_cst_send_payment_response {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_backup(port_: i64) {
|
||||
wire_backup_impl(port_)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_connect(port_: i64, req: *mut wire_cst_connect_request) {
|
||||
wire_connect_impl(port_, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_empty_wallet_cache(port_: i64) {
|
||||
wire_empty_wallet_cache_impl(port_)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_get_info(
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
) {
|
||||
wire__crate__bindings__BindingLiquidSdk_backup_impl(port_, that)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
req: *mut wire_cst_get_info_request,
|
||||
) {
|
||||
wire_get_info_impl(port_, req)
|
||||
wire__crate__bindings__BindingLiquidSdk_get_info_impl(port_, that, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_list_payments(port_: i64) {
|
||||
wire_list_payments_impl(port_)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_prepare_receive_payment(
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
req: *mut wire_cst_prepare_receive_request,
|
||||
) {
|
||||
wire_prepare_receive_payment_impl(port_, req)
|
||||
wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment_impl(port_, that, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_prepare_send_payment(
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
req: *mut wire_cst_prepare_send_request,
|
||||
) {
|
||||
wire_prepare_send_payment_impl(port_, req)
|
||||
wire__crate__bindings__BindingLiquidSdk_prepare_send_payment_impl(port_, that, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_receive_payment(
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
req: *mut wire_cst_prepare_receive_response,
|
||||
) {
|
||||
wire_receive_payment_impl(port_, req)
|
||||
wire__crate__bindings__BindingLiquidSdk_receive_payment_impl(port_, that, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_restore(port_: i64, req: *mut wire_cst_restore_request) {
|
||||
wire_restore_impl(port_, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire_send_payment(
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
req: *mut wire_cst_restore_request,
|
||||
) {
|
||||
wire__crate__bindings__BindingLiquidSdk_restore_impl(port_, that, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
req: *mut wire_cst_prepare_send_response,
|
||||
) {
|
||||
wire_send_payment_impl(port_, req)
|
||||
wire__crate__bindings__BindingLiquidSdk_send_payment_impl(port_, that, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__connect(
|
||||
port_: i64,
|
||||
req: *mut wire_cst_connect_request,
|
||||
) {
|
||||
wire__crate__bindings__connect_impl(port_, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ptr: *const std::ffi::c_void,
|
||||
) {
|
||||
unsafe {
|
||||
StdArc::<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>::increment_strong_count(ptr as _);
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ptr: *const std::ffi::c_void,
|
||||
) {
|
||||
unsafe {
|
||||
StdArc::<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>::decrement_strong_count(ptr as _);
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@@ -533,23 +548,6 @@ 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,
|
||||
@@ -577,15 +575,24 @@ 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)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_list_payment {
|
||||
ptr: *mut wire_cst_payment,
|
||||
len: i32,
|
||||
pub struct wire_cst_liquid_sdk_error {
|
||||
tag: i32,
|
||||
kind: LiquidSdkErrorKind,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub union LiquidSdkErrorKind {
|
||||
Generic: wire_cst_LiquidSdkError_Generic,
|
||||
nil__: (),
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_LiquidSdkError_Generic {
|
||||
err: *mut wire_cst_list_prim_u_8_strict,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
@@ -595,17 +602,6 @@ pub struct wire_cst_list_prim_u_8_strict {
|
||||
}
|
||||
#[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,
|
||||
@@ -634,7 +630,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,
|
||||
refund_tx_id: *mut wire_cst_list_prim_u_8_strict,
|
||||
txid: *mut wire_cst_list_prim_u_8_strict,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.35.
|
||||
|
||||
#![allow(
|
||||
non_camel_case_types,
|
||||
@@ -14,11 +14,13 @@
|
||||
clippy::double_parens,
|
||||
clippy::let_and_return,
|
||||
clippy::too_many_arguments,
|
||||
clippy::match_single_binding
|
||||
clippy::match_single_binding,
|
||||
clippy::let_unit_value
|
||||
)]
|
||||
|
||||
// Section: imports
|
||||
|
||||
use crate::bindings::*;
|
||||
use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt};
|
||||
use flutter_rust_bridge::for_generated::transform_result_dco;
|
||||
use flutter_rust_bridge::{Handler, IntoIntoDart};
|
||||
@@ -30,8 +32,8 @@ flutter_rust_bridge::frb_generated_boilerplate!(
|
||||
default_rust_opaque = RustOpaqueNom,
|
||||
default_rust_auto_opaque = RustAutoOpaqueNom,
|
||||
);
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.33";
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = -451265040;
|
||||
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;
|
||||
|
||||
// Section: executor
|
||||
|
||||
@@ -39,17 +41,271 @@ flutter_rust_bridge::frb_generated_default_handler!();
|
||||
|
||||
// Section: wire_funcs
|
||||
|
||||
fn wire_backup_impl(port_: flutter_rust_bridge::for_generated::MessagePort) {
|
||||
fn wire__crate__bindings__BindingLiquidSdk_backup_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: "backup",
|
||||
debug_name: "BindingLiquidSdk_backup",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || move |context| transform_result_dco((move || crate::bindings::backup())()),
|
||||
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::backup(&api_that)
|
||||
})())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire_connect_impl(
|
||||
fn wire__crate__bindings__BindingLiquidSdk_get_info_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>,
|
||||
>,
|
||||
req: impl CstDecode<crate::model::GetInfoRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "BindingLiquidSdk_get_info",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_that = that.cst_decode();
|
||||
let api_req = req.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::get_info(&api_that, api_req)
|
||||
})())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>,
|
||||
>,
|
||||
req: impl CstDecode<crate::model::PrepareReceiveRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "BindingLiquidSdk_prepare_receive_payment",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_that = that.cst_decode();
|
||||
let api_req = req.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::prepare_receive_payment(&api_that, api_req)
|
||||
})())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_prepare_send_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>,
|
||||
>,
|
||||
req: impl CstDecode<crate::model::PrepareSendRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "BindingLiquidSdk_prepare_send_payment",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_that = that.cst_decode();
|
||||
let api_req = req.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::prepare_send_payment(&api_that, api_req)
|
||||
})())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_receive_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>,
|
||||
>,
|
||||
req: impl CstDecode<crate::model::PrepareReceiveResponse>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "BindingLiquidSdk_receive_payment",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_that = that.cst_decode();
|
||||
let api_req = req.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::receive_payment(&api_that, api_req)
|
||||
})())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_restore_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>,
|
||||
>,
|
||||
req: impl CstDecode<crate::model::RestoreRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "BindingLiquidSdk_restore",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_that = that.cst_decode();
|
||||
let api_req = req.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::restore(&api_that, api_req)
|
||||
})())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_send_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>,
|
||||
>,
|
||||
req: impl CstDecode<crate::model::PrepareSendResponse>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "BindingLiquidSdk_send_payment",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_that = that.cst_decode();
|
||||
let api_req = req.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::send_payment(&api_that, api_req)
|
||||
})())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__connect_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
req: impl CstDecode<crate::model::ConnectRequest>,
|
||||
) {
|
||||
@@ -65,130 +321,6 @@ fn wire_connect_impl(
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire_empty_wallet_cache_impl(port_: flutter_rust_bridge::for_generated::MessagePort) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "empty_wallet_cache",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
move |context| transform_result_dco((move || crate::bindings::empty_wallet_cache())())
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire_get_info_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
req: impl CstDecode<crate::model::GetInfoRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "get_info",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_req = req.cst_decode();
|
||||
move |context| transform_result_dco((move || crate::bindings::get_info(api_req))())
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire_list_payments_impl(port_: flutter_rust_bridge::for_generated::MessagePort) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "list_payments",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || move |context| transform_result_dco((move || crate::bindings::list_payments())()),
|
||||
)
|
||||
}
|
||||
fn wire_prepare_receive_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
req: impl CstDecode<crate::model::PrepareReceiveRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "prepare_receive_payment",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_req = req.cst_decode();
|
||||
move |context| {
|
||||
transform_result_dco((move || crate::bindings::prepare_receive_payment(api_req))())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire_prepare_send_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
req: impl CstDecode<crate::model::PrepareSendRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "prepare_send_payment",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_req = req.cst_decode();
|
||||
move |context| {
|
||||
transform_result_dco((move || crate::bindings::prepare_send_payment(api_req))())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire_receive_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
req: impl CstDecode<crate::model::PrepareReceiveResponse>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "receive_payment",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_req = req.cst_decode();
|
||||
move |context| {
|
||||
transform_result_dco((move || crate::bindings::receive_payment(api_req))())
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire_restore_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
req: impl CstDecode<crate::model::RestoreRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "restore",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_req = req.cst_decode();
|
||||
move |context| transform_result_dco((move || crate::bindings::restore(api_req))())
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire_send_payment_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
req: impl CstDecode<crate::model::PrepareSendResponse>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::DcoCodec, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "send_payment",
|
||||
port: Some(port_),
|
||||
mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
|
||||
},
|
||||
move || {
|
||||
let api_req = req.cst_decode();
|
||||
move |context| transform_result_dco((move || crate::bindings::send_payment(api_req))())
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
// Section: dart2rust
|
||||
|
||||
@@ -214,34 +346,6 @@ 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 {
|
||||
@@ -254,10 +358,29 @@ impl CstDecode<u8> for u8 {
|
||||
self
|
||||
}
|
||||
}
|
||||
impl SseDecode for flutter_rust_bridge::for_generated::anyhow::Error {
|
||||
impl CstDecode<usize> for usize {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> usize {
|
||||
self
|
||||
}
|
||||
}
|
||||
impl SseDecode for BindingLiquidSdk {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
unreachable!("");
|
||||
let mut inner = <RustOpaqueNom<
|
||||
flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>,
|
||||
>>::sse_decode(deserializer);
|
||||
return inner.rust_auto_opaque_decode_owned();
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode
|
||||
for RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>
|
||||
{
|
||||
// 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 = <usize>::sse_decode(deserializer);
|
||||
return unsafe { decode_rust_opaque_nom(inner) };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,13 +427,9 @@ 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,
|
||||
};
|
||||
}
|
||||
@@ -323,15 +442,19 @@ impl SseDecode for i32 {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Vec<crate::model::Payment> {
|
||||
impl SseDecode for crate::error::LiquidSdkError {
|
||||
// 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));
|
||||
let mut tag_ = <i32>::sse_decode(deserializer);
|
||||
match tag_ {
|
||||
0 => {
|
||||
let mut var_err = <String>::sse_decode(deserializer);
|
||||
return crate::error::LiquidSdkError::Generic { err: var_err };
|
||||
}
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
}
|
||||
return ans_;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,39 +493,6 @@ 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 {
|
||||
@@ -442,10 +532,10 @@ impl SseDecode for crate::error::PaymentError {
|
||||
}
|
||||
10 => {
|
||||
let mut var_err = <String>::sse_decode(deserializer);
|
||||
let mut var_refundTxId = <String>::sse_decode(deserializer);
|
||||
let mut var_txid = <String>::sse_decode(deserializer);
|
||||
return crate::error::PaymentError::Refunded {
|
||||
err: var_err,
|
||||
refund_tx_id: var_refundTxId,
|
||||
txid: var_txid,
|
||||
};
|
||||
}
|
||||
11 => {
|
||||
@@ -463,32 +553,6 @@ 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 {
|
||||
@@ -563,13 +627,6 @@ 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 {
|
||||
@@ -589,6 +646,13 @@ impl SseDecode for () {
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {}
|
||||
}
|
||||
|
||||
impl SseDecode for usize {
|
||||
// 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_u64::<NativeEndian>().unwrap() as _
|
||||
}
|
||||
}
|
||||
|
||||
fn pde_ffi_dispatcher_primary_impl(
|
||||
func_id: i32,
|
||||
port: flutter_rust_bridge::for_generated::MessagePort,
|
||||
@@ -616,6 +680,21 @@ fn pde_ffi_dispatcher_sync_impl(
|
||||
|
||||
// Section: rust2dart
|
||||
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for FrbWrapper<BindingLiquidSdk> {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0)
|
||||
.into_dart()
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for FrbWrapper<BindingLiquidSdk> {}
|
||||
|
||||
impl flutter_rust_bridge::IntoIntoDart<FrbWrapper<BindingLiquidSdk>> for BindingLiquidSdk {
|
||||
fn into_into_dart(self) -> FrbWrapper<BindingLiquidSdk> {
|
||||
self.into()
|
||||
}
|
||||
}
|
||||
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::model::ConnectRequest {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
@@ -654,8 +733,6 @@ 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()
|
||||
@@ -670,6 +747,24 @@ impl flutter_rust_bridge::IntoIntoDart<crate::model::GetInfoResponse>
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::error::LiquidSdkError {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
match self {
|
||||
crate::error::LiquidSdkError::Generic { err } => {
|
||||
[0.into_dart(), err.into_into_dart().into_dart()].into_dart()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive for crate::error::LiquidSdkError {}
|
||||
impl flutter_rust_bridge::IntoIntoDart<crate::error::LiquidSdkError>
|
||||
for crate::error::LiquidSdkError
|
||||
{
|
||||
fn into_into_dart(self) -> crate::error::LiquidSdkError {
|
||||
self
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::model::Network {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
match self {
|
||||
@@ -685,27 +780,6 @@ 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 {
|
||||
@@ -723,10 +797,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, refund_tx_id } => [
|
||||
crate::error::PaymentError::Refunded { err, txid } => [
|
||||
10.into_dart(),
|
||||
err.into_into_dart().into_dart(),
|
||||
refund_tx_id.into_into_dart().into_dart(),
|
||||
txid.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart(),
|
||||
crate::error::PaymentError::SendError { err } => {
|
||||
@@ -745,38 +819,6 @@ 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()
|
||||
@@ -905,10 +947,21 @@ impl flutter_rust_bridge::IntoIntoDart<crate::model::SendPaymentResponse>
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for flutter_rust_bridge::for_generated::anyhow::Error {
|
||||
impl SseEncode for BindingLiquidSdk {
|
||||
// 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(format!("{:?}", self), serializer);
|
||||
<RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer);
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode
|
||||
for RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>
|
||||
{
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
let (ptr, size) = self.sse_encode_raw();
|
||||
<usize>::sse_encode(ptr, serializer);
|
||||
<i32>::sse_encode(size, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -946,8 +999,6 @@ 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);
|
||||
}
|
||||
}
|
||||
@@ -959,12 +1010,14 @@ impl SseEncode for i32 {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Vec<crate::model::Payment> {
|
||||
impl SseEncode for crate::error::LiquidSdkError {
|
||||
// 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);
|
||||
match self {
|
||||
crate::error::LiquidSdkError::Generic { err } => {
|
||||
<i32>::sse_encode(0, serializer);
|
||||
<String>::sse_encode(err, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1005,29 +1058,6 @@ 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) {
|
||||
@@ -1064,10 +1094,10 @@ impl SseEncode for crate::error::PaymentError {
|
||||
crate::error::PaymentError::PersistError => {
|
||||
<i32>::sse_encode(9, serializer);
|
||||
}
|
||||
crate::error::PaymentError::Refunded { err, refund_tx_id } => {
|
||||
crate::error::PaymentError::Refunded { err, txid } => {
|
||||
<i32>::sse_encode(10, serializer);
|
||||
<String>::sse_encode(err, serializer);
|
||||
<String>::sse_encode(refund_tx_id, serializer);
|
||||
<String>::sse_encode(txid, serializer);
|
||||
}
|
||||
crate::error::PaymentError::SendError { err } => {
|
||||
<i32>::sse_encode(11, serializer);
|
||||
@@ -1081,40 +1111,6 @@ 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) {
|
||||
@@ -1167,13 +1163,6 @@ 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) {
|
||||
@@ -1193,6 +1182,16 @@ impl SseEncode for () {
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {}
|
||||
}
|
||||
|
||||
impl SseEncode for usize {
|
||||
// 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_u64::<NativeEndian>(self as _)
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
#[path = "bridge.io.rs"]
|
||||
mod io;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.35.
|
||||
|
||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||
|
||||
@@ -8,29 +8,42 @@ import 'frb_generated.dart';
|
||||
import 'model.dart';
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
|
||||
Future<void> connect({required ConnectRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.connect(req: req, hint: hint);
|
||||
Future<BindingLiquidSdk> connect({required ConnectRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.crateBindingsConnect(req: req, hint: hint);
|
||||
|
||||
Future<GetInfoResponse> getInfo({required GetInfoRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.getInfo(req: req, hint: hint);
|
||||
// Rust type: RustOpaqueNom<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<BindingLiquidSdk>>
|
||||
@sealed
|
||||
class BindingLiquidSdk extends RustOpaque {
|
||||
BindingLiquidSdk.dcoDecode(List<dynamic> wire) : super.dcoDecode(wire, _kStaticData);
|
||||
|
||||
Future<PrepareSendResponse> prepareSendPayment({required PrepareSendRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.prepareSendPayment(req: req, hint: hint);
|
||||
BindingLiquidSdk.sseDecode(int ptr, int externalSizeOnNative)
|
||||
: super.sseDecode(ptr, externalSizeOnNative, _kStaticData);
|
||||
|
||||
Future<SendPaymentResponse> sendPayment({required PrepareSendResponse req, dynamic hint}) =>
|
||||
RustLib.instance.api.sendPayment(req: req, hint: hint);
|
||||
static final _kStaticData = RustArcStaticData(
|
||||
rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_BindingLiquidSdk,
|
||||
rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_BindingLiquidSdk,
|
||||
rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_BindingLiquidSdkPtr,
|
||||
);
|
||||
|
||||
Future<PrepareReceiveResponse> prepareReceivePayment({required PrepareReceiveRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.prepareReceivePayment(req: req, hint: hint);
|
||||
Future<void> backup({dynamic hint}) =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkBackup(that: this, hint: hint);
|
||||
|
||||
Future<ReceivePaymentResponse> receivePayment({required PrepareReceiveResponse req, dynamic hint}) =>
|
||||
RustLib.instance.api.receivePayment(req: req, hint: hint);
|
||||
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.listPayments(hint: hint);
|
||||
Future<PrepareReceiveResponse> prepareReceivePayment({required PrepareReceiveRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api
|
||||
.crateBindingsBindingLiquidSdkPrepareReceivePayment(that: this, req: req, hint: hint);
|
||||
|
||||
Future<void> emptyWalletCache({dynamic hint}) => RustLib.instance.api.emptyWalletCache(hint: hint);
|
||||
Future<PrepareSendResponse> prepareSendPayment({required PrepareSendRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkPrepareSendPayment(that: this, req: req, hint: hint);
|
||||
|
||||
Future<void> backup({dynamic hint}) => RustLib.instance.api.backup(hint: hint);
|
||||
Future<ReceivePaymentResponse> receivePayment({required PrepareReceiveResponse req, dynamic hint}) =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkReceivePayment(that: this, req: req, hint: hint);
|
||||
|
||||
Future<void> restore({required RestoreRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.restore(req: req, hint: hint);
|
||||
Future<void> restore({required RestoreRequest req, dynamic hint}) =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkRestore(that: this, req: req, hint: hint);
|
||||
|
||||
Future<SendPaymentResponse> sendPayment({required PrepareSendResponse req, dynamic hint}) =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkSendPayment(that: this, req: req, hint: hint);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.35.
|
||||
|
||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||
|
||||
@@ -8,6 +8,15 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
|
||||
part 'error.freezed.dart';
|
||||
|
||||
@freezed
|
||||
sealed class LiquidSdkError with _$LiquidSdkError implements FrbException {
|
||||
const LiquidSdkError._();
|
||||
|
||||
const factory LiquidSdkError.generic({
|
||||
required String err,
|
||||
}) = LiquidSdkError_Generic;
|
||||
}
|
||||
|
||||
@freezed
|
||||
sealed class PaymentError with _$PaymentError implements FrbException {
|
||||
const PaymentError._();
|
||||
|
||||
@@ -14,6 +14,121 @@ T _$identity<T>(T value) => value;
|
||||
final _privateConstructorUsedError = UnsupportedError(
|
||||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LiquidSdkError {
|
||||
String get err => throw _privateConstructorUsedError;
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
$LiquidSdkErrorCopyWith<LiquidSdkError> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $LiquidSdkErrorCopyWith<$Res> {
|
||||
factory $LiquidSdkErrorCopyWith(LiquidSdkError value, $Res Function(LiquidSdkError) then) =
|
||||
_$LiquidSdkErrorCopyWithImpl<$Res, LiquidSdkError>;
|
||||
@useResult
|
||||
$Res call({String err});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$LiquidSdkErrorCopyWithImpl<$Res, $Val extends LiquidSdkError>
|
||||
implements $LiquidSdkErrorCopyWith<$Res> {
|
||||
_$LiquidSdkErrorCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? err = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
err: null == err
|
||||
? _value.err
|
||||
: err // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$LiquidSdkError_GenericImplCopyWith<$Res> implements $LiquidSdkErrorCopyWith<$Res> {
|
||||
factory _$$LiquidSdkError_GenericImplCopyWith(
|
||||
_$LiquidSdkError_GenericImpl value, $Res Function(_$LiquidSdkError_GenericImpl) then) =
|
||||
__$$LiquidSdkError_GenericImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String err});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$LiquidSdkError_GenericImplCopyWithImpl<$Res>
|
||||
extends _$LiquidSdkErrorCopyWithImpl<$Res, _$LiquidSdkError_GenericImpl>
|
||||
implements _$$LiquidSdkError_GenericImplCopyWith<$Res> {
|
||||
__$$LiquidSdkError_GenericImplCopyWithImpl(
|
||||
_$LiquidSdkError_GenericImpl _value, $Res Function(_$LiquidSdkError_GenericImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? err = null,
|
||||
}) {
|
||||
return _then(_$LiquidSdkError_GenericImpl(
|
||||
err: null == err
|
||||
? _value.err
|
||||
: err // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$LiquidSdkError_GenericImpl extends LiquidSdkError_Generic {
|
||||
const _$LiquidSdkError_GenericImpl({required this.err}) : super._();
|
||||
|
||||
@override
|
||||
final String err;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LiquidSdkError.generic(err: $err)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$LiquidSdkError_GenericImpl &&
|
||||
(identical(other.err, err) || other.err == err));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, err);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$LiquidSdkError_GenericImplCopyWith<_$LiquidSdkError_GenericImpl> get copyWith =>
|
||||
__$$LiquidSdkError_GenericImplCopyWithImpl<_$LiquidSdkError_GenericImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class LiquidSdkError_Generic extends LiquidSdkError {
|
||||
const factory LiquidSdkError_Generic({required final String err}) = _$LiquidSdkError_GenericImpl;
|
||||
const LiquidSdkError_Generic._() : super._();
|
||||
|
||||
@override
|
||||
String get err;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$LiquidSdkError_GenericImplCopyWith<_$LiquidSdkError_GenericImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$PaymentError {}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.35.
|
||||
|
||||
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
||||
|
||||
@@ -50,10 +50,10 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
||||
ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig => kDefaultExternalLibraryLoaderConfig;
|
||||
|
||||
@override
|
||||
String get codegenVersion => '2.0.0-dev.33';
|
||||
String get codegenVersion => '2.0.0-dev.35';
|
||||
|
||||
@override
|
||||
int get rustContentHash => -451265040;
|
||||
int get rustContentHash => -855974711;
|
||||
|
||||
static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig(
|
||||
stem: 'breez_liquid_sdk',
|
||||
@@ -63,25 +63,33 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
||||
}
|
||||
|
||||
abstract class RustLibApi extends BaseApi {
|
||||
Future<void> backup({dynamic hint});
|
||||
Future<void> crateBindingsBindingLiquidSdkBackup({required BindingLiquidSdk that, dynamic hint});
|
||||
|
||||
Future<void> connect({required ConnectRequest req, dynamic hint});
|
||||
Future<GetInfoResponse> crateBindingsBindingLiquidSdkGetInfo(
|
||||
{required BindingLiquidSdk that, required GetInfoRequest req, dynamic hint});
|
||||
|
||||
Future<void> emptyWalletCache({dynamic hint});
|
||||
Future<PrepareReceiveResponse> crateBindingsBindingLiquidSdkPrepareReceivePayment(
|
||||
{required BindingLiquidSdk that, required PrepareReceiveRequest req, dynamic hint});
|
||||
|
||||
Future<GetInfoResponse> getInfo({required GetInfoRequest req, dynamic hint});
|
||||
Future<PrepareSendResponse> crateBindingsBindingLiquidSdkPrepareSendPayment(
|
||||
{required BindingLiquidSdk that, required PrepareSendRequest req, dynamic hint});
|
||||
|
||||
Future<List<Payment>> listPayments({dynamic hint});
|
||||
Future<ReceivePaymentResponse> crateBindingsBindingLiquidSdkReceivePayment(
|
||||
{required BindingLiquidSdk that, required PrepareReceiveResponse req, dynamic hint});
|
||||
|
||||
Future<PrepareReceiveResponse> prepareReceivePayment({required PrepareReceiveRequest req, dynamic hint});
|
||||
Future<void> crateBindingsBindingLiquidSdkRestore(
|
||||
{required BindingLiquidSdk that, required RestoreRequest req, dynamic hint});
|
||||
|
||||
Future<PrepareSendResponse> prepareSendPayment({required PrepareSendRequest req, dynamic hint});
|
||||
Future<SendPaymentResponse> crateBindingsBindingLiquidSdkSendPayment(
|
||||
{required BindingLiquidSdk that, required PrepareSendResponse req, dynamic hint});
|
||||
|
||||
Future<ReceivePaymentResponse> receivePayment({required PrepareReceiveResponse req, dynamic hint});
|
||||
Future<BindingLiquidSdk> crateBindingsConnect({required ConnectRequest req, dynamic hint});
|
||||
|
||||
Future<void> restore({required RestoreRequest req, dynamic hint});
|
||||
RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_BindingLiquidSdk;
|
||||
|
||||
Future<SendPaymentResponse> sendPayment({required PrepareSendResponse req, dynamic hint});
|
||||
RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_BindingLiquidSdk;
|
||||
|
||||
CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BindingLiquidSdkPtr;
|
||||
}
|
||||
|
||||
class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
@@ -93,236 +101,243 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
});
|
||||
|
||||
@override
|
||||
Future<void> backup({dynamic hint}) {
|
||||
Future<void> crateBindingsBindingLiquidSdkBackup({required BindingLiquidSdk that, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
return wire.wire_backup(port_);
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_backup(port_, arg0);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_unit,
|
||||
decodeErrorData: dco_decode_AnyhowException,
|
||||
decodeErrorData: dco_decode_liquid_sdk_error,
|
||||
),
|
||||
constMeta: kBackupConstMeta,
|
||||
argValues: [],
|
||||
constMeta: kCrateBindingsBindingLiquidSdkBackupConstMeta,
|
||||
argValues: [that],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kBackupConstMeta => const TaskConstMeta(
|
||||
debugName: "backup",
|
||||
argNames: [],
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkBackupConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_backup",
|
||||
argNames: ["that"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> connect({required ConnectRequest req, dynamic hint}) {
|
||||
Future<GetInfoResponse> crateBindingsBindingLiquidSdkGetInfo(
|
||||
{required BindingLiquidSdk that, required GetInfoRequest req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 = cst_encode_box_autoadd_connect_request(req);
|
||||
return wire.wire_connect(port_, arg0);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_unit,
|
||||
decodeErrorData: dco_decode_AnyhowException,
|
||||
),
|
||||
constMeta: kConnectConstMeta,
|
||||
argValues: [req],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kConnectConstMeta => const TaskConstMeta(
|
||||
debugName: "connect",
|
||||
argNames: ["req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> emptyWalletCache({dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
return wire.wire_empty_wallet_cache(port_);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_unit,
|
||||
decodeErrorData: dco_decode_AnyhowException,
|
||||
),
|
||||
constMeta: kEmptyWalletCacheConstMeta,
|
||||
argValues: [],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kEmptyWalletCacheConstMeta => const TaskConstMeta(
|
||||
debugName: "empty_wallet_cache",
|
||||
argNames: [],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<GetInfoResponse> getInfo({required GetInfoRequest req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 = cst_encode_box_autoadd_get_info_request(req);
|
||||
return wire.wire_get_info(port_, arg0);
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
var arg1 = cst_encode_box_autoadd_get_info_request(req);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_get_info(port_, arg0, arg1);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_get_info_response,
|
||||
decodeErrorData: dco_decode_AnyhowException,
|
||||
decodeErrorData: dco_decode_liquid_sdk_error,
|
||||
),
|
||||
constMeta: kGetInfoConstMeta,
|
||||
argValues: [req],
|
||||
constMeta: kCrateBindingsBindingLiquidSdkGetInfoConstMeta,
|
||||
argValues: [that, req],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kGetInfoConstMeta => const TaskConstMeta(
|
||||
debugName: "get_info",
|
||||
argNames: ["req"],
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkGetInfoConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_get_info",
|
||||
argNames: ["that", "req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<List<Payment>> listPayments({dynamic hint}) {
|
||||
Future<PrepareReceiveResponse> crateBindingsBindingLiquidSdkPrepareReceivePayment(
|
||||
{required BindingLiquidSdk that, required PrepareReceiveRequest req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
return wire.wire_list_payments(port_);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_list_payment,
|
||||
decodeErrorData: dco_decode_AnyhowException,
|
||||
),
|
||||
constMeta: kListPaymentsConstMeta,
|
||||
argValues: [],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kListPaymentsConstMeta => const TaskConstMeta(
|
||||
debugName: "list_payments",
|
||||
argNames: [],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<PrepareReceiveResponse> prepareReceivePayment({required PrepareReceiveRequest req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 = cst_encode_box_autoadd_prepare_receive_request(req);
|
||||
return wire.wire_prepare_receive_payment(port_, arg0);
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
var arg1 = cst_encode_box_autoadd_prepare_receive_request(req);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(port_, arg0, arg1);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_prepare_receive_response,
|
||||
decodeErrorData: dco_decode_payment_error,
|
||||
),
|
||||
constMeta: kPrepareReceivePaymentConstMeta,
|
||||
argValues: [req],
|
||||
constMeta: kCrateBindingsBindingLiquidSdkPrepareReceivePaymentConstMeta,
|
||||
argValues: [that, req],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kPrepareReceivePaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "prepare_receive_payment",
|
||||
argNames: ["req"],
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkPrepareReceivePaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_prepare_receive_payment",
|
||||
argNames: ["that", "req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<PrepareSendResponse> prepareSendPayment({required PrepareSendRequest req, dynamic hint}) {
|
||||
Future<PrepareSendResponse> crateBindingsBindingLiquidSdkPrepareSendPayment(
|
||||
{required BindingLiquidSdk that, required PrepareSendRequest req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 = cst_encode_box_autoadd_prepare_send_request(req);
|
||||
return wire.wire_prepare_send_payment(port_, arg0);
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
var arg1 = cst_encode_box_autoadd_prepare_send_request(req);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(port_, arg0, arg1);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_prepare_send_response,
|
||||
decodeErrorData: dco_decode_payment_error,
|
||||
),
|
||||
constMeta: kPrepareSendPaymentConstMeta,
|
||||
argValues: [req],
|
||||
constMeta: kCrateBindingsBindingLiquidSdkPrepareSendPaymentConstMeta,
|
||||
argValues: [that, req],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kPrepareSendPaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "prepare_send_payment",
|
||||
argNames: ["req"],
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkPrepareSendPaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_prepare_send_payment",
|
||||
argNames: ["that", "req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<ReceivePaymentResponse> receivePayment({required PrepareReceiveResponse req, dynamic hint}) {
|
||||
Future<ReceivePaymentResponse> crateBindingsBindingLiquidSdkReceivePayment(
|
||||
{required BindingLiquidSdk that, required PrepareReceiveResponse req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 = cst_encode_box_autoadd_prepare_receive_response(req);
|
||||
return wire.wire_receive_payment(port_, arg0);
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
var arg1 = cst_encode_box_autoadd_prepare_receive_response(req);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_receive_payment(port_, arg0, arg1);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_receive_payment_response,
|
||||
decodeErrorData: dco_decode_payment_error,
|
||||
),
|
||||
constMeta: kReceivePaymentConstMeta,
|
||||
argValues: [req],
|
||||
constMeta: kCrateBindingsBindingLiquidSdkReceivePaymentConstMeta,
|
||||
argValues: [that, req],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kReceivePaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "receive_payment",
|
||||
argNames: ["req"],
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkReceivePaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_receive_payment",
|
||||
argNames: ["that", "req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> restore({required RestoreRequest req, dynamic hint}) {
|
||||
Future<void> crateBindingsBindingLiquidSdkRestore(
|
||||
{required BindingLiquidSdk that, required RestoreRequest req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 = cst_encode_box_autoadd_restore_request(req);
|
||||
return wire.wire_restore(port_, arg0);
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
var arg1 = cst_encode_box_autoadd_restore_request(req);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_restore(port_, arg0, arg1);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_unit,
|
||||
decodeErrorData: dco_decode_AnyhowException,
|
||||
decodeErrorData: dco_decode_liquid_sdk_error,
|
||||
),
|
||||
constMeta: kRestoreConstMeta,
|
||||
argValues: [req],
|
||||
constMeta: kCrateBindingsBindingLiquidSdkRestoreConstMeta,
|
||||
argValues: [that, req],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kRestoreConstMeta => const TaskConstMeta(
|
||||
debugName: "restore",
|
||||
argNames: ["req"],
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkRestoreConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_restore",
|
||||
argNames: ["that", "req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<SendPaymentResponse> sendPayment({required PrepareSendResponse req, dynamic hint}) {
|
||||
Future<SendPaymentResponse> crateBindingsBindingLiquidSdkSendPayment(
|
||||
{required BindingLiquidSdk that, required PrepareSendResponse req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 = cst_encode_box_autoadd_prepare_send_response(req);
|
||||
return wire.wire_send_payment(port_, arg0);
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
var arg1 = cst_encode_box_autoadd_prepare_send_response(req);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_send_payment(port_, arg0, arg1);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_send_payment_response,
|
||||
decodeErrorData: dco_decode_payment_error,
|
||||
),
|
||||
constMeta: kSendPaymentConstMeta,
|
||||
constMeta: kCrateBindingsBindingLiquidSdkSendPaymentConstMeta,
|
||||
argValues: [that, req],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkSendPaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_send_payment",
|
||||
argNames: ["that", "req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<BindingLiquidSdk> crateBindingsConnect({required ConnectRequest req, dynamic hint}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 = cst_encode_box_autoadd_connect_request(req);
|
||||
return wire.wire__crate__bindings__connect(port_, arg0);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData:
|
||||
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk,
|
||||
decodeErrorData: dco_decode_liquid_sdk_error,
|
||||
),
|
||||
constMeta: kCrateBindingsConnectConstMeta,
|
||||
argValues: [req],
|
||||
apiImpl: this,
|
||||
hint: hint,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kSendPaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "send_payment",
|
||||
TaskConstMeta get kCrateBindingsConnectConstMeta => const TaskConstMeta(
|
||||
debugName: "connect",
|
||||
argNames: ["req"],
|
||||
);
|
||||
|
||||
RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_BindingLiquidSdk => wire
|
||||
.rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk;
|
||||
|
||||
RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_BindingLiquidSdk => wire
|
||||
.rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk;
|
||||
|
||||
@protected
|
||||
AnyhowException dco_decode_AnyhowException(dynamic raw) {
|
||||
BindingLiquidSdk
|
||||
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return AnyhowException(raw as String);
|
||||
return BindingLiquidSdk.dcoDecode(raw as List<dynamic>);
|
||||
}
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk
|
||||
dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return BindingLiquidSdk.dcoDecode(raw as List<dynamic>);
|
||||
}
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return BindingLiquidSdk.dcoDecode(raw as List<dynamic>);
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -379,12 +394,6 @@ 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
|
||||
@@ -411,12 +420,10 @@ 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 != 4) throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
|
||||
if (arr.length != 2) throw Exception('unexpected arr length: expect 2 but see ${arr.length}');
|
||||
return GetInfoResponse(
|
||||
balanceSat: dco_decode_u_64(arr[0]),
|
||||
pendingSendSat: dco_decode_u_64(arr[1]),
|
||||
pendingReceiveSat: dco_decode_u_64(arr[2]),
|
||||
pubkey: dco_decode_String(arr[3]),
|
||||
pubkey: dco_decode_String(arr[1]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -427,9 +434,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
|
||||
@protected
|
||||
List<Payment> dco_decode_list_payment(dynamic raw) {
|
||||
LiquidSdkError dco_decode_liquid_sdk_error(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return (raw as List<dynamic>).map(dco_decode_payment).toList();
|
||||
switch (raw[0]) {
|
||||
case 0:
|
||||
return LiquidSdkError_Generic(
|
||||
err: dco_decode_String(raw[1]),
|
||||
);
|
||||
default:
|
||||
throw Exception("unreachable");
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -450,28 +464,6 @@ 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
|
||||
@@ -503,7 +495,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
case 10:
|
||||
return PaymentError_Refunded(
|
||||
err: dco_decode_String(raw[1]),
|
||||
refundTxId: dco_decode_String(raw[2]),
|
||||
txid: dco_decode_String(raw[2]),
|
||||
);
|
||||
case 11:
|
||||
return PaymentError_SendError(
|
||||
@@ -518,18 +510,6 @@ 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
|
||||
@@ -603,12 +583,6 @@ 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
|
||||
@@ -628,10 +602,32 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
|
||||
@protected
|
||||
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
|
||||
int dco_decode_usize(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return dcoDecodeI64OrU64(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk
|
||||
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
var inner = sse_decode_String(deserializer);
|
||||
return AnyhowException(inner);
|
||||
return BindingLiquidSdk.sseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk
|
||||
sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return BindingLiquidSdk.sseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return BindingLiquidSdk.sseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -689,12 +685,6 @@ 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
|
||||
@@ -715,14 +705,8 @@ 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,
|
||||
pendingSendSat: var_pendingSendSat,
|
||||
pendingReceiveSat: var_pendingReceiveSat,
|
||||
pubkey: var_pubkey);
|
||||
return GetInfoResponse(balanceSat: var_balanceSat, pubkey: var_pubkey);
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -732,15 +716,17 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
|
||||
@protected
|
||||
List<Payment> sse_decode_list_payment(SseDeserializer deserializer) {
|
||||
LiquidSdkError sse_decode_liquid_sdk_error(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));
|
||||
var tag_ = sse_decode_i_32(deserializer);
|
||||
switch (tag_) {
|
||||
case 0:
|
||||
var var_err = sse_decode_String(deserializer);
|
||||
return LiquidSdkError_Generic(err: var_err);
|
||||
default:
|
||||
throw UnimplementedError('');
|
||||
}
|
||||
return ans_;
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -768,37 +754,6 @@ 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
|
||||
@@ -829,8 +784,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return PaymentError_PersistError();
|
||||
case 10:
|
||||
var var_err = sse_decode_String(deserializer);
|
||||
var var_refundTxId = sse_decode_String(deserializer);
|
||||
return PaymentError_Refunded(err: var_err, refundTxId: var_refundTxId);
|
||||
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);
|
||||
return PaymentError_SendError(err: var_err);
|
||||
@@ -842,20 +797,6 @@ 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
|
||||
@@ -908,12 +849,6 @@ 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
|
||||
@@ -931,6 +866,36 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
// 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_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk 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_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
// ignore: invalid_use_of_internal_member
|
||||
return raw.cstEncode(move: false);
|
||||
}
|
||||
|
||||
@protected
|
||||
int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
// ignore: invalid_use_of_internal_member
|
||||
return raw.cstEncode();
|
||||
}
|
||||
|
||||
@protected
|
||||
bool cst_encode_bool(bool raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
@@ -949,24 +914,6 @@ 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
|
||||
@@ -980,9 +927,30 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_AnyhowException(AnyhowException self, SseSerializer serializer) {
|
||||
int cst_encode_usize(int raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
return raw;
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
throw UnimplementedError('Unreachable ()');
|
||||
sse_encode_usize(self.sseEncode(move: true), serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_usize(self.sseEncode(move: false), serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_usize(self.sseEncode(move: null), serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -1040,12 +1008,6 @@ 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
|
||||
@@ -1064,8 +1026,6 @@ 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);
|
||||
}
|
||||
|
||||
@@ -1076,11 +1036,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_list_payment(List<Payment> self, SseSerializer serializer) {
|
||||
void sse_encode_liquid_sdk_error(LiquidSdkError 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);
|
||||
switch (self) {
|
||||
case LiquidSdkError_Generic(err: final err):
|
||||
sse_encode_i_32(0, serializer);
|
||||
sse_encode_String(err, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1107,28 +1068,6 @@ 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
|
||||
@@ -1155,10 +1094,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, refundTxId: final refundTxId):
|
||||
case PaymentError_Refunded(err: final err, txid: final txid):
|
||||
sse_encode_i_32(10, serializer);
|
||||
sse_encode_String(err, serializer);
|
||||
sse_encode_String(refundTxId, serializer);
|
||||
sse_encode_String(txid, serializer);
|
||||
case PaymentError_SendError(err: final err):
|
||||
sse_encode_i_32(11, serializer);
|
||||
sse_encode_String(err, serializer);
|
||||
@@ -1168,18 +1107,6 @@ 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
|
||||
@@ -1225,12 +1152,6 @@ 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
|
||||
@@ -1247,4 +1168,10 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
void sse_encode_unit(void self, SseSerializer serializer) {
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.35.
|
||||
|
||||
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
||||
|
||||
@@ -20,8 +20,22 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
required super.portManager,
|
||||
});
|
||||
|
||||
CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BindingLiquidSdkPtr => wire
|
||||
._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr;
|
||||
|
||||
@protected
|
||||
AnyhowException dco_decode_AnyhowException(dynamic raw);
|
||||
BindingLiquidSdk
|
||||
dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
dynamic raw);
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk
|
||||
dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
dynamic raw);
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
dynamic raw);
|
||||
|
||||
@protected
|
||||
String dco_decode_String(dynamic raw);
|
||||
@@ -50,9 +64,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
RestoreRequest dco_decode_box_autoadd_restore_request(dynamic raw);
|
||||
|
||||
@protected
|
||||
int dco_decode_box_autoadd_u_64(dynamic raw);
|
||||
|
||||
@protected
|
||||
ConnectRequest dco_decode_connect_request(dynamic raw);
|
||||
|
||||
@@ -66,7 +77,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
int dco_decode_i_32(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<Payment> dco_decode_list_payment(dynamic raw);
|
||||
LiquidSdkError dco_decode_liquid_sdk_error(dynamic raw);
|
||||
|
||||
@protected
|
||||
Uint8List dco_decode_list_prim_u_8_strict(dynamic raw);
|
||||
@@ -77,21 +88,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
String? dco_decode_opt_String(dynamic raw);
|
||||
|
||||
@protected
|
||||
int? dco_decode_opt_box_autoadd_u_64(dynamic raw);
|
||||
|
||||
@protected
|
||||
Payment dco_decode_payment(dynamic raw);
|
||||
|
||||
@protected
|
||||
PaymentError dco_decode_payment_error(dynamic raw);
|
||||
|
||||
@protected
|
||||
PaymentState dco_decode_payment_state(dynamic raw);
|
||||
|
||||
@protected
|
||||
PaymentType dco_decode_payment_type(dynamic raw);
|
||||
|
||||
@protected
|
||||
PrepareReceiveRequest dco_decode_prepare_receive_request(dynamic raw);
|
||||
|
||||
@@ -113,9 +112,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
SendPaymentResponse dco_decode_send_payment_response(dynamic raw);
|
||||
|
||||
@protected
|
||||
int dco_decode_u_32(dynamic raw);
|
||||
|
||||
@protected
|
||||
int dco_decode_u_64(dynamic raw);
|
||||
|
||||
@@ -126,7 +122,21 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
void dco_decode_unit(dynamic raw);
|
||||
|
||||
@protected
|
||||
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer);
|
||||
int dco_decode_usize(dynamic raw);
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk
|
||||
sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk
|
||||
sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
BindingLiquidSdk sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
String sse_decode_String(SseDeserializer deserializer);
|
||||
@@ -155,9 +165,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
RestoreRequest sse_decode_box_autoadd_restore_request(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
int sse_decode_box_autoadd_u_64(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ConnectRequest sse_decode_connect_request(SseDeserializer deserializer);
|
||||
|
||||
@@ -171,7 +178,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
int sse_decode_i_32(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
List<Payment> sse_decode_list_payment(SseDeserializer deserializer);
|
||||
LiquidSdkError sse_decode_liquid_sdk_error(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer);
|
||||
@@ -182,21 +189,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
String? sse_decode_opt_String(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
int? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
Payment sse_decode_payment(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
PaymentError sse_decode_payment_error(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
PaymentState sse_decode_payment_state(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
PaymentType sse_decode_payment_type(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
PrepareReceiveRequest sse_decode_prepare_receive_request(SseDeserializer deserializer);
|
||||
|
||||
@@ -218,9 +213,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
SendPaymentResponse sse_decode_send_payment_response(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
int sse_decode_u_32(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
int sse_decode_u_64(SseDeserializer deserializer);
|
||||
|
||||
@@ -231,10 +223,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
void sse_decode_unit(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_encode_AnyhowException(AnyhowException raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
throw UnimplementedError();
|
||||
}
|
||||
int sse_decode_usize(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_encode_String(String raw) {
|
||||
@@ -302,22 +291,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<ffi.Uint64> cst_encode_box_autoadd_u_64(int raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
return wire.cst_new_box_autoadd_u_64(cst_encode_u_64(raw));
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_payment> cst_encode_list_payment(List<Payment> raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
final ans = wire.cst_new_list_payment(raw.length);
|
||||
for (var i = 0; i < raw.length; ++i) {
|
||||
cst_api_fill_to_wire_payment(raw[i], ans.ref.ptr[i]);
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_encode_list_prim_u_8_strict(Uint8List raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
@@ -332,12 +305,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
return raw == null ? ffi.nullptr : cst_encode_String(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<ffi.Uint64> cst_encode_opt_box_autoadd_u_64(int? raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
return raw == null ? ffi.nullptr : cst_encode_box_autoadd_u_64(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
int cst_encode_u_64(int raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
@@ -401,20 +368,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void cst_api_fill_to_wire_get_info_response(GetInfoResponse apiObj, wire_cst_get_info_response wireObj) {
|
||||
wireObj.balance_sat = cst_encode_u_64(apiObj.balanceSat);
|
||||
wireObj.pending_send_sat = cst_encode_u_64(apiObj.pendingSendSat);
|
||||
wireObj.pending_receive_sat = cst_encode_u_64(apiObj.pendingReceiveSat);
|
||||
wireObj.pubkey = cst_encode_String(apiObj.pubkey);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_payment(Payment apiObj, wire_cst_payment wireObj) {
|
||||
wireObj.tx_id = cst_encode_String(apiObj.txId);
|
||||
wireObj.swap_id = cst_encode_opt_String(apiObj.swapId);
|
||||
wireObj.timestamp = cst_encode_u_32(apiObj.timestamp);
|
||||
wireObj.amount_sat = cst_encode_u_64(apiObj.amountSat);
|
||||
wireObj.fees_sat = cst_encode_opt_box_autoadd_u_64(apiObj.feesSat);
|
||||
wireObj.payment_type = cst_encode_payment_type(apiObj.paymentType);
|
||||
wireObj.status = cst_encode_payment_state(apiObj.status);
|
||||
void cst_api_fill_to_wire_liquid_sdk_error(LiquidSdkError apiObj, wire_cst_liquid_sdk_error wireObj) {
|
||||
if (apiObj is LiquidSdkError_Generic) {
|
||||
var pre_err = cst_encode_String(apiObj.err);
|
||||
wireObj.tag = 0;
|
||||
wireObj.kind.Generic.err = pre_err;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -465,10 +429,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
}
|
||||
if (apiObj is PaymentError_Refunded) {
|
||||
var pre_err = cst_encode_String(apiObj.err);
|
||||
var pre_refund_tx_id = cst_encode_String(apiObj.refundTxId);
|
||||
var pre_txid = cst_encode_String(apiObj.txid);
|
||||
wireObj.tag = 10;
|
||||
wireObj.kind.Refunded.err = pre_err;
|
||||
wireObj.kind.Refunded.refund_tx_id = pre_refund_tx_id;
|
||||
wireObj.kind.Refunded.txid = pre_txid;
|
||||
return;
|
||||
}
|
||||
if (apiObj is PaymentError_SendError) {
|
||||
@@ -529,6 +493,18 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
wireObj.txid = cst_encode_String(apiObj.txid);
|
||||
}
|
||||
|
||||
@protected
|
||||
int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk raw);
|
||||
|
||||
@protected
|
||||
int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk raw);
|
||||
|
||||
@protected
|
||||
int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk raw);
|
||||
|
||||
@protected
|
||||
bool cst_encode_bool(bool raw);
|
||||
|
||||
@@ -538,15 +514,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
int cst_encode_network(Network raw);
|
||||
|
||||
@protected
|
||||
int cst_encode_payment_state(PaymentState raw);
|
||||
|
||||
@protected
|
||||
int cst_encode_payment_type(PaymentType raw);
|
||||
|
||||
@protected
|
||||
int cst_encode_u_32(int raw);
|
||||
|
||||
@protected
|
||||
int cst_encode_u_8(int raw);
|
||||
|
||||
@@ -554,7 +521,19 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
void cst_encode_unit(void raw);
|
||||
|
||||
@protected
|
||||
void sse_encode_AnyhowException(AnyhowException self, SseSerializer serializer);
|
||||
int cst_encode_usize(int raw);
|
||||
|
||||
@protected
|
||||
void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
BindingLiquidSdk self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_String(String self, SseSerializer serializer);
|
||||
@@ -583,9 +562,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_box_autoadd_restore_request(RestoreRequest self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_u_64(int self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_connect_request(ConnectRequest self, SseSerializer serializer);
|
||||
|
||||
@@ -599,7 +575,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
void sse_encode_i_32(int self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_payment(List<Payment> self, SseSerializer serializer);
|
||||
void sse_encode_liquid_sdk_error(LiquidSdkError self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_prim_u_8_strict(Uint8List self, SseSerializer serializer);
|
||||
@@ -610,21 +586,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_opt_String(String? self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_u_64(int? self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_payment(Payment self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_payment_error(PaymentError self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_payment_state(PaymentState self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_payment_type(PaymentType self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_prepare_receive_request(PrepareReceiveRequest self, SseSerializer serializer);
|
||||
|
||||
@@ -646,9 +610,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_send_payment_response(SendPaymentResponse self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_u_32(int self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_u_64(int self, SseSerializer serializer);
|
||||
|
||||
@@ -657,6 +618,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
|
||||
@protected
|
||||
void sse_encode_unit(void self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_usize(int self, SseSerializer serializer);
|
||||
}
|
||||
|
||||
// Section: wire_class
|
||||
@@ -694,153 +658,189 @@ class RustLibWire implements BaseWire {
|
||||
late final _store_dart_post_cobject =
|
||||
_store_dart_post_cobjectPtr.asFunction<void Function(DartPostCObjectFnType)>();
|
||||
|
||||
void wire_backup(
|
||||
void wire__crate__bindings__BindingLiquidSdk_backup(
|
||||
int port_,
|
||||
int that,
|
||||
) {
|
||||
return _wire_backup(
|
||||
return _wire__crate__bindings__BindingLiquidSdk_backup(
|
||||
port_,
|
||||
that,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_backupPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>('frbgen_breez_liquid_wire_backup');
|
||||
late final _wire_backup = _wire_backupPtr.asFunction<void Function(int)>();
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_backupPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_backup =
|
||||
_wire__crate__bindings__BindingLiquidSdk_backupPtr.asFunction<void Function(int, int)>();
|
||||
|
||||
void wire_connect(
|
||||
void wire__crate__bindings__BindingLiquidSdk_get_info(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_get_info_request> req,
|
||||
) {
|
||||
return _wire__crate__bindings__BindingLiquidSdk_get_info(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_get_infoPtr = _lookup<
|
||||
ffi
|
||||
.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_get_info_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_get_info =
|
||||
_wire__crate__bindings__BindingLiquidSdk_get_infoPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_get_info_request>)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_prepare_receive_request> req,
|
||||
) {
|
||||
return _wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_prepare_receive_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_receive_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment =
|
||||
_wire__crate__bindings__BindingLiquidSdk_prepare_receive_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_receive_request>)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_prepare_send_request> req,
|
||||
) {
|
||||
return _wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_prepare_send_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_send_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_prepare_send_payment =
|
||||
_wire__crate__bindings__BindingLiquidSdk_prepare_send_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_send_request>)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_receive_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_prepare_receive_response> req,
|
||||
) {
|
||||
return _wire__crate__bindings__BindingLiquidSdk_receive_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_receive_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_receive_response>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_receive_payment =
|
||||
_wire__crate__bindings__BindingLiquidSdk_receive_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_receive_response>)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_restore(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_restore_request> req,
|
||||
) {
|
||||
return _wire__crate__bindings__BindingLiquidSdk_restore(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_restorePtr = _lookup<
|
||||
ffi
|
||||
.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_restore_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_restore =
|
||||
_wire__crate__bindings__BindingLiquidSdk_restorePtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_restore_request>)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_send_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_prepare_send_response> req,
|
||||
) {
|
||||
return _wire__crate__bindings__BindingLiquidSdk_send_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_send_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_send_response>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_send_payment =
|
||||
_wire__crate__bindings__BindingLiquidSdk_send_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_send_response>)>();
|
||||
|
||||
void wire__crate__bindings__connect(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_connect_request> req,
|
||||
) {
|
||||
return _wire_connect(
|
||||
return _wire__crate__bindings__connect(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_connectPtr =
|
||||
late final _wire__crate__bindings__connectPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_connect_request>)>>(
|
||||
'frbgen_breez_liquid_wire_connect');
|
||||
late final _wire_connect =
|
||||
_wire_connectPtr.asFunction<void Function(int, ffi.Pointer<wire_cst_connect_request>)>();
|
||||
'frbgen_breez_liquid_wire__crate__bindings__connect');
|
||||
late final _wire__crate__bindings__connect = _wire__crate__bindings__connectPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_connect_request>)>();
|
||||
|
||||
void wire_empty_wallet_cache(
|
||||
int port_,
|
||||
void
|
||||
rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ffi.Pointer<ffi.Void> ptr,
|
||||
) {
|
||||
return _wire_empty_wallet_cache(
|
||||
port_,
|
||||
return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ptr,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_empty_wallet_cachePtr = _lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
|
||||
'frbgen_breez_liquid_wire_empty_wallet_cache');
|
||||
late final _wire_empty_wallet_cache = _wire_empty_wallet_cachePtr.asFunction<void Function(int)>();
|
||||
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
|
||||
'frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk');
|
||||
late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk =
|
||||
_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr
|
||||
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
|
||||
|
||||
void wire_get_info(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_get_info_request> req,
|
||||
void
|
||||
rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ffi.Pointer<ffi.Void> ptr,
|
||||
) {
|
||||
return _wire_get_info(
|
||||
port_,
|
||||
req,
|
||||
return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ptr,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_get_infoPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_get_info_request>)>>(
|
||||
'frbgen_breez_liquid_wire_get_info');
|
||||
late final _wire_get_info =
|
||||
_wire_get_infoPtr.asFunction<void Function(int, ffi.Pointer<wire_cst_get_info_request>)>();
|
||||
|
||||
void wire_list_payments(
|
||||
int port_,
|
||||
) {
|
||||
return _wire_list_payments(
|
||||
port_,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_list_paymentsPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>('frbgen_breez_liquid_wire_list_payments');
|
||||
late final _wire_list_payments = _wire_list_paymentsPtr.asFunction<void Function(int)>();
|
||||
|
||||
void wire_prepare_receive_payment(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_prepare_receive_request> req,
|
||||
) {
|
||||
return _wire_prepare_receive_payment(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_prepare_receive_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_receive_request>)>>(
|
||||
'frbgen_breez_liquid_wire_prepare_receive_payment');
|
||||
late final _wire_prepare_receive_payment = _wire_prepare_receive_paymentPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_receive_request>)>();
|
||||
|
||||
void wire_prepare_send_payment(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_prepare_send_request> req,
|
||||
) {
|
||||
return _wire_prepare_send_payment(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_prepare_send_paymentPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_send_request>)>>(
|
||||
'frbgen_breez_liquid_wire_prepare_send_payment');
|
||||
late final _wire_prepare_send_payment = _wire_prepare_send_paymentPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_send_request>)>();
|
||||
|
||||
void wire_receive_payment(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_prepare_receive_response> req,
|
||||
) {
|
||||
return _wire_receive_payment(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_receive_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_receive_response>)>>(
|
||||
'frbgen_breez_liquid_wire_receive_payment');
|
||||
late final _wire_receive_payment = _wire_receive_paymentPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_receive_response>)>();
|
||||
|
||||
void wire_restore(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_restore_request> req,
|
||||
) {
|
||||
return _wire_restore(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_restorePtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_restore_request>)>>(
|
||||
'frbgen_breez_liquid_wire_restore');
|
||||
late final _wire_restore =
|
||||
_wire_restorePtr.asFunction<void Function(int, ffi.Pointer<wire_cst_restore_request>)>();
|
||||
|
||||
void wire_send_payment(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_prepare_send_response> req,
|
||||
) {
|
||||
return _wire_send_payment(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire_send_paymentPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_send_response>)>>(
|
||||
'frbgen_breez_liquid_wire_send_payment');
|
||||
late final _wire_send_payment =
|
||||
_wire_send_paymentPtr.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_send_response>)>();
|
||||
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
|
||||
'frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk');
|
||||
late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk =
|
||||
_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr
|
||||
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
|
||||
|
||||
ffi.Pointer<wire_cst_connect_request> cst_new_box_autoadd_connect_request() {
|
||||
return _cst_new_box_autoadd_connect_request();
|
||||
@@ -912,34 +912,6 @@ class RustLibWire implements BaseWire {
|
||||
late final _cst_new_box_autoadd_restore_request =
|
||||
_cst_new_box_autoadd_restore_requestPtr.asFunction<ffi.Pointer<wire_cst_restore_request> Function()>();
|
||||
|
||||
ffi.Pointer<ffi.Uint64> cst_new_box_autoadd_u_64(
|
||||
int value,
|
||||
) {
|
||||
return _cst_new_box_autoadd_u_64(
|
||||
value,
|
||||
);
|
||||
}
|
||||
|
||||
late final _cst_new_box_autoadd_u_64Ptr =
|
||||
_lookup<ffi.NativeFunction<ffi.Pointer<ffi.Uint64> Function(ffi.Uint64)>>(
|
||||
'frbgen_breez_liquid_cst_new_box_autoadd_u_64');
|
||||
late final _cst_new_box_autoadd_u_64 =
|
||||
_cst_new_box_autoadd_u_64Ptr.asFunction<ffi.Pointer<ffi.Uint64> Function(int)>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_payment> cst_new_list_payment(
|
||||
int len,
|
||||
) {
|
||||
return _cst_new_list_payment(
|
||||
len,
|
||||
);
|
||||
}
|
||||
|
||||
late final _cst_new_list_paymentPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Pointer<wire_cst_list_payment> Function(ffi.Int32)>>(
|
||||
'frbgen_breez_liquid_cst_new_list_payment');
|
||||
late final _cst_new_list_payment =
|
||||
_cst_new_list_paymentPtr.asFunction<ffi.Pointer<wire_cst_list_payment> Function(int)>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_prim_u_8_strict> cst_new_list_prim_u_8_strict(
|
||||
int len,
|
||||
) {
|
||||
@@ -971,22 +943,6 @@ typedef DartDartPostCObjectFnTypeFunction = bool Function(
|
||||
typedef DartPort = ffi.Int64;
|
||||
typedef DartDartPort = int;
|
||||
|
||||
final class wire_cst_list_prim_u_8_strict extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Uint8> ptr;
|
||||
|
||||
@ffi.Int32()
|
||||
external int len;
|
||||
}
|
||||
|
||||
final class wire_cst_connect_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> mnemonic;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> data_dir;
|
||||
|
||||
@ffi.Int32()
|
||||
external int network;
|
||||
}
|
||||
|
||||
final class wire_cst_get_info_request extends ffi.Struct {
|
||||
@ffi.Bool()
|
||||
external bool with_scan;
|
||||
@@ -997,6 +953,13 @@ final class wire_cst_prepare_receive_request extends ffi.Struct {
|
||||
external int payer_amount_sat;
|
||||
}
|
||||
|
||||
final class wire_cst_list_prim_u_8_strict extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Uint8> ptr;
|
||||
|
||||
@ffi.Int32()
|
||||
external int len;
|
||||
}
|
||||
|
||||
final class wire_cst_prepare_send_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> invoice;
|
||||
}
|
||||
@@ -1020,46 +983,37 @@ final class wire_cst_prepare_send_response extends ffi.Struct {
|
||||
external int fees_sat;
|
||||
}
|
||||
|
||||
final class wire_cst_payment extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> tx_id;
|
||||
final class wire_cst_connect_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> mnemonic;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> swap_id;
|
||||
|
||||
@ffi.Uint32()
|
||||
external int timestamp;
|
||||
|
||||
@ffi.Uint64()
|
||||
external int amount_sat;
|
||||
|
||||
external ffi.Pointer<ffi.Uint64> fees_sat;
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> data_dir;
|
||||
|
||||
@ffi.Int32()
|
||||
external int payment_type;
|
||||
|
||||
@ffi.Int32()
|
||||
external int status;
|
||||
}
|
||||
|
||||
final class wire_cst_list_payment extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_payment> ptr;
|
||||
|
||||
@ffi.Int32()
|
||||
external int len;
|
||||
external int network;
|
||||
}
|
||||
|
||||
final class wire_cst_get_info_response extends ffi.Struct {
|
||||
@ffi.Uint64()
|
||||
external int balance_sat;
|
||||
|
||||
@ffi.Uint64()
|
||||
external int pending_send_sat;
|
||||
|
||||
@ffi.Uint64()
|
||||
external int pending_receive_sat;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> pubkey;
|
||||
}
|
||||
|
||||
final class wire_cst_LiquidSdkError_Generic extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
|
||||
}
|
||||
|
||||
final class LiquidSdkErrorKind extends ffi.Union {
|
||||
external wire_cst_LiquidSdkError_Generic Generic;
|
||||
}
|
||||
|
||||
final class wire_cst_liquid_sdk_error extends ffi.Struct {
|
||||
@ffi.Int32()
|
||||
external int tag;
|
||||
|
||||
external LiquidSdkErrorKind kind;
|
||||
}
|
||||
|
||||
final class wire_cst_PaymentError_Generic extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
|
||||
}
|
||||
@@ -1071,7 +1025,7 @@ final class wire_cst_PaymentError_LwkError extends ffi.Struct {
|
||||
final class wire_cst_PaymentError_Refunded extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> refund_tx_id;
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> txid;
|
||||
}
|
||||
|
||||
final class wire_cst_PaymentError_SendError extends ffi.Struct {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.33.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.35.
|
||||
|
||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||
|
||||
|
||||
@@ -23,6 +23,6 @@ dev_dependencies:
|
||||
test: ^1.25.5
|
||||
dependencies:
|
||||
ffi: ^2.1.2
|
||||
flutter_rust_bridge: 2.0.0-dev.33
|
||||
flutter_rust_bridge: 2.0.0-dev.35
|
||||
freezed_annotation: ^2.4.1
|
||||
meta: ^1.12.0 # meta is pinned to version 1.12.0 by integration_test from the flutter SDK.
|
||||
|
||||
@@ -4,15 +4,19 @@ import 'package:test/test.dart';
|
||||
import 'helpers.dart';
|
||||
|
||||
void main() {
|
||||
late BindingLiquidSdk sdk;
|
||||
|
||||
group('main', () {
|
||||
setUpAll(() async {
|
||||
await initApi();
|
||||
ConnectRequest connectRequest = ConnectRequest(mnemonic: "", network: Network.liquidTestnet);
|
||||
sdk = await connect(req: connectRequest);
|
||||
});
|
||||
|
||||
test("after setting up, getInfo should throw exception with 'Not initialized' message", () async {
|
||||
GetInfoRequest req = GetInfoRequest(withScan: true);
|
||||
GetInfoRequest getInfoRequest = GetInfoRequest(withScan: true);
|
||||
try {
|
||||
await getInfo(req: req);
|
||||
await sdk.getInfo(req: getInfoRequest);
|
||||
} catch (e) {
|
||||
if (e is AnyhowException) {
|
||||
expect(e.message, "Not initialized");
|
||||
|
||||
@@ -5,13 +5,13 @@ import 'package:path_provider/path_provider.dart';
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await initialize();
|
||||
await initializeWallet();
|
||||
runApp(const MyApp());
|
||||
BindingLiquidSdk liquidSDK = await initializeWallet();
|
||||
runApp(MyApp(liquidSDK));
|
||||
}
|
||||
|
||||
const String mnemonic = "";
|
||||
|
||||
Future initializeWallet() async {
|
||||
Future<BindingLiquidSdk> initializeWallet() async {
|
||||
assert(mnemonic.isNotEmpty, "Please enter your mnemonic.");
|
||||
final dataDir = await getApplicationDocumentsDirectory();
|
||||
final req = ConnectRequest(
|
||||
@@ -19,11 +19,13 @@ Future initializeWallet() async {
|
||||
dataDir: dataDir.path,
|
||||
network: Network.liquid,
|
||||
);
|
||||
await connect(req: req);
|
||||
return await connect(req: req);
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({super.key});
|
||||
final BindingLiquidSdk liquidSDK;
|
||||
|
||||
const MyApp(this.liquidSDK, {super.key});
|
||||
|
||||
@override
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
@@ -43,7 +45,7 @@ class _MyAppState extends State<MyApp> {
|
||||
child: Column(
|
||||
children: [
|
||||
FutureBuilder<GetInfoResponse>(
|
||||
future: getInfo(
|
||||
future: widget.liquidSDK.getInfo(
|
||||
req: const GetInfoRequest(
|
||||
withScan: true,
|
||||
),
|
||||
@@ -93,7 +95,7 @@ class _MyAppState extends State<MyApp> {
|
||||
),
|
||||
const SizedBox(height: 16.0),
|
||||
FutureBuilder<PrepareReceiveResponse>(
|
||||
future: prepareReceivePayment(
|
||||
future: widget.liquidSDK.prepareReceivePayment(
|
||||
req: const PrepareReceiveRequest(payerAmountSat: 1000),
|
||||
),
|
||||
initialData: null,
|
||||
@@ -125,7 +127,7 @@ class _MyAppState extends State<MyApp> {
|
||||
),
|
||||
const SizedBox(height: 16.0),
|
||||
FutureBuilder<ReceivePaymentResponse>(
|
||||
future: receivePayment(req: prepareReceiveResponse),
|
||||
future: widget.liquidSDK.receivePayment(req: prepareReceiveResponse),
|
||||
initialData: null,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
|
||||
@@ -125,13 +125,13 @@ packages:
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
flutter_rust_bridge:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_rust_bridge
|
||||
sha256: "2bf072117fe975e18aa418234572aa6c60a0513141dc4239a5409eebd0a6a597"
|
||||
sha256: "915d48099928282c80f7f13ad7b9bbf5808bd3c2a1ec3dc76a749aefde3025ae"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0-dev.33"
|
||||
version: "2.0.0-dev.35"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
||||
@@ -11,6 +11,7 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
flutter_rust_bridge: ^2.0.0-dev.35
|
||||
flutter_breez_liquid: ^0.1.0
|
||||
path_provider: ^2.1.3
|
||||
# When depending on this package from a real application you should use:
|
||||
|
||||
1
packages/flutter/ios/.gitignore
vendored
1
packages/flutter/ios/.gitignore
vendored
@@ -2,4 +2,3 @@ Flutter/
|
||||
Runner/
|
||||
Frameworks/*
|
||||
!Frameworks/.gitkeep
|
||||
|
||||
|
||||
@@ -37,159 +37,192 @@ class FlutterBreezLiquidBindings {
|
||||
late final _store_dart_post_cobject =
|
||||
_store_dart_post_cobjectPtr.asFunction<void Function(DartPostCObjectFnType)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_backup(
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup(
|
||||
int port_,
|
||||
int that,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_backup(
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup(
|
||||
port_,
|
||||
that,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_backupPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>('frbgen_breez_liquid_wire_backup');
|
||||
late final _frbgen_breez_liquid_wire_backup =
|
||||
_frbgen_breez_liquid_wire_backupPtr.asFunction<void Function(int)>();
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backupPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backupPtr
|
||||
.asFunction<void Function(int, int)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_connect(
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_get_info_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_infoPtr = _lookup<
|
||||
ffi
|
||||
.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_get_info_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info =
|
||||
_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_prepare_receive_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_prepare_receive_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_paymentPtr =
|
||||
_lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_receive_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_receive_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_receive_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_prepare_send_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_send_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_payment =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_prepare_send_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_send_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_prepare_receive_response> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_receive_response>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_payment =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_receive_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_receive_response>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_restore_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restorePtr = _lookup<
|
||||
ffi
|
||||
.NativeFunction<ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_restore_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restorePtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_restore_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_prepare_send_response> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_prepare_send_response>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_prepare_send_response>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__connect(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_connect_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_connect(
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__connect(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_connectPtr =
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__connectPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_connect_request>)>>(
|
||||
'frbgen_breez_liquid_wire_connect');
|
||||
late final _frbgen_breez_liquid_wire_connect = _frbgen_breez_liquid_wire_connectPtr
|
||||
'frbgen_breez_liquid_wire__crate__bindings__connect');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__connect =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__connectPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_connect_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_empty_wallet_cache(
|
||||
int port_,
|
||||
void
|
||||
frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ffi.Pointer<ffi.Void> ptr,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_empty_wallet_cache(
|
||||
port_,
|
||||
return _frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ptr,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_empty_wallet_cachePtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>(
|
||||
'frbgen_breez_liquid_wire_empty_wallet_cache');
|
||||
late final _frbgen_breez_liquid_wire_empty_wallet_cache =
|
||||
_frbgen_breez_liquid_wire_empty_wallet_cachePtr.asFunction<void Function(int)>();
|
||||
late final _frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
|
||||
'frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk');
|
||||
late final _frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk =
|
||||
_frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr
|
||||
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_get_info(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_get_info_request> req,
|
||||
void
|
||||
frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ffi.Pointer<ffi.Void> ptr,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_get_info(
|
||||
port_,
|
||||
req,
|
||||
return _frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
ptr,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_get_infoPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_get_info_request>)>>(
|
||||
'frbgen_breez_liquid_wire_get_info');
|
||||
late final _frbgen_breez_liquid_wire_get_info = _frbgen_breez_liquid_wire_get_infoPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_get_info_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_list_payments(
|
||||
int port_,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_list_payments(
|
||||
port_,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_list_paymentsPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64)>>('frbgen_breez_liquid_wire_list_payments');
|
||||
late final _frbgen_breez_liquid_wire_list_payments =
|
||||
_frbgen_breez_liquid_wire_list_paymentsPtr.asFunction<void Function(int)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_prepare_receive_payment(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_prepare_receive_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_prepare_receive_payment(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_prepare_receive_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_receive_request>)>>(
|
||||
'frbgen_breez_liquid_wire_prepare_receive_payment');
|
||||
late final _frbgen_breez_liquid_wire_prepare_receive_payment =
|
||||
_frbgen_breez_liquid_wire_prepare_receive_paymentPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_receive_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_prepare_send_payment(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_prepare_send_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_prepare_send_payment(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_prepare_send_paymentPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_send_request>)>>(
|
||||
'frbgen_breez_liquid_wire_prepare_send_payment');
|
||||
late final _frbgen_breez_liquid_wire_prepare_send_payment =
|
||||
_frbgen_breez_liquid_wire_prepare_send_paymentPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_send_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_receive_payment(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_prepare_receive_response> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_receive_payment(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_receive_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_receive_response>)>>(
|
||||
'frbgen_breez_liquid_wire_receive_payment');
|
||||
late final _frbgen_breez_liquid_wire_receive_payment = _frbgen_breez_liquid_wire_receive_paymentPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_receive_response>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_restore(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_restore_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_restore(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_restorePtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_restore_request>)>>(
|
||||
'frbgen_breez_liquid_wire_restore');
|
||||
late final _frbgen_breez_liquid_wire_restore = _frbgen_breez_liquid_wire_restorePtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_restore_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire_send_payment(
|
||||
int port_,
|
||||
ffi.Pointer<wire_cst_prepare_send_response> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire_send_payment(
|
||||
port_,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire_send_paymentPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Int64, ffi.Pointer<wire_cst_prepare_send_response>)>>(
|
||||
'frbgen_breez_liquid_wire_send_payment');
|
||||
late final _frbgen_breez_liquid_wire_send_payment = _frbgen_breez_liquid_wire_send_paymentPtr
|
||||
.asFunction<void Function(int, ffi.Pointer<wire_cst_prepare_send_response>)>();
|
||||
late final _frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
|
||||
'frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk');
|
||||
late final _frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk =
|
||||
_frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr
|
||||
.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
|
||||
|
||||
ffi.Pointer<wire_cst_connect_request> frbgen_breez_liquid_cst_new_box_autoadd_connect_request() {
|
||||
return _frbgen_breez_liquid_cst_new_box_autoadd_connect_request();
|
||||
@@ -271,34 +304,6 @@ 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,
|
||||
) {
|
||||
@@ -342,22 +347,6 @@ typedef DartDartPort = int;
|
||||
|
||||
final class _Dart_Handle extends ffi.Opaque {}
|
||||
|
||||
final class wire_cst_list_prim_u_8_strict extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Uint8> ptr;
|
||||
|
||||
@ffi.Int32()
|
||||
external int len;
|
||||
}
|
||||
|
||||
final class wire_cst_connect_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> mnemonic;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> data_dir;
|
||||
|
||||
@ffi.Int32()
|
||||
external int network;
|
||||
}
|
||||
|
||||
final class wire_cst_get_info_request extends ffi.Struct {
|
||||
@ffi.Bool()
|
||||
external bool with_scan;
|
||||
@@ -368,6 +357,13 @@ final class wire_cst_prepare_receive_request extends ffi.Struct {
|
||||
external int payer_amount_sat;
|
||||
}
|
||||
|
||||
final class wire_cst_list_prim_u_8_strict extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Uint8> ptr;
|
||||
|
||||
@ffi.Int32()
|
||||
external int len;
|
||||
}
|
||||
|
||||
final class wire_cst_prepare_send_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> invoice;
|
||||
}
|
||||
@@ -391,46 +387,37 @@ final class wire_cst_prepare_send_response extends ffi.Struct {
|
||||
external int fees_sat;
|
||||
}
|
||||
|
||||
final class wire_cst_payment extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> tx_id;
|
||||
final class wire_cst_connect_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> mnemonic;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> swap_id;
|
||||
|
||||
@ffi.Uint32()
|
||||
external int timestamp;
|
||||
|
||||
@ffi.Uint64()
|
||||
external int amount_sat;
|
||||
|
||||
external ffi.Pointer<ffi.Uint64> fees_sat;
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> data_dir;
|
||||
|
||||
@ffi.Int32()
|
||||
external int payment_type;
|
||||
|
||||
@ffi.Int32()
|
||||
external int status;
|
||||
}
|
||||
|
||||
final class wire_cst_list_payment extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_payment> ptr;
|
||||
|
||||
@ffi.Int32()
|
||||
external int len;
|
||||
external int network;
|
||||
}
|
||||
|
||||
final class wire_cst_get_info_response extends ffi.Struct {
|
||||
@ffi.Uint64()
|
||||
external int balance_sat;
|
||||
|
||||
@ffi.Uint64()
|
||||
external int pending_send_sat;
|
||||
|
||||
@ffi.Uint64()
|
||||
external int pending_receive_sat;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> pubkey;
|
||||
}
|
||||
|
||||
final class wire_cst_LiquidSdkError_Generic extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
|
||||
}
|
||||
|
||||
final class LiquidSdkErrorKind extends ffi.Union {
|
||||
external wire_cst_LiquidSdkError_Generic Generic;
|
||||
}
|
||||
|
||||
final class wire_cst_liquid_sdk_error extends ffi.Struct {
|
||||
@ffi.Int32()
|
||||
external int tag;
|
||||
|
||||
external LiquidSdkErrorKind kind;
|
||||
}
|
||||
|
||||
final class wire_cst_PaymentError_Generic extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
|
||||
}
|
||||
@@ -442,7 +429,7 @@ final class wire_cst_PaymentError_LwkError extends ffi.Struct {
|
||||
final class wire_cst_PaymentError_Refunded extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> err;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> refund_tx_id;
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> txid;
|
||||
}
|
||||
|
||||
final class wire_cst_PaymentError_SendError extends ffi.Struct {
|
||||
|
||||
Reference in New Issue
Block a user