Remove get_new_keypair
This commit is contained in:
parent
544e8989c6
commit
4c558589d0
16
src/api.rs
16
src/api.rs
@ -270,22 +270,6 @@ pub fn get_member() -> ApiResult<Member> {
|
|||||||
Ok(us)
|
Ok(us)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen]
|
|
||||||
pub fn get_new_keypair() -> NewKey {
|
|
||||||
let secp = Secp256k1::new();
|
|
||||||
let mut rng = thread_rng();
|
|
||||||
let keypair = Keypair::new(&secp, &mut rng);
|
|
||||||
|
|
||||||
let secret_hex = keypair.secret_bytes().to_lower_hex_string();
|
|
||||||
let (xonly, parity) = keypair.x_only_public_key();
|
|
||||||
|
|
||||||
NewKey {
|
|
||||||
private_key: secret_hex,
|
|
||||||
x_only_public_key: xonly.to_string(),
|
|
||||||
key_parity: if parity == Parity::Even { true } else { false }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
pub fn restore_device(device_str: String) -> ApiResult<()> {
|
pub fn restore_device(device_str: String) -> ApiResult<()> {
|
||||||
let device: Device = serde_json::from_str(&device_str)?;
|
let device: Device = serde_json::from_str(&device_str)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user