pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(electrum_server_address: &str) -> Self
pub fn new(electrum_server_address: &str) -> Self
Examples found in repository?
examples/example.rs (line 8)
6fn main() {
7 let address = "127.0.0.1:50001";
8 let client = Client::new(address);
9
10 let relay_fee = get_relay_fee(&client);
11 println!("relay fee result: {}", relay_fee);
12 // let relay_fee_method = "blockchain.relayfee";
13 //let relay_fee_response = client.raw_call(relay_fee_method, vec![]).unwrap();
14 // let response = BlockchainRelayFeeCommand::new().call(&client).unwrap();
15 // println!("relay fee result: {:?}", response);
16
17 let p2pkh_address = "mv7RvNNQ7HpQf2diQai5hgpeuzkFoAQP9G".to_string();
18 let address_balance = get_balance_for_address(&p2pkh_address, &client);
19 println!("balance: {:#?}", address_balance);
20 let address_utxos = get_utxos_for_address(&p2pkh_address, &client);
21 println!("utxos: {:#?}", address_utxos);
22 let address_historical_transactions =
23 get_historical_transactions_for_address(&p2pkh_address, &client);
24 println!(
25 "historical transactions: {:#?}",
26 address_historical_transactions
27 );
28
29 let p2sh_address = "2MzBNKyJjx44BDJfwEevVzS3Q9Z5kSEYUZB".to_string();
30 let address_balance = get_balance_for_address(&p2sh_address, &client);
31 println!("balance: {:#?}", address_balance);
32 let address_utxos = get_utxos_for_address(&p2pkh_address, &client);
33 println!("utxos: {:#?}", address_utxos);
34
35 let p2wpkh_address = "tb1qphdqqxupe6dzkz3z58twy5l4s0v24mle5gkp99".to_string();
36 let address_balance = get_balance_for_address(&p2wpkh_address, &client);
37 println!("balance: {:#?}", address_balance);
38 let address_utxos = get_utxos_for_address(&p2pkh_address, &client);
39 println!("utxos: {:#?}", address_utxos);
40}
Auto Trait Implementations§
impl !Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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