-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypes.js
More file actions
47 lines (41 loc) · 937 Bytes
/
Copy pathtypes.js
File metadata and controls
47 lines (41 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// import {IKeyPair} from './qosWeb/core/types'
// import Account from './qosWeb/core'
export class ToPage {
constructor (params) {
this.pageName = params.pageName
this.params = params.params
}
}
export class Asset {
constructor (name, amount) {
this.name = name
this.amount = amount
}
}
export class encrypedKeyPair {
constructor(pub, priv, bech32pub) {
this.publicKey = pub
this.encrypedPrivateKey = priv
this.bech32pub = bech32pub
}
}
export class Account {
constructor (name, address, encrypedKeyPair) {
this.name = name
this.adress = address
this.encrypedKeyPair = encrypedKeyPair
this.qos = new Asset('QOS', 0)
this.qscs = {}
}
getQOS () {
return this.qos.amount
}
getAsset (name) {
if (name === 'QOS') {
return this.qos.amount
} else if (this.qscs.hasOwnProperty(name)) {
return this.qscs[name].amount
}
return null
}
}