A flutter package for converting xpubs and xprvs to different versions.
To use the bitcoin_utils
package in your project, add it as a dependency in your project's pubspec.yaml:
dependencies:
bitcoin_utils:
import 'package:bitcoin_utils/xyzpub.dart';
// ....
const xPub =
'xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj';
const expectedZPub =
"zpub6qUQGY8YyN3ZxYEgf8J6KCQBqQAbdSWaT9RK54L5FWTTh8na8NkCkZpYHnWt7zEwNhqd6p9Utq562cSZsqGqFE87NNsUKnyZeJ5KvbhfC8E";
final result = convertVersion(xPub, Version.zPub);
expect(result, expectedZPub);
Please see /test/bitcoin_utils_test.dart
for more usage examples
This package is based on the xyzpub Rust crate: https://docs.rs/xyzpub/0.3.0/xyzpub/
As more functionality and utilities are added, more references if any will be added here.
There will be a React Native version of this package as well.