diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.lcd.ts index 9350c68ecf2..647cd899a49 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryVaultRequest, QueryVaultResponseSDKType, QueryAllVaultsRequest, QueryAllVaultsResponseSDKType, QueryMegavaultTotalSharesRequest, QueryMegavaultTotalSharesResponseSDKType, QueryMegavaultOwnerSharesRequest, QueryMegavaultOwnerSharesResponseSDKType, QueryVaultParamsRequest, QueryVaultParamsResponseSDKType, QueryMegavaultWithdrawalInfoRequest, QueryMegavaultWithdrawalInfoResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryVaultRequest, QueryVaultResponseSDKType, QueryAllVaultsRequest, QueryAllVaultsResponseSDKType, QueryMegavaultTotalSharesRequest, QueryMegavaultTotalSharesResponseSDKType, QueryMegavaultOwnerSharesRequest, QueryMegavaultOwnerSharesResponseSDKType, QueryMegavaultAllOwnerSharesRequest, QueryMegavaultAllOwnerSharesResponseSDKType, QueryVaultParamsRequest, QueryVaultParamsResponseSDKType, QueryMegavaultWithdrawalInfoRequest, QueryMegavaultWithdrawalInfoResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -15,6 +15,7 @@ export class LCDQueryClient { this.allVaults = this.allVaults.bind(this); this.megavaultTotalShares = this.megavaultTotalShares.bind(this); this.megavaultOwnerShares = this.megavaultOwnerShares.bind(this); + this.megavaultAllOwnerShares = this.megavaultAllOwnerShares.bind(this); this.vaultParams = this.vaultParams.bind(this); this.megavaultWithdrawalInfo = this.megavaultWithdrawalInfo.bind(this); } @@ -59,9 +60,24 @@ export class LCDQueryClient { /* Queries owner shares of megavault. */ - async megavaultOwnerShares(params: QueryMegavaultOwnerSharesRequest = { + async megavaultOwnerShares(params: QueryMegavaultOwnerSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.address !== "undefined") { + options.params.address = params.address; + } + + const endpoint = `dydxprotocol/vault/megavault/owner_shares`; + return await this.req.get(endpoint, options); + } + /* Queries all owner shares of megavault. */ + + + async megavaultAllOwnerShares(params: QueryMegavaultAllOwnerSharesRequest = { pagination: undefined - }): Promise { + }): Promise { const options: any = { params: {} }; @@ -70,8 +86,8 @@ export class LCDQueryClient { setPaginationParams(options, params.pagination); } - const endpoint = `dydxprotocol/vault/megavault/owner_shares`; - return await this.req.get(endpoint, options); + const endpoint = `dydxprotocol/vault/megavault/all_owner_shares`; + return await this.req.get(endpoint, options); } /* Queries vault params of a vault. */ diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.rpc.Query.ts index a77656dc6c0..78897009758 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, QueryVaultRequest, QueryVaultResponse, QueryAllVaultsRequest, QueryAllVaultsResponse, QueryMegavaultTotalSharesRequest, QueryMegavaultTotalSharesResponse, QueryMegavaultOwnerSharesRequest, QueryMegavaultOwnerSharesResponse, QueryVaultParamsRequest, QueryVaultParamsResponse, QueryMegavaultWithdrawalInfoRequest, QueryMegavaultWithdrawalInfoResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryVaultRequest, QueryVaultResponse, QueryAllVaultsRequest, QueryAllVaultsResponse, QueryMegavaultTotalSharesRequest, QueryMegavaultTotalSharesResponse, QueryMegavaultOwnerSharesRequest, QueryMegavaultOwnerSharesResponse, QueryMegavaultAllOwnerSharesRequest, QueryMegavaultAllOwnerSharesResponse, QueryVaultParamsRequest, QueryVaultParamsResponse, QueryMegavaultWithdrawalInfoRequest, QueryMegavaultWithdrawalInfoResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -18,7 +18,10 @@ export interface Query { megavaultTotalShares(request?: QueryMegavaultTotalSharesRequest): Promise; /** Queries owner shares of megavault. */ - megavaultOwnerShares(request?: QueryMegavaultOwnerSharesRequest): Promise; + megavaultOwnerShares(request: QueryMegavaultOwnerSharesRequest): Promise; + /** Queries all owner shares of megavault. */ + + megavaultAllOwnerShares(request?: QueryMegavaultAllOwnerSharesRequest): Promise; /** Queries vault params of a vault. */ vaultParams(request: QueryVaultParamsRequest): Promise; @@ -36,6 +39,7 @@ export class QueryClientImpl implements Query { this.allVaults = this.allVaults.bind(this); this.megavaultTotalShares = this.megavaultTotalShares.bind(this); this.megavaultOwnerShares = this.megavaultOwnerShares.bind(this); + this.megavaultAllOwnerShares = this.megavaultAllOwnerShares.bind(this); this.vaultParams = this.vaultParams.bind(this); this.megavaultWithdrawalInfo = this.megavaultWithdrawalInfo.bind(this); } @@ -66,14 +70,20 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryMegavaultTotalSharesResponse.decode(new _m0.Reader(data))); } - megavaultOwnerShares(request: QueryMegavaultOwnerSharesRequest = { - pagination: undefined - }): Promise { + megavaultOwnerShares(request: QueryMegavaultOwnerSharesRequest): Promise { const data = QueryMegavaultOwnerSharesRequest.encode(request).finish(); const promise = this.rpc.request("dydxprotocol.vault.Query", "MegavaultOwnerShares", data); return promise.then(data => QueryMegavaultOwnerSharesResponse.decode(new _m0.Reader(data))); } + megavaultAllOwnerShares(request: QueryMegavaultAllOwnerSharesRequest = { + pagination: undefined + }): Promise { + const data = QueryMegavaultAllOwnerSharesRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.vault.Query", "MegavaultAllOwnerShares", data); + return promise.then(data => QueryMegavaultAllOwnerSharesResponse.decode(new _m0.Reader(data))); + } + vaultParams(request: QueryVaultParamsRequest): Promise { const data = QueryVaultParamsRequest.encode(request).finish(); const promise = this.rpc.request("dydxprotocol.vault.Query", "VaultParams", data); @@ -107,10 +117,14 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.megavaultTotalShares(request); }, - megavaultOwnerShares(request?: QueryMegavaultOwnerSharesRequest): Promise { + megavaultOwnerShares(request: QueryMegavaultOwnerSharesRequest): Promise { return queryService.megavaultOwnerShares(request); }, + megavaultAllOwnerShares(request?: QueryMegavaultAllOwnerSharesRequest): Promise { + return queryService.megavaultAllOwnerShares(request); + }, + vaultParams(request: QueryVaultParamsRequest): Promise { return queryService.vaultParams(request); }, diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts index 2a62eebecce..9598eedc6b1 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts @@ -1,6 +1,6 @@ import { VaultType, VaultTypeSDKType, VaultId, VaultIdSDKType } from "./vault"; import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; -import { NumShares, NumSharesSDKType, OwnerShare, OwnerShareSDKType } from "./share"; +import { NumShares, NumSharesSDKType, ShareUnlock, ShareUnlockSDKType, OwnerShare, OwnerShareSDKType } from "./share"; import { Params, ParamsSDKType, QuotingParams, QuotingParamsSDKType, OperatorParams, OperatorParamsSDKType, VaultParams, VaultParamsSDKType } from "./params"; import { SubaccountId, SubaccountIdSDKType } from "../subaccounts/subaccount"; import * as _m0 from "protobufjs/minimal"; @@ -125,7 +125,7 @@ export interface QueryMegavaultTotalSharesResponseSDKType { */ export interface QueryMegavaultOwnerSharesRequest { - pagination?: PageRequest; + address: string; } /** * QueryMegavaultOwnerSharesRequest is a request type for the @@ -133,7 +133,7 @@ export interface QueryMegavaultOwnerSharesRequest { */ export interface QueryMegavaultOwnerSharesRequestSDKType { - pagination?: PageRequestSDKType; + address: string; } /** * QueryMegavaultOwnerSharesResponse is a response type for the @@ -141,8 +141,23 @@ export interface QueryMegavaultOwnerSharesRequestSDKType { */ export interface QueryMegavaultOwnerSharesResponse { - ownerShares: OwnerShare[]; - pagination?: PageResponse; + /** Owner address. */ + address: string; + /** Total number of shares that belong to the owner. */ + + shares?: NumShares; + /** All share unlocks. */ + + shareUnlocks: ShareUnlock[]; + /** Owner equity in megavault (in quote quantums). */ + + equity: Uint8Array; + /** + * Equity that owner can withdraw in quote quantums (as one cannot + * withdraw locked shares). + */ + + withdrawableEquity: Uint8Array; } /** * QueryMegavaultOwnerSharesResponse is a response type for the @@ -150,6 +165,55 @@ export interface QueryMegavaultOwnerSharesResponse { */ export interface QueryMegavaultOwnerSharesResponseSDKType { + /** Owner address. */ + address: string; + /** Total number of shares that belong to the owner. */ + + shares?: NumSharesSDKType; + /** All share unlocks. */ + + share_unlocks: ShareUnlockSDKType[]; + /** Owner equity in megavault (in quote quantums). */ + + equity: Uint8Array; + /** + * Equity that owner can withdraw in quote quantums (as one cannot + * withdraw locked shares). + */ + + withdrawable_equity: Uint8Array; +} +/** + * QueryMegavaultAllOwnerSharesRequest is a request type for the + * MegavaultAllOwnerShares RPC method. + */ + +export interface QueryMegavaultAllOwnerSharesRequest { + pagination?: PageRequest; +} +/** + * QueryMegavaultAllOwnerSharesRequest is a request type for the + * MegavaultAllOwnerShares RPC method. + */ + +export interface QueryMegavaultAllOwnerSharesRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryMegavaultAllOwnerSharesResponse is a response type for the + * MegavaultAllOwnerShares RPC method. + */ + +export interface QueryMegavaultAllOwnerSharesResponse { + ownerShares: OwnerShare[]; + pagination?: PageResponse; +} +/** + * QueryMegavaultAllOwnerSharesResponse is a response type for the + * MegavaultAllOwnerShares RPC method. + */ + +export interface QueryMegavaultAllOwnerSharesResponseSDKType { owner_shares: OwnerShareSDKType[]; pagination?: PageResponseSDKType; } @@ -662,14 +726,14 @@ export const QueryMegavaultTotalSharesResponse = { function createBaseQueryMegavaultOwnerSharesRequest(): QueryMegavaultOwnerSharesRequest { return { - pagination: undefined + address: "" }; } export const QueryMegavaultOwnerSharesRequest = { encode(message: QueryMegavaultOwnerSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + if (message.address !== "") { + writer.uint32(10).string(message.address); } return writer; @@ -684,8 +748,8 @@ export const QueryMegavaultOwnerSharesRequest = { const tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.pagination = PageRequest.decode(reader, reader.uint32()); + case 1: + message.address = reader.string(); break; default: @@ -699,7 +763,7 @@ export const QueryMegavaultOwnerSharesRequest = { fromPartial(object: DeepPartial): QueryMegavaultOwnerSharesRequest { const message = createBaseQueryMegavaultOwnerSharesRequest(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + message.address = object.address ?? ""; return message; } @@ -707,13 +771,143 @@ export const QueryMegavaultOwnerSharesRequest = { function createBaseQueryMegavaultOwnerSharesResponse(): QueryMegavaultOwnerSharesResponse { return { - ownerShares: [], - pagination: undefined + address: "", + shares: undefined, + shareUnlocks: [], + equity: new Uint8Array(), + withdrawableEquity: new Uint8Array() }; } export const QueryMegavaultOwnerSharesResponse = { encode(message: QueryMegavaultOwnerSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + + if (message.shares !== undefined) { + NumShares.encode(message.shares, writer.uint32(18).fork()).ldelim(); + } + + for (const v of message.shareUnlocks) { + ShareUnlock.encode(v!, writer.uint32(26).fork()).ldelim(); + } + + if (message.equity.length !== 0) { + writer.uint32(34).bytes(message.equity); + } + + if (message.withdrawableEquity.length !== 0) { + writer.uint32(42).bytes(message.withdrawableEquity); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryMegavaultOwnerSharesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMegavaultOwnerSharesResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + + case 2: + message.shares = NumShares.decode(reader, reader.uint32()); + break; + + case 3: + message.shareUnlocks.push(ShareUnlock.decode(reader, reader.uint32())); + break; + + case 4: + message.equity = reader.bytes(); + break; + + case 5: + message.withdrawableEquity = reader.bytes(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryMegavaultOwnerSharesResponse { + const message = createBaseQueryMegavaultOwnerSharesResponse(); + message.address = object.address ?? ""; + message.shares = object.shares !== undefined && object.shares !== null ? NumShares.fromPartial(object.shares) : undefined; + message.shareUnlocks = object.shareUnlocks?.map(e => ShareUnlock.fromPartial(e)) || []; + message.equity = object.equity ?? new Uint8Array(); + message.withdrawableEquity = object.withdrawableEquity ?? new Uint8Array(); + return message; + } + +}; + +function createBaseQueryMegavaultAllOwnerSharesRequest(): QueryMegavaultAllOwnerSharesRequest { + return { + pagination: undefined + }; +} + +export const QueryMegavaultAllOwnerSharesRequest = { + encode(message: QueryMegavaultAllOwnerSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryMegavaultAllOwnerSharesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryMegavaultAllOwnerSharesRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryMegavaultAllOwnerSharesRequest { + const message = createBaseQueryMegavaultAllOwnerSharesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + } + +}; + +function createBaseQueryMegavaultAllOwnerSharesResponse(): QueryMegavaultAllOwnerSharesResponse { + return { + ownerShares: [], + pagination: undefined + }; +} + +export const QueryMegavaultAllOwnerSharesResponse = { + encode(message: QueryMegavaultAllOwnerSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.ownerShares) { OwnerShare.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -725,10 +919,10 @@ export const QueryMegavaultOwnerSharesResponse = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryMegavaultOwnerSharesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryMegavaultAllOwnerSharesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryMegavaultOwnerSharesResponse(); + const message = createBaseQueryMegavaultAllOwnerSharesResponse(); while (reader.pos < end) { const tag = reader.uint32(); @@ -751,8 +945,8 @@ export const QueryMegavaultOwnerSharesResponse = { return message; }, - fromPartial(object: DeepPartial): QueryMegavaultOwnerSharesResponse { - const message = createBaseQueryMegavaultOwnerSharesResponse(); + fromPartial(object: DeepPartial): QueryMegavaultAllOwnerSharesResponse { + const message = createBaseQueryMegavaultAllOwnerSharesResponse(); message.ownerShares = object.ownerShares?.map(e => OwnerShare.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; diff --git a/proto/dydxprotocol/vault/query.proto b/proto/dydxprotocol/vault/query.proto index faff37c6922..b36a1d2b965 100644 --- a/proto/dydxprotocol/vault/query.proto +++ b/proto/dydxprotocol/vault/query.proto @@ -1,9 +1,10 @@ syntax = "proto3"; package dydxprotocol.vault; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; import "dydxprotocol/subaccounts/subaccount.proto"; import "dydxprotocol/vault/params.proto"; import "dydxprotocol/vault/share.proto"; @@ -35,6 +36,11 @@ service Query { returns (QueryMegavaultOwnerSharesResponse) { option (google.api.http).get = "/dydxprotocol/vault/megavault/owner_shares"; } + // Queries all owner shares of megavault. + rpc MegavaultAllOwnerShares(QueryMegavaultAllOwnerSharesRequest) + returns (QueryMegavaultAllOwnerSharesResponse) { + option (google.api.http).get = "/dydxprotocol/vault/megavault/all_owner_shares"; + } // Queries vault params of a vault. rpc VaultParams(QueryVaultParamsRequest) returns (QueryVaultParamsResponse) { option (google.api.http).get = "/dydxprotocol/vault/params/{type}/{number}"; @@ -105,12 +111,42 @@ message QueryMegavaultTotalSharesResponse { NumShares total_shares = 1; } // QueryMegavaultOwnerSharesRequest is a request type for the // MegavaultOwnerShares RPC method. message QueryMegavaultOwnerSharesRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 3; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } // QueryMegavaultOwnerSharesResponse is a response type for the // MegavaultOwnerShares RPC method. message QueryMegavaultOwnerSharesResponse { + // Owner address. + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Total number of shares that belong to the owner. + NumShares shares = 2 [ (gogoproto.nullable) = false ]; + // All share unlocks. + repeated ShareUnlock share_unlocks = 3 [ (gogoproto.nullable) = false ]; + // Owner equity in megavault (in quote quantums). + bytes equity = 4 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; + // Equity that owner can withdraw in quote quantums (as one cannot + // withdraw locked shares). + bytes withdrawable_equity = 5 [ + (gogoproto.customtype) = + "github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt", + (gogoproto.nullable) = false + ]; +} + +// QueryMegavaultAllOwnerSharesRequest is a request type for the +// MegavaultAllOwnerShares RPC method. +message QueryMegavaultAllOwnerSharesRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryMegavaultAllOwnerSharesResponse is a response type for the +// MegavaultAllOwnerShares RPC method. +message QueryMegavaultAllOwnerSharesResponse { repeated OwnerShare owner_shares = 1; cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/protocol/x/vault/client/cli/query.go b/protocol/x/vault/client/cli/query.go index 93b2c5a115e..ad9c2b24e9a 100644 --- a/protocol/x/vault/client/cli/query.go +++ b/protocol/x/vault/client/cli/query.go @@ -30,6 +30,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryTotalShares()) cmd.AddCommand(CmdQueryListOwnerShares()) cmd.AddCommand(CmdQueryMegavaultWithdrawalInfo()) + cmd.AddCommand(CmdQueryOwnerShares()) return cmd } @@ -169,11 +170,11 @@ func CmdQueryListOwnerShares() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - request := &types.QueryMegavaultOwnerSharesRequest{ + request := &types.QueryMegavaultAllOwnerSharesRequest{ Pagination: pageReq, } - res, err := queryClient.MegavaultOwnerShares(context.Background(), request) + res, err := queryClient.MegavaultAllOwnerShares(context.Background(), request) if err != nil { return err } @@ -221,3 +222,30 @@ func CmdQueryMegavaultWithdrawalInfo() *cobra.Command { return cmd } + +func CmdQueryOwnerShares() *cobra.Command { + cmd := &cobra.Command{ + Use: "owner-shares [address]", + Short: "get owner shares by their address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.MegavaultOwnerShares( + context.Background(), + &types.QueryMegavaultOwnerSharesRequest{ + Address: args[0], + }, + ) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/protocol/x/vault/keeper/grpc_query_shares.go b/protocol/x/vault/keeper/grpc_query_shares.go index edd51e2c1aa..7a38c9677f6 100644 --- a/protocol/x/vault/keeper/grpc_query_shares.go +++ b/protocol/x/vault/keeper/grpc_query_shares.go @@ -2,11 +2,13 @@ package keeper import ( "context" + "math/big" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/cosmos/cosmos-sdk/types/query" + "github.com/dydxprotocol/v4-chain/protocol/dtypes" "github.com/dydxprotocol/v4-chain/protocol/lib" "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" ) @@ -33,6 +35,49 @@ func (k Keeper) MegavaultOwnerShares( } ctx := lib.UnwrapSDKContext(c, types.ModuleName) + ownerShares, exists := k.GetOwnerShares(ctx, req.Address) + if !exists { + return nil, status.Error(codes.NotFound, "owner not found") + } + + shareUnlocks, exists := k.GetOwnerShareUnlocks(ctx, req.Address) + totalLockedShares := big.NewInt(0) + if exists { + totalLockedShares = shareUnlocks.GetTotalLockedShares() + } + + megavaultEquity, err := k.GetMegavaultEquity(ctx) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + totalShares := k.GetTotalShares(ctx) + + bigOwnerShares := ownerShares.NumShares.BigInt() + ownerEquity := new(big.Int).Mul(bigOwnerShares, megavaultEquity) + ownerEquity.Quo(ownerEquity, totalShares.NumShares.BigInt()) + + ownerWithdrawableEquity := new(big.Int).Sub(bigOwnerShares, totalLockedShares) + ownerWithdrawableEquity.Mul(ownerWithdrawableEquity, ownerEquity) + ownerWithdrawableEquity.Quo(ownerWithdrawableEquity, bigOwnerShares) + + return &types.QueryMegavaultOwnerSharesResponse{ + Address: req.Address, + Shares: ownerShares, + ShareUnlocks: shareUnlocks.ShareUnlocks, + Equity: dtypes.NewIntFromBigInt(ownerEquity), + WithdrawableEquity: dtypes.NewIntFromBigInt(ownerWithdrawableEquity), + }, nil +} + +func (k Keeper) MegavaultAllOwnerShares( + c context.Context, + req *types.QueryMegavaultAllOwnerSharesRequest, +) (*types.QueryMegavaultAllOwnerSharesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + var ownerShares []*types.OwnerShare ownerSharesStore := k.getOwnerSharesStore(ctx) pageRes, err := query.Paginate(ownerSharesStore, req.Pagination, func(key []byte, value []byte) error { @@ -53,7 +98,7 @@ func (k Keeper) MegavaultOwnerShares( return nil, status.Error(codes.Internal, err.Error()) } - return &types.QueryMegavaultOwnerSharesResponse{ + return &types.QueryMegavaultAllOwnerSharesResponse{ OwnerShares: ownerShares, Pagination: pageRes, }, nil diff --git a/protocol/x/vault/keeper/grpc_query_shares_test.go b/protocol/x/vault/keeper/grpc_query_shares_test.go index 0eb32db72ee..bf8651202d0 100644 --- a/protocol/x/vault/keeper/grpc_query_shares_test.go +++ b/protocol/x/vault/keeper/grpc_query_shares_test.go @@ -4,19 +4,21 @@ import ( "math/big" "testing" + "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/dydxprotocol/v4-chain/protocol/dtypes" testapp "github.com/dydxprotocol/v4-chain/protocol/testutil/app" "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" + satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" "github.com/stretchr/testify/require" ) -func TestMegavaultOwnerShares(t *testing.T) { +func TestMegavaultAllOwnerShares(t *testing.T) { tests := map[string]struct { /* --- Setup --- */ // Request. - req *vaulttypes.QueryMegavaultOwnerSharesRequest + req *vaulttypes.QueryMegavaultAllOwnerSharesRequest // Owner shares. ownerShares map[string]*big.Int @@ -25,7 +27,7 @@ func TestMegavaultOwnerShares(t *testing.T) { expectedErr string }{ "Success": { - req: &vaulttypes.QueryMegavaultOwnerSharesRequest{}, + req: &vaulttypes.QueryMegavaultAllOwnerSharesRequest{}, ownerShares: map[string]*big.Int{ constants.Alice_Num0.Owner: big.NewInt(100), constants.Bob_Num0.Owner: big.NewInt(200), @@ -46,7 +48,7 @@ func TestMegavaultOwnerShares(t *testing.T) { }, }, "Success: no owners": { - req: &vaulttypes.QueryMegavaultOwnerSharesRequest{}, + req: &vaulttypes.QueryMegavaultAllOwnerSharesRequest{}, ownerShares: map[string]*big.Int{}, }, "Error: nil request": { @@ -72,7 +74,7 @@ func TestMegavaultOwnerShares(t *testing.T) { require.NoError(t, err) // Check OwnerShares query response is as expected. - response, err := k.MegavaultOwnerShares(ctx, tc.req) + response, err := k.MegavaultAllOwnerShares(ctx, tc.req) if tc.expectedErr != "" { require.ErrorContains(t, err, tc.expectedErr) } else { @@ -94,3 +96,170 @@ func TestMegavaultOwnerShares(t *testing.T) { }) } } + +func TestMegavaultOwnerShares(t *testing.T) { + tests := map[string]struct { + /* --- Setup --- */ + // Request. + req *vaulttypes.QueryMegavaultOwnerSharesRequest + // Owner address. + ownerAddress string + // Owner shares. + ownerShares *big.Int + // Share unlocks. + shareUnlocks []vaulttypes.ShareUnlock + // Total shares. + totalShares *big.Int + // Megavault equity. + megavaultEquity *big.Int + + /* --- Expectations --- */ + expectedOwnerEquity *big.Int + expectedOwnerWithdrawableEquity *big.Int + expectedErr string + }{ + "Success with zero unlock": { + req: &vaulttypes.QueryMegavaultOwnerSharesRequest{ + Address: constants.AliceAccAddress.String(), + }, + ownerAddress: constants.AliceAccAddress.String(), + ownerShares: big.NewInt(100), + totalShares: big.NewInt(5_000), + megavaultEquity: big.NewInt(2_000_000), + expectedOwnerEquity: big.NewInt(40_000), + expectedOwnerWithdrawableEquity: big.NewInt(40_000), + }, + "Success with one unlock": { + req: &vaulttypes.QueryMegavaultOwnerSharesRequest{ + Address: constants.AliceAccAddress.String(), + }, + ownerAddress: constants.AliceAccAddress.String(), + ownerShares: big.NewInt(100), + shareUnlocks: []vaulttypes.ShareUnlock{ + { + Shares: vaulttypes.NumShares{ + NumShares: dtypes.NewInt(17), + }, + UnlockBlockHeight: 123, + }, + }, + totalShares: big.NewInt(5_000), + megavaultEquity: big.NewInt(2_000_000), + expectedOwnerEquity: big.NewInt(40_000), + // 40_000 * (100 - 17) / 100 = 33_200 + expectedOwnerWithdrawableEquity: big.NewInt(33_200), + }, + "Success with two unlocks": { + req: &vaulttypes.QueryMegavaultOwnerSharesRequest{ + Address: constants.BobAccAddress.String(), + }, + ownerAddress: constants.BobAccAddress.String(), + ownerShares: big.NewInt(47_123), + shareUnlocks: []vaulttypes.ShareUnlock{ + { + Shares: vaulttypes.NumShares{ + NumShares: dtypes.NewInt(1_234), + }, + UnlockBlockHeight: 905, + }, + { + Shares: vaulttypes.NumShares{ + NumShares: dtypes.NewInt(4_444), + }, + UnlockBlockHeight: 1023, + }, + }, + totalShares: big.NewInt(358_791_341), + megavaultEquity: big.NewInt(753_582_314_912), + // 753_582_314_912 * 47_123 / 358_791_341 ~= 98_974_126 + expectedOwnerEquity: big.NewInt(98_974_126), + // 98_974_126 * (47_123 - 5_678) / 47_123 ~= 87_048_419 + expectedOwnerWithdrawableEquity: big.NewInt(87_048_419), + }, + "Error: owner not found": { + req: &vaulttypes.QueryMegavaultOwnerSharesRequest{ + Address: constants.BobAccAddress.String(), + }, + ownerAddress: constants.AliceAccAddress.String(), + ownerShares: big.NewInt(100), + shareUnlocks: []vaulttypes.ShareUnlock{}, + totalShares: big.NewInt(5_000), + megavaultEquity: big.NewInt(2_000_000), + expectedErr: "owner not found", + }, + "Error: nil request": { + req: nil, + ownerAddress: constants.AliceAccAddress.String(), + ownerShares: big.NewInt(100), + shareUnlocks: []vaulttypes.ShareUnlock{}, + totalShares: big.NewInt(5_000), + megavaultEquity: big.NewInt(2_000_000), + expectedErr: "invalid request", + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + tApp := testapp.NewTestAppBuilder(t).WithGenesisDocFn(func() (genesis types.GenesisDoc) { + genesis = testapp.DefaultGenesis() + // Initialize megavault main vault with its equity. + testapp.UpdateGenesisDocWithAppStateForModule( + &genesis, + func(genesisState *satypes.GenesisState) { + genesisState.Subaccounts = []satypes.Subaccount{ + { + Id: &vaulttypes.MegavaultMainSubaccount, + AssetPositions: []*satypes.AssetPosition{ + { + AssetId: constants.Usdc.Id, + Quantums: dtypes.NewIntFromBigInt(tc.megavaultEquity), + }, + }, + }, + } + }, + ) + return genesis + }).Build() + ctx := tApp.InitChain() + k := tApp.App.VaultKeeper + + err := k.SetTotalShares(ctx, vaulttypes.BigIntToNumShares(tc.totalShares)) + require.NoError(t, err) + err = k.SetOwnerShares( + ctx, + tc.ownerAddress, + vaulttypes.BigIntToNumShares(tc.ownerShares), + ) + require.NoError(t, err) + err = k.SetOwnerShareUnlocks( + ctx, + tc.ownerAddress, + vaulttypes.OwnerShareUnlocks{ + OwnerAddress: tc.ownerAddress, + ShareUnlocks: tc.shareUnlocks, + }, + ) + require.NoError(t, err) + + // Check OwnerShares query response is as expected. + res, err := k.MegavaultOwnerShares(ctx, tc.req) + if tc.expectedErr != "" { + require.ErrorContains(t, err, tc.expectedErr) + } else { + require.NoError(t, err) + require.Equal( + t, + vaulttypes.QueryMegavaultOwnerSharesResponse{ + Address: tc.req.Address, + Shares: vaulttypes.BigIntToNumShares(tc.ownerShares), + ShareUnlocks: tc.shareUnlocks, + Equity: dtypes.NewIntFromBigInt(tc.expectedOwnerEquity), + WithdrawableEquity: dtypes.NewIntFromBigInt(tc.expectedOwnerWithdrawableEquity), + }, + *res, + ) + } + }) + } +} diff --git a/protocol/x/vault/types/query.pb.go b/protocol/x/vault/types/query.pb.go index 3a203499602..6e12e1dbac6 100644 --- a/protocol/x/vault/types/query.pb.go +++ b/protocol/x/vault/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-proto" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -433,7 +434,7 @@ func (m *QueryMegavaultTotalSharesResponse) GetTotalShares() *NumShares { // QueryMegavaultOwnerSharesRequest is a request type for the // MegavaultOwnerShares RPC method. type QueryMegavaultOwnerSharesRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } func (m *QueryMegavaultOwnerSharesRequest) Reset() { *m = QueryMegavaultOwnerSharesRequest{} } @@ -469,18 +470,27 @@ func (m *QueryMegavaultOwnerSharesRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMegavaultOwnerSharesRequest proto.InternalMessageInfo -func (m *QueryMegavaultOwnerSharesRequest) GetPagination() *query.PageRequest { +func (m *QueryMegavaultOwnerSharesRequest) GetAddress() string { if m != nil { - return m.Pagination + return m.Address } - return nil + return "" } // QueryMegavaultOwnerSharesResponse is a response type for the // MegavaultOwnerShares RPC method. type QueryMegavaultOwnerSharesResponse struct { - OwnerShares []*OwnerShare `protobuf:"bytes,1,rep,name=owner_shares,json=ownerShares,proto3" json:"owner_shares,omitempty"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` + // Owner address. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Total number of shares that belong to the owner. + Shares NumShares `protobuf:"bytes,2,opt,name=shares,proto3" json:"shares"` + // All share unlocks. + ShareUnlocks []ShareUnlock `protobuf:"bytes,3,rep,name=share_unlocks,json=shareUnlocks,proto3" json:"share_unlocks"` + // Owner equity in megavault (in quote quantums). + Equity github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,4,opt,name=equity,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"equity"` + // Equity that owner can withdraw in quote quantums (as one cannot + // withdraw locked shares). + WithdrawableEquity github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,5,opt,name=withdrawable_equity,json=withdrawableEquity,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"withdrawable_equity"` } func (m *QueryMegavaultOwnerSharesResponse) Reset() { *m = QueryMegavaultOwnerSharesResponse{} } @@ -516,14 +526,121 @@ func (m *QueryMegavaultOwnerSharesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMegavaultOwnerSharesResponse proto.InternalMessageInfo -func (m *QueryMegavaultOwnerSharesResponse) GetOwnerShares() []*OwnerShare { +func (m *QueryMegavaultOwnerSharesResponse) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QueryMegavaultOwnerSharesResponse) GetShares() NumShares { + if m != nil { + return m.Shares + } + return NumShares{} +} + +func (m *QueryMegavaultOwnerSharesResponse) GetShareUnlocks() []ShareUnlock { + if m != nil { + return m.ShareUnlocks + } + return nil +} + +// QueryMegavaultAllOwnerSharesRequest is a request type for the +// MegavaultAllOwnerShares RPC method. +type QueryMegavaultAllOwnerSharesRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryMegavaultAllOwnerSharesRequest) Reset() { *m = QueryMegavaultAllOwnerSharesRequest{} } +func (m *QueryMegavaultAllOwnerSharesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryMegavaultAllOwnerSharesRequest) ProtoMessage() {} +func (*QueryMegavaultAllOwnerSharesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_478fb8dc0ff21ea6, []int{10} +} +func (m *QueryMegavaultAllOwnerSharesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMegavaultAllOwnerSharesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMegavaultAllOwnerSharesRequest.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 *QueryMegavaultAllOwnerSharesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMegavaultAllOwnerSharesRequest.Merge(m, src) +} +func (m *QueryMegavaultAllOwnerSharesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryMegavaultAllOwnerSharesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMegavaultAllOwnerSharesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMegavaultAllOwnerSharesRequest proto.InternalMessageInfo + +func (m *QueryMegavaultAllOwnerSharesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryMegavaultAllOwnerSharesResponse is a response type for the +// MegavaultAllOwnerShares RPC method. +type QueryMegavaultAllOwnerSharesResponse struct { + OwnerShares []*OwnerShare `protobuf:"bytes,1,rep,name=owner_shares,json=ownerShares,proto3" json:"owner_shares,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryMegavaultAllOwnerSharesResponse) Reset() { *m = QueryMegavaultAllOwnerSharesResponse{} } +func (m *QueryMegavaultAllOwnerSharesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryMegavaultAllOwnerSharesResponse) ProtoMessage() {} +func (*QueryMegavaultAllOwnerSharesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_478fb8dc0ff21ea6, []int{11} +} +func (m *QueryMegavaultAllOwnerSharesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMegavaultAllOwnerSharesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMegavaultAllOwnerSharesResponse.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 *QueryMegavaultAllOwnerSharesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMegavaultAllOwnerSharesResponse.Merge(m, src) +} +func (m *QueryMegavaultAllOwnerSharesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryMegavaultAllOwnerSharesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMegavaultAllOwnerSharesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMegavaultAllOwnerSharesResponse proto.InternalMessageInfo + +func (m *QueryMegavaultAllOwnerSharesResponse) GetOwnerShares() []*OwnerShare { if m != nil { return m.OwnerShares } return nil } -func (m *QueryMegavaultOwnerSharesResponse) GetPagination() *query.PageResponse { +func (m *QueryMegavaultAllOwnerSharesResponse) GetPagination() *query.PageResponse { if m != nil { return m.Pagination } @@ -540,7 +657,7 @@ func (m *QueryVaultParamsRequest) Reset() { *m = QueryVaultParamsRequest func (m *QueryVaultParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryVaultParamsRequest) ProtoMessage() {} func (*QueryVaultParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_478fb8dc0ff21ea6, []int{10} + return fileDescriptor_478fb8dc0ff21ea6, []int{12} } func (m *QueryVaultParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -593,7 +710,7 @@ func (m *QueryVaultParamsResponse) Reset() { *m = QueryVaultParamsRespon func (m *QueryVaultParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryVaultParamsResponse) ProtoMessage() {} func (*QueryVaultParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_478fb8dc0ff21ea6, []int{11} + return fileDescriptor_478fb8dc0ff21ea6, []int{13} } func (m *QueryVaultParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -647,7 +764,7 @@ func (m *QueryMegavaultWithdrawalInfoRequest) Reset() { *m = QueryMegava func (m *QueryMegavaultWithdrawalInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryMegavaultWithdrawalInfoRequest) ProtoMessage() {} func (*QueryMegavaultWithdrawalInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_478fb8dc0ff21ea6, []int{12} + return fileDescriptor_478fb8dc0ff21ea6, []int{14} } func (m *QueryMegavaultWithdrawalInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -703,7 +820,7 @@ func (m *QueryMegavaultWithdrawalInfoResponse) Reset() { *m = QueryMegav func (m *QueryMegavaultWithdrawalInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryMegavaultWithdrawalInfoResponse) ProtoMessage() {} func (*QueryMegavaultWithdrawalInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_478fb8dc0ff21ea6, []int{13} + return fileDescriptor_478fb8dc0ff21ea6, []int{15} } func (m *QueryMegavaultWithdrawalInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -757,6 +874,8 @@ func init() { proto.RegisterType((*QueryMegavaultTotalSharesResponse)(nil), "dydxprotocol.vault.QueryMegavaultTotalSharesResponse") proto.RegisterType((*QueryMegavaultOwnerSharesRequest)(nil), "dydxprotocol.vault.QueryMegavaultOwnerSharesRequest") proto.RegisterType((*QueryMegavaultOwnerSharesResponse)(nil), "dydxprotocol.vault.QueryMegavaultOwnerSharesResponse") + proto.RegisterType((*QueryMegavaultAllOwnerSharesRequest)(nil), "dydxprotocol.vault.QueryMegavaultAllOwnerSharesRequest") + proto.RegisterType((*QueryMegavaultAllOwnerSharesResponse)(nil), "dydxprotocol.vault.QueryMegavaultAllOwnerSharesResponse") proto.RegisterType((*QueryVaultParamsRequest)(nil), "dydxprotocol.vault.QueryVaultParamsRequest") proto.RegisterType((*QueryVaultParamsResponse)(nil), "dydxprotocol.vault.QueryVaultParamsResponse") proto.RegisterType((*QueryMegavaultWithdrawalInfoRequest)(nil), "dydxprotocol.vault.QueryMegavaultWithdrawalInfoRequest") @@ -766,76 +885,85 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/vault/query.proto", fileDescriptor_478fb8dc0ff21ea6) } var fileDescriptor_478fb8dc0ff21ea6 = []byte{ - // 1090 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xe6, 0x8f, 0x69, 0x9f, 0xdd, 0x3f, 0x0c, 0x69, 0x12, 0xdc, 0xe2, 0x34, 0x0b, 0xb4, - 0x24, 0x6d, 0x77, 0x95, 0xd0, 0xaa, 0x08, 0x21, 0xd4, 0x46, 0xa2, 0x34, 0x07, 0x68, 0xed, 0x44, - 0x20, 0x21, 0xc1, 0x32, 0xb6, 0x27, 0xce, 0x22, 0x7b, 0xc7, 0xde, 0x9d, 0x75, 0x62, 0xaa, 0x48, - 0x08, 0xc4, 0x81, 0x1b, 0x12, 0x57, 0x2e, 0xf0, 0x05, 0x38, 0x22, 0xce, 0x5c, 0x7a, 0xac, 0xc4, - 0x05, 0x71, 0xa8, 0x50, 0xc2, 0x37, 0xe0, 0x0b, 0xa0, 0x9d, 0x79, 0x5e, 0xef, 0xda, 0xbb, 0xce, - 0xb6, 0x32, 0x97, 0xc8, 0x99, 0x79, 0xef, 0xf7, 0x7e, 0xf3, 0xfe, 0xfc, 0xde, 0x42, 0xa9, 0xde, - 0xab, 0x1f, 0xb4, 0x5d, 0x2e, 0x78, 0x8d, 0x37, 0xcd, 0x2e, 0xf5, 0x9b, 0xc2, 0xec, 0xf8, 0xcc, - 0xed, 0x19, 0xf2, 0x90, 0x90, 0xe8, 0xbd, 0x21, 0xef, 0x8b, 0xf3, 0x0d, 0xde, 0xe0, 0xf2, 0xcc, - 0x0c, 0x7e, 0x29, 0xcb, 0xe2, 0xa5, 0x06, 0xe7, 0x8d, 0x26, 0x33, 0x69, 0xdb, 0x36, 0xa9, 0xe3, - 0x70, 0x41, 0x85, 0xcd, 0x1d, 0x0f, 0x6f, 0xd7, 0x6a, 0xdc, 0x6b, 0x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, 0xff, 0xff, 0x82, 0xa3, 0x58, 0x95, 0x18, 0x0f, - 0x00, 0x00, + // 1244 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xc6, 0x89, 0x4b, 0x5e, 0x92, 0xb6, 0x4c, 0xd3, 0x24, 0x75, 0x8b, 0xd3, 0x2c, 0xa5, + 0x25, 0x69, 0xe3, 0x25, 0xa1, 0xa5, 0x08, 0x10, 0x6a, 0x22, 0x51, 0x1a, 0x24, 0x68, 0xed, 0x84, + 0x22, 0x21, 0xc1, 0x32, 0xb6, 0x27, 0xce, 0x8a, 0xf5, 0x8e, 0xb3, 0x3b, 0x9b, 0xc4, 0x54, 0x91, + 0x10, 0x88, 0x03, 0x37, 0x24, 0xae, 0x5c, 0xe0, 0x23, 0x20, 0x24, 0x04, 0x12, 0x27, 0x38, 0xf4, + 0x58, 0xc1, 0x05, 0x71, 0xa8, 0x50, 0xc2, 0x07, 0x41, 0x3b, 0xf3, 0xd6, 0xde, 0x75, 0xd6, 0xce, + 0x36, 0x72, 0x2f, 0x91, 0x77, 0xe6, 0xbd, 0xdf, 0xef, 0xbd, 0x37, 0xef, 0x5f, 0x20, 0x5f, 0x6d, + 0x56, 0x77, 0x1b, 0x2e, 0x17, 0xbc, 0xc2, 0x6d, 0x63, 0x9b, 0xfa, 0xb6, 0x30, 0xb6, 0x7c, 0xe6, + 0x36, 0x0b, 0xf2, 0x90, 0x90, 0xe8, 0x7d, 0x41, 0xde, 0xe7, 0xce, 0x55, 0xb8, 0x57, 0xe7, 0x9e, + 0x29, 0x8f, 0x0d, 0xf5, 0xa1, 0xc4, 0x73, 0xf3, 0xea, 0xcb, 0x28, 0x53, 0x8f, 0x29, 0x1c, 0x63, + 0x7b, 0xb1, 0xcc, 0x04, 0x5d, 0x34, 0x1a, 0xb4, 0x66, 0x39, 0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x6e, 0xc2, 0x59, 0xf9, 0x74, 0xcb, 0xb6, 0x2d, + 0x25, 0xc3, 0xd2, 0x21, 0xb7, 0x01, 0xda, 0x4d, 0x02, 0xdf, 0xef, 0x72, 0x01, 0xfb, 0x4b, 0xd0, + 0x51, 0x0a, 0xaa, 0x33, 0x61, 0x47, 0x29, 0xdc, 0xa3, 0x35, 0x86, 0xba, 0xa5, 0x88, 0xa6, 0xfe, + 0xbd, 0x06, 0x93, 0x9d, 0x0c, 0x98, 0x20, 0x6f, 0x42, 0x56, 0x9a, 0x12, 0x54, 0x61, 0xe6, 0xf0, + 0xdb, 0x86, 0x95, 0xd3, 0x99, 0x58, 0x25, 0xd4, 0x22, 0x6f, 0xc7, 0x4c, 0x54, 0xf9, 0x71, 0xe5, + 0x48, 0x13, 0x11, 0x24, 0x6a, 0xa3, 0x0e, 0x17, 0x25, 0xcd, 0xbb, 0xac, 0x46, 0x25, 0xf6, 0x3a, + 0x17, 0xd4, 0x5e, 0x0b, 0xda, 0x4f, 0xab, 0x95, 0x30, 0x98, 0xed, 0x21, 0x83, 0x1e, 0xdd, 0x82, + 0x31, 0x11, 0x1c, 0x9b, 0xb2, 0x75, 0x85, 0xdd, 0x25, 0xb1, 0xb8, 0xde, 0xf3, 0xeb, 0xa8, 0x3c, + 0x2a, 0xda, 0x48, 0xfa, 0xfd, 0x4e, 0x53, 0xee, 0xee, 0x38, 0xcc, 0x8d, 0x99, 0x42, 0x96, 0xe0, + 0x04, 0xad, 0x56, 0x5d, 0xe6, 0x29, 0x82, 0x91, 0x95, 0xe9, 0x3f, 0x7f, 0x5a, 0x98, 0x40, 0xbf, + 0x97, 0xd5, 0xcd, 0x9a, 0x70, 0x2d, 0xa7, 0x56, 0x0a, 0x05, 0xf5, 0xdf, 0x32, 0x9d, 0xf6, 0xc7, + 0x80, 0xd1, 0xfe, 0x63, 0x20, 0x93, 0xd7, 0x21, 0x8b, 0xde, 0x0e, 0xa6, 0xf0, 0x16, 0x73, 0x10, + 0x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 0x91, 0x21, 0x92, 0xc6, + 0xf2, 0xc3, 0x33, 0x2e, 0x8d, 0xe5, 0x09, 0x93, 0x2a, 0xad, 0xe5, 0xd1, 0x69, 0x46, 0xfe, 0xd0, + 0x60, 0xaa, 0xcb, 0x04, 0x24, 0x37, 0x8f, 0x36, 0x23, 0x71, 0x46, 0xe7, 0x5e, 0x7d, 0x72, 0x45, + 0x74, 0xe1, 0x15, 0xe9, 0xc2, 0x4b, 0xa4, 0xd0, 0xdb, 0x05, 0x6a, 0xdb, 0x66, 0xcc, 0x8d, 0xef, + 0x34, 0x18, 0x8d, 0x0c, 0x0c, 0x72, 0xb5, 0x77, 0xb5, 0xc4, 0x0b, 0xfb, 0x5a, 0x3a, 0xe1, 0x34, + 0x51, 0x56, 0xd5, 0x7d, 0xa8, 0xc2, 0x7e, 0x8f, 0x46, 0x39, 0x3e, 0x2d, 0xd2, 0x44, 0x39, 0x71, + 0xb4, 0xa5, 0x89, 0x72, 0xf2, 0x60, 0xd2, 0x6f, 0x48, 0x17, 0x0c, 0xb2, 0xd0, 0x3b, 0xca, 0xad, + 0x25, 0xcd, 0x36, 0x2d, 0x67, 0x83, 0xaf, 0x14, 0x1f, 0xee, 0xe7, 0xb5, 0x47, 0xfb, 0x79, 0xed, + 0xdf, 0xfd, 0xbc, 0xf6, 0xcd, 0x41, 0x7e, 0xe0, 0xd1, 0x41, 0x7e, 0xe0, 0xef, 0x83, 0xfc, 0xc0, + 0x87, 0x37, 0xd3, 0x77, 0xfc, 0x5d, 0xa4, 0x91, 0x8d, 0xbf, 0x9c, 0x95, 0xe7, 0x2f, 0xff, 0x1f, + 0x00, 0x00, 0xff, 0xff, 0x2c, 0x32, 0x3f, 0x04, 0x18, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -860,6 +988,8 @@ type QueryClient interface { MegavaultTotalShares(ctx context.Context, in *QueryMegavaultTotalSharesRequest, opts ...grpc.CallOption) (*QueryMegavaultTotalSharesResponse, error) // Queries owner shares of megavault. MegavaultOwnerShares(ctx context.Context, in *QueryMegavaultOwnerSharesRequest, opts ...grpc.CallOption) (*QueryMegavaultOwnerSharesResponse, error) + // Queries all owner shares of megavault. + MegavaultAllOwnerShares(ctx context.Context, in *QueryMegavaultAllOwnerSharesRequest, opts ...grpc.CallOption) (*QueryMegavaultAllOwnerSharesResponse, error) // Queries vault params of a vault. VaultParams(ctx context.Context, in *QueryVaultParamsRequest, opts ...grpc.CallOption) (*QueryVaultParamsResponse, error) // Queries withdrawal info for megavault. @@ -919,6 +1049,15 @@ func (c *queryClient) MegavaultOwnerShares(ctx context.Context, in *QueryMegavau return out, nil } +func (c *queryClient) MegavaultAllOwnerShares(ctx context.Context, in *QueryMegavaultAllOwnerSharesRequest, opts ...grpc.CallOption) (*QueryMegavaultAllOwnerSharesResponse, error) { + out := new(QueryMegavaultAllOwnerSharesResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.vault.Query/MegavaultAllOwnerShares", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) VaultParams(ctx context.Context, in *QueryVaultParamsRequest, opts ...grpc.CallOption) (*QueryVaultParamsResponse, error) { out := new(QueryVaultParamsResponse) err := c.cc.Invoke(ctx, "/dydxprotocol.vault.Query/VaultParams", in, out, opts...) @@ -949,6 +1088,8 @@ type QueryServer interface { MegavaultTotalShares(context.Context, *QueryMegavaultTotalSharesRequest) (*QueryMegavaultTotalSharesResponse, error) // Queries owner shares of megavault. MegavaultOwnerShares(context.Context, *QueryMegavaultOwnerSharesRequest) (*QueryMegavaultOwnerSharesResponse, error) + // Queries all owner shares of megavault. + MegavaultAllOwnerShares(context.Context, *QueryMegavaultAllOwnerSharesRequest) (*QueryMegavaultAllOwnerSharesResponse, error) // Queries vault params of a vault. VaultParams(context.Context, *QueryVaultParamsRequest) (*QueryVaultParamsResponse, error) // Queries withdrawal info for megavault. @@ -974,6 +1115,9 @@ func (*UnimplementedQueryServer) MegavaultTotalShares(ctx context.Context, req * func (*UnimplementedQueryServer) MegavaultOwnerShares(ctx context.Context, req *QueryMegavaultOwnerSharesRequest) (*QueryMegavaultOwnerSharesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MegavaultOwnerShares not implemented") } +func (*UnimplementedQueryServer) MegavaultAllOwnerShares(ctx context.Context, req *QueryMegavaultAllOwnerSharesRequest) (*QueryMegavaultAllOwnerSharesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MegavaultAllOwnerShares not implemented") +} func (*UnimplementedQueryServer) VaultParams(ctx context.Context, req *QueryVaultParamsRequest) (*QueryVaultParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VaultParams not implemented") } @@ -1075,6 +1219,24 @@ func _Query_MegavaultOwnerShares_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } +func _Query_MegavaultAllOwnerShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryMegavaultAllOwnerSharesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MegavaultAllOwnerShares(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.vault.Query/MegavaultAllOwnerShares", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MegavaultAllOwnerShares(ctx, req.(*QueryMegavaultAllOwnerSharesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_VaultParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryVaultParamsRequest) if err := dec(in); err != nil { @@ -1135,6 +1297,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "MegavaultOwnerShares", Handler: _Query_MegavaultOwnerShares_Handler, }, + { + MethodName: "MegavaultAllOwnerShares", + Handler: _Query_MegavaultAllOwnerShares_Handler, + }, { MethodName: "VaultParams", Handler: _Query_VaultParams_Handler, @@ -1488,6 +1654,110 @@ func (m *QueryMegavaultOwnerSharesRequest) MarshalTo(dAtA []byte) (int, error) { } func (m *QueryMegavaultOwnerSharesRequest) 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMegavaultOwnerSharesResponse) 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 *QueryMegavaultOwnerSharesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMegavaultOwnerSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.WithdrawableEquity.Size() + i -= size + if _, err := m.WithdrawableEquity.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size := m.Equity.Size() + i -= size + if _, err := m.Equity.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.ShareUnlocks) > 0 { + for iNdEx := len(m.ShareUnlocks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ShareUnlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.Shares.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMegavaultAllOwnerSharesRequest) 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 *QueryMegavaultAllOwnerSharesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMegavaultAllOwnerSharesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1507,7 +1777,7 @@ func (m *QueryMegavaultOwnerSharesRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *QueryMegavaultOwnerSharesResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryMegavaultAllOwnerSharesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1517,12 +1787,12 @@ func (m *QueryMegavaultOwnerSharesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryMegavaultOwnerSharesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryMegavaultAllOwnerSharesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryMegavaultOwnerSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryMegavaultAllOwnerSharesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1852,6 +2122,44 @@ func (m *QueryMegavaultTotalSharesResponse) Size() (n int) { } func (m *QueryMegavaultOwnerSharesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryMegavaultOwnerSharesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = m.Shares.Size() + n += 1 + l + sovQuery(uint64(l)) + if len(m.ShareUnlocks) > 0 { + for _, e := range m.ShareUnlocks { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + l = m.Equity.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.WithdrawableEquity.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryMegavaultAllOwnerSharesRequest) Size() (n int) { if m == nil { return 0 } @@ -1864,7 +2172,7 @@ func (m *QueryMegavaultOwnerSharesRequest) Size() (n int) { return n } -func (m *QueryMegavaultOwnerSharesResponse) Size() (n int) { +func (m *QueryMegavaultAllOwnerSharesResponse) Size() (n int) { if m == nil { return 0 } @@ -2818,6 +3126,303 @@ func (m *QueryMegavaultOwnerSharesRequest) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: QueryMegavaultOwnerSharesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + 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 *QueryMegavaultOwnerSharesResponse) 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: QueryMegavaultOwnerSharesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMegavaultOwnerSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Shares.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShareUnlocks", 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.ShareUnlocks = append(m.ShareUnlocks, ShareUnlock{}) + if err := m.ShareUnlocks[len(m.ShareUnlocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Equity", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Equity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawableEquity", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.WithdrawableEquity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryMegavaultAllOwnerSharesRequest) 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: QueryMegavaultAllOwnerSharesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMegavaultAllOwnerSharesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) @@ -2875,7 +3480,7 @@ func (m *QueryMegavaultOwnerSharesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMegavaultOwnerSharesResponse) Unmarshal(dAtA []byte) error { +func (m *QueryMegavaultAllOwnerSharesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2898,10 +3503,10 @@ func (m *QueryMegavaultOwnerSharesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMegavaultOwnerSharesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryMegavaultAllOwnerSharesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMegavaultOwnerSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryMegavaultAllOwnerSharesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/protocol/x/vault/types/query.pb.gw.go b/protocol/x/vault/types/query.pb.gw.go index 87c4c5c0a88..c59b81459ba 100644 --- a/protocol/x/vault/types/query.pb.gw.go +++ b/protocol/x/vault/types/query.pb.gw.go @@ -223,6 +223,42 @@ func local_request_Query_MegavaultOwnerShares_0(ctx context.Context, marshaler r } +var ( + filter_Query_MegavaultAllOwnerShares_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_MegavaultAllOwnerShares_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMegavaultAllOwnerSharesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MegavaultAllOwnerShares_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MegavaultAllOwnerShares(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MegavaultAllOwnerShares_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryMegavaultAllOwnerSharesRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MegavaultAllOwnerShares_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MegavaultAllOwnerShares(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_VaultParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryVaultParamsRequest var metadata runtime.ServerMetadata @@ -462,6 +498,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_MegavaultAllOwnerShares_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_MegavaultAllOwnerShares_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_MegavaultAllOwnerShares_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_VaultParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -649,6 +708,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_MegavaultAllOwnerShares_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_MegavaultAllOwnerShares_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_MegavaultAllOwnerShares_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_VaultParams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -703,6 +782,8 @@ var ( pattern_Query_MegavaultOwnerShares_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "vault", "megavault", "owner_shares"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_MegavaultAllOwnerShares_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "vault", "megavault", "all_owner_shares"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_VaultParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"dydxprotocol", "vault", "params", "type", "number"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_MegavaultWithdrawalInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "vault", "megavault", "withdrawal_info"}, "", runtime.AssumeColonVerbOpt(false))) @@ -719,6 +800,8 @@ var ( forward_Query_MegavaultOwnerShares_0 = runtime.ForwardResponseMessage + forward_Query_MegavaultAllOwnerShares_0 = runtime.ForwardResponseMessage + forward_Query_VaultParams_0 = runtime.ForwardResponseMessage forward_Query_MegavaultWithdrawalInfo_0 = runtime.ForwardResponseMessage