forked from eqlabs/pathfinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pathfinder_ws.json
182 lines (182 loc) · 6.56 KB
/
pathfinder_ws.json
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
{
"openrpc": "1.2.6",
"info": {
"title": "Pathfinder websocket RPC API",
"version": "0.1",
"description": "Provides additional (pathfinder specific) methods over and above the Starknet RPC API"
},
"methods": [
{
"name": "pathfinder_subscribe",
"summary": "Open a new websocket subscription",
"description": "Creates a websocket stream which will fire events of the requested subscription type. Only available for websocket connections.",
"params": [
{
"name": "kind",
"summary": "The type of subscription",
"required": true,
"schema": {
"type": "string",
"enum": [
"newHeads"
]
}
}
],
"result": {
"name": "subscription ID",
"description": "An identifier for this subscription stream used to associate events with this subscription.",
"schema": {
"type": "integer"
}
}
},
{
"name": "pathfinder_unsubscribe",
"summary": "Closes a websocket subscription",
"description": "Creates a websocket stream which will fire events of the requested subscription type. Only available for websocket connections.",
"params": [
{
"name": "subscription ID",
"summary": "The subscription to close",
"required": true,
"schema": {
"type": "integer"
}
}
],
"result": {
"name": "Unsubscription result",
"description": "True if the unsubscription was successful",
"schema": {
"type": "boolean"
}
}
},
{
"name": "pathfinder_subscription",
"summary": "A subscription event notification sent by the node.",
"params": [],
"result": {
"name": "Subscription event",
"schema": {
"type": "object",
"properties": {
"subscription": {
"name": "Subscription ID",
"summary": "The subscription this event is for",
"type": "integer"
},
"event": {
"$ref": "#/components/schemas/BLOCK_HEADER"
}
},
"required": ["subscription", "event"]
}
},
"errors": [
{
"$ref": "#/components/errors/WEBSOCKET_SUBSCRIPTION_CLOSED"
}
]
}
],
"components": {
"contentDescriptors": {},
"schemas": {
"BLOCK_HEADER": {
"type": "object",
"properties": {
"hash": {
"ref": "#/components/schemas/FELT"
},
"parent_hash": {
"ref": "#/components/schemas/FELT"
},
"number": {
"type": "integer"
},
"timestamp": {
"type": "integer"
},
"eth_l1_gas_price": {
"ref": "#/components/schemas/FELT"
},
"strk_l1_gas_price": {
"ref": "#/components/schemas/FELT"
},
"sequencer_address": {
"ref": "#/components/schemas/FELT"
},
"starknet_version": {
"ref": "string"
},
"class_commitment": {
"ref": "#/components/schemas/FELT"
},
"event_commitment": {
"ref": "#/components/schemas/FELT"
},
"state_commitment": {
"ref": "#/components/schemas/FELT"
},
"storage_commitment": {
"ref": "#/components/schemas/FELT"
},
"transaction_commitment": {
"ref": "#/components/schemas/FELT"
},
"transaction_count": {
"type": "integer"
},
"event_count": {
"type": "integer"
}
},
"required": [
"hash",
"parent_hash",
"number",
"timestamp",
"eth_l1_gas_price",
"strk_l1_gas_price",
"sequencer_address",
"starknet_version",
"class_commitment",
"event_commitment",
"state_commitment",
"storage_commitment",
"transaction_commitment",
"transaction_count",
"event_count"
]
},
"FELT": {
"$ref": "./pathfinder_rpc_api.json#/components/schemas/FELT"
}
},
"errors": {
"WEBSOCKET_SUBSCRIPTION_CLOSED": {
"code": -32099,
"message": "Websocket subscription closed",
"data": {
"type": "object",
"description": "More data about the execution failure",
"properties": {
"id": {
"title": "Subscription ID",
"description": "The ID of the closed subscription",
"type": "integer"
},
"reason": {
"title": "Closing reason",
"description": "The reason why the subscription was closed",
"type": "string"
}
},
"required": ["id", "reason"]
}
}
}
}
}