0.0.3 • Published 1 year ago

@nolanle/mixlib v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

npm npm-downloads

Installation

First of all, installation step:

  • With npm
npm install @nolanle/mixlib
  • With yarn
yarn add @nolanle/mixlib

Usages

  • Generate Master Key and Mnemonic
import {create, Network} from '@nolanle/mixlib;

<!-- 12 | 15 | 18 | 21 | 24 -->
const count = 12;

<!-- use this -->
const masterKey = await create('Master Key', count);
console.log(masterKey.mnemonic);
  • Derive master key to accounts
const network = new Network('Ethereum', 'ETH', 18, 60);
const ethAccount = masterKey.derive(network);
  • Working with account
const address = ethAccount.toAddress();
const balance = ethAccount.getBalance();
const privkey = ethAccount.toPrivateKey();