-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
154 lines (130 loc) · 3.07 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
enum ApproveStatus {
default
cancelled
confirmed
}
enum BatchStatus {
completed
interrupted
}
type TokenData @jsonField {
name: String
decimals: String
}
type Account @entity {
id: ID! # accountId
transferTotalCount: Int
batchTotalCount: Int
batchRecordsTo: [BatchRecordReceiver] @derivedFrom(field: "receiver")
batchRecordsFrom: [BatchRecordSender] @derivedFrom(field: "sender")
extrinsics: [Extrinsic] @derivedFrom(field: "signer")
transferFrom: [Transfer] @derivedFrom(field: "from")
transferTo: [Transfer] @derivedFrom(field: "to")
}
type ApproveRecord @entity {
id: ID! # accountId-blockNumber-extrinsicIdx
account: String! # approve account address
callHash: String!
multisigRecord: MultisigRecord!
}
type Block @entity {
id: ID! # block hash
number: BigInt
parentHash: String
specVersion: Int
timestamp: Date
extrinsics: [Extrinsic] @derivedFrom(field: "block")
events: [Event] @derivedFrom(field: "block")
}
type BatchRecord @entity {
id: ID! # blockNumber-extrinsicHash
confirmExtrinsicIdx: String
cancelExtrinsicIdx: String
extrinsicHash: String
fees: BigInt
module: String # utility
method: String # batch
signature: String
timestamp: Date
block: Block
calls: [CallData]
status: BatchStatus # completed/interrupted
receivers: [BatchRecordReceiver] @derivedFrom(field: "batch")
sender: [BatchRecordSender] @derivedFrom(field: "batch")
}
type BatchRecordReceiver @entity {
id: ID! # combine id of batch and account id
batch: BatchRecord
receiver: Account
}
type BatchRecordSender @entity {
id: ID! # combine id of batch and account id
batch: BatchRecord
sender: Account
}
type CallData @jsonField {
amount: String
timestamp: Date
receiver: String
sender: String
token: TokenData
}
type Extrinsic @entity {
id: ID! # extrinsic hash
args: String
isSigned: Boolean
isSuccess: Boolean
method: String
nonce: BigInt
section: String
signature: String
timestamp: Date
tip: BigInt
block: Block
signer: Account
events: [Event] @derivedFrom(field: "extrinsic")
}
type Event @entity {
id: ID! # blockNumber-eventIdx
data: String!
index: Int!
method: String!
section: String!
timestamp: Date
block: Block
extrinsic: Extrinsic
}
type MultisigAccount @entity {
id: ID! # multisigAccountId (address)
members: [String!]!
threshold: Int!
record: [MultisigRecord] @derivedFrom(field: "multisigAccount")
}
type MultisigRecord @entity {
id: ID! # multisigAccountId-blockNumber-extrinsicIdx
approvals: [String!]
createExtrinsicIdx: String! # blockNumber-extrinsicIdx
confirmExtrinsicIdx: String
cancelExtrinsicIdx: String
fees: BigInt
module: String!
method: String!
timestamp: Date
status: ApproveStatus! # default/cancelled/confirmed
block: Block!
confirmBlock: Block
multisigAccount: MultisigAccount!
transfer: Transfer
}
type Transfer @entity {
id: ID! # blockNumber-extrinsicHash
amount: BigInt!
extrinsicHash: String
fees: BigInt!
status: Boolean!
timestamp: Date!
block: Block
from: Account!
to: Account!
token: TokenData
}