From cdc21dd353db3ef6efd6f383c086f92f07f3e89b Mon Sep 17 00:00:00 2001 From: slandymani Date: Tue, 8 Oct 2024 01:12:57 +0300 Subject: [PATCH] add onft module queries --- proto/onft/v1/onft.proto | 54 + proto/onft/v1/query.proto | 112 ++ x/onft/keeper/grpc_query.go | 180 +++ x/onft/types/errors.go | 2 + x/onft/types/onft.pb.go | 1143 ++++++++++++++++ x/onft/types/query.pb.go | 2472 +++++++++++++++++++++++++++++++++++ x/onft/types/query.pb.gw.go | 579 ++++++++ 7 files changed, 4542 insertions(+) create mode 100644 proto/onft/v1/onft.proto create mode 100644 proto/onft/v1/query.proto create mode 100644 x/onft/keeper/grpc_query.go create mode 100644 x/onft/types/onft.pb.go create mode 100644 x/onft/types/query.pb.go create mode 100644 x/onft/types/query.pb.gw.go diff --git a/proto/onft/v1/onft.proto b/proto/onft/v1/onft.proto new file mode 100644 index 00000000..a8ec8e73 --- /dev/null +++ b/proto/onft/v1/onft.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package onft.v1; + +import "google/protobuf/any.proto"; + +option go_package = "github.com/ODIN-PROTOCOL/odin-core/x/onft/types"; + +// Class defines the class of the nft type. +message Class { + // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + string id = 1; + + // name defines the human-readable name of the NFT classification. Optional + string name = 2; + + // symbol is an abbreviated name for nft classification. Optional + string symbol = 3; + + // description is a brief description of nft classification. Optional + string description = 4; + + // uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + string uri = 5; + + // uri_hash is a hash of the document pointed by uri. Optional + string uri_hash = 6; + + // data is the app specific metadata of the NFT class. Optional + google.protobuf.Any data = 7; + + // owner is the owner address of the following nft class + string owner = 8; +} + +// NFT defines the NFT. +message NFT { + // class_id associated with the NFT, similar to the contract address of ERC721 + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; + + // uri for the NFT metadata stored off chain + string uri = 3; + + // uri_hash is a hash of the document pointed by uri + string uri_hash = 4; + + // owner is the owner address of the following nft + string owner = 5; + + // data is an app specific data of the NFT. Optional + google.protobuf.Any data = 10; +} \ No newline at end of file diff --git a/proto/onft/v1/query.proto b/proto/onft/v1/query.proto new file mode 100644 index 00000000..31017d0d --- /dev/null +++ b/proto/onft/v1/query.proto @@ -0,0 +1,112 @@ +syntax = "proto3"; +package onft.v1; + +option go_package = "github.com/ODIN-PROTOCOL/odin-core/x/onft/types"; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "onft/v1/onft.proto"; + +// Query defines the gRPC querier service. +service Query { + // ClassOwner queries the owner of the NFT class + rpc ClassOwner(QueryClassOwnerRequest) returns (QueryClassOwnerResponse) { + option (google.api.http).get = "/onft/v1/class/{class_id}/owner"; + } + + // NFTs queries all NFTs with owners of a given class or owner,choose at least one of the two, + // similar to tokenByIndex in ERC721Enumerable + rpc NFTs(QueryNFTsRequest) returns (QueryNFTsResponse) { + option (google.api.http).get = "/onft/v1/nfts"; + } + + // NFT queries an NFT with owner based on its class and id + rpc NFT(QueryNFTRequest) returns (QueryNFTResponse) { + option (google.api.http).get = "/onft/v1/nfts/{class_id}/{id}"; + } + + // Class queries an NFT class based on its id with class owner + rpc Class(QueryClassRequest) returns (QueryClassResponse) { + option (google.api.http).get = "/onft/v1/classes/{class_id}"; + } + + // Classes queries all NFT classes with owners + rpc Classes(QueryClassesRequest) returns (QueryClassesResponse) { + option (google.api.http).get = "/onft/v1/classes"; + } +} + +// QueryClassOwnerRequest is the request type for the Query/Owner RPC method +message QueryClassOwnerRequest { + // class_id associated with nft collection + string class_id = 1; +} + +// QueryClassOwnerResponse is the response type for the Query/Owner RPC method +message QueryClassOwnerResponse { + // owner is the owner address of the nft class + string owner = 1; +} + +// QueryNFTstRequest is the request type for the Query/NFTs RPC method +message QueryNFTsRequest { + // class_id associated with the nft + string class_id = 1; + + // owner is the owner address of the nft + string owner = 2; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +message QueryNFTsResponse { + // NFT defines the NFT + repeated NFT nfts = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryNFTRequest is the request type for the Query/NFT RPC method +message QueryNFTRequest { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; +} + +// QueryNFTResponse is the response type for the Query/NFT RPC method +message QueryNFTResponse { + // owner is the owner address of the nft + NFT nft = 1; +} + +// QueryClassRequest is the request type for the Query/Class RPC method +message QueryClassRequest { + // class_id associated with the nft + string class_id = 1; +} + +// QueryClassResponse is the response type for the Query/Class RPC method +message QueryClassResponse { + // class defines the class of the nft type. + Class class = 1; +} + +// QueryClassesRequest is the request type for the Query/Classes RPC method +message QueryClassesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClassesResponse is the response type for the Query/Classes RPC method +message QueryClassesResponse { + // class defines the class of the nft type. + repeated Class classes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} \ No newline at end of file diff --git a/x/onft/keeper/grpc_query.go b/x/onft/keeper/grpc_query.go new file mode 100644 index 00000000..cee49b8b --- /dev/null +++ b/x/onft/keeper/grpc_query.go @@ -0,0 +1,180 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/x/nft" + onfttypes "github.com/ODIN-PROTOCOL/odin-core/x/onft/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ onfttypes.QueryServer = Keeper{} + +func (k Keeper) ClassOwner(ctx context.Context, r *onfttypes.QueryClassOwnerRequest) (*onfttypes.QueryClassOwnerResponse, error) { + if r == nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap("empty request") + } + + if len(r.ClassId) == 0 { + return nil, nft.ErrEmptyClassID + } + + owner, err := k.ClassOwners.Get(ctx, r.ClassId) + if err != nil { + return nil, err + } + + ownerStr, err := k.addressCodec.BytesToString(owner) + if err != nil { + return nil, err + } + + return &onfttypes.QueryClassOwnerResponse{Owner: ownerStr}, nil +} + +func (k Keeper) NFTs(ctx context.Context, r *onfttypes.QueryNFTsRequest) (*onfttypes.QueryNFTsResponse, error) { + if r == nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap("empty request") + } + + nfts, err := k.nftKeeper.NFTs(ctx, &nft.QueryNFTsRequest{Pagination: r.Pagination}) + if err != nil { + return nil, err + } + + nftsOwners := make([]*onfttypes.NFT, len(nfts.Nfts)) + for i, n := range nfts.Nfts { + ownerStr := "" + owner := k.nftKeeper.GetOwner(ctx, n.ClassId, n.Id) + if !owner.Empty() { + ownerStr, _ = k.addressCodec.BytesToString(owner) + } + + nftsOwners[i] = &onfttypes.NFT{ + Id: n.Id, + ClassId: n.ClassId, + Uri: n.Uri, + UriHash: n.UriHash, + Data: n.Data, + Owner: ownerStr, + } + } + + return &onfttypes.QueryNFTsResponse{ + Nfts: nftsOwners, + Pagination: nfts.Pagination, + }, nil +} + +func (k Keeper) NFT(ctx context.Context, r *onfttypes.QueryNFTRequest) (*onfttypes.QueryNFTResponse, error) { + if r == nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap("empty request") + } + + if len(r.ClassId) == 0 { + return nil, nft.ErrEmptyClassID + } + if len(r.Id) == 0 { + return nil, nft.ErrEmptyNFTID + } + + n, has := k.nftKeeper.GetNFT(ctx, r.ClassId, r.Id) + if !has { + return nil, nft.ErrNFTNotExists.Wrapf("not found nft: class: %s, id: %s", r.ClassId, r.Id) + } + + owner := k.nftKeeper.GetOwner(ctx, r.ClassId, r.Id) + ownerStr, err := k.addressCodec.BytesToString(owner) + if err != nil { + return nil, err + } + + resp := &onfttypes.QueryNFTResponse{ + Nft: &onfttypes.NFT{ + ClassId: n.ClassId, + Id: n.Id, + Uri: n.Uri, + UriHash: n.UriHash, + Owner: ownerStr, + Data: n.Data, + }, + } + + return resp, nil +} + +func (k Keeper) Class(ctx context.Context, r *onfttypes.QueryClassRequest) (*onfttypes.QueryClassResponse, error) { + if r == nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap("empty request") + } + + if len(r.ClassId) == 0 { + return nil, nft.ErrEmptyClassID + } + + class, has := k.nftKeeper.GetClass(ctx, r.ClassId) + if !has { + return nil, nft.ErrClassNotExists.Wrapf("not found class: %s", r.ClassId) + } + + owner, err := k.ClassOwners.Get(ctx, r.ClassId) + if err != nil { + return nil, err + } + + ownerStr, err := k.addressCodec.BytesToString(owner) + if err != nil { + return nil, err + } + + resp := &onfttypes.QueryClassResponse{ + Class: &onfttypes.Class{ + Id: class.Id, + Name: class.Name, + Symbol: class.Symbol, + Description: class.Description, + Uri: class.Uri, + UriHash: class.UriHash, + Data: class.Data, + Owner: ownerStr, + }, + } + + return resp, nil +} + +func (k Keeper) Classes(ctx context.Context, r *onfttypes.QueryClassesRequest) (*onfttypes.QueryClassesResponse, error) { + if r == nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap("empty request") + } + + classes, err := k.nftKeeper.Classes(ctx, &nft.QueryClassesRequest{Pagination: r.Pagination}) + if err != nil { + return nil, err + } + + classesOwners := make([]*onfttypes.Class, len(classes.Classes)) + for i, class := range classes.Classes { + ownerStr := "" + owner, err := k.ClassOwners.Get(ctx, class.Id) + if err == nil { + ownerStr, _ = k.addressCodec.BytesToString(owner) + } + + classesOwners[i] = &onfttypes.Class{ + Id: class.Id, + Name: class.Name, + Symbol: class.Symbol, + Description: class.Description, + Uri: class.Uri, + UriHash: class.UriHash, + Data: class.Data, + Owner: ownerStr, + } + } + + return &onfttypes.QueryClassesResponse{ + Classes: classesOwners, + Pagination: classes.Pagination, + }, nil +} diff --git a/x/onft/types/errors.go b/x/onft/types/errors.go index 3063a745..e9cce38f 100644 --- a/x/onft/types/errors.go +++ b/x/onft/types/errors.go @@ -5,4 +5,6 @@ import sdkerrors "cosmossdk.io/errors" var ( ErrClassNotFound = sdkerrors.New(ModuleName, 1, "class not found") ErrSenderNotAuthorized = sdkerrors.Register(ModuleName, 2, "sender not authorized") + ErrEmptyClassID = sdkerrors.Register(ModuleName, 3, "empty class id") + ErrEmptyNFTID = sdkerrors.Register(ModuleName, 4, "empty nft id") ) diff --git a/x/onft/types/onft.pb.go b/x/onft/types/onft.pb.go new file mode 100644 index 00000000..a15d0113 --- /dev/null +++ b/x/onft/types/onft.pb.go @@ -0,0 +1,1143 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: onft/v1/onft.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Class defines the class of the nft type. +type Class struct { + // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // name defines the human-readable name of the NFT classification. Optional + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // symbol is an abbreviated name for nft classification. Optional + Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` + // description is a brief description of nft classification. Optional + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + // uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + Uri string `protobuf:"bytes,5,opt,name=uri,proto3" json:"uri,omitempty"` + // uri_hash is a hash of the document pointed by uri. Optional + UriHash string `protobuf:"bytes,6,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` + // data is the app specific metadata of the NFT class. Optional + Data *types.Any `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` + // owner is the owner address of the following nft class + Owner string `protobuf:"bytes,8,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (m *Class) Reset() { *m = Class{} } +func (m *Class) String() string { return proto.CompactTextString(m) } +func (*Class) ProtoMessage() {} +func (*Class) Descriptor() ([]byte, []int) { + return fileDescriptor_d219138c4316c810, []int{0} +} +func (m *Class) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Class) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Class.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Class) XXX_Merge(src proto.Message) { + xxx_messageInfo_Class.Merge(m, src) +} +func (m *Class) XXX_Size() int { + return m.Size() +} +func (m *Class) XXX_DiscardUnknown() { + xxx_messageInfo_Class.DiscardUnknown(m) +} + +var xxx_messageInfo_Class proto.InternalMessageInfo + +func (m *Class) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Class) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Class) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *Class) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Class) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *Class) GetUriHash() string { + if m != nil { + return m.UriHash + } + return "" +} + +func (m *Class) GetData() *types.Any { + if m != nil { + return m.Data + } + return nil +} + +func (m *Class) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +// NFT defines the NFT. +type NFT struct { + // class_id associated with the NFT, similar to the contract address of ERC721 + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // id is a unique identifier of the NFT + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + // uri for the NFT metadata stored off chain + Uri string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty"` + // uri_hash is a hash of the document pointed by uri + UriHash string `protobuf:"bytes,4,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` + // owner is the owner address of the following nft + Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` + // data is an app specific data of the NFT. Optional + Data *types.Any `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *NFT) Reset() { *m = NFT{} } +func (m *NFT) String() string { return proto.CompactTextString(m) } +func (*NFT) ProtoMessage() {} +func (*NFT) Descriptor() ([]byte, []int) { + return fileDescriptor_d219138c4316c810, []int{1} +} +func (m *NFT) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NFT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NFT.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NFT) XXX_Merge(src proto.Message) { + xxx_messageInfo_NFT.Merge(m, src) +} +func (m *NFT) XXX_Size() int { + return m.Size() +} +func (m *NFT) XXX_DiscardUnknown() { + xxx_messageInfo_NFT.DiscardUnknown(m) +} + +var xxx_messageInfo_NFT proto.InternalMessageInfo + +func (m *NFT) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *NFT) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *NFT) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *NFT) GetUriHash() string { + if m != nil { + return m.UriHash + } + return "" +} + +func (m *NFT) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *NFT) GetData() *types.Any { + if m != nil { + return m.Data + } + return nil +} + +func init() { + proto.RegisterType((*Class)(nil), "onft.v1.Class") + proto.RegisterType((*NFT)(nil), "onft.v1.NFT") +} + +func init() { proto.RegisterFile("onft/v1/onft.proto", fileDescriptor_d219138c4316c810) } + +var fileDescriptor_d219138c4316c810 = []byte{ + // 343 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xcd, 0x4a, 0x03, 0x31, + 0x14, 0x85, 0x9b, 0xf9, 0xe9, 0xd4, 0x14, 0x44, 0x42, 0x91, 0xd4, 0xc5, 0x50, 0xba, 0xea, 0xa6, + 0x13, 0xaa, 0x4f, 0xa0, 0x15, 0xb1, 0x20, 0x1d, 0x29, 0x5d, 0xb9, 0x29, 0x99, 0x9f, 0x76, 0x02, + 0x6d, 0x52, 0x92, 0x99, 0xea, 0xbc, 0x85, 0x2f, 0xe0, 0xfb, 0xb8, 0x2c, 0xae, 0x5c, 0x4a, 0xfb, + 0x22, 0x32, 0xe9, 0x38, 0x54, 0x10, 0x5c, 0xe5, 0xde, 0x73, 0x2f, 0xf7, 0x7c, 0x87, 0x40, 0x24, + 0xf8, 0x3c, 0x25, 0x9b, 0x01, 0x29, 0x5e, 0x6f, 0x2d, 0x45, 0x2a, 0x90, 0xa3, 0xeb, 0xcd, 0xe0, + 0xa2, 0xbd, 0x10, 0x62, 0xb1, 0x8c, 0x89, 0x96, 0x83, 0x6c, 0x4e, 0x28, 0xcf, 0x0f, 0x3b, 0xdd, + 0x0f, 0x00, 0xed, 0xe1, 0x92, 0x2a, 0x85, 0x4e, 0xa1, 0xc1, 0x22, 0x0c, 0x3a, 0xa0, 0x77, 0x32, + 0x31, 0x58, 0x84, 0x10, 0xb4, 0x38, 0x5d, 0xc5, 0xd8, 0xd0, 0x8a, 0xae, 0xd1, 0x39, 0xac, 0xab, + 0x7c, 0x15, 0x88, 0x25, 0x36, 0xb5, 0x5a, 0x76, 0xa8, 0x03, 0x9b, 0x51, 0xac, 0x42, 0xc9, 0xd6, + 0x29, 0x13, 0x1c, 0x5b, 0x7a, 0x78, 0x2c, 0xa1, 0x33, 0x68, 0x66, 0x92, 0x61, 0x5b, 0x4f, 0x8a, + 0x12, 0xb5, 0x61, 0x23, 0x93, 0x6c, 0x96, 0x50, 0x95, 0xe0, 0xba, 0x96, 0x9d, 0x4c, 0xb2, 0x7b, + 0xaa, 0x12, 0xd4, 0x83, 0x56, 0x44, 0x53, 0x8a, 0x9d, 0x0e, 0xe8, 0x35, 0x2f, 0x5b, 0xde, 0x01, + 0xdf, 0xfb, 0xc1, 0xf7, 0xae, 0x79, 0x3e, 0xd1, 0x1b, 0xa8, 0x05, 0x6d, 0xf1, 0xcc, 0x63, 0x89, + 0x1b, 0xfa, 0xc2, 0xa1, 0xe9, 0xbe, 0x01, 0x68, 0x8e, 0xef, 0xa6, 0x85, 0x45, 0x58, 0x64, 0x9b, + 0x55, 0xc1, 0x1c, 0xdd, 0x8f, 0xa2, 0x32, 0xad, 0x51, 0xa5, 0x2d, 0xf9, 0xcc, 0xbf, 0xf9, 0xac, + 0xdf, 0x7c, 0x95, 0xab, 0x7d, 0xe4, 0x5a, 0x51, 0xc3, 0xff, 0xa8, 0x6f, 0x46, 0xef, 0x3b, 0x17, + 0x6c, 0x77, 0x2e, 0xf8, 0xda, 0xb9, 0xe0, 0x75, 0xef, 0xd6, 0xb6, 0x7b, 0xb7, 0xf6, 0xb9, 0x77, + 0x6b, 0x4f, 0x64, 0xc1, 0xd2, 0x24, 0x0b, 0xbc, 0x50, 0xac, 0x88, 0x7f, 0x3b, 0x1a, 0xf7, 0x1f, + 0x27, 0xfe, 0xd4, 0x1f, 0xfa, 0x0f, 0x44, 0x44, 0x8c, 0xf7, 0x43, 0x21, 0x63, 0xf2, 0xa2, 0xff, + 0x98, 0xa4, 0xf9, 0x3a, 0x56, 0x41, 0x5d, 0x9f, 0xbf, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x06, + 0x74, 0xee, 0xc6, 0x00, 0x02, 0x00, 0x00, +} + +func (m *Class) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Class) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Class) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x42 + } + if m.Data != nil { + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOnft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintOnft(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x32 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0x2a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NFT) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NFT) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NFT) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Data != nil { + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOnft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x2a + } + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintOnft(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x22 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0x1a + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintOnft(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintOnft(dAtA []byte, offset int, v uint64) int { + offset -= sovOnft(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Class) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + if m.Data != nil { + l = m.Data.Size() + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + return n +} + +func (m *NFT) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + if m.Data != nil { + l = m.Data.Size() + n += 1 + l + sovOnft(uint64(l)) + } + return n +} + +func sovOnft(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozOnft(x uint64) (n int) { + return sovOnft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Class) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Class: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Class: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = &types.Any{} + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NFT) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NFT: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NFT: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Data == nil { + m.Data = &types.Any{} + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipOnft(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnft + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnft + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnft + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthOnft + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOnft + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthOnft + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthOnft = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOnft = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOnft = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onft/types/query.pb.go b/x/onft/types/query.pb.go new file mode 100644 index 00000000..dfc0f758 --- /dev/null +++ b/x/onft/types/query.pb.go @@ -0,0 +1,2472 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: onft/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryClassOwnerRequest is the request type for the Query/Owner RPC method +type QueryClassOwnerRequest struct { + // class_id associated with nft collection + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` +} + +func (m *QueryClassOwnerRequest) Reset() { *m = QueryClassOwnerRequest{} } +func (m *QueryClassOwnerRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClassOwnerRequest) ProtoMessage() {} +func (*QueryClassOwnerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{0} +} +func (m *QueryClassOwnerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassOwnerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassOwnerRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryClassOwnerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassOwnerRequest.Merge(m, src) +} +func (m *QueryClassOwnerRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClassOwnerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassOwnerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassOwnerRequest proto.InternalMessageInfo + +func (m *QueryClassOwnerRequest) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +// QueryClassOwnerResponse is the response type for the Query/Owner RPC method +type QueryClassOwnerResponse struct { + // owner is the owner address of the nft class + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (m *QueryClassOwnerResponse) Reset() { *m = QueryClassOwnerResponse{} } +func (m *QueryClassOwnerResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClassOwnerResponse) ProtoMessage() {} +func (*QueryClassOwnerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{1} +} +func (m *QueryClassOwnerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassOwnerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryClassOwnerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassOwnerResponse.Merge(m, src) +} +func (m *QueryClassOwnerResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClassOwnerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassOwnerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassOwnerResponse proto.InternalMessageInfo + +func (m *QueryClassOwnerResponse) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +// QueryNFTstRequest is the request type for the Query/NFTs RPC method +type QueryNFTsRequest struct { + // class_id associated with the nft + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // owner is the owner address of the nft + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryNFTsRequest) Reset() { *m = QueryNFTsRequest{} } +func (m *QueryNFTsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNFTsRequest) ProtoMessage() {} +func (*QueryNFTsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{2} +} +func (m *QueryNFTsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNFTsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNFTsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNFTsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNFTsRequest.Merge(m, src) +} +func (m *QueryNFTsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNFTsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNFTsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNFTsRequest proto.InternalMessageInfo + +func (m *QueryNFTsRequest) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *QueryNFTsRequest) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *QueryNFTsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +type QueryNFTsResponse struct { + // NFT defines the NFT + Nfts []*NFT `protobuf:"bytes,1,rep,name=nfts,proto3" json:"nfts,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryNFTsResponse) Reset() { *m = QueryNFTsResponse{} } +func (m *QueryNFTsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNFTsResponse) ProtoMessage() {} +func (*QueryNFTsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{3} +} +func (m *QueryNFTsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNFTsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNFTsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNFTsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNFTsResponse.Merge(m, src) +} +func (m *QueryNFTsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNFTsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNFTsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNFTsResponse proto.InternalMessageInfo + +func (m *QueryNFTsResponse) GetNfts() []*NFT { + if m != nil { + return m.Nfts + } + return nil +} + +func (m *QueryNFTsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryNFTRequest is the request type for the Query/NFT RPC method +type QueryNFTRequest struct { + // class_id associated with the nft + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // id is a unique identifier of the NFT + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryNFTRequest) Reset() { *m = QueryNFTRequest{} } +func (m *QueryNFTRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNFTRequest) ProtoMessage() {} +func (*QueryNFTRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{4} +} +func (m *QueryNFTRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNFTRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNFTRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNFTRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNFTRequest.Merge(m, src) +} +func (m *QueryNFTRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNFTRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNFTRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNFTRequest proto.InternalMessageInfo + +func (m *QueryNFTRequest) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *QueryNFTRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// QueryNFTResponse is the response type for the Query/NFT RPC method +type QueryNFTResponse struct { + // owner is the owner address of the nft + Nft *NFT `protobuf:"bytes,1,opt,name=nft,proto3" json:"nft,omitempty"` +} + +func (m *QueryNFTResponse) Reset() { *m = QueryNFTResponse{} } +func (m *QueryNFTResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNFTResponse) ProtoMessage() {} +func (*QueryNFTResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{5} +} +func (m *QueryNFTResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNFTResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNFTResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNFTResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNFTResponse.Merge(m, src) +} +func (m *QueryNFTResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNFTResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNFTResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNFTResponse proto.InternalMessageInfo + +func (m *QueryNFTResponse) GetNft() *NFT { + if m != nil { + return m.Nft + } + return nil +} + +// QueryClassRequest is the request type for the Query/Class RPC method +type QueryClassRequest struct { + // class_id associated with the nft + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` +} + +func (m *QueryClassRequest) Reset() { *m = QueryClassRequest{} } +func (m *QueryClassRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClassRequest) ProtoMessage() {} +func (*QueryClassRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{6} +} +func (m *QueryClassRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryClassRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassRequest.Merge(m, src) +} +func (m *QueryClassRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClassRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassRequest proto.InternalMessageInfo + +func (m *QueryClassRequest) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +// QueryClassResponse is the response type for the Query/Class RPC method +type QueryClassResponse struct { + // class defines the class of the nft type. + Class *Class `protobuf:"bytes,1,opt,name=class,proto3" json:"class,omitempty"` +} + +func (m *QueryClassResponse) Reset() { *m = QueryClassResponse{} } +func (m *QueryClassResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClassResponse) ProtoMessage() {} +func (*QueryClassResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{7} +} +func (m *QueryClassResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryClassResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassResponse.Merge(m, src) +} +func (m *QueryClassResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClassResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassResponse proto.InternalMessageInfo + +func (m *QueryClassResponse) GetClass() *Class { + if m != nil { + return m.Class + } + return nil +} + +// QueryClassesRequest is the request type for the Query/Classes RPC method +type QueryClassesRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryClassesRequest) Reset() { *m = QueryClassesRequest{} } +func (m *QueryClassesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClassesRequest) ProtoMessage() {} +func (*QueryClassesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{8} +} +func (m *QueryClassesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryClassesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassesRequest.Merge(m, src) +} +func (m *QueryClassesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClassesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassesRequest proto.InternalMessageInfo + +func (m *QueryClassesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryClassesResponse is the response type for the Query/Classes RPC method +type QueryClassesResponse struct { + // class defines the class of the nft type. + Classes []*Class `protobuf:"bytes,1,rep,name=classes,proto3" json:"classes,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryClassesResponse) Reset() { *m = QueryClassesResponse{} } +func (m *QueryClassesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClassesResponse) ProtoMessage() {} +func (*QueryClassesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_75a97f4510dee2b2, []int{9} +} +func (m *QueryClassesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryClassesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassesResponse.Merge(m, src) +} +func (m *QueryClassesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClassesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassesResponse proto.InternalMessageInfo + +func (m *QueryClassesResponse) GetClasses() []*Class { + if m != nil { + return m.Classes + } + return nil +} + +func (m *QueryClassesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryClassOwnerRequest)(nil), "onft.v1.QueryClassOwnerRequest") + proto.RegisterType((*QueryClassOwnerResponse)(nil), "onft.v1.QueryClassOwnerResponse") + proto.RegisterType((*QueryNFTsRequest)(nil), "onft.v1.QueryNFTsRequest") + proto.RegisterType((*QueryNFTsResponse)(nil), "onft.v1.QueryNFTsResponse") + proto.RegisterType((*QueryNFTRequest)(nil), "onft.v1.QueryNFTRequest") + proto.RegisterType((*QueryNFTResponse)(nil), "onft.v1.QueryNFTResponse") + proto.RegisterType((*QueryClassRequest)(nil), "onft.v1.QueryClassRequest") + proto.RegisterType((*QueryClassResponse)(nil), "onft.v1.QueryClassResponse") + proto.RegisterType((*QueryClassesRequest)(nil), "onft.v1.QueryClassesRequest") + proto.RegisterType((*QueryClassesResponse)(nil), "onft.v1.QueryClassesResponse") +} + +func init() { proto.RegisterFile("onft/v1/query.proto", fileDescriptor_75a97f4510dee2b2) } + +var fileDescriptor_75a97f4510dee2b2 = []byte{ + // 619 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4d, 0x6f, 0xd3, 0x4c, + 0x10, 0xc7, 0xe3, 0xbc, 0x3c, 0x79, 0x98, 0x42, 0x5b, 0xb6, 0x05, 0x12, 0xb7, 0x71, 0x82, 0x79, + 0x69, 0x84, 0x54, 0xaf, 0x92, 0xde, 0x10, 0x27, 0x8a, 0x82, 0x22, 0xa1, 0xa4, 0x44, 0x39, 0x21, + 0x21, 0x70, 0xe2, 0x4d, 0xb0, 0xd4, 0x7a, 0xd3, 0xac, 0x13, 0x5a, 0x55, 0xe5, 0x00, 0x27, 0xc4, + 0x05, 0x89, 0x2f, 0xc5, 0xb1, 0x12, 0x17, 0x8e, 0x28, 0xe1, 0x83, 0x20, 0xef, 0xae, 0xdf, 0x52, + 0x57, 0xad, 0x10, 0x47, 0xef, 0xcc, 0xfc, 0x7f, 0xb3, 0xff, 0xd9, 0x31, 0xac, 0x51, 0x67, 0xe0, + 0xe2, 0x69, 0x0d, 0x1f, 0x4e, 0xc8, 0xf8, 0xd8, 0x18, 0x8d, 0xa9, 0x4b, 0x51, 0xde, 0x3b, 0x34, + 0xa6, 0x35, 0x75, 0x73, 0x48, 0xe9, 0x70, 0x9f, 0x60, 0x73, 0x64, 0x63, 0xd3, 0x71, 0xa8, 0x6b, + 0xba, 0x36, 0x75, 0x98, 0x48, 0x53, 0x1f, 0xf5, 0x29, 0x3b, 0xa0, 0x0c, 0xf7, 0x4c, 0x46, 0x44, + 0x3d, 0x9e, 0xd6, 0x7a, 0xc4, 0x35, 0x6b, 0x78, 0x64, 0x0e, 0x6d, 0x87, 0x27, 0xcb, 0x5c, 0xe4, + 0x73, 0xb8, 0x34, 0x3f, 0xd3, 0x77, 0xe0, 0xf6, 0x4b, 0xaf, 0x6a, 0x77, 0xdf, 0x64, 0xac, 0xfd, + 0xde, 0x21, 0xe3, 0x0e, 0x39, 0x9c, 0x10, 0xe6, 0xa2, 0x22, 0xfc, 0xdf, 0xf7, 0x0e, 0xdf, 0xd8, + 0x56, 0x41, 0xa9, 0x28, 0xd5, 0x6b, 0x9d, 0x3c, 0xff, 0x6e, 0x5a, 0x3a, 0x86, 0x3b, 0xe7, 0x8a, + 0xd8, 0x88, 0x3a, 0x8c, 0xa0, 0x75, 0xc8, 0x51, 0xef, 0x40, 0x96, 0x88, 0x0f, 0xfd, 0x8b, 0x02, + 0xab, 0xbc, 0xa2, 0xd5, 0xe8, 0xb2, 0xcb, 0x01, 0xa1, 0x4a, 0x3a, 0xa2, 0x82, 0x1a, 0x00, 0xe1, + 0x9d, 0x0a, 0x99, 0x8a, 0x52, 0x5d, 0xaa, 0x3f, 0x34, 0x84, 0x01, 0x86, 0x67, 0x80, 0x21, 0x0c, + 0x94, 0x06, 0x18, 0x7b, 0xe6, 0x90, 0x48, 0x58, 0x27, 0x52, 0xa9, 0x7f, 0x80, 0x9b, 0x91, 0x66, + 0x64, 0xe3, 0x15, 0xc8, 0x3a, 0x03, 0x97, 0x15, 0x94, 0x4a, 0xa6, 0xba, 0x54, 0xbf, 0x6e, 0x48, + 0xfb, 0x8d, 0x56, 0xa3, 0xdb, 0xe1, 0x11, 0xf4, 0x3c, 0x86, 0x4f, 0x73, 0xfc, 0xd6, 0xa5, 0x78, + 0x21, 0x1f, 0xe3, 0x3f, 0x81, 0x15, 0x9f, 0x7f, 0x05, 0x2f, 0x96, 0x21, 0x6d, 0x5b, 0xd2, 0x88, + 0xb4, 0x6d, 0xe9, 0xf5, 0xd0, 0xca, 0xa0, 0x79, 0x0d, 0x32, 0xce, 0xc0, 0xe5, 0x95, 0x8b, 0xbd, + 0x7b, 0x01, 0xdd, 0x90, 0x37, 0xe6, 0x03, 0xbb, 0xc2, 0x80, 0x1f, 0x03, 0x8a, 0xe6, 0x4b, 0xca, + 0x7d, 0xc8, 0xf1, 0x04, 0xc9, 0x59, 0x0e, 0x38, 0x22, 0x4d, 0x04, 0xf5, 0xd7, 0xb0, 0x16, 0xd6, + 0x92, 0x80, 0x16, 0x1f, 0x9e, 0xf2, 0xd7, 0xc3, 0xfb, 0xac, 0xc0, 0x7a, 0x5c, 0x5f, 0x76, 0x57, + 0x05, 0xd1, 0x3e, 0xf1, 0x67, 0xb8, 0xd8, 0x9f, 0x1f, 0xfe, 0x67, 0x83, 0xac, 0x7f, 0xca, 0x42, + 0x8e, 0xf7, 0x82, 0x8e, 0x00, 0xc2, 0x65, 0x40, 0xe5, 0x80, 0x9c, 0xbc, 0x5b, 0x6a, 0xe5, 0xe2, + 0x04, 0x81, 0xd1, 0xb7, 0x3e, 0xfe, 0xf8, 0xfd, 0x2d, 0x7d, 0x17, 0x95, 0xb1, 0xbf, 0xb4, 0xbc, + 0x7b, 0x7c, 0xe2, 0x8f, 0xec, 0x14, 0x8b, 0xa5, 0xe8, 0x42, 0xd6, 0x7b, 0xc7, 0xa8, 0x18, 0x97, + 0x8c, 0x2c, 0x9a, 0xaa, 0x26, 0x85, 0x24, 0xe7, 0x16, 0xe7, 0xac, 0xa0, 0x1b, 0x01, 0x87, 0xbf, + 0x75, 0x13, 0x32, 0xad, 0x46, 0x17, 0x15, 0xce, 0x55, 0xfa, 0x9a, 0xc5, 0x84, 0x88, 0x94, 0x7c, + 0xc0, 0x25, 0xcb, 0xa8, 0x14, 0x93, 0x8c, 0x76, 0x7e, 0x62, 0x5b, 0xa7, 0x88, 0x40, 0x8e, 0xdf, + 0x1b, 0xa9, 0x09, 0x66, 0xf8, 0x98, 0x8d, 0xc4, 0x98, 0x04, 0xdd, 0xe3, 0xa0, 0x12, 0xda, 0x88, + 0x7b, 0x44, 0xa2, 0x2c, 0xf4, 0x16, 0xf2, 0xf2, 0xa5, 0xa0, 0xcd, 0x04, 0xb1, 0xe0, 0x81, 0xaa, + 0xa5, 0x0b, 0xa2, 0x12, 0x56, 0xe0, 0x30, 0x84, 0x56, 0x17, 0x61, 0x4f, 0x9b, 0xdf, 0x67, 0x9a, + 0x72, 0x36, 0xd3, 0x94, 0x5f, 0x33, 0x4d, 0xf9, 0x3a, 0xd7, 0x52, 0x67, 0x73, 0x2d, 0xf5, 0x73, + 0xae, 0xa5, 0x5e, 0xe1, 0xa1, 0xed, 0xbe, 0x9b, 0xf4, 0x8c, 0x3e, 0x3d, 0xc0, 0xed, 0x67, 0xcd, + 0xd6, 0xf6, 0x5e, 0xa7, 0xdd, 0x6d, 0xef, 0xb6, 0x5f, 0x60, 0x6a, 0xd9, 0xce, 0x76, 0x9f, 0x8e, + 0x09, 0x3e, 0x12, 0x7a, 0xee, 0xf1, 0x88, 0xb0, 0xde, 0x7f, 0xfc, 0xa7, 0xbc, 0xf3, 0x27, 0x00, + 0x00, 0xff, 0xff, 0x3c, 0xa6, 0x93, 0xb0, 0x12, 0x06, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // ClassOwner queries the owner of the NFT class + ClassOwner(ctx context.Context, in *QueryClassOwnerRequest, opts ...grpc.CallOption) (*QueryClassOwnerResponse, error) + // NFTs queries all NFTs with owners 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 with owner 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 with class owner + Class(ctx context.Context, in *QueryClassRequest, opts ...grpc.CallOption) (*QueryClassResponse, error) + // Classes queries all NFT classes with owners + Classes(ctx context.Context, in *QueryClassesRequest, opts ...grpc.CallOption) (*QueryClassesResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) ClassOwner(ctx context.Context, in *QueryClassOwnerRequest, opts ...grpc.CallOption) (*QueryClassOwnerResponse, error) { + out := new(QueryClassOwnerResponse) + err := c.cc.Invoke(ctx, "/onft.v1.Query/ClassOwner", 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, "/onft.v1.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, "/onft.v1.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, "/onft.v1.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, "/onft.v1.Query/Classes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // ClassOwner queries the owner of the NFT class + ClassOwner(context.Context, *QueryClassOwnerRequest) (*QueryClassOwnerResponse, error) + // NFTs queries all NFTs with owners 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 with owner based on its class and id + NFT(context.Context, *QueryNFTRequest) (*QueryNFTResponse, error) + // Class queries an NFT class based on its id with class owner + Class(context.Context, *QueryClassRequest) (*QueryClassResponse, error) + // Classes queries all NFT classes with owners + Classes(context.Context, *QueryClassesRequest) (*QueryClassesResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) ClassOwner(ctx context.Context, req *QueryClassOwnerRequest) (*QueryClassOwnerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClassOwner not implemented") +} +func (*UnimplementedQueryServer) NFTs(ctx context.Context, req *QueryNFTsRequest) (*QueryNFTsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NFTs not implemented") +} +func (*UnimplementedQueryServer) NFT(ctx context.Context, req *QueryNFTRequest) (*QueryNFTResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NFT not implemented") +} +func (*UnimplementedQueryServer) Class(ctx context.Context, req *QueryClassRequest) (*QueryClassResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Class not implemented") +} +func (*UnimplementedQueryServer) Classes(ctx context.Context, req *QueryClassesRequest) (*QueryClassesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Classes not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_ClassOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryClassOwnerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClassOwner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/onft.v1.Query/ClassOwner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClassOwner(ctx, req.(*QueryClassOwnerRequest)) + } + 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: "/onft.v1.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: "/onft.v1.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: "/onft.v1.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: "/onft.v1.Query/Classes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Classes(ctx, req.(*QueryClassesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "onft.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ClassOwner", + Handler: _Query_ClassOwner_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: "onft/v1/query.proto", +} + +func (m *QueryClassOwnerRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryClassOwnerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassOwnerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryClassOwnerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryNFTsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNFTsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNFTsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryNFTsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNFTsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNFTsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Nfts) > 0 { + for iNdEx := len(m.Nfts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nfts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryNFTRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNFTRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNFTRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryNFTResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNFTResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNFTResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Nft != nil { + { + size, err := m.Nft.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryClassRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryClassResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Class != nil { + { + size, err := m.Class.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryClassesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryClassesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Classes) > 0 { + for iNdEx := len(m.Classes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Classes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryClassOwnerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassOwnerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryNFTsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryNFTsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Nfts) > 0 { + for _, e := range m.Nfts { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryNFTRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryNFTResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Nft != nil { + l = m.Nft.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Class != nil { + l = m.Class.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Classes) > 0 { + for _, e := range m.Classes { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryClassOwnerRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryClassOwnerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassOwnerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassOwnerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryClassOwnerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNFTsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNFTsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNFTsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNFTsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNFTsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNFTsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nfts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nfts = append(m.Nfts, &NFT{}) + if err := m.Nfts[len(m.Nfts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNFTRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNFTRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNFTRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNFTResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNFTResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNFTResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nft", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Nft == nil { + m.Nft = &NFT{} + } + if err := m.Nft.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryClassRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryClassResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Class", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Class == nil { + m.Class = &Class{} + } + if err := m.Class.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryClassesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryClassesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Classes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Classes = append(m.Classes, &Class{}) + if err := m.Classes[len(m.Classes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onft/types/query.pb.gw.go b/x/onft/types/query.pb.gw.go new file mode 100644 index 00000000..2bfda689 --- /dev/null +++ b/x/onft/types/query.pb.gw.go @@ -0,0 +1,579 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: onft/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_ClassOwner_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryClassOwnerRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["class_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") + } + + protoReq.ClassId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) + } + + msg, err := client.ClassOwner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ClassOwner_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryClassOwnerRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["class_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") + } + + protoReq.ClassId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) + } + + msg, err := server.ClassOwner(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_NFTs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_NFTs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNFTsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_NFTs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.NFTs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NFTs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNFTsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_NFTs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.NFTs(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_NFT_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNFTRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["class_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") + } + + protoReq.ClassId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) + } + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.NFT(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NFT_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNFTRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["class_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") + } + + protoReq.ClassId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) + } + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.NFT(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Class_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryClassRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["class_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") + } + + protoReq.ClassId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) + } + + msg, err := client.Class(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Class_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryClassRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["class_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") + } + + protoReq.ClassId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) + } + + msg, err := server.Class(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Classes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Classes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryClassesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Classes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Classes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Classes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryClassesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Classes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Classes(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_ClassOwner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ClassOwner_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ClassOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_NFTs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NFTs_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NFTs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_NFT_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NFT_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NFT_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Class_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Class_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Class_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Classes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Classes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Classes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_ClassOwner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ClassOwner_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ClassOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_NFTs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NFTs_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NFTs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_NFT_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NFT_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NFT_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Class_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Class_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Class_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Classes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Classes_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Classes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_ClassOwner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"onft", "v1", "class", "class_id", "owner"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NFTs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"onft", "v1", "nfts"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NFT_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"onft", "v1", "nfts", "class_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Class_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"onft", "v1", "classes", "class_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Classes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"onft", "v1", "classes"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_ClassOwner_0 = runtime.ForwardResponseMessage + + forward_Query_NFTs_0 = runtime.ForwardResponseMessage + + forward_Query_NFT_0 = runtime.ForwardResponseMessage + + forward_Query_Class_0 = runtime.ForwardResponseMessage + + forward_Query_Classes_0 = runtime.ForwardResponseMessage +)