Skip to content

Commit

Permalink
add grpc endpoint for markets hard cap setting
Browse files Browse the repository at this point in the history
Signed-off-by: Shrenuj Bansal <[email protected]>
  • Loading branch information
shrenujb committed Oct 15, 2024
1 parent a6a17f8 commit b1b66ec
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LCDClient } from "@osmonauts/lcd";
import { QueryListingVaultDepositParams, QueryListingVaultDepositParamsResponseSDKType } from "./query";
import { QueryMarketsHardCap, QueryMarketsHardCapResponseSDKType, QueryListingVaultDepositParams, QueryListingVaultDepositParamsResponseSDKType } from "./query";
export class LCDQueryClient {
req: LCDClient;

Expand All @@ -9,8 +9,16 @@ export class LCDQueryClient {
requestClient: LCDClient;
}) {
this.req = requestClient;
this.marketsHardCap = this.marketsHardCap.bind(this);
this.listingVaultDepositParams = this.listingVaultDepositParams.bind(this);
}
/* Queries for the hard cap number of listed markets */


async marketsHardCap(_params: QueryMarketsHardCap = {}): Promise<QueryMarketsHardCapResponseSDKType> {
const endpoint = `dydxprotocol/listing/markets_hard_cap`;
return await this.req.get<QueryMarketsHardCapResponseSDKType>(endpoint);
}
/* Queries the listing vault deposit params */


Expand Down
4 changes: 3 additions & 1 deletion proto/dydxprotocol/listing/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/listing/types";
// Query defines the gRPC querier service.
service Query {
// Queries for the hard cap number of listed markets
rpc MarketsHardCap(QueryMarketsHardCap) returns (QueryMarketsHardCapResponse);
rpc MarketsHardCap(QueryMarketsHardCap) returns (QueryMarketsHardCapResponse) {
option (google.api.http).get = "/dydxprotocol/listing/markets_hard_cap";
}

// Queries the listing vault deposit params
rpc ListingVaultDepositParams(QueryListingVaultDepositParams)
Expand Down
23 changes: 12 additions & 11 deletions protocol/x/listing/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions protocol/x/listing/types/query.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b1b66ec

Please sign in to comment.