This repository was archived by the owner on Sep 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
102 lines (78 loc) · 1.76 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
type Block @entity {
id: ID!
number: BigInt
timestamp: Date
parentHash: String
specVersion: Int
extrinsics: [Extrinsic] @derivedFrom(field: "block")
events: [Event] @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")
calls: [Call] @derivedFrom(field: "extrinsic")
}
type Event @entity {
id: ID!
index: Int!
section: String!
method: String!
data: String!
block: Block #create relation to block
extrinsic: Extrinsic #create relation to extrins
}
type Call @entity {
id: ID!
section: String
method: String
args: String
timestamp: Date
isSuccess: Boolean
signer: Account #create ration to account
extrinsic: Extrinsic #create relation to extrinsic
parentCall: Call #create relation to call
calls: [Call] @derivedFrom(field: "parentCall")
}
type Account @entity {
id: ID!
extrinsics: [Extrinsic] @derivedFrom(field: "signer")
calls: [Call] @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
extrinsic: Extrinsic #create relation to extrinsic
call: Call #create relation to call
timestamp: Date
isSuccess: Boolean
}
type ExchangeData @jsonField {
key: String
value: String
}
type ExchangeRate @entity {
id: ID!
rates: [ExchangeData]
blockNumber: BigInt
}