bitpay / bitcore

A full stack for bitcoin and blockchain-based applications
https://bitcore.io/
MIT License
4.88k stars 2.09k forks source link

The BCH address is invalid #2772

Open DingGeng-GitHub opened 4 years ago

DingGeng-GitHub commented 4 years ago

node.js:v12.14.1 npm:6.13.4 bitcore-lib-cash:8.16.2

const bch           = require("bitcore-lib-cash");
var Address = bch.Address;
var BitpayFormat = Address.BitpayFormat;
var CashAddrFormat = Address.CashAddrFormat;
var address = new Address("bitcoincash:qr0q67nsn66cf3klfufttr0vuswh3w5nt5jqpp20t9");

console.log("oldFormat: " +  address) // bitcoincash:qr0q67nsn66cf3klfufttr0vuswh3w5nt5jqpp20t9
    console.log("BitpayFormat:" + address.toString(BitpayFormat)) // bitcoincash:qr0q67nsn66cf3klfufttr0vuswh3w5nt5jqpp20t9
    console.log("CashAddrFormat: " + address.toString(CashAddrFormat)) // bitcoincash:qr0q67nsn66cf3klfufttr0vuswh3w5nt5jqpp20t9

why Converts an address to any other BCH address,but it didn't work?

All, Ask for help

Pissanu14 commented 4 years ago

2853