import { AccountType } from './type'; import { PublicKey } from '../crypto/public_key'; export class Balance{ Type:AccountType Amount:number setType(type){ this.Type=type } getType(){ return this.Type } setAmount(amount){ this.Amount=amount } getAmount(){ return this.Amount } } export class TemplateAccount{ Name:string; Address:string; PublicKey:PublicKey; Amounts:Array; Permissions:Array; Roles:Array; Code:string; constructor(){ } setName(name){ this.Name=name } getName(){ return this.Name } setAddress(address){ this.Address=address } getAddress(){ return this.Address } setPublicKey(publicKey:PublicKey){ this.PublicKey=publicKey } getPublicKey(){ return this.PublicKey } setCode(code){ this.Code=code } getCode(){ return this.Code } addAmount(accountType:number,amount:number){ if(!this.Amounts ){ this.Amounts =new Array() } let balance=new Balance() balance.setType(accountType) balance.setAmount(amount) this.Amounts.push(balance) } addPermission(permName:string){ if(!this.Permissions){ this.Permissions =new Array() } this.Permissions.push(permName) } addRole(roleName:string){ if(!this.Roles){ this.Roles =new Array() } this.Roles.push(roleName) } }