pub struct RustBitcoinImplementation { /* private fields */ }Expand description
Rust implementation of the Bitcoin interface using rust-bitcoin [BPC-3] Complete real implementation as per BDF v2.5 standards
Implementations§
Source§impl RustBitcoinImplementation
impl RustBitcoinImplementation
Sourcepub fn new(config: &BitcoinConfig) -> Result<Self, Box<dyn Error>>
pub fn new(config: &BitcoinConfig) -> Result<Self, Box<dyn Error>>
Create a new Rust Bitcoin implementation [BPC-3] Complete real implementation as per BDF v2.5 standards
Sourcepub fn new_network(network: Network) -> Self
pub fn new_network(network: Network) -> Self
Create a new implementation with network only
Sourcepub fn with_rpc_client(
self,
rpc_url: String,
rpc_auth: Auth,
) -> Result<Self, BitcoinError>
pub fn with_rpc_client( self, rpc_url: String, rpc_auth: Auth, ) -> Result<Self, BitcoinError>
Add RPC client to the implementation
Trait Implementations§
Source§impl BitcoinInterface for RustBitcoinImplementation
impl BitcoinInterface for RustBitcoinImplementation
Source§fn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 str,
) -> Pin<Box<dyn Future<Output = BitcoinResult<Transaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 str,
) -> Pin<Box<dyn Future<Output = BitcoinResult<Transaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get transaction by txid Read more
Source§fn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = BitcoinResult<Block>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = BitcoinResult<Block>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get block by hash Read more
Source§fn get_block_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BitcoinResult<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_block_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BitcoinResult<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get current blockchain height Read more
Source§fn generate_address<'life0, 'async_trait>(
&'life0 self,
address_type: AddressType,
) -> Pin<Box<dyn Future<Output = BitcoinResult<Address>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_address<'life0, 'async_trait>(
&'life0 self,
address_type: AddressType,
) -> Pin<Box<dyn Future<Output = BitcoinResult<Address>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a new address Read more
Source§fn create_transaction<'life0, 'async_trait>(
&'life0 self,
_outputs: Vec<(String, u64)>,
fee_rate: u64,
) -> Pin<Box<dyn Future<Output = BitcoinResult<Transaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_transaction<'life0, 'async_trait>(
&'life0 self,
_outputs: Vec<(String, u64)>,
fee_rate: u64,
) -> Pin<Box<dyn Future<Output = BitcoinResult<Transaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create and sign a transaction Read more
Source§fn broadcast_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
transaction: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = BitcoinResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn broadcast_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
transaction: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = BitcoinResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Broadcast a transaction to the network Read more
Source§fn get_block_header<'life0, 'life1, 'async_trait>(
&'life0 self,
_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = BitcoinResult<BlockHeader>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_block_header<'life0, 'life1, 'async_trait>(
&'life0 self,
_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = BitcoinResult<BlockHeader>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get block header by hash Read more
Source§fn verify_merkle_proof<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tx_hash: &'life1 str,
_block_header: &'life2 BlockHeader,
) -> Pin<Box<dyn Future<Output = BitcoinResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn verify_merkle_proof<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tx_hash: &'life1 str,
_block_header: &'life2 BlockHeader,
) -> Pin<Box<dyn Future<Output = BitcoinResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Verify a merkle proof Read more
Source§fn get_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
_address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = BitcoinResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
_address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = BitcoinResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get balance for wallet/address Read more
Source§fn estimate_fee<'life0, 'async_trait>(
&'life0 self,
_target_blocks: u8,
) -> Pin<Box<dyn Future<Output = BitcoinResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn estimate_fee<'life0, 'async_trait>(
&'life0 self,
_target_blocks: u8,
) -> Pin<Box<dyn Future<Output = BitcoinResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Estimate fee for a transaction Read more
Source§fn send_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = BitcoinResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 Transaction,
) -> Pin<Box<dyn Future<Output = BitcoinResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a transaction Read more
Source§fn implementation_type(&self) -> BitcoinImplementationType
fn implementation_type(&self) -> BitcoinImplementationType
Implementation type Read more
Auto Trait Implementations§
impl !Freeze for RustBitcoinImplementation
impl !RefUnwindSafe for RustBitcoinImplementation
impl Send for RustBitcoinImplementation
impl Sync for RustBitcoinImplementation
impl Unpin for RustBitcoinImplementation
impl !UnwindSafe for RustBitcoinImplementation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more