bdkffi::kyoto

Struct CbfBuilder

Source
pub struct CbfBuilder { /* private fields */ }
Expand description

Build a BIP 157/158 light client to fetch transactions for a Wallet.

Options:

  • List of Peer: Bitcoin full-nodes for the light client to connect to. May be empty.
  • connections: The number of connections for the light client to maintain.
  • scan_type: Sync, recover, or start a new wallet. For more information see ScanType.
  • data_dir: Optional directory to store block headers and peers.

A note on recovering wallets. Developers should allow users to provide an approximate recovery height and an estimated number of transactions for the wallet. When determining how many scripts to check filters for, the Wallet lookahead value will be used. To ensure all transactions are recovered, the lookahead should be roughly the number of transactions in the wallet history.

Implementations§

Source§

impl CbfBuilder

Source

pub fn new() -> Self

Start a new CbfBuilder

Source

pub fn connections(&self, connections: u8) -> Arc<Self>

The number of connections for the light client to maintain. Default is two.

Source

pub fn data_dir(&self, data_dir: String) -> Arc<Self>

Directory to store block headers and peers. If none is provided, the current working directory will be used.

Source

pub fn scan_type(&self, scan_type: ScanType) -> Arc<Self>

Select between syncing, recovering, or scanning for new wallets.

Source

pub fn peers(&self, peers: Vec<Peer>) -> Arc<Self>

Bitcoin full-nodes to attempt a connection with.

Source

pub fn configure_timeout_millis( &self, handshake: u64, response: u64, ) -> Arc<Self>

Configure the time in milliseconds that a node has to:

  1. Respond to the initial connection
  2. Respond to a request
Source

pub fn socks5_proxy(&self, proxy: Socks5Proxy) -> Arc<Self>

Configure connections to be established through a Socks5 proxy. The vast majority of the time, the connection is to a local Tor daemon, which is typically exposed at 127.0.0.1:9050`.

Source

pub fn build(&self, wallet: &Wallet) -> CbfComponents

Construct a CbfComponents for a Wallet.

Trait Implementations§

Source§

impl Clone for CbfBuilder

Source§

fn clone(&self) -> CbfBuilder

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<UT> LiftRef<UT> for CbfBuilder

Source§

impl<UT> LowerError<UT> for CbfBuilder

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for CbfBuilder

Source§

type ReturnType = <Arc<CbfBuilder> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for CbfBuilder

Source§

const TYPE_ID_META: MetadataBuffer

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, dst: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V