Crates.io | xyzpub |
lib.rs | xyzpub |
version | 0.3.0 |
source | src |
created_at | 2021-08-28 09:30:08.953233 |
updated_at | 2022-10-11 16:10:25.353779 |
description | Convert xpubs and xprvs to different versions. |
homepage | |
repository | https://github.com/KaiWitt/xyzpub |
max_upload_size | |
id | 443389 |
size | 15,467 |
Convert xpubs and xprvs to different versions.
use xyzpub::{convert_version, Version};
let xpub = "xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj";
let expected_zpub = "zpub6qUQGY8YyN3ZxYEgf8J6KCQBqQAbdSWaT9RK54L5FWTTh8na8NkCkZpYHnWt7zEwNhqd6p9Utq562cSZsqGqFE87NNsUKnyZeJ5KvbhfC8E";
let result = convert_version(xpub, &Version::Zpub).unwrap();
assert_eq!(result, expected_zpub);