Files
dex/pkg/grpc/pb/lxdex_grpc.pb.go
zeekay 889ebc0e26 lx/dex: gate gRPC transport behind the grpc build tag
Default build pulls zero gRPC code; rebuild with `-tags=grpc` to opt
into gRPC.

Decomplected via a `grpcBackend` interface in `sdk/go/client` and a
`grpcSubClient` interface in `client/go`. The default build wires a
no-op backend (`*_nogrpc.go`); the `grpc` build wires the real
protobuf-backed client (`*_grpc.go`). Public methods stay the same in
both builds — the gRPC fast path is preferred when wired, else
JSON-RPC / WebSocket.

Files gated:
- pkg/grpc/pb/lxdex_grpc.pb.go            (//go:build grpc)
- pkg/proto/engine/proto/lx_engine_grpc.pb.go (//go:build grpc)

Files refactored:
- sdk/go/client.go: //go:build grpc with stub in client_nogrpc.go
- sdk/go/client/client.go: gRPC removed from method bodies; backed by
  the grpcBackend interface (grpc_backend{,_grpc,_nogrpc}.go)
- client/go/main.go: GrpcClient + ConnectGrpc moved to grpc.go
  (//go:build grpc); nogrpc.go stubs ConnectGrpc with a clear error

Verification:
- go build ./... (default) clean across sdk/go, client/go, top-level
- go build -tags=grpc ./... clean across all three modules
- go test ./... and go test -tags=grpc ./... green
- go list -deps shows 0 google.golang.org/grpc packages in default
  builds of sdk/go/client and client/go; 62 packages with -tags=grpc

READMEs in sdk/go and client/go document the build-tag opt-in.
2026-05-16 17:54:11 -07:00

599 lines
24 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.3
// source: proto/lxdex.proto
//go:build grpc
package pb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
LXDEXService_PlaceOrder_FullMethodName = "/lxdex.LXDEXService/PlaceOrder"
LXDEXService_CancelOrder_FullMethodName = "/lxdex.LXDEXService/CancelOrder"
LXDEXService_GetOrder_FullMethodName = "/lxdex.LXDEXService/GetOrder"
LXDEXService_GetOrders_FullMethodName = "/lxdex.LXDEXService/GetOrders"
LXDEXService_GetOrderBook_FullMethodName = "/lxdex.LXDEXService/GetOrderBook"
LXDEXService_StreamOrderBook_FullMethodName = "/lxdex.LXDEXService/StreamOrderBook"
LXDEXService_GetTrades_FullMethodName = "/lxdex.LXDEXService/GetTrades"
LXDEXService_StreamTrades_FullMethodName = "/lxdex.LXDEXService/StreamTrades"
LXDEXService_GetBalance_FullMethodName = "/lxdex.LXDEXService/GetBalance"
LXDEXService_GetPositions_FullMethodName = "/lxdex.LXDEXService/GetPositions"
LXDEXService_GetNodeInfo_FullMethodName = "/lxdex.LXDEXService/GetNodeInfo"
LXDEXService_GetPeers_FullMethodName = "/lxdex.LXDEXService/GetPeers"
LXDEXService_Ping_FullMethodName = "/lxdex.LXDEXService/Ping"
)
// LXDEXServiceClient is the client API for LXDEXService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// LX gRPC Service for internal Lux Network IPC
type LXDEXServiceClient interface {
// Order Management
PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error)
CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error)
GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*Order, error)
GetOrders(ctx context.Context, in *GetOrdersRequest, opts ...grpc.CallOption) (*GetOrdersResponse, error)
// Market Data
GetOrderBook(ctx context.Context, in *GetOrderBookRequest, opts ...grpc.CallOption) (*OrderBook, error)
StreamOrderBook(ctx context.Context, in *StreamOrderBookRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OrderBookUpdate], error)
GetTrades(ctx context.Context, in *GetTradesRequest, opts ...grpc.CallOption) (*GetTradesResponse, error)
StreamTrades(ctx context.Context, in *StreamTradesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Trade], error)
// Account Management
GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*Balance, error)
GetPositions(ctx context.Context, in *GetPositionsRequest, opts ...grpc.CallOption) (*GetPositionsResponse, error)
// Node Management
GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*NodeInfo, error)
GetPeers(ctx context.Context, in *GetPeersRequest, opts ...grpc.CallOption) (*GetPeersResponse, error)
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
}
type lXDEXServiceClient struct {
cc grpc.ClientConnInterface
}
func NewLXDEXServiceClient(cc grpc.ClientConnInterface) LXDEXServiceClient {
return &lXDEXServiceClient{cc}
}
func (c *lXDEXServiceClient) PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PlaceOrderResponse)
err := c.cc.Invoke(ctx, LXDEXService_PlaceOrder_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CancelOrderResponse)
err := c.cc.Invoke(ctx, LXDEXService_CancelOrder_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*Order, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Order)
err := c.cc.Invoke(ctx, LXDEXService_GetOrder_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) GetOrders(ctx context.Context, in *GetOrdersRequest, opts ...grpc.CallOption) (*GetOrdersResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetOrdersResponse)
err := c.cc.Invoke(ctx, LXDEXService_GetOrders_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) GetOrderBook(ctx context.Context, in *GetOrderBookRequest, opts ...grpc.CallOption) (*OrderBook, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OrderBook)
err := c.cc.Invoke(ctx, LXDEXService_GetOrderBook_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) StreamOrderBook(ctx context.Context, in *StreamOrderBookRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[OrderBookUpdate], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &LXDEXService_ServiceDesc.Streams[0], LXDEXService_StreamOrderBook_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[StreamOrderBookRequest, OrderBookUpdate]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type LXDEXService_StreamOrderBookClient = grpc.ServerStreamingClient[OrderBookUpdate]
func (c *lXDEXServiceClient) GetTrades(ctx context.Context, in *GetTradesRequest, opts ...grpc.CallOption) (*GetTradesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetTradesResponse)
err := c.cc.Invoke(ctx, LXDEXService_GetTrades_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) StreamTrades(ctx context.Context, in *StreamTradesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Trade], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &LXDEXService_ServiceDesc.Streams[1], LXDEXService_StreamTrades_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[StreamTradesRequest, Trade]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type LXDEXService_StreamTradesClient = grpc.ServerStreamingClient[Trade]
func (c *lXDEXServiceClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*Balance, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Balance)
err := c.cc.Invoke(ctx, LXDEXService_GetBalance_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) GetPositions(ctx context.Context, in *GetPositionsRequest, opts ...grpc.CallOption) (*GetPositionsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetPositionsResponse)
err := c.cc.Invoke(ctx, LXDEXService_GetPositions_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*NodeInfo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NodeInfo)
err := c.cc.Invoke(ctx, LXDEXService_GetNodeInfo_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) GetPeers(ctx context.Context, in *GetPeersRequest, opts ...grpc.CallOption) (*GetPeersResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetPeersResponse)
err := c.cc.Invoke(ctx, LXDEXService_GetPeers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *lXDEXServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PingResponse)
err := c.cc.Invoke(ctx, LXDEXService_Ping_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// LXDEXServiceServer is the server API for LXDEXService service.
// All implementations must embed UnimplementedLXDEXServiceServer
// for forward compatibility.
//
// LX gRPC Service for internal Lux Network IPC
type LXDEXServiceServer interface {
// Order Management
PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error)
CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error)
GetOrder(context.Context, *GetOrderRequest) (*Order, error)
GetOrders(context.Context, *GetOrdersRequest) (*GetOrdersResponse, error)
// Market Data
GetOrderBook(context.Context, *GetOrderBookRequest) (*OrderBook, error)
StreamOrderBook(*StreamOrderBookRequest, grpc.ServerStreamingServer[OrderBookUpdate]) error
GetTrades(context.Context, *GetTradesRequest) (*GetTradesResponse, error)
StreamTrades(*StreamTradesRequest, grpc.ServerStreamingServer[Trade]) error
// Account Management
GetBalance(context.Context, *GetBalanceRequest) (*Balance, error)
GetPositions(context.Context, *GetPositionsRequest) (*GetPositionsResponse, error)
// Node Management
GetNodeInfo(context.Context, *GetNodeInfoRequest) (*NodeInfo, error)
GetPeers(context.Context, *GetPeersRequest) (*GetPeersResponse, error)
Ping(context.Context, *PingRequest) (*PingResponse, error)
mustEmbedUnimplementedLXDEXServiceServer()
}
// UnimplementedLXDEXServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedLXDEXServiceServer struct{}
func (UnimplementedLXDEXServiceServer) PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PlaceOrder not implemented")
}
func (UnimplementedLXDEXServiceServer) CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CancelOrder not implemented")
}
func (UnimplementedLXDEXServiceServer) GetOrder(context.Context, *GetOrderRequest) (*Order, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetOrder not implemented")
}
func (UnimplementedLXDEXServiceServer) GetOrders(context.Context, *GetOrdersRequest) (*GetOrdersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetOrders not implemented")
}
func (UnimplementedLXDEXServiceServer) GetOrderBook(context.Context, *GetOrderBookRequest) (*OrderBook, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetOrderBook not implemented")
}
func (UnimplementedLXDEXServiceServer) StreamOrderBook(*StreamOrderBookRequest, grpc.ServerStreamingServer[OrderBookUpdate]) error {
return status.Errorf(codes.Unimplemented, "method StreamOrderBook not implemented")
}
func (UnimplementedLXDEXServiceServer) GetTrades(context.Context, *GetTradesRequest) (*GetTradesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTrades not implemented")
}
func (UnimplementedLXDEXServiceServer) StreamTrades(*StreamTradesRequest, grpc.ServerStreamingServer[Trade]) error {
return status.Errorf(codes.Unimplemented, "method StreamTrades not implemented")
}
func (UnimplementedLXDEXServiceServer) GetBalance(context.Context, *GetBalanceRequest) (*Balance, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBalance not implemented")
}
func (UnimplementedLXDEXServiceServer) GetPositions(context.Context, *GetPositionsRequest) (*GetPositionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPositions not implemented")
}
func (UnimplementedLXDEXServiceServer) GetNodeInfo(context.Context, *GetNodeInfoRequest) (*NodeInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented")
}
func (UnimplementedLXDEXServiceServer) GetPeers(context.Context, *GetPeersRequest) (*GetPeersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPeers not implemented")
}
func (UnimplementedLXDEXServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedLXDEXServiceServer) mustEmbedUnimplementedLXDEXServiceServer() {}
func (UnimplementedLXDEXServiceServer) testEmbeddedByValue() {}
// UnsafeLXDEXServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LXDEXServiceServer will
// result in compilation errors.
type UnsafeLXDEXServiceServer interface {
mustEmbedUnimplementedLXDEXServiceServer()
}
func RegisterLXDEXServiceServer(s grpc.ServiceRegistrar, srv LXDEXServiceServer) {
// If the following call pancis, it indicates UnimplementedLXDEXServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&LXDEXService_ServiceDesc, srv)
}
func _LXDEXService_PlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PlaceOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).PlaceOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_PlaceOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).PlaceOrder(ctx, req.(*PlaceOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_CancelOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CancelOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).CancelOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_CancelOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).CancelOrder(ctx, req.(*CancelOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_GetOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).GetOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_GetOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).GetOrder(ctx, req.(*GetOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_GetOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetOrdersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).GetOrders(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_GetOrders_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).GetOrders(ctx, req.(*GetOrdersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_GetOrderBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetOrderBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).GetOrderBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_GetOrderBook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).GetOrderBook(ctx, req.(*GetOrderBookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_StreamOrderBook_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(StreamOrderBookRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(LXDEXServiceServer).StreamOrderBook(m, &grpc.GenericServerStream[StreamOrderBookRequest, OrderBookUpdate]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type LXDEXService_StreamOrderBookServer = grpc.ServerStreamingServer[OrderBookUpdate]
func _LXDEXService_GetTrades_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetTradesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).GetTrades(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_GetTrades_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).GetTrades(ctx, req.(*GetTradesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_StreamTrades_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(StreamTradesRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(LXDEXServiceServer).StreamTrades(m, &grpc.GenericServerStream[StreamTradesRequest, Trade]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type LXDEXService_StreamTradesServer = grpc.ServerStreamingServer[Trade]
func _LXDEXService_GetBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).GetBalance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_GetBalance_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).GetBalance(ctx, req.(*GetBalanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_GetPositions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPositionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).GetPositions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_GetPositions_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).GetPositions(ctx, req.(*GetPositionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetNodeInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).GetNodeInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_GetNodeInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).GetNodeInfo(ctx, req.(*GetNodeInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_GetPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPeersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).GetPeers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_GetPeers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).GetPeers(ctx, req.(*GetPeersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LXDEXService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LXDEXServiceServer).Ping(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LXDEXService_Ping_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LXDEXServiceServer).Ping(ctx, req.(*PingRequest))
}
return interceptor(ctx, in, info, handler)
}
// LXDEXService_ServiceDesc is the grpc.ServiceDesc for LXDEXService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LXDEXService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "lxdex.LXDEXService",
HandlerType: (*LXDEXServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "PlaceOrder",
Handler: _LXDEXService_PlaceOrder_Handler,
},
{
MethodName: "CancelOrder",
Handler: _LXDEXService_CancelOrder_Handler,
},
{
MethodName: "GetOrder",
Handler: _LXDEXService_GetOrder_Handler,
},
{
MethodName: "GetOrders",
Handler: _LXDEXService_GetOrders_Handler,
},
{
MethodName: "GetOrderBook",
Handler: _LXDEXService_GetOrderBook_Handler,
},
{
MethodName: "GetTrades",
Handler: _LXDEXService_GetTrades_Handler,
},
{
MethodName: "GetBalance",
Handler: _LXDEXService_GetBalance_Handler,
},
{
MethodName: "GetPositions",
Handler: _LXDEXService_GetPositions_Handler,
},
{
MethodName: "GetNodeInfo",
Handler: _LXDEXService_GetNodeInfo_Handler,
},
{
MethodName: "GetPeers",
Handler: _LXDEXService_GetPeers_Handler,
},
{
MethodName: "Ping",
Handler: _LXDEXService_Ping_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "StreamOrderBook",
Handler: _LXDEXService_StreamOrderBook_Handler,
ServerStreams: true,
},
{
StreamName: "StreamTrades",
Handler: _LXDEXService_StreamTrades_Handler,
ServerStreams: true,
},
},
Metadata: "proto/lxdex.proto",
}