-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathschema.graphql
71 lines (64 loc) · 1.32 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
### Generic ###
type Token @entity {
id: ID!
name: String
decimals: Int!
symbol: String
# Only interested in tokens with a linked zkAsset
zkAsset: ZkAsset!
}
type ZkAsset @entity {
id: ID!
name: String
scalingFactor: BigInt!
symbol: String
# ZkAsset may be purely private
linkedToken: Token
}
interface TransactionEvent {
id: ID!
block: Int!
event: String!
from: Bytes!
stream: Stream!
timestamp: BigInt!
to: Bytes
}
### NoteStream ###
# The id is the stream's id
type Cancellation implements TransactionEvent @entity {
id: ID!
block: Int!
event: String!
from: Bytes!
stream: Stream!
timestamp: BigInt!
to: Bytes
duration: BigInt!
}
type Withdrawal implements TransactionEvent @entity {
id: ID!
block: Int!
event: String!
from: Bytes!
stream: Stream!
timestamp: BigInt!
to: Bytes
duration: BigInt!
}
type Stream @entity {
id: ID!
cancellation: Cancellation
lastWithdrawTime: BigInt!
# Optional as cancelled streams don't have a note
noteHash: Bytes
recipient: Bytes!
sender: Bytes!
startTime: BigInt!
stopTime: BigInt!
timestamp: BigInt!
# @derivedFrom makes it possible to map large sets of data to the same stream
txs: [TransactionEvent!] @derivedFrom(field: "stream")
withdrawals: [Withdrawal!] @derivedFrom(field: "stream")
zkAsset: ZkAsset
}