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

package ringv1

import (
	context "context"
	v1 "github.com/CaduceusMetaverseProtocol/metaprotocol/gen/proto/go/base/v1"
	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

// RingServiceClient is the client API for RingService 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 RingServiceClient interface {
	// account info service
	SendRawTransaction(ctx context.Context, in *v1.EthTransaction, opts ...grpc.CallOption) (*SendRawTransactionResponse, error)
	Nonce(ctx context.Context, in *NonceRequest, opts ...grpc.CallOption) (*NonceResponse, error)
}

type ringServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRingServiceClient(cc grpc.ClientConnInterface) RingServiceClient {
	return &ringServiceClient{cc}
}

func (c *ringServiceClient) SendRawTransaction(ctx context.Context, in *v1.EthTransaction, opts ...grpc.CallOption) (*SendRawTransactionResponse, error) {
	out := new(SendRawTransactionResponse)
	err := c.cc.Invoke(ctx, "/ring.v1.RingService/SendRawTransaction", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *ringServiceClient) Nonce(ctx context.Context, in *NonceRequest, opts ...grpc.CallOption) (*NonceResponse, error) {
	out := new(NonceResponse)
	err := c.cc.Invoke(ctx, "/ring.v1.RingService/Nonce", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RingServiceServer is the server API for RingService service.
// All implementations must embed UnimplementedRingServiceServer
// for forward compatibility
type RingServiceServer interface {
	// account info service
	SendRawTransaction(context.Context, *v1.EthTransaction) (*SendRawTransactionResponse, error)
	Nonce(context.Context, *NonceRequest) (*NonceResponse, error)
	mustEmbedUnimplementedRingServiceServer()
}

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

func (UnimplementedRingServiceServer) SendRawTransaction(context.Context, *v1.EthTransaction) (*SendRawTransactionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SendRawTransaction not implemented")
}
func (UnimplementedRingServiceServer) Nonce(context.Context, *NonceRequest) (*NonceResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Nonce not implemented")
}
func (UnimplementedRingServiceServer) mustEmbedUnimplementedRingServiceServer() {}

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

func RegisterRingServiceServer(s grpc.ServiceRegistrar, srv RingServiceServer) {
	s.RegisterService(&RingService_ServiceDesc, srv)
}

func _RingService_SendRawTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(v1.EthTransaction)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RingServiceServer).SendRawTransaction(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/ring.v1.RingService/SendRawTransaction",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RingServiceServer).SendRawTransaction(ctx, req.(*v1.EthTransaction))
	}
	return interceptor(ctx, in, info, handler)
}

func _RingService_Nonce_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(NonceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RingServiceServer).Nonce(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/ring.v1.RingService/Nonce",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RingServiceServer).Nonce(ctx, req.(*NonceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// RingService_ServiceDesc is the grpc.ServiceDesc for RingService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RingService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ring.v1.RingService",
	HandlerType: (*RingServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendRawTransaction",
			Handler:    _RingService_SendRawTransaction_Handler,
		},
		{
			MethodName: "Nonce",
			Handler:    _RingService_Nonce_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ring/v1/service.proto",
}
