@@ -49,6 +49,8 @@ pub const PSBT_GLOBAL_RGB_TRANSITION: u64 = 0x01;
49
49
/// Proprietary key subtype for storing information on which close method
50
50
/// should be used.
51
51
pub const PSBT_GLOBAL_RGB_CLOSE_METHOD : u64 = 0x02 ;
52
+ /// Proprietary key subtype to signal that tapret host has been put on change.
53
+ pub const PSBT_GLOBAL_RGB_TAP_HOST_CHANGE : u64 = 0x03 ;
52
54
/// Proprietary key subtype for storing RGB state transition operation id which
53
55
/// consumes this input.
54
56
pub const PSBT_IN_RGB_CONSUMED_BY : u64 = 0x01 ;
@@ -99,6 +101,7 @@ pub trait ProprietaryKeyRgb {
99
101
data : opid. to_vec ( ) . into ( ) ,
100
102
}
101
103
}
104
+
102
105
/// Constructs [`PSBT_GLOBAL_RGB_CLOSE_METHOD`] proprietary key.
103
106
fn rgb_close_method ( ) -> PropKey {
104
107
PropKey {
@@ -116,6 +119,15 @@ pub trait ProprietaryKeyRgb {
116
119
data : contract_id. to_vec ( ) . into ( ) ,
117
120
}
118
121
}
122
+
123
+ /// Constructs [`PSBT_GLOBAL_RGB_TAP_HOST_CHANGE`] proprietary key.
124
+ fn rgb_tapret_host_on_change ( ) -> PropKey {
125
+ PropKey {
126
+ identifier : PSBT_RGB_PREFIX . to_owned ( ) ,
127
+ subtype : PSBT_GLOBAL_RGB_TAP_HOST_CHANGE ,
128
+ data : none ! ( ) ,
129
+ }
130
+ }
119
131
}
120
132
121
133
impl ProprietaryKeyRgb for PropKey { }
@@ -193,8 +205,12 @@ pub trait RgbExt {
193
205
194
206
fn rgb_close_method ( & self ) -> Result < Option < CloseMethod > , RgbPsbtError > ;
195
207
208
+ fn rgb_tapret_host_on_change ( & self ) -> bool ;
209
+
196
210
fn set_rgb_close_method ( & mut self , close_method : CloseMethod ) ;
197
211
212
+ fn set_rgb_tapret_host_on_change ( & mut self ) ;
213
+
198
214
fn push_rgb_transition ( & mut self , transition : Transition ) -> Result < bool , RgbPsbtError > ;
199
215
200
216
fn rgb_bundles ( & self ) -> Result < BTreeMap < ContractId , TransitionBundle > , RgbPsbtError > {
@@ -299,10 +315,18 @@ impl RgbExt for Psbt {
299
315
Err ( RgbPsbtError :: InvalidCloseMethod )
300
316
}
301
317
318
+ fn rgb_tapret_host_on_change ( & self ) -> bool {
319
+ self . has_proprietary ( & PropKey :: rgb_tapret_host_on_change ( ) )
320
+ }
321
+
302
322
fn set_rgb_close_method ( & mut self , close_method : CloseMethod ) {
303
323
let _ = self . push_proprietary ( PropKey :: rgb_close_method ( ) , vec ! [ close_method as u8 ] ) ;
304
324
}
305
325
326
+ fn set_rgb_tapret_host_on_change ( & mut self ) {
327
+ let _ = self . push_proprietary ( PropKey :: rgb_tapret_host_on_change ( ) , vec ! [ ] ) ;
328
+ }
329
+
306
330
fn push_rgb_transition ( & mut self , mut transition : Transition ) -> Result < bool , RgbPsbtError > {
307
331
let opid = transition. id ( ) ;
308
332
0 commit comments