Skip to content

Commit 1f3ac16

Browse files
committed
Add upgrade_wallet wasm method.
1 parent 96d9131 commit 1f3ac16

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/web.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@ pub mod bitcoin {
110110
})
111111
}
112112

113+
#[wasm_bindgen]
114+
pub fn upgrade_wallet(password: String, encrypted_descriptors: String) -> Promise {
115+
set_panic_hook();
116+
117+
future_to_promise(async move {
118+
match crate::bitcoin::upgrade_wallet(&password, &encrypted_descriptors) {
119+
Ok(result) => Ok(JsValue::from_string(
120+
serde_json::to_string(&result).unwrap(),
121+
)),
122+
Err(err) => Err(JsValue::from_string(err.to_string())),
123+
}
124+
})
125+
}
126+
113127
#[wasm_bindgen]
114128
pub fn get_mnemonic_seed(encryption_password: String, seed_password: String) -> Promise {
115129
set_panic_hook();

0 commit comments

Comments
 (0)