// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.19.3
// source: keyManager.proto

package service

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

// KeyManagerClient is the client API for KeyManager 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 KeyManagerClient interface {
	CreateMnemonic(ctx context.Context, in *CreateMnemonicRequest, opts ...grpc.CallOption) (*CreateMnemonicResponse, error)
	CreateKey(ctx context.Context, in *CreateKeyRequest, opts ...grpc.CallOption) (*KeyResponse, error)
	GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*KeyResponse, error)
	GetAddress(ctx context.Context, in *GetAddressRequest, opts ...grpc.CallOption) (*KeyResponse, error)
	Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error)
}

type keyManagerClient struct {
	cc grpc.ClientConnInterface
}

func NewKeyManagerClient(cc grpc.ClientConnInterface) KeyManagerClient {
	return &keyManagerClient{cc}
}

func (c *keyManagerClient) CreateMnemonic(ctx context.Context, in *CreateMnemonicRequest, opts ...grpc.CallOption) (*CreateMnemonicResponse, error) {
	out := new(CreateMnemonicResponse)
	err := c.cc.Invoke(ctx, "/service.KeyManager/CreateMnemonic", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *keyManagerClient) CreateKey(ctx context.Context, in *CreateKeyRequest, opts ...grpc.CallOption) (*KeyResponse, error) {
	out := new(KeyResponse)
	err := c.cc.Invoke(ctx, "/service.KeyManager/CreateKey", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *keyManagerClient) GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*KeyResponse, error) {
	out := new(KeyResponse)
	err := c.cc.Invoke(ctx, "/service.KeyManager/GetIndex", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *keyManagerClient) GetAddress(ctx context.Context, in *GetAddressRequest, opts ...grpc.CallOption) (*KeyResponse, error) {
	out := new(KeyResponse)
	err := c.cc.Invoke(ctx, "/service.KeyManager/GetAddress", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *keyManagerClient) Sign(ctx context.Context, in *SignRequest, opts ...grpc.CallOption) (*SignResponse, error) {
	out := new(SignResponse)
	err := c.cc.Invoke(ctx, "/service.KeyManager/Sign", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// KeyManagerServer is the server API for KeyManager service.
// All implementations must embed UnimplementedKeyManagerServer
// for forward compatibility
type KeyManagerServer interface {
	CreateMnemonic(context.Context, *CreateMnemonicRequest) (*CreateMnemonicResponse, error)
	CreateKey(context.Context, *CreateKeyRequest) (*KeyResponse, error)
	GetIndex(context.Context, *GetIndexRequest) (*KeyResponse, error)
	GetAddress(context.Context, *GetAddressRequest) (*KeyResponse, error)
	Sign(context.Context, *SignRequest) (*SignResponse, error)
	mustEmbedUnimplementedKeyManagerServer()
}

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

func (UnimplementedKeyManagerServer) CreateMnemonic(context.Context, *CreateMnemonicRequest) (*CreateMnemonicResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateMnemonic not implemented")
}
func (UnimplementedKeyManagerServer) CreateKey(context.Context, *CreateKeyRequest) (*KeyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateKey not implemented")
}
func (UnimplementedKeyManagerServer) GetIndex(context.Context, *GetIndexRequest) (*KeyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetIndex not implemented")
}
func (UnimplementedKeyManagerServer) GetAddress(context.Context, *GetAddressRequest) (*KeyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetAddress not implemented")
}
func (UnimplementedKeyManagerServer) Sign(context.Context, *SignRequest) (*SignResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Sign not implemented")
}
func (UnimplementedKeyManagerServer) mustEmbedUnimplementedKeyManagerServer() {}

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

func RegisterKeyManagerServer(s grpc.ServiceRegistrar, srv KeyManagerServer) {
	s.RegisterService(&KeyManager_ServiceDesc, srv)
}

func _KeyManager_CreateMnemonic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateMnemonicRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyManagerServer).CreateMnemonic(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/service.KeyManager/CreateMnemonic",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyManagerServer).CreateMnemonic(ctx, req.(*CreateMnemonicRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _KeyManager_CreateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyManagerServer).CreateKey(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/service.KeyManager/CreateKey",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyManagerServer).CreateKey(ctx, req.(*CreateKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _KeyManager_GetIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetIndexRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyManagerServer).GetIndex(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/service.KeyManager/GetIndex",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyManagerServer).GetIndex(ctx, req.(*GetIndexRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _KeyManager_GetAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAddressRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyManagerServer).GetAddress(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/service.KeyManager/GetAddress",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyManagerServer).GetAddress(ctx, req.(*GetAddressRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _KeyManager_Sign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SignRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KeyManagerServer).Sign(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/service.KeyManager/Sign",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KeyManagerServer).Sign(ctx, req.(*SignRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// KeyManager_ServiceDesc is the grpc.ServiceDesc for KeyManager service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var KeyManager_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "service.KeyManager",
	HandlerType: (*KeyManagerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateMnemonic",
			Handler:    _KeyManager_CreateMnemonic_Handler,
		},
		{
			MethodName: "CreateKey",
			Handler:    _KeyManager_CreateKey_Handler,
		},
		{
			MethodName: "GetIndex",
			Handler:    _KeyManager_GetIndex_Handler,
		},
		{
			MethodName: "GetAddress",
			Handler:    _KeyManager_GetAddress_Handler,
		},
		{
			MethodName: "Sign",
			Handler:    _KeyManager_Sign_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "keyManager.proto",
}
