diff --git a/api/irismod/nft/nft.pulsar.go b/api/irismod/nft/nft.pulsar.go index 766dfba2..3b4ff227 100644 --- a/api/irismod/nft/nft.pulsar.go +++ b/api/irismod/nft/nft.pulsar.go @@ -754,1558 +754,46 @@ func (x *fastReflection_BaseNFT) ProtoMethods() *protoiface.Methods { } var ( - md_NFTMetadata protoreflect.MessageDescriptor - fd_NFTMetadata_name protoreflect.FieldDescriptor - fd_NFTMetadata_data protoreflect.FieldDescriptor -) - -func init() { - file_irismod_nft_nft_proto_init() - md_NFTMetadata = File_irismod_nft_nft_proto.Messages().ByName("NFTMetadata") - fd_NFTMetadata_name = md_NFTMetadata.Fields().ByName("name") - fd_NFTMetadata_data = md_NFTMetadata.Fields().ByName("data") -} - -var _ protoreflect.Message = (*fastReflection_NFTMetadata)(nil) - -type fastReflection_NFTMetadata NFTMetadata - -func (x *NFTMetadata) ProtoReflect() protoreflect.Message { - return (*fastReflection_NFTMetadata)(x) -} - -func (x *NFTMetadata) slowProtoReflect() protoreflect.Message { - mi := &file_irismod_nft_nft_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_NFTMetadata_messageType fastReflection_NFTMetadata_messageType -var _ protoreflect.MessageType = fastReflection_NFTMetadata_messageType{} - -type fastReflection_NFTMetadata_messageType struct{} - -func (x fastReflection_NFTMetadata_messageType) Zero() protoreflect.Message { - return (*fastReflection_NFTMetadata)(nil) -} -func (x fastReflection_NFTMetadata_messageType) New() protoreflect.Message { - return new(fastReflection_NFTMetadata) -} -func (x fastReflection_NFTMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_NFTMetadata -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_NFTMetadata) Descriptor() protoreflect.MessageDescriptor { - return md_NFTMetadata -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_NFTMetadata) Type() protoreflect.MessageType { - return _fastReflection_NFTMetadata_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_NFTMetadata) New() protoreflect.Message { - return new(fastReflection_NFTMetadata) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_NFTMetadata) Interface() protoreflect.ProtoMessage { - return (*NFTMetadata)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_NFTMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Name != "" { - value := protoreflect.ValueOfString(x.Name) - if !f(fd_NFTMetadata_name, value) { - return - } - } - if x.Data != "" { - value := protoreflect.ValueOfString(x.Data) - if !f(fd_NFTMetadata_data, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_NFTMetadata) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "irismod.nft.NFTMetadata.name": - return x.Name != "" - case "irismod.nft.NFTMetadata.data": - return x.Data != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.NFTMetadata")) - } - panic(fmt.Errorf("message irismod.nft.NFTMetadata does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NFTMetadata) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "irismod.nft.NFTMetadata.name": - x.Name = "" - case "irismod.nft.NFTMetadata.data": - x.Data = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.NFTMetadata")) - } - panic(fmt.Errorf("message irismod.nft.NFTMetadata does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_NFTMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "irismod.nft.NFTMetadata.name": - value := x.Name - return protoreflect.ValueOfString(value) - case "irismod.nft.NFTMetadata.data": - value := x.Data - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.NFTMetadata")) - } - panic(fmt.Errorf("message irismod.nft.NFTMetadata does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NFTMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "irismod.nft.NFTMetadata.name": - x.Name = value.Interface().(string) - case "irismod.nft.NFTMetadata.data": - x.Data = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.NFTMetadata")) - } - panic(fmt.Errorf("message irismod.nft.NFTMetadata does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NFTMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "irismod.nft.NFTMetadata.name": - panic(fmt.Errorf("field name of message irismod.nft.NFTMetadata is not mutable")) - case "irismod.nft.NFTMetadata.data": - panic(fmt.Errorf("field data of message irismod.nft.NFTMetadata is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.NFTMetadata")) - } - panic(fmt.Errorf("message irismod.nft.NFTMetadata does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_NFTMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "irismod.nft.NFTMetadata.name": - return protoreflect.ValueOfString("") - case "irismod.nft.NFTMetadata.data": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.NFTMetadata")) - } - panic(fmt.Errorf("message irismod.nft.NFTMetadata does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_NFTMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in irismod.nft.NFTMetadata", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_NFTMetadata) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NFTMetadata) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_NFTMetadata) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_NFTMetadata) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*NFTMetadata) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Name) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Data) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*NFTMetadata) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Data) > 0 { - i -= len(x.Data) - copy(dAtA[i:], x.Data) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) - i-- - dAtA[i] = 0x12 - } - if len(x.Name) > 0 { - i -= len(x.Name) - copy(dAtA[i:], x.Name) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*NFTMetadata) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NFTMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NFTMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Data = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_Denom protoreflect.MessageDescriptor - fd_Denom_id protoreflect.FieldDescriptor - fd_Denom_name protoreflect.FieldDescriptor - fd_Denom_schema protoreflect.FieldDescriptor - fd_Denom_creator protoreflect.FieldDescriptor - fd_Denom_symbol protoreflect.FieldDescriptor - fd_Denom_mint_restricted protoreflect.FieldDescriptor - fd_Denom_update_restricted protoreflect.FieldDescriptor - fd_Denom_description protoreflect.FieldDescriptor - fd_Denom_uri protoreflect.FieldDescriptor - fd_Denom_uri_hash protoreflect.FieldDescriptor - fd_Denom_data protoreflect.FieldDescriptor -) - -func init() { - file_irismod_nft_nft_proto_init() - md_Denom = File_irismod_nft_nft_proto.Messages().ByName("Denom") - fd_Denom_id = md_Denom.Fields().ByName("id") - fd_Denom_name = md_Denom.Fields().ByName("name") - fd_Denom_schema = md_Denom.Fields().ByName("schema") - fd_Denom_creator = md_Denom.Fields().ByName("creator") - fd_Denom_symbol = md_Denom.Fields().ByName("symbol") - fd_Denom_mint_restricted = md_Denom.Fields().ByName("mint_restricted") - fd_Denom_update_restricted = md_Denom.Fields().ByName("update_restricted") - fd_Denom_description = md_Denom.Fields().ByName("description") - fd_Denom_uri = md_Denom.Fields().ByName("uri") - fd_Denom_uri_hash = md_Denom.Fields().ByName("uri_hash") - fd_Denom_data = md_Denom.Fields().ByName("data") -} - -var _ protoreflect.Message = (*fastReflection_Denom)(nil) - -type fastReflection_Denom Denom - -func (x *Denom) ProtoReflect() protoreflect.Message { - return (*fastReflection_Denom)(x) -} - -func (x *Denom) slowProtoReflect() protoreflect.Message { - mi := &file_irismod_nft_nft_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Denom_messageType fastReflection_Denom_messageType -var _ protoreflect.MessageType = fastReflection_Denom_messageType{} - -type fastReflection_Denom_messageType struct{} - -func (x fastReflection_Denom_messageType) Zero() protoreflect.Message { - return (*fastReflection_Denom)(nil) -} -func (x fastReflection_Denom_messageType) New() protoreflect.Message { - return new(fastReflection_Denom) -} -func (x fastReflection_Denom_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Denom -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Denom) Descriptor() protoreflect.MessageDescriptor { - return md_Denom -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Denom) Type() protoreflect.MessageType { - return _fastReflection_Denom_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Denom) New() protoreflect.Message { - return new(fastReflection_Denom) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Denom) Interface() protoreflect.ProtoMessage { - return (*Denom)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_Denom) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Denom_id, value) { - return - } - } - if x.Name != "" { - value := protoreflect.ValueOfString(x.Name) - if !f(fd_Denom_name, value) { - return - } - } - if x.Schema != "" { - value := protoreflect.ValueOfString(x.Schema) - if !f(fd_Denom_schema, value) { - return - } - } - if x.Creator != "" { - value := protoreflect.ValueOfString(x.Creator) - if !f(fd_Denom_creator, value) { - return - } - } - if x.Symbol != "" { - value := protoreflect.ValueOfString(x.Symbol) - if !f(fd_Denom_symbol, value) { - return - } - } - if x.MintRestricted != false { - value := protoreflect.ValueOfBool(x.MintRestricted) - if !f(fd_Denom_mint_restricted, value) { - return - } - } - if x.UpdateRestricted != false { - value := protoreflect.ValueOfBool(x.UpdateRestricted) - if !f(fd_Denom_update_restricted, value) { - return - } - } - if x.Description != "" { - value := protoreflect.ValueOfString(x.Description) - if !f(fd_Denom_description, value) { - return - } - } - if x.Uri != "" { - value := protoreflect.ValueOfString(x.Uri) - if !f(fd_Denom_uri, value) { - return - } - } - if x.UriHash != "" { - value := protoreflect.ValueOfString(x.UriHash) - if !f(fd_Denom_uri_hash, value) { - return - } - } - if x.Data != "" { - value := protoreflect.ValueOfString(x.Data) - if !f(fd_Denom_data, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Denom) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "irismod.nft.Denom.id": - return x.Id != "" - case "irismod.nft.Denom.name": - return x.Name != "" - case "irismod.nft.Denom.schema": - return x.Schema != "" - case "irismod.nft.Denom.creator": - return x.Creator != "" - case "irismod.nft.Denom.symbol": - return x.Symbol != "" - case "irismod.nft.Denom.mint_restricted": - return x.MintRestricted != false - case "irismod.nft.Denom.update_restricted": - return x.UpdateRestricted != false - case "irismod.nft.Denom.description": - return x.Description != "" - case "irismod.nft.Denom.uri": - return x.Uri != "" - case "irismod.nft.Denom.uri_hash": - return x.UriHash != "" - case "irismod.nft.Denom.data": - return x.Data != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) - } - panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Denom) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "irismod.nft.Denom.id": - x.Id = "" - case "irismod.nft.Denom.name": - x.Name = "" - case "irismod.nft.Denom.schema": - x.Schema = "" - case "irismod.nft.Denom.creator": - x.Creator = "" - case "irismod.nft.Denom.symbol": - x.Symbol = "" - case "irismod.nft.Denom.mint_restricted": - x.MintRestricted = false - case "irismod.nft.Denom.update_restricted": - x.UpdateRestricted = false - case "irismod.nft.Denom.description": - x.Description = "" - case "irismod.nft.Denom.uri": - x.Uri = "" - case "irismod.nft.Denom.uri_hash": - x.UriHash = "" - case "irismod.nft.Denom.data": - x.Data = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) - } - panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Denom) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "irismod.nft.Denom.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "irismod.nft.Denom.name": - value := x.Name - return protoreflect.ValueOfString(value) - case "irismod.nft.Denom.schema": - value := x.Schema - return protoreflect.ValueOfString(value) - case "irismod.nft.Denom.creator": - value := x.Creator - return protoreflect.ValueOfString(value) - case "irismod.nft.Denom.symbol": - value := x.Symbol - return protoreflect.ValueOfString(value) - case "irismod.nft.Denom.mint_restricted": - value := x.MintRestricted - return protoreflect.ValueOfBool(value) - case "irismod.nft.Denom.update_restricted": - value := x.UpdateRestricted - return protoreflect.ValueOfBool(value) - case "irismod.nft.Denom.description": - value := x.Description - return protoreflect.ValueOfString(value) - case "irismod.nft.Denom.uri": - value := x.Uri - return protoreflect.ValueOfString(value) - case "irismod.nft.Denom.uri_hash": - value := x.UriHash - return protoreflect.ValueOfString(value) - case "irismod.nft.Denom.data": - value := x.Data - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) - } - panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Denom) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "irismod.nft.Denom.id": - x.Id = value.Interface().(string) - case "irismod.nft.Denom.name": - x.Name = value.Interface().(string) - case "irismod.nft.Denom.schema": - x.Schema = value.Interface().(string) - case "irismod.nft.Denom.creator": - x.Creator = value.Interface().(string) - case "irismod.nft.Denom.symbol": - x.Symbol = value.Interface().(string) - case "irismod.nft.Denom.mint_restricted": - x.MintRestricted = value.Bool() - case "irismod.nft.Denom.update_restricted": - x.UpdateRestricted = value.Bool() - case "irismod.nft.Denom.description": - x.Description = value.Interface().(string) - case "irismod.nft.Denom.uri": - x.Uri = value.Interface().(string) - case "irismod.nft.Denom.uri_hash": - x.UriHash = value.Interface().(string) - case "irismod.nft.Denom.data": - x.Data = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) - } - panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Denom) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "irismod.nft.Denom.id": - panic(fmt.Errorf("field id of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.name": - panic(fmt.Errorf("field name of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.schema": - panic(fmt.Errorf("field schema of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.creator": - panic(fmt.Errorf("field creator of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.symbol": - panic(fmt.Errorf("field symbol of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.mint_restricted": - panic(fmt.Errorf("field mint_restricted of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.update_restricted": - panic(fmt.Errorf("field update_restricted of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.description": - panic(fmt.Errorf("field description of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.uri": - panic(fmt.Errorf("field uri of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.uri_hash": - panic(fmt.Errorf("field uri_hash of message irismod.nft.Denom is not mutable")) - case "irismod.nft.Denom.data": - panic(fmt.Errorf("field data of message irismod.nft.Denom is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) - } - panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Denom) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "irismod.nft.Denom.id": - return protoreflect.ValueOfString("") - case "irismod.nft.Denom.name": - return protoreflect.ValueOfString("") - case "irismod.nft.Denom.schema": - return protoreflect.ValueOfString("") - case "irismod.nft.Denom.creator": - return protoreflect.ValueOfString("") - case "irismod.nft.Denom.symbol": - return protoreflect.ValueOfString("") - case "irismod.nft.Denom.mint_restricted": - return protoreflect.ValueOfBool(false) - case "irismod.nft.Denom.update_restricted": - return protoreflect.ValueOfBool(false) - case "irismod.nft.Denom.description": - return protoreflect.ValueOfString("") - case "irismod.nft.Denom.uri": - return protoreflect.ValueOfString("") - case "irismod.nft.Denom.uri_hash": - return protoreflect.ValueOfString("") - case "irismod.nft.Denom.data": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) - } - panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Denom) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in irismod.nft.Denom", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Denom) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Denom) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Denom) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Denom) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Denom) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Name) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Schema) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Creator) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Symbol) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.MintRestricted { - n += 2 - } - if x.UpdateRestricted { - n += 2 - } - l = len(x.Description) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Uri) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.UriHash) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Data) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Denom) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Data) > 0 { - i -= len(x.Data) - copy(dAtA[i:], x.Data) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) - i-- - dAtA[i] = 0x5a - } - if len(x.UriHash) > 0 { - i -= len(x.UriHash) - copy(dAtA[i:], x.UriHash) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UriHash))) - i-- - dAtA[i] = 0x52 - } - if len(x.Uri) > 0 { - i -= len(x.Uri) - copy(dAtA[i:], x.Uri) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Uri))) - i-- - dAtA[i] = 0x4a - } - if len(x.Description) > 0 { - i -= len(x.Description) - copy(dAtA[i:], x.Description) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) - i-- - dAtA[i] = 0x42 - } - if x.UpdateRestricted { - i-- - if x.UpdateRestricted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - } - if x.MintRestricted { - i-- - if x.MintRestricted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(x.Symbol) > 0 { - i -= len(x.Symbol) - copy(dAtA[i:], x.Symbol) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Symbol))) - i-- - dAtA[i] = 0x2a - } - if len(x.Creator) > 0 { - i -= len(x.Creator) - copy(dAtA[i:], x.Creator) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Creator))) - i-- - dAtA[i] = 0x22 - } - if len(x.Schema) > 0 { - i -= len(x.Schema) - copy(dAtA[i:], x.Schema) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Schema))) - i-- - dAtA[i] = 0x1a - } - if len(x.Name) > 0 { - i -= len(x.Name) - copy(dAtA[i:], x.Name) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) - i-- - dAtA[i] = 0x12 - } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Denom) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Denom: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Denom: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Schema = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MintRestricted", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.MintRestricted = bool(v != 0) - case 7: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UpdateRestricted", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.UpdateRestricted = bool(v != 0) - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Uri = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 10: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.UriHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Data = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_DenomMetadata protoreflect.MessageDescriptor - fd_DenomMetadata_creator protoreflect.FieldDescriptor - fd_DenomMetadata_schema protoreflect.FieldDescriptor - fd_DenomMetadata_mint_restricted protoreflect.FieldDescriptor - fd_DenomMetadata_update_restricted protoreflect.FieldDescriptor - fd_DenomMetadata_data protoreflect.FieldDescriptor + md_Denom protoreflect.MessageDescriptor + fd_Denom_id protoreflect.FieldDescriptor + fd_Denom_name protoreflect.FieldDescriptor + fd_Denom_schema protoreflect.FieldDescriptor + fd_Denom_creator protoreflect.FieldDescriptor + fd_Denom_symbol protoreflect.FieldDescriptor + fd_Denom_mint_restricted protoreflect.FieldDescriptor + fd_Denom_update_restricted protoreflect.FieldDescriptor + fd_Denom_description protoreflect.FieldDescriptor + fd_Denom_uri protoreflect.FieldDescriptor + fd_Denom_uri_hash protoreflect.FieldDescriptor + fd_Denom_data protoreflect.FieldDescriptor ) func init() { file_irismod_nft_nft_proto_init() - md_DenomMetadata = File_irismod_nft_nft_proto.Messages().ByName("DenomMetadata") - fd_DenomMetadata_creator = md_DenomMetadata.Fields().ByName("creator") - fd_DenomMetadata_schema = md_DenomMetadata.Fields().ByName("schema") - fd_DenomMetadata_mint_restricted = md_DenomMetadata.Fields().ByName("mint_restricted") - fd_DenomMetadata_update_restricted = md_DenomMetadata.Fields().ByName("update_restricted") - fd_DenomMetadata_data = md_DenomMetadata.Fields().ByName("data") + md_Denom = File_irismod_nft_nft_proto.Messages().ByName("Denom") + fd_Denom_id = md_Denom.Fields().ByName("id") + fd_Denom_name = md_Denom.Fields().ByName("name") + fd_Denom_schema = md_Denom.Fields().ByName("schema") + fd_Denom_creator = md_Denom.Fields().ByName("creator") + fd_Denom_symbol = md_Denom.Fields().ByName("symbol") + fd_Denom_mint_restricted = md_Denom.Fields().ByName("mint_restricted") + fd_Denom_update_restricted = md_Denom.Fields().ByName("update_restricted") + fd_Denom_description = md_Denom.Fields().ByName("description") + fd_Denom_uri = md_Denom.Fields().ByName("uri") + fd_Denom_uri_hash = md_Denom.Fields().ByName("uri_hash") + fd_Denom_data = md_Denom.Fields().ByName("data") } -var _ protoreflect.Message = (*fastReflection_DenomMetadata)(nil) +var _ protoreflect.Message = (*fastReflection_Denom)(nil) -type fastReflection_DenomMetadata DenomMetadata +type fastReflection_Denom Denom -func (x *DenomMetadata) ProtoReflect() protoreflect.Message { - return (*fastReflection_DenomMetadata)(x) +func (x *Denom) ProtoReflect() protoreflect.Message { + return (*fastReflection_Denom)(x) } -func (x *DenomMetadata) slowProtoReflect() protoreflect.Message { - mi := &file_irismod_nft_nft_proto_msgTypes[3] +func (x *Denom) slowProtoReflect() protoreflect.Message { + mi := &file_irismod_nft_nft_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2316,43 +804,43 @@ func (x *DenomMetadata) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_DenomMetadata_messageType fastReflection_DenomMetadata_messageType -var _ protoreflect.MessageType = fastReflection_DenomMetadata_messageType{} +var _fastReflection_Denom_messageType fastReflection_Denom_messageType +var _ protoreflect.MessageType = fastReflection_Denom_messageType{} -type fastReflection_DenomMetadata_messageType struct{} +type fastReflection_Denom_messageType struct{} -func (x fastReflection_DenomMetadata_messageType) Zero() protoreflect.Message { - return (*fastReflection_DenomMetadata)(nil) +func (x fastReflection_Denom_messageType) Zero() protoreflect.Message { + return (*fastReflection_Denom)(nil) } -func (x fastReflection_DenomMetadata_messageType) New() protoreflect.Message { - return new(fastReflection_DenomMetadata) +func (x fastReflection_Denom_messageType) New() protoreflect.Message { + return new(fastReflection_Denom) } -func (x fastReflection_DenomMetadata_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_DenomMetadata +func (x fastReflection_Denom_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Denom } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_DenomMetadata) Descriptor() protoreflect.MessageDescriptor { - return md_DenomMetadata +func (x *fastReflection_Denom) Descriptor() protoreflect.MessageDescriptor { + return md_Denom } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_DenomMetadata) Type() protoreflect.MessageType { - return _fastReflection_DenomMetadata_messageType +func (x *fastReflection_Denom) Type() protoreflect.MessageType { + return _fastReflection_Denom_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_DenomMetadata) New() protoreflect.Message { - return new(fastReflection_DenomMetadata) +func (x *fastReflection_Denom) New() protoreflect.Message { + return new(fastReflection_Denom) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_DenomMetadata) Interface() protoreflect.ProtoMessage { - return (*DenomMetadata)(x) +func (x *fastReflection_Denom) Interface() protoreflect.ProtoMessage { + return (*Denom)(x) } // Range iterates over every populated field in an undefined order, @@ -2360,34 +848,70 @@ func (x *fastReflection_DenomMetadata) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_DenomMetadata) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Creator != "" { - value := protoreflect.ValueOfString(x.Creator) - if !f(fd_DenomMetadata_creator, value) { +func (x *fastReflection_Denom) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_Denom_id, value) { + return + } + } + if x.Name != "" { + value := protoreflect.ValueOfString(x.Name) + if !f(fd_Denom_name, value) { return } } if x.Schema != "" { value := protoreflect.ValueOfString(x.Schema) - if !f(fd_DenomMetadata_schema, value) { + if !f(fd_Denom_schema, value) { + return + } + } + if x.Creator != "" { + value := protoreflect.ValueOfString(x.Creator) + if !f(fd_Denom_creator, value) { + return + } + } + if x.Symbol != "" { + value := protoreflect.ValueOfString(x.Symbol) + if !f(fd_Denom_symbol, value) { return } } if x.MintRestricted != false { value := protoreflect.ValueOfBool(x.MintRestricted) - if !f(fd_DenomMetadata_mint_restricted, value) { + if !f(fd_Denom_mint_restricted, value) { return } } if x.UpdateRestricted != false { value := protoreflect.ValueOfBool(x.UpdateRestricted) - if !f(fd_DenomMetadata_update_restricted, value) { + if !f(fd_Denom_update_restricted, value) { + return + } + } + if x.Description != "" { + value := protoreflect.ValueOfString(x.Description) + if !f(fd_Denom_description, value) { + return + } + } + if x.Uri != "" { + value := protoreflect.ValueOfString(x.Uri) + if !f(fd_Denom_uri, value) { + return + } + } + if x.UriHash != "" { + value := protoreflect.ValueOfString(x.UriHash) + if !f(fd_Denom_uri_hash, value) { return } } if x.Data != "" { value := protoreflect.ValueOfString(x.Data) - if !f(fd_DenomMetadata_data, value) { + if !f(fd_Denom_data, value) { return } } @@ -2404,23 +928,35 @@ func (x *fastReflection_DenomMetadata) Range(f func(protoreflect.FieldDescriptor // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_DenomMetadata) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_Denom) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "irismod.nft.DenomMetadata.creator": - return x.Creator != "" - case "irismod.nft.DenomMetadata.schema": + case "irismod.nft.Denom.id": + return x.Id != "" + case "irismod.nft.Denom.name": + return x.Name != "" + case "irismod.nft.Denom.schema": return x.Schema != "" - case "irismod.nft.DenomMetadata.mint_restricted": + case "irismod.nft.Denom.creator": + return x.Creator != "" + case "irismod.nft.Denom.symbol": + return x.Symbol != "" + case "irismod.nft.Denom.mint_restricted": return x.MintRestricted != false - case "irismod.nft.DenomMetadata.update_restricted": + case "irismod.nft.Denom.update_restricted": return x.UpdateRestricted != false - case "irismod.nft.DenomMetadata.data": + case "irismod.nft.Denom.description": + return x.Description != "" + case "irismod.nft.Denom.uri": + return x.Uri != "" + case "irismod.nft.Denom.uri_hash": + return x.UriHash != "" + case "irismod.nft.Denom.data": return x.Data != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.DenomMetadata")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) } - panic(fmt.Errorf("message irismod.nft.DenomMetadata does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) } } @@ -2430,23 +966,35 @@ func (x *fastReflection_DenomMetadata) Has(fd protoreflect.FieldDescriptor) bool // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DenomMetadata) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_Denom) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "irismod.nft.DenomMetadata.creator": - x.Creator = "" - case "irismod.nft.DenomMetadata.schema": + case "irismod.nft.Denom.id": + x.Id = "" + case "irismod.nft.Denom.name": + x.Name = "" + case "irismod.nft.Denom.schema": x.Schema = "" - case "irismod.nft.DenomMetadata.mint_restricted": + case "irismod.nft.Denom.creator": + x.Creator = "" + case "irismod.nft.Denom.symbol": + x.Symbol = "" + case "irismod.nft.Denom.mint_restricted": x.MintRestricted = false - case "irismod.nft.DenomMetadata.update_restricted": + case "irismod.nft.Denom.update_restricted": x.UpdateRestricted = false - case "irismod.nft.DenomMetadata.data": + case "irismod.nft.Denom.description": + x.Description = "" + case "irismod.nft.Denom.uri": + x.Uri = "" + case "irismod.nft.Denom.uri_hash": + x.UriHash = "" + case "irismod.nft.Denom.data": x.Data = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.DenomMetadata")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) } - panic(fmt.Errorf("message irismod.nft.DenomMetadata does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) } } @@ -2456,28 +1004,46 @@ func (x *fastReflection_DenomMetadata) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_DenomMetadata) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Denom) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "irismod.nft.DenomMetadata.creator": - value := x.Creator + case "irismod.nft.Denom.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "irismod.nft.Denom.name": + value := x.Name return protoreflect.ValueOfString(value) - case "irismod.nft.DenomMetadata.schema": + case "irismod.nft.Denom.schema": value := x.Schema return protoreflect.ValueOfString(value) - case "irismod.nft.DenomMetadata.mint_restricted": + case "irismod.nft.Denom.creator": + value := x.Creator + return protoreflect.ValueOfString(value) + case "irismod.nft.Denom.symbol": + value := x.Symbol + return protoreflect.ValueOfString(value) + case "irismod.nft.Denom.mint_restricted": value := x.MintRestricted return protoreflect.ValueOfBool(value) - case "irismod.nft.DenomMetadata.update_restricted": + case "irismod.nft.Denom.update_restricted": value := x.UpdateRestricted return protoreflect.ValueOfBool(value) - case "irismod.nft.DenomMetadata.data": + case "irismod.nft.Denom.description": + value := x.Description + return protoreflect.ValueOfString(value) + case "irismod.nft.Denom.uri": + value := x.Uri + return protoreflect.ValueOfString(value) + case "irismod.nft.Denom.uri_hash": + value := x.UriHash + return protoreflect.ValueOfString(value) + case "irismod.nft.Denom.data": value := x.Data return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.DenomMetadata")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) } - panic(fmt.Errorf("message irismod.nft.DenomMetadata does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", descriptor.FullName())) } } @@ -2491,23 +1057,35 @@ func (x *fastReflection_DenomMetadata) Get(descriptor protoreflect.FieldDescript // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DenomMetadata) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_Denom) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "irismod.nft.DenomMetadata.creator": - x.Creator = value.Interface().(string) - case "irismod.nft.DenomMetadata.schema": + case "irismod.nft.Denom.id": + x.Id = value.Interface().(string) + case "irismod.nft.Denom.name": + x.Name = value.Interface().(string) + case "irismod.nft.Denom.schema": x.Schema = value.Interface().(string) - case "irismod.nft.DenomMetadata.mint_restricted": + case "irismod.nft.Denom.creator": + x.Creator = value.Interface().(string) + case "irismod.nft.Denom.symbol": + x.Symbol = value.Interface().(string) + case "irismod.nft.Denom.mint_restricted": x.MintRestricted = value.Bool() - case "irismod.nft.DenomMetadata.update_restricted": + case "irismod.nft.Denom.update_restricted": x.UpdateRestricted = value.Bool() - case "irismod.nft.DenomMetadata.data": + case "irismod.nft.Denom.description": + x.Description = value.Interface().(string) + case "irismod.nft.Denom.uri": + x.Uri = value.Interface().(string) + case "irismod.nft.Denom.uri_hash": + x.UriHash = value.Interface().(string) + case "irismod.nft.Denom.data": x.Data = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.DenomMetadata")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) } - panic(fmt.Errorf("message irismod.nft.DenomMetadata does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) } } @@ -2521,56 +1099,80 @@ func (x *fastReflection_DenomMetadata) Set(fd protoreflect.FieldDescriptor, valu // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DenomMetadata) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Denom) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "irismod.nft.DenomMetadata.creator": - panic(fmt.Errorf("field creator of message irismod.nft.DenomMetadata is not mutable")) - case "irismod.nft.DenomMetadata.schema": - panic(fmt.Errorf("field schema of message irismod.nft.DenomMetadata is not mutable")) - case "irismod.nft.DenomMetadata.mint_restricted": - panic(fmt.Errorf("field mint_restricted of message irismod.nft.DenomMetadata is not mutable")) - case "irismod.nft.DenomMetadata.update_restricted": - panic(fmt.Errorf("field update_restricted of message irismod.nft.DenomMetadata is not mutable")) - case "irismod.nft.DenomMetadata.data": - panic(fmt.Errorf("field data of message irismod.nft.DenomMetadata is not mutable")) + case "irismod.nft.Denom.id": + panic(fmt.Errorf("field id of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.name": + panic(fmt.Errorf("field name of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.schema": + panic(fmt.Errorf("field schema of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.creator": + panic(fmt.Errorf("field creator of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.symbol": + panic(fmt.Errorf("field symbol of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.mint_restricted": + panic(fmt.Errorf("field mint_restricted of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.update_restricted": + panic(fmt.Errorf("field update_restricted of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.description": + panic(fmt.Errorf("field description of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.uri": + panic(fmt.Errorf("field uri of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.uri_hash": + panic(fmt.Errorf("field uri_hash of message irismod.nft.Denom is not mutable")) + case "irismod.nft.Denom.data": + panic(fmt.Errorf("field data of message irismod.nft.Denom is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.DenomMetadata")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) } - panic(fmt.Errorf("message irismod.nft.DenomMetadata does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_DenomMetadata) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_Denom) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "irismod.nft.DenomMetadata.creator": + case "irismod.nft.Denom.id": + return protoreflect.ValueOfString("") + case "irismod.nft.Denom.name": + return protoreflect.ValueOfString("") + case "irismod.nft.Denom.schema": + return protoreflect.ValueOfString("") + case "irismod.nft.Denom.creator": return protoreflect.ValueOfString("") - case "irismod.nft.DenomMetadata.schema": + case "irismod.nft.Denom.symbol": return protoreflect.ValueOfString("") - case "irismod.nft.DenomMetadata.mint_restricted": + case "irismod.nft.Denom.mint_restricted": return protoreflect.ValueOfBool(false) - case "irismod.nft.DenomMetadata.update_restricted": + case "irismod.nft.Denom.update_restricted": return protoreflect.ValueOfBool(false) - case "irismod.nft.DenomMetadata.data": + case "irismod.nft.Denom.description": + return protoreflect.ValueOfString("") + case "irismod.nft.Denom.uri": + return protoreflect.ValueOfString("") + case "irismod.nft.Denom.uri_hash": + return protoreflect.ValueOfString("") + case "irismod.nft.Denom.data": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.DenomMetadata")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.Denom")) } - panic(fmt.Errorf("message irismod.nft.DenomMetadata does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.Denom does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_DenomMetadata) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_Denom) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in irismod.nft.DenomMetadata", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in irismod.nft.Denom", d.FullName())) } panic("unreachable") } @@ -2578,7 +1180,7 @@ func (x *fastReflection_DenomMetadata) WhichOneof(d protoreflect.OneofDescriptor // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_DenomMetadata) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_Denom) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -2589,7 +1191,7 @@ func (x *fastReflection_DenomMetadata) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_DenomMetadata) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_Denom) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -2601,7 +1203,7 @@ func (x *fastReflection_DenomMetadata) SetUnknown(fields protoreflect.RawFields) // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_DenomMetadata) IsValid() bool { +func (x *fastReflection_Denom) IsValid() bool { return x != nil } @@ -2611,9 +1213,9 @@ func (x *fastReflection_DenomMetadata) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_Denom) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*DenomMetadata) + x := input.Message.Interface().(*Denom) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2625,7 +1227,11 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Creator) + l = len(x.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Name) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -2633,12 +1239,32 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Creator) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Symbol) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.MintRestricted { n += 2 } if x.UpdateRestricted { n += 2 } + l = len(x.Description) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Uri) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.UriHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } l = len(x.Data) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -2653,7 +1279,7 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*DenomMetadata) + x := input.Message.Interface().(*Denom) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2677,7 +1303,28 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.Data) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Data))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x5a + } + if len(x.UriHash) > 0 { + i -= len(x.UriHash) + copy(dAtA[i:], x.UriHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UriHash))) + i-- + dAtA[i] = 0x52 + } + if len(x.Uri) > 0 { + i -= len(x.Uri) + copy(dAtA[i:], x.Uri) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Uri))) + i-- + dAtA[i] = 0x4a + } + if len(x.Description) > 0 { + i -= len(x.Description) + copy(dAtA[i:], x.Description) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Description))) + i-- + dAtA[i] = 0x42 } if x.UpdateRestricted { i-- @@ -2687,7 +1334,7 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { dAtA[i] = 0 } i-- - dAtA[i] = 0x20 + dAtA[i] = 0x38 } if x.MintRestricted { i-- @@ -2697,19 +1344,40 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { dAtA[i] = 0 } i-- - dAtA[i] = 0x18 + dAtA[i] = 0x30 + } + if len(x.Symbol) > 0 { + i -= len(x.Symbol) + copy(dAtA[i:], x.Symbol) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Symbol))) + i-- + dAtA[i] = 0x2a + } + if len(x.Creator) > 0 { + i -= len(x.Creator) + copy(dAtA[i:], x.Creator) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Creator))) + i-- + dAtA[i] = 0x22 } if len(x.Schema) > 0 { i -= len(x.Schema) copy(dAtA[i:], x.Schema) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Schema))) i-- + dAtA[i] = 0x1a + } + if len(x.Name) > 0 { + i -= len(x.Name) + copy(dAtA[i:], x.Name) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Name))) + i-- dAtA[i] = 0x12 } - if len(x.Creator) > 0 { - i -= len(x.Creator) - copy(dAtA[i:], x.Creator) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Creator))) + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) i-- dAtA[i] = 0xa } @@ -2724,7 +1392,7 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*DenomMetadata) + x := input.Message.Interface().(*Denom) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2743,26 +1411,122 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Denom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Denom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DenomMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DenomMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + x.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) } @@ -2794,9 +1558,9 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { } x.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2824,9 +1588,9 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Schema = string(dAtA[iNdEx:postIndex]) + x.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 6: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MintRestricted", wireType) } @@ -2846,7 +1610,7 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { } } x.MintRestricted = bool(v != 0) - case 4: + case 7: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UpdateRestricted", wireType) } @@ -2866,7 +1630,103 @@ func (x *fastReflection_DenomMetadata) ProtoMethods() *protoiface.Methods { } } x.UpdateRestricted = bool(v != 0) - case 5: + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } @@ -3001,7 +1861,7 @@ func (x *IDCollection) ProtoReflect() protoreflect.Message { } func (x *IDCollection) slowProtoReflect() protoreflect.Message { - mi := &file_irismod_nft_nft_proto_msgTypes[4] + mi := &file_irismod_nft_nft_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3550,7 +2410,7 @@ func (x *Owner) ProtoReflect() protoreflect.Message { } func (x *Owner) slowProtoReflect() protoreflect.Message { - mi := &file_irismod_nft_nft_proto_msgTypes[5] + mi := &file_irismod_nft_nft_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4108,7 +2968,7 @@ func (x *Collection) ProtoReflect() protoreflect.Message { } func (x *Collection) slowProtoReflect() protoreflect.Message { - mi := &file_irismod_nft_nft_proto_msgTypes[6] + mi := &file_irismod_nft_nft_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4697,49 +3557,6 @@ func (x *BaseNFT) GetUriHash() string { return "" } -type NFTMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *NFTMetadata) Reset() { - *x = NFTMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_irismod_nft_nft_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NFTMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NFTMetadata) ProtoMessage() {} - -// Deprecated: Use NFTMetadata.ProtoReflect.Descriptor instead. -func (*NFTMetadata) Descriptor() ([]byte, []int) { - return file_irismod_nft_nft_proto_rawDescGZIP(), []int{1} -} - -func (x *NFTMetadata) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NFTMetadata) GetData() string { - if x != nil { - return x.Data - } - return "" -} - // Denom defines a type of NFT type Denom struct { state protoimpl.MessageState @@ -4762,7 +3579,7 @@ type Denom struct { func (x *Denom) Reset() { *x = Denom{} if protoimpl.UnsafeEnabled { - mi := &file_irismod_nft_nft_proto_msgTypes[2] + mi := &file_irismod_nft_nft_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4776,7 +3593,7 @@ func (*Denom) ProtoMessage() {} // Deprecated: Use Denom.ProtoReflect.Descriptor instead. func (*Denom) Descriptor() ([]byte, []int) { - return file_irismod_nft_nft_proto_rawDescGZIP(), []int{2} + return file_irismod_nft_nft_proto_rawDescGZIP(), []int{1} } func (x *Denom) GetId() string { @@ -4856,73 +3673,6 @@ func (x *Denom) GetData() string { return "" } -type DenomMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Schema string `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - MintRestricted bool `protobuf:"varint,3,opt,name=mint_restricted,json=mintRestricted,proto3" json:"mint_restricted,omitempty"` - UpdateRestricted bool `protobuf:"varint,4,opt,name=update_restricted,json=updateRestricted,proto3" json:"update_restricted,omitempty"` - Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *DenomMetadata) Reset() { - *x = DenomMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_irismod_nft_nft_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DenomMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DenomMetadata) ProtoMessage() {} - -// Deprecated: Use DenomMetadata.ProtoReflect.Descriptor instead. -func (*DenomMetadata) Descriptor() ([]byte, []int) { - return file_irismod_nft_nft_proto_rawDescGZIP(), []int{3} -} - -func (x *DenomMetadata) GetCreator() string { - if x != nil { - return x.Creator - } - return "" -} - -func (x *DenomMetadata) GetSchema() string { - if x != nil { - return x.Schema - } - return "" -} - -func (x *DenomMetadata) GetMintRestricted() bool { - if x != nil { - return x.MintRestricted - } - return false -} - -func (x *DenomMetadata) GetUpdateRestricted() bool { - if x != nil { - return x.UpdateRestricted - } - return false -} - -func (x *DenomMetadata) GetData() string { - if x != nil { - return x.Data - } - return "" -} - // IDCollection defines a type of collection with specified ID type IDCollection struct { state protoimpl.MessageState @@ -4936,7 +3686,7 @@ type IDCollection struct { func (x *IDCollection) Reset() { *x = IDCollection{} if protoimpl.UnsafeEnabled { - mi := &file_irismod_nft_nft_proto_msgTypes[4] + mi := &file_irismod_nft_nft_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4950,7 +3700,7 @@ func (*IDCollection) ProtoMessage() {} // Deprecated: Use IDCollection.ProtoReflect.Descriptor instead. func (*IDCollection) Descriptor() ([]byte, []int) { - return file_irismod_nft_nft_proto_rawDescGZIP(), []int{4} + return file_irismod_nft_nft_proto_rawDescGZIP(), []int{2} } func (x *IDCollection) GetDenomId() string { @@ -4980,7 +3730,7 @@ type Owner struct { func (x *Owner) Reset() { *x = Owner{} if protoimpl.UnsafeEnabled { - mi := &file_irismod_nft_nft_proto_msgTypes[5] + mi := &file_irismod_nft_nft_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4994,7 +3744,7 @@ func (*Owner) ProtoMessage() {} // Deprecated: Use Owner.ProtoReflect.Descriptor instead. func (*Owner) Descriptor() ([]byte, []int) { - return file_irismod_nft_nft_proto_rawDescGZIP(), []int{5} + return file_irismod_nft_nft_proto_rawDescGZIP(), []int{3} } func (x *Owner) GetAddress() string { @@ -5024,7 +3774,7 @@ type Collection struct { func (x *Collection) Reset() { *x = Collection{} if protoimpl.UnsafeEnabled { - mi := &file_irismod_nft_nft_proto_msgTypes[6] + mi := &file_irismod_nft_nft_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5038,7 +3788,7 @@ func (*Collection) ProtoMessage() {} // Deprecated: Use Collection.ProtoReflect.Descriptor instead. func (*Collection) Descriptor() ([]byte, []int) { - return file_irismod_nft_nft_proto_rawDescGZIP(), []int{6} + return file_irismod_nft_nft_proto_rawDescGZIP(), []int{4} } func (x *Collection) GetDenom() *Denom { @@ -5071,75 +3821,60 @@ var file_irismod_nft_nft_proto_rawDesc = []byte{ 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x72, 0x69, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x72, 0x69, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, - 0x22, 0x3b, 0x0a, 0x0b, 0x4e, 0x46, 0x54, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xb4, 0x02, - 0x0a, 0x05, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x72, 0x65, - 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x12, 0x2b, - 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, - 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x72, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, - 0x19, 0x0a, 0x08, 0x75, 0x72, 0x69, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x75, 0x72, 0x69, 0x48, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x04, - 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0xb1, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x74, - 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x22, 0xb4, 0x02, 0x0a, 0x05, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x74, + 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x74, - 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x77, 0x0a, 0x0c, 0x49, 0x44, 0x43, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, - 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, - 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x14, 0xf2, 0xde, 0x1f, - 0x10, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x73, - 0x22, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, - 0x01, 0x22, 0x8f, 0x01, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x66, 0x0a, 0x0e, 0x69, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x49, 0x44, 0x43, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xc8, 0xde, 0x1f, 0x00, 0xe2, 0xde, - 0x1f, 0x0d, 0x49, 0x44, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xf2, - 0xde, 0x1f, 0x0b, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x69, 0x64, 0x63, 0x73, 0x22, 0x52, 0x0d, - 0x69, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x04, 0xe8, - 0xa0, 0x1f, 0x01, 0x22, 0x7a, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x2e, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x44, - 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x12, 0x36, 0x0a, 0x04, 0x6e, 0x66, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x42, 0x61, - 0x73, 0x65, 0x4e, 0x46, 0x54, 0x42, 0x0c, 0xc8, 0xde, 0x1f, 0x00, 0xe2, 0xde, 0x1f, 0x04, 0x4e, - 0x46, 0x54, 0x73, 0x52, 0x04, 0x6e, 0x66, 0x74, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x42, - 0x8e, 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x72, 0x69, 0x73, - 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x42, 0x08, 0x4e, 0x66, 0x74, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x6d, 0x6f, 0x64, 0x73, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6e, 0x65, - 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, - 0x64, 0x2f, 0x6e, 0x66, 0x74, 0xa2, 0x02, 0x03, 0x49, 0x4e, 0x58, 0xaa, 0x02, 0x0b, 0x49, 0x72, - 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x4e, 0x66, 0x74, 0xca, 0x02, 0x0b, 0x49, 0x72, 0x69, 0x73, - 0x6d, 0x6f, 0x64, 0x5c, 0x4e, 0x66, 0x74, 0xe2, 0x02, 0x17, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, - 0x64, 0x5c, 0x4e, 0x66, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0xea, 0x02, 0x0c, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x3a, 0x3a, 0x4e, 0x66, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, + 0x72, 0x69, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x72, 0x69, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x72, 0x69, 0x48, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x22, 0x77, 0x0a, 0x0c, 0x49, 0x44, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x14, 0xf2, 0xde, 0x1f, 0x10, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x73, 0x22, + 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, + 0x22, 0x8f, 0x01, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x66, 0x0a, 0x0e, 0x69, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x69, + 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x49, 0x44, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x24, 0xc8, 0xde, 0x1f, 0x00, 0xe2, 0xde, 0x1f, + 0x0d, 0x49, 0x44, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xf2, 0xde, + 0x1f, 0x0b, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x69, 0x64, 0x63, 0x73, 0x22, 0x52, 0x0d, 0x69, + 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x04, 0xe8, 0xa0, + 0x1f, 0x01, 0x22, 0x7a, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x2e, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x44, 0x65, + 0x6e, 0x6f, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x12, 0x36, 0x0a, 0x04, 0x6e, 0x66, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x42, 0x61, 0x73, + 0x65, 0x4e, 0x46, 0x54, 0x42, 0x0c, 0xc8, 0xde, 0x1f, 0x00, 0xe2, 0xde, 0x1f, 0x04, 0x4e, 0x46, + 0x54, 0x73, 0x52, 0x04, 0x6e, 0x66, 0x74, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0x8e, + 0x01, 0xc8, 0xe1, 0x1e, 0x00, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, + 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x42, 0x08, 0x4e, 0x66, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x20, 0x6d, 0x6f, 0x64, 0x73, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6e, 0x65, 0x74, + 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x2f, 0x6e, 0x66, 0x74, 0xa2, 0x02, 0x03, 0x49, 0x4e, 0x58, 0xaa, 0x02, 0x0b, 0x49, 0x72, 0x69, + 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x4e, 0x66, 0x74, 0xca, 0x02, 0x0b, 0x49, 0x72, 0x69, 0x73, 0x6d, + 0x6f, 0x64, 0x5c, 0x4e, 0x66, 0x74, 0xe2, 0x02, 0x17, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x5c, 0x4e, 0x66, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0c, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x3a, 0x3a, 0x4e, 0x66, 0x74, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5154,19 +3889,17 @@ func file_irismod_nft_nft_proto_rawDescGZIP() []byte { return file_irismod_nft_nft_proto_rawDescData } -var file_irismod_nft_nft_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_irismod_nft_nft_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_irismod_nft_nft_proto_goTypes = []interface{}{ - (*BaseNFT)(nil), // 0: irismod.nft.BaseNFT - (*NFTMetadata)(nil), // 1: irismod.nft.NFTMetadata - (*Denom)(nil), // 2: irismod.nft.Denom - (*DenomMetadata)(nil), // 3: irismod.nft.DenomMetadata - (*IDCollection)(nil), // 4: irismod.nft.IDCollection - (*Owner)(nil), // 5: irismod.nft.Owner - (*Collection)(nil), // 6: irismod.nft.Collection + (*BaseNFT)(nil), // 0: irismod.nft.BaseNFT + (*Denom)(nil), // 1: irismod.nft.Denom + (*IDCollection)(nil), // 2: irismod.nft.IDCollection + (*Owner)(nil), // 3: irismod.nft.Owner + (*Collection)(nil), // 4: irismod.nft.Collection } var file_irismod_nft_nft_proto_depIdxs = []int32{ - 4, // 0: irismod.nft.Owner.id_collections:type_name -> irismod.nft.IDCollection - 2, // 1: irismod.nft.Collection.denom:type_name -> irismod.nft.Denom + 2, // 0: irismod.nft.Owner.id_collections:type_name -> irismod.nft.IDCollection + 1, // 1: irismod.nft.Collection.denom:type_name -> irismod.nft.Denom 0, // 2: irismod.nft.Collection.nfts:type_name -> irismod.nft.BaseNFT 3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method input_type @@ -5194,18 +3927,6 @@ func file_irismod_nft_nft_proto_init() { } } file_irismod_nft_nft_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NFTMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_irismod_nft_nft_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Denom); i { case 0: return &v.state @@ -5217,19 +3938,7 @@ func file_irismod_nft_nft_proto_init() { return nil } } - file_irismod_nft_nft_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DenomMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_irismod_nft_nft_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_irismod_nft_nft_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IDCollection); i { case 0: return &v.state @@ -5241,7 +3950,7 @@ func file_irismod_nft_nft_proto_init() { return nil } } - file_irismod_nft_nft_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_irismod_nft_nft_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Owner); i { case 0: return &v.state @@ -5253,7 +3962,7 @@ func file_irismod_nft_nft_proto_init() { return nil } } - file_irismod_nft_nft_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_irismod_nft_nft_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Collection); i { case 0: return &v.state @@ -5272,7 +3981,7 @@ func file_irismod_nft_nft_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_irismod_nft_nft_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, diff --git a/api/irismod/nft/query.pulsar.go b/api/irismod/nft/query.pulsar.go index 045a770b..328b1231 100644 --- a/api/irismod/nft/query.pulsar.go +++ b/api/irismod/nft/query.pulsar.go @@ -904,29 +904,29 @@ func (x *fastReflection_QuerySupplyResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryNFTsOfOwnerRequest protoreflect.MessageDescriptor - fd_QueryNFTsOfOwnerRequest_denom_id protoreflect.FieldDescriptor - fd_QueryNFTsOfOwnerRequest_owner protoreflect.FieldDescriptor - fd_QueryNFTsOfOwnerRequest_pagination protoreflect.FieldDescriptor + md_QueryOwnerRequest protoreflect.MessageDescriptor + fd_QueryOwnerRequest_denom_id protoreflect.FieldDescriptor + fd_QueryOwnerRequest_owner protoreflect.FieldDescriptor + fd_QueryOwnerRequest_pagination protoreflect.FieldDescriptor ) func init() { file_irismod_nft_query_proto_init() - md_QueryNFTsOfOwnerRequest = File_irismod_nft_query_proto.Messages().ByName("QueryNFTsOfOwnerRequest") - fd_QueryNFTsOfOwnerRequest_denom_id = md_QueryNFTsOfOwnerRequest.Fields().ByName("denom_id") - fd_QueryNFTsOfOwnerRequest_owner = md_QueryNFTsOfOwnerRequest.Fields().ByName("owner") - fd_QueryNFTsOfOwnerRequest_pagination = md_QueryNFTsOfOwnerRequest.Fields().ByName("pagination") + md_QueryOwnerRequest = File_irismod_nft_query_proto.Messages().ByName("QueryOwnerRequest") + fd_QueryOwnerRequest_denom_id = md_QueryOwnerRequest.Fields().ByName("denom_id") + fd_QueryOwnerRequest_owner = md_QueryOwnerRequest.Fields().ByName("owner") + fd_QueryOwnerRequest_pagination = md_QueryOwnerRequest.Fields().ByName("pagination") } -var _ protoreflect.Message = (*fastReflection_QueryNFTsOfOwnerRequest)(nil) +var _ protoreflect.Message = (*fastReflection_QueryOwnerRequest)(nil) -type fastReflection_QueryNFTsOfOwnerRequest QueryNFTsOfOwnerRequest +type fastReflection_QueryOwnerRequest QueryOwnerRequest -func (x *QueryNFTsOfOwnerRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryNFTsOfOwnerRequest)(x) +func (x *QueryOwnerRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryOwnerRequest)(x) } -func (x *QueryNFTsOfOwnerRequest) slowProtoReflect() protoreflect.Message { +func (x *QueryOwnerRequest) slowProtoReflect() protoreflect.Message { mi := &file_irismod_nft_query_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -938,43 +938,43 @@ func (x *QueryNFTsOfOwnerRequest) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryNFTsOfOwnerRequest_messageType fastReflection_QueryNFTsOfOwnerRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryNFTsOfOwnerRequest_messageType{} +var _fastReflection_QueryOwnerRequest_messageType fastReflection_QueryOwnerRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryOwnerRequest_messageType{} -type fastReflection_QueryNFTsOfOwnerRequest_messageType struct{} +type fastReflection_QueryOwnerRequest_messageType struct{} -func (x fastReflection_QueryNFTsOfOwnerRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryNFTsOfOwnerRequest)(nil) +func (x fastReflection_QueryOwnerRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryOwnerRequest)(nil) } -func (x fastReflection_QueryNFTsOfOwnerRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryNFTsOfOwnerRequest) +func (x fastReflection_QueryOwnerRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryOwnerRequest) } -func (x fastReflection_QueryNFTsOfOwnerRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryNFTsOfOwnerRequest +func (x fastReflection_QueryOwnerRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryOwnerRequest } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryNFTsOfOwnerRequest +func (x *fastReflection_QueryOwnerRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryOwnerRequest } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryNFTsOfOwnerRequest_messageType +func (x *fastReflection_QueryOwnerRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryOwnerRequest_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryNFTsOfOwnerRequest) New() protoreflect.Message { - return new(fastReflection_QueryNFTsOfOwnerRequest) +func (x *fastReflection_QueryOwnerRequest) New() protoreflect.Message { + return new(fastReflection_QueryOwnerRequest) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Interface() protoreflect.ProtoMessage { - return (*QueryNFTsOfOwnerRequest)(x) +func (x *fastReflection_QueryOwnerRequest) Interface() protoreflect.ProtoMessage { + return (*QueryOwnerRequest)(x) } // Range iterates over every populated field in an undefined order, @@ -982,22 +982,22 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) Interface() protoreflect.ProtoM // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryOwnerRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.DenomId != "" { value := protoreflect.ValueOfString(x.DenomId) - if !f(fd_QueryNFTsOfOwnerRequest_denom_id, value) { + if !f(fd_QueryOwnerRequest_denom_id, value) { return } } if x.Owner != "" { value := protoreflect.ValueOfString(x.Owner) - if !f(fd_QueryNFTsOfOwnerRequest_owner, value) { + if !f(fd_QueryOwnerRequest_owner, value) { return } } if x.Pagination != nil { value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryNFTsOfOwnerRequest_pagination, value) { + if !f(fd_QueryOwnerRequest_pagination, value) { return } } @@ -1014,19 +1014,19 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) Range(f func(protoreflect.Field // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryOwnerRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerRequest.denom_id": + case "irismod.nft.QueryOwnerRequest.denom_id": return x.DenomId != "" - case "irismod.nft.QueryNFTsOfOwnerRequest.owner": + case "irismod.nft.QueryOwnerRequest.owner": return x.Owner != "" - case "irismod.nft.QueryNFTsOfOwnerRequest.pagination": + case "irismod.nft.QueryOwnerRequest.pagination": return x.Pagination != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerRequest")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerRequest does not contain field %s", fd.FullName())) } } @@ -1036,19 +1036,19 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) Has(fd protoreflect.FieldDescri // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryOwnerRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerRequest.denom_id": + case "irismod.nft.QueryOwnerRequest.denom_id": x.DenomId = "" - case "irismod.nft.QueryNFTsOfOwnerRequest.owner": + case "irismod.nft.QueryOwnerRequest.owner": x.Owner = "" - case "irismod.nft.QueryNFTsOfOwnerRequest.pagination": + case "irismod.nft.QueryOwnerRequest.pagination": x.Pagination = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerRequest")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerRequest does not contain field %s", fd.FullName())) } } @@ -1058,22 +1058,22 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) Clear(fd protoreflect.FieldDesc // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryOwnerRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "irismod.nft.QueryNFTsOfOwnerRequest.denom_id": + case "irismod.nft.QueryOwnerRequest.denom_id": value := x.DenomId return protoreflect.ValueOfString(value) - case "irismod.nft.QueryNFTsOfOwnerRequest.owner": + case "irismod.nft.QueryOwnerRequest.owner": value := x.Owner return protoreflect.ValueOfString(value) - case "irismod.nft.QueryNFTsOfOwnerRequest.pagination": + case "irismod.nft.QueryOwnerRequest.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerRequest")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerRequest does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerRequest does not contain field %s", descriptor.FullName())) } } @@ -1087,19 +1087,19 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) Get(descriptor protoreflect.Fie // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryOwnerRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerRequest.denom_id": + case "irismod.nft.QueryOwnerRequest.denom_id": x.DenomId = value.Interface().(string) - case "irismod.nft.QueryNFTsOfOwnerRequest.owner": + case "irismod.nft.QueryOwnerRequest.owner": x.Owner = value.Interface().(string) - case "irismod.nft.QueryNFTsOfOwnerRequest.pagination": + case "irismod.nft.QueryOwnerRequest.pagination": x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerRequest")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerRequest does not contain field %s", fd.FullName())) } } @@ -1113,52 +1113,52 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) Set(fd protoreflect.FieldDescri // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryNFTsOfOwnerRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryOwnerRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerRequest.pagination": + case "irismod.nft.QueryOwnerRequest.pagination": if x.Pagination == nil { x.Pagination = new(v1beta1.PageRequest) } return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - case "irismod.nft.QueryNFTsOfOwnerRequest.denom_id": - panic(fmt.Errorf("field denom_id of message irismod.nft.QueryNFTsOfOwnerRequest is not mutable")) - case "irismod.nft.QueryNFTsOfOwnerRequest.owner": - panic(fmt.Errorf("field owner of message irismod.nft.QueryNFTsOfOwnerRequest is not mutable")) + case "irismod.nft.QueryOwnerRequest.denom_id": + panic(fmt.Errorf("field denom_id of message irismod.nft.QueryOwnerRequest is not mutable")) + case "irismod.nft.QueryOwnerRequest.owner": + panic(fmt.Errorf("field owner of message irismod.nft.QueryOwnerRequest is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerRequest")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerRequest does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryNFTsOfOwnerRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryOwnerRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerRequest.denom_id": + case "irismod.nft.QueryOwnerRequest.denom_id": return protoreflect.ValueOfString("") - case "irismod.nft.QueryNFTsOfOwnerRequest.owner": + case "irismod.nft.QueryOwnerRequest.owner": return protoreflect.ValueOfString("") - case "irismod.nft.QueryNFTsOfOwnerRequest.pagination": + case "irismod.nft.QueryOwnerRequest.pagination": m := new(v1beta1.PageRequest) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerRequest")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerRequest")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerRequest does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerRequest does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryNFTsOfOwnerRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryOwnerRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in irismod.nft.QueryNFTsOfOwnerRequest", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in irismod.nft.QueryOwnerRequest", d.FullName())) } panic("unreachable") } @@ -1166,7 +1166,7 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) WhichOneof(d protoreflect.Oneof // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryNFTsOfOwnerRequest) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryOwnerRequest) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1177,7 +1177,7 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) GetUnknown() protoreflect.RawFi // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryNFTsOfOwnerRequest) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryOwnerRequest) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1189,7 +1189,7 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) SetUnknown(fields protoreflect. // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_QueryNFTsOfOwnerRequest) IsValid() bool { +func (x *fastReflection_QueryOwnerRequest) IsValid() bool { return x != nil } @@ -1199,9 +1199,9 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryNFTsOfOwnerRequest) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryOwnerRequest) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryNFTsOfOwnerRequest) + x := input.Message.Interface().(*QueryOwnerRequest) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1235,7 +1235,7 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) ProtoMethods() *protoiface.Meth } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryNFTsOfOwnerRequest) + x := input.Message.Interface().(*QueryOwnerRequest) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1293,7 +1293,7 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) ProtoMethods() *protoiface.Meth }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryNFTsOfOwnerRequest) + x := input.Message.Interface().(*QueryOwnerRequest) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1325,10 +1325,10 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) ProtoMethods() *protoiface.Meth fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryNFTsOfOwnerRequest: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryOwnerRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryNFTsOfOwnerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryOwnerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1467,27 +1467,27 @@ func (x *fastReflection_QueryNFTsOfOwnerRequest) ProtoMethods() *protoiface.Meth } var ( - md_QueryNFTsOfOwnerResponse protoreflect.MessageDescriptor - fd_QueryNFTsOfOwnerResponse_owner protoreflect.FieldDescriptor - fd_QueryNFTsOfOwnerResponse_pagination protoreflect.FieldDescriptor + md_QueryOwnerResponse protoreflect.MessageDescriptor + fd_QueryOwnerResponse_owner protoreflect.FieldDescriptor + fd_QueryOwnerResponse_pagination protoreflect.FieldDescriptor ) func init() { file_irismod_nft_query_proto_init() - md_QueryNFTsOfOwnerResponse = File_irismod_nft_query_proto.Messages().ByName("QueryNFTsOfOwnerResponse") - fd_QueryNFTsOfOwnerResponse_owner = md_QueryNFTsOfOwnerResponse.Fields().ByName("owner") - fd_QueryNFTsOfOwnerResponse_pagination = md_QueryNFTsOfOwnerResponse.Fields().ByName("pagination") + md_QueryOwnerResponse = File_irismod_nft_query_proto.Messages().ByName("QueryOwnerResponse") + fd_QueryOwnerResponse_owner = md_QueryOwnerResponse.Fields().ByName("owner") + fd_QueryOwnerResponse_pagination = md_QueryOwnerResponse.Fields().ByName("pagination") } -var _ protoreflect.Message = (*fastReflection_QueryNFTsOfOwnerResponse)(nil) +var _ protoreflect.Message = (*fastReflection_QueryOwnerResponse)(nil) -type fastReflection_QueryNFTsOfOwnerResponse QueryNFTsOfOwnerResponse +type fastReflection_QueryOwnerResponse QueryOwnerResponse -func (x *QueryNFTsOfOwnerResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryNFTsOfOwnerResponse)(x) +func (x *QueryOwnerResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryOwnerResponse)(x) } -func (x *QueryNFTsOfOwnerResponse) slowProtoReflect() protoreflect.Message { +func (x *QueryOwnerResponse) slowProtoReflect() protoreflect.Message { mi := &file_irismod_nft_query_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1499,43 +1499,43 @@ func (x *QueryNFTsOfOwnerResponse) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_QueryNFTsOfOwnerResponse_messageType fastReflection_QueryNFTsOfOwnerResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryNFTsOfOwnerResponse_messageType{} +var _fastReflection_QueryOwnerResponse_messageType fastReflection_QueryOwnerResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryOwnerResponse_messageType{} -type fastReflection_QueryNFTsOfOwnerResponse_messageType struct{} +type fastReflection_QueryOwnerResponse_messageType struct{} -func (x fastReflection_QueryNFTsOfOwnerResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryNFTsOfOwnerResponse)(nil) +func (x fastReflection_QueryOwnerResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryOwnerResponse)(nil) } -func (x fastReflection_QueryNFTsOfOwnerResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryNFTsOfOwnerResponse) +func (x fastReflection_QueryOwnerResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryOwnerResponse) } -func (x fastReflection_QueryNFTsOfOwnerResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryNFTsOfOwnerResponse +func (x fastReflection_QueryOwnerResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryOwnerResponse } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryNFTsOfOwnerResponse +func (x *fastReflection_QueryOwnerResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryOwnerResponse } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryNFTsOfOwnerResponse_messageType +func (x *fastReflection_QueryOwnerResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryOwnerResponse_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryNFTsOfOwnerResponse) New() protoreflect.Message { - return new(fastReflection_QueryNFTsOfOwnerResponse) +func (x *fastReflection_QueryOwnerResponse) New() protoreflect.Message { + return new(fastReflection_QueryOwnerResponse) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Interface() protoreflect.ProtoMessage { - return (*QueryNFTsOfOwnerResponse)(x) +func (x *fastReflection_QueryOwnerResponse) Interface() protoreflect.ProtoMessage { + return (*QueryOwnerResponse)(x) } // Range iterates over every populated field in an undefined order, @@ -1543,16 +1543,16 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) Interface() protoreflect.Proto // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_QueryOwnerResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Owner != nil { value := protoreflect.ValueOfMessage(x.Owner.ProtoReflect()) - if !f(fd_QueryNFTsOfOwnerResponse_owner, value) { + if !f(fd_QueryOwnerResponse_owner, value) { return } } if x.Pagination != nil { value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - if !f(fd_QueryNFTsOfOwnerResponse_pagination, value) { + if !f(fd_QueryOwnerResponse_pagination, value) { return } } @@ -1569,17 +1569,17 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) Range(f func(protoreflect.Fiel // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_QueryOwnerResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerResponse.owner": + case "irismod.nft.QueryOwnerResponse.owner": return x.Owner != nil - case "irismod.nft.QueryNFTsOfOwnerResponse.pagination": + case "irismod.nft.QueryOwnerResponse.pagination": return x.Pagination != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerResponse")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerResponse does not contain field %s", fd.FullName())) } } @@ -1589,17 +1589,17 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) Has(fd protoreflect.FieldDescr // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_QueryOwnerResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerResponse.owner": + case "irismod.nft.QueryOwnerResponse.owner": x.Owner = nil - case "irismod.nft.QueryNFTsOfOwnerResponse.pagination": + case "irismod.nft.QueryOwnerResponse.pagination": x.Pagination = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerResponse")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerResponse does not contain field %s", fd.FullName())) } } @@ -1609,19 +1609,19 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) Clear(fd protoreflect.FieldDes // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryOwnerResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "irismod.nft.QueryNFTsOfOwnerResponse.owner": + case "irismod.nft.QueryOwnerResponse.owner": value := x.Owner return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "irismod.nft.QueryNFTsOfOwnerResponse.pagination": + case "irismod.nft.QueryOwnerResponse.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerResponse")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerResponse does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerResponse does not contain field %s", descriptor.FullName())) } } @@ -1635,17 +1635,17 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) Get(descriptor protoreflect.Fi // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_QueryOwnerResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerResponse.owner": + case "irismod.nft.QueryOwnerResponse.owner": x.Owner = value.Message().Interface().(*Owner) - case "irismod.nft.QueryNFTsOfOwnerResponse.pagination": + case "irismod.nft.QueryOwnerResponse.pagination": x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerResponse")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerResponse does not contain field %s", fd.FullName())) } } @@ -1659,52 +1659,52 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) Set(fd protoreflect.FieldDescr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryNFTsOfOwnerResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryOwnerResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerResponse.owner": + case "irismod.nft.QueryOwnerResponse.owner": if x.Owner == nil { x.Owner = new(Owner) } return protoreflect.ValueOfMessage(x.Owner.ProtoReflect()) - case "irismod.nft.QueryNFTsOfOwnerResponse.pagination": + case "irismod.nft.QueryOwnerResponse.pagination": if x.Pagination == nil { x.Pagination = new(v1beta1.PageResponse) } return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerResponse")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerResponse does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryNFTsOfOwnerResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_QueryOwnerResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "irismod.nft.QueryNFTsOfOwnerResponse.owner": + case "irismod.nft.QueryOwnerResponse.owner": m := new(Owner) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "irismod.nft.QueryNFTsOfOwnerResponse.pagination": + case "irismod.nft.QueryOwnerResponse.pagination": m := new(v1beta1.PageResponse) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryNFTsOfOwnerResponse")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.nft.QueryOwnerResponse")) } - panic(fmt.Errorf("message irismod.nft.QueryNFTsOfOwnerResponse does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message irismod.nft.QueryOwnerResponse does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryNFTsOfOwnerResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_QueryOwnerResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in irismod.nft.QueryNFTsOfOwnerResponse", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in irismod.nft.QueryOwnerResponse", d.FullName())) } panic("unreachable") } @@ -1712,7 +1712,7 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) WhichOneof(d protoreflect.Oneo // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryNFTsOfOwnerResponse) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_QueryOwnerResponse) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -1723,7 +1723,7 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) GetUnknown() protoreflect.RawF // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryNFTsOfOwnerResponse) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_QueryOwnerResponse) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -1735,7 +1735,7 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) SetUnknown(fields protoreflect // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_QueryNFTsOfOwnerResponse) IsValid() bool { +func (x *fastReflection_QueryOwnerResponse) IsValid() bool { return x != nil } @@ -1745,9 +1745,9 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_QueryNFTsOfOwnerResponse) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_QueryOwnerResponse) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryNFTsOfOwnerResponse) + x := input.Message.Interface().(*QueryOwnerResponse) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1777,7 +1777,7 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) ProtoMethods() *protoiface.Met } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryNFTsOfOwnerResponse) + x := input.Message.Interface().(*QueryOwnerResponse) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1835,7 +1835,7 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) ProtoMethods() *protoiface.Met }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryNFTsOfOwnerResponse) + x := input.Message.Interface().(*QueryOwnerResponse) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1867,10 +1867,10 @@ func (x *fastReflection_QueryNFTsOfOwnerResponse) ProtoMethods() *protoiface.Met fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryNFTsOfOwnerResponse: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryOwnerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryNFTsOfOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5868,9 +5868,8 @@ func (x *QuerySupplyResponse) GetAmount() uint64 { return 0 } -// QueryNFTsOfOwnerRequest is the request type for the Query/NFTsOfOwner RPC -// method -type QueryNFTsOfOwnerRequest struct { +// QueryOwnerRequest is the request type for the Query/Owner RPC method +type QueryOwnerRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -5881,8 +5880,8 @@ type QueryNFTsOfOwnerRequest struct { Pagination *v1beta1.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryNFTsOfOwnerRequest) Reset() { - *x = QueryNFTsOfOwnerRequest{} +func (x *QueryOwnerRequest) Reset() { + *x = QueryOwnerRequest{} if protoimpl.UnsafeEnabled { mi := &file_irismod_nft_query_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5890,41 +5889,40 @@ func (x *QueryNFTsOfOwnerRequest) Reset() { } } -func (x *QueryNFTsOfOwnerRequest) String() string { +func (x *QueryOwnerRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryNFTsOfOwnerRequest) ProtoMessage() {} +func (*QueryOwnerRequest) ProtoMessage() {} -// Deprecated: Use QueryNFTsOfOwnerRequest.ProtoReflect.Descriptor instead. -func (*QueryNFTsOfOwnerRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryOwnerRequest.ProtoReflect.Descriptor instead. +func (*QueryOwnerRequest) Descriptor() ([]byte, []int) { return file_irismod_nft_query_proto_rawDescGZIP(), []int{2} } -func (x *QueryNFTsOfOwnerRequest) GetDenomId() string { +func (x *QueryOwnerRequest) GetDenomId() string { if x != nil { return x.DenomId } return "" } -func (x *QueryNFTsOfOwnerRequest) GetOwner() string { +func (x *QueryOwnerRequest) GetOwner() string { if x != nil { return x.Owner } return "" } -func (x *QueryNFTsOfOwnerRequest) GetPagination() *v1beta1.PageRequest { +func (x *QueryOwnerRequest) GetPagination() *v1beta1.PageRequest { if x != nil { return x.Pagination } return nil } -// QueryNFTsOfOwnerResponse is the response type for the Query/NFTsOfOwner RPC -// method -type QueryNFTsOfOwnerResponse struct { +// QueryOwnerResponse is the response type for the Query/Owner RPC method +type QueryOwnerResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -5933,8 +5931,8 @@ type QueryNFTsOfOwnerResponse struct { Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (x *QueryNFTsOfOwnerResponse) Reset() { - *x = QueryNFTsOfOwnerResponse{} +func (x *QueryOwnerResponse) Reset() { + *x = QueryOwnerResponse{} if protoimpl.UnsafeEnabled { mi := &file_irismod_nft_query_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -5942,25 +5940,25 @@ func (x *QueryNFTsOfOwnerResponse) Reset() { } } -func (x *QueryNFTsOfOwnerResponse) String() string { +func (x *QueryOwnerResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryNFTsOfOwnerResponse) ProtoMessage() {} +func (*QueryOwnerResponse) ProtoMessage() {} -// Deprecated: Use QueryNFTsOfOwnerResponse.ProtoReflect.Descriptor instead. -func (*QueryNFTsOfOwnerResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use QueryOwnerResponse.ProtoReflect.Descriptor instead. +func (*QueryOwnerResponse) Descriptor() ([]byte, []int) { return file_irismod_nft_query_proto_rawDescGZIP(), []int{3} } -func (x *QueryNFTsOfOwnerResponse) GetOwner() *Owner { +func (x *QueryOwnerResponse) GetOwner() *Owner { if x != nil { return x.Owner } return nil } -func (x *QueryNFTsOfOwnerResponse) GetPagination() *v1beta1.PageResponse { +func (x *QueryOwnerResponse) GetPagination() *v1beta1.PageResponse { if x != nil { return x.Pagination } @@ -6312,138 +6310,135 @@ var file_irismod_nft_query_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb9, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4e, 0x46, 0x54, 0x73, 0x4f, 0x66, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x10, 0xf2, 0xde, 0x1f, 0x0c, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x22, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8d, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, - 0x54, 0x73, 0x4f, 0x66, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x4f, - 0x77, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x90, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x64, 0x12, - 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb3, 0x01, 0x0a, 0x11, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, + 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x26, + 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xf2, + 0xde, 0x1f, 0x0c, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x52, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x87, + 0x01, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, + 0x66, 0x74, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, + 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9b, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, - 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x0a, - 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x43, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, - 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xf2, 0xde, - 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, - 0x22, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x12, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x28, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x44, 0x65, - 0x6e, 0x6f, 0x6d, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x5c, 0x0a, 0x12, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x90, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, + 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9b, 0x01, 0x0a, 0x17, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x69, 0x72, + 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x30, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x44, - 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x71, 0x0a, 0x0f, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, + 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x43, 0x0a, 0x11, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x65, 0x6e, 0x6f, - 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x2e, - 0x0a, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x22, 0x43, - 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x03, 0x6e, 0x66, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x42, 0x61, - 0x73, 0x65, 0x4e, 0x46, 0x54, 0x42, 0x07, 0xe2, 0xde, 0x1f, 0x03, 0x4e, 0x46, 0x54, 0x52, 0x03, - 0x6e, 0x66, 0x74, 0x32, 0xe4, 0x05, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x82, 0x01, - 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x1f, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, - 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x72, 0x69, 0x73, - 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x6e, 0x66, - 0x74, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, - 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x3d, 0x2a, 0x2a, 0x7d, 0x2f, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x79, 0x12, 0x75, 0x0a, 0x0b, 0x4e, 0x46, 0x54, 0x73, 0x4f, 0x66, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x24, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x73, 0x4f, 0x66, 0x4f, 0x77, 0x6e, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, - 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x73, 0x4f, - 0x66, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, - 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x6e, 0x66, 0x74, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x43, 0x6f, - 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, - 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x69, 0x72, - 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x3d, - 0x2a, 0x2a, 0x7d, 0x12, 0x68, 0x0a, 0x06, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x1f, 0x2e, - 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, - 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, - 0x6f, 0x64, 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x73, 0x0a, - 0x05, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1e, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, - 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, - 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, - 0x21, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x64, 0x65, - 0x6e, 0x6f, 0x6d, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x3d, 0x2a, - 0x2a, 0x7d, 0x12, 0x76, 0x0a, 0x03, 0x4e, 0x46, 0x54, 0x12, 0x1c, 0x2e, 0x69, 0x72, 0x69, 0x73, - 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, - 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, - 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x6e, 0x66, 0x74, - 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x3d, 0x2a, 0x2a, 0x7d, 0x2f, - 0x7b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0x8c, 0x01, 0x0a, 0x0f, 0x63, - 0x6f, 0x6d, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x42, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x6d, 0x6f, - 0x64, 0x73, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6e, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x6e, 0x66, 0x74, 0xa2, 0x02, - 0x03, 0x49, 0x4e, 0x58, 0xaa, 0x02, 0x0b, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x4e, - 0x66, 0x74, 0xca, 0x02, 0x0b, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x5c, 0x4e, 0x66, 0x74, - 0xe2, 0x02, 0x17, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x5c, 0x4e, 0x66, 0x74, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x49, 0x72, 0x69, - 0x73, 0x6d, 0x6f, 0x64, 0x3a, 0x3a, 0x4e, 0x66, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0x3e, + 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, + 0x74, 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x5c, + 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x90, 0x01, 0x0a, + 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, + 0x66, 0x74, 0x2e, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x71, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x13, 0xf2, 0xde, 0x1f, 0x0f, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x07, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x49, 0x64, 0x22, 0x43, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x03, 0x6e, 0x66, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, + 0x74, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4e, 0x46, 0x54, 0x42, 0x07, 0xe2, 0xde, 0x1f, 0x03, 0x4e, + 0x46, 0x54, 0x52, 0x03, 0x6e, 0x66, 0x74, 0x32, 0xc5, 0x05, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x7f, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x1f, 0x2e, 0x69, 0x72, + 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x69, + 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x79, 0x12, 0x63, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x69, 0x72, + 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x69, 0x72, + 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x6e, + 0x66, 0x74, 0x2f, 0x6e, 0x66, 0x74, 0x73, 0x12, 0x84, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x69, 0x72, + 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x69, 0x72, 0x69, 0x73, + 0x6d, 0x6f, 0x64, 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x70, + 0x0a, 0x05, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x1e, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, + 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, + 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x6e, 0x6f, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, + 0x12, 0x1e, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x64, + 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x7d, + 0x12, 0x68, 0x0a, 0x06, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x69, 0x72, 0x69, + 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, + 0x6e, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x72, + 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, + 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, + 0x6e, 0x66, 0x74, 0x2f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x12, 0x73, 0x0a, 0x03, 0x4e, 0x46, + 0x54, 0x12, 0x1c, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x6e, 0x66, 0x74, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4e, 0x46, 0x54, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x12, 0x27, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x2f, 0x6e, 0x66, 0x74, 0x2f, 0x6e, 0x66, 0x74, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, + 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x42, + 0x8c, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, + 0x6e, 0x66, 0x74, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x20, 0x6d, 0x6f, 0x64, 0x73, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6e, 0x65, 0x74, 0x2e, + 0x6f, 0x72, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, + 0x6e, 0x66, 0x74, 0xa2, 0x02, 0x03, 0x49, 0x4e, 0x58, 0xaa, 0x02, 0x0b, 0x49, 0x72, 0x69, 0x73, + 0x6d, 0x6f, 0x64, 0x2e, 0x4e, 0x66, 0x74, 0xca, 0x02, 0x0b, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, + 0x64, 0x5c, 0x4e, 0x66, 0x74, 0xe2, 0x02, 0x17, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x5c, + 0x4e, 0x66, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0c, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x3a, 0x3a, 0x4e, 0x66, 0x74, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6460,29 +6455,29 @@ func file_irismod_nft_query_proto_rawDescGZIP() []byte { var file_irismod_nft_query_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_irismod_nft_query_proto_goTypes = []interface{}{ - (*QuerySupplyRequest)(nil), // 0: irismod.nft.QuerySupplyRequest - (*QuerySupplyResponse)(nil), // 1: irismod.nft.QuerySupplyResponse - (*QueryNFTsOfOwnerRequest)(nil), // 2: irismod.nft.QueryNFTsOfOwnerRequest - (*QueryNFTsOfOwnerResponse)(nil), // 3: irismod.nft.QueryNFTsOfOwnerResponse - (*QueryCollectionRequest)(nil), // 4: irismod.nft.QueryCollectionRequest - (*QueryCollectionResponse)(nil), // 5: irismod.nft.QueryCollectionResponse - (*QueryDenomRequest)(nil), // 6: irismod.nft.QueryDenomRequest - (*QueryDenomResponse)(nil), // 7: irismod.nft.QueryDenomResponse - (*QueryDenomsRequest)(nil), // 8: irismod.nft.QueryDenomsRequest - (*QueryDenomsResponse)(nil), // 9: irismod.nft.QueryDenomsResponse - (*QueryNFTRequest)(nil), // 10: irismod.nft.QueryNFTRequest - (*QueryNFTResponse)(nil), // 11: irismod.nft.QueryNFTResponse - (*v1beta1.PageRequest)(nil), // 12: cosmos.base.query.v1beta1.PageRequest - (*Owner)(nil), // 13: irismod.nft.Owner - (*v1beta1.PageResponse)(nil), // 14: cosmos.base.query.v1beta1.PageResponse - (*Collection)(nil), // 15: irismod.nft.Collection - (*Denom)(nil), // 16: irismod.nft.Denom - (*BaseNFT)(nil), // 17: irismod.nft.BaseNFT + (*QuerySupplyRequest)(nil), // 0: irismod.nft.QuerySupplyRequest + (*QuerySupplyResponse)(nil), // 1: irismod.nft.QuerySupplyResponse + (*QueryOwnerRequest)(nil), // 2: irismod.nft.QueryOwnerRequest + (*QueryOwnerResponse)(nil), // 3: irismod.nft.QueryOwnerResponse + (*QueryCollectionRequest)(nil), // 4: irismod.nft.QueryCollectionRequest + (*QueryCollectionResponse)(nil), // 5: irismod.nft.QueryCollectionResponse + (*QueryDenomRequest)(nil), // 6: irismod.nft.QueryDenomRequest + (*QueryDenomResponse)(nil), // 7: irismod.nft.QueryDenomResponse + (*QueryDenomsRequest)(nil), // 8: irismod.nft.QueryDenomsRequest + (*QueryDenomsResponse)(nil), // 9: irismod.nft.QueryDenomsResponse + (*QueryNFTRequest)(nil), // 10: irismod.nft.QueryNFTRequest + (*QueryNFTResponse)(nil), // 11: irismod.nft.QueryNFTResponse + (*v1beta1.PageRequest)(nil), // 12: cosmos.base.query.v1beta1.PageRequest + (*Owner)(nil), // 13: irismod.nft.Owner + (*v1beta1.PageResponse)(nil), // 14: cosmos.base.query.v1beta1.PageResponse + (*Collection)(nil), // 15: irismod.nft.Collection + (*Denom)(nil), // 16: irismod.nft.Denom + (*BaseNFT)(nil), // 17: irismod.nft.BaseNFT } var file_irismod_nft_query_proto_depIdxs = []int32{ - 12, // 0: irismod.nft.QueryNFTsOfOwnerRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 13, // 1: irismod.nft.QueryNFTsOfOwnerResponse.owner:type_name -> irismod.nft.Owner - 14, // 2: irismod.nft.QueryNFTsOfOwnerResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 12, // 0: irismod.nft.QueryOwnerRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 13, // 1: irismod.nft.QueryOwnerResponse.owner:type_name -> irismod.nft.Owner + 14, // 2: irismod.nft.QueryOwnerResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse 12, // 3: irismod.nft.QueryCollectionRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest 15, // 4: irismod.nft.QueryCollectionResponse.collection:type_name -> irismod.nft.Collection 14, // 5: irismod.nft.QueryCollectionResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse @@ -6492,16 +6487,16 @@ var file_irismod_nft_query_proto_depIdxs = []int32{ 14, // 9: irismod.nft.QueryDenomsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse 17, // 10: irismod.nft.QueryNFTResponse.nft:type_name -> irismod.nft.BaseNFT 0, // 11: irismod.nft.Query.Supply:input_type -> irismod.nft.QuerySupplyRequest - 2, // 12: irismod.nft.Query.NFTsOfOwner:input_type -> irismod.nft.QueryNFTsOfOwnerRequest + 2, // 12: irismod.nft.Query.Owner:input_type -> irismod.nft.QueryOwnerRequest 4, // 13: irismod.nft.Query.Collection:input_type -> irismod.nft.QueryCollectionRequest - 8, // 14: irismod.nft.Query.Denoms:input_type -> irismod.nft.QueryDenomsRequest - 6, // 15: irismod.nft.Query.Denom:input_type -> irismod.nft.QueryDenomRequest + 6, // 14: irismod.nft.Query.Denom:input_type -> irismod.nft.QueryDenomRequest + 8, // 15: irismod.nft.Query.Denoms:input_type -> irismod.nft.QueryDenomsRequest 10, // 16: irismod.nft.Query.NFT:input_type -> irismod.nft.QueryNFTRequest 1, // 17: irismod.nft.Query.Supply:output_type -> irismod.nft.QuerySupplyResponse - 3, // 18: irismod.nft.Query.NFTsOfOwner:output_type -> irismod.nft.QueryNFTsOfOwnerResponse + 3, // 18: irismod.nft.Query.Owner:output_type -> irismod.nft.QueryOwnerResponse 5, // 19: irismod.nft.Query.Collection:output_type -> irismod.nft.QueryCollectionResponse - 9, // 20: irismod.nft.Query.Denoms:output_type -> irismod.nft.QueryDenomsResponse - 7, // 21: irismod.nft.Query.Denom:output_type -> irismod.nft.QueryDenomResponse + 7, // 20: irismod.nft.Query.Denom:output_type -> irismod.nft.QueryDenomResponse + 9, // 21: irismod.nft.Query.Denoms:output_type -> irismod.nft.QueryDenomsResponse 11, // 22: irismod.nft.Query.NFT:output_type -> irismod.nft.QueryNFTResponse 17, // [17:23] is the sub-list for method output_type 11, // [11:17] is the sub-list for method input_type @@ -6542,7 +6537,7 @@ func file_irismod_nft_query_proto_init() { } } file_irismod_nft_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryNFTsOfOwnerRequest); i { + switch v := v.(*QueryOwnerRequest); i { case 0: return &v.state case 1: @@ -6554,7 +6549,7 @@ func file_irismod_nft_query_proto_init() { } } file_irismod_nft_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryNFTsOfOwnerResponse); i { + switch v := v.(*QueryOwnerResponse); i { case 0: return &v.state case 1: diff --git a/api/irismod/nft/query_grpc.pb.go b/api/irismod/nft/query_grpc.pb.go index 59e0da59..59ce7733 100644 --- a/api/irismod/nft/query_grpc.pb.go +++ b/api/irismod/nft/query_grpc.pb.go @@ -19,12 +19,12 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Supply_FullMethodName = "/irismod.nft.Query/Supply" - Query_NFTsOfOwner_FullMethodName = "/irismod.nft.Query/NFTsOfOwner" - Query_Collection_FullMethodName = "/irismod.nft.Query/Collection" - Query_Denoms_FullMethodName = "/irismod.nft.Query/Denoms" - Query_Denom_FullMethodName = "/irismod.nft.Query/Denom" - Query_NFT_FullMethodName = "/irismod.nft.Query/NFT" + Query_Supply_FullMethodName = "/irismod.nft.Query/Supply" + Query_Owner_FullMethodName = "/irismod.nft.Query/Owner" + Query_Collection_FullMethodName = "/irismod.nft.Query/Collection" + Query_Denom_FullMethodName = "/irismod.nft.Query/Denom" + Query_Denoms_FullMethodName = "/irismod.nft.Query/Denoms" + Query_NFT_FullMethodName = "/irismod.nft.Query/NFT" ) // QueryClient is the client API for Query service. @@ -33,14 +33,14 @@ const ( type QueryClient interface { // Supply queries the total supply of a given denom or owner Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) - // NFTsOfOwner queries the NFTs of the specified owner - NFTsOfOwner(ctx context.Context, in *QueryNFTsOfOwnerRequest, opts ...grpc.CallOption) (*QueryNFTsOfOwnerResponse, error) + // Owner queries the NFTs of the specified owner + Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) // Collection queries the NFTs of the specified denom Collection(ctx context.Context, in *QueryCollectionRequest, opts ...grpc.CallOption) (*QueryCollectionResponse, error) - // Denoms queries all the denoms - Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) // Denom queries the definition of a given denom Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) + // Denoms queries all the denoms + Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) // NFT queries the NFT for the given denom and token ID NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc.CallOption) (*QueryNFTResponse, error) } @@ -62,9 +62,9 @@ func (c *queryClient) Supply(ctx context.Context, in *QuerySupplyRequest, opts . return out, nil } -func (c *queryClient) NFTsOfOwner(ctx context.Context, in *QueryNFTsOfOwnerRequest, opts ...grpc.CallOption) (*QueryNFTsOfOwnerResponse, error) { - out := new(QueryNFTsOfOwnerResponse) - err := c.cc.Invoke(ctx, Query_NFTsOfOwner_FullMethodName, in, out, opts...) +func (c *queryClient) Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) { + out := new(QueryOwnerResponse) + err := c.cc.Invoke(ctx, Query_Owner_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -80,18 +80,18 @@ func (c *queryClient) Collection(ctx context.Context, in *QueryCollectionRequest return out, nil } -func (c *queryClient) Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) { - out := new(QueryDenomsResponse) - err := c.cc.Invoke(ctx, Query_Denoms_FullMethodName, in, out, opts...) +func (c *queryClient) Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) { + out := new(QueryDenomResponse) + err := c.cc.Invoke(ctx, Query_Denom_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) { - out := new(QueryDenomResponse) - err := c.cc.Invoke(ctx, Query_Denom_FullMethodName, in, out, opts...) +func (c *queryClient) Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) { + out := new(QueryDenomsResponse) + err := c.cc.Invoke(ctx, Query_Denoms_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -113,14 +113,14 @@ func (c *queryClient) NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc type QueryServer interface { // Supply queries the total supply of a given denom or owner Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) - // NFTsOfOwner queries the NFTs of the specified owner - NFTsOfOwner(context.Context, *QueryNFTsOfOwnerRequest) (*QueryNFTsOfOwnerResponse, error) + // Owner queries the NFTs of the specified owner + Owner(context.Context, *QueryOwnerRequest) (*QueryOwnerResponse, error) // Collection queries the NFTs of the specified denom Collection(context.Context, *QueryCollectionRequest) (*QueryCollectionResponse, error) - // Denoms queries all the denoms - Denoms(context.Context, *QueryDenomsRequest) (*QueryDenomsResponse, error) // Denom queries the definition of a given denom Denom(context.Context, *QueryDenomRequest) (*QueryDenomResponse, error) + // Denoms queries all the denoms + Denoms(context.Context, *QueryDenomsRequest) (*QueryDenomsResponse, error) // NFT queries the NFT for the given denom and token ID NFT(context.Context, *QueryNFTRequest) (*QueryNFTResponse, error) mustEmbedUnimplementedQueryServer() @@ -133,18 +133,18 @@ type UnimplementedQueryServer struct { func (UnimplementedQueryServer) Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Supply not implemented") } -func (UnimplementedQueryServer) NFTsOfOwner(context.Context, *QueryNFTsOfOwnerRequest) (*QueryNFTsOfOwnerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NFTsOfOwner not implemented") +func (UnimplementedQueryServer) Owner(context.Context, *QueryOwnerRequest) (*QueryOwnerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Owner not implemented") } func (UnimplementedQueryServer) Collection(context.Context, *QueryCollectionRequest) (*QueryCollectionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Collection not implemented") } -func (UnimplementedQueryServer) Denoms(context.Context, *QueryDenomsRequest) (*QueryDenomsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Denoms not implemented") -} func (UnimplementedQueryServer) Denom(context.Context, *QueryDenomRequest) (*QueryDenomResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Denom not implemented") } +func (UnimplementedQueryServer) Denoms(context.Context, *QueryDenomsRequest) (*QueryDenomsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Denoms not implemented") +} func (UnimplementedQueryServer) NFT(context.Context, *QueryNFTRequest) (*QueryNFTResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NFT not implemented") } @@ -179,20 +179,20 @@ func _Query_Supply_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_NFTsOfOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryNFTsOfOwnerRequest) +func _Query_Owner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOwnerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).NFTsOfOwner(ctx, in) + return srv.(QueryServer).Owner(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_NFTsOfOwner_FullMethodName, + FullMethod: Query_Owner_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).NFTsOfOwner(ctx, req.(*QueryNFTsOfOwnerRequest)) + return srv.(QueryServer).Owner(ctx, req.(*QueryOwnerRequest)) } return interceptor(ctx, in, info, handler) } @@ -215,38 +215,38 @@ func _Query_Collection_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Query_Denoms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomsRequest) +func _Query_Denom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Denoms(ctx, in) + return srv.(QueryServer).Denom(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_Denoms_FullMethodName, + FullMethod: Query_Denom_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Denoms(ctx, req.(*QueryDenomsRequest)) + return srv.(QueryServer).Denom(ctx, req.(*QueryDenomRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Denom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomRequest) +func _Query_Denoms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Denom(ctx, in) + return srv.(QueryServer).Denoms(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Query_Denom_FullMethodName, + FullMethod: Query_Denoms_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Denom(ctx, req.(*QueryDenomRequest)) + return srv.(QueryServer).Denoms(ctx, req.(*QueryDenomsRequest)) } return interceptor(ctx, in, info, handler) } @@ -281,21 +281,21 @@ var Query_ServiceDesc = grpc.ServiceDesc{ Handler: _Query_Supply_Handler, }, { - MethodName: "NFTsOfOwner", - Handler: _Query_NFTsOfOwner_Handler, + MethodName: "Owner", + Handler: _Query_Owner_Handler, }, { MethodName: "Collection", Handler: _Query_Collection_Handler, }, - { - MethodName: "Denoms", - Handler: _Query_Denoms_Handler, - }, { MethodName: "Denom", Handler: _Query_Denom_Handler, }, + { + MethodName: "Denoms", + Handler: _Query_Denoms_Handler, + }, { MethodName: "NFT", Handler: _Query_NFT_Handler, diff --git a/e2e/nft/query.go b/e2e/nft/query.go index 778263be..f84ccba9 100644 --- a/e2e/nft/query.go +++ b/e2e/nft/query.go @@ -144,10 +144,10 @@ func (s *QueryTestSuite) TestQueryCmd() { //------test GetCmdQueryOwner()------------- url = fmt.Sprintf("%s/irismod/nft/nfts?owner=%s", baseURL, from.String()) resp, err = testutil.GetRequest(url) - respType = proto.Message(&nfttypes.QueryNFTsOfOwnerResponse{}) + respType = proto.Message(&nfttypes.QueryOwnerResponse{}) s.Require().NoError(err) s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(resp, respType)) - ownerResp := respType.(*nfttypes.QueryNFTsOfOwnerResponse) + ownerResp := respType.(*nfttypes.QueryOwnerResponse) s.Require().Equal(from.String(), ownerResp.Owner.Address) s.Require().Equal(denomID, ownerResp.Owner.IDCollections[0].DenomId) s.Require().Equal(tokenID, ownerResp.Owner.IDCollections[0].TokenIds[0]) diff --git a/e2e/nft/test_helper.go b/e2e/nft/test_helper.go index 1a660263..a10cc1bd 100644 --- a/e2e/nft/test_helper.go +++ b/e2e/nft/test_helper.go @@ -213,7 +213,7 @@ func QueryOwnerExec(t *testing.T, clientCtx client.Context, address string, extraArgs ...string, -) *nfttypes.QueryNFTsOfOwnerResponse { +) *nfttypes.QueryOwnerResponse { t.Helper() args := []string{ address, @@ -221,7 +221,7 @@ func QueryOwnerExec(t *testing.T, } args = append(args, extraArgs...) - response := &nfttypes.QueryNFTsOfOwnerResponse{} + response := &nfttypes.QueryOwnerResponse{} network.ExecQueryCmd(t, clientCtx, nftcli.GetCmdQueryOwner(), args, response) return response } diff --git a/modules/nft/client/cli/query.go b/modules/nft/client/cli/query.go index 35e76a22..6cc0d33e 100644 --- a/modules/nft/client/cli/query.go +++ b/modules/nft/client/cli/query.go @@ -101,7 +101,7 @@ func GetCmdQueryOwner() *cobra.Command { return err } queryClient := types.NewQueryClient(clientCtx) - resp, err := queryClient.NFTsOfOwner(context.Background(), &types.QueryNFTsOfOwnerRequest{ + resp, err := queryClient.Owner(context.Background(), &types.QueryOwnerRequest{ DenomId: denomID, Owner: args[0], Pagination: pageReq, diff --git a/modules/nft/depinject.go b/modules/nft/depinject.go index bfe83971..0310d1bf 100644 --- a/modules/nft/depinject.go +++ b/modules/nft/depinject.go @@ -53,8 +53,6 @@ func ProvideModule(in Inputs) Outputs { keeper := keeper.NewKeeper( in.Cdc, in.Key, - in.AccountKeeper, - in.BankKeeper, ) m := NewAppModule(in.Cdc, keeper, in.AccountKeeper, in.BankKeeper) diff --git a/modules/nft/go.mod b/modules/nft/go.mod index 1facd1ca..9f9ccdf4 100644 --- a/modules/nft/go.mod +++ b/modules/nft/go.mod @@ -10,6 +10,7 @@ require ( github.com/cometbft/cometbft v0.37.4 github.com/cosmos/cosmos-sdk v0.47.9 github.com/cosmos/gogoproto v1.4.10 + github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.3 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.6.1 @@ -80,7 +81,6 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect diff --git a/modules/nft/keeper/collection.go b/modules/nft/keeper/collection.go index e79366b8..df0e8f11 100644 --- a/modules/nft/keeper/collection.go +++ b/modules/nft/keeper/collection.go @@ -1,15 +1,22 @@ package keeper import ( + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" + "mods.irisnet.org/modules/nft/exported" "mods.irisnet.org/modules/nft/types" ) -// SaveCollection saves all NFTs and returns an error if there already exists -func (k Keeper) SaveCollection(ctx sdk.Context, collection types.Collection) error { +// SetCollection saves all NFTs and returns an error if there already exists +func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection) error { for _, nft := range collection.NFTs { - if err := k.SaveNFT( + if err := k.MintNFT( ctx, collection.Denom.Id, nft.GetID(), @@ -25,30 +32,87 @@ func (k Keeper) SaveCollection(ctx sdk.Context, collection types.Collection) err return nil } -// GetCollections returns all the collections -func (k Keeper) GetCollections(ctx sdk.Context) (cs []types.Collection, err error) { - for _, class := range k.nk.GetClasses(ctx) { - nfts, err := k.GetNFTs(ctx, class.Id) - if err != nil { - return nil, err - } +// GetCollection returns the collection by the specified denom ID +func (k Keeper) GetCollection(ctx sdk.Context, denomID string) (types.Collection, error) { + denom, found := k.GetDenom(ctx, denomID) + if !found { + return types.Collection{}, sdkerrors.Wrapf(types.ErrInvalidDenom, "denomID %s not existed ", denomID) + } - denom, err := k.GetDenomInfo(ctx, class.Id) - if err != nil { - return nil, err - } + nfts := k.GetNFTs(ctx, denomID) + return types.NewCollection(denom, nfts), nil +} + +// GetPaginateCollection returns the collection by the specified denom ID +func (k Keeper) GetPaginateCollection(ctx sdk.Context, request *types.QueryCollectionRequest, denomID string) (types.Collection, *query.PageResponse, error) { + denom, found := k.GetDenom(ctx, denomID) + if !found { + return types.Collection{}, nil, sdkerrors.Wrapf(types.ErrInvalidDenom, "denomID %s not existed ", denomID) + } + var nfts []exported.NFT + store := ctx.KVStore(k.storeKey) + nftStore := prefix.NewStore(store, types.KeyNFT(denomID, "")) + pageRes, err := query.Paginate(nftStore, shapePageRequest(request.Pagination), func(key []byte, value []byte) error { + var baseNFT types.BaseNFT + k.cdc.MustUnmarshal(value, &baseNFT) + nfts = append(nfts, baseNFT) + return nil + }) + if err != nil { + return types.Collection{}, nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err) + } + return types.NewCollection(denom, nfts), pageRes, nil +} - cs = append(cs, types.NewCollection(*denom, nfts)) +// GetCollections returns all the collections +func (k Keeper) GetCollections(ctx sdk.Context) (cs []types.Collection) { + for _, denom := range k.GetDenoms(ctx) { + nfts := k.GetNFTs(ctx, denom.Id) + cs = append(cs, types.NewCollection(denom, nfts)) } - return cs, nil + return cs } -// GetTotalSupply returns the number of NFTs by the specified denom ID +// GetDenomSupply returns the number of NFTs by the specified denom ID func (k Keeper) GetTotalSupply(ctx sdk.Context, denomID string) uint64 { - return k.nk.GetTotalSupply(ctx, denomID) + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.KeyCollection(denomID)) + if len(bz) == 0 { + return 0 + } + return types.MustUnMarshalSupply(k.cdc, bz) +} + +// GetTotalSupplyOfOwner returns the amount of NFTs by the specified conditions +func (k Keeper) GetTotalSupplyOfOwner(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64) { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.KeyOwner(owner, id, "")) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + supply++ + } + return supply } -// GetBalance returns the amount of NFTs by the specified conditions -func (k Keeper) GetBalance(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64) { - return k.nk.GetBalance(ctx, id, owner) +func (k Keeper) increaseSupply(ctx sdk.Context, denomID string) { + supply := k.GetTotalSupply(ctx, denomID) + supply++ + + store := ctx.KVStore(k.storeKey) + bz := types.MustMarshalSupply(k.cdc, supply) + store.Set(types.KeyCollection(denomID), bz) } + +func (k Keeper) decreaseSupply(ctx sdk.Context, denomID string) { + supply := k.GetTotalSupply(ctx, denomID) + supply-- + + store := ctx.KVStore(k.storeKey) + if supply == 0 { + store.Delete(types.KeyCollection(denomID)) + return + } + + bz := types.MustMarshalSupply(k.cdc, supply) + store.Set(types.KeyCollection(denomID), bz) +} \ No newline at end of file diff --git a/modules/nft/keeper/collection_test.go b/modules/nft/keeper/collection_test.go index c1e5e096..52fc4271 100644 --- a/modules/nft/keeper/collection_test.go +++ b/modules/nft/keeper/collection_test.go @@ -25,7 +25,7 @@ func (suite *KeeperSuite) TestSetCollection() { NFTs: []types.BaseNFT{nft2, nft}, } - err := suite.keeper.SaveCollection(suite.ctx, collection2) + err := suite.keeper.SetCollection(suite.ctx, collection2) suite.Nil(err) msg, fail := keeper.SupplyInvariant(suite.keeper)(suite.ctx) @@ -34,7 +34,7 @@ func (suite *KeeperSuite) TestSetCollection() { func (suite *KeeperSuite) TestGetCollections() { // SaveNFT shouldn't fail when collection does not exist - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) msg, fail := keeper.SupplyInvariant(suite.keeper)(suite.ctx) @@ -43,15 +43,15 @@ func (suite *KeeperSuite) TestGetCollections() { func (suite *KeeperSuite) TestGetSupply() { // SaveNFT shouldn't fail when collection does not exist - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) // SaveNFT shouldn't fail when collection does not exist - err = suite.keeper.SaveNFT(suite.ctx, denomID, tokenID2, tokenNm2, tokenURI, tokenURIHash, tokenData, address2) + err = suite.keeper.MintNFT(suite.ctx, denomID, tokenID2, tokenNm2, tokenURI, tokenURIHash, tokenData, address2) suite.NoError(err) // SaveNFT shouldn't fail when collection does not exist - err = suite.keeper.SaveNFT(suite.ctx, denomID2, tokenID, tokenNm2, tokenURI, tokenURIHash, tokenData, address2) + err = suite.keeper.MintNFT(suite.ctx, denomID2, tokenID, tokenNm2, tokenURI, tokenURIHash, tokenData, address2) suite.NoError(err) supply := suite.keeper.GetTotalSupply(suite.ctx, denomID) @@ -60,10 +60,10 @@ func (suite *KeeperSuite) TestGetSupply() { supply = suite.keeper.GetTotalSupply(suite.ctx, denomID2) suite.Equal(uint64(1), supply) - supply = suite.keeper.GetBalance(suite.ctx, denomID, address) + supply = suite.keeper.GetTotalSupplyOfOwner(suite.ctx, denomID, address) suite.Equal(uint64(1), supply) - supply = suite.keeper.GetBalance(suite.ctx, denomID, address2) + supply = suite.keeper.GetTotalSupplyOfOwner(suite.ctx, denomID, address2) suite.Equal(uint64(1), supply) supply = suite.keeper.GetTotalSupply(suite.ctx, denomID) @@ -73,7 +73,7 @@ func (suite *KeeperSuite) TestGetSupply() { suite.Equal(uint64(1), supply) // burn nft - err = suite.keeper.RemoveNFT(suite.ctx, denomID, tokenID, address) + err = suite.keeper.BurnNFT(suite.ctx, denomID, tokenID, address) suite.NoError(err) supply = suite.keeper.GetTotalSupply(suite.ctx, denomID) @@ -83,7 +83,7 @@ func (suite *KeeperSuite) TestGetSupply() { suite.Equal(uint64(1), supply) // burn nft - err = suite.keeper.RemoveNFT(suite.ctx, denomID, tokenID2, address2) + err = suite.keeper.BurnNFT(suite.ctx, denomID, tokenID2, address2) suite.NoError(err) supply = suite.keeper.GetTotalSupply(suite.ctx, denomID) diff --git a/modules/nft/keeper/denom.go b/modules/nft/keeper/denom.go index f7b11ca6..ffb2e9ea 100644 --- a/modules/nft/keeper/denom.go +++ b/modules/nft/keeper/denom.go @@ -1,119 +1,66 @@ package keeper import ( - errorsmod "cosmossdk.io/errors" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/nft" "mods.irisnet.org/modules/nft/types" ) -// SaveDenom issues a denom according to the given params -func (k Keeper) SaveDenom(ctx sdk.Context, id, - name, - schema, - symbol string, - creator sdk.AccAddress, - mintRestricted, - updateRestricted bool, - description, - uri, - uriHash, - data string, -) error { - denomMetadata := &types.DenomMetadata{ - Creator: creator.String(), - Schema: schema, - MintRestricted: mintRestricted, - UpdateRestricted: updateRestricted, - Data: data, - } - metadata, err := codectypes.NewAnyWithValue(denomMetadata) - if err != nil { - return err - } - return k.nk.SaveClass(ctx, nft.Class{ - Id: id, - Name: name, - Symbol: symbol, - Description: description, - Uri: uri, - UriHash: uriHash, - Data: metadata, - }) +// HasDenom returns whether the specified denom ID exists +func (k Keeper) HasDenomID(ctx sdk.Context, id string) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.KeyDenomID(id)) } -// TransferDenomOwner transfers the ownership of the given denom to the new owner -func (k Keeper) TransferDenomOwner( - ctx sdk.Context, - denomID string, - srcOwner, - dstOwner sdk.AccAddress, -) error { - denom, err := k.GetDenomInfo(ctx, denomID) - if err != nil { - return err +// SetDenom is responsible for saving the definition of denom +func (k Keeper) SetDenom(ctx sdk.Context, denom types.Denom) error { + if k.HasDenomID(ctx, denom.Id) { + return sdkerrors.Wrapf(types.ErrInvalidDenom, "denomID %s has already exists", denom.Id) } - // authorize - if srcOwner.String() != denom.Creator { - return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to transfer denom %s", srcOwner.String(), denomID) - } + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&denom) + store.Set(types.KeyDenomID(denom.Id), bz) + store.Set(types.KeyDenomName(denom.Name), []byte(denom.Id)) + return nil +} - denomMetadata := &types.DenomMetadata{ - Creator: dstOwner.String(), - Schema: denom.Schema, - MintRestricted: denom.MintRestricted, - UpdateRestricted: denom.UpdateRestricted, - Data: denom.Data, - } - data, err := codectypes.NewAnyWithValue(denomMetadata) - if err != nil { - return err - } - class := nft.Class{ - Id: denom.Id, - Name: denom.Name, - Symbol: denom.Symbol, - Data: data, +// GetDenom returns the denom by id +func (k Keeper) GetDenom(ctx sdk.Context, id string) (denom types.Denom, found bool) { + store := ctx.KVStore(k.storeKey) - Description: denom.Description, - Uri: denom.Uri, - UriHash: denom.UriHash, + bz := store.Get(types.KeyDenomID(id)) + if len(bz) == 0 { + return denom, false } - return k.nk.UpdateClass(ctx, class) + k.cdc.MustUnmarshal(bz, &denom) + return denom, true } -// GetDenomInfo return the denom information -func (k Keeper) GetDenomInfo(ctx sdk.Context, denomID string) (*types.Denom, error) { - class, has := k.nk.GetClass(ctx, denomID) - if !has { - return nil, errorsmod.Wrapf(types.ErrInvalidDenom, "denom ID %s not exists", denomID) - } +// GetDenoms returns all the denoms +func (k Keeper) GetDenoms(ctx sdk.Context) (denoms []types.Denom) { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.KeyDenomID("")) + defer iterator.Close() - var denomMetadata types.DenomMetadata - if err := k.cdc.Unmarshal(class.Data.GetValue(), &denomMetadata); err != nil { - return nil, err + for ; iterator.Valid(); iterator.Next() { + var denom types.Denom + k.cdc.MustUnmarshal(iterator.Value(), &denom) + denoms = append(denoms, denom) } - return &types.Denom{ - Id: class.Id, - Name: class.Name, - Schema: denomMetadata.Schema, - Creator: denomMetadata.Creator, - Symbol: class.Symbol, - MintRestricted: denomMetadata.MintRestricted, - UpdateRestricted: denomMetadata.UpdateRestricted, - Description: class.Description, - Uri: class.Uri, - UriHash: class.UriHash, - Data: denomMetadata.Data, - }, nil + return denoms } -// HasDenom determine whether denom exists -func (k Keeper) HasDenom(ctx sdk.Context, denomID string) bool { - return k.nk.HasClass(ctx, denomID) -} +// UpdateDenom is responsible for updating the definition of denom +func (k Keeper) UpdateDenom(ctx sdk.Context, denom types.Denom) error { + if !k.HasDenomID(ctx, denom.Id) { + return sdkerrors.Wrapf(types.ErrInvalidDenom, "denomID %s not exists", denom.Id) + } + + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&denom) + store.Set(types.KeyDenomID(denom.Id), bz) + return nil +} \ No newline at end of file diff --git a/modules/nft/keeper/genesis.go b/modules/nft/keeper/genesis.go index 3b52dc03..cbfecfd3 100644 --- a/modules/nft/keeper/genesis.go +++ b/modules/nft/keeper/genesis.go @@ -13,27 +13,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { } for _, c := range data.Collections { - creator, err := sdk.AccAddressFromBech32(c.Denom.Creator) - if err != nil { + if err := k.SetDenom(ctx, c.Denom); err != nil { panic(err) } - if err := k.SaveDenom(ctx, - c.Denom.Id, - c.Denom.Name, - c.Denom.Schema, - c.Denom.Symbol, - creator, - c.Denom.MintRestricted, - c.Denom.UpdateRestricted, - c.Denom.Description, - c.Denom.Uri, - c.Denom.UriHash, - c.Denom.Data, - ); err != nil { - panic(err) - } - - if err := k.SaveCollection(ctx, c); err != nil { + if err := k.SetCollection(ctx, c); err != nil { panic(err) } } @@ -41,9 +24,5 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) { // ExportGenesis returns a GenesisState for a given context and keeper. func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { - collections, err := k.GetCollections(ctx) - if err != nil { - panic(err) - } - return types.NewGenesisState(collections) + return types.NewGenesisState(k.GetCollections(ctx)) } diff --git a/modules/nft/keeper/grpc_query.go b/modules/nft/keeper/grpc_query.go index 08feb7af..eb0a7c8b 100644 --- a/modules/nft/keeper/grpc_query.go +++ b/modules/nft/keeper/grpc_query.go @@ -3,9 +3,10 @@ package keeper import ( "context" - errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/nft" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -14,7 +15,10 @@ import ( var _ types.QueryServer = Keeper{} -// Supply queries the total supply of a given denom or owner +// Supply queries the total supply of a given denom or owner. +// +// The function takes a context and a QuerySupplyRequest as parameters. +// It returns a QuerySupplyResponse and an error. func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error) { ctx := sdk.UnwrapSDKContext(c) @@ -27,151 +31,165 @@ func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*t if err != nil { return nil, status.Errorf(codes.InvalidArgument, "invalid owner address %s", request.Owner) } - supply = k.GetBalance(ctx, request.DenomId, owner) + supply = k.GetTotalSupplyOfOwner(ctx, request.DenomId, owner) } return &types.QuerySupplyResponse{Amount: supply}, nil } -// NFTsOfOwner queries the NFTs of the specified owner -func (k Keeper) NFTsOfOwner(c context.Context, request *types.QueryNFTsOfOwnerRequest) (*types.QueryNFTsOfOwnerResponse, error) { - r := &nft.QueryNFTsRequest{ - ClassId: request.DenomId, - Owner: request.Owner, - Pagination: shapePageRequest(request.Pagination), - } +// Owner queries the NFTs of the specified owner. +// +// The function takes a context and a QueryOwnerRequest as parameters. +// It returns a QueryOwnerResponse and an error. +// +// The function first unwraps the context to get the SDK context. +// Then it converts the owner address from a Bech32 string to an SDK AccAddress. +// If the conversion fails, it returns an error. +// +// The function initializes an empty Owner struct with the owner address. +// It also initializes an empty map to store the token IDs. +// +// The function retrieves the store key and creates a new prefix store. +// It then paginates the NFT store using the provided pagination request. +// For each key-value pair in the store, it splits the key into the denom ID and token ID. +// If the denom ID is not provided in the request, it is extracted from the key. +// The function checks if the token ID is already present in the map. +// If it is, it appends the token ID to the existing list. +// Otherwise, it creates a new entry in the map and adds the token ID. +// +// After pagination, the function iterates over the IDCollections and assigns the corresponding token IDs. +// +// Finally, it returns a QueryOwnerResponse containing the Owner and the pagination result. +func (k Keeper) Owner(c context.Context, request *types.QueryOwnerRequest) (*types.QueryOwnerResponse, error) { + ctx := sdk.UnwrapSDKContext(c) - result, err := k.nk.NFTs(c, r) + ownerAddress, err := sdk.AccAddressFromBech32(request.Owner) if err != nil { - return nil, err + return nil, status.Errorf(codes.InvalidArgument, "invalid owner address %s", request.Owner) } - denomMap := make(map[string][]string) - var denoms []string - for _, token := range result.Nfts { - if denomMap[token.ClassId] == nil { - denomMap[token.ClassId] = []string{} - denoms = append(denoms, token.ClassId) - } - denomMap[token.ClassId] = append(denomMap[token.ClassId], token.Id) + owner := types.Owner{ + Address: ownerAddress.String(), + IDCollections: types.IDCollections{}, } - - var idc []types.IDCollection - for _, denomID := range denoms { - idc = append(idc, types.IDCollection{ - DenomId: denomID, - TokenIds: denomMap[denomID], - }) + idsMap := make(map[string][]string) + store := ctx.KVStore(k.storeKey) + nftStore := prefix.NewStore(store, types.KeyOwner(ownerAddress, request.DenomId, "")) + pageRes, err := query.Paginate(nftStore, shapePageRequest(request.Pagination), func(key []byte, value []byte) error { + denomID := request.DenomId + tokenID := string(key) + if len(request.DenomId) == 0 { + denomID, tokenID, _ = types.SplitKeyDenom(key) + } + if ids, ok := idsMap[denomID]; ok { + idsMap[denomID] = append(ids, tokenID) + } else { + idsMap[denomID] = []string{tokenID} + owner.IDCollections = append( + owner.IDCollections, + types.IDCollection{DenomId: denomID}, + ) + } + return nil + }) + if err != nil { + return nil, err } - - response := &types.QueryNFTsOfOwnerResponse{ - Owner: &types.Owner{ - Address: request.Owner, - IDCollections: idc, - }, - Pagination: result.Pagination, + for i := 0; i < len(owner.IDCollections); i++ { + owner.IDCollections[i].TokenIds = idsMap[owner.IDCollections[i].DenomId] } - - return response, nil + return &types.QueryOwnerResponse{Owner: &owner, Pagination: pageRes}, nil } -// Collection queries the NFTs of the specified denom +// Collection retrieves a collection based on the given QueryCollectionRequest. +// +// Parameters: +// - c: The context.Context object. +// - request: The QueryCollectionRequest object. +// +// Returns: +// - *types.QueryCollectionResponse: The QueryCollectionResponse object. +// - error: An error if any occurred. func (k Keeper) Collection(c context.Context, request *types.QueryCollectionRequest) (*types.QueryCollectionResponse, error) { ctx := sdk.UnwrapSDKContext(c) - denom, err := k.GetDenomInfo(ctx, request.DenomId) - if err != nil { - return nil, err - } - r := &nft.QueryNFTsRequest{ - ClassId: request.DenomId, - Pagination: shapePageRequest(request.Pagination), - } - - result, err := k.nk.NFTs(c, r) + collection, pageRes, err := k.GetPaginateCollection(ctx, request, request.DenomId) if err != nil { return nil, err } - - var nfts []types.BaseNFT - for _, token := range result.Nfts { - owner := k.nk.GetOwner(ctx, request.DenomId, token.Id) - - nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, token.Data.GetValue()) - if err != nil { - return nil, err - } - - nfts = append(nfts, types.BaseNFT{ - Id: token.Id, - URI: token.Uri, - UriHash: token.UriHash, - Name: nftMetadata.Name, - Owner: owner.String(), - Data: nftMetadata.Data, - }) - } - - collection := &types.Collection{ - Denom: *denom, - NFTs: nfts, - } - - response := &types.QueryCollectionResponse{ - Collection: collection, - Pagination: result.Pagination, - } - - return response, nil + return &types.QueryCollectionResponse{Collection: &collection, Pagination: pageRes}, nil } -// Denom queries the definition of a given denom +// Denom retrieves a denom based on the given QueryDenomRequest. +// +// Parameters: +// - c: The context.Context object. +// - request: The QueryDenomRequest object. +// +// Returns: +// - *types.QueryDenomResponse: The QueryDenomResponse object. +// - error: An error if the denom ID does not exist. func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error) { ctx := sdk.UnwrapSDKContext(c) - denom, err := k.GetDenomInfo(ctx, request.DenomId) - if err != nil { - return nil, err + + denomObject, found := k.GetDenom(ctx, request.DenomId) + if !found { + return nil, sdkerrors.Wrapf(types.ErrInvalidDenom, "denom ID %s not exists", request.DenomId) } - return &types.QueryDenomResponse{Denom: denom}, nil + + return &types.QueryDenomResponse{Denom: &denomObject}, nil } -// Denoms queries all the denoms +// Denoms retrieves a list of denoms based on the given QueryDenomsRequest. +// +// Parameters: +// - c: The context.Context object. +// - req: The QueryDenomsRequest object. +// +// Returns: +// - *types.QueryDenomsResponse: The QueryDenomsResponse object. +// - error: An error if the pagination is invalid. func (k Keeper) Denoms(c context.Context, req *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - result, err := k.nk.Classes(c, &nft.QueryClassesRequest{ - Pagination: shapePageRequest(req.Pagination), + var denoms []types.Denom + store := ctx.KVStore(k.storeKey) + denomStore := prefix.NewStore(store, types.KeyDenomID("")) + pageRes, err := query.Paginate(denomStore, shapePageRequest(req.Pagination), func(key []byte, value []byte) error { + var denom types.Denom + k.cdc.MustUnmarshal(value, &denom) + denoms = append(denoms, denom) + return nil }) if err != nil { - return nil, err - } - - var denoms []types.Denom - for _, denom := range result.Classes { - denom, err := k.GetDenomInfo(ctx, denom.Id) - if err != nil { - return nil, err - } - denoms = append(denoms, *denom) + return nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err) } return &types.QueryDenomsResponse{ Denoms: denoms, - Pagination: result.Pagination, + Pagination: pageRes, }, nil } -// NFT queries the NFT for the given denom and token ID +// NFT retrieves an NFT based on the given QueryNFTRequest. +// +// Parameters: +// - c: The context.Context object. +// - request: The QueryNFTRequest object. +// +// Returns: +// - *types.QueryNFTResponse: The QueryNFTResponse object. +// - error: An error if the NFT is not found or has an invalid type. func (k Keeper) NFT(c context.Context, request *types.QueryNFTRequest) (*types.QueryNFTResponse, error) { ctx := sdk.UnwrapSDKContext(c) nft, err := k.GetNFT(ctx, request.DenomId, request.TokenId) if err != nil { - return nil, errorsmod.Wrapf(types.ErrUnknownNFT, "invalid NFT %s from collection %s", request.TokenId, request.DenomId) + return nil, sdkerrors.Wrapf(types.ErrUnknownNFT, "invalid NFT %s from collection %s", request.TokenId, request.DenomId) } baseNFT, ok := nft.(types.BaseNFT) if !ok { - return nil, errorsmod.Wrapf(types.ErrUnknownNFT, "invalid type NFT %s from collection %s", request.TokenId, request.DenomId) + return nil, sdkerrors.Wrapf(types.ErrUnknownNFT, "invalid type NFT %s from collection %s", request.TokenId, request.DenomId) } return &types.QueryNFTResponse{NFT: &baseNFT}, nil diff --git a/modules/nft/keeper/grpc_query_test.go b/modules/nft/keeper/grpc_query_test.go index 65e20fe0..ff486dc9 100644 --- a/modules/nft/keeper/grpc_query_test.go +++ b/modules/nft/keeper/grpc_query_test.go @@ -7,7 +7,7 @@ import ( ) func (suite *KeeperSuite) TestSupply() { - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) response, err := suite.queryClient.Supply(gocontext.Background(), &types.QuerySupplyRequest{ @@ -20,10 +20,10 @@ func (suite *KeeperSuite) TestSupply() { } func (suite *KeeperSuite) TestOwner() { - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) - response, err := suite.queryClient.NFTsOfOwner(gocontext.Background(), &types.QueryNFTsOfOwnerRequest{ + response, err := suite.queryClient.Owner(gocontext.Background(), &types.QueryOwnerRequest{ DenomId: denomID, Owner: address.String(), }) @@ -34,7 +34,7 @@ func (suite *KeeperSuite) TestOwner() { } func (suite *KeeperSuite) TestCollection() { - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) response, err := suite.queryClient.Collection(gocontext.Background(), &types.QueryCollectionRequest{ @@ -48,7 +48,7 @@ func (suite *KeeperSuite) TestCollection() { } func (suite *KeeperSuite) TestDenom() { - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) response, err := suite.queryClient.Denom(gocontext.Background(), &types.QueryDenomRequest{ @@ -61,7 +61,7 @@ func (suite *KeeperSuite) TestDenom() { } func (suite *KeeperSuite) TestDenoms() { - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) response, err := suite.queryClient.Denoms(gocontext.Background(), &types.QueryDenomsRequest{}) @@ -72,7 +72,7 @@ func (suite *KeeperSuite) TestDenoms() { } func (suite *KeeperSuite) TestNFT() { - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) response, err := suite.queryClient.NFT(gocontext.Background(), &types.QueryNFTRequest{ diff --git a/modules/nft/keeper/invariants.go b/modules/nft/keeper/invariants.go index 7bbaf23e..6706ae66 100644 --- a/modules/nft/keeper/invariants.go +++ b/modules/nft/keeper/invariants.go @@ -22,11 +22,7 @@ func SupplyInvariant(k Keeper) sdk.Invariant { var msg string count := 0 - collections, err := k.GetCollections(ctx) - if err != nil { - panic(err) - } - + collections := k.GetCollections(ctx) for _, collection := range collections { ownersCollectionsSupply[collection.Denom.Id] = uint64(len(collection.NFTs)) } diff --git a/modules/nft/keeper/keeper.go b/modules/nft/keeper/keeper.go index b8b5314f..9fb7a712 100644 --- a/modules/nft/keeper/keeper.go +++ b/modules/nft/keeper/keeper.go @@ -7,8 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/nft" - nftkeeper "github.com/cosmos/cosmos-sdk/x/nft/keeper" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "mods.irisnet.org/modules/nft/types" ) @@ -17,28 +16,191 @@ import ( type Keeper struct { storeKey storetypes.StoreKey // Unexposed key to access store from sdk.Context cdc codec.Codec - nk nftkeeper.Keeper } // NewKeeper creates a new instance of the NFT Keeper -func NewKeeper(cdc codec.Codec, - storeKey storetypes.StoreKey, - ak nft.AccountKeeper, - bk nft.BankKeeper, -) Keeper { +func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey) Keeper { return Keeper{ storeKey: storeKey, cdc: cdc, - nk: nftkeeper.NewKeeper(storeKey, cdc, ak, bk), } } -// NFTkeeper returns a cosmos-sdk nftkeeper.Keeper. -func (k Keeper) NFTkeeper() nftkeeper.Keeper { - return k.nk -} - // Logger returns a module-specific logger. func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("irismod/%s", types.ModuleName)) } + +// IssueDenom issues a denom according to the given params +func (k Keeper) IssueDenom(ctx sdk.Context, + id, name, schema, symbol string, + creator sdk.AccAddress, + mintRestricted, updateRestricted bool, + description, uri, uriHash, data string, +) error { + return k.SetDenom(ctx, types.Denom{ + Id: id, + Name: name, + Schema: schema, + Creator: creator.String(), + Symbol: symbol, + MintRestricted: mintRestricted, + UpdateRestricted: updateRestricted, + Description: description, + Uri: uri, + UriHash: uriHash, + Data: data, + }) +} + +// MintNFT mints an NFT and manages the NFT's existence within Collections and Owners +func (k Keeper) MintNFT( + ctx sdk.Context, denomID, tokenID, tokenNm, + tokenURI, uriHash, tokenData string, owner sdk.AccAddress, +) error { + if k.HasNFT(ctx, denomID, tokenID) { + return sdkerrors.Wrapf(types.ErrNFTAlreadyExists, "NFT %s already exists in collection %s", tokenID, denomID) + } + + k.setNFT( + ctx, denomID, + types.NewBaseNFT( + tokenID, + tokenNm, + owner, + tokenURI, + uriHash, + tokenData, + ), + ) + k.setOwner(ctx, denomID, tokenID, owner) + k.increaseSupply(ctx, denomID) + + return nil +} + +// EditNFT updates an already existing NFT +func (k Keeper) EditNFT( + ctx sdk.Context, denomID, tokenID, tokenNm, + tokenURI, tokenURIHash, tokenData string, owner sdk.AccAddress, +) error { + denom, found := k.GetDenom(ctx, denomID) + if !found { + return sdkerrors.Wrapf(types.ErrInvalidDenom, "denom ID %s not exists", denomID) + } + + if denom.UpdateRestricted { + // if true , nobody can update the NFT under this denom + return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "nobody can update the NFT under this denom %s", denom.Id) + } + + // just the owner of NFT can edit + nft, err := k.Authorize(ctx, denomID, tokenID, owner) + if err != nil { + return err + } + + if types.Modified(tokenNm) { + nft.Name = tokenNm + } + + if types.Modified(tokenURI) { + nft.URI = tokenURI + } + + if types.Modified(tokenURIHash) { + nft.UriHash = tokenURIHash + } + + if types.Modified(tokenData) { + nft.Data = tokenData + } + + k.setNFT(ctx, denomID, nft) + + return nil +} + +// TransferOwner transfers the ownership of the given NFT to the new owner +func (k Keeper) TransferOwner( + ctx sdk.Context, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, + tokenData string, srcOwner, dstOwner sdk.AccAddress, +) error { + denom, found := k.GetDenom(ctx, denomID) + if !found { + return sdkerrors.Wrapf(types.ErrInvalidDenom, "denom ID %s not exists", denomID) + } + + if denom.UpdateRestricted && (types.Modified(tokenNm) || + types.Modified(tokenURI) || + types.Modified(tokenData) || + types.Modified(tokenURIHash)) { + return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "It is restricted to update NFT under this denom %s", denom.Id) + } + + nft, err := k.Authorize(ctx, denomID, tokenID, srcOwner) + if err != nil { + return err + } + + nft.Owner = dstOwner.String() + + if types.Modified(tokenNm) { + nft.Name = tokenNm + } + if types.Modified(tokenURI) { + nft.URI = tokenURI + } + if types.Modified(tokenURIHash) { + nft.UriHash = tokenURIHash + } + if types.Modified(tokenData) { + nft.Data = tokenData + } + + k.setNFT(ctx, denomID, nft) + k.swapOwner(ctx, denomID, tokenID, srcOwner, dstOwner) + return nil +} + +// BurnNFT deletes a specified NFT +func (k Keeper) BurnNFT(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error { + if !k.HasDenomID(ctx, denomID) { + return sdkerrors.Wrapf(types.ErrInvalidDenom, "denom ID %s not exists", denomID) + } + + nft, err := k.Authorize(ctx, denomID, tokenID, owner) + if err != nil { + return err + } + + k.deleteNFT(ctx, denomID, nft) + k.deleteOwner(ctx, denomID, tokenID, owner) + k.decreaseSupply(ctx, denomID) + + return nil +} + +// TransferDenomOwner transfers the ownership of the given denom to the new owner +func (k Keeper) TransferDenomOwner( + ctx sdk.Context, denomID string, srcOwner, dstOwner sdk.AccAddress, +) error { + denom, found := k.GetDenom(ctx, denomID) + if !found { + return sdkerrors.Wrapf(types.ErrInvalidDenom, "denom ID %s not exists", denomID) + } + + // authorize + if srcOwner.String() != denom.Creator { + return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to transfer denom %s", srcOwner.String(), denomID) + } + + denom.Creator = dstOwner.String() + + err := k.UpdateDenom(ctx, denom) + if err != nil { + return err + } + + return nil +} diff --git a/modules/nft/keeper/keeper_test.go b/modules/nft/keeper/keeper_test.go index 55529986..224dff47 100644 --- a/modules/nft/keeper/keeper_test.go +++ b/modules/nft/keeper/keeper_test.go @@ -81,7 +81,7 @@ func (suite *KeeperSuite) SetupTest() { types.RegisterQueryServer(queryHelper, suite.keeper) suite.queryClient = types.NewQueryClient(queryHelper) - err := suite.keeper.SaveDenom( + err := suite.keeper.IssueDenom( suite.ctx, denomID, denomNm, @@ -98,7 +98,7 @@ func (suite *KeeperSuite) SetupTest() { suite.NoError(err) // SaveNFT shouldn't fail when collection does not exist - err = suite.keeper.SaveDenom( + err = suite.keeper.IssueDenom( suite.ctx, denomID2, denomNm2, @@ -114,7 +114,7 @@ func (suite *KeeperSuite) SetupTest() { ) suite.NoError(err) - err = suite.keeper.SaveDenom( + err = suite.keeper.IssueDenom( suite.ctx, denomID3, denomNm3, @@ -131,8 +131,7 @@ func (suite *KeeperSuite) SetupTest() { suite.NoError(err) // collections should equal 3 - collections, err := suite.keeper.GetCollections(suite.ctx) - suite.NoError(err) + collections:= suite.keeper.GetCollections(suite.ctx) suite.NotEmpty(collections) suite.Equal(len(collections), 3) } @@ -143,7 +142,7 @@ func TestKeeperSuite(t *testing.T) { func (suite *KeeperSuite) TestMintNFT() { // SaveNFT shouldn't fail when collection does not exist - err := suite.keeper.SaveNFT( + err := suite.keeper.MintNFT( suite.ctx, denomID, tokenID, @@ -156,7 +155,7 @@ func (suite *KeeperSuite) TestMintNFT() { suite.NoError(err) // SaveNFT shouldn't fail when collection exists - err = suite.keeper.SaveNFT( + err = suite.keeper.MintNFT( suite.ctx, denomID, tokenID2, @@ -171,7 +170,7 @@ func (suite *KeeperSuite) TestMintNFT() { func (suite *KeeperSuite) TestUpdateNFT() { // UpdateNFT should fail when NFT doesn't exists - err := suite.keeper.UpdateNFT( + err := suite.keeper.EditNFT( suite.ctx, denomID, tokenID, @@ -184,7 +183,7 @@ func (suite *KeeperSuite) TestUpdateNFT() { suite.Error(err) // SaveNFT shouldn't fail when collection does not exist - err = suite.keeper.SaveNFT( + err = suite.keeper.MintNFT( suite.ctx, denomID, tokenID, @@ -197,7 +196,7 @@ func (suite *KeeperSuite) TestUpdateNFT() { suite.NoError(err) // UpdateNFT should fail when NFT doesn't exists - err = suite.keeper.UpdateNFT( + err = suite.keeper.EditNFT( suite.ctx, denomID, tokenID2, @@ -210,7 +209,7 @@ func (suite *KeeperSuite) TestUpdateNFT() { suite.Error(err) // UpdateNFT shouldn't fail when NFT exists - err = suite.keeper.UpdateNFT( + err = suite.keeper.EditNFT( suite.ctx, denomID, tokenID, @@ -223,7 +222,7 @@ func (suite *KeeperSuite) TestUpdateNFT() { suite.NoError(err) // UpdateNFT should fail when NFT failed to authorize - err = suite.keeper.UpdateNFT( + err = suite.keeper.EditNFT( suite.ctx, denomID, tokenID, @@ -241,7 +240,7 @@ func (suite *KeeperSuite) TestUpdateNFT() { suite.Equal(receivedNFT.GetURI(), tokenURI2) // UpdateNFT shouldn't fail when NFT exists - err = suite.keeper.UpdateNFT( + err = suite.keeper.EditNFT( suite.ctx, denomID, tokenID, @@ -253,7 +252,7 @@ func (suite *KeeperSuite) TestUpdateNFT() { ) suite.Error(err) - err = suite.keeper.SaveNFT( + err = suite.keeper.MintNFT( suite.ctx, denomID3, denomID3, @@ -266,7 +265,7 @@ func (suite *KeeperSuite) TestUpdateNFT() { suite.NoError(err) // UpdateNFT should fail if updateRestricted equal to true, nobody can update the NFT under this denom - err = suite.keeper.UpdateNFT( + err = suite.keeper.EditNFT( suite.ctx, denomID3, denomID3, @@ -281,7 +280,7 @@ func (suite *KeeperSuite) TestUpdateNFT() { func (suite *KeeperSuite) TestTransferOwnership() { // SaveNFT shouldn't fail when collection does not exist - err := suite.keeper.SaveNFT( + err := suite.keeper.MintNFT( suite.ctx, denomID, tokenID, @@ -294,7 +293,7 @@ func (suite *KeeperSuite) TestTransferOwnership() { suite.NoError(err) // invalid owner - err = suite.keeper.TransferOwnership( + err = suite.keeper.TransferOwner( suite.ctx, denomID, tokenID, @@ -308,7 +307,7 @@ func (suite *KeeperSuite) TestTransferOwnership() { suite.Error(err) // right - err = suite.keeper.TransferOwnership( + err = suite.keeper.TransferOwner( suite.ctx, denomID, tokenID, @@ -335,7 +334,7 @@ func (suite *KeeperSuite) TestTransferDenom() { err = suite.keeper.TransferDenomOwner(suite.ctx, denomID, address, address3) suite.NoError(err) - denom, _ := suite.keeper.GetDenomInfo(suite.ctx, denomID) + denom, _ := suite.keeper.GetDenom(suite.ctx, denomID) // denom.Creator should equal to address3 after transfer suite.Equal(denom.Creator, address3.String()) @@ -343,7 +342,7 @@ func (suite *KeeperSuite) TestTransferDenom() { func (suite *KeeperSuite) TestBurnNFT() { // SaveNFT should not fail when collection does not exist - err := suite.keeper.SaveNFT( + err := suite.keeper.MintNFT( suite.ctx, denomID, tokenID, @@ -356,7 +355,7 @@ func (suite *KeeperSuite) TestBurnNFT() { suite.NoError(err) // RemoveNFT should fail when NFT doesn't exist but collection does exist - err = suite.keeper.RemoveNFT(suite.ctx, denomID, tokenID, address) + err = suite.keeper.BurnNFT(suite.ctx, denomID, tokenID, address) suite.NoError(err) // NFT should no longer exist diff --git a/modules/nft/keeper/legacy_keeper.go b/modules/nft/keeper/legacy_keeper.go index 52b7eb75..3008c078 100644 --- a/modules/nft/keeper/legacy_keeper.go +++ b/modules/nft/keeper/legacy_keeper.go @@ -7,96 +7,49 @@ import ( "mods.irisnet.org/modules/nft/types" ) +// LegacyKeeper is an alias of Keeper type LegacyKeeper struct { nk Keeper } +// NewLegacyKeeper creates a new instance of the NFT Keeper func NewLegacyKeeper(nk Keeper) LegacyKeeper { return LegacyKeeper{nk} } -func (n LegacyKeeper) IssueDenom( - ctx sdk.Context, - id, - name, - schema, - symbol string, +// IssueDenom issues a denom according to the given params +func (n LegacyKeeper) IssueDenom(ctx sdk.Context, + id, name, schema, symbol string, creator sdk.AccAddress, - mintRestricted, - updateRestricted bool, -) error { - return n.nk.SaveDenom( - ctx, - id, - name, - schema, - symbol, - creator, - mintRestricted, - updateRestricted, - types.DoNotModify, - types.DoNotModify, - types.DoNotModify, - types.DoNotModify, - ) + mintRestricted, updateRestricted bool) error { + return n.nk.IssueDenom(ctx, id, name, schema, symbol, creator, mintRestricted, updateRestricted, types.DoNotModify, types.DoNotModify, types.DoNotModify, types.DoNotModify) } -func (n LegacyKeeper) MintNFT( - ctx sdk.Context, - denomID, - tokenID, - tokenNm, - tokenURI, - tokenData string, - owner sdk.AccAddress, -) error { - return n.nk.SaveNFT( - ctx, - denomID, - tokenID, - tokenNm, - tokenURI, - "", - tokenData, - owner, - ) +// MintNFT mints a new NFT +func (n LegacyKeeper) MintNFT(ctx sdk.Context, + denomID, tokenID, tokenNm, tokenURI, tokenData string, + owner sdk.AccAddress) error { + return n.nk.MintNFT(ctx, denomID, tokenID, tokenNm, tokenURI, "", tokenData, owner) } -func (n LegacyKeeper) TransferOwner( - ctx sdk.Context, - denomID, - tokenID, - tokenNm, - tokenURI, - tokenData string, - srcOwner, - dstOwner sdk.AccAddress, -) error { - return n.nk.TransferOwnership( - ctx, - denomID, - tokenID, - tokenNm, - tokenURI, - types.DoNotModify, - tokenData, - srcOwner, - dstOwner, - ) +// TransferOwner transfers the ownership of an NFT +func (n LegacyKeeper) TransferOwner(ctx sdk.Context, + denomID, tokenID, tokenNm, tokenURI, tokenData string, + srcOwner, dstOwner sdk.AccAddress) error { + return n.nk.TransferOwner(ctx, denomID, tokenID, tokenNm, tokenURI, types.DoNotModify, tokenData, srcOwner, dstOwner) } +// BurnNFT burns an NFT func (n LegacyKeeper) BurnNFT(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error { - return n.nk.RemoveNFT(ctx, denomID, tokenID, owner) + return n.nk.BurnNFT(ctx, denomID, tokenID, owner) } +// GetNFT returns an NFT func (n LegacyKeeper) GetNFT(ctx sdk.Context, denomID, tokenID string) (nft exported.NFT, err error) { return n.nk.GetNFT(ctx, denomID, tokenID) } +// GetDenom returns a denom func (n LegacyKeeper) GetDenom(ctx sdk.Context, id string) (denom types.Denom, found bool) { - d, err := n.nk.GetDenomInfo(ctx, id) - if err != nil { - return denom, false - } - return *d, true + return n.nk.GetDenom(ctx, id) } diff --git a/modules/nft/keeper/migrations.go b/modules/nft/keeper/migrations.go index 2e379965..412c0045 100644 --- a/modules/nft/keeper/migrations.go +++ b/modules/nft/keeper/migrations.go @@ -1,11 +1,5 @@ package keeper -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - v2 "mods.irisnet.org/modules/nft/migrations/v2" -) - // Migrator is a struct for handling in-place store migrations. type Migrator struct { k Keeper @@ -14,9 +8,4 @@ type Migrator struct { // NewMigrator returns a new Migrator. func NewMigrator(k Keeper) Migrator { return Migrator{k: k} -} - -// Migrate1to2 migrates from version 1 to 2. -func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v2.Migrate(ctx, m.k.storeKey, m.k.cdc, m.k.Logger(ctx), m.k.SaveDenom) -} +} \ No newline at end of file diff --git a/modules/nft/keeper/msg_server.go b/modules/nft/keeper/msg_server.go index 974ed9f9..4a8f46fa 100644 --- a/modules/nft/keeper/msg_server.go +++ b/modules/nft/keeper/msg_server.go @@ -3,37 +3,35 @@ package keeper import ( "context" - errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "mods.irisnet.org/modules/nft/types" ) -var _ types.MsgServer = Keeper{} +type msgServer struct { + Keeper +} + +var _ types.MsgServer = msgServer{} + +// NewMsgServerImpl returns an implementation of the NFT MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} // IssueDenom issue a new denom. -func (k Keeper) IssueDenom( - goCtx context.Context, - msg *types.MsgIssueDenom, -) (*types.MsgIssueDenomResponse, error) { +func (m msgServer) IssueDenom(goCtx context.Context, msg *types.MsgIssueDenom) (*types.MsgIssueDenomResponse, error) { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { return nil, err } ctx := sdk.UnwrapSDKContext(goCtx) - if err := k.SaveDenom(ctx, msg.Id, - msg.Name, - msg.Schema, - msg.Symbol, - sender, - msg.MintRestricted, - msg.UpdateRestricted, - msg.Description, - msg.Uri, - msg.UriHash, - msg.Data, + if err := m.Keeper.IssueDenom(ctx, msg.Id, msg.Name, msg.Schema, msg.Symbol, sender, + msg.MintRestricted, msg.UpdateRestricted, + msg.Description, msg.Uri, msg.UriHash, msg.Data, ); err != nil { return nil, err } @@ -45,15 +43,17 @@ func (k Keeper) IssueDenom( sdk.NewAttribute(types.AttributeKeyDenomName, msg.Name), sdk.NewAttribute(types.AttributeKeyCreator, msg.Sender), ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), }) return &types.MsgIssueDenomResponse{}, nil } -func (k Keeper) MintNFT( - goCtx context.Context, - msg *types.MsgMintNFT, -) (*types.MsgMintNFTResponse, error) { +func (m msgServer) MintNFT(goCtx context.Context, msg *types.MsgMintNFT) (*types.MsgMintNFTResponse, error) { recipient, err := sdk.AccAddressFromBech32(msg.Recipient) if err != nil { return nil, err @@ -66,22 +66,16 @@ func (k Keeper) MintNFT( ctx := sdk.UnwrapSDKContext(goCtx) - denom, err := k.GetDenomInfo(ctx, msg.DenomId) - if err != nil { - return nil, err + denom, found := m.Keeper.GetDenom(ctx, msg.DenomId) + if !found { + return nil, sdkerrors.Wrapf(types.ErrInvalidDenom, "denom ID %s not exists", msg.DenomId) } if denom.MintRestricted && denom.Creator != sender.String() { - return nil, errorsmod.Wrapf( - sdkerrors.ErrUnauthorized, - "%s is not allowed to mint NFT of denom %s", - sender, - msg.DenomId, - ) + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to mint NFT of denom %s", msg.Sender, msg.DenomId) } - if err := k.SaveNFT(ctx, msg.DenomId, - msg.Id, + if err := m.Keeper.MintNFT(ctx, msg.DenomId, msg.Id, msg.Name, msg.URI, msg.UriHash, @@ -99,23 +93,24 @@ func (k Keeper) MintNFT( sdk.NewAttribute(types.AttributeKeyTokenURI, msg.URI), sdk.NewAttribute(types.AttributeKeyRecipient, msg.Recipient), ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), }) return &types.MsgMintNFTResponse{}, nil } -func (k Keeper) EditNFT( - goCtx context.Context, - msg *types.MsgEditNFT, -) (*types.MsgEditNFTResponse, error) { +func (m msgServer) EditNFT(goCtx context.Context, msg *types.MsgEditNFT) (*types.MsgEditNFTResponse, error) { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { return nil, err } ctx := sdk.UnwrapSDKContext(goCtx) - if err := k.UpdateNFT(ctx, msg.DenomId, - msg.Id, + if err := m.Keeper.EditNFT(ctx, msg.DenomId, msg.Id, msg.Name, msg.URI, msg.UriHash, @@ -133,14 +128,17 @@ func (k Keeper) EditNFT( sdk.NewAttribute(types.AttributeKeyTokenURI, msg.URI), sdk.NewAttribute(types.AttributeKeyOwner, msg.Sender), ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), }) return &types.MsgEditNFTResponse{}, nil } -func (k Keeper) TransferNFT(goCtx context.Context, - msg *types.MsgTransferNFT, -) (*types.MsgTransferNFTResponse, error) { +func (m msgServer) TransferNFT(goCtx context.Context, msg *types.MsgTransferNFT) (*types.MsgTransferNFTResponse, error) { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { return nil, err @@ -152,8 +150,7 @@ func (k Keeper) TransferNFT(goCtx context.Context, } ctx := sdk.UnwrapSDKContext(goCtx) - if err := k.TransferOwnership(ctx, msg.DenomId, - msg.Id, + if err := m.Keeper.TransferOwner(ctx, msg.DenomId, msg.Id, msg.Name, msg.URI, msg.UriHash, @@ -172,22 +169,24 @@ func (k Keeper) TransferNFT(goCtx context.Context, sdk.NewAttribute(types.AttributeKeySender, msg.Sender), sdk.NewAttribute(types.AttributeKeyRecipient, msg.Recipient), ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), }) return &types.MsgTransferNFTResponse{}, nil } -func (k Keeper) BurnNFT( - goCtx context.Context, - msg *types.MsgBurnNFT, -) (*types.MsgBurnNFTResponse, error) { +func (m msgServer) BurnNFT(goCtx context.Context, msg *types.MsgBurnNFT) (*types.MsgBurnNFTResponse, error) { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { return nil, err } ctx := sdk.UnwrapSDKContext(goCtx) - if err := k.RemoveNFT(ctx, msg.DenomId, msg.Id, sender); err != nil { + if err := m.Keeper.BurnNFT(ctx, msg.DenomId, msg.Id, sender); err != nil { return nil, err } @@ -198,15 +197,17 @@ func (k Keeper) BurnNFT( sdk.NewAttribute(types.AttributeKeyTokenID, msg.Id), sdk.NewAttribute(types.AttributeKeyOwner, msg.Sender), ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), }) return &types.MsgBurnNFTResponse{}, nil } -func (k Keeper) TransferDenom( - goCtx context.Context, - msg *types.MsgTransferDenom, -) (*types.MsgTransferDenomResponse, error) { +func (m msgServer) TransferDenom(goCtx context.Context, msg *types.MsgTransferDenom) (*types.MsgTransferDenomResponse, error) { sender, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { return nil, err @@ -218,7 +219,7 @@ func (k Keeper) TransferDenom( } ctx := sdk.UnwrapSDKContext(goCtx) - if err := k.TransferDenomOwner(ctx, msg.Id, sender, recipient); err != nil { + if err := m.Keeper.TransferDenomOwner(ctx, msg.Id, sender, recipient); err != nil { return nil, err } @@ -229,7 +230,12 @@ func (k Keeper) TransferDenom( sdk.NewAttribute(types.AttributeKeySender, msg.Sender), sdk.NewAttribute(types.AttributeKeyRecipient, msg.Recipient), ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), }) return &types.MsgTransferDenomResponse{}, nil -} +} \ No newline at end of file diff --git a/modules/nft/keeper/nft.go b/modules/nft/keeper/nft.go index 9f5d696f..194580b2 100644 --- a/modules/nft/keeper/nft.go +++ b/modules/nft/keeper/nft.go @@ -1,216 +1,73 @@ package keeper import ( - errorsmod "cosmossdk.io/errors" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/nft" "mods.irisnet.org/modules/nft/exported" "mods.irisnet.org/modules/nft/types" ) -// SaveNFT mints an NFT and manages the NFT's existence within Collections and Owners -func (k Keeper) SaveNFT(ctx sdk.Context, denomID, - tokenID, - tokenNm, - tokenURI, - tokenUriHash, - tokenData string, - receiver sdk.AccAddress, -) error { - nftMetadata := &types.NFTMetadata{ - Name: tokenNm, - Data: tokenData, - } - data, err := codectypes.NewAnyWithValue(nftMetadata) - if err != nil { - return err - } - return k.nk.Mint(ctx, nft.NFT{ - ClassId: denomID, - Id: tokenID, - Uri: tokenURI, - UriHash: tokenUriHash, - Data: data, - }, receiver) -} +// GetNFT gets the the specified NFT +func (k Keeper) GetNFT(ctx sdk.Context, denomID, tokenID string) (nft exported.NFT, err error) { + store := ctx.KVStore(k.storeKey) -// UpdateNFT updates an already existing NFT -func (k Keeper) UpdateNFT(ctx sdk.Context, denomID, - tokenID, - tokenNm, - tokenURI, - tokenURIHash, - tokenData string, - owner sdk.AccAddress, -) error { - denom, err := k.GetDenomInfo(ctx, denomID) - if err != nil { - return err + bz := store.Get(types.KeyNFT(denomID, tokenID)) + if bz == nil { + return nil, sdkerrors.Wrapf(types.ErrUnknownNFT, "not found NFT: %s", tokenID) } - if denom.UpdateRestricted { - // if true , nobody can update the NFT under this denom - return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "nobody can update the NFT under this denom %s", denomID) - } + var baseNFT types.BaseNFT + k.cdc.MustUnmarshal(bz, &baseNFT) - // just the owner of NFT can edit - if err := k.Authorize(ctx, denomID, tokenID, owner); err != nil { - return err - } + return baseNFT, nil +} - if !types.Modified(tokenURI) && - !types.Modified(tokenURIHash) && - !types.Modified(tokenNm) && - !types.Modified(tokenData) { - return nil - } +// GetNFTs returns all NFTs by the specified denom ID +func (k Keeper) GetNFTs(ctx sdk.Context, denom string) (nfts []exported.NFT) { + store := ctx.KVStore(k.storeKey) - token, exist := k.nk.GetNFT(ctx, denomID, tokenID) - if !exist { - return errorsmod.Wrapf(types.ErrUnknownNFT, "nft ID %s not exists", tokenID) + iterator := sdk.KVStorePrefixIterator(store, types.KeyNFT(denom, "")) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + var baseNFT types.BaseNFT + k.cdc.MustUnmarshal(iterator.Value(), &baseNFT) + nfts = append(nfts, baseNFT) } - token.Uri = types.Modify(token.Uri, tokenURI) - token.UriHash = types.Modify(token.UriHash, tokenURIHash) - if types.Modified(tokenNm) || types.Modified(tokenData) { - nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, token.Data.GetValue()) - if err != nil { - return err - } - - nftMetadata.Name = types.Modify(nftMetadata.Name, tokenNm) - nftMetadata.Data = types.Modify(nftMetadata.Data, tokenData) - data, err := codectypes.NewAnyWithValue(&nftMetadata) - if err != nil { - return err - } - token.Data = data - } - return k.nk.Update(ctx, token) + return nfts } -// TransferOwnership transfers the ownership of the given NFT to the new owner -func (k Keeper) TransferOwnership(ctx sdk.Context, denomID, - tokenID, - tokenNm, - tokenURI, - tokenURIHash, - tokenData string, - srcOwner, - dstOwner sdk.AccAddress, -) error { - token, exist := k.nk.GetNFT(ctx, denomID, tokenID) - if !exist { - return errorsmod.Wrapf(types.ErrInvalidTokenID, "nft ID %s not exists", tokenID) - } - - if err := k.Authorize(ctx, denomID, tokenID, srcOwner); err != nil { - return err - } - - denom, err := k.GetDenomInfo(ctx, denomID) +// Authorize checks if the sender is the owner of the given NFT +// Return the NFT if true, an error otherwise +func (k Keeper) Authorize(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) (types.BaseNFT, error) { + nft, err := k.GetNFT(ctx, denomID, tokenID) if err != nil { - return err - } - - tokenChanged := types.Modified(tokenURI) || types.Modified(tokenURIHash) - tokenMetadataChanged := types.Modified(tokenNm) || types.Modified(tokenData) - - if denom.UpdateRestricted && (tokenChanged || tokenMetadataChanged) { - return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "It is restricted to update NFT under this denom %s", denom.Id) - } - - if !tokenChanged && !tokenMetadataChanged { - return k.nk.Transfer(ctx, denomID, tokenID, dstOwner) - } - - token.Uri = types.Modify(token.Uri, tokenURI) - token.UriHash = types.Modify(token.UriHash, tokenURIHash) - if tokenMetadataChanged { - nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, token.Data.GetValue()) - if err != nil { - return err - } - - nftMetadata.Name = types.Modify(nftMetadata.Name, tokenNm) - nftMetadata.Data = types.Modify(nftMetadata.Data, tokenData) - data, err := codectypes.NewAnyWithValue(&nftMetadata) - if err != nil { - return err - } - token.Data = data + return types.BaseNFT{}, err } - if err := k.nk.Update(ctx, token); err != nil { - return err + if !owner.Equals(nft.GetOwner()) { + return types.BaseNFT{}, sdkerrors.Wrap(types.ErrUnauthorized, owner.String()) } - return k.nk.Transfer(ctx, denomID, tokenID, dstOwner) -} -// RemoveNFT deletes a specified NFT -func (k Keeper) RemoveNFT(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error { - if err := k.Authorize(ctx, denomID, tokenID, owner); err != nil { - return err - } - return k.nk.Burn(ctx, denomID, tokenID) + return nft.(types.BaseNFT), nil } -// GetNFT gets the specified NFT -func (k Keeper) GetNFT(ctx sdk.Context, denomID, tokenID string) (nft exported.NFT, err error) { - token, exist := k.nk.GetNFT(ctx, denomID, tokenID) - if !exist { - return nil, errorsmod.Wrapf(types.ErrUnknownNFT, "not found NFT: %s", denomID) - } - - nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, token.Data.GetValue()) - if err != nil { - return nil, err - } - - owner := k.nk.GetOwner(ctx, denomID, tokenID) - return types.BaseNFT{ - Id: token.Id, - Name: nftMetadata.Name, - URI: token.Uri, - Data: nftMetadata.Data, - Owner: owner.String(), - UriHash: token.UriHash, - }, nil +// HasNFT checks if the specified NFT exists +func (k Keeper) HasNFT(ctx sdk.Context, denomID, tokenID string) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.KeyNFT(denomID, tokenID)) } -// GetNFTs returns all NFTs by the specified denom ID -func (k Keeper) GetNFTs(ctx sdk.Context, denom string) (nfts []exported.NFT, err error) { - tokens := k.nk.GetNFTsOfClass(ctx, denom) - for _, token := range tokens { - nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, token.Data.GetValue()) - if err != nil { - return nil, err - } - nfts = append(nfts, types.BaseNFT{ - Id: token.GetId(), - Name: nftMetadata.Name, - URI: token.GetUri(), - UriHash: token.GetUriHash(), - Data: nftMetadata.Data, - Owner: k.nk.GetOwner(ctx, denom, token.GetId()).String(), - }) - } - return nfts, nil -} +func (k Keeper) setNFT(ctx sdk.Context, denomID string, nft types.BaseNFT) { + store := ctx.KVStore(k.storeKey) -// Authorize checks if the sender is the owner of the given NFT -// Return the NFT if true, an error otherwise -func (k Keeper) Authorize(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) error { - if !owner.Equals(k.nk.GetOwner(ctx, denomID, tokenID)) { - return errorsmod.Wrap(types.ErrUnauthorized, owner.String()) - } - return nil + bz := k.cdc.MustMarshal(&nft) + store.Set(types.KeyNFT(denomID, nft.GetID()), bz) } -// HasNFT checks if the specified NFT exists -func (k Keeper) HasNFT(ctx sdk.Context, denomID, tokenID string) bool { - return k.nk.HasNFT(ctx, denomID, tokenID) -} +// deleteNFT deletes an existing NFT from store +func (k Keeper) deleteNFT(ctx sdk.Context, denomID string, nft exported.NFT) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.KeyNFT(denomID, nft.GetID())) +} \ No newline at end of file diff --git a/modules/nft/keeper/nft_test.go b/modules/nft/keeper/nft_test.go index 75908c5b..d55eba75 100644 --- a/modules/nft/keeper/nft_test.go +++ b/modules/nft/keeper/nft_test.go @@ -6,7 +6,7 @@ import ( func (suite *KeeperSuite) TestGetNFT() { // SaveNFT shouldn't fail when collection does not exist - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) // GetNFT should get the NFT @@ -17,7 +17,7 @@ func (suite *KeeperSuite) TestGetNFT() { suite.Equal(receivedNFT.GetURI(), tokenURI) // SaveNFT shouldn't fail when collection exists - err = suite.keeper.SaveNFT(suite.ctx, denomID, tokenID2, tokenNm2, tokenURI, tokenURIHash, tokenData, address) + err = suite.keeper.MintNFT(suite.ctx, denomID, tokenID2, tokenNm2, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) // GetNFT should get the NFT when collection exists @@ -32,31 +32,30 @@ func (suite *KeeperSuite) TestGetNFT() { } func (suite *KeeperSuite) TestGetNFTs() { - err := suite.keeper.SaveNFT(suite.ctx, denomID2, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID2, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) - err = suite.keeper.SaveNFT(suite.ctx, denomID2, tokenID2, tokenNm2, tokenURI, tokenURIHash, tokenData, address) + err = suite.keeper.MintNFT(suite.ctx, denomID2, tokenID2, tokenNm2, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) - err = suite.keeper.SaveNFT(suite.ctx, denomID2, tokenID3, tokenNm3, tokenURI, tokenURIHash, tokenData, address) + err = suite.keeper.MintNFT(suite.ctx, denomID2, tokenID3, tokenNm3, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) - err = suite.keeper.SaveNFT(suite.ctx, denomID, tokenID3, tokenNm3, tokenURI, tokenURIHash, tokenData, address) + err = suite.keeper.MintNFT(suite.ctx, denomID, tokenID3, tokenNm3, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) - nfts, err := suite.keeper.GetNFTs(suite.ctx, denomID2) - suite.NoError(err) + nfts := suite.keeper.GetNFTs(suite.ctx, denomID2) suite.Len(nfts, 3) } func (suite *KeeperSuite) TestAuthorize() { - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) - err = suite.keeper.Authorize(suite.ctx, denomID, tokenID, address2) + _, err = suite.keeper.Authorize(suite.ctx, denomID, tokenID, address2) suite.Error(err) - err = suite.keeper.Authorize(suite.ctx, denomID, tokenID, address) + _, err = suite.keeper.Authorize(suite.ctx, denomID, tokenID, address) suite.NoError(err) } @@ -66,7 +65,7 @@ func (suite *KeeperSuite) TestHasNFT() { suite.False(isNFT) // SaveNFT shouldn't fail when collection does not exist - err := suite.keeper.SaveNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) + err := suite.keeper.MintNFT(suite.ctx, denomID, tokenID, tokenNm, tokenURI, tokenURIHash, tokenData, address) suite.NoError(err) // IsNFT should return true diff --git a/modules/nft/keeper/owners.go b/modules/nft/keeper/owners.go new file mode 100644 index 00000000..c759cd81 --- /dev/null +++ b/modules/nft/keeper/owners.go @@ -0,0 +1,90 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "mods.irisnet.org/modules/nft/types" +) + +// GetOwner gets all the ID collections owned by an address and denom ID +func (k Keeper) GetOwner(ctx sdk.Context, address sdk.AccAddress, denom string) types.Owner { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.KeyOwner(address, denom, "")) + defer iterator.Close() + + owner := types.Owner{ + Address: address.String(), + IDCollections: types.IDCollections{}, + } + idsMap := make(map[string][]string) + + for ; iterator.Valid(); iterator.Next() { + _, denomID, tokenID, _ := types.SplitKeyOwner(iterator.Key()) + if ids, ok := idsMap[denomID]; ok { + idsMap[denomID] = append(ids, tokenID) + } else { + idsMap[denomID] = []string{tokenID} + owner.IDCollections = append( + owner.IDCollections, + types.IDCollection{DenomId: denomID}, + ) + } + } + + for i := 0; i < len(owner.IDCollections); i++ { + owner.IDCollections[i].TokenIds = idsMap[owner.IDCollections[i].DenomId] + } + + return owner +} + +// GetOwners gets all the ID collections +func (k Keeper) GetOwners(ctx sdk.Context) (owners types.Owners) { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStoreReversePrefixIterator(store, types.KeyOwner(nil, "", "")) + defer iterator.Close() + + idcsMap := make(map[string]types.IDCollections) + for ; iterator.Valid(); iterator.Next() { + key := iterator.Key() + address, denom, id, _ := types.SplitKeyOwner(key) + if _, ok := idcsMap[address.String()]; !ok { + idcsMap[address.String()] = types.IDCollections{} + owners = append( + owners, + types.Owner{Address: address.String()}, + ) + } + idcs := idcsMap[address.String()] + idcs = idcs.Add(denom, id) + idcsMap[address.String()] = idcs + } + for i, owner := range owners { + owners[i].IDCollections = idcsMap[owner.Address] + } + + return owners +} + +func (k Keeper) deleteOwner(ctx sdk.Context, denomID, tokenID string, owner sdk.AccAddress) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.KeyOwner(owner, denomID, tokenID)) +} + +func (k Keeper) setOwner(ctx sdk.Context, + denomID, tokenID string, + owner sdk.AccAddress) { + store := ctx.KVStore(k.storeKey) + + bz := types.MustMarshalTokenID(k.cdc, tokenID) + store.Set(types.KeyOwner(owner, denomID, tokenID), bz) +} + +func (k Keeper) swapOwner(ctx sdk.Context, denomID, tokenID string, srcOwner, dstOwner sdk.AccAddress) { + + // delete old owner key + k.deleteOwner(ctx, denomID, tokenID, srcOwner) + + // set new owner key + k.setOwner(ctx, denomID, tokenID, dstOwner) +} diff --git a/modules/nft/migrations/v2/expected_keeper.go b/modules/nft/migrations/v2/expected_keeper.go deleted file mode 100644 index 9e5a450f..00000000 --- a/modules/nft/migrations/v2/expected_keeper.go +++ /dev/null @@ -1,15 +0,0 @@ -package v2 - -import sdk "github.com/cosmos/cosmos-sdk/types" - -// SaveDenom save the denom of class -type SaveDenom func(ctx sdk.Context, id, name, schema, - symbol string, - creator sdk.AccAddress, - mintRestricted, - updateRestricted bool, - description, - uri, - uriHash, - data string, -) error diff --git a/modules/nft/migrations/v2/keeper.go b/modules/nft/migrations/v2/keeper.go deleted file mode 100644 index 2e7c5af7..00000000 --- a/modules/nft/migrations/v2/keeper.go +++ /dev/null @@ -1,164 +0,0 @@ -package v2 - -import ( - "reflect" - "unsafe" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" - "github.com/cosmos/cosmos-sdk/x/nft" - nftkeeper "github.com/cosmos/cosmos-sdk/x/nft/keeper" - - "mods.irisnet.org/modules/nft/types" -) - -type keeper struct { - storeKey storetypes.StoreKey // Unexposed key to access store from sdk.Context - cdc codec.Codec -} - -func (k keeper) saveNFT(ctx sdk.Context, denomID, - tokenID, - tokenNm, - tokenURI, - tokenURIHash, - tokenData string, - receiver sdk.AccAddress, -) error { - nftMetadata := &types.NFTMetadata{ - Name: tokenNm, - Data: tokenData, - } - data, err := codectypes.NewAnyWithValue(nftMetadata) - if err != nil { - return err - } - - token := nft.NFT{ - ClassId: denomID, - Id: tokenID, - Uri: tokenURI, - UriHash: tokenURIHash, - Data: data, - } - k.setNFT(ctx, token) - k.setOwner(ctx, token.ClassId, token.Id, receiver) - k.incrTotalSupply(ctx, token.ClassId) - return nil -} - -func (k keeper) setNFT(ctx sdk.Context, token nft.NFT) { - nftStore := k.getNFTStore(ctx, token.ClassId) - bz := k.cdc.MustMarshal(&token) - nftStore.Set([]byte(token.Id), bz) -} - -func (k keeper) setOwner(ctx sdk.Context, classID, nftID string, owner sdk.AccAddress) { - store := ctx.KVStore(k.storeKey) - store.Set(ownerStoreKey(classID, nftID), owner.Bytes()) - - ownerStore := k.getClassStoreByOwner(ctx, owner, classID) - ownerStore.Set([]byte(nftID), nftkeeper.Placeholder) -} - -func (k keeper) incrTotalSupply(ctx sdk.Context, classID string) { - supply := k.GetTotalSupply(ctx, classID) + 1 - k.updateTotalSupply(ctx, classID, supply) -} - -// GetTotalSupply returns the number of all nfts under the specified classID -func (k keeper) GetTotalSupply(ctx sdk.Context, classID string) uint64 { - store := ctx.KVStore(k.storeKey) - bz := store.Get(classTotalSupply(classID)) - return sdk.BigEndianToUint64(bz) -} - -func (k keeper) updateTotalSupply(ctx sdk.Context, classID string, supply uint64) { - store := ctx.KVStore(k.storeKey) - supplyKey := classTotalSupply(classID) - store.Set(supplyKey, sdk.Uint64ToBigEndian(supply)) -} - -func (k keeper) getClassStoreByOwner(ctx sdk.Context, owner sdk.AccAddress, classID string) prefix.Store { - store := ctx.KVStore(k.storeKey) - key := nftOfClassByOwnerStoreKey(owner, classID) - return prefix.NewStore(store, key) -} - -func (k keeper) getNFTStore(ctx sdk.Context, classID string) prefix.Store { - store := ctx.KVStore(k.storeKey) - return prefix.NewStore(store, nftStoreKey(classID)) -} - -// classTotalSupply returns the byte representation of the ClassTotalSupply -func classTotalSupply(classID string) []byte { - key := make([]byte, len(nftkeeper.ClassTotalSupply)+len(classID)) - copy(key, nftkeeper.ClassTotalSupply) - copy(key[len(nftkeeper.ClassTotalSupply):], classID) - return key -} - -// nftStoreKey returns the byte representation of the nft -func nftStoreKey(classID string) []byte { - key := make([]byte, len(nftkeeper.NFTKey)+len(classID)+len(nftkeeper.Delimiter)) - copy(key, nftkeeper.NFTKey) - copy(key[len(nftkeeper.NFTKey):], classID) - copy(key[len(nftkeeper.NFTKey)+len(classID):], nftkeeper.Delimiter) - return key -} - -// ownerStoreKey returns the byte representation of the nft owner -// Items are stored with the following key: values -// 0x04 -func ownerStoreKey(classID, nftID string) []byte { - // key is of format: - classIDBz := UnsafeStrToBytes(classID) - nftIDBz := UnsafeStrToBytes(nftID) - - key := make([]byte, len(nftkeeper.OwnerKey)+len(classIDBz)+len(nftkeeper.Delimiter)+len(nftIDBz)) - copy(key, nftkeeper.OwnerKey) - copy(key[len(nftkeeper.OwnerKey):], classIDBz) - copy(key[len(nftkeeper.OwnerKey)+len(classIDBz):], nftkeeper.Delimiter) - copy(key[len(nftkeeper.OwnerKey)+len(classIDBz)+len(nftkeeper.Delimiter):], nftIDBz) - return key -} - -// nftOfClassByOwnerStoreKey returns the byte representation of the nft owner -// Items are stored with the following key: values -// 0x03 -func nftOfClassByOwnerStoreKey(owner sdk.AccAddress, classID string) []byte { - owner = address.MustLengthPrefix(owner) - classIDBz := UnsafeStrToBytes(classID) - - key := make([]byte, len(nftkeeper.NFTOfClassByOwnerKey)+len(owner)+len(nftkeeper.Delimiter)+len(classIDBz)+len(nftkeeper.Delimiter)) - copy(key, nftkeeper.NFTOfClassByOwnerKey) - copy(key[len(nftkeeper.NFTOfClassByOwnerKey):], owner) - copy(key[len(nftkeeper.NFTOfClassByOwnerKey)+len(owner):], nftkeeper.Delimiter) - copy(key[len(nftkeeper.NFTOfClassByOwnerKey)+len(owner)+len(nftkeeper.Delimiter):], classIDBz) - copy(key[len(nftkeeper.NFTOfClassByOwnerKey)+len(owner)+len(nftkeeper.Delimiter)+len(classIDBz):], nftkeeper.Delimiter) - return key -} - -// UnsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes -// must not be altered after this function is called as it will cause a segmentation fault. -func UnsafeStrToBytes(s string) []byte { - var buf []byte - sHdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) - bufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) - bufHdr.Data = sHdr.Data - bufHdr.Cap = sHdr.Len - bufHdr.Len = sHdr.Len - return buf -} - -// UnsafeBytesToStr is meant to make a zero allocation conversion -// from []byte -> string to speed up operations, it is not meant -// to be used generally, but for a specific pattern to delete keys -// from a map. -func UnsafeBytesToStr(b []byte) string { - return *(*string)(unsafe.Pointer(&b)) -} diff --git a/modules/nft/migrations/v2/keys.go b/modules/nft/migrations/v2/keys.go deleted file mode 100644 index 88db65fc..00000000 --- a/modules/nft/migrations/v2/keys.go +++ /dev/null @@ -1,64 +0,0 @@ -package v2 - -import sdk "github.com/cosmos/cosmos-sdk/types" - -var ( - PrefixNFT = []byte{0x01} - PrefixOwners = []byte{0x02} // key for a owner - PrefixCollection = []byte{0x03} // key for balance of NFTs held by the denom - PrefixDenom = []byte{0x04} // key for denom of the nft - PrefixDenomName = []byte{0x05} // key for denom name of the nft - - delimiter = []byte("/") -) - -// KeyDenom gets the storeKey by the denom id -func KeyDenom(id string) []byte { - key := append(PrefixDenom, delimiter...) - return append(key, []byte(id)...) -} - -// KeyDenomName gets the storeKey by the denom name -func KeyDenomName(name string) []byte { - key := append(PrefixDenomName, delimiter...) - return append(key, []byte(name)...) -} - -// KeyNFT gets the key of nft stored by an denom and id -func KeyNFT(denomID, tokenID string) []byte { - key := append(PrefixNFT, delimiter...) - if len(denomID) > 0 { - key = append(key, []byte(denomID)...) - key = append(key, delimiter...) - } - - if len(denomID) > 0 && len(tokenID) > 0 { - key = append(key, []byte(tokenID)...) - } - return key -} - -// KeyCollection gets the storeKey by the collection -func KeyCollection(denomID string) []byte { - key := append(PrefixCollection, delimiter...) - return append(key, []byte(denomID)...) -} - -// KeyOwner gets the key of a collection owned by an account address -func KeyOwner(address sdk.AccAddress, denomID, tokenID string) []byte { - key := append(PrefixOwners, delimiter...) - if address != nil { - key = append(key, []byte(address.String())...) - key = append(key, delimiter...) - } - - if address != nil && len(denomID) > 0 { - key = append(key, []byte(denomID)...) - key = append(key, delimiter...) - } - - if address != nil && len(denomID) > 0 && len(tokenID) > 0 { - key = append(key, []byte(tokenID)...) - } - return key -} diff --git a/modules/nft/migrations/v2/store.go b/modules/nft/migrations/v2/store.go deleted file mode 100644 index 6b69cc58..00000000 --- a/modules/nft/migrations/v2/store.go +++ /dev/null @@ -1,126 +0,0 @@ -package v2 - -import ( - "time" - - "github.com/cometbft/cometbft/libs/log" - "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - - "mods.irisnet.org/modules/nft/types" -) - -// Migrate is used to migrate nft data from irismod/nft to x/nft -func Migrate(ctx sdk.Context, - storeKey storetypes.StoreKey, - cdc codec.Codec, - logger log.Logger, - saveDenom SaveDenom, -) error { - logger.Info("migrate store data from version 1 to 2") - startTime := time.Now() - - store := ctx.KVStore(storeKey) - iterator := sdk.KVStorePrefixIterator(store, KeyDenom("")) - defer iterator.Close() - - k := keeper{ - storeKey: storeKey, - cdc: cdc, - } - - var ( - denomNum int64 - tokenNum int64 - ) - for ; iterator.Valid(); iterator.Next() { - var denom types.Denom - cdc.MustUnmarshal(iterator.Value(), &denom) - - // delete unused key - store.Delete(KeyDenom(denom.Id)) - store.Delete(KeyDenomName(denom.Name)) - store.Delete(KeyCollection(denom.Id)) - - creator, err := sdk.AccAddressFromBech32(denom.Creator) - if err != nil { - return err - } - - if err := saveDenom(ctx, denom.Id, - denom.Name, - denom.Schema, - denom.Symbol, - creator, - denom.MintRestricted, - denom.UpdateRestricted, - denom.Description, - denom.Uri, - denom.UriHash, - denom.Data, - ); err != nil { - return err - } - - tokenInDenom, err := migrateToken(ctx, k, logger, denom.Id) - if err != nil { - return err - } - denomNum++ - tokenNum += tokenInDenom - - } - logger.Info("migrate store data success", - "denomTotalNum", denomNum, - "tokenTotalNum", tokenNum, - "consume", time.Since(startTime).String(), - ) - return nil -} - -func migrateToken( - ctx sdk.Context, - k keeper, - logger log.Logger, - denomID string, -) (int64, error) { - var iterator sdk.Iterator - defer func() { - if iterator != nil { - _ = iterator.Close() - } - }() - - store := ctx.KVStore(k.storeKey) - - total := int64(0) - iterator = sdk.KVStorePrefixIterator(store, KeyNFT(denomID, "")) - for ; iterator.Valid(); iterator.Next() { - var baseNFT types.BaseNFT - k.cdc.MustUnmarshal(iterator.Value(), &baseNFT) - - owner, err := sdk.AccAddressFromBech32(baseNFT.Owner) - if err != nil { - return 0, err - } - - // delete unused key - store.Delete(KeyNFT(denomID, baseNFT.Id)) - store.Delete(KeyOwner(owner, denomID, baseNFT.Id)) - - if err := k.saveNFT(ctx, denomID, - baseNFT.Id, - baseNFT.Name, - baseNFT.URI, - baseNFT.UriHash, - baseNFT.Data, - owner, - ); err != nil { - return 0, err - } - total++ - } - logger.Info("migrate nft success", "denomID", denomID, "nftNum", total) - return total, nil -} diff --git a/modules/nft/migrations/v2/store_test.go b/modules/nft/migrations/v2/store_test.go deleted file mode 100644 index 8da22120..00000000 --- a/modules/nft/migrations/v2/store_test.go +++ /dev/null @@ -1,185 +0,0 @@ -package v2_test - -// import ( -// "fmt" -// "math/rand" -// "testing" - -// gogotypes "github.com/cosmos/gogoproto/types" -// "github.com/stretchr/testify/require" - -// tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - -// "github.com/cosmos/cosmos-sdk/codec" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" -// sdk "github.com/cosmos/cosmos-sdk/types" - -// "mods.irisnet.org/simapp" -// "mods.irisnet.org/modules/nft/keeper" -// v2 "mods.irisnet.org/modules/nft/migrations/v2" -// "mods.irisnet.org/modules/nft/types" -// ) - -// func TestMigrate(t *testing.T) { -// app := simapp.Setup(t, false) -// ctx := app.BaseApp.NewContext(false, tmproto.Header{}) -// storeKey := app.GetKey(types.StoreKey) -// cdc := app.AppCodec() - -// collections := prepareData(ctx, storeKey, cdc) -// require.NoError( -// t, -// v2.Migrate(ctx, storeKey, cdc, app.NFTKeeper.Logger(ctx), app.NFTKeeper.SaveDenom), -// ) -// check(t, ctx, app.NFTKeeper, collections) - -// } - -// func prepareData( -// ctx sdk.Context, -// storeKey storetypes.StoreKey, -// cdc codec.Codec, -// ) (collection []types.Collection) { -// addrs := simapp.CreateTestAddrs(10) -// for i := 1; i <= 10; i++ { -// denom := types.Denom{ -// Id: fmt.Sprintf("denom%d", i), -// Name: fmt.Sprintf("denomName%d", i), -// Schema: fmt.Sprintf("denomSchema%d", i), -// Creator: addrs[rand.Intn(len(addrs))].String(), -// Symbol: fmt.Sprintf("denomSymbol%d", i), -// MintRestricted: false, -// UpdateRestricted: true, -// Description: fmt.Sprintf("denomDescription%d", i), -// Uri: fmt.Sprintf("denomUri%d", i), -// UriHash: fmt.Sprintf("denomUriHash%d", i), -// Data: fmt.Sprintf("denomData%d", i), -// } -// setDenom(ctx, storeKey, cdc, denom) - -// var tokens []types.BaseNFT -// for j := 1; j <= 100; j++ { -// token := types.BaseNFT{ -// Id: fmt.Sprintf("nft%d", j), -// Name: fmt.Sprintf("nftName%d", j), -// URI: fmt.Sprintf("nftURI%d", j), -// Data: fmt.Sprintf("nftData%d", j), -// Owner: addrs[rand.Intn(len(addrs))].String(), -// UriHash: fmt.Sprintf("nftUriHash%d", j), -// } -// tokens = append(tokens, token) -// mintNFT(ctx, storeKey, cdc, denom.Id, token) -// } -// collection = append(collection, types.Collection{ -// Denom: denom, -// NFTs: tokens, -// }) -// } -// return -// } - -// func check(t *testing.T, ctx sdk.Context, k keeper.Keeper, collections []types.Collection) { -// for _, collection := range collections { -// denom := collection.Denom -// d, err := k.GetDenomInfo(ctx, denom.Id) -// require.NoError(t, err) -// require.EqualValues(t, denom, *d) - -// for _, token := range collection.NFTs { -// nft, err := k.GetNFT(ctx, denom.Id, token.Id) -// require.NoError(t, err) -// require.EqualValues(t, token, nft) -// } -// } -// keeper.SupplyInvariant(k) -// } - -// // SetDenom is responsible for saving the definition of denom -// func setDenom(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Codec, denom types.Denom) { -// store := ctx.KVStore(storeKey) -// bz := cdc.MustMarshal(&denom) -// store.Set(v2.KeyDenom(denom.Id), bz) -// store.Set(v2.KeyDenomName(denom.Name), []byte(denom.Id)) -// } - -// // MintNFT mints an NFT and manages the NFT's existence within Collections and Owners -// func mintNFT( -// ctx sdk.Context, -// storeKey storetypes.StoreKey, -// cdc codec.Codec, -// denomID string, -// baseToken types.BaseNFT, -// ) { -// setNFT(ctx, storeKey, cdc, denomID, baseToken) -// setOwner(ctx, storeKey, cdc, denomID, baseToken.Id, baseToken.Owner) -// increaseSupply(ctx, storeKey, cdc, denomID) -// } - -// func setNFT( -// ctx sdk.Context, -// storeKey storetypes.StoreKey, -// cdc codec.Codec, -// denomID string, -// baseToken types.BaseNFT, -// ) { -// store := ctx.KVStore(storeKey) - -// bz := cdc.MustMarshal(&baseToken) -// store.Set(v2.KeyNFT(denomID, baseToken.Id), bz) -// } - -// func setOwner( -// ctx sdk.Context, -// storeKey storetypes.StoreKey, -// cdc codec.Codec, -// denomID, tokenID, owner string, -// ) { -// store := ctx.KVStore(storeKey) -// bz := mustMarshalTokenID(cdc, tokenID) -// ownerAddr := sdk.MustAccAddressFromBech32(owner) -// store.Set(v2.KeyOwner(ownerAddr, denomID, tokenID), bz) -// } - -// func increaseSupply( -// ctx sdk.Context, -// storeKey storetypes.StoreKey, -// cdc codec.Codec, -// denomID string, -// ) { -// supply := getTotalSupply(ctx, storeKey, cdc, denomID) -// supply++ - -// store := ctx.KVStore(storeKey) -// bz := mustMarshalSupply(cdc, supply) -// store.Set(v2.KeyCollection(denomID), bz) -// } - -// func getTotalSupply( -// ctx sdk.Context, -// storeKey storetypes.StoreKey, -// cdc codec.Codec, -// denomID string, -// ) uint64 { -// store := ctx.KVStore(storeKey) -// bz := store.Get(v2.KeyCollection(denomID)) -// if len(bz) == 0 { -// return 0 -// } -// return mustUnMarshalSupply(cdc, bz) -// } - -// func mustMarshalSupply(cdc codec.Codec, supply uint64) []byte { -// supplyWrap := gogotypes.UInt64Value{Value: supply} -// return cdc.MustMarshal(&supplyWrap) -// } - -// func mustUnMarshalSupply(cdc codec.Codec, value []byte) uint64 { -// var supplyWrap gogotypes.UInt64Value -// cdc.MustUnmarshal(value, &supplyWrap) -// return supplyWrap.Value -// } - -// func mustMarshalTokenID(cdc codec.Codec, tokenID string) []byte { -// tokenIDWrap := gogotypes.StringValue{Value: tokenID} -// return cdc.MustMarshal(&tokenIDWrap) -// } diff --git a/modules/nft/module.go b/modules/nft/module.go index da5a507e..f1ab12db 100644 --- a/modules/nft/module.go +++ b/modules/nft/module.go @@ -113,14 +113,8 @@ func (AppModule) Name() string { return types.ModuleName } // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), am.keeper) + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - sdknfttypes.RegisterQueryServer(cfg.QueryServer(), am.keeper.NFTkeeper()) - - m := keeper.NewMigrator(am.keeper) - if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - panic(fmt.Sprintf("failed to migrate nft from version 1 to 2: %v", err)) - } } // RegisterInvariants registers the NFT module invariants. @@ -150,7 +144,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } +func (AppModule) ConsensusVersion() uint64 { return 1 } // ____________________________________________________________________________ diff --git a/modules/nft/simulation/operations.go b/modules/nft/simulation/operations.go index 26946de6..1334b656 100644 --- a/modules/nft/simulation/operations.go +++ b/modules/nft/simulation/operations.go @@ -408,12 +408,12 @@ func SimulateMsgTransferDenom( opMsg simtypes.OperationMsg, fOps []simtypes.FutureOperation, err error, ) { denomID := randDenom(ctx, k, r, false, false) - denom, err := k.GetDenomInfo(ctx, denomID) - if err != nil { + denom,exist := k.GetDenom(ctx, denomID) + if !exist { return simtypes.NoOpMsg( types.ModuleName, types.TypeMsgTransferDenom, - err.Error(), + "denom not found", ), nil, err } @@ -496,7 +496,7 @@ func SimulateMsgIssueDenom( opMsg simtypes.OperationMsg, fOps []simtypes.FutureOperation, err error, ) { denomID := genDenomID(r) - if k.HasDenom(ctx, denomID) { + if k.HasDenomID(ctx, denomID) { return simtypes.NoOpMsg( types.ModuleName, types.TypeMsgTransferDenom, @@ -585,8 +585,8 @@ func randNFT( idx := r.Intn(len(denoms)) rndDenomID := denoms[idx] - nfts, err := k.GetNFTs(ctx, rndDenomID) - if err != nil || len(nfts) == 0 { + nfts:= k.GetNFTs(ctx, rndDenomID) + if len(nfts) == 0 { return nil, "", "" } diff --git a/modules/nft/types/builder.go b/modules/nft/types/builder.go deleted file mode 100644 index e9d19026..00000000 --- a/modules/nft/types/builder.go +++ /dev/null @@ -1,358 +0,0 @@ -package types - -import ( - "encoding/base64" - "encoding/hex" - "encoding/json" - "errors" - "fmt" - - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/nft" - proto "github.com/cosmos/gogoproto/proto" -) - -const ( - Namespace = "irismod:" - KeyMediaFieldValue = "value" -) - -var ( - ClassKeyName = fmt.Sprintf("%s%s", Namespace, "name") - ClassKeySymbol = fmt.Sprintf("%s%s", Namespace, "symbol") - ClassKeyDescription = fmt.Sprintf("%s%s", Namespace, "description") - ClassKeyURIhash = fmt.Sprintf("%s%s", Namespace, "uri_hash") - ClassKeyMintRestricted = fmt.Sprintf("%s%s", Namespace, "mint_restricted") - ClassKeyUpdateRestricted = fmt.Sprintf("%s%s", Namespace, "update_restricted") - ClassKeyCreator = fmt.Sprintf("%s%s", Namespace, "creator") - ClassKeySchema = fmt.Sprintf("%s%s", Namespace, "schema") - TokenKeyName = fmt.Sprintf("%s%s", Namespace, "name") - TokenKeyURIhash = fmt.Sprintf("%s%s", Namespace, "uri_hash") - - Base64 = base64.StdEncoding -) - -type ( - ClassBuilder struct { - cdc codec.Codec - getModuleAddress func(string) sdk.AccAddress - } - TokenBuilder struct{ cdc codec.Codec } - MediaField struct { - Value interface{} `json:"value"` - Mime string `json:"mime,omitempty"` - } -) - -func NewClassBuilder(cdc codec.Codec, - getModuleAddress func(string) sdk.AccAddress, -) ClassBuilder { - return ClassBuilder{ - cdc: cdc, - getModuleAddress: getModuleAddress, - } -} - -// BuildMetadata encode class into the metadata format defined by ics721 -func (cb ClassBuilder) BuildMetadata(class nft.Class) (string, error) { - var message proto.Message - if err := cb.cdc.UnpackAny(class.Data, &message); err != nil { - return "", err - } - - metadata, ok := message.(*DenomMetadata) - if !ok { - return "", errors.New("unsupport classMetadata") - } - - kvals := make(map[string]interface{}) - if len(metadata.Data) > 0 { - err := json.Unmarshal([]byte(metadata.Data), &kvals) - if err != nil && IsIBCDenom(class.Id) { - // when classData is not a legal json, there is no need to parse the data - return Base64.EncodeToString([]byte(metadata.Data)), nil - } - // note: if metadata.Data is null, it may cause map to be redefined as nil - if kvals == nil { - kvals = make(map[string]interface{}) - } - } - creator, err := sdk.AccAddressFromBech32(metadata.Creator) - if err != nil { - return "", err - } - - hexCreator := hex.EncodeToString(creator) - kvals[ClassKeyName] = MediaField{Value: class.Name} - kvals[ClassKeySymbol] = MediaField{Value: class.Symbol} - kvals[ClassKeyDescription] = MediaField{Value: class.Description} - kvals[ClassKeyURIhash] = MediaField{Value: class.UriHash} - kvals[ClassKeyMintRestricted] = MediaField{Value: metadata.MintRestricted} - kvals[ClassKeyUpdateRestricted] = MediaField{Value: metadata.UpdateRestricted} - kvals[ClassKeyCreator] = MediaField{Value: hexCreator} - kvals[ClassKeySchema] = MediaField{Value: metadata.Schema} - data, err := json.Marshal(kvals) - if err != nil { - return "", err - } - return Base64.EncodeToString(data), nil -} - -// Build create a class from ics721 packetData -func (cb ClassBuilder) Build(classID, classURI, classData string) (nft.Class, error) { - classDataBz, err := Base64.DecodeString(classData) - if err != nil { - return nft.Class{}, err - } - - var ( - name = "" - symbol = "" - description = "" - uriHash = "" - mintRestricted = true - updateRestricted = true - schema = "" - creator = cb.getModuleAddress(ModuleName).String() - ) - - dataMap := make(map[string]interface{}) - if err := json.Unmarshal(classDataBz, &dataMap); err != nil { - any, err := codectypes.NewAnyWithValue(&DenomMetadata{ - Creator: creator, - Schema: schema, - MintRestricted: mintRestricted, - UpdateRestricted: updateRestricted, - Data: string(classDataBz), - }) - if err != nil { - return nft.Class{}, err - } - return nft.Class{ - Id: classID, - Uri: classURI, - Name: name, - Symbol: symbol, - Description: description, - UriHash: uriHash, - Data: any, - }, nil - } - if v, ok := dataMap[ClassKeyName]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { - name = vStr - delete(dataMap, ClassKeyName) - } - } - } - - if v, ok := dataMap[ClassKeySymbol]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { - symbol = vStr - delete(dataMap, ClassKeySymbol) - } - } - } - - if v, ok := dataMap[ClassKeyDescription]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { - description = vStr - delete(dataMap, ClassKeyDescription) - } - } - } - - if v, ok := dataMap[ClassKeyURIhash]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { - uriHash = vStr - delete(dataMap, ClassKeyURIhash) - } - } - } - - if v, ok := dataMap[ClassKeyMintRestricted]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vBool, ok := vMap[KeyMediaFieldValue].(bool); ok { - mintRestricted = vBool - delete(dataMap, ClassKeyMintRestricted) - } - } - } - - if v, ok := dataMap[ClassKeyUpdateRestricted]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vBool, ok := vMap[KeyMediaFieldValue].(bool); ok { - updateRestricted = vBool - delete(dataMap, ClassKeyUpdateRestricted) - } - } - } - - if v, ok := dataMap[ClassKeyCreator]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { - creatorAcc, err := sdk.AccAddressFromHexUnsafe(vStr) - if err != nil { - return nft.Class{}, err - } - creator = creatorAcc.String() - delete(dataMap, ClassKeyCreator) - } - } - } - - if v, ok := dataMap[ClassKeySchema]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { - schema = vStr - delete(dataMap, ClassKeySchema) - } - } - } - - data := "" - if len(dataMap) > 0 { - dataBz, err := json.Marshal(dataMap) - if err != nil { - return nft.Class{}, err - } - data = string(dataBz) - } - - any, err := codectypes.NewAnyWithValue(&DenomMetadata{ - Creator: creator, - Schema: schema, - MintRestricted: mintRestricted, - UpdateRestricted: updateRestricted, - Data: data, - }) - if err != nil { - return nft.Class{}, err - } - - return nft.Class{ - Id: classID, - Uri: classURI, - Name: name, - Symbol: symbol, - Description: description, - UriHash: uriHash, - Data: any, - }, nil -} - -func NewTokenBuilder(cdc codec.Codec) TokenBuilder { - return TokenBuilder{ - cdc: cdc, - } -} - -// BuildMetadata encode nft into the metadata format defined by ics721 -func (tb TokenBuilder) BuildMetadata(token nft.NFT) (string, error) { - var message proto.Message - if err := tb.cdc.UnpackAny(token.Data, &message); err != nil { - return "", err - } - - nftMetadata, ok := message.(*NFTMetadata) - if !ok { - return "", errors.New("unsupport classMetadata") - } - kvals := make(map[string]interface{}) - if len(nftMetadata.Data) > 0 { - err := json.Unmarshal([]byte(nftMetadata.Data), &kvals) - if err != nil && IsIBCDenom(token.ClassId) { - // when nftMetadata is not a legal json, there is no need to parse the data - return Base64.EncodeToString([]byte(nftMetadata.Data)), nil - } - // note: if nftMetadata.Data is null, it may cause map to be redefined as nil - if kvals == nil { - kvals = make(map[string]interface{}) - } - } - kvals[TokenKeyName] = MediaField{Value: nftMetadata.Name} - kvals[TokenKeyURIhash] = MediaField{Value: token.UriHash} - data, err := json.Marshal(kvals) - if err != nil { - return "", err - } - return Base64.EncodeToString(data), nil -} - -// Build create a nft from ics721 packet data -func (tb TokenBuilder) Build(classId, tokenId, tokenURI, tokenData string) (nft.NFT, error) { - tokenDataBz, err := Base64.DecodeString(tokenData) - if err != nil { - return nft.NFT{}, err - } - - dataMap := make(map[string]interface{}) - if err := json.Unmarshal(tokenDataBz, &dataMap); err != nil { - metadata, err := codectypes.NewAnyWithValue(&NFTMetadata{ - Data: string(tokenDataBz), - }) - if err != nil { - return nft.NFT{}, err - } - - return nft.NFT{ - ClassId: classId, - Id: tokenId, - Uri: tokenURI, - Data: metadata, - }, nil - } - - var ( - name string - uriHash string - ) - if v, ok := dataMap[TokenKeyName]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { - name = vStr - delete(dataMap, TokenKeyName) - } - } - } - - if v, ok := dataMap[TokenKeyURIhash]; ok { - if vMap, ok := v.(map[string]interface{}); ok { - if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { - uriHash = vStr - delete(dataMap, TokenKeyURIhash) - } - } - } - - data := "" - if len(dataMap) > 0 { - dataBz, err := json.Marshal(dataMap) - if err != nil { - return nft.NFT{}, err - } - data = string(dataBz) - } - - metadata, err := codectypes.NewAnyWithValue(&NFTMetadata{ - Name: name, - Data: data, - }) - if err != nil { - return nft.NFT{}, err - } - - return nft.NFT{ - ClassId: classId, - Id: tokenId, - Uri: tokenURI, - UriHash: uriHash, - Data: metadata, - }, nil -} diff --git a/modules/nft/types/builder_test.go b/modules/nft/types/builder_test.go deleted file mode 100644 index 34a4a674..00000000 --- a/modules/nft/types/builder_test.go +++ /dev/null @@ -1,249 +0,0 @@ -package types - -import ( - "encoding/json" - "testing" - - "github.com/cometbft/cometbft/crypto" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/nft" - "github.com/cosmos/gogoproto/proto" - "github.com/stretchr/testify/require" -) - -func TestTokenBuilder_Build(t *testing.T) { - nftMetadata := NFTMetadata{ - Name: "My Cat", - Data: "{\"key1\":\"value1\",\"key2\":\"value2\"}", - } - - bz, err := json.Marshal(nftMetadata) - require.NoError(t, err, " nftMetadata json.Marshal failed") - t.Logf("%s", bz) - - any, err := codectypes.NewAnyWithValue(&nftMetadata) - require.NoError(t, err, " nftMetadata codectypes.NewAnyWithValue failed") - - token := nft.NFT{ - ClassId: "kitty", - Id: "cat", - Uri: "uri", - UriHash: "uri_hash", - Data: any, - } - - cdc := GetEncoding() - bz, err = cdc.MarshalJSON(&token) - require.NoError(t, err, " token MarshalJSON failed") - t.Logf("%s", bz) - - builder := NewTokenBuilder(cdc) - result, err := builder.BuildMetadata(token) - require.NoError(t, err, " token builder.BuildMetadata failed") - t.Log(result) - - expToken, err := builder.Build(token.ClassId, token.Id, token.Uri, result) - require.NoError(t, err, " token builder.Build failed") - - exp, err := cdc.MarshalInterfaceJSON(&token) - require.NoError(t, err, " token cdc.MarshalInterfaceJSON failed") - t.Logf("%s", exp) - - act, err := cdc.MarshalInterfaceJSON(&expToken) - require.NoError(t, err, " token cdc.MarshalInterfaceJSON failed") - t.Logf("%s", act) - - require.Equal(t, act, exp, "not equal") -} - -func GetEncoding() codec.Codec { - interfaceRegistry := codectypes.NewInterfaceRegistry() - interfaceRegistry.RegisterImplementations( - (*proto.Message)(nil), - &nft.Class{}, - &nft.NFT{}, - &DenomMetadata{}, - &NFTMetadata{}, - ) - marshaler := codec.NewProtoCodec(interfaceRegistry) - return marshaler -} - -func TestClassBuilder_BuildMetadata(t *testing.T) { - creator, err := sdk.AccAddressFromHexUnsafe( - crypto.AddressHash([]byte("test_consumer")).String(), - ) - require.NoError(t, err, "AccAddressFromHexUnsafe failed") - - cdc := GetEncoding() - getModuleAddress := func(_ string) sdk.AccAddress { - return creator - } - class := nft.Class{ - Name: "kitty", - Symbol: "symbol", - Description: "digital cat", - Uri: "uri", - UriHash: "uri_hash", - } - denomMetadata := DenomMetadata{ - Creator: creator.String(), - Schema: "{}", - MintRestricted: true, - UpdateRestricted: true, - } - - type args struct { - classID string - classData string - } - tests := []struct { - name string - args args - want string - wantErr bool - }{ - { - name: "empty classData", - args: args{ - classID: "cat", - classData: "", - }, - want: `{"irismod:creator":{"value":"f8a9eee6bce5bc043e5feec2baef355f87dbfcdf"},"irismod:description":{"value":"digital cat"},"irismod:mint_restricted":{"value":true},"irismod:name":{"value":"kitty"},"irismod:schema":{"value":"{}"},"irismod:symbol":{"value":"symbol"},"irismod:update_restricted":{"value":true},"irismod:uri_hash":{"value":"uri_hash"}}`, - wantErr: false, - }, - { - name: "classData is invalid json string", - args: args{ - classID: "cat", - classData: "hhaahha", - }, - want: `{"irismod:creator":{"value":"f8a9eee6bce5bc043e5feec2baef355f87dbfcdf"},"irismod:description":{"value":"digital cat"},"irismod:mint_restricted":{"value":true},"irismod:name":{"value":"kitty"},"irismod:schema":{"value":"{}"},"irismod:symbol":{"value":"symbol"},"irismod:update_restricted":{"value":true},"irismod:uri_hash":{"value":"uri_hash"}}`, - wantErr: false, - }, - { - name: "classData is valid json string", - args: args{ - classID: "cat", - classData: "{\"key1\":\"value1\",\"key2\":\"value2\"}", - }, - want: `{"irismod:creator":{"value":"f8a9eee6bce5bc043e5feec2baef355f87dbfcdf"},"irismod:description":{"value":"digital cat"},"irismod:mint_restricted":{"value":true},"irismod:name":{"value":"kitty"},"irismod:schema":{"value":"{}"},"irismod:symbol":{"value":"symbol"},"irismod:update_restricted":{"value":true},"irismod:uri_hash":{"value":"uri_hash"},"key1":"value1","key2":"value2"}`, - wantErr: false, - }, - { - name: "class is IBC assets and classData is invalid json string", - args: args{ - classID: "ibc/943B966B2B8A53C50A198EDAB7C9A41FCEAF24400A94167846679769D8BF8311", - classData: "hahhahha", - }, - want: `hahhahha`, - wantErr: false, - }, - { - name: "class is IBC assets and classData is valid json string", - args: args{ - classID: "ibc/943B966B2B8A53C50A198EDAB7C9A41FCEAF24400A94167846679769D8BF8311", - classData: "{\"key1\":\"value1\",\"key2\":\"value2\"}", - }, - want: `{"irismod:creator":{"value":"f8a9eee6bce5bc043e5feec2baef355f87dbfcdf"},"irismod:description":{"value":"digital cat"},"irismod:mint_restricted":{"value":true},"irismod:name":{"value":"kitty"},"irismod:schema":{"value":"{}"},"irismod:symbol":{"value":"symbol"},"irismod:update_restricted":{"value":true},"irismod:uri_hash":{"value":"uri_hash"},"key1":"value1","key2":"value2"}`, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cb := ClassBuilder{ - cdc: cdc, - getModuleAddress: getModuleAddress, - } - - denomMetadata.Data = tt.args.classData - any, err := codectypes.NewAnyWithValue(&denomMetadata) - require.NoError(t, err, " denomMetadata codectypes.NewAnyWithValue failed") - - class.Id = tt.args.classID - class.Data = any - - got, err := cb.BuildMetadata(class) - want := Base64.EncodeToString([]byte(tt.want)) - if (err != nil) != tt.wantErr { - t.Errorf("ClassBuilder.BuildMetadata() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != want { - t.Errorf("ClassBuilder.BuildMetadata() = %v, want %v", got, tt.want) - } - }) - } -} - -func TestClassBuilder_Build(t *testing.T) { - creator, err := sdk.AccAddressFromHexUnsafe( - crypto.AddressHash([]byte("test_consumer")).String(), - ) - require.NoError(t, err, "AccAddressFromHexUnsafe failed") - - cdc := GetEncoding() - getModuleAddress := func(_ string) sdk.AccAddress { - return creator - } - classID := "cat" - classURI := "uri" - - type args struct { - classData string - } - tests := []struct { - name string - args args - want string - wantErr bool - }{ - { - name: "empty classData", - args: args{ - classData: `{"irismod:creator":{"value":"f8a9eee6bce5bc043e5feec2baef355f87dbfcdf"},"irismod:description":{"value":"digital cat"},"irismod:mint_restricted":{"value":true},"irismod:name":{"value":"kitty"},"irismod:schema":{"value":"{}"},"irismod:symbol":{"value":"symbol"},"irismod:update_restricted":{"value":true},"irismod:uri_hash":{"value":"uri_hash"}}`, - }, - want: `{"@type":"/cosmos.nft.v1beta1.Class","id":"cat","name":"kitty","symbol":"symbol","description":"digital cat","uri":"uri","uri_hash":"uri_hash","data":{"@type":"/irismod.nft.DenomMetadata","creator":"cosmos1lz57ae4uuk7qg0jlampt4me4t7rahlxl5pnn3y","schema":"{}","mint_restricted":true,"update_restricted":true,"data":""}}`, - wantErr: false, - }, - { - name: "classData is invalid json string", - args: args{ - classData: `this is empty class data`, - }, - want: `{"@type":"/cosmos.nft.v1beta1.Class","id":"cat","name":"","symbol":"","description":"","uri":"uri","uri_hash":"","data":{"@type":"/irismod.nft.DenomMetadata","creator":"cosmos1lz57ae4uuk7qg0jlampt4me4t7rahlxl5pnn3y","schema":"","mint_restricted":true,"update_restricted":true,"data":"this is empty class data"}}`, - wantErr: false, - }, - { - name: "classData is valid json string", - args: args{ - classData: `{"irismod:creator":{"value":"f8a9eee6bce5bc043e5feec2baef355f87dbfcdf"},"irismod:description":{"value":"digital cat"},"irismod:mint_restricted":{"value":true},"irismod:name":{"value":"kitty"},"irismod:schema":{"value":"{}"},"irismod:symbol":{"value":"symbol"},"irismod:update_restricted":{"value":true},"irismod:uri_hash":{"value":"uri_hash"},"key1":"value1","key2":"value2"}`, - }, - want: `{"@type":"/cosmos.nft.v1beta1.Class","id":"cat","name":"kitty","symbol":"symbol","description":"digital cat","uri":"uri","uri_hash":"uri_hash","data":{"@type":"/irismod.nft.DenomMetadata","creator":"cosmos1lz57ae4uuk7qg0jlampt4me4t7rahlxl5pnn3y","schema":"{}","mint_restricted":true,"update_restricted":true,"data":"{\"key1\":\"value1\",\"key2\":\"value2\"}"}}`, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cb := ClassBuilder{ - cdc: cdc, - getModuleAddress: getModuleAddress, - } - classDataRaw := Base64.EncodeToString([]byte(tt.args.classData)) - result, err := cb.Build(classID, classURI, classDataRaw) - if (err != nil) != tt.wantErr { - t.Errorf("ClassBuilder.BuildMetadata() error = %v, wantErr %v", err, tt.wantErr) - return - } - - got, err := cdc.MarshalInterfaceJSON(&result) - require.NoError(t, err, " class cdc.MarshalInterfaceJSON failed") - - if string(got) != tt.want { - t.Errorf("ClassBuilder.BuildMetadata() = %v, want %v", string(got), tt.want) - } - }) - } -} diff --git a/modules/nft/types/codec.go b/modules/nft/types/codec.go index 5adf393f..f402f785 100644 --- a/modules/nft/types/codec.go +++ b/modules/nft/types/codec.go @@ -8,7 +8,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" - proto "github.com/cosmos/gogoproto/proto" + gogotypes "github.com/gogo/protobuf/types" "mods.irisnet.org/modules/nft/exported" ) @@ -37,6 +37,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&BaseNFT{}, "irismod/nft/BaseNFT", nil) } +// RegisterInterfaces registers the interfaces types with the interface registry func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), @@ -53,11 +54,31 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &BaseNFT{}, ) - registry.RegisterImplementations( - (*proto.Message)(nil), - &DenomMetadata{}, - &NFTMetadata{}, - ) - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } + +// MustMarshalSupply return supply protobuf code +func MustMarshalSupply(cdc codec.Codec, supply uint64) []byte { + supplyWrap := gogotypes.UInt64Value{Value: supply} + return cdc.MustMarshal(&supplyWrap) +} + +// MustUnMarshalSupply return the supply +func MustUnMarshalSupply(cdc codec.Codec, value []byte) uint64 { + var supplyWrap gogotypes.UInt64Value + cdc.MustUnmarshal(value, &supplyWrap) + return supplyWrap.Value +} + +// MustMarshalTokenID return the tokenID protobuf code +func MustMarshalTokenID(cdc codec.Codec, tokenID string) []byte { + tokenIDWrap := gogotypes.StringValue{Value: tokenID} + return cdc.MustMarshal(&tokenIDWrap) +} + +// MustUnMarshalTokenID return th tokenID +func MustUnMarshalTokenID(cdc codec.Codec, value []byte) string { + var tokenIDWrap gogotypes.StringValue + cdc.MustUnmarshal(value, &tokenIDWrap) + return tokenIDWrap.Value +} \ No newline at end of file diff --git a/modules/nft/types/keys.go b/modules/nft/types/keys.go index d1b6fcda..91f96278 100644 --- a/modules/nft/types/keys.go +++ b/modules/nft/types/keys.go @@ -1,5 +1,12 @@ package types +import ( + "bytes" + "errors" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + const ( // ModuleName is the name of the module ModuleName = "nft" @@ -13,3 +20,89 @@ const ( // RouterKey is the message route for the NFT module RouterKey = ModuleName ) + +var ( + PrefixNFT = []byte{0x01} + PrefixOwners = []byte{0x02} // key for a owner + PrefixCollection = []byte{0x03} // key for balance of NFTs held by the denom + PrefixDenom = []byte{0x04} // key for denom of the nft + PrefixDenomName = []byte{0x05} // key for denom name of the nft + + delimiter = []byte("/") +) + +// SplitKeyOwner return the address,denom,id from the key of stored owner +func SplitKeyOwner(key []byte) (address sdk.AccAddress, denomID, tokenID string, err error) { + key = key[len(PrefixOwners)+len(delimiter):] + keys := bytes.Split(key, delimiter) + if len(keys) != 3 { + return address, denomID, tokenID, errors.New("wrong KeyBalance") + } + + address, _ = sdk.AccAddressFromBech32(string(keys[0])) + denomID = string(keys[1]) + tokenID = string(keys[2]) + return +} + +func SplitKeyDenom(key []byte) (denomID, tokenID string, err error) { + keys := bytes.Split(key, delimiter) + if len(keys) != 2 { + return denomID, tokenID, errors.New("wrong KeyBalance") + } + + denomID = string(keys[0]) + tokenID = string(keys[1]) + return +} + +// KeyBalance gets the key of a collection owned by an account address +func KeyOwner(address sdk.AccAddress, denomID, tokenID string) []byte { + key := append(PrefixOwners, delimiter...) + if address != nil { + key = append(key, []byte(address.String())...) + key = append(key, delimiter...) + } + + if address != nil && len(denomID) > 0 { + key = append(key, []byte(denomID)...) + key = append(key, delimiter...) + } + + if address != nil && len(denomID) > 0 && len(tokenID) > 0 { + key = append(key, []byte(tokenID)...) + } + return key +} + +// KeyNFT gets the key of nft stored by an denom and id +func KeyNFT(denomID, tokenID string) []byte { + key := append(PrefixNFT, delimiter...) + if len(denomID) > 0 { + key = append(key, []byte(denomID)...) + key = append(key, delimiter...) + } + + if len(denomID) > 0 && len(tokenID) > 0 { + key = append(key, []byte(tokenID)...) + } + return key +} + +// KeyCollection gets the storeKey by the collection +func KeyCollection(denomID string) []byte { + key := append(PrefixCollection, delimiter...) + return append(key, []byte(denomID)...) +} + +// KeyDenom gets the storeKey by the denom id +func KeyDenomID(id string) []byte { + key := append(PrefixDenom, delimiter...) + return append(key, []byte(id)...) +} + +// KeyDenomName gets the storeKey by the denom name +func KeyDenomName(name string) []byte { + key := append(PrefixDenomName, delimiter...) + return append(key, []byte(name)...) +} diff --git a/modules/nft/types/nft.go b/modules/nft/types/nft.go index 6827893a..29b102a6 100644 --- a/modules/nft/types/nft.go +++ b/modules/nft/types/nft.go @@ -1,7 +1,6 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "mods.irisnet.org/modules/nft/exported" @@ -57,15 +56,3 @@ func (bnft BaseNFT) GetData() string { // NFTs define a list of NFT type NFTs []exported.NFT - -func UnmarshalNFTMetadata(cdc codec.Codec, bz []byte) (NFTMetadata, error) { - var nftMetadata NFTMetadata - if len(bz) == 0 { - return nftMetadata, nil - } - - if err := cdc.Unmarshal(bz, &nftMetadata); err != nil { - return nftMetadata, err - } - return nftMetadata, nil -} diff --git a/modules/nft/types/nft.pb.go b/modules/nft/types/nft.pb.go index aff43ce7..f0238b96 100644 --- a/modules/nft/types/nft.pb.go +++ b/modules/nft/types/nft.pb.go @@ -66,44 +66,6 @@ func (m *BaseNFT) XXX_DiscardUnknown() { var xxx_messageInfo_BaseNFT proto.InternalMessageInfo -type NFTMetadata struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *NFTMetadata) Reset() { *m = NFTMetadata{} } -func (m *NFTMetadata) String() string { return proto.CompactTextString(m) } -func (*NFTMetadata) ProtoMessage() {} -func (*NFTMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_6d2de7def41e3c0b, []int{1} -} -func (m *NFTMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NFTMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NFTMetadata.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 *NFTMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_NFTMetadata.Merge(m, src) -} -func (m *NFTMetadata) XXX_Size() int { - return m.Size() -} -func (m *NFTMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_NFTMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_NFTMetadata proto.InternalMessageInfo - // Denom defines a type of NFT type Denom struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -123,7 +85,7 @@ func (m *Denom) Reset() { *m = Denom{} } func (m *Denom) String() string { return proto.CompactTextString(m) } func (*Denom) ProtoMessage() {} func (*Denom) Descriptor() ([]byte, []int) { - return fileDescriptor_6d2de7def41e3c0b, []int{2} + return fileDescriptor_6d2de7def41e3c0b, []int{1} } func (m *Denom) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -152,47 +114,6 @@ func (m *Denom) XXX_DiscardUnknown() { var xxx_messageInfo_Denom proto.InternalMessageInfo -type DenomMetadata struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Schema string `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - MintRestricted bool `protobuf:"varint,3,opt,name=mint_restricted,json=mintRestricted,proto3" json:"mint_restricted,omitempty"` - UpdateRestricted bool `protobuf:"varint,4,opt,name=update_restricted,json=updateRestricted,proto3" json:"update_restricted,omitempty"` - Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *DenomMetadata) Reset() { *m = DenomMetadata{} } -func (m *DenomMetadata) String() string { return proto.CompactTextString(m) } -func (*DenomMetadata) ProtoMessage() {} -func (*DenomMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_6d2de7def41e3c0b, []int{3} -} -func (m *DenomMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DenomMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DenomMetadata.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 *DenomMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_DenomMetadata.Merge(m, src) -} -func (m *DenomMetadata) XXX_Size() int { - return m.Size() -} -func (m *DenomMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_DenomMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_DenomMetadata proto.InternalMessageInfo - // IDCollection defines a type of collection with specified ID type IDCollection struct { DenomId string `protobuf:"bytes,1,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` @@ -203,7 +124,7 @@ func (m *IDCollection) Reset() { *m = IDCollection{} } func (m *IDCollection) String() string { return proto.CompactTextString(m) } func (*IDCollection) ProtoMessage() {} func (*IDCollection) Descriptor() ([]byte, []int) { - return fileDescriptor_6d2de7def41e3c0b, []int{4} + return fileDescriptor_6d2de7def41e3c0b, []int{2} } func (m *IDCollection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -242,7 +163,7 @@ func (m *Owner) Reset() { *m = Owner{} } func (m *Owner) String() string { return proto.CompactTextString(m) } func (*Owner) ProtoMessage() {} func (*Owner) Descriptor() ([]byte, []int) { - return fileDescriptor_6d2de7def41e3c0b, []int{5} + return fileDescriptor_6d2de7def41e3c0b, []int{3} } func (m *Owner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -281,7 +202,7 @@ func (m *Collection) Reset() { *m = Collection{} } func (m *Collection) String() string { return proto.CompactTextString(m) } func (*Collection) ProtoMessage() {} func (*Collection) Descriptor() ([]byte, []int) { - return fileDescriptor_6d2de7def41e3c0b, []int{6} + return fileDescriptor_6d2de7def41e3c0b, []int{4} } func (m *Collection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -312,9 +233,7 @@ var xxx_messageInfo_Collection proto.InternalMessageInfo func init() { proto.RegisterType((*BaseNFT)(nil), "irismod.nft.BaseNFT") - proto.RegisterType((*NFTMetadata)(nil), "irismod.nft.NFTMetadata") proto.RegisterType((*Denom)(nil), "irismod.nft.Denom") - proto.RegisterType((*DenomMetadata)(nil), "irismod.nft.DenomMetadata") proto.RegisterType((*IDCollection)(nil), "irismod.nft.IDCollection") proto.RegisterType((*Owner)(nil), "irismod.nft.Owner") proto.RegisterType((*Collection)(nil), "irismod.nft.Collection") @@ -323,47 +242,43 @@ func init() { func init() { proto.RegisterFile("irismod/nft/nft.proto", fileDescriptor_6d2de7def41e3c0b) } var fileDescriptor_6d2de7def41e3c0b = []byte{ - // 630 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcf, 0x6a, 0xdb, 0x4e, - 0x10, 0xb6, 0x64, 0x39, 0xb2, 0x47, 0xf9, 0xf7, 0xdb, 0x9f, 0x5b, 0x94, 0x1e, 0xa4, 0x20, 0x0a, - 0x0d, 0x14, 0x1c, 0x9a, 0x42, 0x0f, 0xe9, 0xa5, 0xa8, 0x21, 0xd4, 0x87, 0xa6, 0x20, 0xd2, 0x4b, - 0x2f, 0x46, 0xd1, 0xae, 0xe3, 0xa5, 0x96, 0xd6, 0xec, 0xae, 0x09, 0xe9, 0x4b, 0xb4, 0xd0, 0x17, - 0xe8, 0x2b, 0x14, 0xfa, 0x10, 0x39, 0xe6, 0xd8, 0x93, 0x69, 0x9d, 0x4b, 0xcf, 0x79, 0x82, 0xa2, - 0x91, 0xe4, 0xca, 0xb8, 0x85, 0x1c, 0x0c, 0x33, 0xdf, 0x7c, 0xbb, 0xf3, 0xcd, 0x37, 0xd6, 0xc2, - 0x3d, 0x2e, 0xb9, 0x4a, 0x05, 0xdd, 0xcf, 0x86, 0x3a, 0xff, 0xf5, 0x26, 0x52, 0x68, 0x41, 0x9c, - 0x12, 0xee, 0x65, 0x43, 0xfd, 0xa0, 0x7b, 0x2e, 0xce, 0x05, 0xe2, 0xfb, 0x79, 0x54, 0x50, 0x82, - 0xcf, 0x06, 0xd8, 0x61, 0xac, 0xd8, 0xc9, 0xf1, 0x29, 0xd9, 0x04, 0x93, 0x53, 0xd7, 0xd8, 0x35, - 0xf6, 0x3a, 0x91, 0xc9, 0x29, 0x21, 0x60, 0x65, 0x71, 0xca, 0x5c, 0x13, 0x11, 0x8c, 0xc9, 0x0e, - 0x34, 0xa7, 0x92, 0xbb, 0xcd, 0x1c, 0x0a, 0xed, 0xf9, 0xcc, 0x6f, 0xbe, 0x8d, 0xfa, 0x51, 0x8e, - 0xe5, 0x74, 0x1a, 0xeb, 0xd8, 0xb5, 0x0a, 0x7a, 0x1e, 0x93, 0x2e, 0xb4, 0xc4, 0x45, 0xc6, 0xa4, - 0xdb, 0x42, 0xb0, 0x48, 0xc8, 0x0e, 0xb4, 0xa7, 0x92, 0x0f, 0x46, 0xb1, 0x1a, 0xb9, 0x6b, 0x58, - 0xb0, 0xa7, 0x92, 0xbf, 0x8a, 0xd5, 0xe8, 0xd0, 0xfa, 0xf5, 0xc5, 0x37, 0x82, 0xe7, 0xe0, 0x9c, - 0x1c, 0x9f, 0xbe, 0x66, 0x3a, 0xc6, 0x5b, 0x2a, 0x21, 0x46, 0x4d, 0x48, 0xd5, 0xcd, 0xfc, 0xd3, - 0xad, 0x3c, 0xfc, 0xcd, 0x84, 0xd6, 0x11, 0xcb, 0x44, 0x7a, 0xa7, 0x81, 0xee, 0xc3, 0x9a, 0x4a, - 0x46, 0x2c, 0x8d, 0x8b, 0x99, 0xa2, 0x32, 0x23, 0x2e, 0xd8, 0x89, 0x64, 0xb1, 0x16, 0xb2, 0x1c, - 0xa8, 0x4a, 0xf1, 0xc4, 0x65, 0x7a, 0x26, 0xc6, 0xe5, 0x50, 0x65, 0x46, 0x1e, 0xc1, 0x56, 0xca, - 0x33, 0x3d, 0x90, 0x4c, 0x69, 0xc9, 0x13, 0xcd, 0x28, 0x0e, 0xd7, 0x8e, 0x36, 0x73, 0x38, 0x5a, - 0xa0, 0xe4, 0x31, 0xfc, 0x37, 0x9d, 0xd0, 0x58, 0xb3, 0x3a, 0xd5, 0x46, 0xea, 0x76, 0x51, 0xa8, - 0x91, 0x77, 0xc1, 0xa1, 0x4c, 0x25, 0x92, 0x4f, 0x34, 0x17, 0x99, 0xdb, 0xc6, 0x96, 0x75, 0x88, - 0x6c, 0x17, 0x2b, 0xe9, 0x60, 0x05, 0x37, 0x51, 0xf7, 0x17, 0x96, 0xfc, 0x5d, 0xd8, 0xe6, 0xac, - 0xd8, 0xf6, 0xd5, 0x80, 0x0d, 0xb4, 0x6d, 0x61, 0x7b, 0xcd, 0x02, 0x63, 0xd5, 0x82, 0xc2, 0x34, - 0x73, 0xc9, 0xb4, 0xbf, 0x58, 0xd0, 0xbc, 0xbb, 0x05, 0xd6, 0x3f, 0x2c, 0xa8, 0x34, 0xb7, 0x56, - 0x34, 0x5f, 0xc0, 0x7a, 0xff, 0xe8, 0xa5, 0x18, 0x8f, 0x59, 0x82, 0x56, 0xf4, 0xa0, 0x4d, 0xf3, - 0x11, 0x06, 0xd5, 0xda, 0xc3, 0xff, 0x6f, 0x67, 0xfe, 0xd6, 0x65, 0x9c, 0x8e, 0x0f, 0x83, 0xaa, - 0x12, 0x44, 0x36, 0x86, 0x7d, 0x4a, 0x9e, 0x40, 0x47, 0x8b, 0xf7, 0x2c, 0x1b, 0x70, 0xaa, 0x5c, - 0x73, 0xb7, 0xb9, 0xd7, 0x09, 0xbb, 0xb7, 0x33, 0x7f, 0xbb, 0x38, 0xb0, 0x28, 0x05, 0x51, 0x1b, - 0xe3, 0x3e, 0x55, 0x65, 0xe3, 0x8f, 0x06, 0xb4, 0xde, 0xe0, 0x7f, 0xd9, 0x05, 0x3b, 0xa6, 0x54, - 0x32, 0xa5, 0x2a, 0x93, 0xca, 0x94, 0x0c, 0x61, 0x93, 0xd3, 0x41, 0xb2, 0x50, 0x57, 0x74, 0x70, - 0x0e, 0x76, 0x7a, 0xb5, 0xcf, 0xb2, 0x57, 0xd7, 0x1f, 0x3e, 0xbc, 0x9a, 0xf9, 0x8d, 0xf9, 0xcc, - 0xdf, 0xa8, 0xa3, 0xea, 0x76, 0xe6, 0x3b, 0x85, 0x22, 0x4e, 0x13, 0x15, 0x44, 0x1b, 0x9c, 0xd6, - 0xaa, 0xa5, 0xa2, 0x0f, 0x00, 0x4b, 0x46, 0xb4, 0x70, 0x46, 0xd4, 0xe4, 0x1c, 0x90, 0xa5, 0x96, - 0xb8, 0xe5, 0xd0, 0xca, 0x7b, 0x45, 0x05, 0x8d, 0x3c, 0x03, 0x2b, 0x1b, 0xea, 0x4a, 0x61, 0x77, - 0x89, 0x5e, 0x3e, 0x0f, 0xe1, 0x7a, 0x29, 0xce, 0x3a, 0x39, 0x3e, 0x55, 0x11, 0xf2, 0x8b, 0xde, - 0xe1, 0x8b, 0xab, 0x9f, 0x5e, 0xe3, 0x6a, 0xee, 0x19, 0xd7, 0x73, 0xcf, 0xf8, 0x31, 0xf7, 0x8c, - 0x4f, 0x37, 0x5e, 0xe3, 0xfa, 0xc6, 0x6b, 0x7c, 0xbf, 0xf1, 0x1a, 0xef, 0x82, 0x54, 0x50, 0x85, - 0x37, 0x66, 0x4c, 0xf7, 0x84, 0x3c, 0xdf, 0x4f, 0x05, 0x9d, 0x8e, 0x99, 0xc2, 0xd7, 0x4a, 0x5f, - 0x4e, 0x98, 0x3a, 0x5b, 0xc3, 0xd7, 0xe8, 0xe9, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x96, - 0xcc, 0x40, 0xc9, 0x04, 0x00, 0x00, + // 571 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x8e, 0xd3, 0x3c, + 0x14, 0x6d, 0xda, 0x74, 0xd2, 0xde, 0xcc, 0x4f, 0x3f, 0x7f, 0x05, 0xa5, 0x2c, 0x92, 0x2a, 0x42, + 0x62, 0x24, 0xa4, 0x54, 0x0c, 0x12, 0x8b, 0x59, 0xa1, 0x30, 0x1a, 0xd1, 0xcd, 0x20, 0x45, 0xc3, + 0x86, 0x4d, 0x95, 0x89, 0xdd, 0xd6, 0xa2, 0x89, 0x2b, 0xdb, 0xd5, 0xa8, 0xbc, 0x04, 0x48, 0xbc, + 0x00, 0x0f, 0xc1, 0x43, 0x74, 0x39, 0x4b, 0x56, 0x11, 0xb4, 0x1b, 0xd6, 0x7d, 0x02, 0x14, 0xc7, + 0x2d, 0xe9, 0x8e, 0x45, 0xa4, 0x7b, 0xcf, 0x3d, 0xf6, 0x39, 0x39, 0xb6, 0xe1, 0x11, 0xe5, 0x54, + 0xa4, 0x0c, 0x0f, 0xb2, 0xb1, 0x2c, 0xbe, 0x60, 0xce, 0x99, 0x64, 0xc8, 0xd6, 0x70, 0x90, 0x8d, + 0xe5, 0x93, 0xee, 0x84, 0x4d, 0x98, 0xc2, 0x07, 0x45, 0x55, 0x52, 0xfc, 0xaf, 0x06, 0x58, 0x61, + 0x2c, 0xc8, 0xcd, 0xf5, 0x2d, 0x3a, 0x85, 0x3a, 0xc5, 0x8e, 0xd1, 0x37, 0xce, 0xdb, 0x51, 0x9d, + 0x62, 0x84, 0xc0, 0xcc, 0xe2, 0x94, 0x38, 0x75, 0x85, 0xa8, 0x1a, 0xf5, 0xa0, 0xb1, 0xe0, 0xd4, + 0x69, 0x14, 0x50, 0x68, 0xad, 0x73, 0xaf, 0xf1, 0x3e, 0x1a, 0x46, 0x05, 0x56, 0xd0, 0x71, 0x2c, + 0x63, 0xc7, 0x2c, 0xe9, 0x45, 0x8d, 0xba, 0xd0, 0x64, 0xf7, 0x19, 0xe1, 0x4e, 0x53, 0x81, 0x65, + 0x83, 0x7a, 0xd0, 0x5a, 0x70, 0x3a, 0x9a, 0xc6, 0x62, 0xea, 0x1c, 0xa9, 0x81, 0xb5, 0xe0, 0xf4, + 0x6d, 0x2c, 0xa6, 0x97, 0xe6, 0xef, 0x6f, 0x9e, 0xe1, 0x7f, 0xaf, 0x43, 0xf3, 0x8a, 0x64, 0x2c, + 0xfd, 0x27, 0x4f, 0x8f, 0xe1, 0x48, 0x24, 0x53, 0x92, 0xc6, 0xa5, 0xad, 0x48, 0x77, 0xc8, 0x01, + 0x2b, 0xe1, 0x24, 0x96, 0x8c, 0x6b, 0x4f, 0xbb, 0x56, 0xad, 0x58, 0xa6, 0x77, 0x6c, 0xa6, 0x7d, + 0xe9, 0x0e, 0x3d, 0x83, 0xb3, 0x94, 0x66, 0x72, 0xc4, 0x89, 0x90, 0x9c, 0x26, 0x92, 0x60, 0xe5, + 0xaf, 0x15, 0x9d, 0x16, 0x70, 0xb4, 0x47, 0xd1, 0x73, 0xf8, 0x6f, 0x31, 0xc7, 0xb1, 0x24, 0x55, + 0xaa, 0xa5, 0xa8, 0x9d, 0x72, 0x50, 0x21, 0xf7, 0xc1, 0xc6, 0x44, 0x24, 0x9c, 0xce, 0x25, 0x65, + 0x99, 0xd3, 0x52, 0x92, 0x55, 0x08, 0x75, 0xca, 0x54, 0xdb, 0x6a, 0xa2, 0xc2, 0xac, 0x46, 0x04, + 0x07, 0x11, 0xed, 0x73, 0xb6, 0xff, 0xe6, 0xac, 0x63, 0xbb, 0x87, 0xe3, 0xe1, 0xd5, 0x1b, 0x36, + 0x9b, 0x91, 0x44, 0x6d, 0x1b, 0x40, 0x0b, 0x17, 0x29, 0x8e, 0x76, 0x11, 0x86, 0xff, 0x6f, 0x73, + 0xef, 0x6c, 0x19, 0xa7, 0xb3, 0x4b, 0x7f, 0x37, 0xf1, 0x23, 0x4b, 0x95, 0x43, 0x8c, 0x5e, 0x40, + 0x5b, 0xb2, 0x8f, 0x24, 0x1b, 0x51, 0x2c, 0x9c, 0x7a, 0xbf, 0x71, 0xde, 0x0e, 0xbb, 0xdb, 0xdc, + 0xeb, 0x94, 0x0b, 0xf6, 0x23, 0x3f, 0x6a, 0xa9, 0x7a, 0x88, 0x85, 0x16, 0xfe, 0x6c, 0x40, 0xf3, + 0x9d, 0x3a, 0x5a, 0x07, 0xac, 0x18, 0x63, 0x4e, 0x84, 0xd0, 0x87, 0xb6, 0x6b, 0xd1, 0x18, 0x4e, + 0x29, 0x1e, 0x25, 0x7b, 0x77, 0xa5, 0x82, 0x7d, 0xd1, 0x0b, 0x2a, 0xb7, 0x34, 0xa8, 0xfa, 0x0f, + 0x9f, 0xae, 0x72, 0xaf, 0xb6, 0xce, 0xbd, 0x93, 0x2a, 0x2a, 0xb6, 0xb9, 0x67, 0x97, 0x8e, 0x28, + 0x4e, 0x84, 0x1f, 0x9d, 0x50, 0x5c, 0x99, 0x6a, 0x47, 0x9f, 0x00, 0x0e, 0x82, 0x68, 0xaa, 0x7f, + 0x54, 0x9e, 0xec, 0x0b, 0x74, 0x20, 0xa9, 0x2e, 0x5a, 0x68, 0x16, 0x5a, 0x51, 0x49, 0x43, 0xaf, + 0xc0, 0xcc, 0xc6, 0x72, 0xe7, 0xb0, 0x7b, 0x40, 0xd7, 0xaf, 0x25, 0x3c, 0xd6, 0xe6, 0xcc, 0x9b, + 0xeb, 0x5b, 0x11, 0x29, 0x7e, 0xa9, 0x1d, 0xbe, 0x5e, 0xfd, 0x72, 0x6b, 0xab, 0xb5, 0x6b, 0x3c, + 0xac, 0x5d, 0xe3, 0xe7, 0xda, 0x35, 0xbe, 0x6c, 0xdc, 0xda, 0xc3, 0xc6, 0xad, 0xfd, 0xd8, 0xb8, + 0xb5, 0x0f, 0x7e, 0xca, 0xb0, 0x50, 0x3b, 0x66, 0x44, 0x06, 0x8c, 0x4f, 0x06, 0x29, 0xc3, 0x8b, + 0x19, 0x11, 0xea, 0xf1, 0xca, 0xe5, 0x9c, 0x88, 0xbb, 0x23, 0xf5, 0x38, 0x5f, 0xfe, 0x09, 0x00, + 0x00, 0xff, 0xff, 0x3f, 0xe5, 0x6d, 0x79, 0xd8, 0x03, 0x00, 0x00, } func (this *BaseNFT) Equal(that interface{}) bool { @@ -405,33 +320,6 @@ func (this *BaseNFT) Equal(that interface{}) bool { } return true } -func (this *NFTMetadata) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*NFTMetadata) - if !ok { - that2, ok := that.(NFTMetadata) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Data != that1.Data { - return false - } - return true -} func (this *Denom) Equal(that interface{}) bool { if that == nil { return this == nil @@ -486,42 +374,6 @@ func (this *Denom) Equal(that interface{}) bool { } return true } -func (this *DenomMetadata) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DenomMetadata) - if !ok { - that2, ok := that.(DenomMetadata) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Creator != that1.Creator { - return false - } - if this.Schema != that1.Schema { - return false - } - if this.MintRestricted != that1.MintRestricted { - return false - } - if this.UpdateRestricted != that1.UpdateRestricted { - return false - } - if this.Data != that1.Data { - return false - } - return true -} func (this *IDCollection) Equal(that interface{}) bool { if that == nil { return this == nil @@ -683,43 +535,6 @@ func (m *BaseNFT) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *NFTMetadata) 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 *NFTMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NFTMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintNft(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintNft(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Denom) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -826,70 +641,6 @@ func (m *Denom) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DenomMetadata) 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 *DenomMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DenomMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintNft(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x2a - } - if m.UpdateRestricted { - i-- - if m.UpdateRestricted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.MintRestricted { - i-- - if m.MintRestricted { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if len(m.Schema) > 0 { - i -= len(m.Schema) - copy(dAtA[i:], m.Schema) - i = encodeVarintNft(dAtA, i, uint64(len(m.Schema))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintNft(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *IDCollection) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1064,23 +815,6 @@ func (m *BaseNFT) Size() (n int) { return n } -func (m *NFTMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovNft(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovNft(uint64(l)) - } - return n -} - func (m *Denom) Size() (n int) { if m == nil { return 0 @@ -1132,33 +866,6 @@ func (m *Denom) Size() (n int) { return n } -func (m *DenomMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovNft(uint64(l)) - } - l = len(m.Schema) - if l > 0 { - n += 1 + l + sovNft(uint64(l)) - } - if m.MintRestricted { - n += 2 - } - if m.UpdateRestricted { - n += 2 - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovNft(uint64(l)) - } - return n -} - func (m *IDCollection) Size() (n int) { if m == nil { return 0 @@ -1462,7 +1169,7 @@ func (m *BaseNFT) Unmarshal(dAtA []byte) error { } return nil } -func (m *NFTMetadata) Unmarshal(dAtA []byte) error { +func (m *Denom) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1485,15 +1192,15 @@ func (m *NFTMetadata) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NFTMetadata: wiretype end group for non-group") + return fmt.Errorf("proto: Denom: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NFTMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Denom: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1521,11 +1228,11 @@ func (m *NFTMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1553,121 +1260,7 @@ func (m *NFTMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Data = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipNft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthNft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Denom) 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 ErrIntOverflowNft - } - 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: Denom: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Denom: 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 ErrIntOverflowNft - } - 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 ErrInvalidLengthNft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthNft - } - 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 ErrIntOverflowNft - } - 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 ErrInvalidLengthNft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthNft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -1954,192 +1547,6 @@ func (m *Denom) Unmarshal(dAtA []byte) error { } return nil } -func (m *DenomMetadata) 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 ErrIntOverflowNft - } - 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: DenomMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DenomMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNft - } - 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 ErrInvalidLengthNft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthNft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNft - } - 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 ErrInvalidLengthNft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthNft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Schema = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MintRestricted", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.MintRestricted = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdateRestricted", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNft - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UpdateRestricted = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowNft - } - 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 ErrInvalidLengthNft - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthNft - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipNft(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthNft - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *IDCollection) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/modules/nft/types/owners.go b/modules/nft/types/owners.go new file mode 100644 index 00000000..c8099a5d --- /dev/null +++ b/modules/nft/types/owners.go @@ -0,0 +1,93 @@ +package types + +import ( + "bytes" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewIDCollection creates a new IDCollection instance +func NewIDCollection(denomID string, tokenIDs []string) IDCollection { + return IDCollection{ + DenomId: denomID, + TokenIds: tokenIDs, + } +} + +// Supply return the amount of the denom +func (idc IDCollection) Supply() int { + return len(idc.TokenIds) +} + +// AddID adds an tokenID to the idCollection +func (idc IDCollection) AddID(tokenID string) IDCollection { + idc.TokenIds = append(idc.TokenIds, tokenID) + return idc +} + +// ---------------------------------------------------------------------------- +// IDCollections is an array of ID Collections +type IDCollections []IDCollection + +// Add adds an ID to the idCollection +func (idcs IDCollections) Add(denomID, tokenID string) IDCollections { + for i, idc := range idcs { + if idc.DenomId == denomID { + idcs[i] = idc.AddID(tokenID) + return idcs + } + } + return append(idcs, IDCollection{ + DenomId: denomID, + TokenIds: []string{tokenID}, + }) +} + +// String follows stringer interface +func (idcs IDCollections) String() string { + if len(idcs) == 0 { + return "" + } + + var buf bytes.Buffer + for _, idCollection := range idcs { + if buf.Len() > 0 { + buf.WriteString("\n") + } + buf.WriteString(idCollection.String()) + } + return buf.String() +} + +// Owner of non fungible tokens +//type Owner struct { +// Address sdk.AccAddress `json:"address" yaml:"address"` +// IDCollections IDCollections `json:"id_collections" yaml:"id_collections"` +//} + +// NewOwner creates a new Owner +func NewOwner(owner sdk.AccAddress, idCollections ...IDCollection) Owner { + return Owner{ + Address: owner.String(), + IDCollections: idCollections, + } +} + +type Owners []Owner + +// NewOwner creates a new Owner +func NewOwners(owner ...Owner) Owners { + return append([]Owner{}, owner...) +} + +// String follows stringer interface +func (owners Owners) String() string { + var buf bytes.Buffer + for _, owner := range owners { + if buf.Len() > 0 { + buf.WriteString("\n") + } + buf.WriteString(owner.String()) + } + return buf.String() +} diff --git a/modules/nft/types/query.pb.go b/modules/nft/types/query.pb.go index 33300c3b..b55ac332 100644 --- a/modules/nft/types/query.pb.go +++ b/modules/nft/types/query.pb.go @@ -128,27 +128,26 @@ func (m *QuerySupplyResponse) GetAmount() uint64 { return 0 } -// QueryNFTsOfOwnerRequest is the request type for the Query/NFTsOfOwner RPC -// method -type QueryNFTsOfOwnerRequest struct { +// QueryOwnerRequest is the request type for the Query/Owner RPC method +type QueryOwnerRequest struct { DenomId string `protobuf:"bytes,1,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` // pagination defines an optional pagination for the request. Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryNFTsOfOwnerRequest) Reset() { *m = QueryNFTsOfOwnerRequest{} } -func (m *QueryNFTsOfOwnerRequest) String() string { return proto.CompactTextString(m) } -func (*QueryNFTsOfOwnerRequest) ProtoMessage() {} -func (*QueryNFTsOfOwnerRequest) Descriptor() ([]byte, []int) { +func (m *QueryOwnerRequest) Reset() { *m = QueryOwnerRequest{} } +func (m *QueryOwnerRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOwnerRequest) ProtoMessage() {} +func (*QueryOwnerRequest) Descriptor() ([]byte, []int) { return fileDescriptor_cb492a2e23c2c143, []int{2} } -func (m *QueryNFTsOfOwnerRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryOwnerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryNFTsOfOwnerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryOwnerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryNFTsOfOwnerRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryOwnerRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -158,58 +157,57 @@ func (m *QueryNFTsOfOwnerRequest) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryNFTsOfOwnerRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryNFTsOfOwnerRequest.Merge(m, src) +func (m *QueryOwnerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOwnerRequest.Merge(m, src) } -func (m *QueryNFTsOfOwnerRequest) XXX_Size() int { +func (m *QueryOwnerRequest) XXX_Size() int { return m.Size() } -func (m *QueryNFTsOfOwnerRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryNFTsOfOwnerRequest.DiscardUnknown(m) +func (m *QueryOwnerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOwnerRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryNFTsOfOwnerRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryOwnerRequest proto.InternalMessageInfo -func (m *QueryNFTsOfOwnerRequest) GetDenomId() string { +func (m *QueryOwnerRequest) GetDenomId() string { if m != nil { return m.DenomId } return "" } -func (m *QueryNFTsOfOwnerRequest) GetOwner() string { +func (m *QueryOwnerRequest) GetOwner() string { if m != nil { return m.Owner } return "" } -func (m *QueryNFTsOfOwnerRequest) GetPagination() *query.PageRequest { +func (m *QueryOwnerRequest) GetPagination() *query.PageRequest { if m != nil { return m.Pagination } return nil } -// QueryNFTsOfOwnerResponse is the response type for the Query/NFTsOfOwner RPC -// method -type QueryNFTsOfOwnerResponse struct { +// QueryOwnerResponse is the response type for the Query/Owner RPC method +type QueryOwnerResponse struct { Owner *Owner `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryNFTsOfOwnerResponse) Reset() { *m = QueryNFTsOfOwnerResponse{} } -func (m *QueryNFTsOfOwnerResponse) String() string { return proto.CompactTextString(m) } -func (*QueryNFTsOfOwnerResponse) ProtoMessage() {} -func (*QueryNFTsOfOwnerResponse) Descriptor() ([]byte, []int) { +func (m *QueryOwnerResponse) Reset() { *m = QueryOwnerResponse{} } +func (m *QueryOwnerResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOwnerResponse) ProtoMessage() {} +func (*QueryOwnerResponse) Descriptor() ([]byte, []int) { return fileDescriptor_cb492a2e23c2c143, []int{3} } -func (m *QueryNFTsOfOwnerResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryOwnerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryNFTsOfOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryNFTsOfOwnerResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryOwnerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -219,26 +217,26 @@ func (m *QueryNFTsOfOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *QueryNFTsOfOwnerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryNFTsOfOwnerResponse.Merge(m, src) +func (m *QueryOwnerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOwnerResponse.Merge(m, src) } -func (m *QueryNFTsOfOwnerResponse) XXX_Size() int { +func (m *QueryOwnerResponse) XXX_Size() int { return m.Size() } -func (m *QueryNFTsOfOwnerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryNFTsOfOwnerResponse.DiscardUnknown(m) +func (m *QueryOwnerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOwnerResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryNFTsOfOwnerResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryOwnerResponse proto.InternalMessageInfo -func (m *QueryNFTsOfOwnerResponse) GetOwner() *Owner { +func (m *QueryOwnerResponse) GetOwner() *Owner { if m != nil { return m.Owner } return nil } -func (m *QueryNFTsOfOwnerResponse) GetPagination() *query.PageResponse { +func (m *QueryOwnerResponse) GetPagination() *query.PageResponse { if m != nil { return m.Pagination } @@ -644,8 +642,8 @@ func (m *QueryNFTResponse) GetNFT() *BaseNFT { func init() { proto.RegisterType((*QuerySupplyRequest)(nil), "irismod.nft.QuerySupplyRequest") proto.RegisterType((*QuerySupplyResponse)(nil), "irismod.nft.QuerySupplyResponse") - proto.RegisterType((*QueryNFTsOfOwnerRequest)(nil), "irismod.nft.QueryNFTsOfOwnerRequest") - proto.RegisterType((*QueryNFTsOfOwnerResponse)(nil), "irismod.nft.QueryNFTsOfOwnerResponse") + proto.RegisterType((*QueryOwnerRequest)(nil), "irismod.nft.QueryOwnerRequest") + proto.RegisterType((*QueryOwnerResponse)(nil), "irismod.nft.QueryOwnerResponse") proto.RegisterType((*QueryCollectionRequest)(nil), "irismod.nft.QueryCollectionRequest") proto.RegisterType((*QueryCollectionResponse)(nil), "irismod.nft.QueryCollectionResponse") proto.RegisterType((*QueryDenomRequest)(nil), "irismod.nft.QueryDenomRequest") @@ -659,56 +657,55 @@ func init() { func init() { proto.RegisterFile("irismod/nft/query.proto", fileDescriptor_cb492a2e23c2c143) } var fileDescriptor_cb492a2e23c2c143 = []byte{ - // 775 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x4f, 0x13, 0x4d, - 0x1c, 0xee, 0xb4, 0xb4, 0xf0, 0x0e, 0x6f, 0x02, 0x4c, 0xf9, 0xd3, 0xb7, 0x2f, 0xb6, 0x75, 0x41, - 0xac, 0x8d, 0xec, 0x08, 0xc6, 0x98, 0x18, 0xf5, 0x50, 0x4c, 0x0d, 0x17, 0xd0, 0xca, 0x89, 0x98, - 0x98, 0x85, 0x4e, 0xd7, 0xc6, 0xee, 0xcc, 0xd2, 0xd9, 0x62, 0x1a, 0xc2, 0x85, 0x8b, 0x27, 0x13, - 0x12, 0x8f, 0x7e, 0x12, 0xbf, 0x01, 0x47, 0x12, 0x2f, 0x9e, 0x1a, 0x53, 0xf8, 0x04, 0x7c, 0x02, - 0xb3, 0x33, 0xb3, 0x76, 0xb7, 0xbb, 0x15, 0xd3, 0x70, 0x9b, 0x9d, 0x79, 0xe6, 0x79, 0x9e, 0x79, - 0x7e, 0xf3, 0x9b, 0x16, 0x2e, 0x34, 0x5a, 0x0d, 0x6e, 0xb1, 0x1a, 0xa6, 0x75, 0x07, 0x1f, 0xb4, - 0x49, 0xab, 0xa3, 0xdb, 0x2d, 0xe6, 0x30, 0x34, 0xa9, 0x16, 0x74, 0x5a, 0x77, 0xb2, 0xb3, 0x26, - 0x33, 0x99, 0x98, 0xc7, 0xee, 0x48, 0x42, 0xb2, 0x8b, 0x26, 0x63, 0x66, 0x93, 0x60, 0xc3, 0x6e, - 0x60, 0x83, 0x52, 0xe6, 0x18, 0x4e, 0x83, 0x51, 0xae, 0x56, 0xe7, 0xfc, 0xcc, 0xb4, 0xee, 0xa8, - 0xe9, 0xd2, 0x3e, 0xe3, 0x16, 0xe3, 0x78, 0xcf, 0xe0, 0x44, 0x0a, 0xe2, 0xc3, 0xb5, 0x3d, 0xe2, - 0x18, 0x6b, 0xd8, 0x36, 0xcc, 0x06, 0x15, 0x1c, 0x12, 0xab, 0xed, 0x42, 0xf4, 0xda, 0x45, 0xbc, - 0x69, 0xdb, 0x76, 0xb3, 0x53, 0x25, 0x07, 0x6d, 0xc2, 0x1d, 0xa4, 0xc3, 0x89, 0x1a, 0xa1, 0xcc, - 0x7a, 0xd7, 0xa8, 0x65, 0x40, 0x01, 0x14, 0xff, 0x29, 0xa7, 0xaf, 0xba, 0xf9, 0xa9, 0x8e, 0x61, - 0x35, 0x9f, 0x68, 0xde, 0x8a, 0x56, 0x1d, 0x17, 0xc3, 0xcd, 0x1a, 0x9a, 0x85, 0x49, 0xf6, 0x91, - 0x92, 0x56, 0x26, 0xee, 0x82, 0xab, 0xf2, 0x43, 0x5b, 0x85, 0xe9, 0x00, 0x37, 0xb7, 0x19, 0xe5, - 0x04, 0xcd, 0xc3, 0x94, 0x61, 0xb1, 0x36, 0x75, 0x04, 0xf5, 0x58, 0x55, 0x7d, 0x69, 0xdf, 0x00, - 0x5c, 0x10, 0xf8, 0xad, 0xca, 0x0e, 0xdf, 0xae, 0x6f, 0xbb, 0x1c, 0xa3, 0x1a, 0x5a, 0x09, 0x18, - 0x2a, 0x4f, 0x5f, 0x75, 0xf3, 0xff, 0x4a, 0xb0, 0xb4, 0xa6, 0x2c, 0xa2, 0x0a, 0x84, 0xfd, 0x48, - 0x32, 0x89, 0x02, 0x28, 0x4e, 0xae, 0xaf, 0xe8, 0x32, 0x3f, 0xdd, 0xcd, 0x4f, 0x97, 0x05, 0x53, - 0xf9, 0xe9, 0xaf, 0x0c, 0x93, 0x28, 0x4f, 0x55, 0xdf, 0x4e, 0xed, 0x33, 0x80, 0x99, 0xb0, 0x77, - 0x75, 0xe0, 0xa2, 0x67, 0x06, 0x08, 0x7e, 0xa4, 0xfb, 0xea, 0xae, 0x4b, 0xa8, 0xb2, 0xf3, 0x32, - 0x60, 0x27, 0x2e, 0xe0, 0x77, 0xaf, 0xb5, 0x23, 0x65, 0x02, 0x7e, 0x4e, 0x01, 0x9c, 0x17, 0x7e, - 0x36, 0x58, 0xb3, 0x49, 0xf6, 0xdd, 0xb9, 0x51, 0xa3, 0xac, 0x44, 0x78, 0x1a, 0x25, 0xa2, 0xaf, - 0x5e, 0x79, 0xfd, 0x96, 0x54, 0x42, 0x8f, 0x21, 0xdc, 0xff, 0x3d, 0xab, 0x62, 0x5a, 0x08, 0xc4, - 0xe4, 0xdb, 0xe4, 0x83, 0xde, 0x5c, 0x60, 0x1b, 0x70, 0x46, 0x98, 0x7b, 0xe1, 0x9e, 0x7a, 0xc4, - 0xa8, 0xb4, 0xe7, 0xaa, 0x99, 0x14, 0x49, 0xbf, 0xfc, 0x02, 0x10, 0x59, 0x7e, 0x09, 0x95, 0x00, - 0xed, 0xad, 0x7f, 0x3f, 0xf7, 0x5c, 0x04, 0x0b, 0x00, 0x46, 0x2e, 0xc0, 0x29, 0x50, 0xfd, 0xe8, - 0xd1, 0x2b, 0x7f, 0x0f, 0x60, 0x4a, 0xc8, 0xf3, 0x0c, 0x28, 0x24, 0xa2, 0x0d, 0x96, 0xc7, 0xce, - 0xba, 0xf9, 0x58, 0x55, 0xe1, 0x6e, 0x2e, 0xf5, 0x03, 0x38, 0xe5, 0x75, 0xcd, 0xa8, 0xd7, 0x53, - 0x87, 0x13, 0x0e, 0xfb, 0x40, 0xa8, 0x8b, 0x8f, 0x0f, 0xe2, 0xbd, 0x15, 0xad, 0x3a, 0x2e, 0x86, - 0x9b, 0x35, 0x6d, 0x03, 0x4e, 0xf7, 0x25, 0x55, 0x02, 0x18, 0x26, 0x68, 0xdd, 0x51, 0xd1, 0xce, - 0x06, 0x8e, 0x5f, 0x36, 0x38, 0xd9, 0xaa, 0xec, 0x94, 0xc7, 0x7b, 0xdd, 0x7c, 0xc2, 0xdd, 0xe3, - 0x22, 0xd7, 0x2f, 0x93, 0x30, 0x29, 0x58, 0xd0, 0x09, 0x80, 0x29, 0xf9, 0xbe, 0xa1, 0x7c, 0x60, - 0x63, 0xf8, 0x55, 0xcd, 0x16, 0x86, 0x03, 0xa4, 0x11, 0xed, 0xd1, 0xc9, 0xf7, 0xcb, 0x2f, 0x71, - 0x8c, 0x56, 0xb1, 0xff, 0x65, 0xef, 0xdf, 0x77, 0x8e, 0x8f, 0xbc, 0x08, 0x9e, 0x95, 0x4a, 0xc7, - 0x98, 0x4b, 0xe5, 0x36, 0x9c, 0xf4, 0xbd, 0x3b, 0x68, 0x39, 0xac, 0x13, 0x7e, 0x52, 0xb3, 0x77, - 0xae, 0x41, 0x29, 0x4b, 0xff, 0x09, 0x4b, 0x69, 0x34, 0x83, 0x07, 0x7e, 0x6c, 0x38, 0xfa, 0x04, - 0x20, 0xec, 0xf7, 0x25, 0x5a, 0x0a, 0x13, 0x86, 0x5e, 0x9f, 0xec, 0xf2, 0x9f, 0x41, 0x4a, 0x54, - 0x17, 0xa2, 0x45, 0xb4, 0xf2, 0x77, 0x39, 0xa0, 0xf7, 0x30, 0x25, 0x2f, 0x75, 0x54, 0x11, 0x02, - 0xdd, 0x14, 0x55, 0x84, 0x60, 0x3f, 0x68, 0xff, 0x0b, 0xf1, 0x39, 0x94, 0x0e, 0x88, 0xab, 0xab, - 0xcf, 0x61, 0x52, 0xc0, 0x51, 0x6e, 0x08, 0x8f, 0xa7, 0x93, 0x1f, 0xba, 0xae, 0x64, 0xee, 0x09, - 0x99, 0x25, 0x74, 0x3b, 0x42, 0x66, 0xe0, 0x78, 0x87, 0xd0, 0xbd, 0x7a, 0x68, 0x31, 0xb2, 0x62, - 0x9e, 0xe0, 0xad, 0x21, 0xab, 0x4a, 0x6e, 0x5d, 0xc8, 0xdd, 0x47, 0xa5, 0x50, 0x1d, 0x07, 0xee, - 0xd4, 0x91, 0xd7, 0x34, 0xc7, 0xe5, 0xa7, 0x67, 0xbd, 0x1c, 0x38, 0xef, 0xe5, 0xc0, 0xcf, 0x5e, - 0x0e, 0x9c, 0x5e, 0xe4, 0x62, 0xe7, 0x17, 0xb9, 0xd8, 0x8f, 0x8b, 0x5c, 0x6c, 0x57, 0xb3, 0x58, - 0x8d, 0x0b, 0x41, 0x4a, 0x1c, 0x9d, 0xb5, 0x4c, 0x6c, 0xb1, 0x5a, 0xbb, 0x49, 0xb8, 0x60, 0x75, - 0x3a, 0x36, 0xe1, 0x7b, 0x29, 0xf1, 0x0f, 0xe3, 0xe1, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5b, - 0x0e, 0x3b, 0xe9, 0x00, 0x09, 0x00, 0x00, + // 766 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x4f, 0x13, 0x4f, + 0x18, 0xee, 0xb4, 0xb4, 0xf0, 0x1b, 0x7e, 0x09, 0x30, 0xe5, 0x4f, 0xad, 0xb8, 0x6d, 0x06, 0x05, + 0x44, 0xdd, 0x11, 0x3c, 0x98, 0x18, 0xe3, 0xa1, 0x98, 0x1a, 0x2e, 0xa8, 0x95, 0x13, 0x31, 0x31, + 0x4b, 0x3b, 0x5d, 0x1b, 0xbb, 0x33, 0x4b, 0x67, 0xab, 0x69, 0x08, 0x31, 0x31, 0x26, 0x5e, 0x49, + 0x3c, 0xfa, 0x31, 0xfc, 0x0c, 0x26, 0x1c, 0x49, 0xbc, 0x78, 0x6a, 0x4c, 0xf1, 0x13, 0xf0, 0x09, + 0xcc, 0xce, 0xcc, 0xda, 0x5d, 0xb6, 0x45, 0xd3, 0x70, 0xdb, 0xce, 0x3c, 0xf3, 0x3c, 0xcf, 0x3c, + 0xef, 0xfb, 0x0e, 0xc0, 0x85, 0x46, 0xab, 0x21, 0x1c, 0x5e, 0x23, 0xac, 0xee, 0x91, 0xfd, 0x36, + 0x6d, 0x75, 0x4c, 0xb7, 0xc5, 0x3d, 0x8e, 0x26, 0xf5, 0x86, 0xc9, 0xea, 0x5e, 0x7e, 0xd6, 0xe6, + 0x36, 0x97, 0xeb, 0xc4, 0xff, 0x52, 0x90, 0xfc, 0xa2, 0xcd, 0xb9, 0xdd, 0xa4, 0xc4, 0x72, 0x1b, + 0xc4, 0x62, 0x8c, 0x7b, 0x96, 0xd7, 0xe0, 0x4c, 0xe8, 0xdd, 0xb9, 0x30, 0x33, 0xab, 0x7b, 0x7a, + 0x79, 0xad, 0xca, 0x85, 0xc3, 0x05, 0xd9, 0xb3, 0x04, 0x55, 0x82, 0xe4, 0xed, 0xfa, 0x1e, 0xf5, + 0xac, 0x75, 0xe2, 0x5a, 0x76, 0x83, 0x49, 0x0e, 0x85, 0xc5, 0xbb, 0x10, 0x3d, 0xf7, 0x11, 0x2f, + 0xda, 0xae, 0xdb, 0xec, 0x54, 0xe8, 0x7e, 0x9b, 0x0a, 0x0f, 0x99, 0x70, 0xa2, 0x46, 0x19, 0x77, + 0x5e, 0x35, 0x6a, 0x39, 0x50, 0x04, 0xab, 0xff, 0x95, 0xb2, 0x67, 0xdd, 0xc2, 0x54, 0xc7, 0x72, + 0x9a, 0x0f, 0x70, 0xb0, 0x83, 0x2b, 0xe3, 0xf2, 0x73, 0xab, 0x86, 0x66, 0x61, 0x9a, 0xbf, 0x63, + 0xb4, 0x95, 0x4b, 0xfa, 0xe0, 0x8a, 0xfa, 0x81, 0xef, 0xc0, 0x6c, 0x84, 0x5b, 0xb8, 0x9c, 0x09, + 0x8a, 0xe6, 0x61, 0xc6, 0x72, 0x78, 0x9b, 0x79, 0x92, 0x7a, 0xac, 0xa2, 0x7f, 0xe1, 0xaf, 0x00, + 0xce, 0x48, 0xfc, 0x53, 0xff, 0xf4, 0xa8, 0x56, 0x96, 0x23, 0x56, 0x4a, 0xd3, 0x67, 0xdd, 0xc2, + 0xff, 0x0a, 0xac, 0x4c, 0x69, 0x73, 0xa8, 0x0c, 0x61, 0x3f, 0x8c, 0x5c, 0xaa, 0x08, 0x56, 0x27, + 0x37, 0x96, 0x4d, 0x95, 0x9c, 0xe9, 0x27, 0x67, 0xaa, 0x52, 0xe9, 0xe4, 0xcc, 0x67, 0x96, 0x4d, + 0xb5, 0xa7, 0x4a, 0xe8, 0x24, 0xfe, 0x04, 0x74, 0x82, 0xda, 0xb5, 0xbe, 0xe4, 0x6a, 0x60, 0x03, + 0x48, 0x66, 0x64, 0x86, 0x6a, 0x6d, 0x2a, 0xa8, 0x36, 0xf2, 0x24, 0x62, 0x24, 0x29, 0xe1, 0x2b, + 0x7f, 0x35, 0xa2, 0x64, 0x22, 0x4e, 0x8e, 0x00, 0x9c, 0x97, 0x4e, 0x36, 0x79, 0xb3, 0x49, 0xab, + 0xfe, 0xda, 0xa8, 0x21, 0x96, 0x07, 0x78, 0x1a, 0x25, 0x9c, 0x2f, 0x00, 0x2e, 0xc4, 0x2c, 0xe9, + 0x84, 0xee, 0x43, 0x58, 0xfd, 0xb3, 0xaa, 0x63, 0x5a, 0x88, 0xc4, 0x14, 0x3a, 0x14, 0x82, 0x5e, + 0x5e, 0x60, 0x9b, 0xba, 0xdf, 0x1e, 0xfb, 0xb7, 0x1e, 0x31, 0x2a, 0xfc, 0x48, 0x97, 0x5f, 0x93, + 0xf4, 0xcb, 0x2f, 0x01, 0x03, 0xcb, 0xaf, 0xa0, 0x0a, 0x80, 0x5f, 0x86, 0xcf, 0x8b, 0xc0, 0x45, + 0xb4, 0x00, 0x60, 0xe4, 0x02, 0x1c, 0x01, 0x3d, 0x83, 0x01, 0xbd, 0xf6, 0x77, 0x17, 0x66, 0xa4, + 0xbc, 0xc8, 0x81, 0x62, 0x6a, 0xb0, 0xc1, 0xd2, 0xd8, 0x71, 0xb7, 0x90, 0xa8, 0x68, 0xdc, 0xe5, + 0xa5, 0xbe, 0x0f, 0xa7, 0xa4, 0xa3, 0xed, 0xf2, 0xce, 0xa8, 0xed, 0x69, 0xc2, 0x09, 0x8f, 0xbf, + 0xa1, 0xcc, 0xc7, 0x27, 0xcf, 0xe3, 0x83, 0x1d, 0x5c, 0x19, 0x97, 0x9f, 0x5b, 0x35, 0xbc, 0x09, + 0xa7, 0xfb, 0x92, 0x3a, 0x01, 0x02, 0x53, 0xac, 0xee, 0xe9, 0x68, 0x67, 0x23, 0xd7, 0x2f, 0x59, + 0x82, 0x6e, 0x97, 0x77, 0x4a, 0xe3, 0xbd, 0x6e, 0x21, 0xe5, 0x9f, 0xf1, 0x91, 0x1b, 0xdf, 0xd2, + 0x30, 0x2d, 0x59, 0xd0, 0x7b, 0x98, 0x51, 0x4f, 0x1a, 0x2a, 0x44, 0xce, 0xc5, 0x1f, 0xd2, 0x7c, + 0x71, 0x38, 0x40, 0xf9, 0xc0, 0x1b, 0x1f, 0xbe, 0xff, 0xfa, 0x9c, 0xbc, 0x8d, 0xd6, 0x48, 0xf8, + 0x31, 0xef, 0xb7, 0xbb, 0x20, 0x07, 0x41, 0x02, 0x87, 0x44, 0x28, 0xd9, 0x2a, 0x4c, 0xcb, 0x27, + 0x04, 0x19, 0x71, 0xfa, 0xf0, 0xe3, 0x99, 0x2f, 0x0c, 0xdd, 0xd7, 0xea, 0x57, 0xa4, 0x7a, 0x16, + 0xcd, 0x90, 0x73, 0x7f, 0x4a, 0x04, 0xfa, 0x08, 0x20, 0xec, 0x4f, 0x20, 0x5a, 0x8a, 0x53, 0xc5, + 0xde, 0x99, 0xfc, 0xf5, 0x8b, 0x41, 0x5a, 0xf4, 0x96, 0x14, 0xbd, 0x81, 0x96, 0xfe, 0xe1, 0xca, + 0xc8, 0x85, 0x69, 0xd9, 0x8e, 0x83, 0xee, 0x1a, 0x1e, 0xdc, 0x41, 0x77, 0x8d, 0xcc, 0x24, 0x5e, + 0x96, 0xb2, 0x45, 0x64, 0x44, 0x64, 0x55, 0x7b, 0x87, 0x15, 0x5f, 0xc3, 0x8c, 0x9a, 0x16, 0x34, + 0x8c, 0x52, 0x5c, 0x50, 0xde, 0xe8, 0xa0, 0xe1, 0xab, 0x52, 0x74, 0x0e, 0x65, 0x07, 0x88, 0x22, + 0x01, 0xfd, 0xf6, 0x42, 0x8b, 0x71, 0x96, 0xfe, 0x70, 0xe4, 0xaf, 0x0d, 0xd9, 0xd5, 0x02, 0x44, + 0x0a, 0xdc, 0x44, 0x2b, 0xb1, 0x0a, 0x86, 0x1b, 0xe7, 0x20, 0x98, 0x8a, 0xc3, 0xd2, 0xc3, 0xe3, + 0x9e, 0x01, 0x4e, 0x7a, 0x06, 0xf8, 0xd9, 0x33, 0xc0, 0xd1, 0xa9, 0x91, 0x38, 0x39, 0x35, 0x12, + 0x3f, 0x4e, 0x8d, 0xc4, 0x2e, 0x76, 0x78, 0x4d, 0x48, 0x35, 0x46, 0x3d, 0x93, 0xb7, 0x6c, 0xe2, + 0xf0, 0x5a, 0xbb, 0x49, 0x85, 0xa4, 0xf4, 0x3a, 0x2e, 0x15, 0x7b, 0x19, 0xf9, 0x6f, 0xc3, 0xbd, + 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x57, 0x80, 0x1f, 0xd5, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -725,14 +722,14 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Supply queries the total supply of a given denom or owner Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) - // NFTsOfOwner queries the NFTs of the specified owner - NFTsOfOwner(ctx context.Context, in *QueryNFTsOfOwnerRequest, opts ...grpc.CallOption) (*QueryNFTsOfOwnerResponse, error) + // Owner queries the NFTs of the specified owner + Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) // Collection queries the NFTs of the specified denom Collection(ctx context.Context, in *QueryCollectionRequest, opts ...grpc.CallOption) (*QueryCollectionResponse, error) - // Denoms queries all the denoms - Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) // Denom queries the definition of a given denom Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) + // Denoms queries all the denoms + Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) // NFT queries the NFT for the given denom and token ID NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc.CallOption) (*QueryNFTResponse, error) } @@ -754,9 +751,9 @@ func (c *queryClient) Supply(ctx context.Context, in *QuerySupplyRequest, opts . return out, nil } -func (c *queryClient) NFTsOfOwner(ctx context.Context, in *QueryNFTsOfOwnerRequest, opts ...grpc.CallOption) (*QueryNFTsOfOwnerResponse, error) { - out := new(QueryNFTsOfOwnerResponse) - err := c.cc.Invoke(ctx, "/irismod.nft.Query/NFTsOfOwner", in, out, opts...) +func (c *queryClient) Owner(ctx context.Context, in *QueryOwnerRequest, opts ...grpc.CallOption) (*QueryOwnerResponse, error) { + out := new(QueryOwnerResponse) + err := c.cc.Invoke(ctx, "/irismod.nft.Query/Owner", in, out, opts...) if err != nil { return nil, err } @@ -772,18 +769,18 @@ func (c *queryClient) Collection(ctx context.Context, in *QueryCollectionRequest return out, nil } -func (c *queryClient) Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) { - out := new(QueryDenomsResponse) - err := c.cc.Invoke(ctx, "/irismod.nft.Query/Denoms", in, out, opts...) +func (c *queryClient) Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) { + out := new(QueryDenomResponse) + err := c.cc.Invoke(ctx, "/irismod.nft.Query/Denom", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) { - out := new(QueryDenomResponse) - err := c.cc.Invoke(ctx, "/irismod.nft.Query/Denom", in, out, opts...) +func (c *queryClient) Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) { + out := new(QueryDenomsResponse) + err := c.cc.Invoke(ctx, "/irismod.nft.Query/Denoms", in, out, opts...) if err != nil { return nil, err } @@ -803,14 +800,14 @@ func (c *queryClient) NFT(ctx context.Context, in *QueryNFTRequest, opts ...grpc type QueryServer interface { // Supply queries the total supply of a given denom or owner Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) - // NFTsOfOwner queries the NFTs of the specified owner - NFTsOfOwner(context.Context, *QueryNFTsOfOwnerRequest) (*QueryNFTsOfOwnerResponse, error) + // Owner queries the NFTs of the specified owner + Owner(context.Context, *QueryOwnerRequest) (*QueryOwnerResponse, error) // Collection queries the NFTs of the specified denom Collection(context.Context, *QueryCollectionRequest) (*QueryCollectionResponse, error) - // Denoms queries all the denoms - Denoms(context.Context, *QueryDenomsRequest) (*QueryDenomsResponse, error) // Denom queries the definition of a given denom Denom(context.Context, *QueryDenomRequest) (*QueryDenomResponse, error) + // Denoms queries all the denoms + Denoms(context.Context, *QueryDenomsRequest) (*QueryDenomsResponse, error) // NFT queries the NFT for the given denom and token ID NFT(context.Context, *QueryNFTRequest) (*QueryNFTResponse, error) } @@ -822,18 +819,18 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Supply(ctx context.Context, req *QuerySupplyRequest) (*QuerySupplyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Supply not implemented") } -func (*UnimplementedQueryServer) NFTsOfOwner(ctx context.Context, req *QueryNFTsOfOwnerRequest) (*QueryNFTsOfOwnerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NFTsOfOwner not implemented") +func (*UnimplementedQueryServer) Owner(ctx context.Context, req *QueryOwnerRequest) (*QueryOwnerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Owner not implemented") } func (*UnimplementedQueryServer) Collection(ctx context.Context, req *QueryCollectionRequest) (*QueryCollectionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Collection not implemented") } -func (*UnimplementedQueryServer) Denoms(ctx context.Context, req *QueryDenomsRequest) (*QueryDenomsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Denoms not implemented") -} func (*UnimplementedQueryServer) Denom(ctx context.Context, req *QueryDenomRequest) (*QueryDenomResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Denom not implemented") } +func (*UnimplementedQueryServer) Denoms(ctx context.Context, req *QueryDenomsRequest) (*QueryDenomsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Denoms not implemented") +} func (*UnimplementedQueryServer) NFT(ctx context.Context, req *QueryNFTRequest) (*QueryNFTResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NFT not implemented") } @@ -860,20 +857,20 @@ func _Query_Supply_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_NFTsOfOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryNFTsOfOwnerRequest) +func _Query_Owner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOwnerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).NFTsOfOwner(ctx, in) + return srv.(QueryServer).Owner(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/irismod.nft.Query/NFTsOfOwner", + FullMethod: "/irismod.nft.Query/Owner", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).NFTsOfOwner(ctx, req.(*QueryNFTsOfOwnerRequest)) + return srv.(QueryServer).Owner(ctx, req.(*QueryOwnerRequest)) } return interceptor(ctx, in, info, handler) } @@ -896,38 +893,38 @@ func _Query_Collection_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Query_Denoms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomsRequest) +func _Query_Denom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Denoms(ctx, in) + return srv.(QueryServer).Denom(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/irismod.nft.Query/Denoms", + FullMethod: "/irismod.nft.Query/Denom", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Denoms(ctx, req.(*QueryDenomsRequest)) + return srv.(QueryServer).Denom(ctx, req.(*QueryDenomRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Denom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomRequest) +func _Query_Denoms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Denom(ctx, in) + return srv.(QueryServer).Denoms(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/irismod.nft.Query/Denom", + FullMethod: "/irismod.nft.Query/Denoms", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Denom(ctx, req.(*QueryDenomRequest)) + return srv.(QueryServer).Denoms(ctx, req.(*QueryDenomsRequest)) } return interceptor(ctx, in, info, handler) } @@ -959,21 +956,21 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Supply_Handler, }, { - MethodName: "NFTsOfOwner", - Handler: _Query_NFTsOfOwner_Handler, + MethodName: "Owner", + Handler: _Query_Owner_Handler, }, { MethodName: "Collection", Handler: _Query_Collection_Handler, }, - { - MethodName: "Denoms", - Handler: _Query_Denoms_Handler, - }, { MethodName: "Denom", Handler: _Query_Denom_Handler, }, + { + MethodName: "Denoms", + Handler: _Query_Denoms_Handler, + }, { MethodName: "NFT", Handler: _Query_NFT_Handler, @@ -1048,7 +1045,7 @@ func (m *QuerySupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryNFTsOfOwnerRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryOwnerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1058,12 +1055,12 @@ func (m *QueryNFTsOfOwnerRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryNFTsOfOwnerRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOwnerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryNFTsOfOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1097,7 +1094,7 @@ func (m *QueryNFTsOfOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryNFTsOfOwnerResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryOwnerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1107,12 +1104,12 @@ func (m *QueryNFTsOfOwnerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryNFTsOfOwnerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOwnerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryNFTsOfOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1494,7 +1491,7 @@ func (m *QuerySupplyResponse) Size() (n int) { return n } -func (m *QueryNFTsOfOwnerRequest) Size() (n int) { +func (m *QueryOwnerRequest) Size() (n int) { if m == nil { return 0 } @@ -1515,7 +1512,7 @@ func (m *QueryNFTsOfOwnerRequest) Size() (n int) { return n } -func (m *QueryNFTsOfOwnerResponse) Size() (n int) { +func (m *QueryOwnerResponse) Size() (n int) { if m == nil { return 0 } @@ -1843,7 +1840,7 @@ func (m *QuerySupplyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryNFTsOfOwnerRequest) Unmarshal(dAtA []byte) error { +func (m *QueryOwnerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1866,10 +1863,10 @@ func (m *QueryNFTsOfOwnerRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryNFTsOfOwnerRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryOwnerRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNFTsOfOwnerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryOwnerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1993,7 +1990,7 @@ func (m *QueryNFTsOfOwnerRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryNFTsOfOwnerResponse) Unmarshal(dAtA []byte) error { +func (m *QueryOwnerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2016,10 +2013,10 @@ func (m *QueryNFTsOfOwnerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryNFTsOfOwnerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryOwnerResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNFTsOfOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/modules/nft/types/query.pb.gw.go b/modules/nft/types/query.pb.gw.go index 42037c74..588687e8 100644 --- a/modules/nft/types/query.pb.gw.go +++ b/modules/nft/types/query.pb.gw.go @@ -106,37 +106,37 @@ func local_request_Query_Supply_0(ctx context.Context, marshaler runtime.Marshal } var ( - filter_Query_NFTsOfOwner_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_Owner_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_NFTsOfOwner_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryNFTsOfOwnerRequest +func request_Query_Owner_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOwnerRequest 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_NFTsOfOwner_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Owner_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.NFTsOfOwner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.Owner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_NFTsOfOwner_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryNFTsOfOwnerRequest +func local_request_Query_Owner_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOwnerRequest 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_NFTsOfOwner_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Owner_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.NFTsOfOwner(ctx, &protoReq) + msg, err := server.Owner(ctx, &protoReq) return msg, metadata, err } @@ -213,42 +213,6 @@ func local_request_Query_Collection_0(ctx context.Context, marshaler runtime.Mar } -var ( - filter_Query_Denoms_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Denoms_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomsRequest - 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_Denoms_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Denoms(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Denoms_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomsRequest - 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_Denoms_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Denoms(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_Denom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryDenomRequest var metadata runtime.ServerMetadata @@ -303,6 +267,42 @@ func local_request_Query_Denom_0(ctx context.Context, marshaler runtime.Marshale } +var ( + filter_Query_Denoms_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Denoms_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsRequest + 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_Denoms_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Denoms(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Denoms_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsRequest + 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_Denoms_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Denoms(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 @@ -408,7 +408,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_NFTsOfOwner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Owner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -419,7 +419,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_NFTsOfOwner_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_Owner_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 { @@ -427,7 +427,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_NFTsOfOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Owner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -454,7 +454,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_Denoms_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Denom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -465,7 +465,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_Denoms_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_Denom_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 { @@ -473,11 +473,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Denoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Denom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Denom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Denoms_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -488,7 +488,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_Denom_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_Denoms_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 { @@ -496,7 +496,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Denom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Denoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -584,7 +584,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_NFTsOfOwner_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Owner_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) @@ -593,14 +593,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_NFTsOfOwner_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_Owner_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_NFTsOfOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Owner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -624,7 +624,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_Denoms_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Denom_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) @@ -633,18 +633,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Denoms_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_Denom_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_Denoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Denom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Denom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_Denoms_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) @@ -653,14 +653,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Denom_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_Denoms_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_Denom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_Denoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -688,29 +688,29 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Supply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3, 2, 4}, []string{"irismod", "nft", "collections", "denom_id", "supply"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Supply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"irismod", "nft", "collections", "denom_id", "supply"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NFTsOfOwner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"irismod", "nft", "nfts"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Owner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"irismod", "nft", "nfts"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Collection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"irismod", "nft", "collections", "denom_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Collection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"irismod", "nft", "collections", "denom_id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Denoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"irismod", "nft", "denoms"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Denom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"irismod", "nft", "denoms", "denom_id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Denom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3}, []string{"irismod", "nft", "denoms", "denom_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Denoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"irismod", "nft", "denoms"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NFT_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 3, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"irismod", "nft", "nfts", "denom_id", "token_id"}, "", 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{"irismod", "nft", "nfts", "denom_id", "token_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Supply_0 = runtime.ForwardResponseMessage - forward_Query_NFTsOfOwner_0 = runtime.ForwardResponseMessage + forward_Query_Owner_0 = runtime.ForwardResponseMessage forward_Query_Collection_0 = runtime.ForwardResponseMessage - forward_Query_Denoms_0 = runtime.ForwardResponseMessage - forward_Query_Denom_0 = runtime.ForwardResponseMessage + forward_Query_Denoms_0 = runtime.ForwardResponseMessage + forward_Query_NFT_0 = runtime.ForwardResponseMessage ) diff --git a/proto/irismod/nft/nft.proto b/proto/irismod/nft/nft.proto index 2736edc7..ef5d3d74 100644 --- a/proto/irismod/nft/nft.proto +++ b/proto/irismod/nft/nft.proto @@ -18,13 +18,6 @@ message BaseNFT { string uri_hash = 6; } -message NFTMetadata { - option (gogoproto.equal) = true; - - string name = 1; - string data = 2; -} - // Denom defines a type of NFT message Denom { option (gogoproto.equal) = true; @@ -42,16 +35,6 @@ message Denom { string data = 11; } -message DenomMetadata { - option (gogoproto.equal) = true; - - string creator = 1; - string schema = 2; - bool mint_restricted = 3; - bool update_restricted = 4; - string data = 5; -} - // IDCollection defines a type of collection with specified ID message IDCollection { option (gogoproto.equal) = true; diff --git a/proto/irismod/nft/query.proto b/proto/irismod/nft/query.proto index df234f23..ca1d2e85 100644 --- a/proto/irismod/nft/query.proto +++ b/proto/irismod/nft/query.proto @@ -12,17 +12,22 @@ option go_package = "mods.irisnet.org/modules/nft/types"; service Query { // Supply queries the total supply of a given denom or owner rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { - option (google.api.http).get = "/irismod/nft/collections/{denom_id=**}/supply"; + option (google.api.http).get = "/irismod/nft/collections/{denom_id}/supply"; } - // NFTsOfOwner queries the NFTs of the specified owner - rpc NFTsOfOwner(QueryNFTsOfOwnerRequest) returns (QueryNFTsOfOwnerResponse) { + // Owner queries the NFTs of the specified owner + rpc Owner(QueryOwnerRequest) returns (QueryOwnerResponse) { option (google.api.http).get = "/irismod/nft/nfts"; } // Collection queries the NFTs of the specified denom rpc Collection(QueryCollectionRequest) returns (QueryCollectionResponse) { - option (google.api.http).get = "/irismod/nft/collections/{denom_id=**}"; + option (google.api.http).get = "/irismod/nft/collections/{denom_id}"; + } + + // Denom queries the definition of a given denom + rpc Denom(QueryDenomRequest) returns (QueryDenomResponse) { + option (google.api.http).get = "/irismod/nft/denoms/{denom_id}"; } // Denoms queries all the denoms @@ -30,14 +35,9 @@ service Query { option (google.api.http).get = "/irismod/nft/denoms"; } - // Denom queries the definition of a given denom - rpc Denom(QueryDenomRequest) returns (QueryDenomResponse) { - option (google.api.http).get = "/irismod/nft/denoms/{denom_id=**}"; - } - // NFT queries the NFT for the given denom and token ID rpc NFT(QueryNFTRequest) returns (QueryNFTResponse) { - option (google.api.http).get = "/irismod/nft/nfts/{denom_id=**}/{token_id}"; + option (google.api.http).get = "/irismod/nft/nfts/{denom_id}/{token_id}"; } } @@ -50,18 +50,16 @@ message QuerySupplyRequest { // QuerySupplyResponse is the response type for the Query/Supply RPC method message QuerySupplyResponse { uint64 amount = 1; } -// QueryNFTsOfOwnerRequest is the request type for the Query/NFTsOfOwner RPC -// method -message QueryNFTsOfOwnerRequest { +// QueryOwnerRequest is the request type for the Query/Owner RPC method +message QueryOwnerRequest { string denom_id = 1 [ (gogoproto.moretags) = "yaml:\"denom_id\"" ]; string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 3; } -// QueryNFTsOfOwnerResponse is the response type for the Query/NFTsOfOwner RPC -// method -message QueryNFTsOfOwnerResponse { +// QueryOwnerResponse is the response type for the Query/Owner RPC method +message QueryOwnerResponse { Owner owner = 1; cosmos.base.query.v1beta1.PageResponse pagination = 2; }