-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
113 lines (97 loc) · 1.91 KB
/
schema.graphql
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
type KVData @jsonField {
key: String
value: String
type: String
}
type Block @entity {
id: ID!
number: BigInt
timestamp: Date
parentHash: String
specVersion: String
stateRoot: String
extrinsicRoot: String
extrinsics: [Extrinsic] @derivedFrom(field: "block")
events: [Event] @derivedFrom(field: "block")
}
type Event @entity {
id: ID!
index: Int
section: String
method: String
data: [KVData]
timestamp: Date
blockNumber: BigInt
block: Block
extrinsic: Extrinsic
}
type Extrinsic @entity {
id: ID!
method: String
section: String
args: [KVData]
nonce: BigInt
timestamp: Date
signature: String
tip: String
isSigned: Boolean
isSuccess: Boolean
block: Block
events: [Event] @derivedFrom(field: "extrinsic")
}
type OracleExchangeRate @entity {
id: ID!
timestamp: Date
origin: String
key: String
value: String
}
type BTCAddress @entity {
id: ID!
vault: Vault
}
type Vault @entity {
id: ID!
registerDate: Date
lastEventAt: Date
btcAddresses: [BTCAddress] @derivedFrom(field: "vault")
tokeRedeemEvents: [TokenRedeemEvent] @derivedFrom(field: "vault")
tokenIssueEvents: [TokenIssueEvent] @derivedFrom(field: "vault")
btcPublicKey: String
# colateralType: String
colateralAmount: BigInt
issuedTokens: BigInt
totalIssuedTokens: BigInt
totalRedeemedTokens: BigInt
toBeIssuedTokens: BigInt
toBeRedeemedTokens: BigInt
toBeReplacedTokens: BigInt
bannedUntilBlock: BigInt
}
type DepositCollateralEvent @entity {
id: ID!
timestamp: Date!
vault: Vault!
amount: BigInt!
totalColateral: BigInt
freeCollateral: BigInt
}
type WithdrawCollateralEvent @entity {
id: ID!
timestamp: Date!
vault: Vault!
amount: BigInt!
totalColateral: BigInt
}
type TokenRedeemEvent @entity {
id: ID!
timestamp: Date!
vault: Vault!
amount: BigInt!
}
type TokenIssueEvent @entity {
id: ID!
timestamp: Date!
vault: Vault!
amount: BigInt!
}