diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts index cdf87659f1..bf75ee98d4 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryPerpetualRequest, QueryPerpetualResponseSDKType, QueryAllPerpetualsRequest, QueryAllPerpetualsResponseSDKType, QueryPremiumVotesRequest, QueryPremiumVotesResponseSDKType, QueryPremiumSamplesRequest, QueryPremiumSamplesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +import { QueryPerpetualRequest, QueryPerpetualResponseSDKType, QueryAllPerpetualsRequest, QueryAllPerpetualsResponseSDKType, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponseSDKType, QueryPremiumVotesRequest, QueryPremiumVotesResponseSDKType, QueryPremiumSamplesRequest, QueryPremiumSamplesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -12,6 +12,7 @@ export class LCDQueryClient { this.req = requestClient; this.perpetual = this.perpetual.bind(this); this.allPerpetuals = this.allPerpetuals.bind(this); + this.allLiquidityTiers = this.allLiquidityTiers.bind(this); this.premiumVotes = this.premiumVotes.bind(this); this.premiumSamples = this.premiumSamples.bind(this); this.params = this.params.bind(this); @@ -40,6 +41,23 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/perpetuals/perpetual`; return await this.req.get(endpoint, options); } + /* Queries a list of LiquidityTiers. */ + + + async allLiquidityTiers(params: QueryAllLiquidityTiersRequest = { + pagination: undefined + }): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + + const endpoint = `dydxprotocol/perpetuals/liquidity_tiers`; + return await this.req.get(endpoint, options); + } /* Queries a list of premium votes. */ diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts index 20442b17f5..afd777b2df 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/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 { QueryPerpetualRequest, QueryPerpetualResponse, QueryAllPerpetualsRequest, QueryAllPerpetualsResponse, QueryPremiumVotesRequest, QueryPremiumVotesResponse, QueryPremiumSamplesRequest, QueryPremiumSamplesResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +import { QueryPerpetualRequest, QueryPerpetualResponse, QueryAllPerpetualsRequest, QueryAllPerpetualsResponse, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponse, QueryPremiumVotesRequest, QueryPremiumVotesResponse, QueryPremiumSamplesRequest, QueryPremiumSamplesResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -10,6 +10,9 @@ export interface Query { /** Queries a list of Perpetual items. */ allPerpetuals(request?: QueryAllPerpetualsRequest): Promise; + /** Queries a list of LiquidityTiers. */ + + allLiquidityTiers(request?: QueryAllLiquidityTiersRequest): Promise; /** Queries a list of premium votes. */ premiumVotes(request?: QueryPremiumVotesRequest): Promise; @@ -27,6 +30,7 @@ export class QueryClientImpl implements Query { this.rpc = rpc; this.perpetual = this.perpetual.bind(this); this.allPerpetuals = this.allPerpetuals.bind(this); + this.allLiquidityTiers = this.allLiquidityTiers.bind(this); this.premiumVotes = this.premiumVotes.bind(this); this.premiumSamples = this.premiumSamples.bind(this); this.params = this.params.bind(this); @@ -46,6 +50,14 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryAllPerpetualsResponse.decode(new _m0.Reader(data))); } + allLiquidityTiers(request: QueryAllLiquidityTiersRequest = { + pagination: undefined + }): Promise { + const data = QueryAllLiquidityTiersRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "AllLiquidityTiers", data); + return promise.then(data => QueryAllLiquidityTiersResponse.decode(new _m0.Reader(data))); + } + premiumVotes(request: QueryPremiumVotesRequest = {}): Promise { const data = QueryPremiumVotesRequest.encode(request).finish(); const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "PremiumVotes", data); @@ -77,6 +89,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.allPerpetuals(request); }, + allLiquidityTiers(request?: QueryAllLiquidityTiersRequest): Promise { + return queryService.allLiquidityTiers(request); + }, + premiumVotes(request?: QueryPremiumVotesRequest): Promise { return queryService.premiumVotes(request); }, diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts index 90c3d42e35..4dda168b08 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts @@ -1,5 +1,5 @@ import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination"; -import { Perpetual, PerpetualSDKType, PremiumStore, PremiumStoreSDKType } from "./perpetual"; +import { Perpetual, PerpetualSDKType, LiquidityTier, LiquidityTierSDKType, PremiumStore, PremiumStoreSDKType } from "./perpetual"; import { Params, ParamsSDKType } from "./params"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial } from "../../helpers"; @@ -47,6 +47,34 @@ export interface QueryAllPerpetualsResponseSDKType { perpetual: PerpetualSDKType[]; pagination?: PageResponseSDKType; } +/** Queries a list of LiquidityTier items. */ + +export interface QueryAllLiquidityTiersRequest { + pagination?: PageRequest; +} +/** Queries a list of LiquidityTier items. */ + +export interface QueryAllLiquidityTiersRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC + * method. + */ + +export interface QueryAllLiquidityTiersResponse { + liquidityTiers: LiquidityTier[]; + pagination?: PageResponse; +} +/** + * QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC + * method. + */ + +export interface QueryAllLiquidityTiersResponseSDKType { + liquidity_tiers: LiquidityTierSDKType[]; + pagination?: PageResponseSDKType; +} /** QueryPremiumVotesRequest is the request type for the PremiumVotes RPC method. */ export interface QueryPremiumVotesRequest {} @@ -304,6 +332,106 @@ export const QueryAllPerpetualsResponse = { }; +function createBaseQueryAllLiquidityTiersRequest(): QueryAllLiquidityTiersRequest { + return { + pagination: undefined + }; +} + +export const QueryAllLiquidityTiersRequest = { + encode(message: QueryAllLiquidityTiersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllLiquidityTiersRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllLiquidityTiersRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryAllLiquidityTiersRequest { + const message = createBaseQueryAllLiquidityTiersRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + } + +}; + +function createBaseQueryAllLiquidityTiersResponse(): QueryAllLiquidityTiersResponse { + return { + liquidityTiers: [], + pagination: undefined + }; +} + +export const QueryAllLiquidityTiersResponse = { + encode(message: QueryAllLiquidityTiersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.liquidityTiers) { + LiquidityTier.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllLiquidityTiersResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllLiquidityTiersResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.liquidityTiers.push(LiquidityTier.decode(reader, reader.uint32())); + break; + + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryAllLiquidityTiersResponse { + const message = createBaseQueryAllLiquidityTiersResponse(); + message.liquidityTiers = object.liquidityTiers?.map(e => LiquidityTier.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + } + +}; + function createBaseQueryPremiumVotesRequest(): QueryPremiumVotesRequest { return {}; } diff --git a/proto/dydxprotocol/perpetuals/query.proto b/proto/dydxprotocol/perpetuals/query.proto index 106053019f..8433b112f8 100644 --- a/proto/dydxprotocol/perpetuals/query.proto +++ b/proto/dydxprotocol/perpetuals/query.proto @@ -22,6 +22,12 @@ service Query { option (google.api.http).get = "/dydxprotocol/perpetuals/perpetual"; } + // Queries a list of LiquidityTiers. + rpc AllLiquidityTiers(QueryAllLiquidityTiersRequest) + returns (QueryAllLiquidityTiersResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/liquidity_tiers"; + } + // Queries a list of premium votes. rpc PremiumVotes(QueryPremiumVotesRequest) returns (QueryPremiumVotesResponse) { @@ -59,6 +65,18 @@ message QueryAllPerpetualsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +// Queries a list of LiquidityTier items. +message QueryAllLiquidityTiersRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC +// method. +message QueryAllLiquidityTiersResponse { + repeated LiquidityTier liquidity_tiers = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // QueryPremiumVotesRequest is the request type for the PremiumVotes RPC method. message QueryPremiumVotesRequest {} diff --git a/protocol/x/perpetuals/keeper/grpc_query_liquidity_tiers.go b/protocol/x/perpetuals/keeper/grpc_query_liquidity_tiers.go new file mode 100644 index 0000000000..b69d4e11dc --- /dev/null +++ b/protocol/x/perpetuals/keeper/grpc_query_liquidity_tiers.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) AllLiquidityTiers( + c context.Context, + req *types.QueryAllLiquidityTiersRequest, +) (*types.QueryAllLiquidityTiersResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(c) + var liquidityTiers []types.LiquidityTier + + store := ctx.KVStore(k.storeKey) + liquidityTierStore := prefix.NewStore(store, []byte(types.LiquidityTierKeyPrefix)) + + pageRes, err := query.Paginate(liquidityTierStore, req.Pagination, func(key []byte, value []byte) error { + var liquidityTier types.LiquidityTier + if err := k.cdc.Unmarshal(value, &liquidityTier); err != nil { + return err + } + + liquidityTiers = append(liquidityTiers, liquidityTier) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllLiquidityTiersResponse{ + LiquidityTiers: liquidityTiers, + Pagination: pageRes, + }, nil +} diff --git a/protocol/x/perpetuals/keeper/grpc_query_liquidity_tiers_test.go b/protocol/x/perpetuals/keeper/grpc_query_liquidity_tiers_test.go new file mode 100644 index 0000000000..a594f605f8 --- /dev/null +++ b/protocol/x/perpetuals/keeper/grpc_query_liquidity_tiers_test.go @@ -0,0 +1,47 @@ +package keeper_test + +import ( + "testing" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/types/query" + testapp "github.com/dydxprotocol/v4-chain/protocol/testutil/app" + "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" + "github.com/stretchr/testify/require" +) + +func TestAllLiquidityTiers( + t *testing.T, +) { + tApp := testapp.NewTestAppBuilder(t). + WithGenesisDocFn(func() types.GenesisDoc { + genesis := testapp.DefaultGenesis() + testapp.UpdateGenesisDocWithAppStateForModule(&genesis, func(state *perptypes.GenesisState) { + state.LiquidityTiers = constants.LiquidityTiers + }) + return genesis + }).Build() + + tApp.InitChain() + + request := perptypes.QueryAllLiquidityTiersRequest{} + abciResponse := tApp.App.Query(abci.RequestQuery{ + Path: "/dydxprotocol.perpetuals.Query/AllLiquidityTiers", + Data: tApp.App.AppCodec().MustMarshal(&request), + }) + require.True(t, abciResponse.IsOK()) + + var actual perptypes.QueryAllLiquidityTiersResponse + tApp.App.AppCodec().MustUnmarshal(abciResponse.Value, &actual) + + expected := perptypes.QueryAllLiquidityTiersResponse{ + LiquidityTiers: constants.LiquidityTiers, + Pagination: &query.PageResponse{ + NextKey: nil, + Total: uint64(len(constants.LiquidityTiers)), + }, + } + require.Equal(t, expected, actual) +} diff --git a/protocol/x/perpetuals/types/query.pb.go b/protocol/x/perpetuals/types/query.pb.go index addba26693..b2e55e80e7 100644 --- a/protocol/x/perpetuals/types/query.pb.go +++ b/protocol/x/perpetuals/types/query.pb.go @@ -218,6 +218,105 @@ func (m *QueryAllPerpetualsResponse) GetPagination() *query.PageResponse { return nil } +// Queries a list of LiquidityTier items. +type QueryAllLiquidityTiersRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllLiquidityTiersRequest) Reset() { *m = QueryAllLiquidityTiersRequest{} } +func (m *QueryAllLiquidityTiersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllLiquidityTiersRequest) ProtoMessage() {} +func (*QueryAllLiquidityTiersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_13b6d29860ccef6b, []int{4} +} +func (m *QueryAllLiquidityTiersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllLiquidityTiersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllLiquidityTiersRequest.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 *QueryAllLiquidityTiersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllLiquidityTiersRequest.Merge(m, src) +} +func (m *QueryAllLiquidityTiersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllLiquidityTiersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllLiquidityTiersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllLiquidityTiersRequest proto.InternalMessageInfo + +func (m *QueryAllLiquidityTiersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllLiquidityTiersResponse is response type for the AllLiquidityTiers RPC +// method. +type QueryAllLiquidityTiersResponse struct { + LiquidityTiers []LiquidityTier `protobuf:"bytes,1,rep,name=liquidity_tiers,json=liquidityTiers,proto3" json:"liquidity_tiers"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllLiquidityTiersResponse) Reset() { *m = QueryAllLiquidityTiersResponse{} } +func (m *QueryAllLiquidityTiersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllLiquidityTiersResponse) ProtoMessage() {} +func (*QueryAllLiquidityTiersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_13b6d29860ccef6b, []int{5} +} +func (m *QueryAllLiquidityTiersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllLiquidityTiersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllLiquidityTiersResponse.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 *QueryAllLiquidityTiersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllLiquidityTiersResponse.Merge(m, src) +} +func (m *QueryAllLiquidityTiersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllLiquidityTiersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllLiquidityTiersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllLiquidityTiersResponse proto.InternalMessageInfo + +func (m *QueryAllLiquidityTiersResponse) GetLiquidityTiers() []LiquidityTier { + if m != nil { + return m.LiquidityTiers + } + return nil +} + +func (m *QueryAllLiquidityTiersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + // QueryPremiumVotesRequest is the request type for the PremiumVotes RPC method. type QueryPremiumVotesRequest struct { } @@ -226,7 +325,7 @@ func (m *QueryPremiumVotesRequest) Reset() { *m = QueryPremiumVotesReque func (m *QueryPremiumVotesRequest) String() string { return proto.CompactTextString(m) } func (*QueryPremiumVotesRequest) ProtoMessage() {} func (*QueryPremiumVotesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13b6d29860ccef6b, []int{4} + return fileDescriptor_13b6d29860ccef6b, []int{6} } func (m *QueryPremiumVotesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -265,7 +364,7 @@ func (m *QueryPremiumVotesResponse) Reset() { *m = QueryPremiumVotesResp func (m *QueryPremiumVotesResponse) String() string { return proto.CompactTextString(m) } func (*QueryPremiumVotesResponse) ProtoMessage() {} func (*QueryPremiumVotesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_13b6d29860ccef6b, []int{5} + return fileDescriptor_13b6d29860ccef6b, []int{7} } func (m *QueryPremiumVotesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,7 +409,7 @@ func (m *QueryPremiumSamplesRequest) Reset() { *m = QueryPremiumSamplesR func (m *QueryPremiumSamplesRequest) String() string { return proto.CompactTextString(m) } func (*QueryPremiumSamplesRequest) ProtoMessage() {} func (*QueryPremiumSamplesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13b6d29860ccef6b, []int{6} + return fileDescriptor_13b6d29860ccef6b, []int{8} } func (m *QueryPremiumSamplesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,7 +448,7 @@ func (m *QueryPremiumSamplesResponse) Reset() { *m = QueryPremiumSamples func (m *QueryPremiumSamplesResponse) String() string { return proto.CompactTextString(m) } func (*QueryPremiumSamplesResponse) ProtoMessage() {} func (*QueryPremiumSamplesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_13b6d29860ccef6b, []int{7} + return fileDescriptor_13b6d29860ccef6b, []int{9} } func (m *QueryPremiumSamplesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -393,7 +492,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_13b6d29860ccef6b, []int{8} + return fileDescriptor_13b6d29860ccef6b, []int{10} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -431,7 +530,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_13b6d29860ccef6b, []int{9} + return fileDescriptor_13b6d29860ccef6b, []int{11} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -472,6 +571,8 @@ func init() { proto.RegisterType((*QueryPerpetualResponse)(nil), "dydxprotocol.perpetuals.QueryPerpetualResponse") proto.RegisterType((*QueryAllPerpetualsRequest)(nil), "dydxprotocol.perpetuals.QueryAllPerpetualsRequest") proto.RegisterType((*QueryAllPerpetualsResponse)(nil), "dydxprotocol.perpetuals.QueryAllPerpetualsResponse") + proto.RegisterType((*QueryAllLiquidityTiersRequest)(nil), "dydxprotocol.perpetuals.QueryAllLiquidityTiersRequest") + proto.RegisterType((*QueryAllLiquidityTiersResponse)(nil), "dydxprotocol.perpetuals.QueryAllLiquidityTiersResponse") proto.RegisterType((*QueryPremiumVotesRequest)(nil), "dydxprotocol.perpetuals.QueryPremiumVotesRequest") proto.RegisterType((*QueryPremiumVotesResponse)(nil), "dydxprotocol.perpetuals.QueryPremiumVotesResponse") proto.RegisterType((*QueryPremiumSamplesRequest)(nil), "dydxprotocol.perpetuals.QueryPremiumSamplesRequest") @@ -485,47 +586,52 @@ func init() { } var fileDescriptor_13b6d29860ccef6b = []byte{ - // 634 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0xb1, 0x6f, 0xd3, 0x40, - 0x14, 0xc6, 0xe3, 0x00, 0x91, 0x7a, 0x34, 0x41, 0x3a, 0x0a, 0x14, 0x53, 0x39, 0x60, 0x4a, 0x13, - 0x02, 0xf8, 0x48, 0xd2, 0x11, 0x06, 0x3a, 0x94, 0x35, 0x84, 0xaa, 0x03, 0x0b, 0x5c, 0x92, 0x93, - 0x6b, 0xc9, 0xf6, 0x5d, 0x7d, 0x4e, 0xd4, 0x08, 0xb1, 0x30, 0x33, 0x20, 0x31, 0xb3, 0xc1, 0xd8, - 0x91, 0xff, 0xa1, 0x63, 0x25, 0x16, 0x26, 0x84, 0x12, 0xfe, 0x10, 0x94, 0xbb, 0x73, 0x62, 0xd3, - 0xb8, 0x4e, 0xba, 0x45, 0xf7, 0xbe, 0xf7, 0xbe, 0xdf, 0x7d, 0xbe, 0xa7, 0x80, 0xfb, 0xbd, 0x61, - 0xef, 0x88, 0x05, 0x34, 0xa4, 0x5d, 0xea, 0x22, 0x46, 0x02, 0x46, 0xc2, 0x3e, 0x76, 0x39, 0x3a, - 0xec, 0x93, 0x60, 0x68, 0x89, 0x0a, 0xbc, 0x15, 0x17, 0x59, 0x33, 0x91, 0xbe, 0x66, 0x53, 0x9b, - 0x8a, 0x02, 0x9a, 0xfc, 0x92, 0x72, 0x7d, 0xc3, 0xa6, 0xd4, 0x76, 0x09, 0xc2, 0xcc, 0x41, 0xd8, - 0xf7, 0x69, 0x88, 0x43, 0x87, 0xfa, 0x5c, 0x55, 0x6b, 0x5d, 0xca, 0x3d, 0xca, 0x51, 0x07, 0x73, - 0x22, 0x5d, 0xd0, 0xa0, 0xde, 0x21, 0x21, 0xae, 0x23, 0x86, 0x6d, 0xc7, 0x17, 0x62, 0xa5, 0xdd, - 0x4c, 0xa3, 0x63, 0x38, 0xc0, 0x5e, 0x34, 0xb1, 0x92, 0xaa, 0x8a, 0x7e, 0x4a, 0xa1, 0x59, 0x01, - 0x37, 0x5e, 0x4d, 0x0c, 0x5b, 0xd1, 0x79, 0x9b, 0x1c, 0xf6, 0x09, 0x0f, 0x61, 0x09, 0xe4, 0x9d, - 0xde, 0xba, 0x76, 0x57, 0xab, 0x16, 0xdb, 0x79, 0xa7, 0x67, 0xbe, 0x03, 0x37, 0xff, 0x17, 0x72, - 0x46, 0x7d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xdb, 0x09, - 0x0f, 0xfa, 0x1d, 0xab, 0x4b, 0xbd, 0xe4, 0x90, 0xc1, 0xf6, 0x93, 0xee, 0x01, 0x76, 0x7c, 0x34, - 0x3d, 0x39, 0x8a, 0x0f, 0x0e, 0x87, 0x8c, 0xf0, 0x4e, 0x41, 0x14, 0x9b, 0xff, 0x02, 0x00, 0x00, - 0xff, 0xff, 0xe6, 0x1c, 0x39, 0xe0, 0xaf, 0x07, 0x00, 0x00, + // 716 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xbf, 0x53, 0x13, 0x41, + 0x14, 0xc7, 0xb3, 0x51, 0x71, 0x78, 0x42, 0x18, 0x57, 0x54, 0x3c, 0xf1, 0xd0, 0x13, 0x09, 0xa2, + 0xde, 0x4a, 0x60, 0xb4, 0xd1, 0x42, 0x0a, 0x6c, 0x2c, 0x30, 0x22, 0x85, 0x0d, 0x5e, 0x92, 0x9d, + 0x63, 0x67, 0xee, 0xb2, 0xc7, 0xdd, 0x86, 0x21, 0xe3, 0xd8, 0x58, 0x5b, 0x38, 0x63, 0x6d, 0xa7, + 0x25, 0xad, 0xb5, 0x25, 0x25, 0x33, 0x36, 0x56, 0x8e, 0x03, 0xd6, 0xfe, 0x0d, 0x4e, 0x76, 0xf7, + 0x92, 0x3b, 0xc8, 0x91, 0x84, 0xa1, 0xcb, 0xec, 0xfb, 0xf1, 0xfd, 0xec, 0xf7, 0xf6, 0xbd, 0x09, + 0xdc, 0xae, 0x35, 0x6b, 0xdb, 0x41, 0xc8, 0x05, 0xaf, 0x72, 0x8f, 0x04, 0x34, 0x0c, 0xa8, 0x68, + 0x38, 0x5e, 0x44, 0x36, 0x1b, 0x34, 0x6c, 0xda, 0x32, 0x82, 0xaf, 0x26, 0x93, 0xec, 0x4e, 0x92, + 0x31, 0xee, 0x72, 0x97, 0xcb, 0x00, 0x69, 0xfd, 0x52, 0xe9,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8b, 0x0f, 0xaa, 0x1b, 0x0e, 0xab, + 0x93, 0xf6, 0xc9, 0x76, 0xb2, 0xb1, 0x68, 0x06, 0x34, 0xaa, 0x0c, 0xc9, 0xe0, 0xc2, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xd7, 0x45, 0x0d, 0x89, 0x94, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -544,6 +650,8 @@ type QueryClient interface { Perpetual(ctx context.Context, in *QueryPerpetualRequest, opts ...grpc.CallOption) (*QueryPerpetualResponse, error) // Queries a list of Perpetual items. AllPerpetuals(ctx context.Context, in *QueryAllPerpetualsRequest, opts ...grpc.CallOption) (*QueryAllPerpetualsResponse, error) + // Queries a list of LiquidityTiers. + AllLiquidityTiers(ctx context.Context, in *QueryAllLiquidityTiersRequest, opts ...grpc.CallOption) (*QueryAllLiquidityTiersResponse, error) // Queries a list of premium votes. PremiumVotes(ctx context.Context, in *QueryPremiumVotesRequest, opts ...grpc.CallOption) (*QueryPremiumVotesResponse, error) // Queries a list of premium samples. @@ -578,6 +686,15 @@ func (c *queryClient) AllPerpetuals(ctx context.Context, in *QueryAllPerpetualsR return out, nil } +func (c *queryClient) AllLiquidityTiers(ctx context.Context, in *QueryAllLiquidityTiersRequest, opts ...grpc.CallOption) (*QueryAllLiquidityTiersResponse, error) { + out := new(QueryAllLiquidityTiersResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.perpetuals.Query/AllLiquidityTiers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) PremiumVotes(ctx context.Context, in *QueryPremiumVotesRequest, opts ...grpc.CallOption) (*QueryPremiumVotesResponse, error) { out := new(QueryPremiumVotesResponse) err := c.cc.Invoke(ctx, "/dydxprotocol.perpetuals.Query/PremiumVotes", in, out, opts...) @@ -611,6 +728,8 @@ type QueryServer interface { Perpetual(context.Context, *QueryPerpetualRequest) (*QueryPerpetualResponse, error) // Queries a list of Perpetual items. AllPerpetuals(context.Context, *QueryAllPerpetualsRequest) (*QueryAllPerpetualsResponse, error) + // Queries a list of LiquidityTiers. + AllLiquidityTiers(context.Context, *QueryAllLiquidityTiersRequest) (*QueryAllLiquidityTiersResponse, error) // Queries a list of premium votes. PremiumVotes(context.Context, *QueryPremiumVotesRequest) (*QueryPremiumVotesResponse, error) // Queries a list of premium samples. @@ -629,6 +748,9 @@ func (*UnimplementedQueryServer) Perpetual(ctx context.Context, req *QueryPerpet func (*UnimplementedQueryServer) AllPerpetuals(ctx context.Context, req *QueryAllPerpetualsRequest) (*QueryAllPerpetualsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllPerpetuals not implemented") } +func (*UnimplementedQueryServer) AllLiquidityTiers(ctx context.Context, req *QueryAllLiquidityTiersRequest) (*QueryAllLiquidityTiersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllLiquidityTiers not implemented") +} func (*UnimplementedQueryServer) PremiumVotes(ctx context.Context, req *QueryPremiumVotesRequest) (*QueryPremiumVotesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PremiumVotes not implemented") } @@ -679,6 +801,24 @@ func _Query_AllPerpetuals_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_AllLiquidityTiers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllLiquidityTiersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllLiquidityTiers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.perpetuals.Query/AllLiquidityTiers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllLiquidityTiers(ctx, req.(*QueryAllLiquidityTiersRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_PremiumVotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryPremiumVotesRequest) if err := dec(in); err != nil { @@ -745,6 +885,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AllPerpetuals", Handler: _Query_AllPerpetuals_Handler, }, + { + MethodName: "AllLiquidityTiers", + Handler: _Query_AllLiquidityTiers_Handler, + }, { MethodName: "PremiumVotes", Handler: _Query_PremiumVotes_Handler, @@ -907,6 +1051,90 @@ func (m *QueryAllPerpetualsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *QueryAllLiquidityTiersRequest) 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 *QueryAllLiquidityTiersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllLiquidityTiersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllLiquidityTiersResponse) 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 *QueryAllLiquidityTiersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllLiquidityTiersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.LiquidityTiers) > 0 { + for iNdEx := len(m.LiquidityTiers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LiquidityTiers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryPremiumVotesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1141,6 +1369,38 @@ func (m *QueryAllPerpetualsResponse) Size() (n int) { return n } +func (m *QueryAllLiquidityTiersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllLiquidityTiersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LiquidityTiers) > 0 { + for _, e := range m.LiquidityTiers { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryPremiumVotesRequest) Size() (n int) { if m == nil { return 0 @@ -1565,6 +1825,212 @@ func (m *QueryAllPerpetualsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAllLiquidityTiersRequest) 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: QueryAllLiquidityTiersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllLiquidityTiersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllLiquidityTiersResponse) 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: QueryAllLiquidityTiersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllLiquidityTiersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidityTiers", 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.LiquidityTiers = append(m.LiquidityTiers, LiquidityTier{}) + if err := m.LiquidityTiers[len(m.LiquidityTiers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryPremiumVotesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/perpetuals/types/query.pb.gw.go b/protocol/x/perpetuals/types/query.pb.gw.go index 7be63a13f2..21cbd1bbde 100644 --- a/protocol/x/perpetuals/types/query.pb.gw.go +++ b/protocol/x/perpetuals/types/query.pb.gw.go @@ -123,6 +123,42 @@ func local_request_Query_AllPerpetuals_0(ctx context.Context, marshaler runtime. } +var ( + filter_Query_AllLiquidityTiers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllLiquidityTiers_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllLiquidityTiersRequest + 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_AllLiquidityTiers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllLiquidityTiers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllLiquidityTiers_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllLiquidityTiersRequest + 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_AllLiquidityTiers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllLiquidityTiers(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_PremiumVotes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryPremiumVotesRequest var metadata runtime.ServerMetadata @@ -229,6 +265,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AllLiquidityTiers_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_AllLiquidityTiers_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_AllLiquidityTiers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_PremiumVotes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -379,6 +438,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AllLiquidityTiers_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_AllLiquidityTiers_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_AllLiquidityTiers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_PremiumVotes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -447,6 +526,8 @@ var ( pattern_Query_AllPerpetuals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "perpetual"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AllLiquidityTiers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "liquidity_tiers"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_PremiumVotes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "premium_votes"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PremiumSamples_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "premium_samples"}, "", runtime.AssumeColonVerbOpt(false))) @@ -459,6 +540,8 @@ var ( forward_Query_AllPerpetuals_0 = runtime.ForwardResponseMessage + forward_Query_AllLiquidityTiers_0 = runtime.ForwardResponseMessage + forward_Query_PremiumVotes_0 = runtime.ForwardResponseMessage forward_Query_PremiumSamples_0 = runtime.ForwardResponseMessage