1 unstable release
0.1.0 | Mar 9, 2019 |
---|
#8 in #bch
1,321 downloads per month
Used in cash_tx_builder
45KB
696 lines
bch_addr
cash_addr format implementation inspired by bchaddrjs.
Usage
use bch_addr::Converter;
let converter = Converter::new();
let cash_addr = converter.to_cash_addr("1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR").unwrap();
assert_eq!(cash_addr, "bitcoincash:qph5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk");
let legacy_addr = converter.to_legacy_addr(&cash_addr).unwrap();
assert_eq!(legacy_addr, "1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR");
lib.rs
:
cash_addr format implementation inspired by bchaddrjs.
Example
use bch_addr::Converter;
let converter = Converter::new();
let cash_addr = converter.to_cash_addr("1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR").unwrap();
assert_eq!(cash_addr, "bitcoincash:qph5kuz78czq00e3t85ugpgd7xmer5kr7c5f6jdpwk");
let legacy_addr = converter.to_legacy_addr(&cash_addr).unwrap();
assert_eq!(legacy_addr, "1B9UNtBfkkpgt8kVbwLN9ktE62QKnMbDzR");
Dependencies
~1MB
~18K SLoC