@latticexyz/services 1.4.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/ecs-relay CHANGED
Binary file
package/bin/ecs-snapshot CHANGED
Binary file
package/bin/ecs-stream CHANGED
Binary file
package/bin/faucet CHANGED
Binary file
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@latticexyz/services",
3
3
  "license": "MIT",
4
- "version": "1.4.1",
4
+ "version": "1.5.1",
5
5
  "description": "MUD services for enhanced interactions with on-chain ECS state",
6
+ "main": "protobuf/ts",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "https://github.com/latticexyz/mud.git",
@@ -16,15 +17,8 @@
16
17
  "release": "npm publish || echo 'version already published'"
17
18
  },
18
19
  "devDependencies": {
19
- "@protobuf-ts/grpcweb-transport": "^2.7.0",
20
- "@protobuf-ts/plugin": "^2.7.0",
21
- "@protobuf-ts/runtime-rpc": "^2.7.0",
20
+ "ts-proto": "^1.126.1",
22
21
  "typedoc": "^0.23.10"
23
22
  },
24
- "peerDependencies": {
25
- "@protobuf-ts/grpcweb-transport": "^2.7.0",
26
- "@protobuf-ts/plugin": "^2.7.0",
27
- "@protobuf-ts/runtime-rpc": "^2.7.0"
28
- },
29
- "gitHead": "9a9fc82623cb29802c55aa4e13808dc191f535c7"
23
+ "gitHead": "6a1d4576b5b3772d2e4805067d90336e24dfe825"
30
24
  }
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-go v1.28.1
4
- // protoc v3.21.3
4
+ // protoc v3.20.1
5
5
  // source: proto/ecs-relay.proto
6
6
 
7
7
  package ecs_relay
