| home |
true |
| heroText |
Lbox.js |
| heroImage |
/logo.svg |
| tagline |
A simple and beautiful bitcoin cash nodejs library. |
| bgImageStyle |
|
| isShowTitleInHome |
true |
| actionText |
Guide |
| actionLink |
/docs/ |
| features |
| title |
details |
Easy |
Simple syntax similar to bitbox/bchjs |
|
| title |
details |
Dependencies |
Lbox just uses libauth as dependency because it has zero dependencies |
|
| title |
details |
Extended |
You can extended the library to add new methods |
|
|
lbox.Address.toLegacyAddress(
"bitcoincash:qzm47qz5ue99y9yl4aca7jnz7dwgdenl85jkfx3znl"
);
let decoded;
let type;
if (cashAddress.split(":").length == 2) {
// decode Address with prefix
decoded = libauth.decodeCashAddress(cashAddress);
if (typeof decoded != "object") throw new Error(decoded);
type = libauth.CashAddressType[decoded.type].toLocaleLowerCase();
} else {
decoded = libauth.decodeCashAddressFormatWithoutPrefix(cashAddress);
if (typeof decoded != "object") throw new Error(decoded);
type = libauth.CashAddressType[decoded.version].toLocaleLowerCase();
}
// check if Address from test net
type = decoded.prefix == "bitcoincash" ? type : type + "-testnet";
libauth.encodeBase58Address(this.instantiateSha256, type, decoded.hash);
BCH
bitcoincash:qqqxpdhdu8umgzr9adzfvypdu65xqtejtq9nssqyww