UNPKG

crypto-wallet-core

Version:

A multi-currency support library for address derivation, private key creation, and transaction creation

11 lines (9 loc) 400 B
const BitcoreLibCash = require('bitcore-lib-cash'); import { AbstractBitcoreLibDeriver } from '../btc'; export class BchDeriver extends AbstractBitcoreLibDeriver { bitcoreLib = BitcoreLibCash; getAddress(network: string, pubKey, addressType: string) { pubKey = new this.bitcoreLib.PublicKey(pubKey); return new this.bitcoreLib.Address(pubKey, network, addressType).toString(true); } }