diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 8b71eca6..d8c39664 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -26,7 +26,10 @@ jobs: automerge: runs-on: ubuntu-latest steps: - - name: automerge - uses: "pascalgn/automerge-action@v0.12.0" + - id: automerge + name: automerge + uses: "pascalgn/automerge-action@v0.16.3" + permissions: + contents: write env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/api/irismod/token/module/v1/module.pulsar.go b/api/irismod/token/module/v1/module.pulsar.go index 8f728e48..631fd853 100644 --- a/api/irismod/token/module/v1/module.pulsar.go +++ b/api/irismod/token/module/v1/module.pulsar.go @@ -517,7 +517,8 @@ type Module struct { unknownFields protoimpl.UnknownFields FeeCollectorName string `protobuf:"bytes,1,opt,name=fee_collector_name,json=feeCollectorName,proto3" json:"fee_collector_name,omitempty"` - // authority defines the custom module authority. If not set, defaults to the governance module. + // authority defines the custom module authority. If not set, defaults to the + // governance module. Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` } diff --git a/api/irismod/token/v1/query.pulsar.go b/api/irismod/token/v1/query.pulsar.go index df0aa040..b434a685 100644 --- a/api/irismod/token/v1/query.pulsar.go +++ b/api/irismod/token/v1/query.pulsar.go @@ -2,6 +2,7 @@ package tokenv1 import ( + _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" v1beta11 "cosmossdk.io/api/cosmos/base/v1beta1" _ "cosmossdk.io/api/cosmos/query/v1" @@ -4654,6 +4655,984 @@ func (x *fastReflection_QueryTotalBurnResponse) ProtoMethods() *protoiface.Metho } } +var ( + md_QueryBalancesRequest protoreflect.MessageDescriptor + fd_QueryBalancesRequest_denom protoreflect.FieldDescriptor + fd_QueryBalancesRequest_address protoreflect.FieldDescriptor +) + +func init() { + file_irismod_token_v1_query_proto_init() + md_QueryBalancesRequest = File_irismod_token_v1_query_proto.Messages().ByName("QueryBalancesRequest") + fd_QueryBalancesRequest_denom = md_QueryBalancesRequest.Fields().ByName("denom") + fd_QueryBalancesRequest_address = md_QueryBalancesRequest.Fields().ByName("address") +} + +var _ protoreflect.Message = (*fastReflection_QueryBalancesRequest)(nil) + +type fastReflection_QueryBalancesRequest QueryBalancesRequest + +func (x *QueryBalancesRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBalancesRequest)(x) +} + +func (x *QueryBalancesRequest) slowProtoReflect() protoreflect.Message { + mi := &file_irismod_token_v1_query_proto_msgTypes[10] + 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_QueryBalancesRequest_messageType fastReflection_QueryBalancesRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryBalancesRequest_messageType{} + +type fastReflection_QueryBalancesRequest_messageType struct{} + +func (x fastReflection_QueryBalancesRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBalancesRequest)(nil) +} +func (x fastReflection_QueryBalancesRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBalancesRequest) +} +func (x fastReflection_QueryBalancesRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBalancesRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBalancesRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBalancesRequest +} + +// 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_QueryBalancesRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryBalancesRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBalancesRequest) New() protoreflect.Message { + return new(fastReflection_QueryBalancesRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBalancesRequest) Interface() protoreflect.ProtoMessage { + return (*QueryBalancesRequest)(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_QueryBalancesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_QueryBalancesRequest_denom, value) { + return + } + } + if x.Address != "" { + value := protoreflect.ValueOfString(x.Address) + if !f(fd_QueryBalancesRequest_address, 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_QueryBalancesRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesRequest.denom": + return x.Denom != "" + case "irismod.token.v1.QueryBalancesRequest.address": + return x.Address != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesRequest")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesRequest 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_QueryBalancesRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesRequest.denom": + x.Denom = "" + case "irismod.token.v1.QueryBalancesRequest.address": + x.Address = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesRequest")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesRequest 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_QueryBalancesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "irismod.token.v1.QueryBalancesRequest.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + case "irismod.token.v1.QueryBalancesRequest.address": + value := x.Address + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesRequest")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesRequest 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_QueryBalancesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesRequest.denom": + x.Denom = value.Interface().(string) + case "irismod.token.v1.QueryBalancesRequest.address": + x.Address = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesRequest")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesRequest 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_QueryBalancesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesRequest.denom": + panic(fmt.Errorf("field denom of message irismod.token.v1.QueryBalancesRequest is not mutable")) + case "irismod.token.v1.QueryBalancesRequest.address": + panic(fmt.Errorf("field address of message irismod.token.v1.QueryBalancesRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesRequest")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesRequest 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_QueryBalancesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesRequest.denom": + return protoreflect.ValueOfString("") + case "irismod.token.v1.QueryBalancesRequest.address": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesRequest")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesRequest 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_QueryBalancesRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in irismod.token.v1.QueryBalancesRequest", 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_QueryBalancesRequest) 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_QueryBalancesRequest) 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_QueryBalancesRequest) 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_QueryBalancesRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBalancesRequest) + 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.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Address) + 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().(*QueryBalancesRequest) + 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.Address) > 0 { + i -= len(x.Address) + copy(dAtA[i:], x.Address) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + i-- + dAtA[i] = 0x12 + } + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + 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().(*QueryBalancesRequest) + 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: QueryBalancesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBalancesRequest: 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 Denom", 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.Denom = 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 Address", 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.Address = 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 _ protoreflect.List = (*_QueryBalancesResponse_1_list)(nil) + +type _QueryBalancesResponse_1_list struct { + list *[]*v1beta11.Coin +} + +func (x *_QueryBalancesResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryBalancesResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryBalancesResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta11.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_QueryBalancesResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta11.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryBalancesResponse_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta11.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryBalancesResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryBalancesResponse_1_list) NewElement() protoreflect.Value { + v := new(v1beta11.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryBalancesResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryBalancesResponse protoreflect.MessageDescriptor + fd_QueryBalancesResponse_balances protoreflect.FieldDescriptor +) + +func init() { + file_irismod_token_v1_query_proto_init() + md_QueryBalancesResponse = File_irismod_token_v1_query_proto.Messages().ByName("QueryBalancesResponse") + fd_QueryBalancesResponse_balances = md_QueryBalancesResponse.Fields().ByName("balances") +} + +var _ protoreflect.Message = (*fastReflection_QueryBalancesResponse)(nil) + +type fastReflection_QueryBalancesResponse QueryBalancesResponse + +func (x *QueryBalancesResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryBalancesResponse)(x) +} + +func (x *QueryBalancesResponse) slowProtoReflect() protoreflect.Message { + mi := &file_irismod_token_v1_query_proto_msgTypes[11] + 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_QueryBalancesResponse_messageType fastReflection_QueryBalancesResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryBalancesResponse_messageType{} + +type fastReflection_QueryBalancesResponse_messageType struct{} + +func (x fastReflection_QueryBalancesResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryBalancesResponse)(nil) +} +func (x fastReflection_QueryBalancesResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryBalancesResponse) +} +func (x fastReflection_QueryBalancesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBalancesResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryBalancesResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryBalancesResponse +} + +// 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_QueryBalancesResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryBalancesResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryBalancesResponse) New() protoreflect.Message { + return new(fastReflection_QueryBalancesResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryBalancesResponse) Interface() protoreflect.ProtoMessage { + return (*QueryBalancesResponse)(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_QueryBalancesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Balances) != 0 { + value := protoreflect.ValueOfList(&_QueryBalancesResponse_1_list{list: &x.Balances}) + if !f(fd_QueryBalancesResponse_balances, 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_QueryBalancesResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesResponse.balances": + return len(x.Balances) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesResponse")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesResponse 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_QueryBalancesResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesResponse.balances": + x.Balances = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesResponse")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesResponse 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_QueryBalancesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "irismod.token.v1.QueryBalancesResponse.balances": + if len(x.Balances) == 0 { + return protoreflect.ValueOfList(&_QueryBalancesResponse_1_list{}) + } + listValue := &_QueryBalancesResponse_1_list{list: &x.Balances} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesResponse")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesResponse 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_QueryBalancesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesResponse.balances": + lv := value.List() + clv := lv.(*_QueryBalancesResponse_1_list) + x.Balances = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesResponse")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesResponse 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_QueryBalancesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesResponse.balances": + if x.Balances == nil { + x.Balances = []*v1beta11.Coin{} + } + value := &_QueryBalancesResponse_1_list{list: &x.Balances} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesResponse")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesResponse 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_QueryBalancesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "irismod.token.v1.QueryBalancesResponse.balances": + list := []*v1beta11.Coin{} + return protoreflect.ValueOfList(&_QueryBalancesResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: irismod.token.v1.QueryBalancesResponse")) + } + panic(fmt.Errorf("message irismod.token.v1.QueryBalancesResponse 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_QueryBalancesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in irismod.token.v1.QueryBalancesResponse", 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_QueryBalancesResponse) 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_QueryBalancesResponse) 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_QueryBalancesResponse) 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_QueryBalancesResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryBalancesResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Balances) > 0 { + for _, e := range x.Balances { + l = options.Size(e) + 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().(*QueryBalancesResponse) + 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.Balances) > 0 { + for iNdEx := len(x.Balances) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Balances[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + 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().(*QueryBalancesResponse) + 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: QueryBalancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryBalancesResponse: 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 Balances", wireType) + } + var msglen 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++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + 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.Balances = append(x.Balances, &v1beta11.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Balances[len(x.Balances)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + 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, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -5050,6 +6029,88 @@ func (x *QueryTotalBurnResponse) GetBurnedCoins() []*v1beta11.Coin { return nil } +// QueryBalancesRequest is request type for the Query/Balances RPC method +type QueryBalancesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // address is the address to query balances for. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *QueryBalancesRequest) Reset() { + *x = QueryBalancesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_irismod_token_v1_query_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBalancesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBalancesRequest) ProtoMessage() {} + +// Deprecated: Use QueryBalancesRequest.ProtoReflect.Descriptor instead. +func (*QueryBalancesRequest) Descriptor() ([]byte, []int) { + return file_irismod_token_v1_query_proto_rawDescGZIP(), []int{10} +} + +func (x *QueryBalancesRequest) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +func (x *QueryBalancesRequest) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +// QueryBalancesResponse is response type for the Query/Balances RPC method +type QueryBalancesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // balances is the balances of all the coins. + Balances []*v1beta11.Coin `protobuf:"bytes,1,rep,name=balances,proto3" json:"balances,omitempty"` +} + +func (x *QueryBalancesResponse) Reset() { + *x = QueryBalancesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_irismod_token_v1_query_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryBalancesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryBalancesResponse) ProtoMessage() {} + +// Deprecated: Use QueryBalancesResponse.ProtoReflect.Descriptor instead. +func (*QueryBalancesResponse) Descriptor() ([]byte, []int) { + return file_irismod_token_v1_query_proto_rawDescGZIP(), []int{11} +} + +func (x *QueryBalancesResponse) GetBalances() []*v1beta11.Coin { + if x != nil { + return x.Balances + } + return nil +} + var File_irismod_token_v1_query_proto protoreflect.FileDescriptor var file_irismod_token_v1_query_proto_rawDesc = []byte{ @@ -5069,124 +6130,149 @@ var file_irismod_token_v1_query_proto_rawDesc = []byte{ 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x29, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x4e, 0x0a, 0x12, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x0c, 0xca, 0xb4, 0x2d, 0x08, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x49, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x72, 0x0a, 0x12, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 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, 0x9a, 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x0c, - 0xca, 0xb4, 0x2d, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x52, 0x06, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 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, 0x2a, 0x0a, - 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22, 0xf9, 0x01, 0x0a, 0x11, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x65, 0x78, 0x69, 0x73, 0x74, 0x12, 0x67, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x66, - 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x2f, 0xc8, 0xde, 0x1f, 0x00, 0xfa, 0xde, 0x1f, 0x27, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x46, 0x65, 0x65, 0x12, 0x65, - 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2f, 0xc8, 0xde, 0x1f, - 0x00, 0xfa, 0xde, 0x1f, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x07, 0x6d, 0x69, - 0x6e, 0x74, 0x46, 0x65, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x88, 0x01, 0x0a, 0x13, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x39, 0x0a, 0x03, 0x72, - 0x65, 0x73, 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, 0x03, 0x72, 0x65, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, - 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x5c, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x72, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x62, 0x75, 0x72, - 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x0b, 0x62, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x32, 0x9a, 0x05, - 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x81, 0x01, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x23, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x88, 0xe7, - 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x69, 0x72, 0x69, 0x73, - 0x6d, 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x7c, 0x0a, 0x06, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x69, 0x72, - 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x25, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, - 0x18, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x84, 0x01, 0x0a, 0x04, 0x46, 0x65, - 0x65, 0x73, 0x12, 0x22, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, - 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, - 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x88, 0xe7, 0xb0, - 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, - 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x2f, 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x66, 0x65, 0x65, 0x73, - 0x12, 0x7c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x69, 0x72, 0x69, - 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x89, - 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x27, 0x2e, 0x69, - 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, - 0x74, 0x61, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x29, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x69, + 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x29, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, + 0x4e, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x0c, 0xca, 0xb4, 0x2d, 0x08, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, + 0x72, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 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, 0x9a, 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x42, 0x0c, 0xca, 0xb4, 0x2d, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x52, + 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 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, 0x2a, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22, 0xf9, 0x01, 0x0a, + 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x12, 0x67, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2f, 0xc8, 0xde, 0x1f, 0x00, 0xfa, 0xde, 0x1f, 0x27, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x46, 0x65, + 0x65, 0x12, 0x65, 0x0a, 0x08, 0x6d, 0x69, 0x6e, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2f, + 0xc8, 0xde, 0x1f, 0x00, 0xfa, 0xde, 0x1f, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, + 0x07, 0x6d, 0x69, 0x6e, 0x74, 0x46, 0x65, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x88, + 0x01, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x39, + 0x0a, 0x03, 0x72, 0x65, 0x73, 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, 0x03, 0x72, 0x65, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x5c, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, + 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0c, + 0x62, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x04, 0xc8, + 0xde, 0x1f, 0x00, 0x52, 0x0b, 0x62, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x69, 0x6e, 0x73, + 0x22, 0x60, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x32, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x08, + 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x35, 0xc8, 0xde, 0x1f, 0x00, 0xaa, + 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x32, 0xb3, 0x06, 0x0a, 0x05, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x81, 0x01, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, + 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x88, 0xe7, 0xb0, 0x2a, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, 0x12, 0x7c, 0x0a, 0x06, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, + 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x25, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x42, 0xbd, 0x01, 0x0a, 0x14, 0x63, - 0x6f, 0x6d, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x72, - 0x69, 0x73, 0x6e, 0x65, 0x74, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, - 0x76, 0x31, 0x3b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x49, 0x54, 0x58, - 0xaa, 0x02, 0x10, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x5c, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, - 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x3a, - 0x3a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x84, 0x01, 0x0a, 0x04, 0x46, 0x65, 0x65, 0x73, 0x12, + 0x22, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x65, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, + 0x7b, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x7d, 0x2f, 0x66, 0x65, 0x65, 0x73, 0x12, 0x7c, 0x0a, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, + 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, + 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1a, 0x12, 0x18, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x89, 0x01, 0x0a, 0x09, + 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x27, 0x2e, 0x69, 0x72, 0x69, 0x73, + 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x6f, 0x74, 0x61, 0x6c, + 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x88, 0xe7, + 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x69, 0x72, 0x69, 0x73, + 0x6d, 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x12, 0x96, 0x01, 0x0a, 0x08, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x73, 0x12, 0x26, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x69, + 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x7b, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x2f, 0x7b, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x7d, + 0x42, 0xbd, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6e, 0x65, 0x74, 0x2f, 0x69, 0x72, 0x69, 0x73, + 0x6d, 0x6f, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x2f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x49, 0x54, 0x58, 0xaa, 0x02, 0x10, 0x49, 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, + 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x49, 0x72, 0x69, 0x73, + 0x6d, 0x6f, 0x64, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x49, + 0x72, 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x49, 0x72, + 0x69, 0x73, 0x6d, 0x6f, 0x64, 0x3a, 0x3a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5201,7 +6287,7 @@ func file_irismod_token_v1_query_proto_rawDescGZIP() []byte { return file_irismod_token_v1_query_proto_rawDescData } -var file_irismod_token_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_irismod_token_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_irismod_token_v1_query_proto_goTypes = []interface{}{ (*QueryTokenRequest)(nil), // 0: irismod.token.v1.QueryTokenRequest (*QueryTokenResponse)(nil), // 1: irismod.token.v1.QueryTokenResponse @@ -5213,37 +6299,42 @@ var file_irismod_token_v1_query_proto_goTypes = []interface{}{ (*QueryParamsResponse)(nil), // 7: irismod.token.v1.QueryParamsResponse (*QueryTotalBurnRequest)(nil), // 8: irismod.token.v1.QueryTotalBurnRequest (*QueryTotalBurnResponse)(nil), // 9: irismod.token.v1.QueryTotalBurnResponse - (*anypb.Any)(nil), // 10: google.protobuf.Any - (*v1beta1.PageRequest)(nil), // 11: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 12: cosmos.base.query.v1beta1.PageResponse - (*v1beta11.Coin)(nil), // 13: cosmos.base.v1beta1.Coin - (*Params)(nil), // 14: irismod.token.v1.Params + (*QueryBalancesRequest)(nil), // 10: irismod.token.v1.QueryBalancesRequest + (*QueryBalancesResponse)(nil), // 11: irismod.token.v1.QueryBalancesResponse + (*anypb.Any)(nil), // 12: google.protobuf.Any + (*v1beta1.PageRequest)(nil), // 13: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 14: cosmos.base.query.v1beta1.PageResponse + (*v1beta11.Coin)(nil), // 15: cosmos.base.v1beta1.Coin + (*Params)(nil), // 16: irismod.token.v1.Params } var file_irismod_token_v1_query_proto_depIdxs = []int32{ - 10, // 0: irismod.token.v1.QueryTokenResponse.token:type_name -> google.protobuf.Any - 11, // 1: irismod.token.v1.QueryTokensRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 10, // 2: irismod.token.v1.QueryTokensResponse.tokens:type_name -> google.protobuf.Any - 12, // 3: irismod.token.v1.QueryTokensResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 13, // 4: irismod.token.v1.QueryFeesResponse.issue_fee:type_name -> cosmos.base.v1beta1.Coin - 13, // 5: irismod.token.v1.QueryFeesResponse.mint_fee:type_name -> cosmos.base.v1beta1.Coin - 14, // 6: irismod.token.v1.QueryParamsResponse.params:type_name -> irismod.token.v1.Params - 12, // 7: irismod.token.v1.QueryParamsResponse.res:type_name -> cosmos.base.query.v1beta1.PageResponse - 13, // 8: irismod.token.v1.QueryTotalBurnResponse.burned_coins:type_name -> cosmos.base.v1beta1.Coin - 0, // 9: irismod.token.v1.Query.Token:input_type -> irismod.token.v1.QueryTokenRequest - 2, // 10: irismod.token.v1.Query.Tokens:input_type -> irismod.token.v1.QueryTokensRequest - 4, // 11: irismod.token.v1.Query.Fees:input_type -> irismod.token.v1.QueryFeesRequest - 6, // 12: irismod.token.v1.Query.Params:input_type -> irismod.token.v1.QueryParamsRequest - 8, // 13: irismod.token.v1.Query.TotalBurn:input_type -> irismod.token.v1.QueryTotalBurnRequest - 1, // 14: irismod.token.v1.Query.Token:output_type -> irismod.token.v1.QueryTokenResponse - 3, // 15: irismod.token.v1.Query.Tokens:output_type -> irismod.token.v1.QueryTokensResponse - 5, // 16: irismod.token.v1.Query.Fees:output_type -> irismod.token.v1.QueryFeesResponse - 7, // 17: irismod.token.v1.Query.Params:output_type -> irismod.token.v1.QueryParamsResponse - 9, // 18: irismod.token.v1.Query.TotalBurn:output_type -> irismod.token.v1.QueryTotalBurnResponse - 14, // [14:19] is the sub-list for method output_type - 9, // [9:14] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 12, // 0: irismod.token.v1.QueryTokenResponse.token:type_name -> google.protobuf.Any + 13, // 1: irismod.token.v1.QueryTokensRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 12, // 2: irismod.token.v1.QueryTokensResponse.tokens:type_name -> google.protobuf.Any + 14, // 3: irismod.token.v1.QueryTokensResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 15, // 4: irismod.token.v1.QueryFeesResponse.issue_fee:type_name -> cosmos.base.v1beta1.Coin + 15, // 5: irismod.token.v1.QueryFeesResponse.mint_fee:type_name -> cosmos.base.v1beta1.Coin + 16, // 6: irismod.token.v1.QueryParamsResponse.params:type_name -> irismod.token.v1.Params + 14, // 7: irismod.token.v1.QueryParamsResponse.res:type_name -> cosmos.base.query.v1beta1.PageResponse + 15, // 8: irismod.token.v1.QueryTotalBurnResponse.burned_coins:type_name -> cosmos.base.v1beta1.Coin + 15, // 9: irismod.token.v1.QueryBalancesResponse.balances:type_name -> cosmos.base.v1beta1.Coin + 0, // 10: irismod.token.v1.Query.Token:input_type -> irismod.token.v1.QueryTokenRequest + 2, // 11: irismod.token.v1.Query.Tokens:input_type -> irismod.token.v1.QueryTokensRequest + 4, // 12: irismod.token.v1.Query.Fees:input_type -> irismod.token.v1.QueryFeesRequest + 6, // 13: irismod.token.v1.Query.Params:input_type -> irismod.token.v1.QueryParamsRequest + 8, // 14: irismod.token.v1.Query.TotalBurn:input_type -> irismod.token.v1.QueryTotalBurnRequest + 10, // 15: irismod.token.v1.Query.Balances:input_type -> irismod.token.v1.QueryBalancesRequest + 1, // 16: irismod.token.v1.Query.Token:output_type -> irismod.token.v1.QueryTokenResponse + 3, // 17: irismod.token.v1.Query.Tokens:output_type -> irismod.token.v1.QueryTokensResponse + 5, // 18: irismod.token.v1.Query.Fees:output_type -> irismod.token.v1.QueryFeesResponse + 7, // 19: irismod.token.v1.Query.Params:output_type -> irismod.token.v1.QueryParamsResponse + 9, // 20: irismod.token.v1.Query.TotalBurn:output_type -> irismod.token.v1.QueryTotalBurnResponse + 11, // 21: irismod.token.v1.Query.Balances:output_type -> irismod.token.v1.QueryBalancesResponse + 16, // [16:22] is the sub-list for method output_type + 10, // [10:16] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_irismod_token_v1_query_proto_init() } @@ -5373,6 +6464,30 @@ func file_irismod_token_v1_query_proto_init() { return nil } } + file_irismod_token_v1_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBalancesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_irismod_token_v1_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryBalancesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -5380,7 +6495,7 @@ func file_irismod_token_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_irismod_token_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 10, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/api/irismod/token/v1/query_grpc.pb.go b/api/irismod/token/v1/query_grpc.pb.go index 166e4c05..4b3b5d1f 100644 --- a/api/irismod/token/v1/query_grpc.pb.go +++ b/api/irismod/token/v1/query_grpc.pb.go @@ -24,6 +24,7 @@ const ( Query_Fees_FullMethodName = "/irismod.token.v1.Query/Fees" Query_Params_FullMethodName = "/irismod.token.v1.Query/Params" Query_TotalBurn_FullMethodName = "/irismod.token.v1.Query/TotalBurn" + Query_Balances_FullMethodName = "/irismod.token.v1.Query/Balances" ) // QueryClient is the client API for Query service. @@ -40,6 +41,9 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // TotalBurn queries all the burnt coins TotalBurn(ctx context.Context, in *QueryTotalBurnRequest, opts ...grpc.CallOption) (*QueryTotalBurnResponse, error) + // Balances queries the balance of the specified token (including erc20 + // balance) + Balances(ctx context.Context, in *QueryBalancesRequest, opts ...grpc.CallOption) (*QueryBalancesResponse, error) } type queryClient struct { @@ -95,6 +99,15 @@ func (c *queryClient) TotalBurn(ctx context.Context, in *QueryTotalBurnRequest, return out, nil } +func (c *queryClient) Balances(ctx context.Context, in *QueryBalancesRequest, opts ...grpc.CallOption) (*QueryBalancesResponse, error) { + out := new(QueryBalancesResponse) + err := c.cc.Invoke(ctx, Query_Balances_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -109,6 +122,9 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // TotalBurn queries all the burnt coins TotalBurn(context.Context, *QueryTotalBurnRequest) (*QueryTotalBurnResponse, error) + // Balances queries the balance of the specified token (including erc20 + // balance) + Balances(context.Context, *QueryBalancesRequest) (*QueryBalancesResponse, error) mustEmbedUnimplementedQueryServer() } @@ -131,6 +147,9 @@ func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*Q func (UnimplementedQueryServer) TotalBurn(context.Context, *QueryTotalBurnRequest) (*QueryTotalBurnResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TotalBurn not implemented") } +func (UnimplementedQueryServer) Balances(context.Context, *QueryBalancesRequest) (*QueryBalancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Balances not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -234,6 +253,24 @@ func _Query_TotalBurn_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_Balances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBalancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Balances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Balances_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Balances(ctx, req.(*QueryBalancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -261,6 +298,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "TotalBurn", Handler: _Query_TotalBurn_Handler, }, + { + MethodName: "Balances", + Handler: _Query_Balances_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "irismod/token/v1/query.proto", diff --git a/api/irismod/token/v1/tx_grpc.pb.go b/api/irismod/token/v1/tx_grpc.pb.go index 3d9655fc..be92a204 100644 --- a/api/irismod/token/v1/tx_grpc.pb.go +++ b/api/irismod/token/v1/tx_grpc.pb.go @@ -47,16 +47,19 @@ type MsgClient interface { TransferTokenOwner(ctx context.Context, in *MsgTransferTokenOwner, opts ...grpc.CallOption) (*MsgTransferTokenOwnerResponse, error) // SwapFeeToken defines a method for swapping between IRIS and ERIS SwapFeeToken(ctx context.Context, in *MsgSwapFeeToken, opts ...grpc.CallOption) (*MsgSwapFeeTokenResponse, error) - // SwapToERC20 defines a method for swapping some native token to its ERC20 counterpart + // SwapToERC20 defines a method for swapping some native token to its ERC20 + // counterpart SwapToERC20(ctx context.Context, in *MsgSwapToERC20, opts ...grpc.CallOption) (*MsgSwapToERC20Response, error) - // SwapFromERC20 defines a method for swapping some ERC20 token to its native counterpart + // SwapFromERC20 defines a method for swapping some ERC20 token to its native + // counterpart SwapFromERC20(ctx context.Context, in *MsgSwapFromERC20, opts ...grpc.CallOption) (*MsgSwapFromERC20Response, error) // UpdateParams defines a governance operation for updating the token // module parameters. The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // DeployERC20 defines a governance operation for deploying an ERC20 contract that binds to a native token + // DeployERC20 defines a governance operation for deploying an ERC20 contract + // that binds to a native token DeployERC20(ctx context.Context, in *MsgDeployERC20, opts ...grpc.CallOption) (*MsgDeployERC20Response, error) } @@ -174,16 +177,19 @@ type MsgServer interface { TransferTokenOwner(context.Context, *MsgTransferTokenOwner) (*MsgTransferTokenOwnerResponse, error) // SwapFeeToken defines a method for swapping between IRIS and ERIS SwapFeeToken(context.Context, *MsgSwapFeeToken) (*MsgSwapFeeTokenResponse, error) - // SwapToERC20 defines a method for swapping some native token to its ERC20 counterpart + // SwapToERC20 defines a method for swapping some native token to its ERC20 + // counterpart SwapToERC20(context.Context, *MsgSwapToERC20) (*MsgSwapToERC20Response, error) - // SwapFromERC20 defines a method for swapping some ERC20 token to its native counterpart + // SwapFromERC20 defines a method for swapping some ERC20 token to its native + // counterpart SwapFromERC20(context.Context, *MsgSwapFromERC20) (*MsgSwapFromERC20Response, error) // UpdateParams defines a governance operation for updating the token // module parameters. The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // DeployERC20 defines a governance operation for deploying an ERC20 contract that binds to a native token + // DeployERC20 defines a governance operation for deploying an ERC20 contract + // that binds to a native token DeployERC20(context.Context, *MsgDeployERC20) (*MsgDeployERC20Response, error) mustEmbedUnimplementedMsgServer() } diff --git a/modules/token/client/cli/cli_test.go b/modules/token/client/cli/cli_test.go index 1e3cb389..250ba628 100644 --- a/modules/token/client/cli/cli_test.go +++ b/modules/token/client/cli/cli_test.go @@ -242,50 +242,50 @@ func (s *IntegrationTestSuite) TestToken() { // --------------------------------------------------------------------------- //------test GetCmdSwapToErc20()------------- - args = []string{ - fmt.Sprintf("--%s=%s", tokencli.FlagTo, to.String()), - - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf( - "--%s=%s", - flags.FlagFees, - sdk.NewCoins(sdk.NewCoin(s.network.BondDenom, sdk.NewInt(10))).String(), - ), - } - - txResult = tokentestutil.SwapToERC20Exec( - s.T(), - s.network, - clientCtx, - from.String(), - sdk.NewCoins(sdk.NewCoin(s.network.BondDenom, sdk.NewInt(1))).String(), - args...) + // args = []string{ + // fmt.Sprintf("--%s=%s", tokencli.FlagTo, to.String()), + + // fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + // fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + // fmt.Sprintf( + // "--%s=%s", + // flags.FlagFees, + // sdk.NewCoins(sdk.NewCoin(s.network.BondDenom, sdk.NewInt(10))).String(), + // ), + // } + + // txResult = tokentestutil.SwapToERC20Exec( + // s.T(), + // s.network, + // clientCtx, + // from.String(), + // sdk.NewCoins(sdk.NewCoin(s.network.BondDenom, sdk.NewInt(1))).String(), + // args...) // TODO assert // s.Require().Equal(expectedCode, txResult.Code) // --------------------------------------------------------------------------- //------test GetCmdSwapFromErc20()------------- - args = []string{ - fmt.Sprintf("--%s=%s", tokencli.FlagTo, to.String()), - - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), - fmt.Sprintf( - "--%s=%s", - flags.FlagFees, - sdk.NewCoins(sdk.NewCoin(s.network.BondDenom, sdk.NewInt(10))).String(), - ), - } - - txResult = tokentestutil.SwapFromERC20Exec( - s.T(), - s.network, - clientCtx, - from.String(), - sdk.NewCoins(sdk.NewCoin(s.network.BondDenom, sdk.NewInt(1))).String(), - args...) + // args = []string{ + // fmt.Sprintf("--%s=%s", tokencli.FlagTo, to.String()), + + // fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + // fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + // fmt.Sprintf( + // "--%s=%s", + // flags.FlagFees, + // sdk.NewCoins(sdk.NewCoin(s.network.BondDenom, sdk.NewInt(10))).String(), + // ), + // } + + // txResult = tokentestutil.SwapFromERC20Exec( + // s.T(), + // s.network, + // clientCtx, + // from.String(), + // sdk.NewCoins(sdk.NewCoin(s.network.BondDenom, sdk.NewInt(1))).String(), + // args...) // TODO assert // s.Require().Equal(expectedCode, txResult.Code) diff --git a/modules/token/client/cli/query.go b/modules/token/client/cli/query.go index 71f0d397..35de492b 100644 --- a/modules/token/client/cli/query.go +++ b/modules/token/client/cli/query.go @@ -29,6 +29,7 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryFee(), GetCmdQueryTotalBurn(), GetCmdQueryParams(), + GetCmdQueryBalances(), ) return queryCmd @@ -43,7 +44,6 @@ func GetCmdQueryToken() *cobra.Command { Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { return err } @@ -57,7 +57,6 @@ func GetCmdQueryToken() *cobra.Command { res, err := queryClient.Token(context.Background(), &v1.QueryTokenRequest{ Denom: args[0], }) - if err != nil { return err } @@ -212,3 +211,32 @@ func GetCmdQueryTotalBurn() *cobra.Command { return cmd } + +// GetCmdQueryBalances return all the balances of an owner in special denom +func GetCmdQueryBalances() *cobra.Command { + cmd := &cobra.Command{ + Use: "balances [addr] [denom]", + Args: cobra.ExactArgs(2), + Long: "Query all the balances of an owner in special denom.", + Example: fmt.Sprintf("$ %s query token balances ", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := v1.NewQueryClient(clientCtx) + res, err := queryClient.Balances(context.Background(), &v1.QueryBalancesRequest{ + Address: args[0], + Denom: args[1], + }) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/modules/token/genesis.go b/modules/token/genesis.go index f34ecad2..8459ccd0 100644 --- a/modules/token/genesis.go +++ b/modules/token/genesis.go @@ -21,7 +21,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, data v1.GenesisState) { // init tokens for _, token := range data.Tokens { - if err := k.AddToken(ctx, token); err != nil { + if err := k.AddToken(ctx, token, false); err != nil { panic(err.Error()) } } @@ -34,7 +34,6 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, data v1.GenesisState) { if !k.HasSymbol(ctx, data.Params.IssueTokenBaseFee.Denom) { panic(fmt.Sprintf("Token %s does not exist", data.Params.IssueTokenBaseFee.Denom)) } - } // ExportGenesis outputs the genesis state diff --git a/modules/token/handler_test.go b/modules/token/handler_test.go index 20c012e7..1cfe64cf 100644 --- a/modules/token/handler_test.go +++ b/modules/token/handler_test.go @@ -65,7 +65,7 @@ func (suite *HandlerSuite) SetupTest() { } func (suite *HandlerSuite) issueToken(token v1.Token) { - err := suite.keeper.AddToken(suite.ctx, token) + err := suite.keeper.AddToken(suite.ctx, token, true) suite.NoError(err) mintCoins := sdk.NewCoins( diff --git a/modules/token/keeper/grpc_query.go b/modules/token/keeper/grpc_query.go index f6800c9b..5160bfff 100644 --- a/modules/token/keeper/grpc_query.go +++ b/modules/token/keeper/grpc_query.go @@ -5,9 +5,11 @@ import ( "fmt" "github.com/cosmos/gogoproto/proto" + "github.com/ethereum/go-ethereum/common" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdkmath "cosmossdk.io/math" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" @@ -21,10 +23,16 @@ import ( var _ v1.QueryServer = Keeper{} -func (k Keeper) Token( - c context.Context, - req *v1.QueryTokenRequest, -) (*v1.QueryTokenResponse, error) { +// Token queries a token by denomination. +// +// Parameters: +// - c: Context object +// - req: QueryTokenRequest object +// +// Returns: +// - QueryTokenResponse object containing token +// - Error if any +func (k Keeper) Token(c context.Context, req *v1.QueryTokenRequest) (*v1.QueryTokenResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } @@ -47,10 +55,16 @@ func (k Keeper) Token( return &v1.QueryTokenResponse{Token: any}, nil } -func (k Keeper) Tokens( - c context.Context, - req *v1.QueryTokensRequest, -) (*v1.QueryTokensResponse, error) { +// Tokens queries a list of tokens based on the given request parameters. +// +// Parameters: +// - c: Context object +// - req: QueryTokensRequest object +// +// Returns: +// - QueryTokensResponse object containing all tokens own by the owner +// - Error if any +func (k Keeper) Tokens(c context.Context, req *v1.QueryTokensRequest) (*v1.QueryTokensResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } @@ -117,6 +131,15 @@ func (k Keeper) Tokens( return &v1.QueryTokensResponse{Tokens: result, Pagination: pageRes}, nil } +// Fees retrieves the issue fee and mint fee for a specific token symbol. +// +// Parameters: +// - c: Context object +// - req: QueryFeesRequest object containing the token symbol +// +// Returns: +// - QueryFeesResponse object containing issue fee, mint fee, and token existence status +// - Error if any func (k Keeper) Fees(c context.Context, req *v1.QueryFeesRequest) (*v1.QueryFeesResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") @@ -145,11 +168,16 @@ func (k Keeper) Fees(c context.Context, req *v1.QueryFeesRequest) (*v1.QueryFees }, nil } -// Params return the all the parameter in tonken module -func (k Keeper) Params( - c context.Context, - req *v1.QueryParamsRequest, -) (*v1.QueryParamsResponse, error) { +// Params returns all the parameters in the token module. +// +// Parameters: +// - c: Context object +// - req: QueryParamsRequest object +// +// Returns: +// - QueryParamsResponse object containing token params +// - Error if any +func (k Keeper) Params(c context.Context, req *v1.QueryParamsRequest) (*v1.QueryParamsResponse, error) { ctx := sdk.UnwrapSDKContext(c) params := k.GetParams(ctx) @@ -157,12 +185,66 @@ func (k Keeper) Params( } // TotalBurn return the all burn coin -func (k Keeper) TotalBurn( - c context.Context, - req *v1.QueryTotalBurnRequest, -) (*v1.QueryTotalBurnResponse, error) { +// +// Parameters: +// - c: Context object +// - req: QueryFeesRequest object +// +// Returns: +// - QueryTotalBurnResponse object containing token params +// - Error if any +func (k Keeper) TotalBurn(c context.Context, req *v1.QueryTotalBurnRequest) (*v1.QueryTotalBurnResponse, error) { ctx := sdk.UnwrapSDKContext(c) + return &v1.QueryTotalBurnResponse{ BurnedCoins: k.GetAllBurnCoin(ctx), }, nil } + +// Balances retrieves the balances of a given address for a specific token. +// +// Parameters: +// - c: the context.Context object. +// - req: the v1.QueryBalancesRequest object containing the address and token denomination. +// +// Returns: +// - *v1.QueryBalancesResponse: the response containing the balances of the address for the specified token. +// - error: an error if the request is empty, the address is invalid, or the token is not found. +func (k Keeper) Balances(c context.Context, req *v1.QueryBalancesRequest) (*v1.QueryBalancesResponse, error) { + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + + addr, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid address (%s)", err) + } + + ctx := sdk.UnwrapSDKContext(c) + + if !k.HasToken(ctx, req.Denom) { + balance := k.bankKeeper.GetBalance(ctx, addr, req.Denom) + balances := sdk.NewCoins(balance) + return &v1.QueryBalancesResponse{Balances: balances}, nil + } + + token, err := k.GetToken(ctx, req.Denom) + if err != nil { + return nil, status.Errorf(codes.NotFound, "token %s not found", req.Denom) + } + + balance := k.bankKeeper.GetBalance(ctx, addr, token.GetMinUnit()) + balances := sdk.NewCoins(balance) + + if len(token.GetContract()) > 0 { + contract := common.HexToAddress(token.GetContract()) + account := common.BytesToAddress(addr.Bytes()) + + erc20Balance, err := k.BalanceOf(ctx, contract, account) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + balances = balances.Add(sdk.NewCoin(token.GetContract(), sdkmath.NewIntFromBigInt(erc20Balance))) + } + return &v1.QueryBalancesResponse{Balances: balances}, nil +} diff --git a/modules/token/keeper/grpc_query_test.go b/modules/token/keeper/grpc_query_test.go index 0488c87f..a082fe1a 100644 --- a/modules/token/keeper/grpc_query_test.go +++ b/modules/token/keeper/grpc_query_test.go @@ -19,7 +19,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryToken() { v1.RegisterQueryServer(queryHelper, app.TokenKeeper) queryClient := v1.NewQueryClient(queryHelper) - _ = suite.app.TokenKeeper.AddToken(ctx, token) + _ = suite.app.TokenKeeper.AddToken(ctx, token, true) // Query token tokenResp1, err := queryClient.Token( @@ -76,7 +76,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryTotalBurn() { _, _, addr := testdata.KeyTestPubAddr() token := v1.NewToken("btc", "Bitcoin Token", "satoshi", 18, 21000000, 22000000, true, addr) - err := suite.app.TokenKeeper.AddToken(ctx, token) + err := suite.app.TokenKeeper.AddToken(ctx, token, true) suite.Require().NoError(err) buinCoin := sdk.NewInt64Coin("satoshi", 1000000000000000000) diff --git a/modules/token/keeper/keeper.go b/modules/token/keeper/keeper.go index a7aaa075..83a72010 100644 --- a/modules/token/keeper/keeper.go +++ b/modules/token/keeper/keeper.go @@ -32,14 +32,16 @@ type Keeper struct { // NewKeeper creates a new instance of Keeper. // // Parameters: -// cdc: codec to marshal/unmarshal binary encoding/decoding. -// key: store key for the module's store. -// bankKeeper: bank Keeper module for interacting with accounts. -// accountKeeper: Account Keeper for interacting with accounts. -// evmKeeper: EVM Keeper module for interacting with Ethereum Virtual Machine transactions. -// ics20Keeper: ICS20 Keeper module for interacting with ICS20 transactions. -// feeCollectorName: name of the fee collector. -// authority: authority string. +// +// cdc: codec to marshal/unmarshal binary encoding/decoding. +// key: store key for the module's store. +// bankKeeper: bank Keeper module for interacting with accounts. +// accountKeeper: Account Keeper for interacting with accounts. +// evmKeeper: EVM Keeper module for interacting with Ethereum Virtual Machine transactions. +// ics20Keeper: ICS20 Keeper module for interacting with ICS20 transactions. +// feeCollectorName: name of the fee collector. +// authority: authority string. +// // Return type: Keeper. func NewKeeper( cdc codec.Codec, @@ -97,7 +99,7 @@ func (k Keeper) IssueToken( maxSupply, mintable, owner, ) - if err := k.AddToken(ctx, token); err != nil { + if err := k.AddToken(ctx, token, true); err != nil { return err } @@ -159,11 +161,11 @@ func (k Keeper) EditToken( if name != v1.DoNotModify { token.Name = name - - metadata, _ := k.bankKeeper.GetDenomMetaData(ctx, token.MinUnit) - metadata.Description = name - - k.bankKeeper.SetDenomMetaData(ctx, metadata) + metadata, exist := k.bankKeeper.GetDenomMetaData(ctx, token.MinUnit) + if exist { + metadata.Description = name + k.bankKeeper.SetDenomMetaData(ctx, metadata) + } } if mintable != types.Nil { diff --git a/modules/token/keeper/keeper_test.go b/modules/token/keeper/keeper_test.go index fc5aab0c..4e64887d 100644 --- a/modules/token/keeper/keeper_test.go +++ b/modules/token/keeper/keeper_test.go @@ -65,7 +65,7 @@ func TestKeeperSuite(t *testing.T) { } func (suite *KeeperTestSuite) setToken(token v1.Token) { - err := suite.keeper.AddToken(suite.ctx, token) + err := suite.keeper.AddToken(suite.ctx, token, true) suite.NoError(err) } @@ -241,7 +241,7 @@ func (suite *KeeperTestSuite) TestSwapFeeToken() { amt = suite.bk.GetBalance(suite.ctx, token2.GetOwner(), token2.MinUnit) suite.Equal("100000000000000000000t2min", amt.String()) - //reverse test + // reverse test _, feeGot, err = suite.keeper.SwapFeeToken( suite.ctx, feeGot, diff --git a/modules/token/keeper/token.go b/modules/token/keeper/token.go index 61dbda01..cc7b0cc8 100644 --- a/modules/token/keeper/token.go +++ b/modules/token/keeper/token.go @@ -64,48 +64,14 @@ func (k Keeper) GetToken(ctx sdk.Context, denom string) (v1.TokenI, error) { } // AddToken saves a new token -func (k Keeper) AddToken(ctx sdk.Context, token v1.Token) error { - if k.HasToken(ctx, token.Symbol) { - return errorsmod.Wrapf( - types.ErrSymbolAlreadyExists, - "symbol already exists: %s", - token.Symbol, - ) - } - - if k.HasToken(ctx, token.MinUnit) { - return errorsmod.Wrapf( - types.ErrMinUnitAlreadyExists, - "min-unit already exists: %s", - token.MinUnit, - ) - } - - // set token - k.setToken(ctx, token) - - // set token to be prefixed with min unit - k.setWithMinUnit(ctx, token.MinUnit, token.Symbol) - - if len(token.Owner) != 0 { - // set token to be prefixed with owner - k.setWithOwner(ctx, token.GetOwner(), token.Symbol) +func (k Keeper) AddToken(ctx sdk.Context, token v1.Token, saveDenomMetaData bool) error { + if err := k.assertTokenValid(ctx, token); err != nil { + return err } - - denomMetaData := banktypes.Metadata{ - Description: token.Name, - Base: token.MinUnit, - Display: token.Symbol, - DenomUnits: []*banktypes.DenomUnit{ - {Denom: token.MinUnit, Exponent: 0}, - {Denom: token.Symbol, Exponent: token.Scale}, - }, + k.upsertToken(ctx, token) + if saveDenomMetaData { + k.setDenomMetaData(ctx, token) } - k.bankKeeper.SetDenomMetaData(ctx, denomMetaData) - - // Set token to be prefixed with min_unit - k.setWithMinUnit(ctx, token.MinUnit, token.Symbol) - return nil } @@ -121,6 +87,13 @@ func (k Keeper) HasMinUint(ctx sdk.Context, minUint string) bool { return store.Has(types.KeyMinUint(minUint)) } + +// HasContract asserts a token exists by contract +func (k Keeper) HasContract(ctx sdk.Context, contract string) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.KeyContract(contract)) +} + // HasToken asserts a token exists func (k Keeper) HasToken(ctx sdk.Context, denom string) bool { if k.HasSymbol(ctx, denom) { @@ -141,7 +114,7 @@ func (k Keeper) GetOwner(ctx sdk.Context, denom string) (sdk.AccAddress, error) // AddBurnCoin saves the total amount of the burned tokens func (k Keeper) AddBurnCoin(ctx sdk.Context, coin sdk.Coin) { - var total = coin + total := coin if hasCoin, err := k.GetBurnCoin(ctx, coin.Denom); err == nil { total = total.Add(hasCoin) } @@ -315,7 +288,6 @@ func (k Keeper) getTokenSupply(ctx sdk.Context, denom string) sdk.Int { return k.bankKeeper.GetSupply(ctx, denom).Amount } - // upsertToken updates or inserts a token into the database. // // ctx: the context in which the token is being upserted. @@ -334,3 +306,55 @@ func (k Keeper) upsertToken(ctx sdk.Context, token v1.Token) { k.setWithContract(ctx, token.Contract, token.Symbol) } } + +func (k Keeper) setDenomMetaData(ctx sdk.Context, token v1.Token) { + denomMetaData := banktypes.Metadata{ + Description: token.Name, + Base: token.MinUnit, + Display: token.Symbol, + DenomUnits: []*banktypes.DenomUnit{ + {Denom: token.MinUnit, Exponent: 0}, + {Denom: token.Symbol, Exponent: token.Scale}, + }, + } + k.bankKeeper.SetDenomMetaData(ctx, denomMetaData) +} + +func(k Keeper) assertTokenValid(ctx sdk.Context, token v1.Token) error { + if k.HasSymbol(ctx, token.Symbol) { + return errorsmod.Wrapf( + types.ErrSymbolAlreadyExists, + "symbol already exists: %s", + token.Symbol, + ) + } + + if k.HasMinUint(ctx, token.MinUnit) { + return errorsmod.Wrapf( + types.ErrMinUnitAlreadyExists, + "min-unit already exists: %s", + token.MinUnit, + ) + } + + if len(token.Contract) == 0 { + return nil + } + + if !common.IsHexAddress(token.Contract) { + return errorsmod.Wrapf( + types.ErrInvalidContract, + "invalid contract address: %s", + token.Contract, + ) + } + + if k.HasContract(ctx, token.Contract) { + return errorsmod.Wrapf( + types.ErrERC20AlreadyExists, + "contract already exists: %s", + token.Contract, + ) + } + return nil +} diff --git a/modules/token/simulation/decoder.go b/modules/token/simulation/decoder.go index e01161dd..477221cb 100644 --- a/modules/token/simulation/decoder.go +++ b/modules/token/simulation/decoder.go @@ -9,6 +9,7 @@ import ( gogotypes "github.com/cosmos/gogoproto/types" "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/irisnet/irismod/modules/token/types" @@ -34,6 +35,21 @@ func NewDecodeStore(cdc codec.BinaryCodec) func(kvA, kvB kv.Pair) string { cdc.MustUnmarshal(kvA.Value, &symbolA) cdc.MustUnmarshal(kvB.Value, &symbolB) return fmt.Sprintf("%v\n%v", symbolA, symbolB) + case bytes.Equal(kvA.Key[:1], types.PrefixBurnTokenAmt): + var burntCoinA, burntCoinB sdk.Coin + cdc.MustUnmarshal(kvA.Value, &burntCoinA) + cdc.MustUnmarshal(kvB.Value, &burntCoinB) + return fmt.Sprintf("%v\n%v", burntCoinA, burntCoinB) + case bytes.Equal(kvA.Key[:1], types.PrefixParamsKey): + var paramsA, paramsB v1.Params + cdc.MustUnmarshal(kvA.Value, ¶msA) + cdc.MustUnmarshal(kvB.Value, ¶msB) + return fmt.Sprintf("%v\n%v", paramsA, paramsB) + case bytes.Equal(kvA.Key[:1], types.PrefixTokenForContract): + var symbolA, symbolB gogotypes.Value + cdc.MustUnmarshal(kvA.Value, &symbolA) + cdc.MustUnmarshal(kvB.Value, &symbolB) + return fmt.Sprintf("%v\n%v", symbolA, symbolB) default: panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) } diff --git a/modules/token/types/keys.go b/modules/token/types/keys.go index 4cebbcc0..38648808 100644 --- a/modules/token/types/keys.go +++ b/modules/token/types/keys.go @@ -49,7 +49,7 @@ func KeyMinUint(minUnit string) []byte { // KeyContract returns the key of the token with the specified contract func KeyContract(contract string) []byte { - bz := common.FromHex(contract) + bz := common.HexToAddress(contract).Bytes() return append(PrefixTokenForContract, bz...) } diff --git a/modules/token/types/v1/query.pb.go b/modules/token/types/v1/query.pb.go index b0668a77..64eb6391 100644 --- a/modules/token/types/v1/query.pb.go +++ b/modules/token/types/v1/query.pb.go @@ -11,6 +11,7 @@ import ( github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -509,6 +510,106 @@ func (m *QueryTotalBurnResponse) GetBurnedCoins() []types1.Coin { return nil } +// QueryBalancesRequest is request type for the Query/Balances RPC method +type QueryBalancesRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // address is the address to query balances for. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryBalancesRequest) Reset() { *m = QueryBalancesRequest{} } +func (m *QueryBalancesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBalancesRequest) ProtoMessage() {} +func (*QueryBalancesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_47c4517e4b9aaaa2, []int{10} +} +func (m *QueryBalancesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBalancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBalancesRequest.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 *QueryBalancesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBalancesRequest.Merge(m, src) +} +func (m *QueryBalancesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBalancesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBalancesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBalancesRequest proto.InternalMessageInfo + +func (m *QueryBalancesRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *QueryBalancesRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// QueryBalancesResponse is response type for the Query/Balances RPC method +type QueryBalancesResponse struct { + // balances is the balances of all the coins. + Balances github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=balances,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balances"` +} + +func (m *QueryBalancesResponse) Reset() { *m = QueryBalancesResponse{} } +func (m *QueryBalancesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBalancesResponse) ProtoMessage() {} +func (*QueryBalancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_47c4517e4b9aaaa2, []int{11} +} +func (m *QueryBalancesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBalancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBalancesResponse.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 *QueryBalancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBalancesResponse.Merge(m, src) +} +func (m *QueryBalancesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBalancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBalancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBalancesResponse proto.InternalMessageInfo + +func (m *QueryBalancesResponse) GetBalances() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Balances + } + return nil +} + func init() { proto.RegisterType((*QueryTokenRequest)(nil), "irismod.token.v1.QueryTokenRequest") proto.RegisterType((*QueryTokenResponse)(nil), "irismod.token.v1.QueryTokenResponse") @@ -520,61 +621,71 @@ func init() { proto.RegisterType((*QueryParamsResponse)(nil), "irismod.token.v1.QueryParamsResponse") proto.RegisterType((*QueryTotalBurnRequest)(nil), "irismod.token.v1.QueryTotalBurnRequest") proto.RegisterType((*QueryTotalBurnResponse)(nil), "irismod.token.v1.QueryTotalBurnResponse") + proto.RegisterType((*QueryBalancesRequest)(nil), "irismod.token.v1.QueryBalancesRequest") + proto.RegisterType((*QueryBalancesResponse)(nil), "irismod.token.v1.QueryBalancesResponse") } func init() { proto.RegisterFile("irismod/token/v1/query.proto", fileDescriptor_47c4517e4b9aaaa2) } var fileDescriptor_47c4517e4b9aaaa2 = []byte{ - // 781 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcf, 0x4f, 0x13, 0x4d, - 0x18, 0xee, 0x02, 0xed, 0x57, 0x06, 0x0e, 0x7c, 0xf3, 0xf5, 0xc3, 0xb2, 0x92, 0x85, 0x2c, 0xf2, - 0x33, 0x61, 0x27, 0x85, 0xc4, 0xa8, 0x37, 0x4b, 0x52, 0x63, 0x4c, 0x0c, 0x6e, 0x3c, 0x19, 0x93, - 0x66, 0x4b, 0x87, 0x75, 0x43, 0x77, 0xa6, 0xec, 0xcc, 0xa2, 0x8d, 0x70, 0xd0, 0x78, 0xc0, 0x9b, - 0x89, 0x37, 0xfe, 0x0a, 0x0f, 0xfe, 0x11, 0xc4, 0x13, 0x89, 0x17, 0x4f, 0xc4, 0x80, 0x89, 0x7f, - 0x83, 0x9e, 0xcc, 0xfc, 0xd8, 0x76, 0x0b, 0xb4, 0xd5, 0xc4, 0x13, 0xbc, 0xf3, 0xbe, 0xef, 0xf3, - 0x3c, 0xf3, 0xec, 0xfb, 0x4e, 0xc1, 0x74, 0x10, 0x05, 0x2c, 0xa4, 0x75, 0xc4, 0xe9, 0x0e, 0x26, - 0x68, 0xaf, 0x84, 0x76, 0x63, 0x1c, 0xb5, 0x9c, 0x66, 0x44, 0x39, 0x85, 0x13, 0x3a, 0xeb, 0xc8, - 0xac, 0xb3, 0x57, 0x32, 0xad, 0x2d, 0xca, 0x42, 0xca, 0x50, 0xcd, 0x63, 0x18, 0xed, 0x95, 0x6a, - 0x98, 0x7b, 0x25, 0xb4, 0x45, 0x03, 0xa2, 0x3a, 0xcc, 0x29, 0x95, 0xaf, 0xca, 0x08, 0xa9, 0x40, - 0xa7, 0x56, 0xd2, 0xad, 0x92, 0xa5, 0x0d, 0xd0, 0xf4, 0xfc, 0x80, 0x78, 0x3c, 0xa0, 0x09, 0xcc, - 0x75, 0x5d, 0x9b, 0x94, 0xa5, 0x55, 0x99, 0x05, 0x9f, 0xfa, 0x54, 0x11, 0x88, 0xff, 0xf4, 0xe9, - 0xb4, 0x4f, 0xa9, 0xdf, 0xc0, 0xc8, 0x6b, 0x06, 0xc8, 0x23, 0x84, 0x72, 0x89, 0x97, 0x90, 0x4f, - 0xe9, 0xac, 0x8c, 0x6a, 0xf1, 0x36, 0xf2, 0x48, 0x02, 0x77, 0xd9, 0x02, 0x75, 0x5b, 0x99, 0xb5, - 0x97, 0xc1, 0xbf, 0x8f, 0x04, 0xf7, 0x63, 0x71, 0xe6, 0xe2, 0xdd, 0x18, 0x33, 0x0e, 0x0b, 0x20, - 0x5b, 0xc7, 0x84, 0x86, 0x45, 0x63, 0xd6, 0x58, 0x1a, 0x75, 0x55, 0x60, 0x3f, 0x04, 0x30, 0x5d, - 0xca, 0x9a, 0x94, 0x30, 0x0c, 0x6f, 0x81, 0xac, 0xc4, 0x93, 0xb5, 0x63, 0x6b, 0x05, 0x47, 0x29, - 0x71, 0x12, 0x25, 0xce, 0x5d, 0xd2, 0x2a, 0x8f, 0x7f, 0xfa, 0xb8, 0x9a, 0xdf, 0xa0, 0x84, 0x63, - 0xc2, 0xef, 0xbb, 0xaa, 0xc1, 0x8e, 0xd2, 0x78, 0x2c, 0xc5, 0x4d, 0x9f, 0x13, 0x1c, 0x25, 0xdc, - 0x32, 0x80, 0x15, 0x00, 0x3a, 0x26, 0x16, 0x87, 0x24, 0xd5, 0x82, 0xa3, 0xfd, 0x17, 0x8e, 0x3b, - 0xca, 0x41, 0xed, 0xb8, 0xb3, 0xe9, 0xf9, 0x58, 0x23, 0xba, 0xa9, 0x4e, 0xfb, 0xc8, 0x00, 0xff, - 0x75, 0x91, 0xea, 0x5b, 0xdc, 0x01, 0x39, 0x29, 0x8a, 0x15, 0x8d, 0xd9, 0xe1, 0xdf, 0xbc, 0x86, - 0xee, 0x80, 0xf7, 0xae, 0xd0, 0xb6, 0x38, 0x50, 0x9b, 0x22, 0xee, 0x12, 0xb7, 0x02, 0x26, 0xa4, - 0xb6, 0x0a, 0xc6, 0x6d, 0x3b, 0x26, 0x41, 0x8e, 0xb5, 0xc2, 0x1a, 0x6d, 0x68, 0x3f, 0x74, 0x64, - 0xff, 0x30, 0xf4, 0x87, 0x53, 0xc5, 0xfa, 0x1a, 0x05, 0x90, 0xc5, 0x2f, 0x02, 0xc6, 0x65, 0x71, - 0xde, 0x55, 0x01, 0xf4, 0xc1, 0x68, 0xc0, 0x58, 0x8c, 0xab, 0xdb, 0x18, 0x6b, 0x7d, 0x53, 0x5d, - 0xfa, 0x12, 0x65, 0x1b, 0x34, 0x20, 0x65, 0x74, 0x7c, 0x3a, 0x93, 0xf9, 0x79, 0x3a, 0xb3, 0xe8, - 0x07, 0xfc, 0x59, 0x5c, 0x73, 0xb6, 0x68, 0xa8, 0x07, 0x5d, 0xff, 0x59, 0x65, 0xf5, 0x1d, 0xc4, - 0x5b, 0x4d, 0xcc, 0x64, 0x83, 0x9b, 0x97, 0xe0, 0x15, 0x8c, 0x21, 0x06, 0xf9, 0x30, 0x20, 0x5c, - 0xf2, 0x0c, 0xff, 0x75, 0x9e, 0x7f, 0x04, 0x76, 0x05, 0x63, 0xbb, 0xa0, 0x07, 0x67, 0xd3, 0x8b, - 0xbc, 0x30, 0x71, 0xca, 0x3e, 0x4c, 0x3e, 0x6d, 0x72, 0xac, 0x3d, 0xb9, 0x09, 0x72, 0x4d, 0x79, - 0xa2, 0x27, 0xb4, 0xe8, 0x5c, 0xdc, 0x7a, 0x47, 0x75, 0x94, 0x47, 0x84, 0x22, 0x57, 0x57, 0xc3, - 0xdb, 0x60, 0x38, 0xc2, 0xec, 0x4f, 0xbf, 0xa7, 0xe8, 0xb1, 0xaf, 0x81, 0xff, 0xf5, 0x90, 0x71, - 0xaf, 0x51, 0x8e, 0xa3, 0x64, 0xb1, 0xec, 0xa7, 0x60, 0xf2, 0x62, 0x42, 0xab, 0x2c, 0x83, 0xf1, - 0x5a, 0x1c, 0x11, 0x5c, 0xaf, 0x8a, 0xd7, 0x26, 0x19, 0xc3, 0x3e, 0xf6, 0x29, 0xb1, 0x63, 0xaa, - 0x49, 0x9c, 0xb0, 0xb5, 0xa3, 0x2c, 0xc8, 0x4a, 0x78, 0xf8, 0xca, 0x00, 0x59, 0x39, 0xe1, 0x70, - 0xee, 0xf2, 0x6d, 0x2f, 0xed, 0xbb, 0x79, 0xa3, 0x7f, 0x91, 0x92, 0x68, 0xaf, 0x1e, 0x7e, 0xff, - 0xb0, 0x62, 0xbc, 0xfe, 0xfc, 0xed, 0xfd, 0x90, 0x0d, 0x67, 0xd1, 0xd5, 0xcf, 0x0a, 0x43, 0x2f, - 0xe5, 0x6b, 0x71, 0x00, 0xf7, 0x41, 0x4e, 0x2d, 0x19, 0xec, 0x0b, 0x9f, 0x7c, 0x3f, 0x73, 0x7e, - 0x40, 0x95, 0x56, 0x31, 0xdf, 0x51, 0x61, 0xc2, 0x62, 0x2f, 0x15, 0xf0, 0x8d, 0x01, 0x46, 0xc4, - 0x6a, 0x40, 0xbb, 0x07, 0x6c, 0x6a, 0xc9, 0xcc, 0xb9, 0xbe, 0x35, 0x9a, 0x78, 0xbd, 0x43, 0xbc, - 0x04, 0x17, 0x7a, 0x5f, 0x5f, 0x2d, 0xe8, 0x01, 0xda, 0x16, 0xec, 0xfb, 0x20, 0xa7, 0x86, 0xab, - 0xa7, 0x09, 0x5d, 0x43, 0xdc, 0xd3, 0x84, 0xee, 0x99, 0x1e, 0x68, 0x82, 0x1e, 0xe1, 0xb7, 0x06, - 0x18, 0x6d, 0x8f, 0x1a, 0x5c, 0xec, 0x69, 0x70, 0xf7, 0x94, 0x9a, 0x4b, 0x83, 0x0b, 0xb5, 0x8e, - 0xe5, 0x8e, 0x0e, 0x0b, 0x4e, 0x5f, 0xe5, 0x09, 0xf7, 0x1a, 0x55, 0x31, 0xa3, 0xe5, 0x07, 0xc7, - 0x67, 0x96, 0x71, 0x72, 0x66, 0x19, 0x5f, 0xcf, 0x2c, 0xe3, 0xdd, 0xb9, 0x95, 0x39, 0x39, 0xb7, - 0x32, 0x5f, 0xce, 0xad, 0xcc, 0x93, 0x52, 0xea, 0x01, 0x10, 0x08, 0x04, 0xf3, 0x36, 0x52, 0x48, - 0xeb, 0x71, 0x03, 0x33, 0x8d, 0x28, 0x1f, 0x03, 0xf1, 0xab, 0x9a, 0x93, 0xcf, 0xf2, 0xfa, 0xaf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x97, 0x3a, 0xa9, 0x33, 0xdf, 0x07, 0x00, 0x00, + // 909 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x36, 0xb5, 0xeb, 0x4c, 0x7b, 0x68, 0x07, 0x53, 0x9c, 0x25, 0xda, 0x44, 0x5b, 0x9a, + 0xa4, 0x11, 0xd9, 0x91, 0x53, 0x81, 0x28, 0xb7, 0x6e, 0xa5, 0x20, 0x84, 0x84, 0xca, 0xc2, 0x09, + 0x21, 0x85, 0x71, 0x3c, 0x59, 0x56, 0xf5, 0xce, 0xb8, 0x3b, 0xb3, 0x81, 0xa8, 0xcd, 0x01, 0x04, + 0x52, 0xb9, 0x21, 0x21, 0x71, 0xe0, 0x17, 0x20, 0x4e, 0x48, 0xf4, 0x47, 0x54, 0x9c, 0x2a, 0xb8, + 0x70, 0x2a, 0x28, 0x41, 0xe2, 0x37, 0xc0, 0x09, 0xcd, 0xcc, 0x1b, 0x7b, 0x1d, 0xc7, 0x76, 0x90, + 0x7a, 0x49, 0x3c, 0x33, 0xef, 0xbd, 0xef, 0x9b, 0xef, 0xcd, 0xf7, 0x6c, 0xb4, 0x94, 0x15, 0x99, + 0xcc, 0x45, 0x97, 0x28, 0x71, 0x8f, 0x71, 0xb2, 0xdf, 0x26, 0xf7, 0x4b, 0x56, 0x1c, 0x44, 0xfd, + 0x42, 0x28, 0x81, 0x2f, 0xc3, 0x69, 0x64, 0x4e, 0xa3, 0xfd, 0xb6, 0x1f, 0xec, 0x0a, 0x99, 0x0b, + 0x49, 0x3a, 0x54, 0x32, 0xb2, 0xdf, 0xee, 0x30, 0x45, 0xdb, 0x64, 0x57, 0x64, 0xdc, 0x66, 0xf8, + 0x8b, 0xf6, 0x7c, 0xc7, 0xac, 0x88, 0x5d, 0xc0, 0xd1, 0x46, 0x35, 0xd5, 0xa0, 0x0c, 0x0a, 0xf4, + 0x69, 0x9a, 0x71, 0xaa, 0x32, 0xe1, 0xca, 0xbc, 0x0c, 0xb1, 0x2e, 0xac, 0xca, 0xca, 0x6f, 0xa6, + 0x22, 0x15, 0x16, 0x40, 0x7f, 0x82, 0xdd, 0xa5, 0x54, 0x88, 0xb4, 0xc7, 0x08, 0xed, 0x67, 0x84, + 0x72, 0x2e, 0x94, 0xa9, 0xe7, 0xc0, 0x17, 0xe1, 0xd4, 0xac, 0x3a, 0xe5, 0x1e, 0xa1, 0xdc, 0x95, + 0xbb, 0x42, 0xf3, 0x8c, 0x0b, 0x62, 0xfe, 0xba, 0x5a, 0x63, 0xaa, 0x58, 0x01, 0xcc, 0x69, 0x78, + 0x03, 0x5d, 0x79, 0x4f, 0xd3, 0xf9, 0x40, 0xef, 0x25, 0xec, 0x7e, 0xc9, 0xa4, 0xc2, 0x4d, 0x54, + 0xeb, 0x32, 0x2e, 0xf2, 0x96, 0xb7, 0xe2, 0xad, 0x2f, 0x24, 0x76, 0x11, 0xbe, 0x8b, 0x70, 0x35, + 0x54, 0xf6, 0x05, 0x97, 0x0c, 0xbf, 0x81, 0x6a, 0xa6, 0x9e, 0x89, 0xbd, 0xb8, 0xd5, 0x8c, 0x2c, + 0xb9, 0xc8, 0x91, 0x8b, 0x6e, 0xf3, 0x83, 0xf8, 0xd2, 0x2f, 0x8f, 0x37, 0x1b, 0x77, 0x04, 0x57, + 0x8c, 0xab, 0xb7, 0x13, 0x9b, 0x10, 0x16, 0xd5, 0x7a, 0xb2, 0x82, 0x2d, 0x3e, 0xe5, 0xac, 0x70, + 0xd8, 0x66, 0x81, 0xb7, 0x11, 0x1a, 0xea, 0xda, 0x3a, 0x67, 0xa0, 0x56, 0x23, 0x68, 0x89, 0x6e, + 0x42, 0x64, 0x45, 0x85, 0x26, 0x44, 0x77, 0x69, 0xca, 0xa0, 0x62, 0x52, 0xc9, 0x0c, 0xbf, 0xf7, + 0xd0, 0x0b, 0x23, 0xa0, 0x70, 0x8b, 0x37, 0x51, 0xdd, 0x90, 0x92, 0x2d, 0x6f, 0x65, 0xfe, 0x8c, + 0xd7, 0x80, 0x0c, 0xfc, 0xd6, 0x29, 0xdc, 0xd6, 0x66, 0x72, 0xb3, 0xc0, 0x23, 0xe4, 0x36, 0xd0, + 0x65, 0xc3, 0x6d, 0x9b, 0xb1, 0x81, 0x1c, 0x57, 0x51, 0x5d, 0x1e, 0xe4, 0x1d, 0xd1, 0x03, 0x3d, + 0x60, 0x15, 0xfe, 0xe3, 0x41, 0xe3, 0x6c, 0x30, 0x5c, 0xa3, 0x89, 0x6a, 0xec, 0xb3, 0x4c, 0x2a, + 0x13, 0xdc, 0x48, 0xec, 0x02, 0xa7, 0x68, 0x21, 0x93, 0xb2, 0x64, 0x3b, 0x7b, 0x8c, 0x01, 0xbf, + 0xc5, 0x11, 0x7e, 0x8e, 0xd9, 0x1d, 0x91, 0xf1, 0x98, 0x3c, 0x79, 0xb6, 0x3c, 0xf7, 0xef, 0xb3, + 0xe5, 0xb5, 0x34, 0x53, 0x9f, 0x94, 0x9d, 0x68, 0x57, 0xe4, 0xf0, 0xf6, 0xe1, 0xdf, 0xa6, 0xec, + 0xde, 0x23, 0xea, 0xa0, 0xcf, 0xa4, 0x49, 0x48, 0x1a, 0xa6, 0xf8, 0x36, 0x63, 0x98, 0xa1, 0x46, + 0x9e, 0x71, 0x65, 0x70, 0xe6, 0x9f, 0x3b, 0xce, 0x05, 0x5d, 0x7b, 0x9b, 0xb1, 0xb0, 0x09, 0x0f, + 0xe7, 0x2e, 0x2d, 0x68, 0xee, 0x94, 0x0a, 0x1f, 0xb9, 0xd6, 0xba, 0x6d, 0xd0, 0xe4, 0x75, 0x54, + 0xef, 0x9b, 0x1d, 0x78, 0xa1, 0xad, 0xe8, 0xe4, 0x20, 0x88, 0x6c, 0x46, 0x7c, 0x5e, 0x33, 0x4a, + 0x20, 0x1a, 0xdf, 0x42, 0xf3, 0x05, 0x93, 0xff, 0xb7, 0x9f, 0x3a, 0x27, 0x7c, 0x09, 0xbd, 0x08, + 0x8f, 0x4c, 0xd1, 0x5e, 0x5c, 0x16, 0xce, 0x58, 0xe1, 0x47, 0xe8, 0xea, 0xc9, 0x03, 0x60, 0x19, + 0xa3, 0x4b, 0x9d, 0xb2, 0xe0, 0xac, 0xbb, 0xa3, 0x07, 0x90, 0x7b, 0x86, 0x53, 0xe4, 0xb3, 0x64, + 0x2f, 0xda, 0x24, 0xbd, 0x23, 0xc3, 0x8f, 0x51, 0xd3, 0x54, 0x8f, 0x69, 0x8f, 0xf2, 0x5d, 0x26, + 0xa7, 0xda, 0x19, 0x6f, 0xa1, 0x0b, 0xb4, 0xdb, 0x2d, 0x98, 0xb4, 0x77, 0x5c, 0x88, 0x5b, 0xbf, + 0x3e, 0xde, 0x6c, 0x02, 0xde, 0x6d, 0x7b, 0xf2, 0xbe, 0x2a, 0x32, 0x9e, 0x26, 0x2e, 0x30, 0xfc, + 0xca, 0x83, 0x9b, 0x0d, 0x21, 0x80, 0x7f, 0x0f, 0x35, 0x3a, 0xb0, 0x37, 0x9b, 0xfb, 0x6b, 0x9a, + 0xfb, 0x8f, 0x7f, 0x2c, 0xaf, 0x9f, 0xb1, 0xf5, 0xf2, 0x87, 0xbf, 0x7f, 0xda, 0xf0, 0x92, 0x01, + 0xc2, 0xd6, 0xcf, 0x75, 0x54, 0x33, 0x3c, 0xf0, 0xe7, 0x1e, 0xaa, 0x19, 0x2f, 0xe3, 0x6b, 0xe3, + 0x7d, 0x1d, 0x9b, 0x6c, 0xfe, 0x2b, 0xd3, 0x83, 0xec, 0x65, 0xc2, 0xcd, 0x47, 0x1a, 0xef, 0x8b, + 0xdf, 0xfe, 0xfa, 0xf6, 0x5c, 0x88, 0x57, 0xc8, 0xe9, 0x03, 0x54, 0x92, 0x07, 0x46, 0xc8, 0x43, + 0xfc, 0x10, 0xd5, 0xed, 0x38, 0xc1, 0x53, 0xcb, 0xbb, 0x7e, 0xf8, 0xd7, 0x67, 0x44, 0x01, 0x8b, + 0xeb, 0x43, 0x16, 0x3e, 0x6e, 0x4d, 0x62, 0x81, 0xbf, 0xf4, 0xd0, 0x79, 0x3d, 0x04, 0x70, 0x38, + 0xa1, 0x6c, 0x65, 0x9c, 0xf8, 0xd7, 0xa6, 0xc6, 0x00, 0xf0, 0xcd, 0x21, 0xf0, 0x3a, 0x5e, 0x9d, + 0x7c, 0x7d, 0x3b, 0x8a, 0x0e, 0xc9, 0x9e, 0x46, 0x7f, 0x88, 0xea, 0xd6, 0x46, 0x13, 0x45, 0x18, + 0xb1, 0xeb, 0x44, 0x11, 0x46, 0xdd, 0x3b, 0x53, 0x04, 0x30, 0xeb, 0xd7, 0x1e, 0x5a, 0x18, 0x98, + 0x0a, 0xaf, 0x4d, 0x14, 0x78, 0xd4, 0x8f, 0xfe, 0xfa, 0xec, 0x40, 0xe0, 0x71, 0x63, 0xc8, 0x23, + 0xc0, 0x4b, 0xa7, 0x69, 0xa2, 0x68, 0x6f, 0x47, 0xbb, 0x11, 0x7f, 0xe7, 0xa1, 0x86, 0xf3, 0x07, + 0x5e, 0x9d, 0x80, 0x70, 0xc2, 0xa3, 0xfe, 0xda, 0xcc, 0x38, 0x20, 0x72, 0x6b, 0x48, 0x24, 0xc2, + 0xaf, 0x8e, 0x13, 0x71, 0x1e, 0x21, 0x0f, 0xc0, 0xb4, 0x87, 0xee, 0x9d, 0xc6, 0xef, 0x3c, 0x39, + 0x0a, 0xbc, 0xa7, 0x47, 0x81, 0xf7, 0xe7, 0x51, 0xe0, 0x7d, 0x73, 0x1c, 0xcc, 0x3d, 0x3d, 0x0e, + 0xe6, 0x7e, 0x3f, 0x0e, 0xe6, 0x3e, 0x6c, 0x57, 0x8c, 0xa8, 0x2b, 0x72, 0xa6, 0x06, 0x95, 0x73, + 0xd1, 0x2d, 0x7b, 0x4c, 0x02, 0x82, 0x31, 0xa5, 0xfe, 0xad, 0x53, 0x37, 0xdf, 0x8c, 0x37, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0xff, 0x27, 0xad, 0x2e, 0x11, 0x75, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -599,6 +710,9 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // TotalBurn queries all the burnt coins TotalBurn(ctx context.Context, in *QueryTotalBurnRequest, opts ...grpc.CallOption) (*QueryTotalBurnResponse, error) + // Balances queries the balance of the specified token (including erc20 + // balance) + Balances(ctx context.Context, in *QueryBalancesRequest, opts ...grpc.CallOption) (*QueryBalancesResponse, error) } type queryClient struct { @@ -654,6 +768,15 @@ func (c *queryClient) TotalBurn(ctx context.Context, in *QueryTotalBurnRequest, return out, nil } +func (c *queryClient) Balances(ctx context.Context, in *QueryBalancesRequest, opts ...grpc.CallOption) (*QueryBalancesResponse, error) { + out := new(QueryBalancesResponse) + err := c.cc.Invoke(ctx, "/irismod.token.v1.Query/Balances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Token returns token with token name @@ -666,6 +789,9 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // TotalBurn queries all the burnt coins TotalBurn(context.Context, *QueryTotalBurnRequest) (*QueryTotalBurnResponse, error) + // Balances queries the balance of the specified token (including erc20 + // balance) + Balances(context.Context, *QueryBalancesRequest) (*QueryBalancesResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -687,6 +813,9 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsReq func (*UnimplementedQueryServer) TotalBurn(ctx context.Context, req *QueryTotalBurnRequest) (*QueryTotalBurnResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TotalBurn not implemented") } +func (*UnimplementedQueryServer) Balances(ctx context.Context, req *QueryBalancesRequest) (*QueryBalancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Balances not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -782,6 +911,24 @@ func _Query_TotalBurn_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_Balances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBalancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Balances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/irismod.token.v1.Query/Balances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Balances(ctx, req.(*QueryBalancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "irismod.token.v1.Query", HandlerType: (*QueryServer)(nil), @@ -806,6 +953,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "TotalBurn", Handler: _Query_TotalBurn_Handler, }, + { + MethodName: "Balances", + Handler: _Query_Balances_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "irismod/token/v1/query.proto", @@ -1178,6 +1329,80 @@ func (m *QueryTotalBurnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryBalancesRequest) 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 *QueryBalancesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBalancesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBalancesResponse) 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 *QueryBalancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBalancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Balances) > 0 { + for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1328,6 +1553,38 @@ func (m *QueryTotalBurnResponse) Size() (n int) { return n } +func (m *QueryBalancesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBalancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Balances) > 0 { + for _, e := range m.Balances { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2261,6 +2518,204 @@ func (m *QueryTotalBurnResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryBalancesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBalancesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBalancesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBalancesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryBalancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balances", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Balances = append(m.Balances, types1.Coin{}) + if err := m.Balances[len(m.Balances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/modules/token/types/v1/query.pb.gw.go b/modules/token/types/v1/query.pb.gw.go index 62e0cc74..4f66e3ec 100644 --- a/modules/token/types/v1/query.pb.gw.go +++ b/modules/token/types/v1/query.pb.gw.go @@ -213,6 +213,82 @@ func local_request_Query_TotalBurn_0(ctx context.Context, marshaler runtime.Mars } +func request_Query_Balances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBalancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := client.Balances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Balances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBalancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := server.Balances(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -334,6 +410,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Balances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Balances_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Balances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -475,6 +574,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Balances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Balances_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_Balances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -488,6 +607,8 @@ var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"irismod", "token", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_TotalBurn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"irismod", "token", "v1", "total_burn"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Balances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"irismod", "token", "v1", "balances", "address", "denom"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -500,4 +621,6 @@ var ( forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_TotalBurn_0 = runtime.ForwardResponseMessage + + forward_Query_Balances_0 = runtime.ForwardResponseMessage ) diff --git a/modules/token/types/v1/tx.pb.go b/modules/token/types/v1/tx.pb.go index 45a69c17..8f7d997e 100644 --- a/modules/token/types/v1/tx.pb.go +++ b/modules/token/types/v1/tx.pb.go @@ -939,16 +939,19 @@ type MsgClient interface { TransferTokenOwner(ctx context.Context, in *MsgTransferTokenOwner, opts ...grpc.CallOption) (*MsgTransferTokenOwnerResponse, error) // SwapFeeToken defines a method for swapping between IRIS and ERIS SwapFeeToken(ctx context.Context, in *MsgSwapFeeToken, opts ...grpc.CallOption) (*MsgSwapFeeTokenResponse, error) - // SwapToERC20 defines a method for swapping some native token to its ERC20 counterpart + // SwapToERC20 defines a method for swapping some native token to its ERC20 + // counterpart SwapToERC20(ctx context.Context, in *MsgSwapToERC20, opts ...grpc.CallOption) (*MsgSwapToERC20Response, error) - // SwapFromERC20 defines a method for swapping some ERC20 token to its native counterpart + // SwapFromERC20 defines a method for swapping some ERC20 token to its native + // counterpart SwapFromERC20(ctx context.Context, in *MsgSwapFromERC20, opts ...grpc.CallOption) (*MsgSwapFromERC20Response, error) // UpdateParams defines a governance operation for updating the token // module parameters. The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // DeployERC20 defines a governance operation for deploying an ERC20 contract that binds to a native token + // DeployERC20 defines a governance operation for deploying an ERC20 contract + // that binds to a native token DeployERC20(ctx context.Context, in *MsgDeployERC20, opts ...grpc.CallOption) (*MsgDeployERC20Response, error) } @@ -1064,16 +1067,19 @@ type MsgServer interface { TransferTokenOwner(context.Context, *MsgTransferTokenOwner) (*MsgTransferTokenOwnerResponse, error) // SwapFeeToken defines a method for swapping between IRIS and ERIS SwapFeeToken(context.Context, *MsgSwapFeeToken) (*MsgSwapFeeTokenResponse, error) - // SwapToERC20 defines a method for swapping some native token to its ERC20 counterpart + // SwapToERC20 defines a method for swapping some native token to its ERC20 + // counterpart SwapToERC20(context.Context, *MsgSwapToERC20) (*MsgSwapToERC20Response, error) - // SwapFromERC20 defines a method for swapping some ERC20 token to its native counterpart + // SwapFromERC20 defines a method for swapping some ERC20 token to its native + // counterpart SwapFromERC20(context.Context, *MsgSwapFromERC20) (*MsgSwapFromERC20Response, error) // UpdateParams defines a governance operation for updating the token // module parameters. The authority is defined in the keeper. // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // DeployERC20 defines a governance operation for deploying an ERC20 contract that binds to a native token + // DeployERC20 defines a governance operation for deploying an ERC20 contract + // that binds to a native token DeployERC20(context.Context, *MsgDeployERC20) (*MsgDeployERC20Response, error) } diff --git a/proto/irismod/token/module/v1/module.proto b/proto/irismod/token/module/v1/module.proto index 65accab8..89c97832 100644 --- a/proto/irismod/token/module/v1/module.proto +++ b/proto/irismod/token/module/v1/module.proto @@ -7,11 +7,12 @@ import "cosmos/app/v1alpha1/module.proto"; // Module is the config object of the bank module. message Module { option (cosmos.app.v1alpha1.module) = { - go_import: "github.com/irisnet/irismod/modules/token" + go_import : "github.com/irisnet/irismod/modules/token" }; string fee_collector_name = 1; - // authority defines the custom module authority. If not set, defaults to the governance module. + // authority defines the custom module authority. If not set, defaults to the + // governance module. string authority = 2; } \ No newline at end of file diff --git a/proto/irismod/token/v1/query.proto b/proto/irismod/token/v1/query.proto index a2cb4dd0..f8828e41 100644 --- a/proto/irismod/token/v1/query.proto +++ b/proto/irismod/token/v1/query.proto @@ -8,6 +8,7 @@ import "cosmos/query/v1/query.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; +import "amino/amino.proto"; import "irismod/token/v1/token.proto"; option go_package = "github.com/irisnet/irismod/modules/token/types/v1"; @@ -39,6 +40,13 @@ service Query { option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/irismod/token/v1/total_burn"; } + // Balances queries the balance of the specified token (including erc20 + // balance) + rpc Balances(QueryBalancesRequest) returns (QueryBalancesResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = + "/irismod/token/v1/balances/{address}/{denom}"; + } } // QueryTokenRequest is request type for the Query/Token RPC method @@ -98,3 +106,20 @@ message QueryTotalBurnResponse { repeated cosmos.base.v1beta1.Coin burned_coins = 1 [ (gogoproto.nullable) = false ]; } + +// QueryBalancesRequest is request type for the Query/Balances RPC method +message QueryBalancesRequest { + string denom = 1; + // address is the address to query balances for. + string address = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// QueryBalancesResponse is response type for the Query/Balances RPC method +message QueryBalancesResponse { + // balances is the balances of all the coins. + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} diff --git a/proto/irismod/token/v1/tx.proto b/proto/irismod/token/v1/tx.proto index 6a554e09..db2f80cf 100644 --- a/proto/irismod/token/v1/tx.proto +++ b/proto/irismod/token/v1/tx.proto @@ -33,10 +33,12 @@ service Msg { // SwapFeeToken defines a method for swapping between IRIS and ERIS rpc SwapFeeToken(MsgSwapFeeToken) returns (MsgSwapFeeTokenResponse); - // SwapToERC20 defines a method for swapping some native token to its ERC20 counterpart + // SwapToERC20 defines a method for swapping some native token to its ERC20 + // counterpart rpc SwapToERC20(MsgSwapToERC20) returns (MsgSwapToERC20Response); - // SwapFromERC20 defines a method for swapping some ERC20 token to its native counterpart + // SwapFromERC20 defines a method for swapping some ERC20 token to its native + // counterpart rpc SwapFromERC20(MsgSwapFromERC20) returns (MsgSwapFromERC20Response); // UpdateParams defines a governance operation for updating the token @@ -45,7 +47,8 @@ service Msg { // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); - // DeployERC20 defines a governance operation for deploying an ERC20 contract that binds to a native token + // DeployERC20 defines a governance operation for deploying an ERC20 contract + // that binds to a native token rpc DeployERC20(MsgDeployERC20) returns (MsgDeployERC20Response); }