Activate flow
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user