forked from darwinia-network/subql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
75 lines (59 loc) · 1.3 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
type Block @entity {
id: ID!
number: BigInt
timestamp: Date
parentHash: String
specVersion: Int
extrinsics: [Extrinsic] @derivedFrom(field: "block")
events: [Event] @derivedFrom(field: "block")
transfers: [Transfer] @derivedFrom(field: "block")
}
type Extrinsic @entity {
id: ID!
method: String
section: String
args: String
signer: Account #create relation to account
nonce: BigInt
timestamp: Date
signature: String
tip: BigInt
isSigned: Boolean
isSuccess: Boolean
block: Block #create relation to block
events: [Event] @derivedFrom(field: "extrinsic")
}
type Event @entity {
id: ID!
index: Int!
section: String!
method: String!
data: String!
timestamp: Date
block: Block #create relation to block
extrinsic: Extrinsic #create relation to extrinsic
}
type Account @entity {
id: ID!
transferTotalCount: Int
extrinsics: [Extrinsic] @derivedFrom(field: "signer")
transferIn: [Transfer] @derivedFrom(field: "to")
transferOut: [Transfer] @derivedFrom(field: "from")
}
type Token @entity {
id: ID!
decimal: Int
name: String
}
type Transfer @entity {
id: ID!
from: Account
to: Account
token: Token
amount: BigInt
timestamp: Date
fee: BigInt
blockNumber: BigInt
# TODO add index field
block: Block #create relation to block
}