Activate flow

This commit is contained in:
Michael Vines
2018-08-23 10:07:30 -07:00
parent bbb8055243
commit 96f8a8620d
8 changed files with 59 additions and 23 deletions

View File

@@ -1,7 +1,11 @@
// @flow
import nacl from 'tweetnacl';
import bs58 from 'bs58';
import type {KeyPair} from 'tweetnacl';
export class Account {
_keypair: KeyPair;
constructor(secretKey: ?Buffer = null) {
if (secretKey) {
this._keypair = nacl.sign.keyPair.fromSecretKey(secretKey);
@@ -14,7 +18,7 @@ export class Account {
return bs58.encode(this._keypair.publicKey);
}
get secretKey(): string {
get secretKey(): Buffer {
return this._keypair.secretKey;
}
}