File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
packages/wasm-miniscript/src Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,26 @@ impl WrapPsbt {
4343 }
4444 }
4545
46+ #[ wasm_bindgen( js_name = updateOutputWithDescriptor) ]
47+ pub fn update_output_with_descriptor (
48+ & mut self ,
49+ output_index : usize ,
50+ descriptor : WrapDescriptor ,
51+ ) -> Result < ( ) , JsError > {
52+ match descriptor. 0 {
53+ WrapDescriptorEnum :: Definite ( d) => self
54+ . 0
55+ . update_output_with_descriptor ( output_index, & d)
56+ . map_err ( JsError :: from) ,
57+ WrapDescriptorEnum :: Derivable ( _, _) => Err ( JsError :: new (
58+ "Cannot update output with a derivable descriptor" ,
59+ ) ) ,
60+ WrapDescriptorEnum :: String ( _) => {
61+ Err ( JsError :: new ( "Cannot update output with a string descriptor" ) )
62+ }
63+ }
64+ }
65+
4666 #[ wasm_bindgen( js_name = finalize) ]
4767 pub fn finalize_mut ( & mut self ) -> Result < ( ) , JsError > {
4868 self . 0
You can’t perform that action at this time.
0 commit comments