forked from Quantumlyy/nftx-holdings-subgraph-mainnet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
78 lines (77 loc) · 1.89 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
type Account @entity {
id: ID!
asERC20: ERC20Contract
asVaultAsset: VaultAsset
ERC20balances: [ERC20Balance!]! @derivedFrom(field: "account")
ERC20approvalsOwner: [ERC20Approval!]! @derivedFrom(field: "owner")
ERC20approvalsSpender: [ERC20Approval!]! @derivedFrom(field: "spender")
ERC20transferFromEvent: [ERC20Transfer!]! @derivedFrom(field: "from")
ERC20transferToEvent: [ERC20Transfer!]! @derivedFrom(field: "to")
events: [Event!]! @derivedFrom(field: "emitter")
}
type VaultAsset @entity {
id: ID!
asAccount: Account
asERC20: ERC20Contract
xTokenShareValue: BigInt
vaultId: BigInt
type: String
}
type ERC20Contract @entity {
id: ID!
asAccount: Account!
asVaultAsset: VaultAsset!
name: String
symbol: String
decimals: Int!
totalSupply: ERC20Balance!
balances: [ERC20Balance!]! @derivedFrom(field: "contract")
approvals: [ERC20Approval!]! @derivedFrom(field: "contract")
transfers: [ERC20Transfer!]! @derivedFrom(field: "contract")
}
type ERC20Balance @entity {
id: ID!
contract: ERC20Contract!
account: Account
value: BigDecimal!
valueExact: BigInt!
transferFromEvent: [ERC20Transfer!]! @derivedFrom(field: "fromBalance")
transferToEvent: [ERC20Transfer!]! @derivedFrom(field: "toBalance")
}
type ERC20Approval @entity {
id: ID!
contract: ERC20Contract!
owner: Account!
spender: Account!
value: BigDecimal!
valueExact: BigInt!
}
interface Event {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
}
type ERC20Transfer implements Event @entity {
id: ID!
emitter: Account!
transaction: Transaction!
timestamp: BigInt!
contract: ERC20Contract!
from: Account
fromBalance: ERC20Balance
to: Account
toBalance: ERC20Balance
value: BigDecimal!
valueExact: BigInt!
}
type Transaction @entity {
id: ID!
timestamp: BigInt!
blockNumber: BigInt!
events: [Event!]! @derivedFrom(field: "transaction")
}
type VaultAddressLookup @entity {
id: ID! #ID
address: Bytes!
}