-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.graphql
More file actions
38 lines (31 loc) · 896 Bytes
/
schema.graphql
File metadata and controls
38 lines (31 loc) · 896 Bytes
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
type DApp @entity {
id: ID! # evm or wasm smart contract address
account: Account # developer account address
registered: Boolean # true if the dApp is registered, false otherwise
stakes: [Stake] @derivedFrom(field: "dApp") #virtual field
rewards: [Reward] @derivedFrom(field: "dApp") #virtual field
}
type Account @entity {
id: ID! # account address
stakes: [Stake] @derivedFrom(field: "account") #virtual field
rewards: [Reward] @derivedFrom(field: "account") #virtual field
}
type Stake @entity {
id: ID! # AccountId - dAppId
account: Account! @index
dApp: DApp! @index
totalStake: BigInt!
}
type StakeEvent @entity {
id: ID! # Extrinsic hash
account: Account! @index
dApp: DApp! @index
amount: BigInt!
blockNumber: BigInt!
}
type Reward @entity {
id: ID! # AccountId - dAppId
account: Account! @index
dApp: DApp! @index
totalReward: BigInt!
}