From 8b0ff0b8b39e984f581877cb18953c1385efb2f3 Mon Sep 17 00:00:00 2001 From: Will Liu Date: Tue, 12 Dec 2023 13:55:52 -0500 Subject: [PATCH 1/2] bump --- indexer/packages/v4-protos/package.json | 8 +- .../src/codegen/dydxprotocol/bundle.ts | 102 +++--- .../codegen/dydxprotocol/clob/liquidations.ts | 87 ----- .../dydxprotocol/ibcratelimit/capacity.ts | 89 +++++ .../dydxprotocol/ibcratelimit/genesis.ts | 60 ++++ .../dydxprotocol/ibcratelimit/limit_params.ts | 198 ++++++++++++ .../dydxprotocol/ibcratelimit/query.lcd.ts | 38 +++ .../ibcratelimit/query.rpc.Query.ts | 49 +++ .../dydxprotocol/ibcratelimit/query.ts | 305 ++++++++++++++++++ .../dydxprotocol/ibcratelimit/tx.rpc.msg.ts | 34 ++ .../codegen/dydxprotocol/ibcratelimit/tx.ts | 225 +++++++++++++ .../dydxprotocol/indexer/events/events.ts | 8 - .../v4-protos/src/codegen/dydxprotocol/lcd.ts | 6 +- .../dydxprotocol/perpetuals/perpetual.ts | 8 - .../src/codegen/dydxprotocol/rpc.query.ts | 2 +- .../src/codegen/dydxprotocol/rpc.tx.ts | 2 +- indexer/pnpm-lock.yaml | 160 +++++---- 17 files changed, 1136 insertions(+), 245 deletions(-) create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts diff --git a/indexer/packages/v4-protos/package.json b/indexer/packages/v4-protos/package.json index b67cea8e61..9a91a5fb6f 100644 --- a/indexer/packages/v4-protos/package.json +++ b/indexer/packages/v4-protos/package.json @@ -32,10 +32,10 @@ "homepage": "https://github.com/dydxprotocol/indexer#readme", "dependencies": { "@bufbuild/buf": "1.19.0-1", - "@cosmjs/amino": "^0.29.3", - "@cosmjs/proto-signing": "^0.29.3", - "@cosmjs/stargate": "^0.29.3", - "@cosmjs/tendermint-rpc": "^0.29.3", + "@cosmjs/amino": "^0.32.1", + "@cosmjs/proto-signing": "^0.32.1", + "@cosmjs/stargate": "^0.32.1", + "@cosmjs/tendermint-rpc": "^0.32.1", "@osmonauts/lcd": "^0.6.0", "bech32": "^2.0.0", "dotenv-flow": "^3.2.0", diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts index 680ae1ba54..d2548c5d77 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts @@ -42,29 +42,29 @@ import * as _45 from "./feetiers/genesis"; import * as _46 from "./feetiers/params"; import * as _47 from "./feetiers/query"; import * as _48 from "./feetiers/tx"; -import * as _49 from "./indexer/events/events"; -import * as _50 from "./indexer/indexer_manager/event"; -import * as _51 from "./indexer/off_chain_updates/off_chain_updates"; -import * as _52 from "./indexer/protocol/v1/clob"; -import * as _53 from "./indexer/protocol/v1/subaccount"; -import * as _54 from "./indexer/redis/redis_order"; -import * as _55 from "./indexer/shared/removal_reason"; -import * as _56 from "./indexer/socks/messages"; -import * as _57 from "./perpetuals/genesis"; -import * as _58 from "./perpetuals/params"; -import * as _59 from "./perpetuals/perpetual"; -import * as _60 from "./perpetuals/query"; -import * as _61 from "./perpetuals/tx"; -import * as _62 from "./prices/genesis"; -import * as _63 from "./prices/market_param"; -import * as _64 from "./prices/market_price"; -import * as _65 from "./prices/query"; -import * as _66 from "./prices/tx"; -import * as _67 from "./ratelimit/capacity"; -import * as _68 from "./ratelimit/genesis"; -import * as _69 from "./ratelimit/limit_params"; -import * as _70 from "./ratelimit/query"; -import * as _71 from "./ratelimit/tx"; +import * as _49 from "./ibcratelimit/capacity"; +import * as _50 from "./ibcratelimit/genesis"; +import * as _51 from "./ibcratelimit/limit_params"; +import * as _52 from "./ibcratelimit/query"; +import * as _53 from "./ibcratelimit/tx"; +import * as _54 from "./indexer/events/events"; +import * as _55 from "./indexer/indexer_manager/event"; +import * as _56 from "./indexer/off_chain_updates/off_chain_updates"; +import * as _57 from "./indexer/protocol/v1/clob"; +import * as _58 from "./indexer/protocol/v1/subaccount"; +import * as _59 from "./indexer/redis/redis_order"; +import * as _60 from "./indexer/shared/removal_reason"; +import * as _61 from "./indexer/socks/messages"; +import * as _62 from "./perpetuals/genesis"; +import * as _63 from "./perpetuals/params"; +import * as _64 from "./perpetuals/perpetual"; +import * as _65 from "./perpetuals/query"; +import * as _66 from "./perpetuals/tx"; +import * as _67 from "./prices/genesis"; +import * as _68 from "./prices/market_param"; +import * as _69 from "./prices/market_price"; +import * as _70 from "./prices/query"; +import * as _71 from "./prices/tx"; import * as _72 from "./rewards/genesis"; import * as _73 from "./rewards/params"; import * as _74 from "./rewards/query"; @@ -95,9 +95,9 @@ import * as _105 from "./clob/query.lcd"; import * as _106 from "./delaymsg/query.lcd"; import * as _107 from "./epochs/query.lcd"; import * as _108 from "./feetiers/query.lcd"; -import * as _109 from "./perpetuals/query.lcd"; -import * as _110 from "./prices/query.lcd"; -import * as _111 from "./ratelimit/query.lcd"; +import * as _109 from "./ibcratelimit/query.lcd"; +import * as _110 from "./perpetuals/query.lcd"; +import * as _111 from "./prices/query.lcd"; import * as _112 from "./rewards/query.lcd"; import * as _113 from "./stats/query.lcd"; import * as _114 from "./subaccounts/query.lcd"; @@ -109,9 +109,9 @@ import * as _119 from "./clob/query.rpc.Query"; import * as _120 from "./delaymsg/query.rpc.Query"; import * as _121 from "./epochs/query.rpc.Query"; import * as _122 from "./feetiers/query.rpc.Query"; -import * as _123 from "./perpetuals/query.rpc.Query"; -import * as _124 from "./prices/query.rpc.Query"; -import * as _125 from "./ratelimit/query.rpc.Query"; +import * as _123 from "./ibcratelimit/query.rpc.Query"; +import * as _124 from "./perpetuals/query.rpc.Query"; +import * as _125 from "./prices/query.rpc.Query"; import * as _126 from "./rewards/query.rpc.Query"; import * as _127 from "./sending/query.rpc.Query"; import * as _128 from "./stats/query.rpc.Query"; @@ -122,9 +122,9 @@ import * as _132 from "./bridge/tx.rpc.msg"; import * as _133 from "./clob/tx.rpc.msg"; import * as _134 from "./delaymsg/tx.rpc.msg"; import * as _135 from "./feetiers/tx.rpc.msg"; -import * as _136 from "./perpetuals/tx.rpc.msg"; -import * as _137 from "./prices/tx.rpc.msg"; -import * as _138 from "./ratelimit/tx.rpc.msg"; +import * as _136 from "./ibcratelimit/tx.rpc.msg"; +import * as _137 from "./perpetuals/tx.rpc.msg"; +import * as _138 from "./prices/tx.rpc.msg"; import * as _139 from "./rewards/tx.rpc.msg"; import * as _140 from "./sending/tx.rpc.msg"; import * as _141 from "./stats/tx.rpc.msg"; @@ -208,35 +208,35 @@ export namespace dydxprotocol { ..._122, ..._135 }; + export const ibcratelimit = { ..._49, + ..._50, + ..._51, + ..._52, + ..._53, + ..._109, + ..._123, + ..._136 + }; export namespace indexer { - export const events = { ..._49 + export const events = { ..._54 }; - export const indexer_manager = { ..._50 + export const indexer_manager = { ..._55 }; - export const off_chain_updates = { ..._51 + export const off_chain_updates = { ..._56 }; export namespace protocol { - export const v1 = { ..._52, - ..._53 + export const v1 = { ..._57, + ..._58 }; } - export const redis = { ..._54 + export const redis = { ..._59 }; - export const shared = { ..._55 + export const shared = { ..._60 }; - export const socks = { ..._56 + export const socks = { ..._61 }; } - export const perpetuals = { ..._57, - ..._58, - ..._59, - ..._60, - ..._61, - ..._109, - ..._123, - ..._136 - }; - export const prices = { ..._62, + export const perpetuals = { ..._62, ..._63, ..._64, ..._65, @@ -245,7 +245,7 @@ export namespace dydxprotocol { ..._124, ..._137 }; - export const ratelimit = { ..._67, + export const prices = { ..._67, ..._68, ..._69, ..._70, diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/liquidations.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/liquidations.ts index 2bf0106eed..7d76bd2b9d 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/liquidations.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/liquidations.ts @@ -83,28 +83,6 @@ export interface SubaccountLiquidationInfoSDKType { quantums_insurance_lost: Long; } -/** - * SubaccountOpenPositionInfo holds information about open positions for a - * perpetual. - */ - -export interface SubaccountOpenPositionInfo { - /** The id of the perpetual. */ - perpetualId: number; - subaccountsWithLongPosition: SubaccountId[]; - subaccountsWithShortPosition: SubaccountId[]; -} -/** - * SubaccountOpenPositionInfo holds information about open positions for a - * perpetual. - */ - -export interface SubaccountOpenPositionInfoSDKType { - /** The id of the perpetual. */ - perpetual_id: number; - subaccounts_with_long_position: SubaccountIdSDKType[]; - subaccounts_with_short_position: SubaccountIdSDKType[]; -} function createBasePerpetualLiquidationInfo(): PerpetualLiquidationInfo { return { @@ -237,69 +215,4 @@ export const SubaccountLiquidationInfo = { return message; } -}; - -function createBaseSubaccountOpenPositionInfo(): SubaccountOpenPositionInfo { - return { - perpetualId: 0, - subaccountsWithLongPosition: [], - subaccountsWithShortPosition: [] - }; -} - -export const SubaccountOpenPositionInfo = { - encode(message: SubaccountOpenPositionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.perpetualId !== 0) { - writer.uint32(8).uint32(message.perpetualId); - } - - for (const v of message.subaccountsWithLongPosition) { - SubaccountId.encode(v!, writer.uint32(18).fork()).ldelim(); - } - - for (const v of message.subaccountsWithShortPosition) { - SubaccountId.encode(v!, writer.uint32(26).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): SubaccountOpenPositionInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSubaccountOpenPositionInfo(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.perpetualId = reader.uint32(); - break; - - case 2: - message.subaccountsWithLongPosition.push(SubaccountId.decode(reader, reader.uint32())); - break; - - case 3: - message.subaccountsWithShortPosition.push(SubaccountId.decode(reader, reader.uint32())); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): SubaccountOpenPositionInfo { - const message = createBaseSubaccountOpenPositionInfo(); - message.perpetualId = object.perpetualId ?? 0; - message.subaccountsWithLongPosition = object.subaccountsWithLongPosition?.map(e => SubaccountId.fromPartial(e)) || []; - message.subaccountsWithShortPosition = object.subaccountsWithShortPosition?.map(e => SubaccountId.fromPartial(e)) || []; - return message; - } - }; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts new file mode 100644 index 0000000000..c0a5eabcaf --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts @@ -0,0 +1,89 @@ +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "../../helpers"; +/** DenomCapacity stores a list of rate limit capacity for a denom. */ + +export interface DenomCapacity { + /** + * denom is the denomination of the token being rate limited. + * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + */ + denom: string; + /** + * capacity_list is a list of capacity amount tracked for each `Limiter` + * on the denom. This list has a 1:1 mapping to `limiter` list under + * `LimitParams`. + */ + + capacityList: Uint8Array[]; +} +/** DenomCapacity stores a list of rate limit capacity for a denom. */ + +export interface DenomCapacitySDKType { + /** + * denom is the denomination of the token being rate limited. + * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + */ + denom: string; + /** + * capacity_list is a list of capacity amount tracked for each `Limiter` + * on the denom. This list has a 1:1 mapping to `limiter` list under + * `LimitParams`. + */ + + capacity_list: Uint8Array[]; +} + +function createBaseDenomCapacity(): DenomCapacity { + return { + denom: "", + capacityList: [] + }; +} + +export const DenomCapacity = { + encode(message: DenomCapacity, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + + for (const v of message.capacityList) { + writer.uint32(18).bytes(v!); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DenomCapacity { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomCapacity(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + + case 2: + message.capacityList.push(reader.bytes()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): DenomCapacity { + const message = createBaseDenomCapacity(); + message.denom = object.denom ?? ""; + message.capacityList = object.capacityList?.map(e => e) || []; + return message; + } + +}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts new file mode 100644 index 0000000000..35956f214f --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts @@ -0,0 +1,60 @@ +import { LimitParams, LimitParamsSDKType } from "./limit_params"; +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "../../helpers"; +/** GenesisState defines the ibcratelimit module's genesis state. */ + +export interface GenesisState { + /** limit_params_list defines the list of `LimitParams` at genesis. */ + limitParamsList: LimitParams[]; +} +/** GenesisState defines the ibcratelimit module's genesis state. */ + +export interface GenesisStateSDKType { + /** limit_params_list defines the list of `LimitParams` at genesis. */ + limit_params_list: LimitParamsSDKType[]; +} + +function createBaseGenesisState(): GenesisState { + return { + limitParamsList: [] + }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.limitParamsList) { + LimitParams.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.limitParamsList.push(LimitParams.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.limitParamsList = object.limitParamsList?.map(e => LimitParams.fromPartial(e)) || []; + return message; + } + +}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts new file mode 100644 index 0000000000..d78b9120d7 --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts @@ -0,0 +1,198 @@ +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "../../helpers"; +/** LimitParams defines rate limit params on a denom. */ + +export interface LimitParams { + /** + * denom is the denomination of the token being rate limited. + * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + */ + denom: string; + /** + * limiters is a list of rate-limiters on this denom. All limiters + * must be satified for a withdrawal to proceed. + */ + + limiters: Limiter[]; +} +/** LimitParams defines rate limit params on a denom. */ + +export interface LimitParamsSDKType { + /** + * denom is the denomination of the token being rate limited. + * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 + */ + denom: string; + /** + * limiters is a list of rate-limiters on this denom. All limiters + * must be satified for a withdrawal to proceed. + */ + + limiters: LimiterSDKType[]; +} +/** Limiter defines one rate-limiter on a specfic denom. */ + +export interface Limiter { + /** + * period_sec is the rolling time period for which the limit applies + * e.g. 3600 (an hour) + */ + periodSec: number; + /** + * baseline_minimum is the minimum maximum withdrawal coin amount within the + * time period. + * e.g. 100_000_000_000 uusdc for 100k USDC; 5e22 adv4tnt for 50k DV4TNT + */ + + baselineMinimum: Uint8Array; + /** + * baseline_tvl_ppm is the maximum ratio of TVL withdrawable in + * the time period, in part-per-million. + * e.g. 100_000 (10%) + */ + + baselineTvlPpm: number; +} +/** Limiter defines one rate-limiter on a specfic denom. */ + +export interface LimiterSDKType { + /** + * period_sec is the rolling time period for which the limit applies + * e.g. 3600 (an hour) + */ + period_sec: number; + /** + * baseline_minimum is the minimum maximum withdrawal coin amount within the + * time period. + * e.g. 100_000_000_000 uusdc for 100k USDC; 5e22 adv4tnt for 50k DV4TNT + */ + + baseline_minimum: Uint8Array; + /** + * baseline_tvl_ppm is the maximum ratio of TVL withdrawable in + * the time period, in part-per-million. + * e.g. 100_000 (10%) + */ + + baseline_tvl_ppm: number; +} + +function createBaseLimitParams(): LimitParams { + return { + denom: "", + limiters: [] + }; +} + +export const LimitParams = { + encode(message: LimitParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + + for (const v of message.limiters) { + Limiter.encode(v!, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LimitParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLimitParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + + case 2: + message.limiters.push(Limiter.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): LimitParams { + const message = createBaseLimitParams(); + message.denom = object.denom ?? ""; + message.limiters = object.limiters?.map(e => Limiter.fromPartial(e)) || []; + return message; + } + +}; + +function createBaseLimiter(): Limiter { + return { + periodSec: 0, + baselineMinimum: new Uint8Array(), + baselineTvlPpm: 0 + }; +} + +export const Limiter = { + encode(message: Limiter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.periodSec !== 0) { + writer.uint32(16).uint32(message.periodSec); + } + + if (message.baselineMinimum.length !== 0) { + writer.uint32(26).bytes(message.baselineMinimum); + } + + if (message.baselineTvlPpm !== 0) { + writer.uint32(32).uint32(message.baselineTvlPpm); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Limiter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLimiter(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 2: + message.periodSec = reader.uint32(); + break; + + case 3: + message.baselineMinimum = reader.bytes(); + break; + + case 4: + message.baselineTvlPpm = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): Limiter { + const message = createBaseLimiter(); + message.periodSec = object.periodSec ?? 0; + message.baselineMinimum = object.baselineMinimum ?? new Uint8Array(); + message.baselineTvlPpm = object.baselineTvlPpm ?? 0; + return message; + } + +}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts new file mode 100644 index 0000000000..5b66647ae5 --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts @@ -0,0 +1,38 @@ +import { LCDClient } from "@osmonauts/lcd"; +import { ListLimitParamsRequest, ListLimitParamsResponseSDKType, QueryCapacityByDenomRequest, QueryCapacityByDenomResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.listLimitParams = this.listLimitParams.bind(this); + this.capacityByDenom = this.capacityByDenom.bind(this); + } + /* List all limit params. */ + + + async listLimitParams(_params: ListLimitParamsRequest = {}): Promise { + const endpoint = `dydxprotocol/v4/ibcratelimit/list_limit_params`; + return await this.req.get(endpoint); + } + /* Query capacity by denom. */ + + + async capacityByDenom(params: QueryCapacityByDenomRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + + const endpoint = `dydxprotocol/v4/ibcratelimit/capacity_by_denom`; + return await this.req.get(endpoint, options); + } + +} \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts new file mode 100644 index 0000000000..309d7e014a --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts @@ -0,0 +1,49 @@ +import { Rpc } from "../../helpers"; +import * as _m0 from "protobufjs/minimal"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { ListLimitParamsRequest, ListLimitParamsResponse, QueryCapacityByDenomRequest, QueryCapacityByDenomResponse } from "./query"; +/** Query defines the gRPC querier service. */ + +export interface Query { + /** List all limit params. */ + listLimitParams(request?: ListLimitParamsRequest): Promise; + /** Query capacity by denom. */ + + capacityByDenom(request: QueryCapacityByDenomRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.listLimitParams = this.listLimitParams.bind(this); + this.capacityByDenom = this.capacityByDenom.bind(this); + } + + listLimitParams(request: ListLimitParamsRequest = {}): Promise { + const data = ListLimitParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.ibcratelimit.Query", "ListLimitParams", data); + return promise.then(data => ListLimitParamsResponse.decode(new _m0.Reader(data))); + } + + capacityByDenom(request: QueryCapacityByDenomRequest): Promise { + const data = QueryCapacityByDenomRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.ibcratelimit.Query", "CapacityByDenom", data); + return promise.then(data => QueryCapacityByDenomResponse.decode(new _m0.Reader(data))); + } + +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + listLimitParams(request?: ListLimitParamsRequest): Promise { + return queryService.listLimitParams(request); + }, + + capacityByDenom(request: QueryCapacityByDenomRequest): Promise { + return queryService.capacityByDenom(request); + } + + }; +}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts new file mode 100644 index 0000000000..def00e01da --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts @@ -0,0 +1,305 @@ +import { LimitParams, LimitParamsSDKType } from "./limit_params"; +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "../../helpers"; +/** ListLimitParamsRequest is a request type of the ListLimitParams RPC method. */ + +export interface ListLimitParamsRequest {} +/** ListLimitParamsRequest is a request type of the ListLimitParams RPC method. */ + +export interface ListLimitParamsRequestSDKType {} +/** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ + +export interface ListLimitParamsResponse { + /** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ + limitParamsList: LimitParams[]; +} +/** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ + +export interface ListLimitParamsResponseSDKType { + /** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ + limit_params_list: LimitParamsSDKType[]; +} +/** + * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC + * method. + */ + +export interface QueryCapacityByDenomRequest { + /** + * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC + * method. + */ + denom: string; +} +/** + * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC + * method. + */ + +export interface QueryCapacityByDenomRequestSDKType { + /** + * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC + * method. + */ + denom: string; +} +/** CapacityResult is a specific rate limit for a denom. */ + +export interface CapacityResult { + periodSec: number; + capacity: Uint8Array; +} +/** CapacityResult is a specific rate limit for a denom. */ + +export interface CapacityResultSDKType { + period_sec: number; + capacity: Uint8Array; +} +/** + * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC + * method. + */ + +export interface QueryCapacityByDenomResponse { + /** + * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC + * method. + */ + results: CapacityResult[]; +} +/** + * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC + * method. + */ + +export interface QueryCapacityByDenomResponseSDKType { + /** + * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC + * method. + */ + results: CapacityResultSDKType[]; +} + +function createBaseListLimitParamsRequest(): ListLimitParamsRequest { + return {}; +} + +export const ListLimitParamsRequest = { + encode(_: ListLimitParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListLimitParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListLimitParamsRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): ListLimitParamsRequest { + const message = createBaseListLimitParamsRequest(); + return message; + } + +}; + +function createBaseListLimitParamsResponse(): ListLimitParamsResponse { + return { + limitParamsList: [] + }; +} + +export const ListLimitParamsResponse = { + encode(message: ListLimitParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.limitParamsList) { + LimitParams.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListLimitParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListLimitParamsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.limitParamsList.push(LimitParams.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): ListLimitParamsResponse { + const message = createBaseListLimitParamsResponse(); + message.limitParamsList = object.limitParamsList?.map(e => LimitParams.fromPartial(e)) || []; + return message; + } + +}; + +function createBaseQueryCapacityByDenomRequest(): QueryCapacityByDenomRequest { + return { + denom: "" + }; +} + +export const QueryCapacityByDenomRequest = { + encode(message: QueryCapacityByDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCapacityByDenomRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCapacityByDenomRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryCapacityByDenomRequest { + const message = createBaseQueryCapacityByDenomRequest(); + message.denom = object.denom ?? ""; + return message; + } + +}; + +function createBaseCapacityResult(): CapacityResult { + return { + periodSec: 0, + capacity: new Uint8Array() + }; +} + +export const CapacityResult = { + encode(message: CapacityResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.periodSec !== 0) { + writer.uint32(8).uint32(message.periodSec); + } + + if (message.capacity.length !== 0) { + writer.uint32(18).bytes(message.capacity); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CapacityResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCapacityResult(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.periodSec = reader.uint32(); + break; + + case 2: + message.capacity = reader.bytes(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): CapacityResult { + const message = createBaseCapacityResult(); + message.periodSec = object.periodSec ?? 0; + message.capacity = object.capacity ?? new Uint8Array(); + return message; + } + +}; + +function createBaseQueryCapacityByDenomResponse(): QueryCapacityByDenomResponse { + return { + results: [] + }; +} + +export const QueryCapacityByDenomResponse = { + encode(message: QueryCapacityByDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.results) { + CapacityResult.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCapacityByDenomResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCapacityByDenomResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.results.push(CapacityResult.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryCapacityByDenomResponse { + const message = createBaseQueryCapacityByDenomResponse(); + message.results = object.results?.map(e => CapacityResult.fromPartial(e)) || []; + return message; + } + +}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts new file mode 100644 index 0000000000..5a4a6a1bd1 --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts @@ -0,0 +1,34 @@ +import { Rpc } from "../../helpers"; +import * as _m0 from "protobufjs/minimal"; +import { MsgSetLimitParams, MsgSetLimitParamsResponse, MsgDeleteLimitParams, MsgDeleteLimitParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ + +export interface Msg { + /** SetLimitParams sets a `LimitParams` object in state. */ + setLimitParams(request: MsgSetLimitParams): Promise; + /** DeleteLimitParams removes a `LimitParams` object from state. */ + + deleteLimitParams(request: MsgDeleteLimitParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.setLimitParams = this.setLimitParams.bind(this); + this.deleteLimitParams = this.deleteLimitParams.bind(this); + } + + setLimitParams(request: MsgSetLimitParams): Promise { + const data = MsgSetLimitParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.ibcratelimit.Msg", "SetLimitParams", data); + return promise.then(data => MsgSetLimitParamsResponse.decode(new _m0.Reader(data))); + } + + deleteLimitParams(request: MsgDeleteLimitParams): Promise { + const data = MsgDeleteLimitParams.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.ibcratelimit.Msg", "DeleteLimitParams", data); + return promise.then(data => MsgDeleteLimitParamsResponse.decode(new _m0.Reader(data))); + } + +} \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts new file mode 100644 index 0000000000..5c6fe30ec9 --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts @@ -0,0 +1,225 @@ +import { LimitParams, LimitParamsSDKType } from "./limit_params"; +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "../../helpers"; +/** MsgSetLimitParams is the Msg/SetLimitParams request type. */ + +export interface MsgSetLimitParams { + authority: string; + /** Defines the parameters to set. All parameters must be supplied. */ + + limitParams?: LimitParams; +} +/** MsgSetLimitParams is the Msg/SetLimitParams request type. */ + +export interface MsgSetLimitParamsSDKType { + authority: string; + /** Defines the parameters to set. All parameters must be supplied. */ + + limit_params?: LimitParamsSDKType; +} +/** MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. */ + +export interface MsgSetLimitParamsResponse {} +/** MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. */ + +export interface MsgSetLimitParamsResponseSDKType {} +/** MsgDeleteLimitParams is the Msg/SetLimitParams request type. */ + +export interface MsgDeleteLimitParams { + authority: string; + /** The denom for which the `LimitParams` should be deleted. */ + + denom: string; +} +/** MsgDeleteLimitParams is the Msg/SetLimitParams request type. */ + +export interface MsgDeleteLimitParamsSDKType { + authority: string; + /** The denom for which the `LimitParams` should be deleted. */ + + denom: string; +} +/** MsgDeleteLimitParamsResponse is the Msg/DeleteLimitParams response type. */ + +export interface MsgDeleteLimitParamsResponse {} +/** MsgDeleteLimitParamsResponse is the Msg/DeleteLimitParams response type. */ + +export interface MsgDeleteLimitParamsResponseSDKType {} + +function createBaseMsgSetLimitParams(): MsgSetLimitParams { + return { + authority: "", + limitParams: undefined + }; +} + +export const MsgSetLimitParams = { + encode(message: MsgSetLimitParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + + if (message.limitParams !== undefined) { + LimitParams.encode(message.limitParams, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetLimitParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLimitParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + + case 2: + message.limitParams = LimitParams.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): MsgSetLimitParams { + const message = createBaseMsgSetLimitParams(); + message.authority = object.authority ?? ""; + message.limitParams = object.limitParams !== undefined && object.limitParams !== null ? LimitParams.fromPartial(object.limitParams) : undefined; + return message; + } + +}; + +function createBaseMsgSetLimitParamsResponse(): MsgSetLimitParamsResponse { + return {}; +} + +export const MsgSetLimitParamsResponse = { + encode(_: MsgSetLimitParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetLimitParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetLimitParamsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): MsgSetLimitParamsResponse { + const message = createBaseMsgSetLimitParamsResponse(); + return message; + } + +}; + +function createBaseMsgDeleteLimitParams(): MsgDeleteLimitParams { + return { + authority: "", + denom: "" + }; +} + +export const MsgDeleteLimitParams = { + encode(message: MsgDeleteLimitParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteLimitParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteLimitParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + + case 2: + message.denom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): MsgDeleteLimitParams { + const message = createBaseMsgDeleteLimitParams(); + message.authority = object.authority ?? ""; + message.denom = object.denom ?? ""; + return message; + } + +}; + +function createBaseMsgDeleteLimitParamsResponse(): MsgDeleteLimitParamsResponse { + return {}; +} + +export const MsgDeleteLimitParamsResponse = { + encode(_: MsgDeleteLimitParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteLimitParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeleteLimitParamsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): MsgDeleteLimitParamsResponse { + const message = createBaseMsgDeleteLimitParamsResponse(); + return message; + } + +}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts index b262a362c8..4de55fd505 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts @@ -943,12 +943,8 @@ export interface LiquidityTierUpsertEventV1 { * The maximum position size at which the margin requirements are * not increased over the default values. Above this position size, * the margin requirements increase at a rate of sqrt(size). - * - * Deprecated since v3.x. */ - /** @deprecated */ - basePositionNotional: Long; } /** @@ -978,12 +974,8 @@ export interface LiquidityTierUpsertEventV1SDKType { * The maximum position size at which the margin requirements are * not increased over the default values. Above this position size, * the margin requirements increase at a rate of sqrt(size). - * - * Deprecated since v3.x. */ - /** @deprecated */ - base_position_notional: Long; } /** diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts index 318178b12f..e246bd66ba 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts @@ -30,13 +30,13 @@ export const createLCDClient = async ({ feetiers: new (await import("./feetiers/query.lcd")).LCDQueryClient({ requestClient }), - perpetuals: new (await import("./perpetuals/query.lcd")).LCDQueryClient({ + ibcratelimit: new (await import("./ibcratelimit/query.lcd")).LCDQueryClient({ requestClient }), - prices: new (await import("./prices/query.lcd")).LCDQueryClient({ + perpetuals: new (await import("./perpetuals/query.lcd")).LCDQueryClient({ requestClient }), - ratelimit: new (await import("./ratelimit/query.lcd")).LCDQueryClient({ + prices: new (await import("./prices/query.lcd")).LCDQueryClient({ requestClient }), rewards: new (await import("./rewards/query.lcd")).LCDQueryClient({ diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts index 2408940f66..f4947e6c05 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts @@ -198,12 +198,8 @@ export interface LiquidityTier { * The maximum position size at which the margin requirements are * not increased over the default values. Above this position size, * the margin requirements increase at a rate of sqrt(size). - * - * Deprecated since v3.x. */ - /** @deprecated */ - basePositionNotional: Long; /** * The impact notional amount (in quote quantums) is used to determine impact @@ -241,12 +237,8 @@ export interface LiquidityTierSDKType { * The maximum position size at which the margin requirements are * not increased over the default values. Above this position size, * the margin requirements increase at a rate of sqrt(size). - * - * Deprecated since v3.x. */ - /** @deprecated */ - base_position_notional: Long; /** * The impact notional amount (in quote quantums) is used to determine impact diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts index 546196beeb..336945f441 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts @@ -16,9 +16,9 @@ export const createRPCQueryClient = async ({ delaymsg: (await import("./delaymsg/query.rpc.Query")).createRpcQueryExtension(client), epochs: (await import("./epochs/query.rpc.Query")).createRpcQueryExtension(client), feetiers: (await import("./feetiers/query.rpc.Query")).createRpcQueryExtension(client), + ibcratelimit: (await import("./ibcratelimit/query.rpc.Query")).createRpcQueryExtension(client), perpetuals: (await import("./perpetuals/query.rpc.Query")).createRpcQueryExtension(client), prices: (await import("./prices/query.rpc.Query")).createRpcQueryExtension(client), - ratelimit: (await import("./ratelimit/query.rpc.Query")).createRpcQueryExtension(client), rewards: (await import("./rewards/query.rpc.Query")).createRpcQueryExtension(client), sending: (await import("./sending/query.rpc.Query")).createRpcQueryExtension(client), stats: (await import("./stats/query.rpc.Query")).createRpcQueryExtension(client), diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts index a76b1b51e9..629f261698 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts @@ -10,9 +10,9 @@ export const createRPCMsgClient = async ({ clob: new (await import("./clob/tx.rpc.msg")).MsgClientImpl(rpc), delaymsg: new (await import("./delaymsg/tx.rpc.msg")).MsgClientImpl(rpc), feetiers: new (await import("./feetiers/tx.rpc.msg")).MsgClientImpl(rpc), + ibcratelimit: new (await import("./ibcratelimit/tx.rpc.msg")).MsgClientImpl(rpc), perpetuals: new (await import("./perpetuals/tx.rpc.msg")).MsgClientImpl(rpc), prices: new (await import("./prices/tx.rpc.msg")).MsgClientImpl(rpc), - ratelimit: new (await import("./ratelimit/tx.rpc.msg")).MsgClientImpl(rpc), rewards: new (await import("./rewards/tx.rpc.msg")).MsgClientImpl(rpc), sending: new (await import("./sending/tx.rpc.msg")).MsgClientImpl(rpc), stats: new (await import("./stats/tx.rpc.msg")).MsgClientImpl(rpc), diff --git a/indexer/pnpm-lock.yaml b/indexer/pnpm-lock.yaml index 1736e463a7..ea974da4c6 100644 --- a/indexer/pnpm-lock.yaml +++ b/indexer/pnpm-lock.yaml @@ -274,10 +274,10 @@ importers: packages/v4-protos: specifiers: '@bufbuild/buf': 1.19.0-1 - '@cosmjs/amino': ^0.29.3 - '@cosmjs/proto-signing': ^0.29.3 - '@cosmjs/stargate': ^0.29.3 - '@cosmjs/tendermint-rpc': ^0.29.3 + '@cosmjs/amino': ^0.32.1 + '@cosmjs/proto-signing': ^0.32.1 + '@cosmjs/stargate': ^0.32.1 + '@cosmjs/tendermint-rpc': ^0.32.1 '@dydxprotocol-indexer/dev': workspace:^0.0.1 '@osmonauts/lcd': ^0.6.0 '@osmonauts/telescope': 0.80.0 @@ -290,10 +290,10 @@ importers: typescript: ^4.7.4 dependencies: '@bufbuild/buf': 1.19.0-1 - '@cosmjs/amino': 0.29.5 - '@cosmjs/proto-signing': 0.29.5 - '@cosmjs/stargate': 0.29.5 - '@cosmjs/tendermint-rpc': 0.29.5 + '@cosmjs/amino': 0.32.1 + '@cosmjs/proto-signing': 0.32.1 + '@cosmjs/stargate': 0.32.1 + '@cosmjs/tendermint-rpc': 0.32.1 '@osmonauts/lcd': 0.6.0 bech32: 2.0.0 dotenv-flow: 3.2.0 @@ -4674,64 +4674,63 @@ packages: protobufjs: 6.11.3 dev: false - /@cosmjs/amino/0.29.5: - resolution: {integrity: sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw==} + /@cosmjs/amino/0.32.1: + resolution: {integrity: sha512-5l2xQ2XuAhV/B3kTIMPBcVZ/OQ+9Yyddzw/lIVs4qE5e/oBI0PVNWXw1oyR0wgfGHrMUxgKjsoOOqE2IbXVyCw==} dependencies: - '@cosmjs/crypto': 0.29.5 - '@cosmjs/encoding': 0.29.5 - '@cosmjs/math': 0.29.5 - '@cosmjs/utils': 0.29.5 + '@cosmjs/crypto': 0.32.1 + '@cosmjs/encoding': 0.32.1 + '@cosmjs/math': 0.32.1 + '@cosmjs/utils': 0.32.1 dev: false - /@cosmjs/crypto/0.29.5: - resolution: {integrity: sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ==} + /@cosmjs/crypto/0.32.1: + resolution: {integrity: sha512-AsKucEg5o8evU0wXF/lDwX+ZSwCKF4bbc57nFzraHywlp3sNu4dfPPURoMrT0r7kT7wQZAy4Pdnvmm9nnCCm/Q==} dependencies: - '@cosmjs/encoding': 0.29.5 - '@cosmjs/math': 0.29.5 - '@cosmjs/utils': 0.29.5 + '@cosmjs/encoding': 0.32.1 + '@cosmjs/math': 0.32.1 + '@cosmjs/utils': 0.32.1 '@noble/hashes': 1.3.0 bn.js: 5.2.1 elliptic: 6.5.4 - libsodium-wrappers: 0.7.11 + libsodium-wrappers-sumo: 0.7.13 dev: false - /@cosmjs/encoding/0.29.5: - resolution: {integrity: sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ==} + /@cosmjs/encoding/0.32.1: + resolution: {integrity: sha512-x60Lfds+Eq42rVV29NaoIAson3kBhATBI3zPp7X3GJTryBc5HFHQ6L/976tE1WB2DrvkfUdWS3ayCMVOY/qm1g==} dependencies: base64-js: 1.5.1 bech32: 1.1.4 readonly-date: 1.0.0 dev: false - /@cosmjs/json-rpc/0.29.5: - resolution: {integrity: sha512-C78+X06l+r9xwdM1yFWIpGl03LhB9NdM1xvZpQHwgCOl0Ir/WV8pw48y3Ez2awAoUBRfTeejPe4KvrE6NoIi/w==} + /@cosmjs/json-rpc/0.32.1: + resolution: {integrity: sha512-Hsj3Sg+m/JF8qfISp/G4TXQ0FAO01mzDKtNcgKufIHCrvJNDiE69xGyGgSm/qKwsXLBmzRTSxHWK0+yZef3LNQ==} dependencies: - '@cosmjs/stream': 0.29.5 + '@cosmjs/stream': 0.32.1 xstream: 11.14.0 dev: false - /@cosmjs/math/0.29.5: - resolution: {integrity: sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q==} + /@cosmjs/math/0.32.1: + resolution: {integrity: sha512-sqJgDjPh49rxe06apzwKYLxAw4LLFKmEd4yQtHqH16BxVVUrvK5UH9TEBpUrRErdjqENowekecDCDBZspGXHNA==} dependencies: bn.js: 5.2.1 dev: false - /@cosmjs/proto-signing/0.29.5: - resolution: {integrity: sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA==} + /@cosmjs/proto-signing/0.32.1: + resolution: {integrity: sha512-IHJMXQ8XnfzR5K1hWb8VV/jEfJof6BL2mgGIA7X4hSPegwoVfb9hnFKPEPgFjGCTTvGZ8SfnCdXxpsOjianVIA==} dependencies: - '@cosmjs/amino': 0.29.5 - '@cosmjs/crypto': 0.29.5 - '@cosmjs/encoding': 0.29.5 - '@cosmjs/math': 0.29.5 - '@cosmjs/utils': 0.29.5 - cosmjs-types: 0.5.2 - long: 4.0.0 + '@cosmjs/amino': 0.32.1 + '@cosmjs/crypto': 0.32.1 + '@cosmjs/encoding': 0.32.1 + '@cosmjs/math': 0.32.1 + '@cosmjs/utils': 0.32.1 + cosmjs-types: 0.9.0 dev: false - /@cosmjs/socket/0.29.5: - resolution: {integrity: sha512-5VYDupIWbIXq3ftPV1LkS5Ya/T7Ol/AzWVhNxZ79hPe/mBfv1bGau/LqIYOm2zxGlgm9hBHOTmWGqNYDwr9LNQ==} + /@cosmjs/socket/0.32.1: + resolution: {integrity: sha512-thPCLCmnCuZvrsDW4YmsADI/MliOXWuMnflbzX+3OhoTuEav2I4/1aOXY0jdy0bbqL0l1opx+JfmwdWptMgKzg==} dependencies: - '@cosmjs/stream': 0.29.5 + '@cosmjs/stream': 0.32.1 isomorphic-ws: 4.0.1_ws@7.5.9 ws: 7.5.9 xstream: 11.14.0 @@ -4740,20 +4739,18 @@ packages: - utf-8-validate dev: false - /@cosmjs/stargate/0.29.5: - resolution: {integrity: sha512-hjEv8UUlJruLrYGJcUZXM/CziaINOKwfVm2BoSdUnNTMxGvY/jC1ABHKeZUYt9oXHxEJ1n9+pDqzbKc8pT0nBw==} + /@cosmjs/stargate/0.32.1: + resolution: {integrity: sha512-S0E1qKQ2CMJU79G8bQTquTyrbU03gFsvCkbo3RvK8v2OltVCByjFNh+0nGN5do+uDOzwwmDvnNLhR+SaIyNQoQ==} dependencies: '@confio/ics23': 0.6.8 - '@cosmjs/amino': 0.29.5 - '@cosmjs/encoding': 0.29.5 - '@cosmjs/math': 0.29.5 - '@cosmjs/proto-signing': 0.29.5 - '@cosmjs/stream': 0.29.5 - '@cosmjs/tendermint-rpc': 0.29.5 - '@cosmjs/utils': 0.29.5 - cosmjs-types: 0.5.2 - long: 4.0.0 - protobufjs: 6.11.3 + '@cosmjs/amino': 0.32.1 + '@cosmjs/encoding': 0.32.1 + '@cosmjs/math': 0.32.1 + '@cosmjs/proto-signing': 0.32.1 + '@cosmjs/stream': 0.32.1 + '@cosmjs/tendermint-rpc': 0.32.1 + '@cosmjs/utils': 0.32.1 + cosmjs-types: 0.9.0 xstream: 11.14.0 transitivePeerDependencies: - bufferutil @@ -4761,23 +4758,23 @@ packages: - utf-8-validate dev: false - /@cosmjs/stream/0.29.5: - resolution: {integrity: sha512-TToTDWyH1p05GBtF0Y8jFw2C+4783ueDCmDyxOMM6EU82IqpmIbfwcdMOCAm0JhnyMh+ocdebbFvnX/sGKzRAA==} + /@cosmjs/stream/0.32.1: + resolution: {integrity: sha512-6RwHaGxWbIG0y++aCYP/doa4ex/Up8Q8G+ehwDzAq3aKl3zbDe9L0FmycclnMuwPm/baPIkEZ6+IVmJoNLX79Q==} dependencies: xstream: 11.14.0 dev: false - /@cosmjs/tendermint-rpc/0.29.5: - resolution: {integrity: sha512-ar80twieuAxsy0x2za/aO3kBr2DFPAXDmk2ikDbmkda+qqfXgl35l9CVAAjKRqd9d+cRvbQyb5M4wy6XQpEV6w==} + /@cosmjs/tendermint-rpc/0.32.1: + resolution: {integrity: sha512-4uGSxB2JejWhwBUgxca4GqcK/BGnCFMIP7ptwEledrC3AY/shPeIYcPXWEBwO7sfwCta8DhAOCLrc9zhVC+VAQ==} dependencies: - '@cosmjs/crypto': 0.29.5 - '@cosmjs/encoding': 0.29.5 - '@cosmjs/json-rpc': 0.29.5 - '@cosmjs/math': 0.29.5 - '@cosmjs/socket': 0.29.5 - '@cosmjs/stream': 0.29.5 - '@cosmjs/utils': 0.29.5 - axios: 0.21.4 + '@cosmjs/crypto': 0.32.1 + '@cosmjs/encoding': 0.32.1 + '@cosmjs/json-rpc': 0.32.1 + '@cosmjs/math': 0.32.1 + '@cosmjs/socket': 0.32.1 + '@cosmjs/stream': 0.32.1 + '@cosmjs/utils': 0.32.1 + axios: 1.6.2 readonly-date: 1.0.0 xstream: 11.14.0 transitivePeerDependencies: @@ -4786,8 +4783,8 @@ packages: - utf-8-validate dev: false - /@cosmjs/utils/0.29.5: - resolution: {integrity: sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ==} + /@cosmjs/utils/0.32.1: + resolution: {integrity: sha512-PV9pa0cVPFCNgfQKEOc6RcNFHr5wMQLcDqWoo/ekIoj1AfzAaqnojdnL80u1C9Qf+vOfRGIXubqiU7Tl7QZuig==} dev: false /@cosmwasm/ts-codegen/0.21.1: @@ -6379,25 +6376,27 @@ packages: engines: {node: '>=12'} dev: true - /axios/0.21.4: - resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} + /axios/0.27.2: + resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} dependencies: follow-redirects: 1.15.1 + form-data: 4.0.0 transitivePeerDependencies: - debug dev: false - /axios/0.27.2: - resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} + /axios/1.2.1: + resolution: {integrity: sha512-I88cFiGu9ryt/tfVEi4kX2SITsvDddTajXTOFmt2uK1ZVA8LytjtdeyefdQWEf5PU8w+4SSJDoYnggflB5tW4A==} dependencies: follow-redirects: 1.15.1 form-data: 4.0.0 + proxy-from-env: 1.1.0 transitivePeerDependencies: - debug dev: false - /axios/1.2.1: - resolution: {integrity: sha512-I88cFiGu9ryt/tfVEi4kX2SITsvDddTajXTOFmt2uK1ZVA8LytjtdeyefdQWEf5PU8w+4SSJDoYnggflB5tW4A==} + /axios/1.6.2: + resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} dependencies: follow-redirects: 1.15.1 form-data: 4.0.0 @@ -7060,11 +7059,8 @@ packages: vary: 1.1.2 dev: false - /cosmjs-types/0.5.2: - resolution: {integrity: sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg==} - dependencies: - long: 4.0.0 - protobufjs: 6.11.3 + /cosmjs-types/0.9.0: + resolution: {integrity: sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ==} dev: false /coveralls/3.1.1: @@ -10493,14 +10489,14 @@ packages: type-check: 0.4.0 dev: true - /libsodium-wrappers/0.7.11: - resolution: {integrity: sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q==} - dependencies: - libsodium: 0.7.11 + /libsodium-sumo/0.7.13: + resolution: {integrity: sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==} dev: false - /libsodium/0.7.11: - resolution: {integrity: sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A==} + /libsodium-wrappers-sumo/0.7.13: + resolution: {integrity: sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==} + dependencies: + libsodium-sumo: 0.7.13 dev: false /liftoff/3.1.0: From 89bbaf86358d71f504c360cb4a27921461393afc Mon Sep 17 00:00:00 2001 From: Will Liu Date: Tue, 12 Dec 2023 14:02:10 -0500 Subject: [PATCH 2/2] fix --- .../src/codegen/dydxprotocol/bundle.ts | 102 +++--- .../codegen/dydxprotocol/clob/liquidations.ts | 87 +++++ .../dydxprotocol/ibcratelimit/capacity.ts | 89 ----- .../dydxprotocol/ibcratelimit/genesis.ts | 60 ---- .../dydxprotocol/ibcratelimit/limit_params.ts | 198 ------------ .../dydxprotocol/ibcratelimit/query.lcd.ts | 38 --- .../ibcratelimit/query.rpc.Query.ts | 49 --- .../dydxprotocol/ibcratelimit/query.ts | 305 ------------------ .../dydxprotocol/ibcratelimit/tx.rpc.msg.ts | 34 -- .../codegen/dydxprotocol/ibcratelimit/tx.ts | 225 ------------- .../dydxprotocol/indexer/events/events.ts | 8 + .../v4-protos/src/codegen/dydxprotocol/lcd.ts | 6 +- .../dydxprotocol/perpetuals/perpetual.ts | 8 + .../src/codegen/dydxprotocol/rpc.query.ts | 2 +- .../src/codegen/dydxprotocol/rpc.tx.ts | 2 +- 15 files changed, 159 insertions(+), 1054 deletions(-) delete mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts delete mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts delete mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts delete mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts delete mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts delete mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts delete mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts delete mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts index d2548c5d77..680ae1ba54 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts @@ -42,29 +42,29 @@ import * as _45 from "./feetiers/genesis"; import * as _46 from "./feetiers/params"; import * as _47 from "./feetiers/query"; import * as _48 from "./feetiers/tx"; -import * as _49 from "./ibcratelimit/capacity"; -import * as _50 from "./ibcratelimit/genesis"; -import * as _51 from "./ibcratelimit/limit_params"; -import * as _52 from "./ibcratelimit/query"; -import * as _53 from "./ibcratelimit/tx"; -import * as _54 from "./indexer/events/events"; -import * as _55 from "./indexer/indexer_manager/event"; -import * as _56 from "./indexer/off_chain_updates/off_chain_updates"; -import * as _57 from "./indexer/protocol/v1/clob"; -import * as _58 from "./indexer/protocol/v1/subaccount"; -import * as _59 from "./indexer/redis/redis_order"; -import * as _60 from "./indexer/shared/removal_reason"; -import * as _61 from "./indexer/socks/messages"; -import * as _62 from "./perpetuals/genesis"; -import * as _63 from "./perpetuals/params"; -import * as _64 from "./perpetuals/perpetual"; -import * as _65 from "./perpetuals/query"; -import * as _66 from "./perpetuals/tx"; -import * as _67 from "./prices/genesis"; -import * as _68 from "./prices/market_param"; -import * as _69 from "./prices/market_price"; -import * as _70 from "./prices/query"; -import * as _71 from "./prices/tx"; +import * as _49 from "./indexer/events/events"; +import * as _50 from "./indexer/indexer_manager/event"; +import * as _51 from "./indexer/off_chain_updates/off_chain_updates"; +import * as _52 from "./indexer/protocol/v1/clob"; +import * as _53 from "./indexer/protocol/v1/subaccount"; +import * as _54 from "./indexer/redis/redis_order"; +import * as _55 from "./indexer/shared/removal_reason"; +import * as _56 from "./indexer/socks/messages"; +import * as _57 from "./perpetuals/genesis"; +import * as _58 from "./perpetuals/params"; +import * as _59 from "./perpetuals/perpetual"; +import * as _60 from "./perpetuals/query"; +import * as _61 from "./perpetuals/tx"; +import * as _62 from "./prices/genesis"; +import * as _63 from "./prices/market_param"; +import * as _64 from "./prices/market_price"; +import * as _65 from "./prices/query"; +import * as _66 from "./prices/tx"; +import * as _67 from "./ratelimit/capacity"; +import * as _68 from "./ratelimit/genesis"; +import * as _69 from "./ratelimit/limit_params"; +import * as _70 from "./ratelimit/query"; +import * as _71 from "./ratelimit/tx"; import * as _72 from "./rewards/genesis"; import * as _73 from "./rewards/params"; import * as _74 from "./rewards/query"; @@ -95,9 +95,9 @@ import * as _105 from "./clob/query.lcd"; import * as _106 from "./delaymsg/query.lcd"; import * as _107 from "./epochs/query.lcd"; import * as _108 from "./feetiers/query.lcd"; -import * as _109 from "./ibcratelimit/query.lcd"; -import * as _110 from "./perpetuals/query.lcd"; -import * as _111 from "./prices/query.lcd"; +import * as _109 from "./perpetuals/query.lcd"; +import * as _110 from "./prices/query.lcd"; +import * as _111 from "./ratelimit/query.lcd"; import * as _112 from "./rewards/query.lcd"; import * as _113 from "./stats/query.lcd"; import * as _114 from "./subaccounts/query.lcd"; @@ -109,9 +109,9 @@ import * as _119 from "./clob/query.rpc.Query"; import * as _120 from "./delaymsg/query.rpc.Query"; import * as _121 from "./epochs/query.rpc.Query"; import * as _122 from "./feetiers/query.rpc.Query"; -import * as _123 from "./ibcratelimit/query.rpc.Query"; -import * as _124 from "./perpetuals/query.rpc.Query"; -import * as _125 from "./prices/query.rpc.Query"; +import * as _123 from "./perpetuals/query.rpc.Query"; +import * as _124 from "./prices/query.rpc.Query"; +import * as _125 from "./ratelimit/query.rpc.Query"; import * as _126 from "./rewards/query.rpc.Query"; import * as _127 from "./sending/query.rpc.Query"; import * as _128 from "./stats/query.rpc.Query"; @@ -122,9 +122,9 @@ import * as _132 from "./bridge/tx.rpc.msg"; import * as _133 from "./clob/tx.rpc.msg"; import * as _134 from "./delaymsg/tx.rpc.msg"; import * as _135 from "./feetiers/tx.rpc.msg"; -import * as _136 from "./ibcratelimit/tx.rpc.msg"; -import * as _137 from "./perpetuals/tx.rpc.msg"; -import * as _138 from "./prices/tx.rpc.msg"; +import * as _136 from "./perpetuals/tx.rpc.msg"; +import * as _137 from "./prices/tx.rpc.msg"; +import * as _138 from "./ratelimit/tx.rpc.msg"; import * as _139 from "./rewards/tx.rpc.msg"; import * as _140 from "./sending/tx.rpc.msg"; import * as _141 from "./stats/tx.rpc.msg"; @@ -208,35 +208,35 @@ export namespace dydxprotocol { ..._122, ..._135 }; - export const ibcratelimit = { ..._49, - ..._50, - ..._51, - ..._52, - ..._53, - ..._109, - ..._123, - ..._136 - }; export namespace indexer { - export const events = { ..._54 + export const events = { ..._49 }; - export const indexer_manager = { ..._55 + export const indexer_manager = { ..._50 }; - export const off_chain_updates = { ..._56 + export const off_chain_updates = { ..._51 }; export namespace protocol { - export const v1 = { ..._57, - ..._58 + export const v1 = { ..._52, + ..._53 }; } - export const redis = { ..._59 + export const redis = { ..._54 }; - export const shared = { ..._60 + export const shared = { ..._55 }; - export const socks = { ..._61 + export const socks = { ..._56 }; } - export const perpetuals = { ..._62, + export const perpetuals = { ..._57, + ..._58, + ..._59, + ..._60, + ..._61, + ..._109, + ..._123, + ..._136 + }; + export const prices = { ..._62, ..._63, ..._64, ..._65, @@ -245,7 +245,7 @@ export namespace dydxprotocol { ..._124, ..._137 }; - export const prices = { ..._67, + export const ratelimit = { ..._67, ..._68, ..._69, ..._70, diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/liquidations.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/liquidations.ts index 7d76bd2b9d..2bf0106eed 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/liquidations.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/liquidations.ts @@ -83,6 +83,28 @@ export interface SubaccountLiquidationInfoSDKType { quantums_insurance_lost: Long; } +/** + * SubaccountOpenPositionInfo holds information about open positions for a + * perpetual. + */ + +export interface SubaccountOpenPositionInfo { + /** The id of the perpetual. */ + perpetualId: number; + subaccountsWithLongPosition: SubaccountId[]; + subaccountsWithShortPosition: SubaccountId[]; +} +/** + * SubaccountOpenPositionInfo holds information about open positions for a + * perpetual. + */ + +export interface SubaccountOpenPositionInfoSDKType { + /** The id of the perpetual. */ + perpetual_id: number; + subaccounts_with_long_position: SubaccountIdSDKType[]; + subaccounts_with_short_position: SubaccountIdSDKType[]; +} function createBasePerpetualLiquidationInfo(): PerpetualLiquidationInfo { return { @@ -215,4 +237,69 @@ export const SubaccountLiquidationInfo = { return message; } +}; + +function createBaseSubaccountOpenPositionInfo(): SubaccountOpenPositionInfo { + return { + perpetualId: 0, + subaccountsWithLongPosition: [], + subaccountsWithShortPosition: [] + }; +} + +export const SubaccountOpenPositionInfo = { + encode(message: SubaccountOpenPositionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.perpetualId !== 0) { + writer.uint32(8).uint32(message.perpetualId); + } + + for (const v of message.subaccountsWithLongPosition) { + SubaccountId.encode(v!, writer.uint32(18).fork()).ldelim(); + } + + for (const v of message.subaccountsWithShortPosition) { + SubaccountId.encode(v!, writer.uint32(26).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SubaccountOpenPositionInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubaccountOpenPositionInfo(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.perpetualId = reader.uint32(); + break; + + case 2: + message.subaccountsWithLongPosition.push(SubaccountId.decode(reader, reader.uint32())); + break; + + case 3: + message.subaccountsWithShortPosition.push(SubaccountId.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): SubaccountOpenPositionInfo { + const message = createBaseSubaccountOpenPositionInfo(); + message.perpetualId = object.perpetualId ?? 0; + message.subaccountsWithLongPosition = object.subaccountsWithLongPosition?.map(e => SubaccountId.fromPartial(e)) || []; + message.subaccountsWithShortPosition = object.subaccountsWithShortPosition?.map(e => SubaccountId.fromPartial(e)) || []; + return message; + } + }; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts deleted file mode 100644 index c0a5eabcaf..0000000000 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/capacity.ts +++ /dev/null @@ -1,89 +0,0 @@ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial } from "../../helpers"; -/** DenomCapacity stores a list of rate limit capacity for a denom. */ - -export interface DenomCapacity { - /** - * denom is the denomination of the token being rate limited. - * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 - */ - denom: string; - /** - * capacity_list is a list of capacity amount tracked for each `Limiter` - * on the denom. This list has a 1:1 mapping to `limiter` list under - * `LimitParams`. - */ - - capacityList: Uint8Array[]; -} -/** DenomCapacity stores a list of rate limit capacity for a denom. */ - -export interface DenomCapacitySDKType { - /** - * denom is the denomination of the token being rate limited. - * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 - */ - denom: string; - /** - * capacity_list is a list of capacity amount tracked for each `Limiter` - * on the denom. This list has a 1:1 mapping to `limiter` list under - * `LimitParams`. - */ - - capacity_list: Uint8Array[]; -} - -function createBaseDenomCapacity(): DenomCapacity { - return { - denom: "", - capacityList: [] - }; -} - -export const DenomCapacity = { - encode(message: DenomCapacity, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - - for (const v of message.capacityList) { - writer.uint32(18).bytes(v!); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DenomCapacity { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDenomCapacity(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - - case 2: - message.capacityList.push(reader.bytes()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): DenomCapacity { - const message = createBaseDenomCapacity(); - message.denom = object.denom ?? ""; - message.capacityList = object.capacityList?.map(e => e) || []; - return message; - } - -}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts deleted file mode 100644 index 35956f214f..0000000000 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/genesis.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { LimitParams, LimitParamsSDKType } from "./limit_params"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial } from "../../helpers"; -/** GenesisState defines the ibcratelimit module's genesis state. */ - -export interface GenesisState { - /** limit_params_list defines the list of `LimitParams` at genesis. */ - limitParamsList: LimitParams[]; -} -/** GenesisState defines the ibcratelimit module's genesis state. */ - -export interface GenesisStateSDKType { - /** limit_params_list defines the list of `LimitParams` at genesis. */ - limit_params_list: LimitParamsSDKType[]; -} - -function createBaseGenesisState(): GenesisState { - return { - limitParamsList: [] - }; -} - -export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.limitParamsList) { - LimitParams.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.limitParamsList.push(LimitParams.decode(reader, reader.uint32())); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = createBaseGenesisState(); - message.limitParamsList = object.limitParamsList?.map(e => LimitParams.fromPartial(e)) || []; - return message; - } - -}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts deleted file mode 100644 index d78b9120d7..0000000000 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/limit_params.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial } from "../../helpers"; -/** LimitParams defines rate limit params on a denom. */ - -export interface LimitParams { - /** - * denom is the denomination of the token being rate limited. - * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 - */ - denom: string; - /** - * limiters is a list of rate-limiters on this denom. All limiters - * must be satified for a withdrawal to proceed. - */ - - limiters: Limiter[]; -} -/** LimitParams defines rate limit params on a denom. */ - -export interface LimitParamsSDKType { - /** - * denom is the denomination of the token being rate limited. - * e.g. ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5 - */ - denom: string; - /** - * limiters is a list of rate-limiters on this denom. All limiters - * must be satified for a withdrawal to proceed. - */ - - limiters: LimiterSDKType[]; -} -/** Limiter defines one rate-limiter on a specfic denom. */ - -export interface Limiter { - /** - * period_sec is the rolling time period for which the limit applies - * e.g. 3600 (an hour) - */ - periodSec: number; - /** - * baseline_minimum is the minimum maximum withdrawal coin amount within the - * time period. - * e.g. 100_000_000_000 uusdc for 100k USDC; 5e22 adv4tnt for 50k DV4TNT - */ - - baselineMinimum: Uint8Array; - /** - * baseline_tvl_ppm is the maximum ratio of TVL withdrawable in - * the time period, in part-per-million. - * e.g. 100_000 (10%) - */ - - baselineTvlPpm: number; -} -/** Limiter defines one rate-limiter on a specfic denom. */ - -export interface LimiterSDKType { - /** - * period_sec is the rolling time period for which the limit applies - * e.g. 3600 (an hour) - */ - period_sec: number; - /** - * baseline_minimum is the minimum maximum withdrawal coin amount within the - * time period. - * e.g. 100_000_000_000 uusdc for 100k USDC; 5e22 adv4tnt for 50k DV4TNT - */ - - baseline_minimum: Uint8Array; - /** - * baseline_tvl_ppm is the maximum ratio of TVL withdrawable in - * the time period, in part-per-million. - * e.g. 100_000 (10%) - */ - - baseline_tvl_ppm: number; -} - -function createBaseLimitParams(): LimitParams { - return { - denom: "", - limiters: [] - }; -} - -export const LimitParams = { - encode(message: LimitParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - - for (const v of message.limiters) { - Limiter.encode(v!, writer.uint32(18).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LimitParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLimitParams(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - - case 2: - message.limiters.push(Limiter.decode(reader, reader.uint32())); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): LimitParams { - const message = createBaseLimitParams(); - message.denom = object.denom ?? ""; - message.limiters = object.limiters?.map(e => Limiter.fromPartial(e)) || []; - return message; - } - -}; - -function createBaseLimiter(): Limiter { - return { - periodSec: 0, - baselineMinimum: new Uint8Array(), - baselineTvlPpm: 0 - }; -} - -export const Limiter = { - encode(message: Limiter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.periodSec !== 0) { - writer.uint32(16).uint32(message.periodSec); - } - - if (message.baselineMinimum.length !== 0) { - writer.uint32(26).bytes(message.baselineMinimum); - } - - if (message.baselineTvlPpm !== 0) { - writer.uint32(32).uint32(message.baselineTvlPpm); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Limiter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLimiter(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 2: - message.periodSec = reader.uint32(); - break; - - case 3: - message.baselineMinimum = reader.bytes(); - break; - - case 4: - message.baselineTvlPpm = reader.uint32(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): Limiter { - const message = createBaseLimiter(); - message.periodSec = object.periodSec ?? 0; - message.baselineMinimum = object.baselineMinimum ?? new Uint8Array(); - message.baselineTvlPpm = object.baselineTvlPpm ?? 0; - return message; - } - -}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts deleted file mode 100644 index 5b66647ae5..0000000000 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.lcd.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { LCDClient } from "@osmonauts/lcd"; -import { ListLimitParamsRequest, ListLimitParamsResponseSDKType, QueryCapacityByDenomRequest, QueryCapacityByDenomResponseSDKType } from "./query"; -export class LCDQueryClient { - req: LCDClient; - - constructor({ - requestClient - }: { - requestClient: LCDClient; - }) { - this.req = requestClient; - this.listLimitParams = this.listLimitParams.bind(this); - this.capacityByDenom = this.capacityByDenom.bind(this); - } - /* List all limit params. */ - - - async listLimitParams(_params: ListLimitParamsRequest = {}): Promise { - const endpoint = `dydxprotocol/v4/ibcratelimit/list_limit_params`; - return await this.req.get(endpoint); - } - /* Query capacity by denom. */ - - - async capacityByDenom(params: QueryCapacityByDenomRequest): Promise { - const options: any = { - params: {} - }; - - if (typeof params?.denom !== "undefined") { - options.params.denom = params.denom; - } - - const endpoint = `dydxprotocol/v4/ibcratelimit/capacity_by_denom`; - return await this.req.get(endpoint, options); - } - -} \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts deleted file mode 100644 index 309d7e014a..0000000000 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.rpc.Query.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Rpc } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; -import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { ListLimitParamsRequest, ListLimitParamsResponse, QueryCapacityByDenomRequest, QueryCapacityByDenomResponse } from "./query"; -/** Query defines the gRPC querier service. */ - -export interface Query { - /** List all limit params. */ - listLimitParams(request?: ListLimitParamsRequest): Promise; - /** Query capacity by denom. */ - - capacityByDenom(request: QueryCapacityByDenomRequest): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - this.listLimitParams = this.listLimitParams.bind(this); - this.capacityByDenom = this.capacityByDenom.bind(this); - } - - listLimitParams(request: ListLimitParamsRequest = {}): Promise { - const data = ListLimitParamsRequest.encode(request).finish(); - const promise = this.rpc.request("dydxprotocol.ibcratelimit.Query", "ListLimitParams", data); - return promise.then(data => ListLimitParamsResponse.decode(new _m0.Reader(data))); - } - - capacityByDenom(request: QueryCapacityByDenomRequest): Promise { - const data = QueryCapacityByDenomRequest.encode(request).finish(); - const promise = this.rpc.request("dydxprotocol.ibcratelimit.Query", "CapacityByDenom", data); - return promise.then(data => QueryCapacityByDenomResponse.decode(new _m0.Reader(data))); - } - -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - listLimitParams(request?: ListLimitParamsRequest): Promise { - return queryService.listLimitParams(request); - }, - - capacityByDenom(request: QueryCapacityByDenomRequest): Promise { - return queryService.capacityByDenom(request); - } - - }; -}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts deleted file mode 100644 index def00e01da..0000000000 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/query.ts +++ /dev/null @@ -1,305 +0,0 @@ -import { LimitParams, LimitParamsSDKType } from "./limit_params"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial } from "../../helpers"; -/** ListLimitParamsRequest is a request type of the ListLimitParams RPC method. */ - -export interface ListLimitParamsRequest {} -/** ListLimitParamsRequest is a request type of the ListLimitParams RPC method. */ - -export interface ListLimitParamsRequestSDKType {} -/** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ - -export interface ListLimitParamsResponse { - /** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ - limitParamsList: LimitParams[]; -} -/** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ - -export interface ListLimitParamsResponseSDKType { - /** ListLimitParamsResponse is a response type of the ListLimitParams RPC method. */ - limit_params_list: LimitParamsSDKType[]; -} -/** - * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC - * method. - */ - -export interface QueryCapacityByDenomRequest { - /** - * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC - * method. - */ - denom: string; -} -/** - * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC - * method. - */ - -export interface QueryCapacityByDenomRequestSDKType { - /** - * QueryCapacityByDenomRequest is a request type for the CapacityByDenom RPC - * method. - */ - denom: string; -} -/** CapacityResult is a specific rate limit for a denom. */ - -export interface CapacityResult { - periodSec: number; - capacity: Uint8Array; -} -/** CapacityResult is a specific rate limit for a denom. */ - -export interface CapacityResultSDKType { - period_sec: number; - capacity: Uint8Array; -} -/** - * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC - * method. - */ - -export interface QueryCapacityByDenomResponse { - /** - * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC - * method. - */ - results: CapacityResult[]; -} -/** - * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC - * method. - */ - -export interface QueryCapacityByDenomResponseSDKType { - /** - * QueryCapacityByDenomResponse is a response type of the CapacityByDenom RPC - * method. - */ - results: CapacityResultSDKType[]; -} - -function createBaseListLimitParamsRequest(): ListLimitParamsRequest { - return {}; -} - -export const ListLimitParamsRequest = { - encode(_: ListLimitParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListLimitParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListLimitParamsRequest(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(_: DeepPartial): ListLimitParamsRequest { - const message = createBaseListLimitParamsRequest(); - return message; - } - -}; - -function createBaseListLimitParamsResponse(): ListLimitParamsResponse { - return { - limitParamsList: [] - }; -} - -export const ListLimitParamsResponse = { - encode(message: ListLimitParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.limitParamsList) { - LimitParams.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListLimitParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListLimitParamsResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.limitParamsList.push(LimitParams.decode(reader, reader.uint32())); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): ListLimitParamsResponse { - const message = createBaseListLimitParamsResponse(); - message.limitParamsList = object.limitParamsList?.map(e => LimitParams.fromPartial(e)) || []; - return message; - } - -}; - -function createBaseQueryCapacityByDenomRequest(): QueryCapacityByDenomRequest { - return { - denom: "" - }; -} - -export const QueryCapacityByDenomRequest = { - encode(message: QueryCapacityByDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.denom !== "") { - writer.uint32(10).string(message.denom); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCapacityByDenomRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCapacityByDenomRequest(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): QueryCapacityByDenomRequest { - const message = createBaseQueryCapacityByDenomRequest(); - message.denom = object.denom ?? ""; - return message; - } - -}; - -function createBaseCapacityResult(): CapacityResult { - return { - periodSec: 0, - capacity: new Uint8Array() - }; -} - -export const CapacityResult = { - encode(message: CapacityResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.periodSec !== 0) { - writer.uint32(8).uint32(message.periodSec); - } - - if (message.capacity.length !== 0) { - writer.uint32(18).bytes(message.capacity); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CapacityResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCapacityResult(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.periodSec = reader.uint32(); - break; - - case 2: - message.capacity = reader.bytes(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): CapacityResult { - const message = createBaseCapacityResult(); - message.periodSec = object.periodSec ?? 0; - message.capacity = object.capacity ?? new Uint8Array(); - return message; - } - -}; - -function createBaseQueryCapacityByDenomResponse(): QueryCapacityByDenomResponse { - return { - results: [] - }; -} - -export const QueryCapacityByDenomResponse = { - encode(message: QueryCapacityByDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.results) { - CapacityResult.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCapacityByDenomResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryCapacityByDenomResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.results.push(CapacityResult.decode(reader, reader.uint32())); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): QueryCapacityByDenomResponse { - const message = createBaseQueryCapacityByDenomResponse(); - message.results = object.results?.map(e => CapacityResult.fromPartial(e)) || []; - return message; - } - -}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts deleted file mode 100644 index 5a4a6a1bd1..0000000000 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.rpc.msg.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Rpc } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; -import { MsgSetLimitParams, MsgSetLimitParamsResponse, MsgDeleteLimitParams, MsgDeleteLimitParamsResponse } from "./tx"; -/** Msg defines the Msg service. */ - -export interface Msg { - /** SetLimitParams sets a `LimitParams` object in state. */ - setLimitParams(request: MsgSetLimitParams): Promise; - /** DeleteLimitParams removes a `LimitParams` object from state. */ - - deleteLimitParams(request: MsgDeleteLimitParams): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - this.setLimitParams = this.setLimitParams.bind(this); - this.deleteLimitParams = this.deleteLimitParams.bind(this); - } - - setLimitParams(request: MsgSetLimitParams): Promise { - const data = MsgSetLimitParams.encode(request).finish(); - const promise = this.rpc.request("dydxprotocol.ibcratelimit.Msg", "SetLimitParams", data); - return promise.then(data => MsgSetLimitParamsResponse.decode(new _m0.Reader(data))); - } - - deleteLimitParams(request: MsgDeleteLimitParams): Promise { - const data = MsgDeleteLimitParams.encode(request).finish(); - const promise = this.rpc.request("dydxprotocol.ibcratelimit.Msg", "DeleteLimitParams", data); - return promise.then(data => MsgDeleteLimitParamsResponse.decode(new _m0.Reader(data))); - } - -} \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts deleted file mode 100644 index 5c6fe30ec9..0000000000 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/ibcratelimit/tx.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { LimitParams, LimitParamsSDKType } from "./limit_params"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial } from "../../helpers"; -/** MsgSetLimitParams is the Msg/SetLimitParams request type. */ - -export interface MsgSetLimitParams { - authority: string; - /** Defines the parameters to set. All parameters must be supplied. */ - - limitParams?: LimitParams; -} -/** MsgSetLimitParams is the Msg/SetLimitParams request type. */ - -export interface MsgSetLimitParamsSDKType { - authority: string; - /** Defines the parameters to set. All parameters must be supplied. */ - - limit_params?: LimitParamsSDKType; -} -/** MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. */ - -export interface MsgSetLimitParamsResponse {} -/** MsgSetLimitParamsResponse is the Msg/SetLimitParams response type. */ - -export interface MsgSetLimitParamsResponseSDKType {} -/** MsgDeleteLimitParams is the Msg/SetLimitParams request type. */ - -export interface MsgDeleteLimitParams { - authority: string; - /** The denom for which the `LimitParams` should be deleted. */ - - denom: string; -} -/** MsgDeleteLimitParams is the Msg/SetLimitParams request type. */ - -export interface MsgDeleteLimitParamsSDKType { - authority: string; - /** The denom for which the `LimitParams` should be deleted. */ - - denom: string; -} -/** MsgDeleteLimitParamsResponse is the Msg/DeleteLimitParams response type. */ - -export interface MsgDeleteLimitParamsResponse {} -/** MsgDeleteLimitParamsResponse is the Msg/DeleteLimitParams response type. */ - -export interface MsgDeleteLimitParamsResponseSDKType {} - -function createBaseMsgSetLimitParams(): MsgSetLimitParams { - return { - authority: "", - limitParams: undefined - }; -} - -export const MsgSetLimitParams = { - encode(message: MsgSetLimitParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - - if (message.limitParams !== undefined) { - LimitParams.encode(message.limitParams, writer.uint32(18).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetLimitParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetLimitParams(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - - case 2: - message.limitParams = LimitParams.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): MsgSetLimitParams { - const message = createBaseMsgSetLimitParams(); - message.authority = object.authority ?? ""; - message.limitParams = object.limitParams !== undefined && object.limitParams !== null ? LimitParams.fromPartial(object.limitParams) : undefined; - return message; - } - -}; - -function createBaseMsgSetLimitParamsResponse(): MsgSetLimitParamsResponse { - return {}; -} - -export const MsgSetLimitParamsResponse = { - encode(_: MsgSetLimitParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetLimitParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSetLimitParamsResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(_: DeepPartial): MsgSetLimitParamsResponse { - const message = createBaseMsgSetLimitParamsResponse(); - return message; - } - -}; - -function createBaseMsgDeleteLimitParams(): MsgDeleteLimitParams { - return { - authority: "", - denom: "" - }; -} - -export const MsgDeleteLimitParams = { - encode(message: MsgDeleteLimitParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - - if (message.denom !== "") { - writer.uint32(18).string(message.denom); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteLimitParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeleteLimitParams(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - - case 2: - message.denom = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(object: DeepPartial): MsgDeleteLimitParams { - const message = createBaseMsgDeleteLimitParams(); - message.authority = object.authority ?? ""; - message.denom = object.denom ?? ""; - return message; - } - -}; - -function createBaseMsgDeleteLimitParamsResponse(): MsgDeleteLimitParamsResponse { - return {}; -} - -export const MsgDeleteLimitParamsResponse = { - encode(_: MsgDeleteLimitParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteLimitParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgDeleteLimitParamsResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromPartial(_: DeepPartial): MsgDeleteLimitParamsResponse { - const message = createBaseMsgDeleteLimitParamsResponse(); - return message; - } - -}; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts index 4de55fd505..b262a362c8 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts @@ -943,8 +943,12 @@ export interface LiquidityTierUpsertEventV1 { * The maximum position size at which the margin requirements are * not increased over the default values. Above this position size, * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. */ + /** @deprecated */ + basePositionNotional: Long; } /** @@ -974,8 +978,12 @@ export interface LiquidityTierUpsertEventV1SDKType { * The maximum position size at which the margin requirements are * not increased over the default values. Above this position size, * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. */ + /** @deprecated */ + base_position_notional: Long; } /** diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts index e246bd66ba..318178b12f 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/lcd.ts @@ -30,15 +30,15 @@ export const createLCDClient = async ({ feetiers: new (await import("./feetiers/query.lcd")).LCDQueryClient({ requestClient }), - ibcratelimit: new (await import("./ibcratelimit/query.lcd")).LCDQueryClient({ - requestClient - }), perpetuals: new (await import("./perpetuals/query.lcd")).LCDQueryClient({ requestClient }), prices: new (await import("./prices/query.lcd")).LCDQueryClient({ requestClient }), + ratelimit: new (await import("./ratelimit/query.lcd")).LCDQueryClient({ + requestClient + }), rewards: new (await import("./rewards/query.lcd")).LCDQueryClient({ requestClient }), diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts index f4947e6c05..2408940f66 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/perpetual.ts @@ -198,8 +198,12 @@ export interface LiquidityTier { * The maximum position size at which the margin requirements are * not increased over the default values. Above this position size, * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. */ + /** @deprecated */ + basePositionNotional: Long; /** * The impact notional amount (in quote quantums) is used to determine impact @@ -237,8 +241,12 @@ export interface LiquidityTierSDKType { * The maximum position size at which the margin requirements are * not increased over the default values. Above this position size, * the margin requirements increase at a rate of sqrt(size). + * + * Deprecated since v3.x. */ + /** @deprecated */ + base_position_notional: Long; /** * The impact notional amount (in quote quantums) is used to determine impact diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts index 336945f441..546196beeb 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.query.ts @@ -16,9 +16,9 @@ export const createRPCQueryClient = async ({ delaymsg: (await import("./delaymsg/query.rpc.Query")).createRpcQueryExtension(client), epochs: (await import("./epochs/query.rpc.Query")).createRpcQueryExtension(client), feetiers: (await import("./feetiers/query.rpc.Query")).createRpcQueryExtension(client), - ibcratelimit: (await import("./ibcratelimit/query.rpc.Query")).createRpcQueryExtension(client), perpetuals: (await import("./perpetuals/query.rpc.Query")).createRpcQueryExtension(client), prices: (await import("./prices/query.rpc.Query")).createRpcQueryExtension(client), + ratelimit: (await import("./ratelimit/query.rpc.Query")).createRpcQueryExtension(client), rewards: (await import("./rewards/query.rpc.Query")).createRpcQueryExtension(client), sending: (await import("./sending/query.rpc.Query")).createRpcQueryExtension(client), stats: (await import("./stats/query.rpc.Query")).createRpcQueryExtension(client), diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts index 629f261698..a76b1b51e9 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/rpc.tx.ts @@ -10,9 +10,9 @@ export const createRPCMsgClient = async ({ clob: new (await import("./clob/tx.rpc.msg")).MsgClientImpl(rpc), delaymsg: new (await import("./delaymsg/tx.rpc.msg")).MsgClientImpl(rpc), feetiers: new (await import("./feetiers/tx.rpc.msg")).MsgClientImpl(rpc), - ibcratelimit: new (await import("./ibcratelimit/tx.rpc.msg")).MsgClientImpl(rpc), perpetuals: new (await import("./perpetuals/tx.rpc.msg")).MsgClientImpl(rpc), prices: new (await import("./prices/tx.rpc.msg")).MsgClientImpl(rpc), + ratelimit: new (await import("./ratelimit/tx.rpc.msg")).MsgClientImpl(rpc), rewards: new (await import("./rewards/tx.rpc.msg")).MsgClientImpl(rpc), sending: new (await import("./sending/tx.rpc.msg")).MsgClientImpl(rpc), stats: new (await import("./stats/tx.rpc.msg")).MsgClientImpl(rpc),