338 lines
12 KiB
Go
338 lines
12 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.2.0
|
|
// - protoc (unknown)
|
|
// source: cosmos/nft/v1beta1/query.proto
|
|
|
|
package nftv1beta1
|
|
|
|
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
|
|
|
|
// QueryClient is the client API for Query 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 QueryClient interface {
|
|
// Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721
|
|
Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error)
|
|
// Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721
|
|
Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error)
|
|
// Supply queries the number of NFTs from the given class, same as totalSupply of ERC721.
|
|
Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error)
|
|
// NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in
|
|
// ERC721Enumerable
|
|
NFTs(ctx context.Context, in *QueryNFTsRequest, opts ...grpc.CallOption) (*QueryNFTsResponse, error)
|
|
// NFT queries an NFT based on its class and id.
|
|
NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc.CallOption) (*QueryNFTResponse, error)
|
|
// Class queries an NFT class based on its id
|
|
Class(ctx context.Context, in *QueryClassRequest, opts ...grpc.CallOption) (*QueryClassResponse, error)
|
|
// Classes queries all NFT classes
|
|
Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error)
|
|
}
|
|
|
|
type queryClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
|
|
return &queryClient{cc}
|
|
}
|
|
|
|
func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) {
|
|
out := new(QueryBalanceResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.nft.v1beta1.Query/Balance", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) {
|
|
out := new(QueryOwnerResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.nft.v1beta1.Query/Owner", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) {
|
|
out := new(QuerySupplyResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.nft.v1beta1.Query/Supply", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) NFTs(ctx context.Context, in *QueryNFTsRequest, opts ...grpc.CallOption) (*QueryNFTsResponse, error) {
|
|
out := new(QueryNFTsResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.nft.v1beta1.Query/NFTs", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc.CallOption) (*QueryNFTResponse, error) {
|
|
out := new(QueryNFTResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.nft.v1beta1.Query/NFT", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Class(ctx context.Context, in *QueryClassRequest, opts ...grpc.CallOption) (*QueryClassResponse, error) {
|
|
out := new(QueryClassResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.nft.v1beta1.Query/Class", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *queryClient) Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error) {
|
|
out := new(QueryClassesResponse)
|
|
err := c.cc.Invoke(ctx, "/cosmos.nft.v1beta1.Query/Classes", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// QueryServer is the server API for Query service.
|
|
// All implementations must embed UnimplementedQueryServer
|
|
// for forward compatibility
|
|
type QueryServer interface {
|
|
// Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721
|
|
Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error)
|
|
// Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721
|
|
Owner(context.Context, *QueryOwnerRequest) (*QueryOwnerResponse, error)
|
|
// Supply queries the number of NFTs from the given class, same as totalSupply of ERC721.
|
|
Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error)
|
|
// NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in
|
|
// ERC721Enumerable
|
|
NFTs(context.Context, *QueryNFTsRequest) (*QueryNFTsResponse, error)
|
|
// NFT queries an NFT based on its class and id.
|
|
NFT(context.Context, *QueryNFTRequest) (*QueryNFTResponse, error)
|
|
// Class queries an NFT class based on its id
|
|
Class(context.Context, *QueryClassRequest) (*QueryClassResponse, error)
|
|
// Classes queries all NFT classes
|
|
Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error)
|
|
mustEmbedUnimplementedQueryServer()
|
|
}
|
|
|
|
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedQueryServer struct {
|
|
}
|
|
|
|
func (UnimplementedQueryServer) Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Owner(context.Context, *QueryOwnerRequest) (*QueryOwnerResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Owner not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Supply not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) NFTs(context.Context, *QueryNFTsRequest) (*QueryNFTsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method NFTs not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) NFT(context.Context, *QueryNFTRequest) (*QueryNFTResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method NFT not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Class(context.Context, *QueryClassRequest) (*QueryClassResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Class not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Classes not implemented")
|
|
}
|
|
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
|
|
|
|
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to QueryServer will
|
|
// result in compilation errors.
|
|
type UnsafeQueryServer interface {
|
|
mustEmbedUnimplementedQueryServer()
|
|
}
|
|
|
|
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
|
|
s.RegisterService(&Query_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryBalanceRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Balance(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.nft.v1beta1.Query/Balance",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Owner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryOwnerRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Owner(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.nft.v1beta1.Query/Owner",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Owner(ctx, req.(*QueryOwnerRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Supply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QuerySupplyRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Supply(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.nft.v1beta1.Query/Supply",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Supply(ctx, req.(*QuerySupplyRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_NFTs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryNFTsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).NFTs(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.nft.v1beta1.Query/NFTs",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).NFTs(ctx, req.(*QueryNFTsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_NFT_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryNFTRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).NFT(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.nft.v1beta1.Query/NFT",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).NFT(ctx, req.(*QueryNFTRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Class_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryClassRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Class(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.nft.v1beta1.Query/Class",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Class(ctx, req.(*QueryClassRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Query_Classes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(QueryClassesRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(QueryServer).Classes(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/cosmos.nft.v1beta1.Query/Classes",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(QueryServer).Classes(ctx, req.(*QueryClassesRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Query_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "cosmos.nft.v1beta1.Query",
|
|
HandlerType: (*QueryServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Balance",
|
|
Handler: _Query_Balance_Handler,
|
|
},
|
|
{
|
|
MethodName: "Owner",
|
|
Handler: _Query_Owner_Handler,
|
|
},
|
|
{
|
|
MethodName: "Supply",
|
|
Handler: _Query_Supply_Handler,
|
|
},
|
|
{
|
|
MethodName: "NFTs",
|
|
Handler: _Query_NFTs_Handler,
|
|
},
|
|
{
|
|
MethodName: "NFT",
|
|
Handler: _Query_NFT_Handler,
|
|
},
|
|
{
|
|
MethodName: "Class",
|
|
Handler: _Query_Class_Handler,
|
|
},
|
|
{
|
|
MethodName: "Classes",
|
|
Handler: _Query_Classes_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "cosmos/nft/v1beta1/query.proto",
|
|
}
|