[][src]Struct bdk_cli::WalletOpt

pub struct WalletOpt {
    pub network: Network,
    pub wallet: String,
    pub proxy: Option<String>,
    pub descriptor: String,
    pub change_descriptor: Option<String>,
    pub esplora: Option<String>,
    pub esplora_concurrency: u8,
    pub electrum: String,
    pub subcommand: WalletSubCommand,
}

Wallet global options and sub-command

A structopt struct that parses wallet global options and sub-command from the command line or from a String vector. See WalletSubCommand for details on parsing sub-commands.

Example


let cli_args = vec!["bdk-cli", "--network", "testnet",
                    "--descriptor", "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/44'/1'/0'/0/*)",
                    "sync", "--max_addresses", "50"];

// to get WalletOpt from OS command line args use:
// let wallet_opt = WalletOpt::from_args();

let wallet_opt = WalletOpt::from_iter(&cli_args);

let expected_wallet_opt = WalletOpt {
        network: Network::Testnet,
        wallet: "main".to_string(),
        proxy: None,
        descriptor: "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/44'/1'/0'/0/*)".to_string(),
        change_descriptor: None,
        #[cfg(feature = "esplora")]
        esplora: None,
        #[cfg(feature = "esplora")]
        esplora_concurrency: 4,
        electrum: "ssl://electrum.blockstream.info:60002".to_string(),
        subcommand: WalletSubCommand::Sync {
            max_addresses: Some(50)
        },
};

assert_eq!(expected_wallet_opt, wallet_opt);

Fields

network: Network

Sets the network

wallet: String

Selects the wallet to use

proxy: Option<String>

Sets the SOCKS5 proxy for the Electrum client

descriptor: String

Sets the descriptor to use for the external addresses

change_descriptor: Option<String>

Sets the descriptor to use for internal addresses

esplora: Option<String>

Use the esplora server if given as parameter

esplora_concurrency: u8

Concurrency of requests made to the esplora server

electrum: String

Sets the Electrum server to use

subcommand: WalletSubCommand

Wallet sub-command

Trait Implementations

impl Clone for WalletOpt[src]

impl Debug for WalletOpt[src]

impl PartialEq<WalletOpt> for WalletOpt[src]

impl StructOpt for WalletOpt[src]

impl StructOptInternal for WalletOpt[src]

impl StructuralPartialEq for WalletOpt[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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