Skip to content

Commit

Permalink
Add add_data enables op_return for bdk-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
waterst0ne committed Jun 29, 2022
1 parent 14866e2 commit 07b06c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@ pub enum OfflineWalletSubCommand {
/// Selects which policy should be used to satisfy the internal descriptor
#[structopt(name = "INT_POLICY", long = "internal_policy")]
internal_policy: Option<String>,
/// Allows 80-bytes of arbitrary data to a transaction output via OP_RETURN
#[structopt(name = "ADD_DATA", long = "add_data")]
add_data: String,
},
/// Bumps the fees of an RBF transaction
BumpFee {
Expand Down Expand Up @@ -920,6 +923,7 @@ where
fee_rate,
external_policy,
internal_policy,
add_data,
} => {
let mut tx_builder = wallet.build_tx();

Expand All @@ -928,6 +932,9 @@ where
} else {
tx_builder.set_recipients(recipients);
}
if !&add_data.is_empty() {
tx_builder.add_data(add_data.as_bytes());
}

if enable_rbf {
tx_builder.enable_rbf();
Expand Down

0 comments on commit 07b06c6

Please sign in to comment.