File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,8 @@ interface TxBuilder {
195
195
196
196
TxBuilder enable_rbf_with_sequence(u32 nsequence);
197
197
198
+ TxBuilder add_data(sequence<u8> data);
199
+
198
200
[Throws=BdkError]
199
201
PartiallySignedBitcoinTransaction finish([ByRef] Wallet wallet);
200
202
};
Original file line number Diff line number Diff line change @@ -344,6 +344,7 @@ struct TxBuilder {
344
344
drain_wallet : bool ,
345
345
drain_to : Option < String > ,
346
346
rbf : Option < RbfValue > ,
347
+ data : Vec < u8 > ,
347
348
}
348
349
349
350
impl TxBuilder {
@@ -354,6 +355,7 @@ impl TxBuilder {
354
355
drain_wallet : false ,
355
356
drain_to : None ,
356
357
rbf : None ,
358
+ data : Vec :: new ( ) ,
357
359
}
358
360
}
359
361
@@ -401,6 +403,13 @@ impl TxBuilder {
401
403
} )
402
404
}
403
405
406
+ fn add_data ( & self , data : Vec < u8 > ) -> Arc < Self > {
407
+ Arc :: new ( TxBuilder {
408
+ data,
409
+ ..self . clone ( )
410
+ } )
411
+ }
412
+
404
413
fn finish ( & self , wallet : & Wallet ) -> Result < Arc < PartiallySignedBitcoinTransaction > , Error > {
405
414
let wallet = wallet. get_wallet ( ) ;
406
415
let mut tx_builder = wallet. build_tx ( ) ;
@@ -426,6 +435,10 @@ impl TxBuilder {
426
435
}
427
436
}
428
437
}
438
+ if !& self . data . is_empty ( ) {
439
+ tx_builder. add_data ( & self . data . as_slice ( ) ) ;
440
+ }
441
+
429
442
tx_builder
430
443
. finish ( )
431
444
. map ( |( psbt, _) | PartiallySignedBitcoinTransaction {
You can’t perform that action at this time.
0 commit comments