-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
112 lines (100 loc) · 2.38 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
# To improve query performance, we strongly suggest adding indexes to any field that you plan to filter or sort by
# Add the `@index` or `@index(unique: true)` annotation after any non-key field
# https://academy.subquery.network/build/graphql.html#indexing-by-non-primary-key-field
enum TxStatus {
Success
Error
}
type EventAttribute @entity {
id: ID!
key: String!
value: String!
event: Event!
}
type Block @entity {
id: ID! # The block header hash
chainId: String! @index
height: BigInt! @index
timestamp: Date!
transactions: [Transaction] @derivedFrom(field: "block")
messages: [Message] @derivedFrom(field: "block")
events: [Event] @derivedFrom(field: "block")
}
type Transaction @entity {
id: ID!
block: Block!
gasUsed: BigInt!
gasWanted: BigInt!
fees: [Coin]!
memo: String
status: TxStatus!
log: String
# timeline: BigInt! @index
timeoutHeight: BigInt @index
# NB: only the first signer!
signerAddress: String @index
messages: [Message] @derivedFrom(field: "transaction")
}
type Message @entity {
id: ID!
# typeUrl: String! @index
typeUrl: String @index
json: String
# timeline: BigInt! @index
transaction: Transaction!
block: Block!
}
type Event @entity {
id: ID!
type: String! @index
attributes: [EventAttribute]! @derivedFrom(field: "event")
transaction: Transaction
block: Block!
}
type Coin @jsonField {
denom: String!
amount: String!
}
type NativeTransfer @entity {
id: ID!
toAddress: String! @index
fromAddress: String! @index
amounts: [Coin]!
denom: String! @index
# timeline: BigInt! @index
message: Message!
transaction: Transaction!
block: Block!
}
type Account @entity {
# id is the address
id: ID!
chainId: String! @index
nativeBalanceChanges: [NativeBalanceChange]! @derivedFrom(field: "account")
# cw20BalanceChanges: [Cw20BalanceChange]! @derivedFrom(field: "account")
genesisBalances: [GenesisBalance] @derivedFrom(field: "account")
}
type GenesisBalance @entity {
id: ID!
amount: BigInt!
denom: String! @index
account: Account!
}
type NativeBalanceChange @entity {
id: ID!
balanceOffset: BigInt!
denom: String! @index
account: Account!
# timeline: BigInt! @index
event: Event!
transaction: Transaction
block: Block!
}
type UnprocessedEntity @entity {
id: ID!
error: String!
event: Event
message: Message
transaction: Transaction
block: Block
}