Skip to content

Commit

Permalink
Merge branch 'main' into tra414
Browse files Browse the repository at this point in the history
  • Loading branch information
shrenujb committed Jun 18, 2024
2 parents 05c335b + 16041e3 commit bec9f2b
Show file tree
Hide file tree
Showing 48 changed files with 1,668 additions and 336 deletions.
48 changes: 25 additions & 23 deletions indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,18 @@ import * as _154 from "./clob/tx.rpc.msg";
import * as _155 from "./delaymsg/tx.rpc.msg";
import * as _156 from "./feetiers/tx.rpc.msg";
import * as _157 from "./govplus/tx.rpc.msg";
import * as _158 from "./perpetuals/tx.rpc.msg";
import * as _159 from "./prices/tx.rpc.msg";
import * as _160 from "./ratelimit/tx.rpc.msg";
import * as _161 from "./rewards/tx.rpc.msg";
import * as _162 from "./sending/tx.rpc.msg";
import * as _163 from "./stats/tx.rpc.msg";
import * as _164 from "./vault/tx.rpc.msg";
import * as _165 from "./vest/tx.rpc.msg";
import * as _166 from "./lcd";
import * as _167 from "./rpc.query";
import * as _168 from "./rpc.tx";
import * as _158 from "./listing/tx.rpc.msg";
import * as _159 from "./perpetuals/tx.rpc.msg";
import * as _160 from "./prices/tx.rpc.msg";
import * as _161 from "./ratelimit/tx.rpc.msg";
import * as _162 from "./rewards/tx.rpc.msg";
import * as _163 from "./sending/tx.rpc.msg";
import * as _164 from "./stats/tx.rpc.msg";
import * as _165 from "./vault/tx.rpc.msg";
import * as _166 from "./vest/tx.rpc.msg";
import * as _167 from "./lcd";
import * as _168 from "./rpc.query";
import * as _169 from "./rpc.tx";
export namespace dydxprotocol {
export const assets = { ..._5,
..._6,
Expand Down Expand Up @@ -260,7 +261,8 @@ export namespace dydxprotocol {
export const listing = { ..._61,
..._62,
..._63,
..._141
..._141,
..._158
};
export const perpetuals = { ..._64,
..._65,
Expand All @@ -269,7 +271,7 @@ export namespace dydxprotocol {
..._68,
..._125,
..._142,
..._158
..._159
};
export const prices = { ..._69,
..._70,
Expand All @@ -278,7 +280,7 @@ export namespace dydxprotocol {
..._73,
..._126,
..._143,
..._159
..._160
};
export const ratelimit = { ..._74,
..._75,
Expand All @@ -288,7 +290,7 @@ export namespace dydxprotocol {
..._79,
..._127,
..._144,
..._160
..._161
};
export const revshare = { ..._80,
..._81,
Expand All @@ -302,14 +304,14 @@ export namespace dydxprotocol {
..._87,
..._128,
..._146,
..._161
..._162
};
export const sending = { ..._88,
..._89,
..._90,
..._91,
..._147,
..._162
..._163
};
export const stats = { ..._92,
..._93,
Expand All @@ -318,7 +320,7 @@ export namespace dydxprotocol {
..._96,
..._129,
..._148,
..._163
..._164
};
export const subaccounts = { ..._97,
..._98,
Expand All @@ -335,18 +337,18 @@ export namespace dydxprotocol {
..._106,
..._131,
..._150,
..._164
..._165
};
export const vest = { ..._107,
..._108,
..._109,
..._110,
..._132,
..._151,
..._165
..._166
};
export const ClientFactory = { ..._166,
..._167,
..._168
export const ClientFactory = { ..._167,
..._168,
..._169
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,35 @@ import * as _m0 from "protobufjs/minimal";
import { DeepPartial } from "../../helpers";
/** GenesisState defines `x/listing`'s genesis state. */

export interface GenesisState {}
export interface GenesisState {
/**
* hard_cap_for_markets is the hard cap for the number of markets that can be
* listed
*/
hardCapForMarkets: number;
}
/** GenesisState defines `x/listing`'s genesis state. */

export interface GenesisStateSDKType {}
export interface GenesisStateSDKType {
/**
* hard_cap_for_markets is the hard cap for the number of markets that can be
* listed
*/
hard_cap_for_markets: number;
}

function createBaseGenesisState(): GenesisState {
return {};
return {
hardCapForMarkets: 0
};
}

export const GenesisState = {
encode(_: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.hardCapForMarkets !== 0) {
writer.uint32(8).uint32(message.hardCapForMarkets);
}

return writer;
},

Expand All @@ -25,6 +43,10 @@ export const GenesisState = {
const tag = reader.uint32();

switch (tag >>> 3) {
case 1:
message.hardCapForMarkets = reader.uint32();
break;

default:
reader.skipType(tag & 7);
break;
Expand All @@ -34,8 +56,9 @@ export const GenesisState = {
return message;
},

fromPartial(_: DeepPartial<GenesisState>): GenesisState {
fromPartial(object: DeepPartial<GenesisState>): GenesisState {
const message = createBaseGenesisState();
message.hardCapForMarkets = object.hardCapForMarkets ?? 0;
return message;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
import { Rpc } from "../../helpers";
import * as _m0 from "protobufjs/minimal";
import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryMarketsHardCap, QueryMarketsHardCapResponse } from "./query";
/** Query defines the gRPC querier service. */

export interface Query {}
export interface Query {
/** Queries for the hard cap number of listed markets */
marketsHardCap(request?: QueryMarketsHardCap): Promise<QueryMarketsHardCapResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;

constructor(rpc: Rpc) {
this.rpc = rpc;
this.marketsHardCap = this.marketsHardCap.bind(this);
}

marketsHardCap(request: QueryMarketsHardCap = {}): Promise<QueryMarketsHardCapResponse> {
const data = QueryMarketsHardCap.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.listing.Query", "MarketsHardCap", data);
return promise.then(data => QueryMarketsHardCapResponse.decode(new _m0.Reader(data)));
}

}
export const createRpcQueryExtension = (base: QueryClient) => {
const rpc = createProtobufRpcClient(base);
const queryService = new QueryClientImpl(rpc);
return {};
return {
marketsHardCap(request?: QueryMarketsHardCap): Promise<QueryMarketsHardCapResponse> {
return queryService.marketsHardCap(request);
}

};
};
Original file line number Diff line number Diff line change
@@ -1 +1,99 @@
export {}
import * as _m0 from "protobufjs/minimal";
import { DeepPartial } from "../../helpers";
/** Queries for the hard cap on listed markets */

export interface QueryMarketsHardCap {}
/** Queries for the hard cap on listed markets */

export interface QueryMarketsHardCapSDKType {}
/** Response type indicating the hard cap on listed markets */

export interface QueryMarketsHardCapResponse {
/** Response type indicating the hard cap on listed markets */
hardCap: number;
}
/** Response type indicating the hard cap on listed markets */

export interface QueryMarketsHardCapResponseSDKType {
/** Response type indicating the hard cap on listed markets */
hard_cap: number;
}

function createBaseQueryMarketsHardCap(): QueryMarketsHardCap {
return {};
}

export const QueryMarketsHardCap = {
encode(_: QueryMarketsHardCap, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): QueryMarketsHardCap {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryMarketsHardCap();

while (reader.pos < end) {
const tag = reader.uint32();

switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}

return message;
},

fromPartial(_: DeepPartial<QueryMarketsHardCap>): QueryMarketsHardCap {
const message = createBaseQueryMarketsHardCap();
return message;
}

};

function createBaseQueryMarketsHardCapResponse(): QueryMarketsHardCapResponse {
return {
hardCap: 0
};
}

export const QueryMarketsHardCapResponse = {
encode(message: QueryMarketsHardCapResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.hardCap !== 0) {
writer.uint32(8).uint32(message.hardCap);
}

return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): QueryMarketsHardCapResponse {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryMarketsHardCapResponse();

while (reader.pos < end) {
const tag = reader.uint32();

switch (tag >>> 3) {
case 1:
message.hardCap = reader.uint32();
break;

default:
reader.skipType(tag & 7);
break;
}
}

return message;
},

fromPartial(object: DeepPartial<QueryMarketsHardCapResponse>): QueryMarketsHardCapResponse {
const message = createBaseQueryMarketsHardCapResponse();
message.hardCap = object.hardCap ?? 0;
return message;
}

};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Rpc } from "../../helpers";
import * as _m0 from "protobufjs/minimal";
import { MsgSetMarketsHardCap, MsgSetMarketsHardCapResponse } from "./tx";
/** Msg defines the Msg service. */

export interface Msg {
/** SetMarketsHardCap sets a hard cap on the number of markets listed */
setMarketsHardCap(request: MsgSetMarketsHardCap): Promise<MsgSetMarketsHardCapResponse>;
}
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;

constructor(rpc: Rpc) {
this.rpc = rpc;
this.setMarketsHardCap = this.setMarketsHardCap.bind(this);
}

setMarketsHardCap(request: MsgSetMarketsHardCap): Promise<MsgSetMarketsHardCapResponse> {
const data = MsgSetMarketsHardCap.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.listing.Msg", "SetMarketsHardCap", data);
return promise.then(data => MsgSetMarketsHardCapResponse.decode(new _m0.Reader(data)));
}

}
Loading

0 comments on commit bec9f2b

Please sign in to comment.