Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor implementation for better accessibility #24

Open
2 tasks
evias opened this issue Apr 24, 2020 · 0 comments
Open
2 tasks

Refactor implementation for better accessibility #24

evias opened this issue Apr 24, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@evias
Copy link
Contributor

evias commented Apr 24, 2020

It is currently cumbersome to work with this library as it always requires the following:

import {
  ExtendedKey,
  MnemonicPassPhrase,
  Wallet,
} from 'symbol-hd-wallets'

const mnemonic = MnemonicPassPhrase.createRandom()
const xkey = ExtendedKey.createFromSeed(mnemonic.toSeed())
const wallet = new Wallet(xkey)

console.log(`Private Key: ${wallet.getAccount().privateKey}`)
console.log(`Public Key: ${wallet.getAccount().publicKey}`)
console.log(`Address: ${wallet.getAccount().address.plain()}`)

Multiple disadvantages to the above snippet result in following task list:

  • Reduce the overhead necessary to create wallets by mnemonic (e.g. MnemonicPassPhrase.getWallet())
  • Make class definitions consistent (i.e. ExtendedKey + MnemonicPassPhrase use factory create method versus Wallet constructor instantiation)
@evias evias added enhancement New feature or request good first issue Good for newcomers labels Apr 24, 2020
@evias evias added this to Product backlog in Symbol-hd-wallets Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Symbol-hd-wallets
  
Product backlog
Development

No branches or pull requests

1 participant