From 03a1a214d26828c1c433b074389a553458d37ec4 Mon Sep 17 00:00:00 2001 From: Troy Kessler Date: Fri, 3 Jan 2025 12:17:22 +0100 Subject: [PATCH] chore: improved account assets query --- docs/static/openapi.yml | 34 +++- proto/kyve/query/v1beta1/account.proto | 16 +- x/query/keeper/grpc_account_assets.go | 4 +- x/query/types/account.pb.go | 206 ++++++++++++++++--------- 4 files changed, 179 insertions(+), 81 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index d6874bb8..a7a08b8d 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -191,12 +191,36 @@ paths: delegation: type: string format: uint64 - description: protocol_staking ... + description: >- + delegation is the amount in $KYVE this account has in total + delegated ... delegation_unbonding: type: string format: uint64 - description: protocol_staking_unbonding ... - outstanding_rewards: + description: >- + delegation_unbonding is the amount in $KYVE this account has + in total currently unbonding ... + delegation_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: >- + delegation_rewards are the current unclaimed delegation + rewards + commission_rewards: type: array items: type: object @@ -213,7 +237,9 @@ paths: method signatures required by gogoproto. - description: protocol_rewards ... + title: >- + commission_rewards are the current unclaimed commission + rewards protocol_funding: type: array items: diff --git a/proto/kyve/query/v1beta1/account.proto b/proto/kyve/query/v1beta1/account.proto index 770b07b4..a480e1aa 100644 --- a/proto/kyve/query/v1beta1/account.proto +++ b/proto/kyve/query/v1beta1/account.proto @@ -38,18 +38,24 @@ message QueryAccountAssetsRequest { message QueryAccountAssetsResponse { // balance ... uint64 balance = 1; - // protocol_staking ... + // delegation is the amount in $KYVE this account has in total delegated ... uint64 delegation = 2; - // protocol_staking_unbonding ... + // delegation_unbonding is the amount in $KYVE this account has in total currently unbonding ... uint64 delegation_unbonding = 3; - // protocol_rewards ... - repeated cosmos.base.v1beta1.Coin outstanding_rewards = 6 [ + // delegation_rewards are the current unclaimed delegation rewards + repeated cosmos.base.v1beta1.Coin delegation_rewards = 6 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // commission_rewards are the current unclaimed commission rewards + repeated cosmos.base.v1beta1.Coin commission_rewards = 7 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; // protocol_funding ... - repeated cosmos.base.v1beta1.Coin protocol_funding = 7 [ + repeated cosmos.base.v1beta1.Coin protocol_funding = 8 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" diff --git a/x/query/keeper/grpc_account_assets.go b/x/query/keeper/grpc_account_assets.go index 36c83b54..41f1a492 100644 --- a/x/query/keeper/grpc_account_assets.go +++ b/x/query/keeper/grpc_account_assets.go @@ -45,11 +45,13 @@ func (k Keeper) AccountAssets(goCtx context.Context, req *types.QueryAccountAsse } for _, validator := range validators.Validators { - response.OutstandingRewards = response.OutstandingRewards.Add( + response.DelegationRewards = response.DelegationRewards.Add( k.stakerKeeper.GetOutstandingRewards(ctx, util.MustAccountAddressFromValAddress(validator.OperatorAddress), req.Address)..., ) } + response.CommissionRewards = k.stakerKeeper.GetOutstandingCommissionRewards(ctx, util.MustAccountAddressFromValAddress(util.MustValaddressFromOperatorAddress(req.Address))) + delegatorBonded, err := k.stakingKeeper.GetDelegatorBonded(ctx, delegatorAddr) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) diff --git a/x/query/types/account.pb.go b/x/query/types/account.pb.go index 24c1bd5b..2e0e4cb2 100644 --- a/x/query/types/account.pb.go +++ b/x/query/types/account.pb.go @@ -83,14 +83,16 @@ func (m *QueryAccountAssetsRequest) GetAddress() string { type QueryAccountAssetsResponse struct { // balance ... Balance uint64 `protobuf:"varint,1,opt,name=balance,proto3" json:"balance,omitempty"` - // protocol_staking ... + // delegation is the amount in $KYVE this account has in total delegated ... Delegation uint64 `protobuf:"varint,2,opt,name=delegation,proto3" json:"delegation,omitempty"` - // protocol_staking_unbonding ... + // delegation_unbonding is the amount in $KYVE this account has in total currently unbonding ... DelegationUnbonding uint64 `protobuf:"varint,3,opt,name=delegation_unbonding,json=delegationUnbonding,proto3" json:"delegation_unbonding,omitempty"` - // protocol_rewards ... - OutstandingRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=outstanding_rewards,json=outstandingRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"outstanding_rewards"` + // delegation_rewards are the current unclaimed delegation rewards + DelegationRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=delegation_rewards,json=delegationRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"delegation_rewards"` + // commission_rewards are the current unclaimed commission rewards + CommissionRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=commission_rewards,json=commissionRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"commission_rewards"` // protocol_funding ... - ProtocolFunding github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=protocol_funding,json=protocolFunding,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"protocol_funding"` + ProtocolFunding github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=protocol_funding,json=protocolFunding,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"protocol_funding"` } func (m *QueryAccountAssetsResponse) Reset() { *m = QueryAccountAssetsResponse{} } @@ -147,9 +149,16 @@ func (m *QueryAccountAssetsResponse) GetDelegationUnbonding() uint64 { return 0 } -func (m *QueryAccountAssetsResponse) GetOutstandingRewards() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *QueryAccountAssetsResponse) GetDelegationRewards() github_com_cosmos_cosmos_sdk_types.Coins { if m != nil { - return m.OutstandingRewards + return m.DelegationRewards + } + return nil +} + +func (m *QueryAccountAssetsResponse) GetCommissionRewards() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.CommissionRewards } return nil } @@ -659,62 +668,63 @@ func init() { func init() { proto.RegisterFile("kyve/query/v1beta1/account.proto", fileDescriptor_51ca316755261aec) } var fileDescriptor_51ca316755261aec = []byte{ - // 878 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x3a, 0x91, 0x23, 0x5e, 0x5a, 0x4a, 0x26, 0x15, 0x72, 0x0d, 0xd9, 0x44, 0x8b, 0xc0, - 0x56, 0x44, 0x77, 0x65, 0x97, 0x22, 0x2a, 0x4e, 0x75, 0x93, 0x70, 0xe0, 0x87, 0xca, 0x16, 0x90, - 0xda, 0xcb, 0x6a, 0xbc, 0x3b, 0xd9, 0x0c, 0x5e, 0xcf, 0xb8, 0x3b, 0xb3, 0x09, 0x56, 0xc5, 0x01, - 0x8e, 0xe5, 0x82, 0xc4, 0xbf, 0x80, 0x04, 0xe2, 0xc4, 0x85, 0x1b, 0x27, 0x4e, 0x3d, 0x56, 0xe2, - 0xc2, 0x09, 0x50, 0x82, 0xc4, 0x89, 0xff, 0x01, 0xed, 0xcc, 0xac, 0xbd, 0xc6, 0x6b, 0x0c, 0x87, - 0x5c, 0x12, 0xcf, 0x9b, 0xef, 0xfd, 0xfa, 0xde, 0xf7, 0x76, 0x60, 0x77, 0x30, 0x3e, 0x21, 0xde, - 0xc3, 0x8c, 0xa4, 0x63, 0xef, 0xa4, 0xd3, 0x27, 0x12, 0x77, 0x3c, 0x1c, 0x86, 0x3c, 0x63, 0xd2, - 0x1d, 0xa5, 0x5c, 0x72, 0x84, 0x72, 0x84, 0xab, 0x10, 0x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 0xa2, 0x45, 0x2b, 0xe9, 0x90, 0x18, 0x65, 0x5f, 0x2a, - 0x8c, 0x1f, 0xd0, 0x21, 0x41, 0xaf, 0x43, 0x5d, 0x48, 0x3c, 0x20, 0xa9, 0x52, 0xf3, 0x46, 0xd7, - 0xae, 0x6a, 0xf4, 0x30, 0x4b, 0x92, 0x7b, 0x0a, 0xe5, 0x1b, 0xb4, 0x73, 0x0b, 0xb6, 0xcb, 0x84, - 0xe6, 0x63, 0x27, 0xd1, 0x3b, 0x54, 0xc8, 0xe5, 0x7b, 0xfa, 0x00, 0xec, 0x45, 0xae, 0x66, 0x02, - 0x6f, 0x40, 0xfd, 0x48, 0x59, 0x0d, 0xfb, 0xcd, 0xea, 0xa2, 0x72, 0x84, 0x21, 0xdc, 0xe0, 0x9d, - 0x6f, 0x2c, 0xa8, 0xeb, 0x0b, 0xf4, 0x31, 0xac, 0x6b, 0x22, 0x44, 0x63, 0xf5, 0x82, 0x54, 0x5f, - 0x24, 0x40, 0x1d, 0x58, 0x1b, 0x71, 0x9e, 0x98, 0xe9, 0x6e, 0x57, 0x95, 0xdb, 0xc3, 0x82, 0x86, - 0x77, 0x39, 0x4f, 0x7c, 0x05, 0x75, 0xde, 0x84, 0x9d, 0x32, 0x0b, 0x3e, 0x99, 0x7e, 0x46, 0x96, - 0x53, 0xf8, 0xa3, 0x05, 0xbb, 0x8b, 0xbd, 0x0d, 0x8b, 0x1c, 0xb6, 0xd3, 0x92, 0x3d, 0x08, 0x39, - 0x4f, 0x22, 0x7e, 0xca, 0x02, 0xc2, 0x64, 0x4a, 0x49, 0x21, 0xed, 0x97, 0xab, 0xaa, 0x2d, 0x07, - 0x3c, 0x60, 0x32, 0x1d, 0x1b, 0x9e, 0x5f, 0x28, 0x47, 0xbc, 0x63, 0x02, 0x1e, 0xe8, 0x78, 0xa8, - 0x05, 0x57, 0xf0, 0x09, 0xa6, 0x09, 0xee, 0x27, 0x24, 0x10, 0x09, 0x97, 0xc2, 0x48, 0xee, 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 0x00, 0xff, 0xff, 0xe2, 0x00, 0x1d, 0xe2, 0xe3, 0x08, 0x00, 0x00, + // 893 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x3a, 0x91, 0x03, 0x2f, 0x2d, 0x25, 0xd3, 0x0a, 0xb9, 0x86, 0x6c, 0xa2, 0x45, 0x90, + 0x28, 0xa2, 0xbb, 0xb2, 0x4b, 0x11, 0x15, 0xa7, 0xba, 0x49, 0x38, 0xf0, 0x43, 0x65, 0x0b, 0x48, + 0xed, 0xc5, 0x1a, 0xef, 0x4e, 0x36, 0x83, 0x77, 0x67, 0xdc, 0x9d, 0x71, 0x82, 0x55, 0x21, 0x24, + 0x4e, 0x08, 0x2e, 0x48, 0xfc, 0x0b, 0x48, 0x20, 0x4e, 0x5c, 0xb8, 0x71, 0xe2, 0xd4, 0x63, 0x25, + 0x2e, 0x9c, 0x00, 0x25, 0x48, 0x9c, 0xf8, 0x1f, 0xd0, 0xce, 0xcc, 0xda, 0x63, 0xbc, 0xc6, 0xf4, + 0x90, 0x4b, 0xe2, 0x79, 0xf3, 0xbd, 0xf7, 0xbe, 0xf7, 0xde, 0xf7, 0x3c, 0x86, 0xad, 0xfe, 0xe8, + 0x98, 0x04, 0x0f, 0x86, 0x24, 0x1f, 0x05, 0xc7, 0xad, 0x1e, 0x91, 0xb8, 0x15, 0xe0, 0x28, 0xe2, + 0x43, 0x26, 0xfd, 0x41, 0xce, 0x25, 0x47, 0xa8, 0x40, 0xf8, 0x0a, 0xe1, 0x1b, 0x44, 0x73, 0x1d, + 0x67, 0x94, 0xf1, 0x40, 0xfd, 0xd5, 0xb0, 0xe6, 0x6e, 0xc4, 0x45, 0xc6, 0x45, 0xd0, 0xc3, 0xe2, + 0xdf, 0xf1, 0x06, 0x38, 0xa1, 0x0c, 0x4b, 0xca, 0x99, 0xc1, 0xba, 0x36, 0xb6, 0x44, 0x45, 0x9c, + 0x96, 0xf7, 0x57, 0x12, 0x9e, 0x70, 0xf5, 0x31, 0x28, 0x3e, 0x19, 0xeb, 0x0b, 0x09, 0xe7, 0x49, + 0x4a, 0x02, 0x3c, 0xa0, 0x01, 0x66, 0x8c, 0x4b, 0x15, 0x52, 0x94, 0x31, 0x2b, 0x0a, 0xd1, 0xa4, + 0xd5, 0xbd, 0x77, 0x03, 0xae, 0xbe, 0x57, 0x1c, 0x6f, 0xe9, 0xe2, 0x6e, 0x09, 0x41, 0xa4, 0x08, + 0xc9, 0x83, 0x21, 0x11, 0x12, 0x35, 0x60, 0x15, 0xc7, 0x71, 0x4e, 0x84, 0x68, 0x38, 0x5b, 0xce, + 0xce, 0xd3, 0x61, 0x79, 0xf4, 0x3e, 0x5f, 0x81, 0x66, 0x95, 0x9f, 0x18, 0x70, 0x26, 0x48, 0xe1, + 0xd8, 0xc3, 0x29, 0x66, 0x11, 0x51, 0x8e, 0x2b, 0x61, 0x79, 0x44, 0x2e, 0x40, 0x4c, 0x52, 0x92, + 0x28, 0x92, 0x8d, 0x9a, 0xba, 0xb4, 0x2c, 0xa8, 0x05, 0x57, 0x26, 0xa7, 0xee, 0x90, 0xf5, 0x38, + 0x8b, 0x29, 0x4b, 0x1a, 0xcb, 0x0a, 0x79, 0x79, 0x72, 0xf7, 0x41, 0x79, 0x85, 0x3e, 0x05, 0x64, + 0xb9, 0xe4, 0xe4, 0x04, 0xe7, 0xb1, 0x68, 0xd4, 0xb7, 0x96, 0x77, 0xd6, 0xda, 0x57, 0x7d, 0xdd, + 0x53, 0xbf, 0xe8, 0x69, 0x39, 0x27, 0xff, 0x36, 0xa7, 0xac, 0x73, 0xe3, 0xd1, 0x6f, 0x9b, 0x4b, + 0xdf, 0xff, 0xbe, 0xb9, 0x93, 0x50, 0x79, 0x34, 0xec, 0xf9, 0x11, 0xcf, 0x02, 0x33, 0x00, 0xfd, + 0xef, 0x9a, 0x88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 0x7c, 0x23, + 0xc6, 0x72, 0xdd, 0xc3, 0x92, 0xa0, 0x4d, 0x58, 0x3b, 0xa4, 0x8c, 0x8a, 0x23, 0x0d, 0x31, 0x2f, + 0x85, 0x36, 0x15, 0x80, 0xf6, 0xdf, 0x35, 0xb8, 0x60, 0x77, 0x06, 0x7d, 0xe3, 0xc0, 0xc5, 0xa9, + 0xe7, 0x08, 0x5d, 0xab, 0x2a, 0x78, 0xee, 0x73, 0xd7, 0xf4, 0xff, 0x2f, 0x5c, 0xb7, 0xdd, 0x7b, + 0xf5, 0xb3, 0x5f, 0xfe, 0xfc, 0xba, 0xe6, 0xa3, 0x57, 0x82, 0xf9, 0xbf, 0x16, 0xba, 0x58, 0xf9, + 0x04, 0x0f, 0xcd, 0x40, 0x3f, 0x41, 0x3f, 0x3a, 0xb0, 0x3e, 0xb3, 0x10, 0xa8, 0xb5, 0x28, 0xf7, + 0xcc, 0xde, 0x35, 0xdb, 0x4f, 0xe2, 0x62, 0x28, 0xdf, 0x54, 0x94, 0xaf, 0xa3, 0xd6, 0x7f, 0x51, + 0xd6, 0x1b, 0xd6, 0x4d, 0xa9, 0x90, 0x13, 0xde, 0x9d, 0xbd, 0x47, 0xa7, 0xae, 0xf3, 0xf8, 0xd4, + 0x75, 0xfe, 0x38, 0x75, 0x9d, 0xaf, 0xce, 0xdc, 0xa5, 0xc7, 0x67, 0xee, 0xd2, 0xaf, 0x67, 0xee, + 0xd2, 0xfd, 0x5d, 0x6b, 0x97, 0xde, 0xba, 0xf7, 0xe1, 0xfe, 0xbb, 0x44, 0x9e, 0xf0, 0xbc, 0x1f, + 0x44, 0x47, 0x98, 0xb2, 0xe0, 0x63, 0x93, 0x45, 0xed, 0x54, 0xaf, 0xae, 0x9e, 0x8f, 0xeb, 0xff, + 0x04, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x94, 0x42, 0xa6, 0x61, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -899,13 +909,27 @@ func (m *QueryAccountAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err i = encodeVarintAccount(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x42 + } + } + if len(m.CommissionRewards) > 0 { + for iNdEx := len(m.CommissionRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CommissionRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccount(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x3a } } - if len(m.OutstandingRewards) > 0 { - for iNdEx := len(m.OutstandingRewards) - 1; iNdEx >= 0; iNdEx-- { + if len(m.DelegationRewards) > 0 { + for iNdEx := len(m.DelegationRewards) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.OutstandingRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DelegationRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1330,8 +1354,14 @@ func (m *QueryAccountAssetsResponse) Size() (n int) { if m.DelegationUnbonding != 0 { n += 1 + sovAccount(uint64(m.DelegationUnbonding)) } - if len(m.OutstandingRewards) > 0 { - for _, e := range m.OutstandingRewards { + if len(m.DelegationRewards) > 0 { + for _, e := range m.DelegationRewards { + l = e.Size() + n += 1 + l + sovAccount(uint64(l)) + } + } + if len(m.CommissionRewards) > 0 { + for _, e := range m.CommissionRewards { l = e.Size() n += 1 + l + sovAccount(uint64(l)) } @@ -1669,7 +1699,7 @@ func (m *QueryAccountAssetsResponse) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutstandingRewards", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegationRewards", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1696,12 +1726,46 @@ func (m *QueryAccountAssetsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OutstandingRewards = append(m.OutstandingRewards, types.Coin{}) - if err := m.OutstandingRewards[len(m.OutstandingRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DelegationRewards = append(m.DelegationRewards, types.Coin{}) + if err := m.DelegationRewards[len(m.DelegationRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommissionRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccount + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccount + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccount + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommissionRewards = append(m.CommissionRewards, types.Coin{}) + if err := m.CommissionRewards[len(m.CommissionRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProtocolFunding", wireType) }