| Crates.io | pubport |
| lib.rs | pubport |
| version | 0.4.0 |
| created_at | 2025-03-05 19:21:22.0729+00 |
| updated_at | 2025-04-23 16:15:58.193876+00 |
| description | A library for parsing hardware wallet export formats |
| homepage | https://github.com/bitcoinppl/pubport |
| repository | https://github.com/bitcoinppl/pubport |
| max_upload_size | |
| id | 1579466 |
| size | 113,235 |
A tool to import a wallet public key with descriptors from many different formats seamlessly
use pubport::Format;
let string = std::fs::read_to_string("test/data/sparrow-export.json").unwrap();
let format = Format::try_new_from_str(&string);
assert!(format.is_ok());
let format = format.unwrap();
assert!(matches!(format, Format::Json(_)));
note: need external and internal descriptors, but can be single descriptor or multiple descriptor format
use pubport::Format;
let string = std::fs::read_to_string("test/data/descriptor.txt").unwrap();
let format = Format::try_new_from_str(&string);
assert!(format.is_ok());
let format = format.unwrap();
assert!(matches!(format, Format::Descriptor(_)));
use pubport::Format;
let string = std::fs::read_to_string("test/data/new-wasabi.json").unwrap();
let format = Format::try_new_from_str(&string);
assert!(format.is_ok());
let format = format.unwrap();
assert!(matches!(format, Format::Wasabi(_)));
use pubport::Format;
let string = std::fs::read_to_string("test/data/new-electrum.json").unwrap();
let format = Format::try_new_from_str(&string);
assert!(format.is_ok());
let format = format.unwrap();
assert!(matches!(format, Format::Electrum(_)));