@@ -586,7 +586,7 @@ var file_proto_ecs_relay_proto_rawDesc = []byte{
586
586
  0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2f, 0x0a, 0x17, 0x43, 0x6f, 0x75, 0x6e, 0x74,
587
587
  0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
588
588
  0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
589
- 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xac, 0x05, 0x0a, 0x0f, 0x45, 0x43, 0x53,
589
+ 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xef, 0x05, 0x0a, 0x0f, 0x45, 0x43, 0x53,
590
590
  0x52, 0x65, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0c,
591
591
  0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x13, 0x2e, 0x65,
592
592
  0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
@@ -621,17 +621,21 @@ var file_proto_ecs_relay_proto_rawDesc = []byte{
621
621
  0x6e, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x0a, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61,
622
622
  0x6d, 0x12, 0x13, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x53, 0x69, 0x67,
623
623
  0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x11, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61,
624
- 0x79, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x37, 0x0a,
625
- 0x04, 0x50, 0x75, 0x73, 0x68, 0x12, 0x15, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79,
626
- 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x65,
627
- 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70,
628
- 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x08, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x61,
629
- 0x6e, 0x79, 0x12, 0x19, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x50, 0x75,
630
- 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
631
- 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73,
632
- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x17, 0x5a, 0x15, 0x70, 0x72, 0x6f, 0x74, 0x6f,
633
- 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x63, 0x73, 0x2d, 0x72, 0x65, 0x6c, 0x61, 0x79,
634
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
624
+ 0x79, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x41, 0x0a,
625
+ 0x0a, 0x50, 0x75, 0x73, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x15, 0x2e, 0x65, 0x63,
626
+ 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65,
627
+ 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x50, 0x75,
628
+ 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01,
629
+ 0x12, 0x37, 0x0a, 0x04, 0x50, 0x75, 0x73, 0x68, 0x12, 0x15, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65,
630
+ 0x6c, 0x61, 0x79, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
631
+ 0x16, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52,
632
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x08, 0x50, 0x75, 0x73,
633
+ 0x68, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x19, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79,
634
+ 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
635
+ 0x1a, 0x16, 0x2e, 0x65, 0x63, 0x73, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x50, 0x75, 0x73, 0x68,
636
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x17, 0x5a, 0x15, 0x70, 0x72,
637
+ 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f, 0x2f, 0x65, 0x63, 0x73, 0x2d, 0x72, 0x65,
638
+ 0x6c, 0x61, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
635
639
  }
636
640
 
637
641
  var (
@@ -673,20 +677,22 @@ var file_proto_ecs_relay_proto_depIdxs = []int32{
673
677
  3, // 10: ecsrelay.ECSRelayService.Subscribe:input_type -> ecsrelay.SubscriptionRequest
674
678
  3, // 11: ecsrelay.ECSRelayService.Unsubscribe:input_type -> ecsrelay.SubscriptionRequest
675
679
  1, // 12: ecsrelay.ECSRelayService.OpenStream:input_type -> ecsrelay.Signature
676
- 5, // 13: ecsrelay.ECSRelayService.Push:input_type -> ecsrelay.PushRequest
677
- 6, // 14: ecsrelay.ECSRelayService.PushMany:input_type -> ecsrelay.PushManyRequest
678
- 0, // 15: ecsrelay.ECSRelayService.Authenticate:output_type -> ecsrelay.Identity
679
- 0, // 16: ecsrelay.ECSRelayService.Revoke:output_type -> ecsrelay.Identity
680
- 0, // 17: ecsrelay.ECSRelayService.Ping:output_type -> ecsrelay.Identity
681
- 9, // 18: ecsrelay.ECSRelayService.CountAuthenticated:output_type -> ecsrelay.CountIdentitiesResponse
682
- 9, // 19: ecsrelay.ECSRelayService.CountConnected:output_type -> ecsrelay.CountIdentitiesResponse
683
- 4, // 20: ecsrelay.ECSRelayService.Subscribe:output_type -> ecsrelay.Subscription
684
- 4, // 21: ecsrelay.ECSRelayService.Unsubscribe:output_type -> ecsrelay.Subscription
685
- 2, // 22: ecsrelay.ECSRelayService.OpenStream:output_type -> ecsrelay.Message
686
- 7, // 23: ecsrelay.ECSRelayService.Push:output_type -> ecsrelay.PushResponse
687
- 7, // 24: ecsrelay.ECSRelayService.PushMany:output_type -> ecsrelay.PushResponse
688
- 15, // [15:25] is the sub-list for method output_type
689
- 5, // [5:15] is the sub-list for method input_type
680
+ 5, // 13: ecsrelay.ECSRelayService.PushStream:input_type -> ecsrelay.PushRequest
681
+ 5, // 14: ecsrelay.ECSRelayService.Push:input_type -> ecsrelay.PushRequest
682
+ 6, // 15: ecsrelay.ECSRelayService.PushMany:input_type -> ecsrelay.PushManyRequest
683
+ 0, // 16: ecsrelay.ECSRelayService.Authenticate:output_type -> ecsrelay.Identity
684
+ 0, // 17: ecsrelay.ECSRelayService.Revoke:output_type -> ecsrelay.Identity
685
+ 0, // 18: ecsrelay.ECSRelayService.Ping:output_type -> ecsrelay.Identity
686
+ 9, // 19: ecsrelay.ECSRelayService.CountAuthenticated:output_type -> ecsrelay.CountIdentitiesResponse
687
+ 9, // 20: ecsrelay.ECSRelayService.CountConnected:output_type -> ecsrelay.CountIdentitiesResponse
688
+ 4, // 21: ecsrelay.ECSRelayService.Subscribe:output_type -> ecsrelay.Subscription
689
+ 4, // 22: ecsrelay.ECSRelayService.Unsubscribe:output_type -> ecsrelay.Subscription
690
+ 2, // 23: ecsrelay.ECSRelayService.OpenStream:output_type -> ecsrelay.Message
691
+ 7, // 24: ecsrelay.ECSRelayService.PushStream:output_type -> ecsrelay.PushResponse
692
+ 7, // 25: ecsrelay.ECSRelayService.Push:output_type -> ecsrelay.PushResponse
693
+ 7, // 26: ecsrelay.ECSRelayService.PushMany:output_type -> ecsrelay.PushResponse
694
+ 16, // [16:27] is the sub-list for method output_type
695
+ 5, // [5:16] is the sub-list for method input_type
690
696
  5, // [5:5] is the sub-list for extension type_name
691
697
  5, // [5:5] is the sub-list for extension extendee
692
698
  0, // [0:5] is the sub-list for field type_name
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
2
  // versions:
3
3
  // - protoc-gen-go-grpc v1.2.0
4
- // - protoc v3.21.3
4
+ // - protoc v3.20.1
5
5
  // source: proto/ecs-relay.proto
6
6
 
7
7
  package ecs_relay
@@ -30,6 +30,8 @@ type ECSRelayServiceClient interface {
30
30
  Subscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
31
31
  Unsubscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
32
32
  OpenStream(ctx context.Context, in *Signature, opts ...grpc.CallOption) (ECSRelayService_OpenStreamClient, error)
33
+ // Push a stream of messages to be relayed.
34
+ PushStream(ctx context.Context, opts ...grpc.CallOption) (ECSRelayService_PushStreamClient, error)
33
35
  // Push a single message to be relayed.
34
36
  Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error)
35
37
  // Push a series of messages to be relayed.
@@ -139,6 +141,37 @@ func (x *eCSRelayServiceOpenStreamClient) Recv() (*Message, error) {
139
141
  return m, nil
140
142
  }
141
143
 
144
+ func (c *eCSRelayServiceClient) PushStream(ctx context.Context, opts ...grpc.CallOption) (ECSRelayService_PushStreamClient, error) {
145
+ stream, err := c.cc.NewStream(ctx, &ECSRelayService_ServiceDesc.Streams[1], "/ecsrelay.ECSRelayService/PushStream", opts...)
146
+ if err != nil {
147
+ return nil, err
148
+ }
149
+ x := &eCSRelayServicePushStreamClient{stream}
150
+ return x, nil
151
+ }
152
+
153
+ type ECSRelayService_PushStreamClient interface {
154
+ Send(*PushRequest) error
155
+ Recv() (*PushResponse, error)
156
+ grpc.ClientStream
157
+ }
158
+
159
+ type eCSRelayServicePushStreamClient struct {
160
+ grpc.ClientStream
161
+ }
162
+
163
+ func (x *eCSRelayServicePushStreamClient) Send(m *PushRequest) error {
164
+ return x.ClientStream.SendMsg(m)
165
+ }
166
+
167
+ func (x *eCSRelayServicePushStreamClient) Recv() (*PushResponse, error) {
168
+ m := new(PushResponse)
169
+ if err := x.ClientStream.RecvMsg(m); err != nil {
170
+ return nil, err
171
+ }
172
+ return m, nil
173
+ }
174
+
142
175
  func (c *eCSRelayServiceClient) Push(ctx context.Context, in *PushRequest, opts ...grpc.CallOption) (*PushResponse, error) {
143
176
  out := new(PushResponse)
144
177
  err := c.cc.Invoke(ctx, "/ecsrelay.ECSRelayService/Push", in, out, opts...)
@@ -169,6 +202,8 @@ type ECSRelayServiceServer interface {
169
202
  Subscribe(context.Context, *SubscriptionRequest) (*Subscription, error)
170
203
  Unsubscribe(context.Context, *SubscriptionRequest) (*Subscription, error)
171
204
  OpenStream(*Signature, ECSRelayService_OpenStreamServer) error
205
+ // Push a stream of messages to be relayed.
206
+ PushStream(ECSRelayService_PushStreamServer) error
172
207
  // Push a single message to be relayed.
173
208
  Push(context.Context, *PushRequest) (*PushResponse, error)
174
209
  // Push a series of messages to be relayed.
@@ -204,6 +239,9 @@ func (UnimplementedECSRelayServiceServer) Unsubscribe(context.Context, *Subscrip
204
239
  func (UnimplementedECSRelayServiceServer) OpenStream(*Signature, ECSRelayService_OpenStreamServer) error {
205
240
  return status.Errorf(codes.Unimplemented, "method OpenStream not implemented")
206
241
  }
242
+ func (UnimplementedECSRelayServiceServer) PushStream(ECSRelayService_PushStreamServer) error {
243
+ return status.Errorf(codes.Unimplemented, "method PushStream not implemented")
244
+ }
207
245
  func (UnimplementedECSRelayServiceServer) Push(context.Context, *PushRequest) (*PushResponse, error) {
208
246
  return nil, status.Errorf(codes.Unimplemented, "method Push not implemented")
209
247
  }
@@ -370,6 +408,32 @@ func (x *eCSRelayServiceOpenStreamServer) Send(m *Message) error {
370
408
  return x.ServerStream.SendMsg(m)
371
409
  }
372
410
 
411
+ func _ECSRelayService_PushStream_Handler(srv interface{}, stream grpc.ServerStream) error {
412
+ return srv.(ECSRelayServiceServer).PushStream(&eCSRelayServicePushStreamServer{stream})
413
+ }
414
+
415
+ type ECSRelayService_PushStreamServer interface {
416
+ Send(*PushResponse) error
417
+ Recv() (*PushRequest, error)
418
+ grpc.ServerStream
419
+ }
420
+
421
+ type eCSRelayServicePushStreamServer struct {
422
+ grpc.ServerStream
423
+ }
424
+
425
+ func (x *eCSRelayServicePushStreamServer) Send(m *PushResponse) error {
426
+ return x.ServerStream.SendMsg(m)
427
+ }
428
+
429
+ func (x *eCSRelayServicePushStreamServer) Recv() (*PushRequest, error) {
430
+ m := new(PushRequest)
431
+ if err := x.ServerStream.RecvMsg(m); err != nil {
432
+ return nil, err
433
+ }
434
+ return m, nil
435
+ }
436
+
373
437
  func _ECSRelayService_Push_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
374
438
  in := new(PushRequest)
375
439
  if err := dec(in); err != nil {
@@ -456,6 +520,12 @@ var ECSRelayService_ServiceDesc = grpc.ServiceDesc{
456
520
  Handler: _ECSRelayService_OpenStream_Handler,
457
521
  ServerStreams: true,
458
522
  },
523
+ {
524
+ StreamName: "PushStream",
525
+ Handler: _ECSRelayService_PushStream_Handler,
526
+ ServerStreams: true,
527
+ ClientStreams: true,
528
+ },
459
529
  },
460
530
  Metadata: "proto/ecs-relay.proto",
461
531
  }
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-go v1.28.1
4
- // protoc v3.21.3
4
+ // protoc v3.20.1
5
5
  // source: proto/ecs-snapshot.proto
6
6
 
7
7
  package ecs_snapshot
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
2
  // versions:
3
3
  // - protoc-gen-go-grpc v1.2.0
4
- // - protoc v3.21.3
4
+ // - protoc v3.20.1
5
5
  // source: proto/ecs-snapshot.proto
6
6
 
7
7
  package ecs_snapshot
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-go v1.28.1
4
- // protoc v3.21.3
4
+ // protoc v3.20.1
5
5
  // source: proto/ecs-stream.proto
6
6
 
7
7
  package ecs_stream
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
2
  // versions:
3
3
  // - protoc-gen-go-grpc v1.2.0
4
- // - protoc v3.21.3
4
+ // - protoc v3.20.1
5
5
  // source: proto/ecs-stream.proto
6
6
 
7
7
  package ecs_stream