-
Notifications
You must be signed in to change notification settings - Fork 16
/
schema.graphql
110 lines (105 loc) · 2.57 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
"""
Generic type for ERC-20 tokens.
"""
type Token @entity {
"The contract address"
id: ID!
"The ERC-20 decimals"
decimals: Int
"The ERC-20 name"
name: String
"The ERC-20 symbol"
symbol: String
}
"""
Generic type for Sablier cancellations.
"""
type Cancellation @entity {
"The same as the stream id"
id: ID!
"Amount of tokens the recipient was distributed"
recipientBalance: BigInt!
"Amount of tokens the sender was distributed"
senderBalance: BigInt!
"The time when the cancellation was made"
timestamp: BigInt!
"The token used for payment"
token: Token
"Transaction hash"
txhash: String!
}
"""
Generic type for Sablier streams.
"""
type Stream @entity {
"Details about cancellation time and the distributed amounts"
cancellation: Cancellation
deposit: BigInt!
"The salary id in v1.0.0 and the actual stream id in v1.1.0"
id: ID!
"How much is being streamed every second"
ratePerSecond: BigInt!
"The address of the recipient account"
recipient: Bytes!
"The address of the sender account, who created the streamed"
sender: Bytes!
"The time when the stream commences"
startTime: BigInt!
"The time when the stream stops"
stopTime: BigInt!
"The time when the stream was created"
timestamp: BigInt!
"The token used for payment"
token: Token
"Exhaustive list of all transactions that interacted with the stream"
txs: [StreamTransaction!] @derivedFrom(field: "stream")
"Exhaustive list of all withdrawals made from the stream"
withdrawals: [Withdrawal!] @derivedFrom(field: "stream")
}
"""
Needed for retroactively indexing cancellations and withdrawals for v1.0.0 streams.
"""
type StreamToSalary @entity {
"The stream id"
id: ID!
"The salary id"
salaryId: BigInt!
}
"""
Transaction that interacted with a stream.
"""
type StreamTransaction @entity {
"Transaction hash concatenated with log index"
id: ID!
"Block number"
block: Int!
"The name of the event emitted"
event: String!
"The caller, or msg.sender"
from: Bytes!
"The stream entity associated with this transaction"
stream: Stream!
"Block timestamp"
timestamp: BigInt!
"The contract address"
to: Bytes
"Transaction hash"
txhash: String!
}
"""
Generic type for Sablier withdrawals.
"""
type Withdrawal @entity {
"Transaction hash concatenated with log index"
id: ID!
"How many tokens were withdrawn"
amount: BigInt!
"The stream entity associated with this withdrawal"
stream: Stream!
"The time when the cancellation was made"
timestamp: BigInt!
"The token used for payment"
token: Token
"Transaction hash"
txhash: String!
}