|
|
@ -5,11 +5,11 @@ import { |
|
|
|
getAddress, |
|
|
|
getAddress, |
|
|
|
generatePrivateKey, |
|
|
|
generatePrivateKey, |
|
|
|
} from '@harmony-js/crypto'; |
|
|
|
} from '@harmony-js/crypto'; |
|
|
|
import { Messenger } from '@harmony-js/network'; |
|
|
|
import {Messenger} from '@harmony-js/network'; |
|
|
|
import { isPrivateKey, isAddress } from '@harmony-js/utils'; |
|
|
|
import {isPrivateKey, isAddress} from '@harmony-js/utils'; |
|
|
|
import { Transaction } from '@harmony-js/transaction'; |
|
|
|
import {Transaction} from '@harmony-js/transaction'; |
|
|
|
import { Account } from './account'; |
|
|
|
import {Account} from './account'; |
|
|
|
import { defaultMessenger } from './utils'; |
|
|
|
import {defaultMessenger} from './utils'; |
|
|
|
|
|
|
|
|
|
|
|
class Wallet { |
|
|
|
class Wallet { |
|
|
|
// static method generate Mnemonic
|
|
|
|
// static method generate Mnemonic
|
|
|
@ -47,10 +47,13 @@ class Wallet { |
|
|
|
this.messenger = messenger; |
|
|
|
this.messenger = messenger; |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* @function generateMnemonic |
|
|
|
* @function newMnemonic |
|
|
|
* @memberof Wallet |
|
|
|
* @memberof Wallet |
|
|
|
* @return {string} Mnemonics |
|
|
|
* @return {string} Mnemonics |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
newMnemonic(): string { |
|
|
|
|
|
|
|
return Wallet.generateMnemonic(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @function addByMnemonic |
|
|
|
* @function addByMnemonic |
|
|
@ -326,4 +329,4 @@ class Wallet { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export { Wallet }; |
|
|
|
export {Wallet}; |
|
|
|