Files
awesome-blockchain/src/basic_chain/js/account.js

22 lines
478 B
JavaScript
Raw Normal View History

'use strict';
class Account {
constructor(keypair, id) {
this.keypair_ = keypair;
this.id_ = id;
this.amount_ = 0;
2019-03-13 13:47:58 +08:00
if (!this.keypair_) {
// load from file
}
if (!this.id_) {
// load from file
}
}
get_id() { return this.id_; }
get_key() { return this.keypair_; }
get_amount() { return this.amount_; }
2019-03-13 13:47:58 +08:00
set_amount(amount) {this.amount_ = amount;}
}
module.exports = Account;