// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             (unknown)
// source: orderbook/v1/orderbook.proto

package orderbookv1

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// OrderbookClient is the client API for Orderbook 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.
type OrderbookClient interface {
	PlaceLimitOrder(ctx context.Context, in *PlaceLimitOrderRequest, opts ...grpc.CallOption) (*Response, error)
	PlaceMarketOrder(ctx context.Context, in *PlaceMarketOrderRequest, opts ...grpc.CallOption) (*Response, error)
	CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*Response, error)
	SignProxy(ctx context.Context, in *SignProxyRequest, opts ...grpc.CallOption) (*Response, error)
}

type orderbookClient struct {
	cc grpc.ClientConnInterface
}

func NewOrderbookClient(cc grpc.ClientConnInterface) OrderbookClient {
	return &orderbookClient{cc}
}

func (c *orderbookClient) PlaceLimitOrder(ctx context.Context, in *PlaceLimitOrderRequest, opts ...grpc.CallOption) (*Response, error) {
	out := new(Response)
	err := c.cc.Invoke(ctx, "/exchain.orderbook.v1.Orderbook/PlaceLimitOrder", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *orderbookClient) PlaceMarketOrder(ctx context.Context, in *PlaceMarketOrderRequest, opts ...grpc.CallOption) (*Response, error) {
	out := new(Response)
	err := c.cc.Invoke(ctx, "/exchain.orderbook.v1.Orderbook/PlaceMarketOrder", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *orderbookClient) CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*Response, error) {
	out := new(Response)
	err := c.cc.Invoke(ctx, "/exchain.orderbook.v1.Orderbook/CancelOrder", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *orderbookClient) SignProxy(ctx context.Context, in *SignProxyRequest, opts ...grpc.CallOption) (*Response, error) {
	out := new(Response)
	err := c.cc.Invoke(ctx, "/exchain.orderbook.v1.Orderbook/SignProxy", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// OrderbookServer is the server API for Orderbook service.
// All implementations must embed UnimplementedOrderbookServer
// for forward compatibility
type OrderbookServer interface {
	PlaceLimitOrder(context.Context, *PlaceLimitOrderRequest) (*Response, error)
	PlaceMarketOrder(context.Context, *PlaceMarketOrderRequest) (*Response, error)
	CancelOrder(context.Context, *CancelOrderRequest) (*Response, error)
	SignProxy(context.Context, *SignProxyRequest) (*Response, error)
	mustEmbedUnimplementedOrderbookServer()
}

// UnimplementedOrderbookServer must be embedded to have forward compatible implementations.
type UnimplementedOrderbookServer struct {
}

func (UnimplementedOrderbookServer) PlaceLimitOrder(context.Context, *PlaceLimitOrderRequest) (*Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PlaceLimitOrder not implemented")
}
func (UnimplementedOrderbookServer) PlaceMarketOrder(context.Context, *PlaceMarketOrderRequest) (*Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PlaceMarketOrder not implemented")
}
func (UnimplementedOrderbookServer) CancelOrder(context.Context, *CancelOrderRequest) (*Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CancelOrder not implemented")
}
func (UnimplementedOrderbookServer) SignProxy(context.Context, *SignProxyRequest) (*Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SignProxy not implemented")
}
func (UnimplementedOrderbookServer) mustEmbedUnimplementedOrderbookServer() {}

// UnsafeOrderbookServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to OrderbookServer will
// result in compilation errors.
type UnsafeOrderbookServer interface {
	mustEmbedUnimplementedOrderbookServer()
}

func RegisterOrderbookServer(s grpc.ServiceRegistrar, srv OrderbookServer) {
	s.RegisterService(&Orderbook_ServiceDesc, srv)
}

func _Orderbook_PlaceLimitOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PlaceLimitOrderRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OrderbookServer).PlaceLimitOrder(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/exchain.orderbook.v1.Orderbook/PlaceLimitOrder",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OrderbookServer).PlaceLimitOrder(ctx, req.(*PlaceLimitOrderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Orderbook_PlaceMarketOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PlaceMarketOrderRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OrderbookServer).PlaceMarketOrder(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/exchain.orderbook.v1.Orderbook/PlaceMarketOrder",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OrderbookServer).PlaceMarketOrder(ctx, req.(*PlaceMarketOrderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Orderbook_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.(OrderbookServer).CancelOrder(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/exchain.orderbook.v1.Orderbook/CancelOrder",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OrderbookServer).CancelOrder(ctx, req.(*CancelOrderRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Orderbook_SignProxy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SignProxyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(OrderbookServer).SignProxy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/exchain.orderbook.v1.Orderbook/SignProxy",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(OrderbookServer).SignProxy(ctx, req.(*SignProxyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Orderbook_ServiceDesc is the grpc.ServiceDesc for Orderbook service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Orderbook_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "exchain.orderbook.v1.Orderbook",
	HandlerType: (*OrderbookServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PlaceLimitOrder",
			Handler:    _Orderbook_PlaceLimitOrder_Handler,
		},
		{
			MethodName: "PlaceMarketOrder",
			Handler:    _Orderbook_PlaceMarketOrder_Handler,
		},
		{
			MethodName: "CancelOrder",
			Handler:    _Orderbook_CancelOrder_Handler,
		},
		{
			MethodName: "SignProxy",
			Handler:    _Orderbook_SignProxy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "orderbook/v1/orderbook.proto",
}
