npm install --save @getsafle/vault-bitcoin-controller
const { KeyringController, getBalance } = require('@getsafle/vault-bitcoin-controller');
const bitcoinController = new KeyringController({
// 12 words mnemonic to create wallet
mnemonic: string,
// network - type of network [TESTNET|MAINNET]
// default is MAINNET even if no network is passed
network: string (TESTNET | MAINNET)
});
const keyringState = await bitcoinController.addAccount();
const privateKey = await bitcoinController.exportPrivateKey(address);
const privateKey = await bitcoinController.getAccounts();
const signedTx = await bitcoinController.signTransaction(bitcoinTx);
bitcoinTx: {from, to, amount, satPerByt}
const signedMsg = await bitcoinController.signMessage(msgString, address);
const fees = await bitcoinController.getFees(rawTransaction);
const balance = await getBalance(address, network); // if network !== TESTNET then it will fetch mainnet balance