Struct BlocktankClient

Source
pub struct BlocktankClient { /* private fields */ }

Implementations§

Source§

impl BlocktankClient

Source

pub fn new(base_url: Option<&str>) -> Result<Self>

Creates a new BlocktankClient instance with the given base URL or default if not provided

Source

pub async fn get_info(&self) -> Result<IBtInfo>

Get general service information.

Source

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.

Source

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.

Source

pub async fn create_order( &self, lsp_balance_sat: u64, channel_expiry_weeks: u32, options: Option<CreateOrderOptions>, ) -> Result<IBtOrder>

Creates a new channel order

Source

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.

Source

pub async fn get_orders(&self, order_ids: &[String]) -> Result<Vec<IBtOrder>>

Get multiple orders by order ids.

Source

pub async fn open_channel( &self, order_id: &str, connection_string_or_pubkey: &str, ) -> Result<IBtOrder>

Open channel to a specific node.

Source

pub async fn get_min_zero_conf_tx_fee( &self, order_id: &str, ) -> Result<IBt0ConfMinTxFeeWindow>

Get minimum 0-conf transaction fee for an order.

Source

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.

Source

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.

Source

pub async fn bitkit_log(&self, node_id: &str, message: &str) -> Result<()>

Sends a log message from Bitkit to Blocktank. Heavily rate limited.

Source

pub async fn regtest_mine(&self, count: Option<u32>) -> Result<()>

Mines a number of blocks on the regtest network.

Source

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.

Source

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.

Source

pub async fn regtest_get_payment( &self, payment_id: &str, ) -> Result<IBtBolt11Invoice>

Get paid invoice on the regtest network by payment ID.

Source

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.

Source

pub async fn register_device( &self, device_token: &str, public_key: &str, features: &[String], node_id: &str, iso_timestamp: &str, signature: &str, is_production: Option<bool>, custom_url: Option<&str>, ) -> Result<String>

Registers a device with Blocktank

Source

pub async fn test_notification( &self, device_token: &str, secret_message: &str, notification_type: Option<&str>, custom_url: Option<&str>, ) -> Result<String>

Sends a test notification to a registered device

Trait Implementations§

Source§

impl Clone for BlocktankClient

Source§

fn clone(&self) -> BlocktankClient

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BlocktankClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,