From 8ba34b5d73b444908a59fdbaef4c370649bce881 Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Fri, 20 Sep 2024 12:22:48 +0300 Subject: [PATCH 1/9] update repos versions --- .gitmodules | 2 +- protos/admin-module-src | 2 +- protos/block-sdk-src | 2 +- protos/cosmos-sdk-src | 2 +- protos/feemarket-src | 2 +- protos/ibc-go-src | 2 +- protos/slinky-src | 2 +- protos/wasmd-src | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitmodules b/.gitmodules index 399206c..3c91fd2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,7 +16,7 @@ [submodule "neutron"] path = protos/neutron-src url = git@github.com:neutron-org/neutron.git - branch = feat/choose-cron-blocker-2 + branch = feat/choose-cron-blocker-2 [submodule "slinky"] path = protos/slinky-src url = git@github.com:skip-mev/slinky.git diff --git a/protos/admin-module-src b/protos/admin-module-src index 4986f03..9fac26b 160000 --- a/protos/admin-module-src +++ b/protos/admin-module-src @@ -1 +1 @@ -Subproject commit 4986f03e67c1187a77232a2f07e3add18dabe70e +Subproject commit 9fac26b50249f2049816ade1486e4757d43d2834 diff --git a/protos/block-sdk-src b/protos/block-sdk-src index 137ed46..1ea62f3 160000 --- a/protos/block-sdk-src +++ b/protos/block-sdk-src @@ -1 +1 @@ -Subproject commit 137ed466d5bf3603d9b9c435f79a8e70480d09c1 +Subproject commit 1ea62f3eed1927073562600ba25915f323ee15a3 diff --git a/protos/cosmos-sdk-src b/protos/cosmos-sdk-src index 4222c96..3f0794f 160000 --- a/protos/cosmos-sdk-src +++ b/protos/cosmos-sdk-src @@ -1 +1 @@ -Subproject commit 4222c96ebb82374ad9824c01e21c9b7d5b0a516c +Subproject commit 3f0794fd654a2a4e81fdf0f8802fb7a767f7f9dc diff --git a/protos/feemarket-src b/protos/feemarket-src index b4dccfe..f1f216e 160000 --- a/protos/feemarket-src +++ b/protos/feemarket-src @@ -1 +1 @@ -Subproject commit b4dccfe6c1a3a19a7fc3050f330854aed233ac8d +Subproject commit f1f216e15aa6bcc05075a7079496764820a0f545 diff --git a/protos/ibc-go-src b/protos/ibc-go-src index fcd2237..6b25543 160000 --- a/protos/ibc-go-src +++ b/protos/ibc-go-src @@ -1 +1 @@ -Subproject commit fcd223704cd12d4153a705c048b0a7b2e344d4e0 +Subproject commit 6b2554360c0e3f0bbaa59da5b16b29fc05675c57 diff --git a/protos/slinky-src b/protos/slinky-src index a82dfa9..ef03f40 160000 --- a/protos/slinky-src +++ b/protos/slinky-src @@ -1 +1 @@ -Subproject commit a82dfa9106d8c0eb16b8b303c28251c98d356de1 +Subproject commit ef03f402c6ece9e26479c6f6cc9bf59e9fefc2d6 diff --git a/protos/wasmd-src b/protos/wasmd-src index 4652fc2..465a2a8 160000 --- a/protos/wasmd-src +++ b/protos/wasmd-src @@ -1 +1 @@ -Subproject commit 4652fc29c2d381a9fbd383a677ca9a12b85429c3 +Subproject commit 465a2a832752030837f9319ad8261bbd219d9cbb From 10aa37ba519f2246081c0c6b1902d66273eee946 Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Fri, 20 Sep 2024 12:42:34 +0300 Subject: [PATCH 2/9] return neutron-src --- .gitmodules | 2 +- protos/neutron-src | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 160000 protos/neutron-src diff --git a/.gitmodules b/.gitmodules index 3c91fd2..f9820f9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,7 +16,7 @@ [submodule "neutron"] path = protos/neutron-src url = git@github.com:neutron-org/neutron.git - branch = feat/choose-cron-blocker-2 + branch = feat/icq-params-gov-gated [submodule "slinky"] path = protos/slinky-src url = git@github.com:skip-mev/slinky.git diff --git a/protos/neutron-src b/protos/neutron-src new file mode 160000 index 0000000..6df5f6b --- /dev/null +++ b/protos/neutron-src @@ -0,0 +1 @@ +Subproject commit 6df5f6b15c1f34c1ee4f72e2a2fee19ad4b9b656 From 00fe5514b512883cfc6f99028a2b54ca9d81f67a Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Fri, 20 Sep 2024 13:01:25 +0300 Subject: [PATCH 3/9] remove redundant branch option from gitmodules --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f9820f9..64cb390 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,7 +16,6 @@ [submodule "neutron"] path = protos/neutron-src url = git@github.com:neutron-org/neutron.git - branch = feat/icq-params-gov-gated [submodule "slinky"] path = protos/slinky-src url = git@github.com:skip-mev/slinky.git From aeb1b310ea7f57fe34685cbfb326a66cb22d2725 Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Fri, 20 Sep 2024 14:18:45 +0300 Subject: [PATCH 4/9] add clean.sh script --- package.json | 6 +- scripts/clean.sh | 41 +++ scripts/codegen.js | 1 + src/cosmwasm/wasm/v1/ibc.ts | 39 --- src/cosmwasm/wasm/v1/tx.ts | 2 +- src/slinky/marketmap/v1/tx.rpc.msg.ts | 60 ---- src/slinky/marketmap/v1/tx.ts | 462 -------------------------- src/slinky/rpc.tx.ts | 3 - src/slinky/service/v1/oracle.ts | 105 +++++- 9 files changed, 149 insertions(+), 570 deletions(-) create mode 100755 scripts/clean.sh delete mode 100644 src/slinky/marketmap/v1/tx.rpc.msg.ts delete mode 100644 src/slinky/marketmap/v1/tx.ts diff --git a/package.json b/package.json index 5bba812..9ea1d59 100644 --- a/package.json +++ b/package.json @@ -41,10 +41,10 @@ "precodegen": "./scripts/exports_protos.sh", "codegen": "rm -rf ./src && ./scripts/codegen.js && cp -rf copypaste_files/* ./src/ && npm run format", "prepare-publishing": "./scripts/prepare-publishing.sh", - "build": "rm -rf ./build && tsc && npm run prepare-publishing" - }, - "dependencies": { + "build": "rm -rf ./build && tsc && npm run prepare-publishing", + "clean": "./scripts/clean.sh" }, + "dependencies": {}, "devDependencies": { "@cosmology/telescope": "^1.5.4", "@types/node": "^15.6.2", diff --git a/scripts/clean.sh b/scripts/clean.sh new file mode 100755 index 0000000..6461edf --- /dev/null +++ b/scripts/clean.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +DIRS=(capability cosmos cosmos_proto cosmwasm feemarket gaia gogoproto google ibc neutron osmosis sdk slinky tendermint) +FILES=( + binary.d.ts + binary.js + binary.js.map + helpers.d.ts + helpers.js + helpers.js.map + json-safe.d.ts + json-safe.js + json-safe.js.map + utf8.d.ts + utf8.js + utf8.js.map + varint.d.ts + varint.js + varint.js.map + querier_types.js + querier_types.d.ts +) + +for dir in "${DIRS[@]}"; do + rm -rf "$dir" +done + +for f in "${FILES[@]}"; do + if [[ $f != *"json-safe"* ]]; then + rm -rf "$f" + fi +done + +rm -rf ./build + +for dir in admin-module block-sdk cosmos-sdk feemarket ibc-go neutron slinky wasmd ; do + rm -rf "protos/$dir" +done diff --git a/scripts/codegen.js b/scripts/codegen.js index 796b92b..f3a9850 100755 --- a/scripts/codegen.js +++ b/scripts/codegen.js @@ -44,6 +44,7 @@ telescope({ "neutron/dex/genesis.proto", "neutron/transfer/v1/query.proto", "slinky/abci/v1/vote_extensions.proto", + "slinky/marketmap/v1/tx.proto", ], packages: ["google.api"], }, diff --git a/src/cosmwasm/wasm/v1/ibc.ts b/src/cosmwasm/wasm/v1/ibc.ts index 76ec2bd..56c3614 100644 --- a/src/cosmwasm/wasm/v1/ibc.ts +++ b/src/cosmwasm/wasm/v1/ibc.ts @@ -28,8 +28,6 @@ export interface MsgIBCSendResponse { /** Sequence number of the IBC packet sent */ sequence: bigint; } -/** MsgIBCWriteAcknowledgementResponse */ -export interface MsgIBCWriteAcknowledgementResponse {} /** MsgIBCCloseChannel port and channel need to be owned by the contract */ export interface MsgIBCCloseChannel { channel: string; @@ -165,43 +163,6 @@ export const MsgIBCSendResponse = { return message; }, }; -function createBaseMsgIBCWriteAcknowledgementResponse(): MsgIBCWriteAcknowledgementResponse { - return {}; -} -export const MsgIBCWriteAcknowledgementResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse", - encode(_: MsgIBCWriteAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCWriteAcknowledgementResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgIBCWriteAcknowledgementResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(_: any): MsgIBCWriteAcknowledgementResponse { - const obj = createBaseMsgIBCWriteAcknowledgementResponse(); - return obj; - }, - toJSON(_: MsgIBCWriteAcknowledgementResponse): JsonSafe { - const obj: any = {}; - return obj; - }, - fromPartial, I>>( - _: I, - ): MsgIBCWriteAcknowledgementResponse { - const message = createBaseMsgIBCWriteAcknowledgementResponse(); - return message; - }, -}; function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel { return { channel: "", diff --git a/src/cosmwasm/wasm/v1/tx.ts b/src/cosmwasm/wasm/v1/tx.ts index d95f988..4371f5b 100644 --- a/src/cosmwasm/wasm/v1/tx.ts +++ b/src/cosmwasm/wasm/v1/tx.ts @@ -51,7 +51,7 @@ export interface MsgInstantiateContractResponse { } /** * MsgInstantiateContract2 create a new smart contract instance for the given - * code id with a predictable address. + * code id with a predicable address. */ export interface MsgInstantiateContract2 { /** Sender is the that actor that signed the messages */ diff --git a/src/slinky/marketmap/v1/tx.rpc.msg.ts b/src/slinky/marketmap/v1/tx.rpc.msg.ts deleted file mode 100644 index 5951451..0000000 --- a/src/slinky/marketmap/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* eslint-disable */ -import { Rpc } from "../../../helpers"; -import { BinaryReader } from "../../../binary"; -import { - MsgCreateMarkets, - MsgCreateMarketsResponse, - MsgUpdateMarkets, - MsgUpdateMarketsResponse, - MsgParams, - MsgParamsResponse, - MsgRemoveMarketAuthorities, - MsgRemoveMarketAuthoritiesResponse, -} from "./tx"; -/** Msg is the message service for the x/marketmap module. */ -export interface Msg { - /** CreateMarkets creates markets from the given message. */ - createMarkets(request: MsgCreateMarkets): Promise; - /** UpdateMarkets updates markets from the given message. */ - updateMarkets(request: MsgUpdateMarkets): Promise; - /** - * UpdateParams defines a method for updating the x/marketmap module - * parameters. - */ - updateParams(request: MsgParams): Promise; - /** - * RemoveMarketAuthorities defines a method for removing market authorities - * from the x/marketmap module. the signer must be the admin. - */ - removeMarketAuthorities(request: MsgRemoveMarketAuthorities): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - constructor(rpc: Rpc) { - this.rpc = rpc; - this.createMarkets = this.createMarkets.bind(this); - this.updateMarkets = this.updateMarkets.bind(this); - this.updateParams = this.updateParams.bind(this); - this.removeMarketAuthorities = this.removeMarketAuthorities.bind(this); - } - createMarkets(request: MsgCreateMarkets): Promise { - const data = MsgCreateMarkets.encode(request).finish(); - const promise = this.rpc.request("slinky.marketmap.v1.Msg", "CreateMarkets", data); - return promise.then((data) => MsgCreateMarketsResponse.decode(new BinaryReader(data))); - } - updateMarkets(request: MsgUpdateMarkets): Promise { - const data = MsgUpdateMarkets.encode(request).finish(); - const promise = this.rpc.request("slinky.marketmap.v1.Msg", "UpdateMarkets", data); - return promise.then((data) => MsgUpdateMarketsResponse.decode(new BinaryReader(data))); - } - updateParams(request: MsgParams): Promise { - const data = MsgParams.encode(request).finish(); - const promise = this.rpc.request("slinky.marketmap.v1.Msg", "UpdateParams", data); - return promise.then((data) => MsgParamsResponse.decode(new BinaryReader(data))); - } - removeMarketAuthorities(request: MsgRemoveMarketAuthorities): Promise { - const data = MsgRemoveMarketAuthorities.encode(request).finish(); - const promise = this.rpc.request("slinky.marketmap.v1.Msg", "RemoveMarketAuthorities", data); - return promise.then((data) => MsgRemoveMarketAuthoritiesResponse.decode(new BinaryReader(data))); - } -} diff --git a/src/slinky/marketmap/v1/tx.ts b/src/slinky/marketmap/v1/tx.ts deleted file mode 100644 index 248badc..0000000 --- a/src/slinky/marketmap/v1/tx.ts +++ /dev/null @@ -1,462 +0,0 @@ -/* eslint-disable */ -import { Market } from "./market"; -import { Params } from "./params"; -import { BinaryReader, BinaryWriter } from "../../../binary"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; -import { JsonSafe } from "../../../json-safe"; -export const protobufPackage = "slinky.marketmap.v1"; -/** - * MsgCreateMarkets defines a message carrying a payload for creating markets in - * the x/marketmap module. - */ -export interface MsgCreateMarkets { - /** - * Authority is the signer of this transaction. This authority must be - * authorized by the module to execute the message. - */ - authority: string; - /** - * CreateMarkets is the list of all markets to be created for the given - * transaction. - */ - createMarkets: Market[]; -} -/** MsgUpdateMarketMapResponse is the response message for MsgUpdateMarketMap. */ -export interface MsgCreateMarketsResponse {} -/** - * MsgUpdateMarkets defines a message carrying a payload for updating the - * x/marketmap module. - */ -export interface MsgUpdateMarkets { - /** - * Authority is the signer of this transaction. This authority must be - * authorized by the module to execute the message. - */ - authority: string; - /** - * UpdateMarkets is the list of all markets to be updated for the given - * transaction. - */ - updateMarkets: Market[]; -} -/** MsgUpdateMarketsResponse is the response message for MsgUpdateMarkets. */ -export interface MsgUpdateMarketsResponse {} -/** - * MsgParams defines the Msg/Params request type. It contains the - * new parameters for the x/marketmap module. - */ -export interface MsgParams { - /** Params defines the new parameters for the x/marketmap module. */ - params: Params; - /** - * Authority defines the authority that is updating the x/marketmap module - * parameters. - */ - authority: string; -} -/** MsgParamsResponse defines the Msg/Params response type. */ -export interface MsgParamsResponse {} -/** - * MsgRemoveMarketAuthorities defines the Msg/RemoveMarketAuthoritiesResponse - * request type. It contains the new addresses to remove from the list of - * authorities - */ -export interface MsgRemoveMarketAuthorities { - /** RemoveAddresses is the list of addresses to remove. */ - removeAddresses: string[]; - /** - * Admin defines the authority that is the x/marketmap - * Admin account. This account is set in the module parameters. - */ - admin: string; -} -/** - * MsgRemoveMarketAuthoritiesResponse defines the - * Msg/RemoveMarketAuthoritiesResponse response type. - */ -export interface MsgRemoveMarketAuthoritiesResponse {} -function createBaseMsgCreateMarkets(): MsgCreateMarkets { - return { - authority: "", - createMarkets: [], - }; -} -export const MsgCreateMarkets = { - typeUrl: "/slinky.marketmap.v1.MsgCreateMarkets", - encode(message: MsgCreateMarkets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - for (const v of message.createMarkets) { - Market.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateMarkets { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateMarkets(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - case 2: - message.createMarkets.push(Market.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(object: any): MsgCreateMarkets { - const obj = createBaseMsgCreateMarkets(); - if (isSet(object.authority)) obj.authority = String(object.authority); - if (Array.isArray(object?.createMarkets)) - obj.createMarkets = object.createMarkets.map((e: any) => Market.fromJSON(e)); - return obj; - }, - toJSON(message: MsgCreateMarkets): JsonSafe { - const obj: any = {}; - message.authority !== undefined && (obj.authority = message.authority); - if (message.createMarkets) { - obj.createMarkets = message.createMarkets.map((e) => (e ? Market.toJSON(e) : undefined)); - } else { - obj.createMarkets = []; - } - return obj; - }, - fromPartial, I>>(object: I): MsgCreateMarkets { - const message = createBaseMsgCreateMarkets(); - message.authority = object.authority ?? ""; - message.createMarkets = object.createMarkets?.map((e) => Market.fromPartial(e)) || []; - return message; - }, -}; -function createBaseMsgCreateMarketsResponse(): MsgCreateMarketsResponse { - return {}; -} -export const MsgCreateMarketsResponse = { - typeUrl: "/slinky.marketmap.v1.MsgCreateMarketsResponse", - encode(_: MsgCreateMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateMarketsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateMarketsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(_: any): MsgCreateMarketsResponse { - const obj = createBaseMsgCreateMarketsResponse(); - return obj; - }, - toJSON(_: MsgCreateMarketsResponse): JsonSafe { - const obj: any = {}; - return obj; - }, - fromPartial, I>>(_: I): MsgCreateMarketsResponse { - const message = createBaseMsgCreateMarketsResponse(); - return message; - }, -}; -function createBaseMsgUpdateMarkets(): MsgUpdateMarkets { - return { - authority: "", - updateMarkets: [], - }; -} -export const MsgUpdateMarkets = { - typeUrl: "/slinky.marketmap.v1.MsgUpdateMarkets", - encode(message: MsgUpdateMarkets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.authority !== "") { - writer.uint32(10).string(message.authority); - } - for (const v of message.updateMarkets) { - Market.encode(v!, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarkets { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateMarkets(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.authority = reader.string(); - break; - case 2: - message.updateMarkets.push(Market.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(object: any): MsgUpdateMarkets { - const obj = createBaseMsgUpdateMarkets(); - if (isSet(object.authority)) obj.authority = String(object.authority); - if (Array.isArray(object?.updateMarkets)) - obj.updateMarkets = object.updateMarkets.map((e: any) => Market.fromJSON(e)); - return obj; - }, - toJSON(message: MsgUpdateMarkets): JsonSafe { - const obj: any = {}; - message.authority !== undefined && (obj.authority = message.authority); - if (message.updateMarkets) { - obj.updateMarkets = message.updateMarkets.map((e) => (e ? Market.toJSON(e) : undefined)); - } else { - obj.updateMarkets = []; - } - return obj; - }, - fromPartial, I>>(object: I): MsgUpdateMarkets { - const message = createBaseMsgUpdateMarkets(); - message.authority = object.authority ?? ""; - message.updateMarkets = object.updateMarkets?.map((e) => Market.fromPartial(e)) || []; - return message; - }, -}; -function createBaseMsgUpdateMarketsResponse(): MsgUpdateMarketsResponse { - return {}; -} -export const MsgUpdateMarketsResponse = { - typeUrl: "/slinky.marketmap.v1.MsgUpdateMarketsResponse", - encode(_: MsgUpdateMarketsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateMarketsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateMarketsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(_: any): MsgUpdateMarketsResponse { - const obj = createBaseMsgUpdateMarketsResponse(); - return obj; - }, - toJSON(_: MsgUpdateMarketsResponse): JsonSafe { - const obj: any = {}; - return obj; - }, - fromPartial, I>>(_: I): MsgUpdateMarketsResponse { - const message = createBaseMsgUpdateMarketsResponse(); - return message; - }, -}; -function createBaseMsgParams(): MsgParams { - return { - params: Params.fromPartial({}), - authority: "", - }; -} -export const MsgParams = { - typeUrl: "/slinky.marketmap.v1.MsgParams", - encode(message: MsgParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(10).fork()).ldelim(); - } - if (message.authority !== "") { - writer.uint32(18).string(message.authority); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgParams { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.params = Params.decode(reader, reader.uint32()); - break; - case 2: - message.authority = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(object: any): MsgParams { - const obj = createBaseMsgParams(); - if (isSet(object.params)) obj.params = Params.fromJSON(object.params); - if (isSet(object.authority)) obj.authority = String(object.authority); - return obj; - }, - toJSON(message: MsgParams): JsonSafe { - const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - message.authority !== undefined && (obj.authority = message.authority); - return obj; - }, - fromPartial, I>>(object: I): MsgParams { - const message = createBaseMsgParams(); - if (object.params !== undefined && object.params !== null) { - message.params = Params.fromPartial(object.params); - } - message.authority = object.authority ?? ""; - return message; - }, -}; -function createBaseMsgParamsResponse(): MsgParamsResponse { - return {}; -} -export const MsgParamsResponse = { - typeUrl: "/slinky.marketmap.v1.MsgParamsResponse", - encode(_: MsgParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgParamsResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgParamsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(_: any): MsgParamsResponse { - const obj = createBaseMsgParamsResponse(); - return obj; - }, - toJSON(_: MsgParamsResponse): JsonSafe { - const obj: any = {}; - return obj; - }, - fromPartial, I>>(_: I): MsgParamsResponse { - const message = createBaseMsgParamsResponse(); - return message; - }, -}; -function createBaseMsgRemoveMarketAuthorities(): MsgRemoveMarketAuthorities { - return { - removeAddresses: [], - admin: "", - }; -} -export const MsgRemoveMarketAuthorities = { - typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthorities", - encode(message: MsgRemoveMarketAuthorities, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.removeAddresses) { - writer.uint32(10).string(v!); - } - if (message.admin !== "") { - writer.uint32(18).string(message.admin); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveMarketAuthorities { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRemoveMarketAuthorities(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.removeAddresses.push(reader.string()); - break; - case 2: - message.admin = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(object: any): MsgRemoveMarketAuthorities { - const obj = createBaseMsgRemoveMarketAuthorities(); - if (Array.isArray(object?.removeAddresses)) - obj.removeAddresses = object.removeAddresses.map((e: any) => String(e)); - if (isSet(object.admin)) obj.admin = String(object.admin); - return obj; - }, - toJSON(message: MsgRemoveMarketAuthorities): JsonSafe { - const obj: any = {}; - if (message.removeAddresses) { - obj.removeAddresses = message.removeAddresses.map((e) => e); - } else { - obj.removeAddresses = []; - } - message.admin !== undefined && (obj.admin = message.admin); - return obj; - }, - fromPartial, I>>( - object: I, - ): MsgRemoveMarketAuthorities { - const message = createBaseMsgRemoveMarketAuthorities(); - message.removeAddresses = object.removeAddresses?.map((e) => e) || []; - message.admin = object.admin ?? ""; - return message; - }, -}; -function createBaseMsgRemoveMarketAuthoritiesResponse(): MsgRemoveMarketAuthoritiesResponse { - return {}; -} -export const MsgRemoveMarketAuthoritiesResponse = { - typeUrl: "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse", - encode(_: MsgRemoveMarketAuthoritiesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveMarketAuthoritiesResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgRemoveMarketAuthoritiesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromJSON(_: any): MsgRemoveMarketAuthoritiesResponse { - const obj = createBaseMsgRemoveMarketAuthoritiesResponse(); - return obj; - }, - toJSON(_: MsgRemoveMarketAuthoritiesResponse): JsonSafe { - const obj: any = {}; - return obj; - }, - fromPartial, I>>( - _: I, - ): MsgRemoveMarketAuthoritiesResponse { - const message = createBaseMsgRemoveMarketAuthoritiesResponse(); - return message; - }, -}; diff --git a/src/slinky/rpc.tx.ts b/src/slinky/rpc.tx.ts index c2fefe8..ba5e966 100644 --- a/src/slinky/rpc.tx.ts +++ b/src/slinky/rpc.tx.ts @@ -62,9 +62,6 @@ export const createRPCMsgClient = async ({ rpc }: { rpc: Rpc }) => ({ alerts: { v1: new (await import("./alerts/v1/tx.rpc.msg")).MsgClientImpl(rpc), }, - marketmap: { - v1: new (await import("./marketmap/v1/tx.rpc.msg")).MsgClientImpl(rpc), - }, oracle: { v1: new (await import("./oracle/v1/tx.rpc.msg")).MsgClientImpl(rpc), }, diff --git a/src/slinky/service/v1/oracle.ts b/src/slinky/service/v1/oracle.ts index e765c75..4e0a688 100644 --- a/src/slinky/service/v1/oracle.ts +++ b/src/slinky/service/v1/oracle.ts @@ -13,19 +13,29 @@ export interface QueryPricesResponse_PricesEntry { } /** QueryPricesResponse defines the response type for the Prices method. */ export interface QueryPricesResponse { - /** prices defines the list of prices. */ + /** Prices defines the list of prices. */ prices: { [key: string]: string; }; + /** Timestamp defines the timestamp of the prices. */ timestamp: Timestamp; + /** Version defines the version of the oracle service that provided the prices. */ + version: string; } /** QueryMarketMapRequest defines the request type for the MarketMap method. */ export interface QueryMarketMapRequest {} /** QueryMarketMapResponse defines the response type for the MarketMap method. */ export interface QueryMarketMapResponse { - /** market_map defines the current market map configuration. */ + /** MarketMap defines the current market map configuration. */ marketMap?: MarketMap; } +/** QueryVersionRequest defines the request type for the Version method. */ +export interface QueryVersionRequest {} +/** QueryVersionResponse defines the response type for the Version method. */ +export interface QueryVersionResponse { + /** Version defines the current version of the oracle service. */ + version: string; +} function createBaseQueryPricesRequest(): QueryPricesRequest { return {}; } @@ -125,6 +135,7 @@ function createBaseQueryPricesResponse(): QueryPricesResponse { return { prices: {}, timestamp: Timestamp.fromPartial({}), + version: "", }; } export const QueryPricesResponse = { @@ -142,6 +153,9 @@ export const QueryPricesResponse = { if (message.timestamp !== undefined) { Timestamp.encode(message.timestamp, writer.uint32(18).fork()).ldelim(); } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryPricesResponse { @@ -160,6 +174,9 @@ export const QueryPricesResponse = { case 2: message.timestamp = Timestamp.decode(reader, reader.uint32()); break; + case 3: + message.version = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -177,6 +194,7 @@ export const QueryPricesResponse = { return acc; }, {}); if (isSet(object.timestamp)) obj.timestamp = fromJsonTimestamp(object.timestamp); + if (isSet(object.version)) obj.version = String(object.version); return obj; }, toJSON(message: QueryPricesResponse): JsonSafe { @@ -188,6 +206,7 @@ export const QueryPricesResponse = { }); } message.timestamp !== undefined && (obj.timestamp = fromTimestamp(message.timestamp).toISOString()); + message.version !== undefined && (obj.version = message.version); return obj; }, fromPartial, I>>(object: I): QueryPricesResponse { @@ -203,6 +222,7 @@ export const QueryPricesResponse = { if (object.timestamp !== undefined && object.timestamp !== null) { message.timestamp = Timestamp.fromPartial(object.timestamp); } + message.version = object.version ?? ""; return message; }, }; @@ -290,3 +310,84 @@ export const QueryMarketMapResponse = { return message; }, }; +function createBaseQueryVersionRequest(): QueryVersionRequest { + return {}; +} +export const QueryVersionRequest = { + typeUrl: "/slinky.service.v1.QueryVersionRequest", + encode(_: QueryVersionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVersionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVersionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryVersionRequest { + const obj = createBaseQueryVersionRequest(); + return obj; + }, + toJSON(_: QueryVersionRequest): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial, I>>(_: I): QueryVersionRequest { + const message = createBaseQueryVersionRequest(); + return message; + }, +}; +function createBaseQueryVersionResponse(): QueryVersionResponse { + return { + version: "", + }; +} +export const QueryVersionResponse = { + typeUrl: "/slinky.service.v1.QueryVersionResponse", + encode(message: QueryVersionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVersionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVersionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryVersionResponse { + const obj = createBaseQueryVersionResponse(); + if (isSet(object.version)) obj.version = String(object.version); + return obj; + }, + toJSON(message: QueryVersionResponse): JsonSafe { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version); + return obj; + }, + fromPartial, I>>(object: I): QueryVersionResponse { + const message = createBaseQueryVersionResponse(); + message.version = object.version ?? ""; + return message; + }, +}; From 32a34d6b45a976dd292cbcbb34f8f53b80023560 Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Fri, 20 Sep 2024 14:21:28 +0300 Subject: [PATCH 5/9] readme edits --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0cd9a99..88d03da 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Cosmjs types for users of Neutron chain. -https://www.neutron.org/ + Version of this package is synced with Neutron chain version. @@ -25,6 +25,15 @@ npm install ### Rebuilding types ```sh -npm run codegen # Generate .ts files into ./src -npm run build # Build .js/.d.ts files +# Generate .ts files into ./src +npm run codegen + +# Build .js/.d.ts files +npm run build +``` + +### Removing all unnecessary folders and files + +```sh +npm run clean ``` From 855b703fcbc57ac22d1cfba1de886023269125eb Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Fri, 20 Sep 2024 15:28:22 +0300 Subject: [PATCH 6/9] allow users to choose submodules versions --- README.md | 3 +++ package.json | 1 + scripts/set-versions.sh | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100755 scripts/set-versions.sh diff --git a/README.md b/README.md index 88d03da..ab31ae6 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ git submodule update --init --recursive # Install dependencies npm install + +# Set specified versions for submodules +npm run set-versions ``` ### Rebuilding types diff --git a/package.json b/package.json index 9ea1d59..b8d82dd 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "!cosmos-sdk-*/**/*.md" ], "scripts": { + "set-versions": "./scripts/set-versions.sh", "format": "prettier --write --log-level warn \"./src/**/*.ts\" \"./scripts/**/*.js\"", "precodegen": "./scripts/exports_protos.sh", "codegen": "rm -rf ./src && ./scripts/codegen.js && cp -rf copypaste_files/* ./src/ && npm run format", diff --git a/scripts/set-versions.sh b/scripts/set-versions.sh new file mode 100755 index 0000000..6f07e1f --- /dev/null +++ b/scripts/set-versions.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +readonly ADMIN_MODULE_DIR="admin-module-src" +readonly BLOCK_SDK_DIR="block-sdk-src" +readonly COSMOS_SDK_DIR="cosmos-sdk-src" +readonly FEEMARKET_DIR="feemarket-src" +readonly IBC_GO_DIR="ibc-go-src" +readonly NEUTRON_DIR="neutron-src" +readonly SLINKY_DIR="slinky-src" +readonly WASMD_DIR="wasmd-src" + +readonly ADMIN_MODULE_REV="v2.0.2" +readonly BLOCK_SDK_REV="v2.1.5" +readonly COSMOS_SDK_REV="v0.50.9-neutron" +readonly FEEMARKET_REV="v1.1.1" +readonly IBC_GO_REV="v8.5.1" +readonly NEUTRON_REV="feat/choose-cron-blocker-2" +readonly SLINKY_REV="v1.0.12" +readonly WASMD_REV="v0.51.2-neutron" + +checkout_version () { + git -C protos/$1 checkout $2 +} + +checkout_version $ADMIN_MODULE_DIR $ADMIN_MODULE_REV +checkout_version $BLOCK_SDK_DIR $BLOCK_SDK_REV +checkout_version $COSMOS_SDK_DIR $COSMOS_SDK_REV +checkout_version $FEEMARKET_DIR $FEEMARKET_REV +checkout_version $IBC_GO_DIR $IBC_GO_REV +checkout_version $NEUTRON_DIR $NEUTRON_REV +checkout_version $SLINKY_DIR $SLINKY_REV +checkout_version $WASMD_DIR $WASMD_REV From a01c91ed21553df64a2700da21b803b3c44bcce7 Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Mon, 7 Oct 2024 13:04:12 +0300 Subject: [PATCH 7/9] update readme && move clean after build --- README.md | 7 +------ package.json | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ab31ae6..a85e186 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ git submodule update --init --recursive npm install # Set specified versions for submodules +# Submodules versions (commits or tags) should be set in the ./scripts/set-versions.sh script for the corresponding *_REV constants npm run set-versions ``` @@ -34,9 +35,3 @@ npm run codegen # Build .js/.d.ts files npm run build ``` - -### Removing all unnecessary folders and files - -```sh -npm run clean -``` diff --git a/package.json b/package.json index b8d82dd..ef5cda5 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "precodegen": "./scripts/exports_protos.sh", "codegen": "rm -rf ./src && ./scripts/codegen.js && cp -rf copypaste_files/* ./src/ && npm run format", "prepare-publishing": "./scripts/prepare-publishing.sh", - "build": "rm -rf ./build && tsc && npm run prepare-publishing", - "clean": "./scripts/clean.sh" + "clean": "./scripts/clean.sh", + "build": "rm -rf ./build && tsc && npm run prepare-publishing && npm run clean" }, "dependencies": {}, "devDependencies": { From 8f7805c866a2825b2ce3f7220a74d89cda440260 Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Tue, 8 Oct 2024 11:13:51 +0300 Subject: [PATCH 8/9] update Neutron rev --- scripts/set-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/set-versions.sh b/scripts/set-versions.sh index 6f07e1f..c879a54 100755 --- a/scripts/set-versions.sh +++ b/scripts/set-versions.sh @@ -17,7 +17,7 @@ readonly BLOCK_SDK_REV="v2.1.5" readonly COSMOS_SDK_REV="v0.50.9-neutron" readonly FEEMARKET_REV="v1.1.1" readonly IBC_GO_REV="v8.5.1" -readonly NEUTRON_REV="feat/choose-cron-blocker-2" +readonly NEUTRON_REV="v4.2.4" readonly SLINKY_REV="v1.0.12" readonly WASMD_REV="v0.51.2-neutron" From 3a88c35f7b5e9d1b7521db707e3d38ad225e8727 Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Tue, 8 Oct 2024 11:25:42 +0300 Subject: [PATCH 9/9] update Neutron rev && regen --- protos/neutron-src | 2 +- scripts/set-versions.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/protos/neutron-src b/protos/neutron-src index 6df5f6b..a319222 160000 --- a/protos/neutron-src +++ b/protos/neutron-src @@ -1 +1 @@ -Subproject commit 6df5f6b15c1f34c1ee4f72e2a2fee19ad4b9b656 +Subproject commit a319222034843a91c9d6500dc75f7b633debfa45 diff --git a/scripts/set-versions.sh b/scripts/set-versions.sh index c879a54..fc33602 100755 --- a/scripts/set-versions.sh +++ b/scripts/set-versions.sh @@ -17,7 +17,7 @@ readonly BLOCK_SDK_REV="v2.1.5" readonly COSMOS_SDK_REV="v0.50.9-neutron" readonly FEEMARKET_REV="v1.1.1" readonly IBC_GO_REV="v8.5.1" -readonly NEUTRON_REV="v4.2.4" +readonly NEUTRON_REV="main" readonly SLINKY_REV="v1.0.12" readonly WASMD_REV="v0.51.2-neutron"