A Module written in javascript for managing various keyrings of BEVM accounts, encrypting them, and using them. This repository contains BEVMHdKeyring
class to create BEVM wallet from Safle Vault.
npm install --save @getsafle/vault-bevm-controller
const { KeyringController, getBalance } = require('@getsafle/vault-bevm-controller');
const bevmController = new KeyringController({
encryptor: {
// An optional object for defining encryption schemes:
// Defaults to Browser-native SubtleCrypto.
encrypt(password, object) {
return new Promise('encrypted!');
},
decrypt(password, encryptedString) {
return new Promise({ foo: 'bar' });
},
},
});
const keyringState = await bevmController.createNewVaultAndKeychain(password);
const keyringState = await bevmController.createNewVaultAndRestore(password, mnemonic);
const keyringState = await bevmController.addNewAccount(keyringObject);
const privateKey = await bevmController.exportAccount(address);
const signedTx = await bevmController.signTransaction(bevmTx, _fromAddress);
const signedMsg = await bevmController.signMessage(msgParams);
const signedObj = await bevmController.sign(msgParams, pvtKey, web3Obj);
const signedData = await bevmController.signTypedMessage(msgParams);
const balance = await bevmController.getBalance(address, web3);
const receipt = await bevmController.sendTransaction(signedTx, web3);
const fees = await bevmController.getFees(rawTx, web3);