pub struct BlocktankClient { /* private fields */ }
Implementations§
Source§impl BlocktankClient
impl BlocktankClient
Sourcepub fn new(base_url: Option<&str>) -> Result<Self>
pub fn new(base_url: Option<&str>) -> Result<Self>
Creates a new BlocktankClient instance with the given base URL or default if not provided
Sourcepub async fn estimate_order_fee(
&self,
lsp_balance_sat: u64,
channel_expiry_weeks: u32,
options: Option<CreateOrderOptions>,
) -> Result<IBtEstimateFeeResponse>
pub async fn estimate_order_fee( &self, lsp_balance_sat: u64, channel_expiry_weeks: u32, options: Option<CreateOrderOptions>, ) -> Result<IBtEstimateFeeResponse>
Estimates the fee to create a channel order without actually creating an order.
Sourcepub async fn estimate_order_fee_full(
&self,
lsp_balance_sat: u64,
channel_expiry_weeks: u32,
options: Option<CreateOrderOptions>,
) -> Result<IBtEstimateFeeResponse2>
pub async fn estimate_order_fee_full( &self, lsp_balance_sat: u64, channel_expiry_weeks: u32, options: Option<CreateOrderOptions>, ) -> Result<IBtEstimateFeeResponse2>
Estimates the fee to create a channel order without actually creating an order. Includes network and service fee.
Sourcepub async fn create_order(
&self,
lsp_balance_sat: u64,
channel_expiry_weeks: u32,
options: Option<CreateOrderOptions>,
) -> Result<IBtOrder>
pub async fn create_order( &self, lsp_balance_sat: u64, channel_expiry_weeks: u32, options: Option<CreateOrderOptions>, ) -> Result<IBtOrder>
Creates a new channel order
Sourcepub async fn get_order(&self, order_id: &str) -> Result<IBtOrder>
pub async fn get_order(&self, order_id: &str) -> Result<IBtOrder>
Get order by order id. Returns an error if it doesn’t find the order.
Sourcepub async fn get_orders(&self, order_ids: &[String]) -> Result<Vec<IBtOrder>>
pub async fn get_orders(&self, order_ids: &[String]) -> Result<Vec<IBtOrder>>
Get multiple orders by order ids.
Sourcepub async fn open_channel(
&self,
order_id: &str,
connection_string_or_pubkey: &str,
) -> Result<IBtOrder>
pub async fn open_channel( &self, order_id: &str, connection_string_or_pubkey: &str, ) -> Result<IBtOrder>
Open channel to a specific node.
Sourcepub async fn get_min_zero_conf_tx_fee(
&self,
order_id: &str,
) -> Result<IBt0ConfMinTxFeeWindow>
pub async fn get_min_zero_conf_tx_fee( &self, order_id: &str, ) -> Result<IBt0ConfMinTxFeeWindow>
Get minimum 0-conf transaction fee for an order.
Sourcepub async fn create_cjit_entry(
&self,
channel_size_sat: u64,
invoice_sat: u64,
invoice_description: &str,
node_id: &str,
channel_expiry_weeks: u32,
options: Option<CreateCjitOptions>,
) -> Result<ICJitEntry>
pub async fn create_cjit_entry( &self, channel_size_sat: u64, invoice_sat: u64, invoice_description: &str, node_id: &str, channel_expiry_weeks: u32, options: Option<CreateCjitOptions>, ) -> Result<ICJitEntry>
Create a new CJIT entry for Just-In-Time channel open.
Sourcepub async fn get_cjit_entry(&self, entry_id: &str) -> Result<ICJitEntry>
pub async fn get_cjit_entry(&self, entry_id: &str) -> Result<ICJitEntry>
Get CJIT entry by id. Returns an error if it doesn’t find the entry.
Sourcepub async fn bitkit_log(&self, node_id: &str, message: &str) -> Result<()>
pub async fn bitkit_log(&self, node_id: &str, message: &str) -> Result<()>
Sends a log message from Bitkit to Blocktank. Heavily rate limited.
Sourcepub async fn regtest_mine(&self, count: Option<u32>) -> Result<()>
pub async fn regtest_mine(&self, count: Option<u32>) -> Result<()>
Mines a number of blocks on the regtest network.
Sourcepub async fn regtest_deposit(
&self,
address: &str,
amount_sat: Option<u64>,
) -> Result<String>
pub async fn regtest_deposit( &self, address: &str, amount_sat: Option<u64>, ) -> Result<String>
Deposits a number of satoshis to an address on the regtest network. Returns the transaction ID of the deposit.
Sourcepub async fn regtest_pay(
&self,
invoice: &str,
amount_sat: Option<u64>,
) -> Result<String>
pub async fn regtest_pay( &self, invoice: &str, amount_sat: Option<u64>, ) -> Result<String>
Pays an invoice on the regtest network. Returns the payment ID.
Sourcepub async fn regtest_get_payment(
&self,
payment_id: &str,
) -> Result<IBtBolt11Invoice>
pub async fn regtest_get_payment( &self, payment_id: &str, ) -> Result<IBtBolt11Invoice>
Get paid invoice on the regtest network by payment ID.
Sourcepub async fn regtest_close_channel(
&self,
funding_tx_id: &str,
vout: u32,
force_close_after_s: Option<u64>,
) -> Result<String>
pub async fn regtest_close_channel( &self, funding_tx_id: &str, vout: u32, force_close_after_s: Option<u64>, ) -> Result<String>
Closes a channel on the regtest network. Returns the closing transaction ID.
Trait Implementations§
Source§impl Clone for BlocktankClient
impl Clone for BlocktankClient
Source§fn clone(&self) -> BlocktankClient
fn clone(&self) -> BlocktankClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more