From 6daa1120e01078fc3fc47d2a8eb3a725b568b769 Mon Sep 17 00:00:00 2001 From: neeboo Date: Tue, 30 Jul 2019 19:06:16 +0800 Subject: [PATCH] feat(account): add newMnemonic --- .travis.yml | 1 + packages/harmony-account/src/wallet.ts | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75c9a80..2a4ef93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ install: - yarn bootstrap script: - yarn dist + cache: directories: - '$HOME/.yarn-cache' diff --git a/packages/harmony-account/src/wallet.ts b/packages/harmony-account/src/wallet.ts index 7af499f..248edd6 100644 --- a/packages/harmony-account/src/wallet.ts +++ b/packages/harmony-account/src/wallet.ts @@ -5,11 +5,11 @@ import { getAddress, generatePrivateKey, } from '@harmony-js/crypto'; -import { Messenger } from '@harmony-js/network'; -import { isPrivateKey, isAddress } from '@harmony-js/utils'; -import { Transaction } from '@harmony-js/transaction'; -import { Account } from './account'; -import { defaultMessenger } from './utils'; +import {Messenger} from '@harmony-js/network'; +import {isPrivateKey, isAddress} from '@harmony-js/utils'; +import {Transaction} from '@harmony-js/transaction'; +import {Account} from './account'; +import {defaultMessenger} from './utils'; class Wallet { // static method generate Mnemonic @@ -47,10 +47,13 @@ class Wallet { this.messenger = messenger; } /** - * @function generateMnemonic + * @function newMnemonic * @memberof Wallet * @return {string} Mnemonics */ + newMnemonic(): string { + return Wallet.generateMnemonic(); + } /** * @function addByMnemonic @@ -326,4 +329,4 @@ class Wallet { } } -export { Wallet }; +export {Wallet};