forked from latticexyz/mud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs-stream.proto
47 lines (41 loc) · 1.3 KB
/
ecs-stream.proto
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
syntax = "proto3";
package ecsstream;
option go_package = "protobuf/go/ecs-stream";
message TxMetadata {
string to = 2;
bytes data = 3;
uint64 value = 4;
}
message ECSEvent {
string eventType = 1;
string componentId = 2;
string entityId = 3;
bytes value = 4;
string txHash = 5;
TxMetadata txMetadata = 6;
}
// The Stream Service definition.
service ECSStreamService {
// Opens a cursor to receive the latest ECS events and additional data specified via request.
rpc SubscribeToStreamLatest (ECSStreamBlockBundleRequest) returns (stream ECSStreamBlockBundleReply) {}
}
// Request to subscribe to an ECSStream. The required parameter is 'worldAddress', while others
// are opt-in based on which data the client is interested in receiving.
message ECSStreamBlockBundleRequest {
string worldAddress = 1;
bool blockNumber = 2;
bool blockHash = 3;
bool blockTimestamp = 4;
bool transactionsConfirmed = 5;
bool ecsEvents = 6;
bool ecsEventsIncludeTxMetadata = 7;
}
// ECSStream response. The fields are populated based on the request which must have been sent when
// starting the subscription.
message ECSStreamBlockBundleReply {
uint32 blockNumber = 1;
string blockHash = 2;
uint32 blockTimestamp = 3;
repeated string transactionsConfirmed = 4;
repeated ECSEvent ecsEvents = 5;
}