UNPKG

chaingate

Version:

A complete TypeScript library for connecting to and making transactions on different blockchains

27 lines 1.01 kB
import { UtxoWallet } from '../../abstract/UtxoWallet/UtxoWallet'; import { BitcoinCashPreparedTransaction } from './BitcoinCashPreparedTransaction'; Object.defineProperty(global, '_bitcoreCash', { get() { return undefined; }, set() { }, configurable: true, }); export class BitcoinCashWallet extends UtxoWallet { constructor(utils, transports) { super(utils, transports, { bech32: 'bc', pubKeyHash: 0x00, scriptHash: 0x05, wif: 0x80, }); } async getAddress(addressType = 'cashaddr') { return this.utils.publicKeyToAddress(await this.getPublicKey(), addressType); } async createTransfer(toAddress, amount) { const privateKeyProvider = await this.transports.getPrivateKeyProvider(this.utils.currencyInfo.id); return new BitcoinCashPreparedTransaction(this.utils, await this.getAddress(), toAddress, amount, privateKeyProvider); } } //# sourceMappingURL=BitcoinCashWallet.js.map