Wallet based on ethereumjs-wallet
, for managing local accounts
npm install @rei-network/wallet
const manager = new AccountManager("/root/.rei/keystore");
// new account
const { address } = await manager.newAccount("passphrase");
console.log("new address:", address);
// unlock account
await manager.unlock(address, "passphrase");
// get account private key
console.log(manager.getPrivateKey(address).toString("hex"));