Skip to content

Commit

Permalink
add sign_change_pubkey_with_onchain_auth_data in wasm(fix #125) (#126)
Browse files Browse the repository at this point in the history
* add sign_change_pubkey_with_onchain_auth_data in wasm(fix #125)
  • Loading branch information
nick-zkp authored Dec 11, 2023
1 parent 092bc08 commit 670c629
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bindings/wasm/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ impl Signer {
self.inner.pubkey_hash().as_hex()
}

#[wasm_bindgen(js_name=signChangePubkeyWithOnchain)]
pub fn sign_change_pubkey_with_onchain(&self, tx: ChangePubKey) -> Result<JsValue, JsValue> {
let inner_tx = tx.json_value()?;
let change_pubkey: TxChangePubKey = serde_wasm_bindgen::from_value(inner_tx)?;
let signature = self
.inner
.sign_change_pubkey_with_onchain_auth_data(change_pubkey)?;
Ok(serde_wasm_bindgen::to_value(&signature)?)
}

#[wasm_bindgen(js_name=signChangePubkeyWithEthEcdsaAuth)]
pub fn sign_change_pubkey_with_eth_ecdsa_auth(
&self,
Expand Down

0 comments on commit 670c629

Please sign in to comment.