-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
1,668 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 19 additions & 2 deletions
21
indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/query.rpc.Query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
}; | ||
}; |
100 changes: 99 additions & 1 deletion
100
indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
}; |
24 changes: 24 additions & 0 deletions
24
indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/tx.rpc.msg.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); | ||
} | ||
|
||
} |
Oops, something went wrong.