-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
70 lines (65 loc) · 1.33 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
# erc20 transfer
type Owner @entity {
id: ID!
balance: BigInt!
}
type ERC20Transfer @entity {
id: ID!
from: Owner
to: Owner
amount: BigInt!
timestamp: DateTime!
block: Int!
currencyId: String @index
}
# currency transfer
type Account @entity {
"Account address"
id: ID!
transfersTo: [Transfer!] @derivedFrom(field: "to")
transfersFrom: [Transfer!] @derivedFrom(field: "from")
}
type Transfer @entity {
id: ID!
blockNumber: Int! @index
timestamp: DateTime! @index
extrinsicHash: String @index
from: Account!
to: Account!
amount: BigInt! @index
fee: BigInt # fee is calculated at the best effort and may be zero for some old extrinsics
}
type EthTransaction @entity {
hash: String! @index
nonce: Int!
blockHash: String
blockNumber: EthBlock
transactionIndex: Int
from: String!
to: String!
value: String
gasPrice: String
gas: Int
input: String
}
type EthBlock @entity {
number: Int @index
hash: String @index
parentHash: String!
baseFeePerGas: Int
nonce: String
sha3Uncles: String!
logsBloom: String
transactionsRoot: String!
stateRoot: String
miner: String
difficulty: String
totalDifficulty: String
extraData: String
size: Int
gasLimit: Int
gasUsed: Int
timestamp: Int
transactions: [EthTransaction] @derivedFrom(field: "blockNumber")
uncles: [String]
}