[−][src]Enum bdk_cli::WalletSubCommand
Wallet sub-command
A structopt enum that parses wallet sub-command arguments from
the command line or from a String vector, such as in the bdk-cli
example cli wallet.
Example
let sync_sub_command = WalletSubCommand::from_iter(&["bdk-cli", "sync", "--max_addresses", "50"]); assert!(matches!( sync_sub_command, WalletSubCommand::Sync { max_addresses: Some(50) } ));
To capture wallet sub-commands from a string vector without a preceeding binary name you can
create a custom struct the includes the NoBinaryName clap setting and wraps the WalletSubCommand
enum. See also the bdk-cli
example app.
Example
#[derive(Debug, StructOpt, Clone, PartialEq)] #[structopt(name = "BDK CLI", setting = AppSettings::NoBinaryName, version = option_env ! ("CARGO_PKG_VERSION").unwrap_or("unknown"), author = option_env ! ("CARGO_PKG_AUTHORS").unwrap_or(""))] struct ReplOpt { /// Wallet sub-command #[structopt(subcommand)] pub subcommand: WalletSubCommand, }
Variants
Generates a new external address
Syncs with the chosen blockchain server
Lists the available spendable UTXOs
Lists all the incoming and outgoing transactions of the wallet
Returns the current wallet balance
Creates a new unsigned transaction
Fields of CreateTx
recipients: Vec<(Script, u64)>Adds a recipient to the transaction
send_all: boolSends all the funds (or all the selected utxos). Requires only one recipients of value 0
enable_rbf: boolEnables Replace-By-Fee (BIP125)
offline_signer: boolMake a PSBT that can be signed by offline signers and hardware wallets. Forces the addition of non_witness_utxo and more details to let the signer identify the change output.
utxos: Option<Vec<OutPoint>>Selects which utxos must be spent
unspendable: Option<Vec<OutPoint>>Marks a utxo as unspendable
fee_rate: Option<f32>Fee rate to use in sat/vbyte
external_policy: Option<String>Selects which policy should be used to satisfy the external descriptor
internal_policy: Option<String>Selects which policy should be used to satisfy the internal descriptor
Bumps the fees of an RBF transaction
Fields of BumpFee
txid: StringTXID of the transaction to update
send_all: boolAllows the wallet to reduce the amount of the only output in order to increase fees. This is generally the expected behavior for transactions originally created with send_all
offline_signer: boolMake a PSBT that can be signed by offline signers and hardware wallets. Forces the addition of non_witness_utxo and more details to let the signer identify the change output.
utxos: Option<Vec<OutPoint>>Selects which utxos must be added to the tx. Unconfirmed utxos cannot be used
unspendable: Option<Vec<OutPoint>>Marks an utxo as unspendable, in case more inputs are needed to cover the extra fees
fee_rate: f32The new targeted fee rate in sat/vbyte
Returns the available spending policies for the descriptor
Returns the public version of the wallet's descriptor(s)
Signs and tries to finalize a PSBT
Fields of Sign
Broadcasts a transaction to the network. Takes either a raw transaction or a PSBT to extract
Fields of Broadcast
Extracts a raw transaction from a PSBT
Fields of ExtractPsbt
psbt: StringSets the PSBT to extract
Finalizes a PSBT
Fields of FinalizePsbt
Combines multiple PSBTs into one
Fields of CombinePsbt
Enter REPL command loop mode
Trait Implementations
impl Clone for WalletSubCommand[src]
pub fn clone(&self) -> WalletSubCommand[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for WalletSubCommand[src]
impl PartialEq<WalletSubCommand> for WalletSubCommand[src]
pub fn eq(&self, other: &WalletSubCommand) -> bool[src]
pub fn ne(&self, other: &WalletSubCommand) -> bool[src]
impl StructOpt for WalletSubCommand[src]
pub fn clap<'a, 'b>() -> App<'a, 'b>[src]
pub fn from_clap(matches: &ArgMatches<'_>) -> Self[src]
pub fn from_args() -> Self[src]
pub fn from_args_safe() -> Result<Self, Error>[src]
pub fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone, [src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
pub fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone, [src]
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
impl StructOptInternal for WalletSubCommand[src]
pub fn augment_clap<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b>[src]
pub fn from_subcommand<'a, 'b>(
sub: (&'b str, Option<&'b ArgMatches<'a>>)
) -> Option<Self>[src]
sub: (&'b str, Option<&'b ArgMatches<'a>>)
) -> Option<Self>
pub fn is_subcommand() -> bool[src]
impl StructuralPartialEq for WalletSubCommand[src]
Auto Trait Implementations
impl RefUnwindSafe for WalletSubCommand[src]
impl Send for WalletSubCommand[src]
impl Sync for WalletSubCommand[src]
impl Unpin for WalletSubCommand[src]
impl UnwindSafe for WalletSubCommand[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,