Skip to content

Commit 07b06c6

Browse files
committed
Add add_data enables op_return for bdk-cli
1 parent 14866e2 commit 07b06c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,9 @@ pub enum OfflineWalletSubCommand {
721721
/// Selects which policy should be used to satisfy the internal descriptor
722722
#[structopt(name = "INT_POLICY", long = "internal_policy")]
723723
internal_policy: Option<String>,
724+
/// Allows 80-bytes of arbitrary data to a transaction output via OP_RETURN
725+
#[structopt(name = "ADD_DATA", long = "add_data")]
726+
add_data: String,
724727
},
725728
/// Bumps the fees of an RBF transaction
726729
BumpFee {
@@ -920,6 +923,7 @@ where
920923
fee_rate,
921924
external_policy,
922925
internal_policy,
926+
add_data,
923927
} => {
924928
let mut tx_builder = wallet.build_tx();
925929

@@ -928,6 +932,9 @@ where
928932
} else {
929933
tx_builder.set_recipients(recipients);
930934
}
935+
if !&add_data.is_empty() {
936+
tx_builder.add_data(add_data.as_bytes());
937+
}
931938

932939
if enable_rbf {
933940
tx_builder.enable_rbf();

0 commit comments

Comments
 (0)