mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-18 14:34:24 +01:00
Get Payment (#476)
* Get payment by destination * CI fixes * Remove claim_address from query * Add PaymentDestination enum * Add payment hash as a payment query option * Bump Flutter dependencies * Move destination/address queries to list_payments * Apply suggestions from code review Co-authored-by: yse <70684173+hydra-yse@users.noreply.github.com> --------- Co-authored-by: yse <70684173+hydra-yse@users.noreply.github.com>
This commit is contained in:
@@ -32,13 +32,14 @@ You'll need a Testnet LN node to test the sending and receiving operations. A si
|
||||
|
||||
To get a full list of commands run `-h` or `<command> -h` to get more information about a command.
|
||||
|
||||
- **send-payment** - Send lbtc and receive btc lightning through a swap
|
||||
- **send-payment** - Send a payment directly or via a swap
|
||||
- **fetch-lightning-limits** - Fetch the current limits for Send and Receive payments
|
||||
- **fetch-onchain-limits** - Fetch the current limits for Onchain Send and Receive payments
|
||||
- **send-onchain-payment** - Send lbtc and receive btc onchain through a swap
|
||||
- **receive-payment** - Receive lbtc and send btc through a swap
|
||||
- **send-onchain-payment** - Send to a Bitcoin onchain address via a swap
|
||||
- **receive-payment** - Receive a payment directly or via a swap
|
||||
- **buy-bitcoin** - Generates an URL to buy bitcoin from a 3rd party provider
|
||||
- **list-payments** - List incoming and outgoing payments
|
||||
- **get-payment** - Retrieve a payment
|
||||
- **list-refundables** - List refundable chain swaps
|
||||
- **prepare-refund** - Prepare a refund transaction for an incomplete swap
|
||||
- **refund** - Broadcast a refund transaction for an incomplete swap
|
||||
@@ -47,7 +48,7 @@ To get a full list of commands run `-h` or `<command> -h` to get more informatio
|
||||
- **sign-message** - Sign a message using the wallet private key
|
||||
- **check-message** - Verify a message with a public key
|
||||
- **sync** - Sync local data with mempool and onchain data
|
||||
- **recommended-fees** - Get the recommended BTC fees based on the configured mempool.space instance
|
||||
- **recommended-fees** - Get the recommended Bitcoin fees based on the configured mempool.space instance
|
||||
- **empty-cache** - Empties the encrypted transaction cache
|
||||
- **backup** - Backs up the current pending swaps
|
||||
- **restore** - Retrieve a list of backups
|
||||
|
||||
@@ -19,11 +19,11 @@ use serde_json::to_string_pretty;
|
||||
|
||||
#[derive(Parser, Debug, Clone, PartialEq)]
|
||||
pub(crate) enum Command {
|
||||
/// Send lbtc and receive btc lightning through a swap
|
||||
/// Send a payment directly or via a swap
|
||||
SendPayment {
|
||||
/// Invoice which has to be paid
|
||||
#[arg(long)]
|
||||
bolt11: Option<String>,
|
||||
invoice: Option<String>,
|
||||
|
||||
/// Either BIP21 URI or Liquid address we intend to pay to
|
||||
#[arg(long)]
|
||||
@@ -42,9 +42,9 @@ pub(crate) enum Command {
|
||||
FetchLightningLimits,
|
||||
/// Fetch the current limits for Onchain Send and Receive payments
|
||||
FetchOnchainLimits,
|
||||
/// Send lbtc and receive btc onchain through a swap
|
||||
/// Send to a Bitcoin onchain address via a swap
|
||||
SendOnchainPayment {
|
||||
/// Btc onchain address to send to
|
||||
/// Bitcoin onchain address to send to
|
||||
address: String,
|
||||
|
||||
/// Amount that will be received, in satoshi. Must be set if `drain` is false or unset.
|
||||
@@ -58,7 +58,7 @@ pub(crate) enum Command {
|
||||
#[clap(short = 'f', long = "fee_rate")]
|
||||
fee_rate_sat_per_vbyte: Option<u32>,
|
||||
},
|
||||
/// Receive lbtc and send btc through a swap
|
||||
/// Receive a payment directly or via a swap
|
||||
ReceivePayment {
|
||||
/// The method to use when receiving. Either "lightning", "bitcoin" or "liquid"
|
||||
#[arg(short = 'm', long = "method")]
|
||||
@@ -101,6 +101,19 @@ pub(crate) enum Command {
|
||||
/// Optional offset in payments
|
||||
#[clap(short = 'o', long = "offset")]
|
||||
offset: Option<u32>,
|
||||
|
||||
/// Optional Liquid BIP21 URI / address destination
|
||||
#[clap(short = 'd', long = "destination")]
|
||||
liquid_destination: Option<String>,
|
||||
|
||||
/// Optional Bitcoin address
|
||||
#[clap(short = 'a', long = "address")]
|
||||
bitcoin_address: Option<String>,
|
||||
},
|
||||
/// Retrieve a payment
|
||||
GetPayment {
|
||||
/// Lightning payment hash
|
||||
payment_hash: String,
|
||||
},
|
||||
/// List refundable chain swaps
|
||||
ListRefundables,
|
||||
@@ -108,7 +121,7 @@ pub(crate) enum Command {
|
||||
PrepareRefund {
|
||||
// Swap address of the lockup
|
||||
swap_address: String,
|
||||
// Btc onchain address to send the refund to
|
||||
// Bitcoin onchain address to send the refund to
|
||||
refund_address: String,
|
||||
// Fee rate to use, in sat/vbyte
|
||||
fee_rate_sat_per_vbyte: u32,
|
||||
@@ -117,7 +130,7 @@ pub(crate) enum Command {
|
||||
Refund {
|
||||
// Swap address of the lockup
|
||||
swap_address: String,
|
||||
// Btc onchain address to send the refund to
|
||||
// Bitcoin onchain address to send the refund to
|
||||
refund_address: String,
|
||||
// Fee rate to use, in sat/vbyte
|
||||
fee_rate_sat_per_vbyte: u32,
|
||||
@@ -139,7 +152,7 @@ pub(crate) enum Command {
|
||||
},
|
||||
/// Sync local data with mempool and onchain data
|
||||
Sync,
|
||||
/// Get the recommended BTC fees based on the configured mempool.space instance
|
||||
/// Get the recommended Bitcoin fees based on the configured mempool.space instance
|
||||
RecommendedFees,
|
||||
/// Empties the encrypted transaction cache
|
||||
EmptyCache,
|
||||
@@ -157,7 +170,7 @@ pub(crate) enum Command {
|
||||
Disconnect,
|
||||
/// Parse a generic string to get its type and relevant metadata
|
||||
Parse {
|
||||
/// Generic input (URL, LNURL, BIP-21 BTC Address, LN invoice, etc)
|
||||
/// Generic input (URL, LNURL, BIP-21 Bitcoin Address, LN invoice, etc)
|
||||
input: String,
|
||||
},
|
||||
/// Pay using LNURL
|
||||
@@ -290,22 +303,22 @@ pub(crate) async fn handle_command(
|
||||
command_result!(limits)
|
||||
}
|
||||
Command::SendPayment {
|
||||
bolt11,
|
||||
invoice,
|
||||
address,
|
||||
amount_sat,
|
||||
delay,
|
||||
} => {
|
||||
let destination = match (bolt11, address) {
|
||||
let destination = match (invoice, address) {
|
||||
(None, None) => {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Must specify either a `bolt11` invoice or a direct/BIP21 `address`."
|
||||
"Must specify either an invoice or a direct/BIP21 address."
|
||||
))
|
||||
}
|
||||
(Some(bolt11), None) => bolt11,
|
||||
(Some(invoice), None) => invoice,
|
||||
(None, Some(address)) => address,
|
||||
(Some(_), Some(_)) => {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Cannot specify both `bolt11` and `address` at the same time."
|
||||
"Cannot specify both invoice and address at the same time."
|
||||
))
|
||||
}
|
||||
};
|
||||
@@ -436,7 +449,15 @@ pub(crate) async fn handle_command(
|
||||
to_timestamp,
|
||||
limit,
|
||||
offset,
|
||||
liquid_destination,
|
||||
bitcoin_address,
|
||||
} => {
|
||||
let details = match (liquid_destination, bitcoin_address) {
|
||||
(Some(destination), None) => Some(ListPaymentDetails::Liquid { destination }),
|
||||
(None, Some(address)) => Some(ListPaymentDetails::Bitcoin { address }),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
let payments = sdk
|
||||
.list_payments(&ListPaymentsRequest {
|
||||
filters: None,
|
||||
@@ -444,10 +465,22 @@ pub(crate) async fn handle_command(
|
||||
to_timestamp,
|
||||
limit,
|
||||
offset,
|
||||
details,
|
||||
})
|
||||
.await?;
|
||||
command_result!(payments)
|
||||
}
|
||||
Command::GetPayment { payment_hash } => {
|
||||
let maybe_payment = sdk
|
||||
.get_payment(&GetPaymentRequest::Lightning { payment_hash })
|
||||
.await?;
|
||||
match maybe_payment {
|
||||
Some(payment) => command_result!(payment),
|
||||
None => {
|
||||
return Err(anyhow::anyhow!("Payment not found."));
|
||||
}
|
||||
}
|
||||
}
|
||||
Command::ListRefundables => {
|
||||
let refundables = sdk.list_refundables().await?;
|
||||
command_result!(refundables)
|
||||
|
||||
@@ -63,17 +63,49 @@ typedef struct wire_cst_check_message_request {
|
||||
struct wire_cst_list_prim_u_8_strict *signature;
|
||||
} wire_cst_check_message_request;
|
||||
|
||||
typedef struct wire_cst_GetPaymentRequest_Lightning {
|
||||
struct wire_cst_list_prim_u_8_strict *payment_hash;
|
||||
} wire_cst_GetPaymentRequest_Lightning;
|
||||
|
||||
typedef union GetPaymentRequestKind {
|
||||
struct wire_cst_GetPaymentRequest_Lightning Lightning;
|
||||
} GetPaymentRequestKind;
|
||||
|
||||
typedef struct wire_cst_get_payment_request {
|
||||
int32_t tag;
|
||||
union GetPaymentRequestKind kind;
|
||||
} wire_cst_get_payment_request;
|
||||
|
||||
typedef struct wire_cst_list_payment_type {
|
||||
int32_t *ptr;
|
||||
int32_t len;
|
||||
} wire_cst_list_payment_type;
|
||||
|
||||
typedef struct wire_cst_ListPaymentDetails_Liquid {
|
||||
struct wire_cst_list_prim_u_8_strict *destination;
|
||||
} wire_cst_ListPaymentDetails_Liquid;
|
||||
|
||||
typedef struct wire_cst_ListPaymentDetails_Bitcoin {
|
||||
struct wire_cst_list_prim_u_8_strict *address;
|
||||
} wire_cst_ListPaymentDetails_Bitcoin;
|
||||
|
||||
typedef union ListPaymentDetailsKind {
|
||||
struct wire_cst_ListPaymentDetails_Liquid Liquid;
|
||||
struct wire_cst_ListPaymentDetails_Bitcoin Bitcoin;
|
||||
} ListPaymentDetailsKind;
|
||||
|
||||
typedef struct wire_cst_list_payment_details {
|
||||
int32_t tag;
|
||||
union ListPaymentDetailsKind kind;
|
||||
} wire_cst_list_payment_details;
|
||||
|
||||
typedef struct wire_cst_list_payments_request {
|
||||
struct wire_cst_list_payment_type *filters;
|
||||
int64_t *from_timestamp;
|
||||
int64_t *to_timestamp;
|
||||
uint32_t *offset;
|
||||
uint32_t *limit;
|
||||
struct wire_cst_list_payment_details *details;
|
||||
} wire_cst_list_payments_request;
|
||||
|
||||
typedef struct wire_cst_ln_url_auth_request_data {
|
||||
@@ -277,6 +309,7 @@ typedef struct wire_cst_PaymentDetails_Lightning {
|
||||
struct wire_cst_list_prim_u_8_strict *description;
|
||||
struct wire_cst_list_prim_u_8_strict *preimage;
|
||||
struct wire_cst_list_prim_u_8_strict *bolt11;
|
||||
struct wire_cst_list_prim_u_8_strict *payment_hash;
|
||||
struct wire_cst_list_prim_u_8_strict *refund_tx_id;
|
||||
uint64_t *refund_tx_amount_sat;
|
||||
} wire_cst_PaymentDetails_Lightning;
|
||||
@@ -932,6 +965,10 @@ void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_fetch_onchain_l
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_info(int64_t port_,
|
||||
uintptr_t that);
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_payment(int64_t port_,
|
||||
uintptr_t that,
|
||||
struct wire_cst_get_payment_request *req);
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_fiat_currencies(int64_t port_,
|
||||
uintptr_t that);
|
||||
|
||||
@@ -1052,10 +1089,14 @@ struct wire_cst_check_message_request *frbgen_breez_liquid_cst_new_box_autoadd_c
|
||||
|
||||
struct wire_cst_connect_request *frbgen_breez_liquid_cst_new_box_autoadd_connect_request(void);
|
||||
|
||||
struct wire_cst_get_payment_request *frbgen_breez_liquid_cst_new_box_autoadd_get_payment_request(void);
|
||||
|
||||
int64_t *frbgen_breez_liquid_cst_new_box_autoadd_i_64(int64_t value);
|
||||
|
||||
struct wire_cst_liquid_address_data *frbgen_breez_liquid_cst_new_box_autoadd_liquid_address_data(void);
|
||||
|
||||
struct wire_cst_list_payment_details *frbgen_breez_liquid_cst_new_box_autoadd_list_payment_details(void);
|
||||
|
||||
struct wire_cst_list_payments_request *frbgen_breez_liquid_cst_new_box_autoadd_list_payments_request(void);
|
||||
|
||||
struct wire_cst_ln_invoice *frbgen_breez_liquid_cst_new_box_autoadd_ln_invoice(void);
|
||||
@@ -1146,8 +1187,10 @@ static int64_t dummy_method_to_enforce_bundling(void) {
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_buy_bitcoin_request);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_check_message_request);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_connect_request);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_get_payment_request);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_i_64);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_liquid_address_data);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_list_payment_details);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_list_payments_request);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_invoice);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_ln_url_auth_request_data);
|
||||
@@ -1200,6 +1243,7 @@ static int64_t dummy_method_to_enforce_bundling(void) {
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_fetch_lightning_limits);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_fetch_onchain_limits);
|
||||
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_get_payment);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_fiat_currencies);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_payments);
|
||||
dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_refundables);
|
||||
|
||||
@@ -83,6 +83,8 @@ RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_fetch_onc
|
||||
);
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_info(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_payment(void*_Nonnull ptr, RustBuffer req, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_list_fiat_currencies(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_list_payments(void*_Nonnull ptr, RustBuffer req, RustCallStatus *_Nonnull out_status
|
||||
@@ -135,7 +137,7 @@ void uniffi_breez_sdk_liquid_bindings_fn_init_callback_logger(ForeignCallback _N
|
||||
);
|
||||
void*_Nonnull uniffi_breez_sdk_liquid_bindings_fn_func_connect(RustBuffer req, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_default_config(RustBuffer network, RustCallStatus *_Nonnull out_status
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_default_config(RustBuffer network, RustBuffer breez_api_key, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_parse(RustBuffer input, RustCallStatus *_Nonnull out_status
|
||||
);
|
||||
@@ -298,6 +300,9 @@ uint16_t uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_fetch
|
||||
);
|
||||
uint16_t uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_info(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_payment(void
|
||||
|
||||
);
|
||||
uint16_t uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_list_fiat_currencies(void
|
||||
|
||||
|
||||
117
lib/bindings/langs/flutter/scripts/pubspec.lock
Normal file
117
lib/bindings/langs/flutter/scripts/pubspec.lock
Normal file
@@ -0,0 +1,117 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
args:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: args
|
||||
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.5.0"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.11.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
cli_script:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cli_script
|
||||
sha256: "3463c6e8e57271faaf557eee56cb455522f1ab1ebe618bbfb7454f74fc793967"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.19.0"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
glob:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: glob
|
||||
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.16.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.12.0"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
tuple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: tuple
|
||||
sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
sdks:
|
||||
dart: ">=3.4.0 <4.0.0"
|
||||
@@ -467,11 +467,23 @@ dictionary ListPaymentsRequest {
|
||||
i64? to_timestamp = null;
|
||||
u32? offset = null;
|
||||
u32? limit = null;
|
||||
ListPaymentDetails? details = null;
|
||||
};
|
||||
|
||||
[Enum]
|
||||
interface ListPaymentDetails {
|
||||
Liquid(string destination);
|
||||
Bitcoin(string address);
|
||||
};
|
||||
|
||||
[Enum]
|
||||
interface GetPaymentRequest {
|
||||
Lightning(string payment_hash);
|
||||
};
|
||||
|
||||
[Enum]
|
||||
interface PaymentDetails {
|
||||
Lightning(string swap_id, string description, string? preimage, string? bolt11, string? refund_tx_id, u64? refund_tx_amount_sat);
|
||||
Lightning(string swap_id, string description, string? preimage, string? bolt11, string? payment_hash, string? refund_tx_id, u64? refund_tx_amount_sat);
|
||||
Liquid(string destination, string description);
|
||||
Bitcoin(string swap_id, string description, string? refund_tx_id, u64? refund_tx_amount_sat);
|
||||
};
|
||||
@@ -628,6 +640,9 @@ interface BindingLiquidSdk {
|
||||
[Throws=PaymentError]
|
||||
sequence<Payment> list_payments(ListPaymentsRequest req);
|
||||
|
||||
[Throws=PaymentError]
|
||||
Payment? get_payment(GetPaymentRequest req);
|
||||
|
||||
[Throws=SdkError]
|
||||
sequence<RefundableSwap> list_refundables();
|
||||
|
||||
|
||||
@@ -155,6 +155,10 @@ impl BindingLiquidSdk {
|
||||
rt().block_on(self.sdk.list_payments(&req))
|
||||
}
|
||||
|
||||
pub fn get_payment(&self, req: GetPaymentRequest) -> Result<Option<Payment>, PaymentError> {
|
||||
rt().block_on(self.sdk.get_payment(&req))
|
||||
}
|
||||
|
||||
pub fn lnurl_pay(&self, req: LnUrlPayRequest) -> Result<LnUrlPayResult, LnUrlPayError> {
|
||||
rt().block_on(self.sdk.lnurl_pay(req)).map_err(Into::into)
|
||||
}
|
||||
|
||||
@@ -176,6 +176,13 @@ impl BindingLiquidSdk {
|
||||
self.sdk.list_payments(&req).await
|
||||
}
|
||||
|
||||
pub async fn get_payment(
|
||||
&self,
|
||||
req: GetPaymentRequest,
|
||||
) -> Result<Option<Payment>, PaymentError> {
|
||||
self.sdk.get_payment(&req).await
|
||||
}
|
||||
|
||||
pub async fn lnurl_pay(
|
||||
&self,
|
||||
req: LnUrlPayRequest,
|
||||
|
||||
@@ -125,6 +125,12 @@ pub enum PaymentError {
|
||||
SignerError { err: String },
|
||||
}
|
||||
impl PaymentError {
|
||||
pub(crate) fn invalid_invoice(err: &str) -> Self {
|
||||
Self::InvalidInvoice {
|
||||
err: err.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn receive_error(err: &str) -> Self {
|
||||
Self::ReceiveError {
|
||||
err: err.to_string(),
|
||||
|
||||
@@ -39,7 +39,7 @@ flutter_rust_bridge::frb_generated_boilerplate!(
|
||||
default_rust_auto_opaque = RustAutoOpaqueNom,
|
||||
);
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.4.0";
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1532646653;
|
||||
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1147354100;
|
||||
|
||||
// Section: executor
|
||||
|
||||
@@ -481,6 +481,55 @@ fn wire__crate__bindings__BindingLiquidSdk_get_info_impl(
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_get_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::GetPaymentRequest>,
|
||||
) {
|
||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::DcoCodec, _, _, _>(
|
||||
flutter_rust_bridge::for_generated::TaskInfo {
|
||||
debug_name: "BindingLiquidSdk_get_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| async move {
|
||||
transform_result_dco::<_, _, crate::error::PaymentError>(
|
||||
(move || async move {
|
||||
let mut api_that_guard = None;
|
||||
let decode_indices_ =
|
||||
flutter_rust_bridge::for_generated::lockable_compute_decode_order(
|
||||
vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new(
|
||||
&api_that, 0, false,
|
||||
)],
|
||||
);
|
||||
for i in decode_indices_ {
|
||||
match i {
|
||||
0 => {
|
||||
api_that_guard =
|
||||
Some(api_that.lockable_decode_async_ref().await)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
let api_that_guard = api_that_guard.unwrap();
|
||||
let output_ok = crate::bindings::BindingLiquidSdk::get_payment(
|
||||
&*api_that_guard,
|
||||
api_req,
|
||||
)
|
||||
.await?;
|
||||
Ok(output_ok)
|
||||
})()
|
||||
.await,
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
fn wire__crate__bindings__BindingLiquidSdk_list_fiat_currencies_impl(
|
||||
port_: flutter_rust_bridge::for_generated::MessagePort,
|
||||
that: impl CstDecode<
|
||||
@@ -2251,6 +2300,24 @@ impl SseDecode for crate::model::GetInfoResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::model::GetPaymentRequest {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut tag_ = <i32>::sse_decode(deserializer);
|
||||
match tag_ {
|
||||
0 => {
|
||||
let mut var_paymentHash = <String>::sse_decode(deserializer);
|
||||
return crate::model::GetPaymentRequest::Lightning {
|
||||
payment_hash: var_paymentHash,
|
||||
};
|
||||
}
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for i32 {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -2431,6 +2498,30 @@ impl SseDecode for Vec<crate::model::Payment> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for crate::model::ListPaymentDetails {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
let mut tag_ = <i32>::sse_decode(deserializer);
|
||||
match tag_ {
|
||||
0 => {
|
||||
let mut var_destination = <String>::sse_decode(deserializer);
|
||||
return crate::model::ListPaymentDetails::Liquid {
|
||||
destination: var_destination,
|
||||
};
|
||||
}
|
||||
1 => {
|
||||
let mut var_address = <String>::sse_decode(deserializer);
|
||||
return crate::model::ListPaymentDetails::Bitcoin {
|
||||
address: var_address,
|
||||
};
|
||||
}
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Vec<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 {
|
||||
@@ -2451,12 +2542,14 @@ impl SseDecode for crate::model::ListPaymentsRequest {
|
||||
let mut var_toTimestamp = <Option<i64>>::sse_decode(deserializer);
|
||||
let mut var_offset = <Option<u32>>::sse_decode(deserializer);
|
||||
let mut var_limit = <Option<u32>>::sse_decode(deserializer);
|
||||
let mut var_details = <Option<crate::model::ListPaymentDetails>>::sse_decode(deserializer);
|
||||
return crate::model::ListPaymentsRequest {
|
||||
filters: var_filters,
|
||||
from_timestamp: var_fromTimestamp,
|
||||
to_timestamp: var_toTimestamp,
|
||||
offset: var_offset,
|
||||
limit: var_limit,
|
||||
details: var_details,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -3009,6 +3102,28 @@ impl SseDecode for Option<i64> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Option<crate::model::ListPaymentDetails> {
|
||||
// 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(<crate::model::ListPaymentDetails>::sse_decode(deserializer));
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Option<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 {
|
||||
if (<bool>::sse_decode(deserializer)) {
|
||||
return Some(<crate::model::Payment>::sse_decode(deserializer));
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseDecode for Option<crate::bindings::SuccessActionProcessed> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
|
||||
@@ -3134,6 +3249,7 @@ impl SseDecode for crate::model::PaymentDetails {
|
||||
let mut var_description = <String>::sse_decode(deserializer);
|
||||
let mut var_preimage = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_bolt11 = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_paymentHash = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_refundTxId = <Option<String>>::sse_decode(deserializer);
|
||||
let mut var_refundTxAmountSat = <Option<u64>>::sse_decode(deserializer);
|
||||
return crate::model::PaymentDetails::Lightning {
|
||||
@@ -3141,6 +3257,7 @@ impl SseDecode for crate::model::PaymentDetails {
|
||||
description: var_description,
|
||||
preimage: var_preimage,
|
||||
bolt11: var_bolt11,
|
||||
payment_hash: var_paymentHash,
|
||||
refund_tx_id: var_refundTxId,
|
||||
refund_tx_amount_sat: var_refundTxAmountSat,
|
||||
};
|
||||
@@ -4141,6 +4258,30 @@ 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::model::GetPaymentRequest {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
match self {
|
||||
crate::model::GetPaymentRequest::Lightning { payment_hash } => {
|
||||
[0.into_dart(), payment_hash.into_into_dart().into_dart()].into_dart()
|
||||
}
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
|
||||
for crate::model::GetPaymentRequest
|
||||
{
|
||||
}
|
||||
impl flutter_rust_bridge::IntoIntoDart<crate::model::GetPaymentRequest>
|
||||
for crate::model::GetPaymentRequest
|
||||
{
|
||||
fn into_into_dart(self) -> crate::model::GetPaymentRequest {
|
||||
self
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for FrbWrapper<crate::bindings::InputType> {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
match self.0 {
|
||||
@@ -4270,6 +4411,33 @@ impl flutter_rust_bridge::IntoIntoDart<crate::model::LiquidNetwork>
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::model::ListPaymentDetails {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
match self {
|
||||
crate::model::ListPaymentDetails::Liquid { destination } => {
|
||||
[0.into_dart(), destination.into_into_dart().into_dart()].into_dart()
|
||||
}
|
||||
crate::model::ListPaymentDetails::Bitcoin { address } => {
|
||||
[1.into_dart(), address.into_into_dart().into_dart()].into_dart()
|
||||
}
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
|
||||
for crate::model::ListPaymentDetails
|
||||
{
|
||||
}
|
||||
impl flutter_rust_bridge::IntoIntoDart<crate::model::ListPaymentDetails>
|
||||
for crate::model::ListPaymentDetails
|
||||
{
|
||||
fn into_into_dart(self) -> crate::model::ListPaymentDetails {
|
||||
self
|
||||
}
|
||||
}
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
impl flutter_rust_bridge::IntoDart for crate::model::ListPaymentsRequest {
|
||||
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
|
||||
[
|
||||
@@ -4278,6 +4446,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::ListPaymentsRequest {
|
||||
self.to_timestamp.into_into_dart().into_dart(),
|
||||
self.offset.into_into_dart().into_dart(),
|
||||
self.limit.into_into_dart().into_dart(),
|
||||
self.details.into_into_dart().into_dart(),
|
||||
]
|
||||
.into_dart()
|
||||
}
|
||||
@@ -4930,6 +5099,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::PaymentDetails {
|
||||
description,
|
||||
preimage,
|
||||
bolt11,
|
||||
payment_hash,
|
||||
refund_tx_id,
|
||||
refund_tx_amount_sat,
|
||||
} => [
|
||||
@@ -4938,6 +5108,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::PaymentDetails {
|
||||
description.into_into_dart().into_dart(),
|
||||
preimage.into_into_dart().into_dart(),
|
||||
bolt11.into_into_dart().into_dart(),
|
||||
payment_hash.into_into_dart().into_dart(),
|
||||
refund_tx_id.into_into_dart().into_dart(),
|
||||
refund_tx_amount_sat.into_into_dart().into_dart(),
|
||||
]
|
||||
@@ -5938,6 +6109,21 @@ impl SseEncode for crate::model::GetInfoResponse {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::model::GetPaymentRequest {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
match self {
|
||||
crate::model::GetPaymentRequest::Lightning { payment_hash } => {
|
||||
<i32>::sse_encode(0, serializer);
|
||||
<String>::sse_encode(payment_hash, serializer);
|
||||
}
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for i32 {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
@@ -6084,6 +6270,25 @@ impl SseEncode for Vec<crate::model::Payment> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for crate::model::ListPaymentDetails {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
match self {
|
||||
crate::model::ListPaymentDetails::Liquid { destination } => {
|
||||
<i32>::sse_encode(0, serializer);
|
||||
<String>::sse_encode(destination, serializer);
|
||||
}
|
||||
crate::model::ListPaymentDetails::Bitcoin { address } => {
|
||||
<i32>::sse_encode(1, serializer);
|
||||
<String>::sse_encode(address, serializer);
|
||||
}
|
||||
_ => {
|
||||
unimplemented!("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Vec<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) {
|
||||
@@ -6102,6 +6307,7 @@ impl SseEncode for crate::model::ListPaymentsRequest {
|
||||
<Option<i64>>::sse_encode(self.to_timestamp, serializer);
|
||||
<Option<u32>>::sse_encode(self.offset, serializer);
|
||||
<Option<u32>>::sse_encode(self.limit, serializer);
|
||||
<Option<crate::model::ListPaymentDetails>>::sse_encode(self.details, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6534,6 +6740,26 @@ impl SseEncode for Option<i64> {
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Option<crate::model::ListPaymentDetails> {
|
||||
// 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 {
|
||||
<crate::model::ListPaymentDetails>::sse_encode(value, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Option<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) {
|
||||
<bool>::sse_encode(self.is_some(), serializer);
|
||||
if let Some(value) = self {
|
||||
<crate::model::Payment>::sse_encode(value, serializer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SseEncode for Option<crate::bindings::SuccessActionProcessed> {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
|
||||
@@ -6633,6 +6859,7 @@ impl SseEncode for crate::model::PaymentDetails {
|
||||
description,
|
||||
preimage,
|
||||
bolt11,
|
||||
payment_hash,
|
||||
refund_tx_id,
|
||||
refund_tx_amount_sat,
|
||||
} => {
|
||||
@@ -6641,6 +6868,7 @@ impl SseEncode for crate::model::PaymentDetails {
|
||||
<String>::sse_encode(description, serializer);
|
||||
<Option<String>>::sse_encode(preimage, serializer);
|
||||
<Option<String>>::sse_encode(bolt11, serializer);
|
||||
<Option<String>>::sse_encode(payment_hash, serializer);
|
||||
<Option<String>>::sse_encode(refund_tx_id, serializer);
|
||||
<Option<u64>>::sse_encode(refund_tx_amount_sat, serializer);
|
||||
}
|
||||
@@ -7392,6 +7620,13 @@ mod io {
|
||||
CstDecode::<crate::model::ConnectRequest>::cst_decode(*wrap).into()
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::GetPaymentRequest> for *mut wire_cst_get_payment_request {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::GetPaymentRequest {
|
||||
let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) };
|
||||
CstDecode::<crate::model::GetPaymentRequest>::cst_decode(*wrap).into()
|
||||
}
|
||||
}
|
||||
impl CstDecode<i64> for *mut i64 {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> i64 {
|
||||
@@ -7405,6 +7640,13 @@ mod io {
|
||||
CstDecode::<crate::bindings::LiquidAddressData>::cst_decode(*wrap).into()
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::ListPaymentDetails> for *mut wire_cst_list_payment_details {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::ListPaymentDetails {
|
||||
let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) };
|
||||
CstDecode::<crate::model::ListPaymentDetails>::cst_decode(*wrap).into()
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::ListPaymentsRequest> for *mut wire_cst_list_payments_request {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::ListPaymentsRequest {
|
||||
@@ -7710,6 +7952,20 @@ mod io {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::GetPaymentRequest> for wire_cst_get_payment_request {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::GetPaymentRequest {
|
||||
match self.tag {
|
||||
0 => {
|
||||
let ans = unsafe { self.kind.Lightning };
|
||||
crate::model::GetPaymentRequest::Lightning {
|
||||
payment_hash: ans.payment_hash.cst_decode(),
|
||||
}
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::bindings::InputType> for wire_cst_input_type {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::bindings::InputType {
|
||||
@@ -7846,6 +8102,26 @@ mod io {
|
||||
vec.into_iter().map(CstDecode::cst_decode).collect()
|
||||
}
|
||||
}
|
||||
impl CstDecode<crate::model::ListPaymentDetails> for wire_cst_list_payment_details {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> crate::model::ListPaymentDetails {
|
||||
match self.tag {
|
||||
0 => {
|
||||
let ans = unsafe { self.kind.Liquid };
|
||||
crate::model::ListPaymentDetails::Liquid {
|
||||
destination: ans.destination.cst_decode(),
|
||||
}
|
||||
}
|
||||
1 => {
|
||||
let ans = unsafe { self.kind.Bitcoin };
|
||||
crate::model::ListPaymentDetails::Bitcoin {
|
||||
address: ans.address.cst_decode(),
|
||||
}
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
impl CstDecode<Vec<crate::model::PaymentType>> for *mut wire_cst_list_payment_type {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
fn cst_decode(self) -> Vec<crate::model::PaymentType> {
|
||||
@@ -7865,6 +8141,7 @@ mod io {
|
||||
to_timestamp: self.to_timestamp.cst_decode(),
|
||||
offset: self.offset.cst_decode(),
|
||||
limit: self.limit.cst_decode(),
|
||||
details: self.details.cst_decode(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8348,6 +8625,7 @@ mod io {
|
||||
description: ans.description.cst_decode(),
|
||||
preimage: ans.preimage.cst_decode(),
|
||||
bolt11: ans.bolt11.cst_decode(),
|
||||
payment_hash: ans.payment_hash.cst_decode(),
|
||||
refund_tx_id: ans.refund_tx_id.cst_decode(),
|
||||
refund_tx_amount_sat: ans.refund_tx_amount_sat.cst_decode(),
|
||||
}
|
||||
@@ -8994,6 +9272,19 @@ mod io {
|
||||
Self::new_with_null_ptr()
|
||||
}
|
||||
}
|
||||
impl NewWithNullPtr for wire_cst_get_payment_request {
|
||||
fn new_with_null_ptr() -> Self {
|
||||
Self {
|
||||
tag: -1,
|
||||
kind: GetPaymentRequestKind { nil__: () },
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Default for wire_cst_get_payment_request {
|
||||
fn default() -> Self {
|
||||
Self::new_with_null_ptr()
|
||||
}
|
||||
}
|
||||
impl NewWithNullPtr for wire_cst_input_type {
|
||||
fn new_with_null_ptr() -> Self {
|
||||
Self {
|
||||
@@ -9051,6 +9342,19 @@ mod io {
|
||||
Self::new_with_null_ptr()
|
||||
}
|
||||
}
|
||||
impl NewWithNullPtr for wire_cst_list_payment_details {
|
||||
fn new_with_null_ptr() -> Self {
|
||||
Self {
|
||||
tag: -1,
|
||||
kind: ListPaymentDetailsKind { nil__: () },
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Default for wire_cst_list_payment_details {
|
||||
fn default() -> Self {
|
||||
Self::new_with_null_ptr()
|
||||
}
|
||||
}
|
||||
impl NewWithNullPtr for wire_cst_list_payments_request {
|
||||
fn new_with_null_ptr() -> Self {
|
||||
Self {
|
||||
@@ -9059,6 +9363,7 @@ mod io {
|
||||
to_timestamp: core::ptr::null_mut(),
|
||||
offset: core::ptr::null_mut(),
|
||||
limit: core::ptr::null_mut(),
|
||||
details: core::ptr::null_mut(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9918,6 +10223,15 @@ mod io {
|
||||
wire__crate__bindings__BindingLiquidSdk_get_info_impl(port_, that)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_payment(
|
||||
port_: i64,
|
||||
that: usize,
|
||||
req: *mut wire_cst_get_payment_request,
|
||||
) {
|
||||
wire__crate__bindings__BindingLiquidSdk_get_payment_impl(port_, that, req)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_fiat_currencies(
|
||||
port_: i64,
|
||||
@@ -10243,6 +10557,14 @@ mod io {
|
||||
)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_get_payment_request(
|
||||
) -> *mut wire_cst_get_payment_request {
|
||||
flutter_rust_bridge::for_generated::new_leak_box_ptr(
|
||||
wire_cst_get_payment_request::new_with_null_ptr(),
|
||||
)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_i_64(value: i64) -> *mut i64 {
|
||||
flutter_rust_bridge::for_generated::new_leak_box_ptr(value)
|
||||
@@ -10256,6 +10578,14 @@ mod io {
|
||||
)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_list_payment_details(
|
||||
) -> *mut wire_cst_list_payment_details {
|
||||
flutter_rust_bridge::for_generated::new_leak_box_ptr(
|
||||
wire_cst_list_payment_details::new_with_null_ptr(),
|
||||
)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_list_payments_request(
|
||||
) -> *mut wire_cst_list_payments_request {
|
||||
@@ -10726,6 +11056,23 @@ mod io {
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_get_payment_request {
|
||||
tag: i32,
|
||||
kind: GetPaymentRequestKind,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub union GetPaymentRequestKind {
|
||||
Lightning: wire_cst_GetPaymentRequest_Lightning,
|
||||
nil__: (),
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_GetPaymentRequest_Lightning {
|
||||
payment_hash: *mut wire_cst_list_prim_u_8_strict,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_input_type {
|
||||
tag: i32,
|
||||
kind: InputTypeKind,
|
||||
@@ -10838,6 +11185,29 @@ mod io {
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_list_payment_details {
|
||||
tag: i32,
|
||||
kind: ListPaymentDetailsKind,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub union ListPaymentDetailsKind {
|
||||
Liquid: wire_cst_ListPaymentDetails_Liquid,
|
||||
Bitcoin: wire_cst_ListPaymentDetails_Bitcoin,
|
||||
nil__: (),
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_ListPaymentDetails_Liquid {
|
||||
destination: *mut wire_cst_list_prim_u_8_strict,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_ListPaymentDetails_Bitcoin {
|
||||
address: *mut wire_cst_list_prim_u_8_strict,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct wire_cst_list_payment_type {
|
||||
ptr: *mut i32,
|
||||
len: i32,
|
||||
@@ -10850,6 +11220,7 @@ mod io {
|
||||
to_timestamp: *mut i64,
|
||||
offset: *mut u32,
|
||||
limit: *mut u32,
|
||||
details: *mut wire_cst_list_payment_details,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
@@ -11279,6 +11650,7 @@ mod io {
|
||||
description: *mut wire_cst_list_prim_u_8_strict,
|
||||
preimage: *mut wire_cst_list_prim_u_8_strict,
|
||||
bolt11: *mut wire_cst_list_prim_u_8_strict,
|
||||
payment_hash: *mut wire_cst_list_prim_u_8_strict,
|
||||
refund_tx_id: *mut wire_cst_list_prim_u_8_strict,
|
||||
refund_tx_amount_sat: *mut u64,
|
||||
}
|
||||
|
||||
@@ -457,6 +457,24 @@ pub struct ListPaymentsRequest {
|
||||
pub to_timestamp: Option<i64>,
|
||||
pub offset: Option<u32>,
|
||||
pub limit: Option<u32>,
|
||||
pub details: Option<ListPaymentDetails>,
|
||||
}
|
||||
|
||||
/// An argument of [ListPaymentsRequest] when calling [crate::sdk::LiquidSdk::list_payments].
|
||||
#[derive(Debug, Serialize)]
|
||||
pub enum ListPaymentDetails {
|
||||
/// The Liquid BIP21 URI or address of the payment
|
||||
Liquid { destination: String },
|
||||
|
||||
/// The Bitcoin address of the payment
|
||||
Bitcoin { address: String },
|
||||
}
|
||||
|
||||
/// An argument when calling [crate::sdk::LiquidSdk::get_payment].
|
||||
#[derive(Debug, Serialize)]
|
||||
pub enum GetPaymentRequest {
|
||||
/// The Lightning payment hash of the payment
|
||||
Lightning { payment_hash: String },
|
||||
}
|
||||
|
||||
// A swap enum variant
|
||||
@@ -656,6 +674,7 @@ impl ChainSwap {
|
||||
pub(crate) struct SendSwap {
|
||||
pub(crate) id: String,
|
||||
pub(crate) invoice: String,
|
||||
pub(crate) payment_hash: Option<String>,
|
||||
pub(crate) description: Option<String>,
|
||||
pub(crate) preimage: Option<String>,
|
||||
pub(crate) payer_amount_sat: u64,
|
||||
@@ -741,6 +760,7 @@ pub(crate) struct ReceiveSwap {
|
||||
pub(crate) create_response_json: String,
|
||||
pub(crate) claim_private_key: String,
|
||||
pub(crate) invoice: String,
|
||||
pub(crate) payment_hash: Option<String>,
|
||||
pub(crate) description: Option<String>,
|
||||
/// The amount of the invoice
|
||||
pub(crate) payer_amount_sat: u64,
|
||||
@@ -1015,9 +1035,8 @@ pub struct PaymentSwapData {
|
||||
pub created_at: u32,
|
||||
|
||||
pub preimage: Option<String>,
|
||||
|
||||
pub bolt11: Option<String>,
|
||||
|
||||
pub payment_hash: Option<String>,
|
||||
pub description: String,
|
||||
|
||||
/// Amount sent by the swap payer
|
||||
@@ -1056,6 +1075,9 @@ pub enum PaymentDetails {
|
||||
/// In the case of a Receive payment, this is the invoice paid by the user
|
||||
bolt11: Option<String>,
|
||||
|
||||
/// The payment hash of the invoice
|
||||
payment_hash: Option<String>,
|
||||
|
||||
/// For a Send swap which was refunded, this is the refund tx id
|
||||
refund_tx_id: Option<String>,
|
||||
|
||||
@@ -1181,6 +1203,7 @@ impl Payment {
|
||||
swap_id: swap.swap_id,
|
||||
preimage: swap.preimage,
|
||||
bolt11: swap.bolt11,
|
||||
payment_hash: swap.payment_hash,
|
||||
description: swap.description,
|
||||
refund_tx_id: swap.refund_tx_id,
|
||||
refund_tx_amount_sat: swap.refund_tx_amount_sat,
|
||||
|
||||
@@ -94,5 +94,9 @@ pub(crate) fn current_migrations() -> Vec<&'static str> {
|
||||
|
||||
DROP TABLE payment_details_old;
|
||||
",
|
||||
"
|
||||
ALTER TABLE receive_swaps ADD COLUMN payment_hash TEXT;
|
||||
ALTER TABLE send_swaps ADD COLUMN payment_hash TEXT;
|
||||
",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::model::*;
|
||||
use crate::{get_invoice_description, utils};
|
||||
use anyhow::{anyhow, Result};
|
||||
use migrations::current_migrations;
|
||||
use rusqlite::{params, Connection, OptionalExtension, Row};
|
||||
use rusqlite::{params, params_from_iter, Connection, OptionalExtension, Row, ToSql};
|
||||
use rusqlite_migration::{Migrations, M};
|
||||
|
||||
const DEFAULT_DB_FILENAME: &str = "storage.sql";
|
||||
@@ -173,6 +173,7 @@ impl Persister {
|
||||
rs.id,
|
||||
rs.created_at,
|
||||
rs.invoice,
|
||||
rs.payment_hash,
|
||||
rs.description,
|
||||
rs.payer_amount_sat,
|
||||
rs.receiver_amount_sat,
|
||||
@@ -180,6 +181,7 @@ impl Persister {
|
||||
ss.id,
|
||||
ss.created_at,
|
||||
ss.invoice,
|
||||
ss.payment_hash,
|
||||
ss.description,
|
||||
ss.preimage,
|
||||
ss.refund_tx_id,
|
||||
@@ -246,36 +248,38 @@ impl Persister {
|
||||
let maybe_receive_swap_id: Option<String> = row.get(6)?;
|
||||
let maybe_receive_swap_created_at: Option<u32> = row.get(7)?;
|
||||
let maybe_receive_swap_invoice: Option<String> = row.get(8)?;
|
||||
let maybe_receive_swap_description: Option<String> = row.get(9)?;
|
||||
let maybe_receive_swap_payer_amount_sat: Option<u64> = row.get(10)?;
|
||||
let maybe_receive_swap_receiver_amount_sat: Option<u64> = row.get(11)?;
|
||||
let maybe_receive_swap_receiver_state: Option<PaymentState> = row.get(12)?;
|
||||
let maybe_receive_swap_payment_hash: Option<String> = row.get(9)?;
|
||||
let maybe_receive_swap_description: Option<String> = row.get(10)?;
|
||||
let maybe_receive_swap_payer_amount_sat: Option<u64> = row.get(11)?;
|
||||
let maybe_receive_swap_receiver_amount_sat: Option<u64> = row.get(12)?;
|
||||
let maybe_receive_swap_receiver_state: Option<PaymentState> = row.get(13)?;
|
||||
|
||||
let maybe_send_swap_id: Option<String> = row.get(13)?;
|
||||
let maybe_send_swap_created_at: Option<u32> = row.get(14)?;
|
||||
let maybe_send_swap_invoice: Option<String> = row.get(15)?;
|
||||
let maybe_send_swap_description: Option<String> = row.get(16)?;
|
||||
let maybe_send_swap_preimage: Option<String> = row.get(17)?;
|
||||
let maybe_send_swap_refund_tx_id: Option<String> = row.get(18)?;
|
||||
let maybe_send_swap_payer_amount_sat: Option<u64> = row.get(19)?;
|
||||
let maybe_send_swap_receiver_amount_sat: Option<u64> = row.get(20)?;
|
||||
let maybe_send_swap_state: Option<PaymentState> = row.get(21)?;
|
||||
let maybe_send_swap_id: Option<String> = row.get(14)?;
|
||||
let maybe_send_swap_created_at: Option<u32> = row.get(15)?;
|
||||
let maybe_send_swap_invoice: Option<String> = row.get(16)?;
|
||||
let maybe_send_swap_payment_hash: Option<String> = row.get(17)?;
|
||||
let maybe_send_swap_description: Option<String> = row.get(18)?;
|
||||
let maybe_send_swap_preimage: Option<String> = row.get(19)?;
|
||||
let maybe_send_swap_refund_tx_id: Option<String> = row.get(20)?;
|
||||
let maybe_send_swap_payer_amount_sat: Option<u64> = row.get(21)?;
|
||||
let maybe_send_swap_receiver_amount_sat: Option<u64> = row.get(22)?;
|
||||
let maybe_send_swap_state: Option<PaymentState> = row.get(23)?;
|
||||
|
||||
let maybe_chain_swap_id: Option<String> = row.get(22)?;
|
||||
let maybe_chain_swap_created_at: Option<u32> = row.get(23)?;
|
||||
let maybe_chain_swap_direction: Option<Direction> = row.get(24)?;
|
||||
let maybe_chain_swap_preimage: Option<String> = row.get(25)?;
|
||||
let maybe_chain_swap_description: Option<String> = row.get(26)?;
|
||||
let maybe_chain_swap_refund_tx_id: Option<String> = row.get(27)?;
|
||||
let maybe_chain_swap_payer_amount_sat: Option<u64> = row.get(28)?;
|
||||
let maybe_chain_swap_receiver_amount_sat: Option<u64> = row.get(29)?;
|
||||
let maybe_chain_swap_claim_address: Option<String> = row.get(30)?;
|
||||
let maybe_chain_swap_state: Option<PaymentState> = row.get(31)?;
|
||||
let maybe_chain_swap_id: Option<String> = row.get(24)?;
|
||||
let maybe_chain_swap_created_at: Option<u32> = row.get(25)?;
|
||||
let maybe_chain_swap_direction: Option<Direction> = row.get(26)?;
|
||||
let maybe_chain_swap_preimage: Option<String> = row.get(27)?;
|
||||
let maybe_chain_swap_description: Option<String> = row.get(28)?;
|
||||
let maybe_chain_swap_refund_tx_id: Option<String> = row.get(29)?;
|
||||
let maybe_chain_swap_payer_amount_sat: Option<u64> = row.get(30)?;
|
||||
let maybe_chain_swap_receiver_amount_sat: Option<u64> = row.get(31)?;
|
||||
let maybe_chain_swap_claim_address: Option<String> = row.get(32)?;
|
||||
let maybe_chain_swap_state: Option<PaymentState> = row.get(33)?;
|
||||
|
||||
let maybe_swap_refund_tx_amount_sat: Option<u64> = row.get(32)?;
|
||||
let maybe_swap_refund_tx_amount_sat: Option<u64> = row.get(34)?;
|
||||
|
||||
let maybe_payment_details_destination: Option<String> = row.get(33)?;
|
||||
let maybe_payment_details_description: Option<String> = row.get(34)?;
|
||||
let maybe_payment_details_destination: Option<String> = row.get(35)?;
|
||||
let maybe_payment_details_description: Option<String> = row.get(36)?;
|
||||
|
||||
let (swap, payment_type) = match maybe_receive_swap_id {
|
||||
Some(receive_swap_id) => (
|
||||
@@ -285,6 +289,7 @@ impl Persister {
|
||||
created_at: maybe_receive_swap_created_at.unwrap_or(utils::now()),
|
||||
preimage: None,
|
||||
bolt11: maybe_receive_swap_invoice.clone(),
|
||||
payment_hash: maybe_receive_swap_payment_hash,
|
||||
description: maybe_receive_swap_description.unwrap_or_else(|| {
|
||||
maybe_receive_swap_invoice
|
||||
.and_then(|bolt11| get_invoice_description!(bolt11))
|
||||
@@ -307,6 +312,7 @@ impl Persister {
|
||||
created_at: maybe_send_swap_created_at.unwrap_or(utils::now()),
|
||||
preimage: maybe_send_swap_preimage,
|
||||
bolt11: maybe_send_swap_invoice.clone(),
|
||||
payment_hash: maybe_send_swap_payment_hash,
|
||||
description: maybe_send_swap_description.unwrap_or_else(|| {
|
||||
maybe_send_swap_invoice
|
||||
.and_then(|bolt11| get_invoice_description!(bolt11))
|
||||
@@ -329,6 +335,7 @@ impl Persister {
|
||||
created_at: maybe_chain_swap_created_at.unwrap_or(utils::now()),
|
||||
preimage: maybe_chain_swap_preimage,
|
||||
bolt11: None,
|
||||
payment_hash: None,
|
||||
description: maybe_chain_swap_description
|
||||
.unwrap_or("Bitcoin transfer".to_string()),
|
||||
payer_amount_sat: maybe_chain_swap_payer_amount_sat.unwrap_or(0),
|
||||
@@ -354,6 +361,7 @@ impl Persister {
|
||||
swap_type: PaymentSwapType::Receive,
|
||||
swap_id,
|
||||
bolt11,
|
||||
payment_hash,
|
||||
refund_tx_id,
|
||||
preimage,
|
||||
refund_tx_amount_sat,
|
||||
@@ -363,6 +371,7 @@ impl Persister {
|
||||
swap_type: PaymentSwapType::Send,
|
||||
swap_id,
|
||||
bolt11,
|
||||
payment_hash,
|
||||
preimage,
|
||||
refund_tx_id,
|
||||
refund_tx_amount_sat,
|
||||
@@ -372,6 +381,7 @@ impl Persister {
|
||||
swap_id,
|
||||
preimage,
|
||||
bolt11,
|
||||
payment_hash,
|
||||
refund_tx_id,
|
||||
refund_tx_amount_sat,
|
||||
description: description.unwrap_or("Liquid transfer".to_string()),
|
||||
@@ -404,7 +414,7 @@ impl Persister {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_payment(&self, id: String) -> Result<Option<Payment>> {
|
||||
pub fn get_payment(&self, id: &str) -> Result<Option<Payment>> {
|
||||
Ok(self
|
||||
.get_connection()?
|
||||
.query_row(
|
||||
@@ -415,9 +425,25 @@ impl Persister {
|
||||
.optional()?)
|
||||
}
|
||||
|
||||
pub fn get_payment_by_request(&self, req: &GetPaymentRequest) -> Result<Option<Payment>> {
|
||||
let (where_clause, param) = match req {
|
||||
GetPaymentRequest::Lightning { payment_hash } => (
|
||||
"(rs.payment_hash = ?1 OR ss.payment_hash = ?1)",
|
||||
payment_hash,
|
||||
),
|
||||
};
|
||||
Ok(self
|
||||
.get_connection()?
|
||||
.query_row(
|
||||
&self.select_payment_query(Some(where_clause), None, None),
|
||||
params![param],
|
||||
|row| self.sql_row_to_payment(row),
|
||||
)
|
||||
.optional()?)
|
||||
}
|
||||
|
||||
pub fn get_payments(&self, req: &ListPaymentsRequest) -> Result<Vec<Payment>> {
|
||||
let where_clause =
|
||||
filter_to_where_clause(req.filters.clone(), req.from_timestamp, req.to_timestamp);
|
||||
let (where_clause, where_params) = filter_to_where_clause(req);
|
||||
let maybe_where_clause = match where_clause.is_empty() {
|
||||
false => Some(where_clause.as_str()),
|
||||
true => None,
|
||||
@@ -428,28 +454,29 @@ impl Persister {
|
||||
let mut stmt =
|
||||
con.prepare(&self.select_payment_query(maybe_where_clause, req.offset, req.limit))?;
|
||||
let payments: Vec<Payment> = stmt
|
||||
.query_map(params![], |row| self.sql_row_to_payment(row))?
|
||||
.query_map(params_from_iter(where_params), |row| {
|
||||
self.sql_row_to_payment(row)
|
||||
})?
|
||||
.map(|i| i.unwrap())
|
||||
.collect();
|
||||
Ok(payments)
|
||||
}
|
||||
}
|
||||
|
||||
fn filter_to_where_clause(
|
||||
type_filters: Option<Vec<PaymentType>>,
|
||||
from_timestamp: Option<i64>,
|
||||
to_timestamp: Option<i64>,
|
||||
) -> String {
|
||||
fn filter_to_where_clause(req: &ListPaymentsRequest) -> (String, Vec<Box<dyn ToSql + '_>>) {
|
||||
let mut where_clause: Vec<String> = Vec::new();
|
||||
let mut where_params: Vec<Box<dyn ToSql>> = Vec::new();
|
||||
|
||||
if let Some(t) = from_timestamp {
|
||||
where_clause.push(format!("coalesce(ptx.timestamp, rs.created_at) >= {t}"));
|
||||
if let Some(t) = req.from_timestamp {
|
||||
where_clause.push("coalesce(ptx.timestamp, rs.created_at) >= ?".to_string());
|
||||
where_params.push(Box::new(t));
|
||||
};
|
||||
if let Some(t) = to_timestamp {
|
||||
where_clause.push(format!("coalesce(ptx.timestamp, rs.created_at) <= {t}"));
|
||||
if let Some(t) = req.to_timestamp {
|
||||
where_clause.push("coalesce(ptx.timestamp, rs.created_at) <= ?".to_string());
|
||||
where_params.push(Box::new(t));
|
||||
};
|
||||
|
||||
if let Some(filters) = type_filters {
|
||||
if let Some(filters) = &req.filters {
|
||||
if !filters.is_empty() {
|
||||
let mut type_filter_clause: HashSet<PaymentType> = HashSet::new();
|
||||
for type_filter in filters {
|
||||
@@ -474,7 +501,20 @@ fn filter_to_where_clause(
|
||||
}
|
||||
}
|
||||
|
||||
where_clause.join(" and ")
|
||||
if let Some(details) = &req.details {
|
||||
match details {
|
||||
ListPaymentDetails::Bitcoin { address } => {
|
||||
where_clause.push("cs.claim_address = ?".to_string());
|
||||
where_params.push(Box::new(address));
|
||||
}
|
||||
ListPaymentDetails::Liquid { destination } => {
|
||||
where_clause.push("pd.destination = ?".to_string());
|
||||
where_params.push(Box::new(destination));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(where_clause.join(" and "), where_params)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -507,7 +547,7 @@ mod tests {
|
||||
})?
|
||||
.first()
|
||||
.is_some());
|
||||
assert!(storage.get_payment(payment_tx_data.tx_id)?.is_some());
|
||||
assert!(storage.get_payment(&payment_tx_data.tx_id)?.is_some());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ impl Persister {
|
||||
create_response_json,
|
||||
claim_private_key,
|
||||
invoice,
|
||||
payment_hash,
|
||||
description,
|
||||
payer_amount_sat,
|
||||
receiver_amount_sat,
|
||||
@@ -32,7 +33,7 @@ impl Persister {
|
||||
claim_tx_id,
|
||||
state
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
)?;
|
||||
let id_hash = sha256::Hash::hash(receive_swap.id.as_bytes()).to_hex();
|
||||
_ = stmt.execute((
|
||||
@@ -42,6 +43,7 @@ impl Persister {
|
||||
&receive_swap.create_response_json,
|
||||
&receive_swap.claim_private_key,
|
||||
&receive_swap.invoice,
|
||||
&receive_swap.payment_hash,
|
||||
&receive_swap.description,
|
||||
&receive_swap.payer_amount_sat,
|
||||
&receive_swap.receiver_amount_sat,
|
||||
@@ -69,6 +71,7 @@ impl Persister {
|
||||
rs.create_response_json,
|
||||
rs.claim_private_key,
|
||||
rs.invoice,
|
||||
rs.payment_hash,
|
||||
rs.description,
|
||||
rs.payer_amount_sat,
|
||||
rs.receiver_amount_sat,
|
||||
@@ -109,13 +112,14 @@ impl Persister {
|
||||
create_response_json: row.get(2)?,
|
||||
claim_private_key: row.get(3)?,
|
||||
invoice: row.get(4)?,
|
||||
description: row.get(5)?,
|
||||
payer_amount_sat: row.get(6)?,
|
||||
receiver_amount_sat: row.get(7)?,
|
||||
claim_fees_sat: row.get(8)?,
|
||||
claim_tx_id: row.get(9)?,
|
||||
created_at: row.get(10)?,
|
||||
state: row.get(11)?,
|
||||
payment_hash: row.get(5)?,
|
||||
description: row.get(6)?,
|
||||
payer_amount_sat: row.get(7)?,
|
||||
receiver_amount_sat: row.get(8)?,
|
||||
claim_fees_sat: row.get(9)?,
|
||||
claim_tx_id: row.get(10)?,
|
||||
created_at: row.get(11)?,
|
||||
state: row.get(12)?,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ impl Persister {
|
||||
id,
|
||||
id_hash,
|
||||
invoice,
|
||||
payment_hash,
|
||||
description,
|
||||
payer_amount_sat,
|
||||
receiver_amount_sat,
|
||||
@@ -31,13 +32,14 @@ impl Persister {
|
||||
created_at,
|
||||
state
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
||||
)?;
|
||||
let id_hash = sha256::Hash::hash(send_swap.id.as_bytes()).to_hex();
|
||||
_ = stmt.execute((
|
||||
&send_swap.id,
|
||||
&id_hash,
|
||||
&send_swap.invoice,
|
||||
&send_swap.payment_hash,
|
||||
&send_swap.description,
|
||||
&send_swap.payer_amount_sat,
|
||||
&send_swap.receiver_amount_sat,
|
||||
@@ -87,6 +89,7 @@ impl Persister {
|
||||
SELECT
|
||||
id,
|
||||
invoice,
|
||||
payment_hash,
|
||||
description,
|
||||
preimage,
|
||||
payer_amount_sat,
|
||||
@@ -124,16 +127,17 @@ impl Persister {
|
||||
Ok(SendSwap {
|
||||
id: row.get(0)?,
|
||||
invoice: row.get(1)?,
|
||||
description: row.get(2)?,
|
||||
preimage: row.get(3)?,
|
||||
payer_amount_sat: row.get(4)?,
|
||||
receiver_amount_sat: row.get(5)?,
|
||||
create_response_json: row.get(6)?,
|
||||
refund_private_key: row.get(7)?,
|
||||
lockup_tx_id: row.get(8)?,
|
||||
refund_tx_id: row.get(9)?,
|
||||
created_at: row.get(10)?,
|
||||
state: row.get(11)?,
|
||||
payment_hash: row.get(2)?,
|
||||
description: row.get(3)?,
|
||||
preimage: row.get(4)?,
|
||||
payer_amount_sat: row.get(5)?,
|
||||
receiver_amount_sat: row.get(6)?,
|
||||
create_response_json: row.get(7)?,
|
||||
refund_private_key: row.get(8)?,
|
||||
lockup_tx_id: row.get(9)?,
|
||||
refund_tx_id: row.get(10)?,
|
||||
created_at: row.get(11)?,
|
||||
state: row.get(12)?,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ impl LiquidSdk {
|
||||
|
||||
async fn emit_payment_updated(&self, payment_id: Option<String>) -> Result<()> {
|
||||
if let Some(id) = payment_id {
|
||||
match self.persister.get_payment(id.clone())? {
|
||||
match self.persister.get_payment(&id)? {
|
||||
Some(payment) => {
|
||||
match payment.status {
|
||||
Complete => {
|
||||
@@ -546,11 +546,10 @@ impl LiquidSdk {
|
||||
}
|
||||
|
||||
fn validate_invoice(&self, invoice: &str) -> Result<Bolt11Invoice, PaymentError> {
|
||||
let invoice = invoice.trim().parse::<Bolt11Invoice>().map_err(|err| {
|
||||
PaymentError::InvalidInvoice {
|
||||
err: err.to_string(),
|
||||
}
|
||||
})?;
|
||||
let invoice = invoice
|
||||
.trim()
|
||||
.parse::<Bolt11Invoice>()
|
||||
.map_err(|err| PaymentError::invalid_invoice(&err.to_string()))?;
|
||||
|
||||
match (invoice.network().to_string().as_str(), self.config.network) {
|
||||
("bitcoin", LiquidNetwork::Mainnet) => {}
|
||||
@@ -564,9 +563,7 @@ impl LiquidSdk {
|
||||
|
||||
ensure_sdk!(
|
||||
!invoice.is_expired(),
|
||||
PaymentError::InvalidInvoice {
|
||||
err: "Invoice has expired".to_string()
|
||||
}
|
||||
PaymentError::invalid_invoice("Invoice has expired")
|
||||
);
|
||||
|
||||
Ok(invoice)
|
||||
@@ -970,9 +967,19 @@ impl LiquidSdk {
|
||||
invoice: &str,
|
||||
fees_sat: u64,
|
||||
) -> Result<SendPaymentResponse, PaymentError> {
|
||||
let receiver_amount_sat = get_invoice_amount!(invoice);
|
||||
let lbtc_pair = self.validate_submarine_pairs(receiver_amount_sat)?;
|
||||
let bolt11_invoice = invoice
|
||||
.trim()
|
||||
.parse::<Bolt11Invoice>()
|
||||
.map_err(|err| PaymentError::invalid_invoice(&err.to_string()))?;
|
||||
let receiver_amount_sat =
|
||||
bolt11_invoice
|
||||
.amount_milli_satoshis()
|
||||
.ok_or(PaymentError::invalid_invoice(
|
||||
"Invoice does not contain an amount",
|
||||
))?
|
||||
/ 1000;
|
||||
|
||||
let lbtc_pair = self.validate_submarine_pairs(receiver_amount_sat)?;
|
||||
let boltz_fees_total = lbtc_pair.fees.total(receiver_amount_sat);
|
||||
let lockup_tx_fees_sat = self
|
||||
.estimate_lockup_tx_fee_send(receiver_amount_sat + boltz_fees_total)
|
||||
@@ -987,10 +994,9 @@ impl LiquidSdk {
|
||||
Pending => return Err(PaymentError::PaymentInProgress),
|
||||
Complete => return Err(PaymentError::AlreadyPaid),
|
||||
RefundPending | Failed => {
|
||||
return Err(PaymentError::InvalidInvoice {
|
||||
err: "Payment has already failed. Please try with another invoice."
|
||||
.to_string(),
|
||||
})
|
||||
return Err(PaymentError::invalid_invoice(
|
||||
"Payment has already failed. Please try with another invoice",
|
||||
))
|
||||
}
|
||||
_ => swap,
|
||||
},
|
||||
@@ -1023,12 +1029,17 @@ impl LiquidSdk {
|
||||
let swap_id = &create_response.id;
|
||||
let create_response_json =
|
||||
SendSwap::from_boltz_struct_to_json(&create_response, swap_id)?;
|
||||
let description = get_invoice_description!(invoice);
|
||||
let payment_hash = bolt11_invoice.payment_hash().to_string();
|
||||
let description = match bolt11_invoice.description() {
|
||||
Bolt11InvoiceDescription::Direct(msg) => Some(msg.to_string()),
|
||||
Bolt11InvoiceDescription::Hash(_) => None,
|
||||
};
|
||||
|
||||
let payer_amount_sat = fees_sat + receiver_amount_sat;
|
||||
let swap = SendSwap {
|
||||
id: swap_id.clone(),
|
||||
invoice: invoice.to_string(),
|
||||
payment_hash: Some(payment_hash),
|
||||
description,
|
||||
preimage: None,
|
||||
payer_amount_sat,
|
||||
@@ -1593,26 +1604,22 @@ impl LiquidSdk {
|
||||
);
|
||||
|
||||
let swap_id = create_response.id.clone();
|
||||
let invoice = Bolt11Invoice::from_str(&create_response.invoice).map_err(|err| {
|
||||
PaymentError::InvalidInvoice {
|
||||
err: err.to_string(),
|
||||
}
|
||||
})?;
|
||||
let invoice = Bolt11Invoice::from_str(&create_response.invoice)
|
||||
.map_err(|err| PaymentError::invalid_invoice(&err.to_string()))?;
|
||||
let payer_amount_sat =
|
||||
invoice
|
||||
.amount_milli_satoshis()
|
||||
.ok_or(PaymentError::InvalidInvoice {
|
||||
err: "Invoice does not contain an amount".to_string(),
|
||||
})?
|
||||
.ok_or(PaymentError::invalid_invoice(
|
||||
"Invoice does not contain an amount",
|
||||
))?
|
||||
/ 1000;
|
||||
|
||||
// Double check that the generated invoice includes our data
|
||||
// https://docs.boltz.exchange/v/api/dont-trust-verify#lightning-invoice-verification
|
||||
if invoice.payment_hash().to_string() != preimage_hash {
|
||||
return Err(PaymentError::InvalidInvoice {
|
||||
err: "Invalid preimage returned by swapper".to_string(),
|
||||
});
|
||||
};
|
||||
ensure_sdk!(
|
||||
invoice.payment_hash().to_string() == preimage_hash,
|
||||
PaymentError::invalid_invoice("Invalid preimage returned by swapper")
|
||||
);
|
||||
|
||||
let create_response_json = ReceiveSwap::from_boltz_struct_to_json(
|
||||
&create_response,
|
||||
@@ -1630,6 +1637,7 @@ impl LiquidSdk {
|
||||
create_response_json,
|
||||
claim_private_key: keypair.display_secret().to_string(),
|
||||
invoice: invoice.to_string(),
|
||||
payment_hash: Some(preimage_hash),
|
||||
description: invoice_description,
|
||||
payer_amount_sat,
|
||||
receiver_amount_sat,
|
||||
@@ -2040,6 +2048,25 @@ impl LiquidSdk {
|
||||
Ok(self.persister.get_payments(req)?)
|
||||
}
|
||||
|
||||
/// Retrieves a payment.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `req` - the [GetPaymentRequest] containing:
|
||||
/// * [GetPaymentRequest::Lightning] - the `payment_hash` of the lightning invoice
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// Returns an `Option<Payment>` if found, or `None` if no payment matches the given request.
|
||||
pub async fn get_payment(
|
||||
&self,
|
||||
req: &GetPaymentRequest,
|
||||
) -> Result<Option<Payment>, PaymentError> {
|
||||
self.ensure_is_started().await?;
|
||||
|
||||
Ok(self.persister.get_payment_by_request(req)?)
|
||||
}
|
||||
|
||||
/// Empties the Liquid Wallet cache for the [Config::network].
|
||||
pub fn empty_wallet_cache(&self) -> Result<()> {
|
||||
let mut path = PathBuf::from(self.config.working_dir.clone());
|
||||
@@ -2332,7 +2359,7 @@ impl LiquidSdk {
|
||||
|
||||
/// Parses a string into an [LNInvoice]. See [invoice::parse_invoice].
|
||||
pub fn parse_invoice(input: &str) -> Result<LNInvoice, PaymentError> {
|
||||
parse_invoice(input).map_err(|e| PaymentError::InvalidInvoice { err: e.to_string() })
|
||||
parse_invoice(input).map_err(|e| PaymentError::invalid_invoice(&e.to_string()))
|
||||
}
|
||||
|
||||
/// Configures a global SDK logger that will log to file and will forward log events to
|
||||
|
||||
@@ -534,10 +534,8 @@ impl SendSwapHandler {
|
||||
fn verify_payment_hash(preimage: &str, invoice: &str) -> Result<(), PaymentError> {
|
||||
let preimage = Preimage::from_str(preimage)?;
|
||||
let preimage_hash = preimage.sha256.to_string();
|
||||
let invoice =
|
||||
Bolt11Invoice::from_str(invoice).map_err(|err| PaymentError::InvalidInvoice {
|
||||
err: err.to_string(),
|
||||
})?;
|
||||
let invoice = Bolt11Invoice::from_str(invoice)
|
||||
.map_err(|err| PaymentError::invalid_invoice(&err.to_string()))?;
|
||||
let invoice_payment_hash = invoice.payment_hash();
|
||||
|
||||
(invoice_payment_hash.to_string() == preimage_hash)
|
||||
|
||||
@@ -29,9 +29,10 @@ fn new_secret_key() -> SecretKey {
|
||||
pub(crate) fn new_send_swap(payment_state: Option<PaymentState>) -> SendSwap {
|
||||
let private_key = new_secret_key();
|
||||
|
||||
let payment_hash = sha256::Hash::from_slice(&[0; 32][..]).expect("Expecting valid hash");
|
||||
let invoice = InvoiceBuilder::new(Currency::BitcoinTestnet)
|
||||
.description("Test invoice".into())
|
||||
.payment_hash(sha256::Hash::from_slice(&[0; 32][..]).expect("Expecting valid hash"))
|
||||
.payment_hash(payment_hash.clone())
|
||||
.payment_secret(PaymentSecret([42u8; 32]))
|
||||
.current_timestamp()
|
||||
.min_final_cltv_expiry_delta(144)
|
||||
@@ -41,6 +42,7 @@ pub(crate) fn new_send_swap(payment_state: Option<PaymentState>) -> SendSwap {
|
||||
SendSwap {
|
||||
id: generate_random_string(4),
|
||||
invoice: invoice.to_string(),
|
||||
payment_hash: Some(payment_hash.to_string()),
|
||||
description: Some("Send to BTC lightning".to_string()),
|
||||
preimage: None,
|
||||
payer_amount_sat: 1149,
|
||||
@@ -96,6 +98,7 @@ pub(crate) fn new_receive_swap(payment_state: Option<PaymentState>) -> ReceiveSw
|
||||
}"#.to_string(),
|
||||
claim_private_key: "179dc5137d2c211fb84e2159252832658afb6d03e095fb5cf324a2b782d2a5ca".to_string(),
|
||||
invoice: "lntb10u1pngqdj3pp5ujsq2txha9nnjwm3sql0t3g8hy67d6qvrr0ykygtycej44jvdljqdpz2djkuepqw3hjqnpdgf2yxgrpv3j8yetnwvcqz95xqyp2xqrzjqf4rczme3t5y9s94fkx7xcgwhj6zy9t56rwqhez9gl8s52k0scz8gzzxeyqq28qqqqqqqqqqqqqqq9gq2ysp5fmynazrpmuz05vp8r5dxpu9cupkaus7hcd258saklp3v79azt6qs9qxpqysgq5sxknac9fwe69q5vzffgayjddskzhjeyu6h8vx45m4svchsy2e3rv6yc3puht7pjzvhwfl7ljamkzfy2dsa75fxd5j82ug0ty0y4xhgq82gc9k".to_string(),
|
||||
payment_hash: Some("e4a0052cd7e967393b71803ef5c507b935e6e80c18de4b110b26332ad64c6fe4".to_string()),
|
||||
payer_amount_sat: 1000,
|
||||
receiver_amount_sat: 587,
|
||||
claim_fees_sat: 200,
|
||||
|
||||
@@ -78,13 +78,12 @@ impl Swapper for MockSwapper {
|
||||
&self,
|
||||
req: boltz_client::swaps::boltz::CreateSubmarineRequest,
|
||||
) -> Result<CreateSubmarineResponse, PaymentError> {
|
||||
let invoice = parse_invoice(&req.invoice).map_err(|err| PaymentError::InvalidInvoice {
|
||||
err: err.to_string(),
|
||||
})?;
|
||||
let invoice = parse_invoice(&req.invoice)
|
||||
.map_err(|err| PaymentError::invalid_invoice(&err.to_string()))?;
|
||||
let Some(amount_msat) = invoice.amount_msat else {
|
||||
return Err(PaymentError::InvalidInvoice {
|
||||
err: "Invoice must contain an amount".to_string(),
|
||||
});
|
||||
return Err(PaymentError::invalid_invoice(
|
||||
"Invoice does not contain an amount",
|
||||
));
|
||||
};
|
||||
|
||||
Ok(CreateSubmarineResponse {
|
||||
|
||||
@@ -51,6 +51,8 @@ abstract class BindingLiquidSdk implements RustOpaqueInterface {
|
||||
|
||||
Future<GetInfoResponse> getInfo();
|
||||
|
||||
Future<Payment?> getPayment({required GetPaymentRequest req});
|
||||
|
||||
Future<List<FiatCurrency>> listFiatCurrencies();
|
||||
|
||||
Future<List<Payment>> listPayments({required ListPaymentsRequest req});
|
||||
|
||||
@@ -65,7 +65,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
||||
String get codegenVersion => '2.4.0';
|
||||
|
||||
@override
|
||||
int get rustContentHash => 1532646653;
|
||||
int get rustContentHash => 1147354100;
|
||||
|
||||
static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig(
|
||||
stem: 'breez_sdk_liquid',
|
||||
@@ -99,6 +99,9 @@ abstract class RustLibApi extends BaseApi {
|
||||
|
||||
Future<GetInfoResponse> crateBindingsBindingLiquidSdkGetInfo({required BindingLiquidSdk that});
|
||||
|
||||
Future<Payment?> crateBindingsBindingLiquidSdkGetPayment(
|
||||
{required BindingLiquidSdk that, required GetPaymentRequest req});
|
||||
|
||||
Future<List<FiatCurrency>> crateBindingsBindingLiquidSdkListFiatCurrencies(
|
||||
{required BindingLiquidSdk that});
|
||||
|
||||
@@ -437,6 +440,32 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
argNames: ["that"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<Payment?> crateBindingsBindingLiquidSdkGetPayment(
|
||||
{required BindingLiquidSdk that, required GetPaymentRequest req}) {
|
||||
return handler.executeNormal(NormalTask(
|
||||
callFfi: (port_) {
|
||||
var arg0 =
|
||||
cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(
|
||||
that);
|
||||
var arg1 = cst_encode_box_autoadd_get_payment_request(req);
|
||||
return wire.wire__crate__bindings__BindingLiquidSdk_get_payment(port_, arg0, arg1);
|
||||
},
|
||||
codec: DcoCodec(
|
||||
decodeSuccessData: dco_decode_opt_box_autoadd_payment,
|
||||
decodeErrorData: dco_decode_payment_error,
|
||||
),
|
||||
constMeta: kCrateBindingsBindingLiquidSdkGetPaymentConstMeta,
|
||||
argValues: [that, req],
|
||||
apiImpl: this,
|
||||
));
|
||||
}
|
||||
|
||||
TaskConstMeta get kCrateBindingsBindingLiquidSdkGetPaymentConstMeta => const TaskConstMeta(
|
||||
debugName: "BindingLiquidSdk_get_payment",
|
||||
argNames: ["that", "req"],
|
||||
);
|
||||
|
||||
@override
|
||||
Future<List<FiatCurrency>> crateBindingsBindingLiquidSdkListFiatCurrencies(
|
||||
{required BindingLiquidSdk that}) {
|
||||
@@ -1311,6 +1340,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return dco_decode_connect_request(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
GetPaymentRequest dco_decode_box_autoadd_get_payment_request(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return dco_decode_get_payment_request(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
PlatformInt64 dco_decode_box_autoadd_i_64(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -1323,6 +1358,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return dco_decode_liquid_address_data(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
ListPaymentDetails dco_decode_box_autoadd_list_payment_details(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return dco_decode_list_payment_details(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
ListPaymentsRequest dco_decode_box_autoadd_list_payments_request(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -1617,6 +1658,19 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
);
|
||||
}
|
||||
|
||||
@protected
|
||||
GetPaymentRequest dco_decode_get_payment_request(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
switch (raw[0]) {
|
||||
case 0:
|
||||
return GetPaymentRequest_Lightning(
|
||||
paymentHash: dco_decode_String(raw[1]),
|
||||
);
|
||||
default:
|
||||
throw Exception("unreachable");
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
int dco_decode_i_32(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -1742,6 +1796,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return (raw as List<dynamic>).map(dco_decode_payment).toList();
|
||||
}
|
||||
|
||||
@protected
|
||||
ListPaymentDetails dco_decode_list_payment_details(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
switch (raw[0]) {
|
||||
case 0:
|
||||
return ListPaymentDetails_Liquid(
|
||||
destination: dco_decode_String(raw[1]),
|
||||
);
|
||||
case 1:
|
||||
return ListPaymentDetails_Bitcoin(
|
||||
address: dco_decode_String(raw[1]),
|
||||
);
|
||||
default:
|
||||
throw Exception("unreachable");
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
List<PaymentType> dco_decode_list_payment_type(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -1752,13 +1823,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
ListPaymentsRequest dco_decode_list_payments_request(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
final arr = raw as List<dynamic>;
|
||||
if (arr.length != 5) throw Exception('unexpected arr length: expect 5 but see ${arr.length}');
|
||||
if (arr.length != 6) throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
|
||||
return ListPaymentsRequest(
|
||||
filters: dco_decode_opt_list_payment_type(arr[0]),
|
||||
fromTimestamp: dco_decode_opt_box_autoadd_i_64(arr[1]),
|
||||
toTimestamp: dco_decode_opt_box_autoadd_i_64(arr[2]),
|
||||
offset: dco_decode_opt_box_autoadd_u_32(arr[3]),
|
||||
limit: dco_decode_opt_box_autoadd_u_32(arr[4]),
|
||||
details: dco_decode_opt_box_autoadd_list_payment_details(arr[5]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2171,6 +2243,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return raw == null ? null : dco_decode_box_autoadd_i_64(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
ListPaymentDetails? dco_decode_opt_box_autoadd_list_payment_details(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return raw == null ? null : dco_decode_box_autoadd_list_payment_details(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
Payment? dco_decode_opt_box_autoadd_payment(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
return raw == null ? null : dco_decode_box_autoadd_payment(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
SuccessActionProcessed? dco_decode_opt_box_autoadd_success_action_processed(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
@@ -2254,8 +2338,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
description: dco_decode_String(raw[2]),
|
||||
preimage: dco_decode_opt_String(raw[3]),
|
||||
bolt11: dco_decode_opt_String(raw[4]),
|
||||
refundTxId: dco_decode_opt_String(raw[5]),
|
||||
refundTxAmountSat: dco_decode_opt_box_autoadd_u_64(raw[6]),
|
||||
paymentHash: dco_decode_opt_String(raw[5]),
|
||||
refundTxId: dco_decode_opt_String(raw[6]),
|
||||
refundTxAmountSat: dco_decode_opt_box_autoadd_u_64(raw[7]),
|
||||
);
|
||||
case 1:
|
||||
return PaymentDetails_Liquid(
|
||||
@@ -2960,6 +3045,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return (sse_decode_connect_request(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
GetPaymentRequest sse_decode_box_autoadd_get_payment_request(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return (sse_decode_get_payment_request(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
PlatformInt64 sse_decode_box_autoadd_i_64(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -2972,6 +3063,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return (sse_decode_liquid_address_data(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
ListPaymentDetails sse_decode_box_autoadd_list_payment_details(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return (sse_decode_list_payment_details(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
ListPaymentsRequest sse_decode_box_autoadd_list_payments_request(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -3263,6 +3360,20 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
pubkey: var_pubkey);
|
||||
}
|
||||
|
||||
@protected
|
||||
GetPaymentRequest sse_decode_get_payment_request(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
var tag_ = sse_decode_i_32(deserializer);
|
||||
switch (tag_) {
|
||||
case 0:
|
||||
var var_paymentHash = sse_decode_String(deserializer);
|
||||
return GetPaymentRequest_Lightning(paymentHash: var_paymentHash);
|
||||
default:
|
||||
throw UnimplementedError('');
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
int sse_decode_i_32(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -3403,6 +3514,23 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
return ans_;
|
||||
}
|
||||
|
||||
@protected
|
||||
ListPaymentDetails sse_decode_list_payment_details(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
var tag_ = sse_decode_i_32(deserializer);
|
||||
switch (tag_) {
|
||||
case 0:
|
||||
var var_destination = sse_decode_String(deserializer);
|
||||
return ListPaymentDetails_Liquid(destination: var_destination);
|
||||
case 1:
|
||||
var var_address = sse_decode_String(deserializer);
|
||||
return ListPaymentDetails_Bitcoin(address: var_address);
|
||||
default:
|
||||
throw UnimplementedError('');
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
List<PaymentType> sse_decode_list_payment_type(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -3423,12 +3551,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
var var_toTimestamp = sse_decode_opt_box_autoadd_i_64(deserializer);
|
||||
var var_offset = sse_decode_opt_box_autoadd_u_32(deserializer);
|
||||
var var_limit = sse_decode_opt_box_autoadd_u_32(deserializer);
|
||||
var var_details = sse_decode_opt_box_autoadd_list_payment_details(deserializer);
|
||||
return ListPaymentsRequest(
|
||||
filters: var_filters,
|
||||
fromTimestamp: var_fromTimestamp,
|
||||
toTimestamp: var_toTimestamp,
|
||||
offset: var_offset,
|
||||
limit: var_limit);
|
||||
limit: var_limit,
|
||||
details: var_details);
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -3852,6 +3982,28 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
ListPaymentDetails? sse_decode_opt_box_autoadd_list_payment_details(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
if (sse_decode_bool(deserializer)) {
|
||||
return (sse_decode_box_autoadd_list_payment_details(deserializer));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
Payment? sse_decode_opt_box_autoadd_payment(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
if (sse_decode_bool(deserializer)) {
|
||||
return (sse_decode_box_autoadd_payment(deserializer));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
SuccessActionProcessed? sse_decode_opt_box_autoadd_success_action_processed(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -3964,6 +4116,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
var var_description = sse_decode_String(deserializer);
|
||||
var var_preimage = sse_decode_opt_String(deserializer);
|
||||
var var_bolt11 = sse_decode_opt_String(deserializer);
|
||||
var var_paymentHash = sse_decode_opt_String(deserializer);
|
||||
var var_refundTxId = sse_decode_opt_String(deserializer);
|
||||
var var_refundTxAmountSat = sse_decode_opt_box_autoadd_u_64(deserializer);
|
||||
return PaymentDetails_Lightning(
|
||||
@@ -3971,6 +4124,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
description: var_description,
|
||||
preimage: var_preimage,
|
||||
bolt11: var_bolt11,
|
||||
paymentHash: var_paymentHash,
|
||||
refundTxId: var_refundTxId,
|
||||
refundTxAmountSat: var_refundTxAmountSat);
|
||||
case 1:
|
||||
@@ -4712,6 +4866,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
sse_encode_connect_request(self, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_get_payment_request(GetPaymentRequest self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_get_payment_request(self, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_i_64(PlatformInt64 self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -4724,6 +4884,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
sse_encode_liquid_address_data(self, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_list_payment_details(ListPaymentDetails self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
sse_encode_list_payment_details(self, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_list_payments_request(ListPaymentsRequest self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -4992,6 +5158,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
sse_encode_String(self.pubkey, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_get_payment_request(GetPaymentRequest self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
switch (self) {
|
||||
case GetPaymentRequest_Lightning(paymentHash: final paymentHash):
|
||||
sse_encode_i_32(0, serializer);
|
||||
sse_encode_String(paymentHash, serializer);
|
||||
default:
|
||||
throw UnimplementedError('');
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_i_32(int self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -5109,6 +5287,21 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_list_payment_details(ListPaymentDetails self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
switch (self) {
|
||||
case ListPaymentDetails_Liquid(destination: final destination):
|
||||
sse_encode_i_32(0, serializer);
|
||||
sse_encode_String(destination, serializer);
|
||||
case ListPaymentDetails_Bitcoin(address: final address):
|
||||
sse_encode_i_32(1, serializer);
|
||||
sse_encode_String(address, serializer);
|
||||
default:
|
||||
throw UnimplementedError('');
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_list_payment_type(List<PaymentType> self, SseSerializer serializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
@@ -5126,6 +5319,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
sse_encode_opt_box_autoadd_i_64(self.toTimestamp, serializer);
|
||||
sse_encode_opt_box_autoadd_u_32(self.offset, serializer);
|
||||
sse_encode_opt_box_autoadd_u_32(self.limit, serializer);
|
||||
sse_encode_opt_box_autoadd_list_payment_details(self.details, serializer);
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -5476,6 +5670,26 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_list_payment_details(ListPaymentDetails? 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_list_payment_details(self, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_payment(Payment? 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_payment(self, serializer);
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_success_action_processed(
|
||||
SuccessActionProcessed? self, SseSerializer serializer) {
|
||||
@@ -5570,6 +5784,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
description: final description,
|
||||
preimage: final preimage,
|
||||
bolt11: final bolt11,
|
||||
paymentHash: final paymentHash,
|
||||
refundTxId: final refundTxId,
|
||||
refundTxAmountSat: final refundTxAmountSat
|
||||
):
|
||||
@@ -5578,6 +5793,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||
sse_encode_String(description, serializer);
|
||||
sse_encode_opt_String(preimage, serializer);
|
||||
sse_encode_opt_String(bolt11, serializer);
|
||||
sse_encode_opt_String(paymentHash, serializer);
|
||||
sse_encode_opt_String(refundTxId, serializer);
|
||||
sse_encode_opt_box_autoadd_u_64(refundTxAmountSat, serializer);
|
||||
case PaymentDetails_Liquid(destination: final destination, description: final description):
|
||||
@@ -6045,6 +6261,9 @@ class BindingLiquidSdkImpl extends RustOpaque implements BindingLiquidSdk {
|
||||
that: this,
|
||||
);
|
||||
|
||||
Future<Payment?> getPayment({required GetPaymentRequest req}) =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkGetPayment(that: this, req: req);
|
||||
|
||||
Future<List<FiatCurrency>> listFiatCurrencies() =>
|
||||
RustLib.instance.api.crateBindingsBindingLiquidSdkListFiatCurrencies(
|
||||
that: this,
|
||||
|
||||
@@ -95,12 +95,18 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
ConnectRequest dco_decode_box_autoadd_connect_request(dynamic raw);
|
||||
|
||||
@protected
|
||||
GetPaymentRequest dco_decode_box_autoadd_get_payment_request(dynamic raw);
|
||||
|
||||
@protected
|
||||
PlatformInt64 dco_decode_box_autoadd_i_64(dynamic raw);
|
||||
|
||||
@protected
|
||||
LiquidAddressData dco_decode_box_autoadd_liquid_address_data(dynamic raw);
|
||||
|
||||
@protected
|
||||
ListPaymentDetails dco_decode_box_autoadd_list_payment_details(dynamic raw);
|
||||
|
||||
@protected
|
||||
ListPaymentsRequest dco_decode_box_autoadd_list_payments_request(dynamic raw);
|
||||
|
||||
@@ -221,6 +227,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
GetInfoResponse dco_decode_get_info_response(dynamic raw);
|
||||
|
||||
@protected
|
||||
GetPaymentRequest dco_decode_get_payment_request(dynamic raw);
|
||||
|
||||
@protected
|
||||
int dco_decode_i_32(dynamic raw);
|
||||
|
||||
@@ -254,6 +263,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<Payment> dco_decode_list_payment(dynamic raw);
|
||||
|
||||
@protected
|
||||
ListPaymentDetails dco_decode_list_payment_details(dynamic raw);
|
||||
|
||||
@protected
|
||||
List<PaymentType> dco_decode_list_payment_type(dynamic raw);
|
||||
|
||||
@@ -350,6 +362,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
PlatformInt64? dco_decode_opt_box_autoadd_i_64(dynamic raw);
|
||||
|
||||
@protected
|
||||
ListPaymentDetails? dco_decode_opt_box_autoadd_list_payment_details(dynamic raw);
|
||||
|
||||
@protected
|
||||
Payment? dco_decode_opt_box_autoadd_payment(dynamic raw);
|
||||
|
||||
@protected
|
||||
SuccessActionProcessed? dco_decode_opt_box_autoadd_success_action_processed(dynamic raw);
|
||||
|
||||
@@ -570,12 +588,18 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
ConnectRequest sse_decode_box_autoadd_connect_request(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
GetPaymentRequest sse_decode_box_autoadd_get_payment_request(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
PlatformInt64 sse_decode_box_autoadd_i_64(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
LiquidAddressData sse_decode_box_autoadd_liquid_address_data(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ListPaymentDetails sse_decode_box_autoadd_list_payment_details(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ListPaymentsRequest sse_decode_box_autoadd_list_payments_request(SseDeserializer deserializer);
|
||||
|
||||
@@ -696,6 +720,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
GetInfoResponse sse_decode_get_info_response(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
GetPaymentRequest sse_decode_get_payment_request(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
int sse_decode_i_32(SseDeserializer deserializer);
|
||||
|
||||
@@ -729,6 +756,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
List<Payment> sse_decode_list_payment(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ListPaymentDetails sse_decode_list_payment_details(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
List<PaymentType> sse_decode_list_payment_type(SseDeserializer deserializer);
|
||||
|
||||
@@ -825,6 +855,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
PlatformInt64? sse_decode_opt_box_autoadd_i_64(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
ListPaymentDetails? sse_decode_opt_box_autoadd_list_payment_details(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
Payment? sse_decode_opt_box_autoadd_payment(SseDeserializer deserializer);
|
||||
|
||||
@protected
|
||||
SuccessActionProcessed? sse_decode_opt_box_autoadd_success_action_processed(SseDeserializer deserializer);
|
||||
|
||||
@@ -1082,6 +1118,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_get_payment_request> cst_encode_box_autoadd_get_payment_request(
|
||||
GetPaymentRequest raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
final ptr = wire.cst_new_box_autoadd_get_payment_request();
|
||||
cst_api_fill_to_wire_get_payment_request(raw, ptr.ref);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<ffi.Int64> cst_encode_box_autoadd_i_64(PlatformInt64 raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
@@ -1097,6 +1142,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_payment_details> cst_encode_box_autoadd_list_payment_details(
|
||||
ListPaymentDetails raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
final ptr = wire.cst_new_box_autoadd_list_payment_details();
|
||||
cst_api_fill_to_wire_list_payment_details(raw, ptr.ref);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_payments_request> cst_encode_box_autoadd_list_payments_request(
|
||||
ListPaymentsRequest raw) {
|
||||
@@ -1475,6 +1529,19 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
return raw == null ? ffi.nullptr : cst_encode_box_autoadd_i_64(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_list_payment_details> cst_encode_opt_box_autoadd_list_payment_details(
|
||||
ListPaymentDetails? raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
return raw == null ? ffi.nullptr : cst_encode_box_autoadd_list_payment_details(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_payment> cst_encode_opt_box_autoadd_payment(Payment? raw) {
|
||||
// Codec=Cst (C-struct based), see doc to use other codecs
|
||||
return raw == null ? ffi.nullptr : cst_encode_box_autoadd_payment(raw);
|
||||
}
|
||||
|
||||
@protected
|
||||
ffi.Pointer<wire_cst_success_action_processed> cst_encode_opt_box_autoadd_success_action_processed(
|
||||
SuccessActionProcessed? raw) {
|
||||
@@ -1611,12 +1678,24 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
cst_api_fill_to_wire_connect_request(apiObj, wireObj.ref);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_box_autoadd_get_payment_request(
|
||||
GetPaymentRequest apiObj, ffi.Pointer<wire_cst_get_payment_request> wireObj) {
|
||||
cst_api_fill_to_wire_get_payment_request(apiObj, wireObj.ref);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_box_autoadd_liquid_address_data(
|
||||
LiquidAddressData apiObj, ffi.Pointer<wire_cst_liquid_address_data> wireObj) {
|
||||
cst_api_fill_to_wire_liquid_address_data(apiObj, wireObj.ref);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_box_autoadd_list_payment_details(
|
||||
ListPaymentDetails apiObj, ffi.Pointer<wire_cst_list_payment_details> wireObj) {
|
||||
cst_api_fill_to_wire_list_payment_details(apiObj, wireObj.ref);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_box_autoadd_list_payments_request(
|
||||
ListPaymentsRequest apiObj, ffi.Pointer<wire_cst_list_payments_request> wireObj) {
|
||||
@@ -1847,6 +1926,17 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
wireObj.pubkey = cst_encode_String(apiObj.pubkey);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_get_payment_request(
|
||||
GetPaymentRequest apiObj, wire_cst_get_payment_request wireObj) {
|
||||
if (apiObj is GetPaymentRequest_Lightning) {
|
||||
var pre_payment_hash = cst_encode_String(apiObj.paymentHash);
|
||||
wireObj.tag = 0;
|
||||
wireObj.kind.Lightning.payment_hash = pre_payment_hash;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_input_type(InputType apiObj, wire_cst_input_type wireObj) {
|
||||
if (apiObj is InputType_BitcoinAddress) {
|
||||
@@ -1930,6 +2020,23 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
wireObj.message = cst_encode_opt_String(apiObj.message);
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_list_payment_details(
|
||||
ListPaymentDetails apiObj, wire_cst_list_payment_details wireObj) {
|
||||
if (apiObj is ListPaymentDetails_Liquid) {
|
||||
var pre_destination = cst_encode_String(apiObj.destination);
|
||||
wireObj.tag = 0;
|
||||
wireObj.kind.Liquid.destination = pre_destination;
|
||||
return;
|
||||
}
|
||||
if (apiObj is ListPaymentDetails_Bitcoin) {
|
||||
var pre_address = cst_encode_String(apiObj.address);
|
||||
wireObj.tag = 1;
|
||||
wireObj.kind.Bitcoin.address = pre_address;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@protected
|
||||
void cst_api_fill_to_wire_list_payments_request(
|
||||
ListPaymentsRequest apiObj, wire_cst_list_payments_request wireObj) {
|
||||
@@ -1938,6 +2045,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
wireObj.to_timestamp = cst_encode_opt_box_autoadd_i_64(apiObj.toTimestamp);
|
||||
wireObj.offset = cst_encode_opt_box_autoadd_u_32(apiObj.offset);
|
||||
wireObj.limit = cst_encode_opt_box_autoadd_u_32(apiObj.limit);
|
||||
wireObj.details = cst_encode_opt_box_autoadd_list_payment_details(apiObj.details);
|
||||
}
|
||||
|
||||
@protected
|
||||
@@ -2300,6 +2408,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
var pre_description = cst_encode_String(apiObj.description);
|
||||
var pre_preimage = cst_encode_opt_String(apiObj.preimage);
|
||||
var pre_bolt11 = cst_encode_opt_String(apiObj.bolt11);
|
||||
var pre_payment_hash = cst_encode_opt_String(apiObj.paymentHash);
|
||||
var pre_refund_tx_id = cst_encode_opt_String(apiObj.refundTxId);
|
||||
var pre_refund_tx_amount_sat = cst_encode_opt_box_autoadd_u_64(apiObj.refundTxAmountSat);
|
||||
wireObj.tag = 0;
|
||||
@@ -2307,6 +2416,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
wireObj.kind.Lightning.description = pre_description;
|
||||
wireObj.kind.Lightning.preimage = pre_preimage;
|
||||
wireObj.kind.Lightning.bolt11 = pre_bolt11;
|
||||
wireObj.kind.Lightning.payment_hash = pre_payment_hash;
|
||||
wireObj.kind.Lightning.refund_tx_id = pre_refund_tx_id;
|
||||
wireObj.kind.Lightning.refund_tx_amount_sat = pre_refund_tx_amount_sat;
|
||||
return;
|
||||
@@ -2857,12 +2967,18 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_box_autoadd_connect_request(ConnectRequest self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_get_payment_request(GetPaymentRequest self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_i_64(PlatformInt64 self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_liquid_address_data(LiquidAddressData self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_list_payment_details(ListPaymentDetails self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_box_autoadd_list_payments_request(ListPaymentsRequest self, SseSerializer serializer);
|
||||
|
||||
@@ -2988,6 +3104,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_get_info_response(GetInfoResponse self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_get_payment_request(GetPaymentRequest self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_i_32(int self, SseSerializer serializer);
|
||||
|
||||
@@ -3022,6 +3141,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_list_payment(List<Payment> self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_payment_details(ListPaymentDetails self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_list_payment_type(List<PaymentType> self, SseSerializer serializer);
|
||||
|
||||
@@ -3119,6 +3241,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_i_64(PlatformInt64? self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_list_payment_details(ListPaymentDetails? self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_payment(Payment? self, SseSerializer serializer);
|
||||
|
||||
@protected
|
||||
void sse_encode_opt_box_autoadd_success_action_processed(
|
||||
SuccessActionProcessed? self, SseSerializer serializer);
|
||||
@@ -3475,6 +3603,26 @@ class RustLibWire implements BaseWire {
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_get_info =
|
||||
_wire__crate__bindings__BindingLiquidSdk_get_infoPtr.asFunction<void Function(int, int)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_get_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_get_payment_request> req,
|
||||
) {
|
||||
return _wire__crate__bindings__BindingLiquidSdk_get_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_get_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_get_payment_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_payment');
|
||||
late final _wire__crate__bindings__BindingLiquidSdk_get_payment =
|
||||
_wire__crate__bindings__BindingLiquidSdk_get_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_get_payment_request>)>();
|
||||
|
||||
void wire__crate__bindings__BindingLiquidSdk_list_fiat_currencies(
|
||||
int port_,
|
||||
int that,
|
||||
@@ -4117,6 +4265,16 @@ class RustLibWire implements BaseWire {
|
||||
late final _cst_new_box_autoadd_connect_request =
|
||||
_cst_new_box_autoadd_connect_requestPtr.asFunction<ffi.Pointer<wire_cst_connect_request> Function()>();
|
||||
|
||||
ffi.Pointer<wire_cst_get_payment_request> cst_new_box_autoadd_get_payment_request() {
|
||||
return _cst_new_box_autoadd_get_payment_request();
|
||||
}
|
||||
|
||||
late final _cst_new_box_autoadd_get_payment_requestPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Pointer<wire_cst_get_payment_request> Function()>>(
|
||||
'frbgen_breez_liquid_cst_new_box_autoadd_get_payment_request');
|
||||
late final _cst_new_box_autoadd_get_payment_request = _cst_new_box_autoadd_get_payment_requestPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_get_payment_request> Function()>();
|
||||
|
||||
ffi.Pointer<ffi.Int64> cst_new_box_autoadd_i_64(
|
||||
int value,
|
||||
) {
|
||||
@@ -4141,6 +4299,16 @@ class RustLibWire implements BaseWire {
|
||||
late final _cst_new_box_autoadd_liquid_address_data = _cst_new_box_autoadd_liquid_address_dataPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_liquid_address_data> Function()>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_payment_details> cst_new_box_autoadd_list_payment_details() {
|
||||
return _cst_new_box_autoadd_list_payment_details();
|
||||
}
|
||||
|
||||
late final _cst_new_box_autoadd_list_payment_detailsPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Pointer<wire_cst_list_payment_details> Function()>>(
|
||||
'frbgen_breez_liquid_cst_new_box_autoadd_list_payment_details');
|
||||
late final _cst_new_box_autoadd_list_payment_details = _cst_new_box_autoadd_list_payment_detailsPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_list_payment_details> Function()>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_payments_request> cst_new_box_autoadd_list_payments_request() {
|
||||
return _cst_new_box_autoadd_list_payments_request();
|
||||
}
|
||||
@@ -4647,6 +4815,21 @@ final class wire_cst_check_message_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> signature;
|
||||
}
|
||||
|
||||
final class wire_cst_GetPaymentRequest_Lightning extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> payment_hash;
|
||||
}
|
||||
|
||||
final class GetPaymentRequestKind extends ffi.Union {
|
||||
external wire_cst_GetPaymentRequest_Lightning Lightning;
|
||||
}
|
||||
|
||||
final class wire_cst_get_payment_request extends ffi.Struct {
|
||||
@ffi.Int32()
|
||||
external int tag;
|
||||
|
||||
external GetPaymentRequestKind kind;
|
||||
}
|
||||
|
||||
final class wire_cst_list_payment_type extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Int32> ptr;
|
||||
|
||||
@@ -4654,6 +4837,27 @@ final class wire_cst_list_payment_type extends ffi.Struct {
|
||||
external int len;
|
||||
}
|
||||
|
||||
final class wire_cst_ListPaymentDetails_Liquid extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> destination;
|
||||
}
|
||||
|
||||
final class wire_cst_ListPaymentDetails_Bitcoin extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> address;
|
||||
}
|
||||
|
||||
final class ListPaymentDetailsKind extends ffi.Union {
|
||||
external wire_cst_ListPaymentDetails_Liquid Liquid;
|
||||
|
||||
external wire_cst_ListPaymentDetails_Bitcoin Bitcoin;
|
||||
}
|
||||
|
||||
final class wire_cst_list_payment_details extends ffi.Struct {
|
||||
@ffi.Int32()
|
||||
external int tag;
|
||||
|
||||
external ListPaymentDetailsKind kind;
|
||||
}
|
||||
|
||||
final class wire_cst_list_payments_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_payment_type> filters;
|
||||
|
||||
@@ -4664,6 +4868,8 @@ final class wire_cst_list_payments_request extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Uint32> offset;
|
||||
|
||||
external ffi.Pointer<ffi.Uint32> limit;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_payment_details> details;
|
||||
}
|
||||
|
||||
final class wire_cst_ln_url_auth_request_data extends ffi.Struct {
|
||||
@@ -4967,6 +5173,8 @@ final class wire_cst_PaymentDetails_Lightning extends ffi.Struct {
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> bolt11;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> payment_hash;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> refund_tx_id;
|
||||
|
||||
external ffi.Pointer<ffi.Uint64> refund_tx_amount_sat;
|
||||
|
||||
@@ -234,6 +234,16 @@ class GetInfoResponse {
|
||||
pubkey == other.pubkey;
|
||||
}
|
||||
|
||||
@freezed
|
||||
sealed class GetPaymentRequest with _$GetPaymentRequest {
|
||||
const GetPaymentRequest._();
|
||||
|
||||
/// The Lightning payment hash of the payment
|
||||
const factory GetPaymentRequest.lightning({
|
||||
required String paymentHash,
|
||||
}) = GetPaymentRequest_Lightning;
|
||||
}
|
||||
|
||||
/// Returned when calling [crate::sdk::LiquidSdk::fetch_lightning_limits].
|
||||
class LightningPaymentLimitsResponse {
|
||||
/// Amount limits for a Send Payment to be valid
|
||||
@@ -295,6 +305,21 @@ enum LiquidNetwork {
|
||||
;
|
||||
}
|
||||
|
||||
@freezed
|
||||
sealed class ListPaymentDetails with _$ListPaymentDetails {
|
||||
const ListPaymentDetails._();
|
||||
|
||||
/// The Liquid BIP21 URI or address of the payment
|
||||
const factory ListPaymentDetails.liquid({
|
||||
required String destination,
|
||||
}) = ListPaymentDetails_Liquid;
|
||||
|
||||
/// The Bitcoin address of the payment
|
||||
const factory ListPaymentDetails.bitcoin({
|
||||
required String address,
|
||||
}) = ListPaymentDetails_Bitcoin;
|
||||
}
|
||||
|
||||
/// An argument when calling [crate::sdk::LiquidSdk::list_payments].
|
||||
class ListPaymentsRequest {
|
||||
final List<PaymentType>? filters;
|
||||
@@ -306,6 +331,7 @@ class ListPaymentsRequest {
|
||||
final PlatformInt64? toTimestamp;
|
||||
final int? offset;
|
||||
final int? limit;
|
||||
final ListPaymentDetails? details;
|
||||
|
||||
const ListPaymentsRequest({
|
||||
this.filters,
|
||||
@@ -313,11 +339,17 @@ class ListPaymentsRequest {
|
||||
this.toTimestamp,
|
||||
this.offset,
|
||||
this.limit,
|
||||
this.details,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
filters.hashCode ^ fromTimestamp.hashCode ^ toTimestamp.hashCode ^ offset.hashCode ^ limit.hashCode;
|
||||
filters.hashCode ^
|
||||
fromTimestamp.hashCode ^
|
||||
toTimestamp.hashCode ^
|
||||
offset.hashCode ^
|
||||
limit.hashCode ^
|
||||
details.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
@@ -328,7 +360,8 @@ class ListPaymentsRequest {
|
||||
fromTimestamp == other.fromTimestamp &&
|
||||
toTimestamp == other.toTimestamp &&
|
||||
offset == other.offset &&
|
||||
limit == other.limit;
|
||||
limit == other.limit &&
|
||||
details == other.details;
|
||||
}
|
||||
|
||||
@freezed
|
||||
@@ -552,6 +585,9 @@ sealed class PaymentDetails with _$PaymentDetails {
|
||||
/// In the case of a Receive payment, this is the invoice paid by the user
|
||||
String? bolt11,
|
||||
|
||||
/// The payment hash of the invoice
|
||||
String? paymentHash,
|
||||
|
||||
/// For a Send swap which was refunded, this is the refund tx id
|
||||
String? refundTxId,
|
||||
|
||||
|
||||
@@ -14,6 +14,316 @@ 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 _$GetPaymentRequest {
|
||||
String get paymentHash => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of GetPaymentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
$GetPaymentRequestCopyWith<GetPaymentRequest> get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $GetPaymentRequestCopyWith<$Res> {
|
||||
factory $GetPaymentRequestCopyWith(GetPaymentRequest value, $Res Function(GetPaymentRequest) then) =
|
||||
_$GetPaymentRequestCopyWithImpl<$Res, GetPaymentRequest>;
|
||||
@useResult
|
||||
$Res call({String paymentHash});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$GetPaymentRequestCopyWithImpl<$Res, $Val extends GetPaymentRequest>
|
||||
implements $GetPaymentRequestCopyWith<$Res> {
|
||||
_$GetPaymentRequestCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of GetPaymentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? paymentHash = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
paymentHash: null == paymentHash
|
||||
? _value.paymentHash
|
||||
: paymentHash // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$GetPaymentRequest_LightningImplCopyWith<$Res> implements $GetPaymentRequestCopyWith<$Res> {
|
||||
factory _$$GetPaymentRequest_LightningImplCopyWith(
|
||||
_$GetPaymentRequest_LightningImpl value, $Res Function(_$GetPaymentRequest_LightningImpl) then) =
|
||||
__$$GetPaymentRequest_LightningImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String paymentHash});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$GetPaymentRequest_LightningImplCopyWithImpl<$Res>
|
||||
extends _$GetPaymentRequestCopyWithImpl<$Res, _$GetPaymentRequest_LightningImpl>
|
||||
implements _$$GetPaymentRequest_LightningImplCopyWith<$Res> {
|
||||
__$$GetPaymentRequest_LightningImplCopyWithImpl(
|
||||
_$GetPaymentRequest_LightningImpl _value, $Res Function(_$GetPaymentRequest_LightningImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of GetPaymentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? paymentHash = null,
|
||||
}) {
|
||||
return _then(_$GetPaymentRequest_LightningImpl(
|
||||
paymentHash: null == paymentHash
|
||||
? _value.paymentHash
|
||||
: paymentHash // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$GetPaymentRequest_LightningImpl extends GetPaymentRequest_Lightning {
|
||||
const _$GetPaymentRequest_LightningImpl({required this.paymentHash}) : super._();
|
||||
|
||||
@override
|
||||
final String paymentHash;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetPaymentRequest.lightning(paymentHash: $paymentHash)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$GetPaymentRequest_LightningImpl &&
|
||||
(identical(other.paymentHash, paymentHash) || other.paymentHash == paymentHash));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, paymentHash);
|
||||
|
||||
/// Create a copy of GetPaymentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$GetPaymentRequest_LightningImplCopyWith<_$GetPaymentRequest_LightningImpl> get copyWith =>
|
||||
__$$GetPaymentRequest_LightningImplCopyWithImpl<_$GetPaymentRequest_LightningImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class GetPaymentRequest_Lightning extends GetPaymentRequest {
|
||||
const factory GetPaymentRequest_Lightning({required final String paymentHash}) =
|
||||
_$GetPaymentRequest_LightningImpl;
|
||||
const GetPaymentRequest_Lightning._() : super._();
|
||||
|
||||
@override
|
||||
String get paymentHash;
|
||||
|
||||
/// Create a copy of GetPaymentRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$GetPaymentRequest_LightningImplCopyWith<_$GetPaymentRequest_LightningImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ListPaymentDetails {}
|
||||
|
||||
/// @nodoc
|
||||
abstract class $ListPaymentDetailsCopyWith<$Res> {
|
||||
factory $ListPaymentDetailsCopyWith(ListPaymentDetails value, $Res Function(ListPaymentDetails) then) =
|
||||
_$ListPaymentDetailsCopyWithImpl<$Res, ListPaymentDetails>;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class _$ListPaymentDetailsCopyWithImpl<$Res, $Val extends ListPaymentDetails>
|
||||
implements $ListPaymentDetailsCopyWith<$Res> {
|
||||
_$ListPaymentDetailsCopyWithImpl(this._value, this._then);
|
||||
|
||||
// ignore: unused_field
|
||||
final $Val _value;
|
||||
// ignore: unused_field
|
||||
final $Res Function($Val) _then;
|
||||
|
||||
/// Create a copy of ListPaymentDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ListPaymentDetails_LiquidImplCopyWith<$Res> {
|
||||
factory _$$ListPaymentDetails_LiquidImplCopyWith(
|
||||
_$ListPaymentDetails_LiquidImpl value, $Res Function(_$ListPaymentDetails_LiquidImpl) then) =
|
||||
__$$ListPaymentDetails_LiquidImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String destination});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ListPaymentDetails_LiquidImplCopyWithImpl<$Res>
|
||||
extends _$ListPaymentDetailsCopyWithImpl<$Res, _$ListPaymentDetails_LiquidImpl>
|
||||
implements _$$ListPaymentDetails_LiquidImplCopyWith<$Res> {
|
||||
__$$ListPaymentDetails_LiquidImplCopyWithImpl(
|
||||
_$ListPaymentDetails_LiquidImpl _value, $Res Function(_$ListPaymentDetails_LiquidImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ListPaymentDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? destination = null,
|
||||
}) {
|
||||
return _then(_$ListPaymentDetails_LiquidImpl(
|
||||
destination: null == destination
|
||||
? _value.destination
|
||||
: destination // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ListPaymentDetails_LiquidImpl extends ListPaymentDetails_Liquid {
|
||||
const _$ListPaymentDetails_LiquidImpl({required this.destination}) : super._();
|
||||
|
||||
@override
|
||||
final String destination;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ListPaymentDetails.liquid(destination: $destination)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ListPaymentDetails_LiquidImpl &&
|
||||
(identical(other.destination, destination) || other.destination == destination));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, destination);
|
||||
|
||||
/// Create a copy of ListPaymentDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ListPaymentDetails_LiquidImplCopyWith<_$ListPaymentDetails_LiquidImpl> get copyWith =>
|
||||
__$$ListPaymentDetails_LiquidImplCopyWithImpl<_$ListPaymentDetails_LiquidImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class ListPaymentDetails_Liquid extends ListPaymentDetails {
|
||||
const factory ListPaymentDetails_Liquid({required final String destination}) =
|
||||
_$ListPaymentDetails_LiquidImpl;
|
||||
const ListPaymentDetails_Liquid._() : super._();
|
||||
|
||||
String get destination;
|
||||
|
||||
/// Create a copy of ListPaymentDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ListPaymentDetails_LiquidImplCopyWith<_$ListPaymentDetails_LiquidImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$ListPaymentDetails_BitcoinImplCopyWith<$Res> {
|
||||
factory _$$ListPaymentDetails_BitcoinImplCopyWith(
|
||||
_$ListPaymentDetails_BitcoinImpl value, $Res Function(_$ListPaymentDetails_BitcoinImpl) then) =
|
||||
__$$ListPaymentDetails_BitcoinImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({String address});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$ListPaymentDetails_BitcoinImplCopyWithImpl<$Res>
|
||||
extends _$ListPaymentDetailsCopyWithImpl<$Res, _$ListPaymentDetails_BitcoinImpl>
|
||||
implements _$$ListPaymentDetails_BitcoinImplCopyWith<$Res> {
|
||||
__$$ListPaymentDetails_BitcoinImplCopyWithImpl(
|
||||
_$ListPaymentDetails_BitcoinImpl _value, $Res Function(_$ListPaymentDetails_BitcoinImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
/// Create a copy of ListPaymentDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? address = null,
|
||||
}) {
|
||||
return _then(_$ListPaymentDetails_BitcoinImpl(
|
||||
address: null == address
|
||||
? _value.address
|
||||
: address // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
class _$ListPaymentDetails_BitcoinImpl extends ListPaymentDetails_Bitcoin {
|
||||
const _$ListPaymentDetails_BitcoinImpl({required this.address}) : super._();
|
||||
|
||||
@override
|
||||
final String address;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ListPaymentDetails.bitcoin(address: $address)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ListPaymentDetails_BitcoinImpl &&
|
||||
(identical(other.address, address) || other.address == address));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, address);
|
||||
|
||||
/// Create a copy of ListPaymentDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$ListPaymentDetails_BitcoinImplCopyWith<_$ListPaymentDetails_BitcoinImpl> get copyWith =>
|
||||
__$$ListPaymentDetails_BitcoinImplCopyWithImpl<_$ListPaymentDetails_BitcoinImpl>(this, _$identity);
|
||||
}
|
||||
|
||||
abstract class ListPaymentDetails_Bitcoin extends ListPaymentDetails {
|
||||
const factory ListPaymentDetails_Bitcoin({required final String address}) =
|
||||
_$ListPaymentDetails_BitcoinImpl;
|
||||
const ListPaymentDetails_Bitcoin._() : super._();
|
||||
|
||||
String get address;
|
||||
|
||||
/// Create a copy of ListPaymentDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
_$$ListPaymentDetails_BitcoinImplCopyWith<_$ListPaymentDetails_BitcoinImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LnUrlPayResult {
|
||||
Object get data => throw _privateConstructorUsedError;
|
||||
@@ -487,6 +797,7 @@ abstract class _$$PaymentDetails_LightningImplCopyWith<$Res> implements $Payment
|
||||
String description,
|
||||
String? preimage,
|
||||
String? bolt11,
|
||||
String? paymentHash,
|
||||
String? refundTxId,
|
||||
BigInt? refundTxAmountSat});
|
||||
}
|
||||
@@ -508,6 +819,7 @@ class __$$PaymentDetails_LightningImplCopyWithImpl<$Res>
|
||||
Object? description = null,
|
||||
Object? preimage = freezed,
|
||||
Object? bolt11 = freezed,
|
||||
Object? paymentHash = freezed,
|
||||
Object? refundTxId = freezed,
|
||||
Object? refundTxAmountSat = freezed,
|
||||
}) {
|
||||
@@ -528,6 +840,10 @@ class __$$PaymentDetails_LightningImplCopyWithImpl<$Res>
|
||||
? _value.bolt11
|
||||
: bolt11 // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
paymentHash: freezed == paymentHash
|
||||
? _value.paymentHash
|
||||
: paymentHash // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
refundTxId: freezed == refundTxId
|
||||
? _value.refundTxId
|
||||
: refundTxId // ignore: cast_nullable_to_non_nullable
|
||||
@@ -548,6 +864,7 @@ class _$PaymentDetails_LightningImpl extends PaymentDetails_Lightning {
|
||||
required this.description,
|
||||
this.preimage,
|
||||
this.bolt11,
|
||||
this.paymentHash,
|
||||
this.refundTxId,
|
||||
this.refundTxAmountSat})
|
||||
: super._();
|
||||
@@ -569,6 +886,10 @@ class _$PaymentDetails_LightningImpl extends PaymentDetails_Lightning {
|
||||
@override
|
||||
final String? bolt11;
|
||||
|
||||
/// The payment hash of the invoice
|
||||
@override
|
||||
final String? paymentHash;
|
||||
|
||||
/// For a Send swap which was refunded, this is the refund tx id
|
||||
@override
|
||||
final String? refundTxId;
|
||||
@@ -579,7 +900,7 @@ class _$PaymentDetails_LightningImpl extends PaymentDetails_Lightning {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PaymentDetails.lightning(swapId: $swapId, description: $description, preimage: $preimage, bolt11: $bolt11, refundTxId: $refundTxId, refundTxAmountSat: $refundTxAmountSat)';
|
||||
return 'PaymentDetails.lightning(swapId: $swapId, description: $description, preimage: $preimage, bolt11: $bolt11, paymentHash: $paymentHash, refundTxId: $refundTxId, refundTxAmountSat: $refundTxAmountSat)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -591,14 +912,15 @@ class _$PaymentDetails_LightningImpl extends PaymentDetails_Lightning {
|
||||
(identical(other.description, description) || other.description == description) &&
|
||||
(identical(other.preimage, preimage) || other.preimage == preimage) &&
|
||||
(identical(other.bolt11, bolt11) || other.bolt11 == bolt11) &&
|
||||
(identical(other.paymentHash, paymentHash) || other.paymentHash == paymentHash) &&
|
||||
(identical(other.refundTxId, refundTxId) || other.refundTxId == refundTxId) &&
|
||||
(identical(other.refundTxAmountSat, refundTxAmountSat) ||
|
||||
other.refundTxAmountSat == refundTxAmountSat));
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
Object.hash(runtimeType, swapId, description, preimage, bolt11, refundTxId, refundTxAmountSat);
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType, swapId, description, preimage, bolt11, paymentHash, refundTxId, refundTxAmountSat);
|
||||
|
||||
/// Create a copy of PaymentDetails
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -615,6 +937,7 @@ abstract class PaymentDetails_Lightning extends PaymentDetails {
|
||||
required final String description,
|
||||
final String? preimage,
|
||||
final String? bolt11,
|
||||
final String? paymentHash,
|
||||
final String? refundTxId,
|
||||
final BigInt? refundTxAmountSat}) = _$PaymentDetails_LightningImpl;
|
||||
const PaymentDetails_Lightning._() : super._();
|
||||
@@ -633,6 +956,9 @@ abstract class PaymentDetails_Lightning extends PaymentDetails {
|
||||
/// In the case of a Receive payment, this is the invoice paid by the user
|
||||
String? get bolt11;
|
||||
|
||||
/// The payment hash of the invoice
|
||||
String? get paymentHash;
|
||||
|
||||
/// For a Send swap which was refunded, this is the refund tx id
|
||||
String? get refundTxId;
|
||||
|
||||
|
||||
576
packages/flutter/example/pubspec.lock
Normal file
576
packages/flutter/example/pubspec.lock
Normal file
@@ -0,0 +1,576 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.5.0"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.11.0"
|
||||
bip39:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: bip39
|
||||
sha256: de1ee27ebe7d96b84bb3a04a4132a0a3007dcdd5ad27dd14aa87a29d97c45edc
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.6"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
breez_liquid:
|
||||
dependency: "direct overridden"
|
||||
description:
|
||||
path: "../../dart"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.3.4"
|
||||
build_cli_annotations:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_cli_annotations
|
||||
sha256: b59d2769769efd6c9ff6d4c4cede0be115a566afc591705c2040b707534b1172
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cli_util
|
||||
sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.1"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.18.0"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: convert
|
||||
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.5"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
ffigen:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffigen
|
||||
sha256: dead012f29db2be71ea152458f5eab600de98fbc244e01088ae6bf2616bceca7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.0.0"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_breez_liquid:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.3.4"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
flutter_rust_bridge:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_rust_bridge
|
||||
sha256: b0271cc147d5afccf9774809e4eef52b7357babe1a1a31db649df6f02dd27580
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
flutter_secure_storage:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_secure_storage
|
||||
sha256: "165164745e6afb5c0e3e3fcc72a012fb9e58496fb26ffb92cf22e16a821e85d0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.2.2"
|
||||
flutter_secure_storage_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_linux
|
||||
sha256: "4d91bfc23047422cbcd73ac684bc169859ee766482517c22172c86596bf1464b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
flutter_secure_storage_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_macos
|
||||
sha256: "1693ab11121a5f925bbea0be725abfcfbbcf36c1e29e571f84a0c0f436147a81"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
flutter_secure_storage_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_platform_interface
|
||||
sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
flutter_secure_storage_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_web
|
||||
sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
flutter_secure_storage_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_windows
|
||||
sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_web_plugins:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
freezed_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: freezed_annotation
|
||||
sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.4"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
hex:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: hex
|
||||
sha256: "4e7cd54e4b59ba026432a6be2dd9d96e4c5205725194997193bf871703b82c4a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.0"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.19.0"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.7"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: json_annotation
|
||||
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.9.0"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.4"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16+1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.12.0"
|
||||
mobile_scanner:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: mobile_scanner
|
||||
sha256: d234581c090526676fd8fab4ada92f35c6746e3fb4f05a399665d75a399fb760
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.2.3"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.0"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.10"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_foundation
|
||||
sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_linux
|
||||
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
path_provider_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_platform_interface
|
||||
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
path_provider_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_windows
|
||||
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: platform
|
||||
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.5"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.8"
|
||||
pointycastle:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pointycastle
|
||||
sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.9.1"
|
||||
qr:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: qr
|
||||
sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
qr_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: qr_flutter
|
||||
sha256: "5095f0fc6e3f71d08adef8feccc8cea4f12eec18a2e31c2e8d82cb6019f4b097"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: quiver
|
||||
sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.2"
|
||||
rxdart:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: rxdart
|
||||
sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.27.7"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.2"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.2.1"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.5.4"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xdg_directories
|
||||
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
yaml_edit:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml_edit
|
||||
sha256: e9c1a3543d2da0db3e90270dbb1e4eebc985ee5e3ffe468d83224472b2194a5f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
sdks:
|
||||
dart: ">=3.4.0 <4.0.0"
|
||||
flutter: ">=3.22.0"
|
||||
@@ -213,6 +213,26 @@ class FlutterBreezLiquidBindings {
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_infoPtr
|
||||
.asFunction<void Function(int, int)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_payment(
|
||||
int port_,
|
||||
int that,
|
||||
ffi.Pointer<wire_cst_get_payment_request> req,
|
||||
) {
|
||||
return _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_payment(
|
||||
port_,
|
||||
that,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
ffi.Void Function(ffi.Int64, ffi.UintPtr, ffi.Pointer<wire_cst_get_payment_request>)>>(
|
||||
'frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_payment');
|
||||
late final _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_payment =
|
||||
_frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_get_paymentPtr
|
||||
.asFunction<void Function(int, int, ffi.Pointer<wire_cst_get_payment_request>)>();
|
||||
|
||||
void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_list_fiat_currencies(
|
||||
int port_,
|
||||
int that,
|
||||
@@ -876,6 +896,17 @@ class FlutterBreezLiquidBindings {
|
||||
_frbgen_breez_liquid_cst_new_box_autoadd_connect_requestPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_connect_request> Function()>();
|
||||
|
||||
ffi.Pointer<wire_cst_get_payment_request> frbgen_breez_liquid_cst_new_box_autoadd_get_payment_request() {
|
||||
return _frbgen_breez_liquid_cst_new_box_autoadd_get_payment_request();
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_cst_new_box_autoadd_get_payment_requestPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Pointer<wire_cst_get_payment_request> Function()>>(
|
||||
'frbgen_breez_liquid_cst_new_box_autoadd_get_payment_request');
|
||||
late final _frbgen_breez_liquid_cst_new_box_autoadd_get_payment_request =
|
||||
_frbgen_breez_liquid_cst_new_box_autoadd_get_payment_requestPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_get_payment_request> Function()>();
|
||||
|
||||
ffi.Pointer<ffi.Int64> frbgen_breez_liquid_cst_new_box_autoadd_i_64(
|
||||
int value,
|
||||
) {
|
||||
@@ -901,6 +932,17 @@ class FlutterBreezLiquidBindings {
|
||||
_frbgen_breez_liquid_cst_new_box_autoadd_liquid_address_dataPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_liquid_address_data> Function()>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_payment_details> frbgen_breez_liquid_cst_new_box_autoadd_list_payment_details() {
|
||||
return _frbgen_breez_liquid_cst_new_box_autoadd_list_payment_details();
|
||||
}
|
||||
|
||||
late final _frbgen_breez_liquid_cst_new_box_autoadd_list_payment_detailsPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Pointer<wire_cst_list_payment_details> Function()>>(
|
||||
'frbgen_breez_liquid_cst_new_box_autoadd_list_payment_details');
|
||||
late final _frbgen_breez_liquid_cst_new_box_autoadd_list_payment_details =
|
||||
_frbgen_breez_liquid_cst_new_box_autoadd_list_payment_detailsPtr
|
||||
.asFunction<ffi.Pointer<wire_cst_list_payment_details> Function()>();
|
||||
|
||||
ffi.Pointer<wire_cst_list_payments_request>
|
||||
frbgen_breez_liquid_cst_new_box_autoadd_list_payments_request() {
|
||||
return _frbgen_breez_liquid_cst_new_box_autoadd_list_payments_request();
|
||||
@@ -1592,6 +1634,26 @@ class FlutterBreezLiquidBindings {
|
||||
_uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_infoPtr
|
||||
.asFunction<RustBuffer Function(ffi.Pointer<ffi.Void>, ffi.Pointer<RustCallStatus>)>();
|
||||
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_payment(
|
||||
ffi.Pointer<ffi.Void> ptr,
|
||||
RustBuffer req,
|
||||
ffi.Pointer<RustCallStatus> out_status,
|
||||
) {
|
||||
return _uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_payment(
|
||||
ptr,
|
||||
req,
|
||||
out_status,
|
||||
);
|
||||
}
|
||||
|
||||
late final _uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_paymentPtr = _lookup<
|
||||
ffi.NativeFunction<
|
||||
RustBuffer Function(ffi.Pointer<ffi.Void>, RustBuffer, ffi.Pointer<RustCallStatus>)>>(
|
||||
'uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_payment');
|
||||
late final _uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_payment =
|
||||
_uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_get_paymentPtr
|
||||
.asFunction<RustBuffer Function(ffi.Pointer<ffi.Void>, RustBuffer, ffi.Pointer<RustCallStatus>)>();
|
||||
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_list_fiat_currencies(
|
||||
ffi.Pointer<ffi.Void> ptr,
|
||||
ffi.Pointer<RustCallStatus> out_status,
|
||||
@@ -2088,20 +2150,22 @@ class FlutterBreezLiquidBindings {
|
||||
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_default_config(
|
||||
RustBuffer network,
|
||||
RustBuffer breez_api_key,
|
||||
ffi.Pointer<RustCallStatus> out_status,
|
||||
) {
|
||||
return _uniffi_breez_sdk_liquid_bindings_fn_func_default_config(
|
||||
network,
|
||||
breez_api_key,
|
||||
out_status,
|
||||
);
|
||||
}
|
||||
|
||||
late final _uniffi_breez_sdk_liquid_bindings_fn_func_default_configPtr =
|
||||
_lookup<ffi.NativeFunction<RustBuffer Function(RustBuffer, ffi.Pointer<RustCallStatus>)>>(
|
||||
_lookup<ffi.NativeFunction<RustBuffer Function(RustBuffer, RustBuffer, ffi.Pointer<RustCallStatus>)>>(
|
||||
'uniffi_breez_sdk_liquid_bindings_fn_func_default_config');
|
||||
late final _uniffi_breez_sdk_liquid_bindings_fn_func_default_config =
|
||||
_uniffi_breez_sdk_liquid_bindings_fn_func_default_configPtr
|
||||
.asFunction<RustBuffer Function(RustBuffer, ffi.Pointer<RustCallStatus>)>();
|
||||
.asFunction<RustBuffer Function(RustBuffer, RustBuffer, ffi.Pointer<RustCallStatus>)>();
|
||||
|
||||
RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_parse(
|
||||
RustBuffer input,
|
||||
@@ -3221,6 +3285,17 @@ class FlutterBreezLiquidBindings {
|
||||
_uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_infoPtr
|
||||
.asFunction<int Function()>();
|
||||
|
||||
int uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_payment() {
|
||||
return _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_payment();
|
||||
}
|
||||
|
||||
late final _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_paymentPtr =
|
||||
_lookup<ffi.NativeFunction<ffi.Uint16 Function()>>(
|
||||
'uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_payment');
|
||||
late final _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_payment =
|
||||
_uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_get_paymentPtr
|
||||
.asFunction<int Function()>();
|
||||
|
||||
int uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_list_fiat_currencies() {
|
||||
return _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_list_fiat_currencies();
|
||||
}
|
||||
@@ -3559,6 +3634,21 @@ final class wire_cst_check_message_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> signature;
|
||||
}
|
||||
|
||||
final class wire_cst_GetPaymentRequest_Lightning extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> payment_hash;
|
||||
}
|
||||
|
||||
final class GetPaymentRequestKind extends ffi.Union {
|
||||
external wire_cst_GetPaymentRequest_Lightning Lightning;
|
||||
}
|
||||
|
||||
final class wire_cst_get_payment_request extends ffi.Struct {
|
||||
@ffi.Int32()
|
||||
external int tag;
|
||||
|
||||
external GetPaymentRequestKind kind;
|
||||
}
|
||||
|
||||
final class wire_cst_list_payment_type extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Int32> ptr;
|
||||
|
||||
@@ -3566,6 +3656,27 @@ final class wire_cst_list_payment_type extends ffi.Struct {
|
||||
external int len;
|
||||
}
|
||||
|
||||
final class wire_cst_ListPaymentDetails_Liquid extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> destination;
|
||||
}
|
||||
|
||||
final class wire_cst_ListPaymentDetails_Bitcoin extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> address;
|
||||
}
|
||||
|
||||
final class ListPaymentDetailsKind extends ffi.Union {
|
||||
external wire_cst_ListPaymentDetails_Liquid Liquid;
|
||||
|
||||
external wire_cst_ListPaymentDetails_Bitcoin Bitcoin;
|
||||
}
|
||||
|
||||
final class wire_cst_list_payment_details extends ffi.Struct {
|
||||
@ffi.Int32()
|
||||
external int tag;
|
||||
|
||||
external ListPaymentDetailsKind kind;
|
||||
}
|
||||
|
||||
final class wire_cst_list_payments_request extends ffi.Struct {
|
||||
external ffi.Pointer<wire_cst_list_payment_type> filters;
|
||||
|
||||
@@ -3576,6 +3687,8 @@ final class wire_cst_list_payments_request extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Uint32> offset;
|
||||
|
||||
external ffi.Pointer<ffi.Uint32> limit;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_payment_details> details;
|
||||
}
|
||||
|
||||
final class wire_cst_ln_url_auth_request_data extends ffi.Struct {
|
||||
@@ -3879,6 +3992,8 @@ final class wire_cst_PaymentDetails_Lightning extends ffi.Struct {
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> bolt11;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> payment_hash;
|
||||
|
||||
external ffi.Pointer<wire_cst_list_prim_u_8_strict> refund_tx_id;
|
||||
|
||||
external ffi.Pointer<ffi.Uint64> refund_tx_amount_sat;
|
||||
|
||||
@@ -634,7 +634,15 @@ fun asListPaymentsRequest(listPaymentsRequest: ReadableMap): ListPaymentsRequest
|
||||
val toTimestamp = if (hasNonNullKey(listPaymentsRequest, "toTimestamp")) listPaymentsRequest.getDouble("toTimestamp").toLong() else null
|
||||
val offset = if (hasNonNullKey(listPaymentsRequest, "offset")) listPaymentsRequest.getInt("offset").toUInt() else null
|
||||
val limit = if (hasNonNullKey(listPaymentsRequest, "limit")) listPaymentsRequest.getInt("limit").toUInt() else null
|
||||
return ListPaymentsRequest(filters, fromTimestamp, toTimestamp, offset, limit)
|
||||
val details =
|
||||
if (hasNonNullKey(listPaymentsRequest, "details")) {
|
||||
listPaymentsRequest.getMap("details")?.let {
|
||||
asListPaymentDetails(it)
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
return ListPaymentsRequest(filters, fromTimestamp, toTimestamp, offset, limit, details)
|
||||
}
|
||||
|
||||
fun readableMapOf(listPaymentsRequest: ListPaymentsRequest): ReadableMap =
|
||||
@@ -644,6 +652,7 @@ fun readableMapOf(listPaymentsRequest: ListPaymentsRequest): ReadableMap =
|
||||
"toTimestamp" to listPaymentsRequest.toTimestamp,
|
||||
"offset" to listPaymentsRequest.offset,
|
||||
"limit" to listPaymentsRequest.limit,
|
||||
"details" to listPaymentsRequest.details?.let { readableMapOf(it) },
|
||||
)
|
||||
|
||||
fun asListPaymentsRequestList(arr: ReadableArray): List<ListPaymentsRequest> {
|
||||
@@ -2232,6 +2241,38 @@ fun asBuyBitcoinProviderList(arr: ReadableArray): List<BuyBitcoinProvider> {
|
||||
return list
|
||||
}
|
||||
|
||||
fun asGetPaymentRequest(getPaymentRequest: ReadableMap): GetPaymentRequest? {
|
||||
val type = getPaymentRequest.getString("type")
|
||||
|
||||
if (type == "lightning") {
|
||||
val paymentHash = getPaymentRequest.getString("paymentHash")!!
|
||||
return GetPaymentRequest.Lightning(paymentHash)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun readableMapOf(getPaymentRequest: GetPaymentRequest): ReadableMap? {
|
||||
val map = Arguments.createMap()
|
||||
when (getPaymentRequest) {
|
||||
is GetPaymentRequest.Lightning -> {
|
||||
pushToMap(map, "type", "lightning")
|
||||
pushToMap(map, "paymentHash", getPaymentRequest.paymentHash)
|
||||
}
|
||||
}
|
||||
return map
|
||||
}
|
||||
|
||||
fun asGetPaymentRequestList(arr: ReadableArray): List<GetPaymentRequest> {
|
||||
val list = ArrayList<GetPaymentRequest>()
|
||||
for (value in arr.toList()) {
|
||||
when (value) {
|
||||
is ReadableMap -> list.add(asGetPaymentRequest(value)!!)
|
||||
else -> throw SdkException.Generic(errUnexpectedType(value))
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
fun asInputType(inputType: ReadableMap): InputType? {
|
||||
val type = inputType.getString("type")
|
||||
|
||||
@@ -2341,6 +2382,46 @@ fun asLiquidNetworkList(arr: ReadableArray): List<LiquidNetwork> {
|
||||
return list
|
||||
}
|
||||
|
||||
fun asListPaymentDetails(listPaymentDetails: ReadableMap): ListPaymentDetails? {
|
||||
val type = listPaymentDetails.getString("type")
|
||||
|
||||
if (type == "liquid") {
|
||||
val destination = listPaymentDetails.getString("destination")!!
|
||||
return ListPaymentDetails.Liquid(destination)
|
||||
}
|
||||
if (type == "bitcoin") {
|
||||
val address = listPaymentDetails.getString("address")!!
|
||||
return ListPaymentDetails.Bitcoin(address)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun readableMapOf(listPaymentDetails: ListPaymentDetails): ReadableMap? {
|
||||
val map = Arguments.createMap()
|
||||
when (listPaymentDetails) {
|
||||
is ListPaymentDetails.Liquid -> {
|
||||
pushToMap(map, "type", "liquid")
|
||||
pushToMap(map, "destination", listPaymentDetails.destination)
|
||||
}
|
||||
is ListPaymentDetails.Bitcoin -> {
|
||||
pushToMap(map, "type", "bitcoin")
|
||||
pushToMap(map, "address", listPaymentDetails.address)
|
||||
}
|
||||
}
|
||||
return map
|
||||
}
|
||||
|
||||
fun asListPaymentDetailsList(arr: ReadableArray): List<ListPaymentDetails> {
|
||||
val list = ArrayList<ListPaymentDetails>()
|
||||
for (value in arr.toList()) {
|
||||
when (value) {
|
||||
is ReadableMap -> list.add(asListPaymentDetails(value)!!)
|
||||
else -> throw SdkException.Generic(errUnexpectedType(value))
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
fun asLnUrlCallbackStatus(lnUrlCallbackStatus: ReadableMap): LnUrlCallbackStatus? {
|
||||
val type = lnUrlCallbackStatus.getString("type")
|
||||
|
||||
@@ -2534,6 +2615,7 @@ fun asPaymentDetails(paymentDetails: ReadableMap): PaymentDetails? {
|
||||
val description = paymentDetails.getString("description")!!
|
||||
val preimage = if (hasNonNullKey(paymentDetails, "preimage")) paymentDetails.getString("preimage") else null
|
||||
val bolt11 = if (hasNonNullKey(paymentDetails, "bolt11")) paymentDetails.getString("bolt11") else null
|
||||
val paymentHash = if (hasNonNullKey(paymentDetails, "paymentHash")) paymentDetails.getString("paymentHash") else null
|
||||
val refundTxId = if (hasNonNullKey(paymentDetails, "refundTxId")) paymentDetails.getString("refundTxId") else null
|
||||
val refundTxAmountSat =
|
||||
if (hasNonNullKey(
|
||||
@@ -2545,7 +2627,7 @@ fun asPaymentDetails(paymentDetails: ReadableMap): PaymentDetails? {
|
||||
} else {
|
||||
null
|
||||
}
|
||||
return PaymentDetails.Lightning(swapId, description, preimage, bolt11, refundTxId, refundTxAmountSat)
|
||||
return PaymentDetails.Lightning(swapId, description, preimage, bolt11, paymentHash, refundTxId, refundTxAmountSat)
|
||||
}
|
||||
if (type == "liquid") {
|
||||
val destination = paymentDetails.getString("destination")!!
|
||||
@@ -2580,6 +2662,7 @@ fun readableMapOf(paymentDetails: PaymentDetails): ReadableMap? {
|
||||
pushToMap(map, "description", paymentDetails.description)
|
||||
pushToMap(map, "preimage", paymentDetails.preimage)
|
||||
pushToMap(map, "bolt11", paymentDetails.bolt11)
|
||||
pushToMap(map, "paymentHash", paymentDetails.paymentHash)
|
||||
pushToMap(map, "refundTxId", paymentDetails.refundTxId)
|
||||
pushToMap(map, "refundTxAmountSat", paymentDetails.refundTxAmountSat)
|
||||
}
|
||||
|
||||
@@ -403,6 +403,23 @@ class BreezSDKLiquidModule(
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun getPayment(
|
||||
req: ReadableMap,
|
||||
promise: Promise,
|
||||
) {
|
||||
executor.execute {
|
||||
try {
|
||||
val reqTmp =
|
||||
asGetPaymentRequest(req) ?: run { throw SdkException.Generic(errMissingMandatoryField("req", "GetPaymentRequest")) }
|
||||
val res = getBindingLiquidSdk().getPayment(reqTmp)
|
||||
promise.resolve(res?.let { readableMapOf(res) })
|
||||
} catch (e: Exception) {
|
||||
promise.reject(e.javaClass.simpleName.replace("Exception", "Error"), e.message, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun listRefundables(promise: Promise) {
|
||||
executor.execute {
|
||||
|
||||
@@ -770,8 +770,12 @@ enum BreezSDKLiquidMapper {
|
||||
}
|
||||
limit = limitTmp
|
||||
}
|
||||
var details: ListPaymentDetails?
|
||||
if let detailsTmp = listPaymentsRequest["details"] as? [String: Any?] {
|
||||
details = try asListPaymentDetails(listPaymentDetails: detailsTmp)
|
||||
}
|
||||
|
||||
return ListPaymentsRequest(filters: filters, fromTimestamp: fromTimestamp, toTimestamp: toTimestamp, offset: offset, limit: limit)
|
||||
return ListPaymentsRequest(filters: filters, fromTimestamp: fromTimestamp, toTimestamp: toTimestamp, offset: offset, limit: limit, details: details)
|
||||
}
|
||||
|
||||
static func dictionaryOf(listPaymentsRequest: ListPaymentsRequest) -> [String: Any?] {
|
||||
@@ -781,6 +785,7 @@ enum BreezSDKLiquidMapper {
|
||||
"toTimestamp": listPaymentsRequest.toTimestamp == nil ? nil : listPaymentsRequest.toTimestamp,
|
||||
"offset": listPaymentsRequest.offset == nil ? nil : listPaymentsRequest.offset,
|
||||
"limit": listPaymentsRequest.limit == nil ? nil : listPaymentsRequest.limit,
|
||||
"details": listPaymentsRequest.details == nil ? nil : dictionaryOf(listPaymentDetails: listPaymentsRequest.details!),
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2617,6 +2622,47 @@ enum BreezSDKLiquidMapper {
|
||||
return list
|
||||
}
|
||||
|
||||
static func asGetPaymentRequest(getPaymentRequest: [String: Any?]) throws -> GetPaymentRequest {
|
||||
let type = getPaymentRequest["type"] as! String
|
||||
if type == "lightning" {
|
||||
guard let _paymentHash = getPaymentRequest["paymentHash"] as? String else {
|
||||
throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "paymentHash", typeName: "GetPaymentRequest"))
|
||||
}
|
||||
return GetPaymentRequest.lightning(paymentHash: _paymentHash)
|
||||
}
|
||||
|
||||
throw SdkError.Generic(message: "Unexpected type \(type) for enum GetPaymentRequest")
|
||||
}
|
||||
|
||||
static func dictionaryOf(getPaymentRequest: GetPaymentRequest) -> [String: Any?] {
|
||||
switch getPaymentRequest {
|
||||
case let .lightning(
|
||||
paymentHash
|
||||
):
|
||||
return [
|
||||
"type": "lightning",
|
||||
"paymentHash": paymentHash,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
static func arrayOf(getPaymentRequestList: [GetPaymentRequest]) -> [Any] {
|
||||
return getPaymentRequestList.map { v -> [String: Any?] in return dictionaryOf(getPaymentRequest: v) }
|
||||
}
|
||||
|
||||
static func asGetPaymentRequestList(arr: [Any]) throws -> [GetPaymentRequest] {
|
||||
var list = [GetPaymentRequest]()
|
||||
for value in arr {
|
||||
if let val = value as? [String: Any?] {
|
||||
var getPaymentRequest = try asGetPaymentRequest(getPaymentRequest: val)
|
||||
list.append(getPaymentRequest)
|
||||
} else {
|
||||
throw SdkError.Generic(message: errUnexpectedType(typeName: "GetPaymentRequest"))
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
static func asInputType(inputType: [String: Any?]) throws -> InputType {
|
||||
let type = inputType["type"] as! String
|
||||
if type == "bitcoinAddress" {
|
||||
@@ -2823,6 +2869,61 @@ enum BreezSDKLiquidMapper {
|
||||
return list
|
||||
}
|
||||
|
||||
static func asListPaymentDetails(listPaymentDetails: [String: Any?]) throws -> ListPaymentDetails {
|
||||
let type = listPaymentDetails["type"] as! String
|
||||
if type == "liquid" {
|
||||
guard let _destination = listPaymentDetails["destination"] as? String else {
|
||||
throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "destination", typeName: "ListPaymentDetails"))
|
||||
}
|
||||
return ListPaymentDetails.liquid(destination: _destination)
|
||||
}
|
||||
if type == "bitcoin" {
|
||||
guard let _address = listPaymentDetails["address"] as? String else {
|
||||
throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "address", typeName: "ListPaymentDetails"))
|
||||
}
|
||||
return ListPaymentDetails.bitcoin(address: _address)
|
||||
}
|
||||
|
||||
throw SdkError.Generic(message: "Unexpected type \(type) for enum ListPaymentDetails")
|
||||
}
|
||||
|
||||
static func dictionaryOf(listPaymentDetails: ListPaymentDetails) -> [String: Any?] {
|
||||
switch listPaymentDetails {
|
||||
case let .liquid(
|
||||
destination
|
||||
):
|
||||
return [
|
||||
"type": "liquid",
|
||||
"destination": destination,
|
||||
]
|
||||
|
||||
case let .bitcoin(
|
||||
address
|
||||
):
|
||||
return [
|
||||
"type": "bitcoin",
|
||||
"address": address,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
static func arrayOf(listPaymentDetailsList: [ListPaymentDetails]) -> [Any] {
|
||||
return listPaymentDetailsList.map { v -> [String: Any?] in return dictionaryOf(listPaymentDetails: v) }
|
||||
}
|
||||
|
||||
static func asListPaymentDetailsList(arr: [Any]) throws -> [ListPaymentDetails] {
|
||||
var list = [ListPaymentDetails]()
|
||||
for value in arr {
|
||||
if let val = value as? [String: Any?] {
|
||||
var listPaymentDetails = try asListPaymentDetails(listPaymentDetails: val)
|
||||
list.append(listPaymentDetails)
|
||||
} else {
|
||||
throw SdkError.Generic(message: errUnexpectedType(typeName: "ListPaymentDetails"))
|
||||
}
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
static func asLnUrlCallbackStatus(lnUrlCallbackStatus: [String: Any?]) throws -> LnUrlCallbackStatus {
|
||||
let type = lnUrlCallbackStatus["type"] as! String
|
||||
if type == "ok" {
|
||||
@@ -3137,11 +3238,13 @@ enum BreezSDKLiquidMapper {
|
||||
|
||||
let _bolt11 = paymentDetails["bolt11"] as? String
|
||||
|
||||
let _paymentHash = paymentDetails["paymentHash"] as? String
|
||||
|
||||
let _refundTxId = paymentDetails["refundTxId"] as? String
|
||||
|
||||
let _refundTxAmountSat = paymentDetails["refundTxAmountSat"] as? UInt64
|
||||
|
||||
return PaymentDetails.lightning(swapId: _swapId, description: _description, preimage: _preimage, bolt11: _bolt11, refundTxId: _refundTxId, refundTxAmountSat: _refundTxAmountSat)
|
||||
return PaymentDetails.lightning(swapId: _swapId, description: _description, preimage: _preimage, bolt11: _bolt11, paymentHash: _paymentHash, refundTxId: _refundTxId, refundTxAmountSat: _refundTxAmountSat)
|
||||
}
|
||||
if type == "liquid" {
|
||||
guard let _destination = paymentDetails["destination"] as? String else {
|
||||
@@ -3172,7 +3275,7 @@ enum BreezSDKLiquidMapper {
|
||||
static func dictionaryOf(paymentDetails: PaymentDetails) -> [String: Any?] {
|
||||
switch paymentDetails {
|
||||
case let .lightning(
|
||||
swapId, description, preimage, bolt11, refundTxId, refundTxAmountSat
|
||||
swapId, description, preimage, bolt11, paymentHash, refundTxId, refundTxAmountSat
|
||||
):
|
||||
return [
|
||||
"type": "lightning",
|
||||
@@ -3180,6 +3283,7 @@ enum BreezSDKLiquidMapper {
|
||||
"description": description,
|
||||
"preimage": preimage == nil ? nil : preimage,
|
||||
"bolt11": bolt11 == nil ? nil : bolt11,
|
||||
"paymentHash": paymentHash == nil ? nil : paymentHash,
|
||||
"refundTxId": refundTxId == nil ? nil : refundTxId,
|
||||
"refundTxAmountSat": refundTxAmountSat == nil ? nil : refundTxAmountSat,
|
||||
]
|
||||
|
||||
@@ -125,6 +125,12 @@ RCT_EXTERN_METHOD(
|
||||
reject: (RCTPromiseRejectBlock)reject
|
||||
)
|
||||
|
||||
RCT_EXTERN_METHOD(
|
||||
getPayment: (NSDictionary*)req
|
||||
resolve: (RCTPromiseResolveBlock)resolve
|
||||
reject: (RCTPromiseRejectBlock)reject
|
||||
)
|
||||
|
||||
RCT_EXTERN_METHOD(
|
||||
listRefundables: (RCTPromiseResolveBlock)resolve
|
||||
reject: (RCTPromiseRejectBlock)reject
|
||||
|
||||
@@ -306,6 +306,21 @@ class RNBreezSDKLiquid: RCTEventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
@objc(getPayment:resolve:reject:)
|
||||
func getPayment(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
||||
do {
|
||||
let reqTmp = try BreezSDKLiquidMapper.asGetPaymentRequest(getPaymentRequest: req)
|
||||
var res = try getBindingLiquidSdk().getPayment(req: reqTmp)
|
||||
if res != nil {
|
||||
resolve(BreezSDKLiquidMapper.dictionaryOf(payment: res!))
|
||||
} else {
|
||||
resolve(nil)
|
||||
}
|
||||
} catch let err {
|
||||
rejectErr(err: err, reject: reject)
|
||||
}
|
||||
}
|
||||
|
||||
@objc(listRefundables:reject:)
|
||||
func listRefundables(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
||||
do {
|
||||
|
||||
@@ -131,6 +131,7 @@ export interface ListPaymentsRequest {
|
||||
toTimestamp?: number
|
||||
offset?: number
|
||||
limit?: number
|
||||
details?: ListPaymentDetails
|
||||
}
|
||||
|
||||
export interface LnUrlAuthRequestData {
|
||||
@@ -391,6 +392,15 @@ export enum BuyBitcoinProvider {
|
||||
MOONPAY = "moonpay"
|
||||
}
|
||||
|
||||
export enum GetPaymentRequestVariant {
|
||||
LIGHTNING = "lightning"
|
||||
}
|
||||
|
||||
export interface GetPaymentRequest {
|
||||
type: GetPaymentRequestVariant.LIGHTNING,
|
||||
paymentHash: string
|
||||
}
|
||||
|
||||
export enum InputTypeVariant {
|
||||
BITCOIN_ADDRESS = "bitcoinAddress",
|
||||
LIQUID_ADDRESS = "liquidAddress",
|
||||
@@ -437,6 +447,19 @@ export enum LiquidNetwork {
|
||||
TESTNET = "testnet"
|
||||
}
|
||||
|
||||
export enum ListPaymentDetailsVariant {
|
||||
LIQUID = "liquid",
|
||||
BITCOIN = "bitcoin"
|
||||
}
|
||||
|
||||
export type ListPaymentDetails = {
|
||||
type: ListPaymentDetailsVariant.LIQUID,
|
||||
destination: string
|
||||
} | {
|
||||
type: ListPaymentDetailsVariant.BITCOIN,
|
||||
address: string
|
||||
}
|
||||
|
||||
export enum LnUrlCallbackStatusVariant {
|
||||
OK = "ok",
|
||||
ERROR_STATUS = "errorStatus"
|
||||
@@ -514,6 +537,7 @@ export type PaymentDetails = {
|
||||
description: string
|
||||
preimage?: string
|
||||
bolt11?: string
|
||||
paymentHash?: string
|
||||
refundTxId?: string
|
||||
refundTxAmountSat?: number
|
||||
} | {
|
||||
@@ -727,6 +751,11 @@ export const listPayments = async (req: ListPaymentsRequest): Promise<Payment[]>
|
||||
return response
|
||||
}
|
||||
|
||||
export const getPayment = async (req: GetPaymentRequest): Promise<Payment | null> => {
|
||||
const response = await BreezSDKLiquid.getPayment(req)
|
||||
return response
|
||||
}
|
||||
|
||||
export const listRefundables = async (): Promise<RefundableSwap[]> => {
|
||||
const response = await BreezSDKLiquid.listRefundables()
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user