#cash #bitcoin #bch

bch_addr

cash_addr format implementation inspired by bchaddrjs

1 unstable release

0.1.0 Mar 9, 2019

#8 in #bch

Download history 17/week @ 2024-06-06 25/week @ 2024-06-13 51/week @ 2024-06-20 10/week @ 2024-06-27 6/week @ 2024-07-04 27/week @ 2024-07-11 144/week @ 2024-07-18 43/week @ 2024-07-25 93/week @ 2024-08-01 373/week @ 2024-08-08 139/week @ 2024-08-15 113/week @ 2024-08-22 162/week @ 2024-08-29 112/week @ 2024-09-05 205/week @ 2024-09-12 114/week @ 2024-09-19

617 downloads per month
Used in cash_tx_builder

MIT license

45KB
696 lines

bch_addr

CircleCI codecov

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