#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 230/week @ 2024-08-04 225/week @ 2024-08-11 185/week @ 2024-08-18 89/week @ 2024-08-25 205/week @ 2024-09-01 62/week @ 2024-09-08 266/week @ 2024-09-15 64/week @ 2024-09-22 73/week @ 2024-09-29 146/week @ 2024-10-06 353/week @ 2024-10-13 175/week @ 2024-10-20 63/week @ 2024-10-27 409/week @ 2024-11-03 526/week @ 2024-11-10 321/week @ 2024-11-17

1,321 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