import { AccAddress , MnemonicKey , PublicKey , Wallet } from '@terra-money/terra.js' ; import { JSONSerializable } from '../utils/json' ; import { CHAINS } from './output' ; export class Account extends JSONSerializable < Account . Data > { accAddress : AccAddress ; publicKey : PublicKey ; privateKey : Buffer ; mnemonic : string ; constructor ( chain ) { super ( ) ; switch ( chain ) { case CHAINS . TERRA : { const account = new MnemonicKey ( ) ; this . accAddress = account . accAddress ; this . publicKey = account . publicKey ; this . privateKey = account . privateKey ; this . mnemonic = account . mnemonic ; } } } toData ( ) { return { acc_address : this . accAddress . toString ( ) , public_key : this . publicKey . toString ( ) , private_key : this . privateKey , mnemonic : this . mnemonic , } ; } get_private_key ( ) { return this . privateKey ; } } export namespace Account { export interface Data { acc_address : AccAddress ; public_key : string ; private_key : Buffer ; mnemonic : string ; } } export { Wallet , MnemonicKey } ;