diff --git a/patches/@cosmjs+cosmwasm-stargate+0.31.3.patch b/patches/@cosmjs+cosmwasm-stargate+0.31.3.patch deleted file mode 100644 index b162100..0000000 --- a/patches/@cosmjs+cosmwasm-stargate+0.31.3.patch +++ /dev/null @@ -1,87 +0,0 @@ -diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.d.ts b/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.d.ts -index 3aebdc5..7fa6509 100644 ---- a/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.d.ts -+++ b/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.d.ts -@@ -1,5 +1,6 @@ - import { Account, AuthExtension, BankExtension, Block, Coin, DeliverTxResponse, IndexedTx, QueryClient, SearchTxQuery, SequenceResponse, TxExtension } from "@cosmjs/stargate"; - import { HttpEndpoint, TendermintClient } from "@cosmjs/tendermint-rpc"; -+import { QueryAllContractStateResponse } from "cosmjs-types/cosmwasm/wasm/v1/query"; - import { JsonObject, WasmExtension } from "./modules"; - export interface Code { - readonly id: number; -@@ -49,7 +50,7 @@ export declare class CosmWasmClient { - * This uses auto-detection to decide between a Tendermint 0.37 and 0.34 client. - * To set the Tendermint client explicitly, use `create`. - */ -- static connect(endpoint: string | HttpEndpoint): Promise; -+ static connect(endpoint: string | HttpEndpoint, desiredHeight?: number): Promise; - /** - * Creates an instance from a manually created Tendermint client. - * Use this to use `Tendermint37Client` instead of `Tendermint34Client`. -@@ -136,5 +137,6 @@ export declare class CosmWasmClient { - * Promise is rejected for invalid response format. - */ - queryContractSmart(address: string, queryMsg: JsonObject): Promise; -+ getAllContractState(address: string, paginationKey: Uint8Array): Promise; - private txsQuery; - } -diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.js b/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.js -index 8f6305b..093a700 100644 ---- a/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.js -+++ b/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.js -@@ -17,18 +17,18 @@ class CosmWasmClient { - * This uses auto-detection to decide between a Tendermint 0.37 and 0.34 client. - * To set the Tendermint client explicitly, use `create`. - */ -- static async connect(endpoint) { -+ static async connect(endpoint, desiredHeight) { - // Tendermint/CometBFT 0.34/0.37 auto-detection. Starting with 0.37 we seem to get reliable versions again 🎉 - // Using 0.34 as the fallback. - let tmClient; -- const tm37Client = await tendermint_rpc_1.Tendermint37Client.connect(endpoint); -+ const tm37Client = await tendermint_rpc_1.Tendermint37Client.connect(endpoint, desiredHeight); - const version = (await tm37Client.status()).nodeInfo.version; - if (version.startsWith("0.37.")) { - tmClient = tm37Client; - } - else { - tm37Client.disconnect(); -- tmClient = await tendermint_rpc_1.Tendermint34Client.connect(endpoint); -+ tmClient = await tendermint_rpc_1.Tendermint34Client.connect(endpoint, desiredHeight); - } - return CosmWasmClient.create(tmClient); - } -@@ -351,6 +351,33 @@ class CosmWasmClient { - } - } - } -+ -+ /** -+ * Makes a smart query on the contract, returns the parsed JSON document. -+ * -+ * Promise is rejected when contract does not exist. -+ * Promise is rejected for invalid query format. -+ * Promise is rejected for invalid response format. -+ */ -+ async getAllContractState(address, paginationKey) { -+ try { -+ return await this.forceGetQueryClient().wasm.getAllContractState(address, paginationKey); -+ } -+ catch (error) { -+ if (error instanceof Error) { -+ if (error.message.startsWith("not found: contract")) { -+ throw new Error(`No contract found at address "${address}"`); -+ } -+ else { -+ throw error; -+ } -+ } -+ else { -+ throw error; -+ } -+ } -+ } -+ - async txsQuery(query) { - const results = await this.forceGetTmClient().txSearchAll({ query: query }); - return results.txs.map((tx) => { diff --git a/patches/@cosmjs+cosmwasm-stargate+0.32.4.patch b/patches/@cosmjs+cosmwasm-stargate+0.32.4.patch new file mode 100644 index 0000000..4da5cf7 --- /dev/null +++ b/patches/@cosmjs+cosmwasm-stargate+0.32.4.patch @@ -0,0 +1,80 @@ +diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.d.ts b/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.d.ts +index a770785..3f427c8 100644 +--- a/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.d.ts ++++ b/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.d.ts +@@ -58,6 +58,7 @@ export declare class CosmWasmClient { + protected constructor(cometClient: CometClient | undefined); + protected getCometClient(): CometClient | undefined; + protected forceGetCometClient(): CometClient; ++ public setQueryClientWithHeight(height?: number): void; + protected getQueryClient(): (QueryClient & AuthExtension & BankExtension & TxExtension & WasmExtension) | undefined; + protected forceGetQueryClient(): QueryClient & AuthExtension & BankExtension & TxExtension & WasmExtension; + getChainId(): Promise; +diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.js b/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.js +index af8341d..bc91fbc 100644 +--- a/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.js ++++ b/node_modules/@cosmjs/cosmwasm-stargate/build/cosmwasmclient.js +@@ -35,6 +35,13 @@ class CosmWasmClient { + this.queryClient = stargate_1.QueryClient.withExtensions(cometClient, stargate_1.setupAuthExtension, stargate_1.setupBankExtension, modules_1.setupWasmExtension, stargate_1.setupTxExtension); + } + } ++ ++ setQueryClientWithHeight(height = undefined) { ++ if (this.tmClient) { ++ this.queryClient = stargate_1.QueryClient.withExtensionsWithHeight(this.tmClient, height, stargate_1.setupAuthExtension, stargate_1.setupBankExtension, modules_1.setupWasmExtension, stargate_1.setupTxExtension); ++ } ++ } ++ + getCometClient() { + return this.cometClient; + } +@@ -120,12 +127,12 @@ class CosmWasmClient { + else if ((0, stargate_1.isSearchTxQueryArray)(query)) { + rawQuery = query + .map((t) => { +- // numeric values must not have quotes https://github.com/cosmos/cosmjs/issues/1462 +- if (typeof t.value === "string") +- return `${t.key}='${t.value}'`; +- else +- return `${t.key}=${t.value}`; +- }) ++ // numeric values must not have quotes https://github.com/cosmos/cosmjs/issues/1462 ++ if (typeof t.value === "string") ++ return `${t.key}='${t.value}'`; ++ else ++ return `${t.key}=${t.value}`; ++ }) + .join(" AND "); + } + else { +diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/modules/wasm/queries.js b/node_modules/@cosmjs/cosmwasm-stargate/build/modules/wasm/queries.js +index e5bf448..878f7e4 100644 +--- a/node_modules/@cosmjs/cosmwasm-stargate/build/modules/wasm/queries.js ++++ b/node_modules/@cosmjs/cosmwasm-stargate/build/modules/wasm/queries.js +@@ -4,8 +4,8 @@ exports.setupWasmExtension = void 0; + const encoding_1 = require("@cosmjs/encoding"); + const stargate_1 = require("@cosmjs/stargate"); + const query_1 = require("cosmjs-types/cosmwasm/wasm/v1/query"); +-function setupWasmExtension(base) { +- const rpc = (0, stargate_1.createProtobufRpcClient)(base); ++function setupWasmExtension(base, height) { ++ const rpc = (0, stargate_1.createProtobufRpcClient)(base, height); + // Use this service to get easy typed access to query methods + // This cannot be used for proof verification + const queryService = new query_1.QueryClientImpl(rpc); +diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js +index 6eb95bb..24d3038 100644 +--- a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js ++++ b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js +@@ -397,7 +397,10 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient { + throw new Error("Failed to retrieve account from signer"); + } + const pubkey = (0, proto_signing_1.encodePubkey)((0, amino_1.encodeSecp256k1Pubkey)(accountFromSigner.pubkey)); +- const signMode = signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON; ++ let signMode = signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON; ++ if (this.signer.signEip191) { ++ signMode = signing_1.SignMode.SIGN_MODE_EIP_191; ++ } + const msgs = messages.map((msg) => this.aminoTypes.toAmino(msg)); + const signDoc = (0, amino_1.makeSignDoc)(msgs, fee, chainId, memo, accountNumber, sequence, timeoutHeight); + const { signature, signed } = await this.signer.signAmino(signerAddress, signDoc); diff --git a/patches/@cosmjs+stargate+0.31.3.patch b/patches/@cosmjs+stargate+0.31.3.patch deleted file mode 100644 index 279ef09..0000000 --- a/patches/@cosmjs+stargate+0.31.3.patch +++ /dev/null @@ -1,87 +0,0 @@ -diff --git a/node_modules/@cosmjs/stargate/build/queryclient/utils.js b/node_modules/@cosmjs/stargate/build/queryclient/utils.js -index 6f4ecaa..b4f6d6b 100644 ---- a/node_modules/@cosmjs/stargate/build/queryclient/utils.js -+++ b/node_modules/@cosmjs/stargate/build/queryclient/utils.js -@@ -32,7 +32,7 @@ function createProtobufRpcClient(base) { - return { - request: async (service, method, data) => { - const path = `/${service}/${method}`; -- const response = await base.queryAbci(path, data, undefined); -+ const response = await base.queryAbci(path, data, base.tmClient.desiredHeight); - return response.value; - }, - }; -diff --git a/node_modules/@cosmjs/stargate/build/signingstargateclient.d.ts b/node_modules/@cosmjs/stargate/build/signingstargateclient.d.ts -index b8ca38c..e954160 100644 ---- a/node_modules/@cosmjs/stargate/build/signingstargateclient.d.ts -+++ b/node_modules/@cosmjs/stargate/build/signingstargateclient.d.ts -@@ -28,6 +28,7 @@ export interface SigningStargateClientOptions extends StargateClientOptions { - readonly broadcastTimeoutMs?: number; - readonly broadcastPollIntervalMs?: number; - readonly gasPrice?: GasPrice; -+ readonly desiredHeight?: number; - } - export declare function createDefaultAminoConverters(): AminoConverters; - export declare class SigningStargateClient extends StargateClient { -diff --git a/node_modules/@cosmjs/stargate/build/signingstargateclient.js b/node_modules/@cosmjs/stargate/build/signingstargateclient.js -index 4330b9f..4a470c3 100644 ---- a/node_modules/@cosmjs/stargate/build/signingstargateclient.js -+++ b/node_modules/@cosmjs/stargate/build/signingstargateclient.js -@@ -58,14 +58,14 @@ class SigningStargateClient extends stargateclient_1.StargateClient { - // Tendermint/CometBFT 0.34/0.37 auto-detection. Starting with 0.37 we seem to get reliable versions again 🎉 - // Using 0.34 as the fallback. - let tmClient; -- const tm37Client = await tendermint_rpc_1.Tendermint37Client.connect(endpoint); -+ const tm37Client = await tendermint_rpc_1.Tendermint37Client.connect(endpoint, options.desiredHeight); - const version = (await tm37Client.status()).nodeInfo.version; - if (version.startsWith("0.37.")) { - tmClient = tm37Client; - } - else { - tm37Client.disconnect(); -- tmClient = await tendermint_rpc_1.Tendermint34Client.connect(endpoint); -+ tmClient = await tendermint_rpc_1.Tendermint34Client.connect(endpoint, options.desiredHeight); - } - return SigningStargateClient.createWithSigner(tmClient, signer, options); - } -diff --git a/node_modules/@cosmjs/stargate/build/stargateclient.d.ts b/node_modules/@cosmjs/stargate/build/stargateclient.d.ts -index 0cd6feb..b5fc618 100644 ---- a/node_modules/@cosmjs/stargate/build/stargateclient.d.ts -+++ b/node_modules/@cosmjs/stargate/build/stargateclient.d.ts -@@ -137,6 +137,7 @@ export interface PrivateStargateClient { - } - export interface StargateClientOptions { - readonly accountParser?: AccountParser; -+ readonly desiredHeight?: number; - } - export declare class StargateClient { - private readonly tmClient; -diff --git a/node_modules/@cosmjs/stargate/build/stargateclient.js b/node_modules/@cosmjs/stargate/build/stargateclient.js -index 3268b13..3845295 100644 ---- a/node_modules/@cosmjs/stargate/build/stargateclient.js -+++ b/node_modules/@cosmjs/stargate/build/stargateclient.js -@@ -70,14 +70,14 @@ class StargateClient { - // Tendermint/CometBFT 0.34/0.37 auto-detection. Starting with 0.37 we seem to get reliable versions again 🎉 - // Using 0.34 as the fallback. - let tmClient; -- const tm37Client = await tendermint_rpc_1.Tendermint37Client.connect(endpoint); -+ const tm37Client = await tendermint_rpc_1.Tendermint37Client.connect(endpoint, options.desiredHeight); - const version = (await tm37Client.status()).nodeInfo.version; - if (version.startsWith("0.37.")) { - tmClient = tm37Client; - } - else { - tm37Client.disconnect(); -- tmClient = await tendermint_rpc_1.Tendermint34Client.connect(endpoint); -+ tmClient = await tendermint_rpc_1.Tendermint34Client.connect(endpoint, options.desiredHeight); - } - return StargateClient.create(tmClient, options); - } -@@ -299,6 +299,7 @@ class StargateClient { - return results.txs.map((tx) => { - const txMsgData = abci_1.TxMsgData.decode(tx.result.data ?? new Uint8Array()); - return { -+ ...tx, - height: tx.height, - txIndex: tx.index, - hash: (0, encoding_1.toHex)(tx.hash).toUpperCase(), diff --git a/patches/@cosmjs+stargate+0.32.4.patch b/patches/@cosmjs+stargate+0.32.4.patch new file mode 100644 index 0000000..667a8c4 --- /dev/null +++ b/patches/@cosmjs+stargate+0.32.4.patch @@ -0,0 +1,72 @@ +diff --git a/node_modules/@cosmjs/stargate/build/queryclient/queryclient.js b/node_modules/@cosmjs/stargate/build/queryclient/queryclient.js +index 634b2e5..c2daa9c 100644 +--- a/node_modules/@cosmjs/stargate/build/queryclient/queryclient.js ++++ b/node_modules/@cosmjs/stargate/build/queryclient/queryclient.js +@@ -32,6 +32,24 @@ class QueryClient { + } + return client; + } ++ ++ static withExtensionsWithHeight(cometClient, height, ...extensionSetups) { ++ const client = new QueryClient(cometClient, height); ++ const extensions = extensionSetups.map((setupExtension) => setupExtension(client, height)); ++ for (const extension of extensions) { ++ (0, utils_1.assert)((0, utils_1.isNonNullObject)(extension), `Extension must be a non-null object`); ++ for (const [moduleKey, moduleValue] of Object.entries(extension)) { ++ (0, utils_1.assert)((0, utils_1.isNonNullObject)(moduleValue), `Module must be a non-null object. Found type ${typeof moduleValue} for module "${moduleKey}".`); ++ const current = client[moduleKey] || {}; ++ client[moduleKey] = { ++ ...current, ++ ...moduleValue, ++ }; ++ } ++ } ++ return client; ++ } ++ + constructor(cometClient) { + this.cometClient = cometClient; + } +diff --git a/node_modules/@cosmjs/stargate/build/queryclient/utils.d.ts b/node_modules/@cosmjs/stargate/build/queryclient/utils.d.ts +index ec5b471..92d5737 100644 +--- a/node_modules/@cosmjs/stargate/build/queryclient/utils.d.ts ++++ b/node_modules/@cosmjs/stargate/build/queryclient/utils.d.ts +@@ -18,7 +18,7 @@ export declare function createPagination(paginationKey?: Uint8Array): PageReques + export interface ProtobufRpcClient { + request(service: string, method: string, data: Uint8Array): Promise; + } +-export declare function createProtobufRpcClient(base: QueryClient): ProtobufRpcClient; ++export declare function createProtobufRpcClient(base: QueryClient, height?: number): ProtobufRpcClient; + /** + * Takes a uint64 value as string, number, BigInt or Uint64 and returns a BigInt + * of it. +diff --git a/node_modules/@cosmjs/stargate/build/queryclient/utils.js b/node_modules/@cosmjs/stargate/build/queryclient/utils.js +index ea25080..a0cb539 100644 +--- a/node_modules/@cosmjs/stargate/build/queryclient/utils.js ++++ b/node_modules/@cosmjs/stargate/build/queryclient/utils.js +@@ -24,11 +24,11 @@ function createPagination(paginationKey) { + return paginationKey ? pagination_1.PageRequest.fromPartial({ key: paginationKey }) : pagination_1.PageRequest.fromPartial({}); + } + exports.createPagination = createPagination; +-function createProtobufRpcClient(base) { ++function createProtobufRpcClient(base, height = undefined) { + return { + request: async (service, method, data) => { + const path = `/${service}/${method}`; +- const response = await base.queryAbci(path, data, undefined); ++ const response = await base.queryAbci(path, data, height); + return response.value; + }, + }; +diff --git a/node_modules/@cosmjs/stargate/build/stargateclient.js b/node_modules/@cosmjs/stargate/build/stargateclient.js +index a6da130..0918f14 100644 +--- a/node_modules/@cosmjs/stargate/build/stargateclient.js ++++ b/node_modules/@cosmjs/stargate/build/stargateclient.js +@@ -297,6 +297,7 @@ class StargateClient { + return results.txs.map((tx) => { + const txMsgData = abci_1.TxMsgData.decode(tx.result.data ?? new Uint8Array()); + return { ++ ...tx, + height: tx.height, + txIndex: tx.index, + hash: (0, encoding_1.toHex)(tx.hash).toUpperCase(), diff --git a/patches/@cosmjs+tendermint-rpc+0.31.3.patch b/patches/@cosmjs+tendermint-rpc+0.31.3.patch deleted file mode 100644 index 34e5a12..0000000 --- a/patches/@cosmjs+tendermint-rpc+0.31.3.patch +++ /dev/null @@ -1,134 +0,0 @@ -diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.d.ts b/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.d.ts -index 533ef38..925fcf6 100644 ---- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.d.ts -+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.d.ts -@@ -8,11 +8,11 @@ export declare class Tendermint34Client { - * - * Uses HTTP when the URL schema is http or https. Uses WebSockets otherwise. - */ -- static connect(endpoint: string | HttpEndpoint): Promise; -+ static connect(endpoint: string | HttpEndpoint, desiredHeight?: number): Promise; - /** - * Creates a new Tendermint client given an RPC client. - */ -- static create(rpcClient: RpcClient): Promise; -+ static create(rpcClient: RpcClient, desiredHeight?: number): Promise; - private static detectVersion; - private readonly client; - private readonly p; -@@ -86,4 +86,5 @@ export declare class Tendermint34Client { - validatorsAll(height?: number): Promise; - private doCall; - private subscribe; -+ public desiredHeight: number; - } -diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js b/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js -index f822f39..3ab5384 100644 ---- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js -+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js -@@ -34,7 +34,7 @@ class Tendermint34Client { - * - * Uses HTTP when the URL schema is http or https. Uses WebSockets otherwise. - */ -- static async connect(endpoint) { -+ static async connect(endpoint, desiredHeight) { - let rpcClient; - if (typeof endpoint === "object") { - rpcClient = new rpcclients_1.HttpClient(endpoint); -@@ -48,13 +48,13 @@ class Tendermint34Client { - // while did not help. Thus we query the version as a way to say "hi" to the backend, - // even in cases where we don't use the result. - const _version = await this.detectVersion(rpcClient); -- return Tendermint34Client.create(rpcClient); -+ return Tendermint34Client.create(rpcClient, desiredHeight); - } - /** - * Creates a new Tendermint client given an RPC client. - */ -- static async create(rpcClient) { -- return new Tendermint34Client(rpcClient); -+ static async create(rpcClient, desiredHeight) { -+ return new Tendermint34Client(rpcClient, desiredHeight); - } - static async detectVersion(client) { - const req = (0, jsonrpc_1.createJsonRpcRequest)(requests.Method.Status); -@@ -72,10 +72,11 @@ class Tendermint34Client { - /** - * Use `Tendermint34Client.connect` or `Tendermint34Client.create` to create an instance. - */ -- constructor(client) { -+ constructor(client, desiredHeight) { - this.client = client; - this.p = adaptor_1.adaptor34.params; - this.r = adaptor_1.adaptor34.responses; -+ this.desiredHeight = desiredHeight; - } - disconnect() { - this.client.disconnect(); -diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.d.ts b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.d.ts -index 3752168..c9b8043 100644 ---- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.d.ts -+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.d.ts -@@ -8,11 +8,11 @@ export declare class Tendermint37Client { - * - * Uses HTTP when the URL schema is http or https. Uses WebSockets otherwise. - */ -- static connect(endpoint: string | HttpEndpoint): Promise; -+ static connect(endpoint: string | HttpEndpoint, desiredHeight?: number): Promise; - /** - * Creates a new Tendermint client given an RPC client. - */ -- static create(rpcClient: RpcClient): Promise; -+ static create(rpcClient: RpcClient, desiredHeight?: number): Promise; - private static detectVersion; - private readonly client; - private readonly p; -@@ -86,4 +86,5 @@ export declare class Tendermint37Client { - validatorsAll(height?: number): Promise; - private doCall; - private subscribe; -+ public desiredHeight: number; - } -diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.js b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.js -index 8f78cc6..892c417 100644 ---- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.js -+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.js -@@ -34,7 +34,7 @@ class Tendermint37Client { - * - * Uses HTTP when the URL schema is http or https. Uses WebSockets otherwise. - */ -- static async connect(endpoint) { -+ static async connect(endpoint, desiredHeight) { - let rpcClient; - if (typeof endpoint === "object") { - rpcClient = new rpcclients_1.HttpClient(endpoint); -@@ -48,13 +48,13 @@ class Tendermint37Client { - // while did not help. Thus we query the version as a way to say "hi" to the backend, - // even in cases where we don't use the result. - const _version = await this.detectVersion(rpcClient); -- return Tendermint37Client.create(rpcClient); -+ return Tendermint37Client.create(rpcClient, desiredHeight); - } - /** - * Creates a new Tendermint client given an RPC client. - */ -- static async create(rpcClient) { -- return new Tendermint37Client(rpcClient); -+ static async create(rpcClient, desiredHeight) { -+ return new Tendermint37Client(rpcClient, desiredHeight); - } - static async detectVersion(client) { - const req = (0, jsonrpc_1.createJsonRpcRequest)(requests.Method.Status); -@@ -72,10 +72,11 @@ class Tendermint37Client { - /** - * Use `Tendermint37Client.connect` or `Tendermint37Client.create` to create an instance. - */ -- constructor(client) { -+ constructor(client, desiredHeight) { - this.client = client; - this.p = adaptor_1.adaptor37.params; - this.r = adaptor_1.adaptor37.responses; -+ this.desiredHeight = desiredHeight - } - disconnect() { - this.client.disconnect(); diff --git a/patches/@cosmjs+tendermint-rpc+0.32.4.patch b/patches/@cosmjs+tendermint-rpc+0.32.4.patch new file mode 100644 index 0000000..d3efd73 --- /dev/null +++ b/patches/@cosmjs+tendermint-rpc+0.32.4.patch @@ -0,0 +1,37 @@ +diff --git a/node_modules/@cosmjs/tendermint-rpc/build/rpcclients/http.js b/node_modules/@cosmjs/tendermint-rpc/build/rpcclients/http.js +index 8c72817..2b810d2 100644 +--- a/node_modules/@cosmjs/tendermint-rpc/build/rpcclients/http.js ++++ b/node_modules/@cosmjs/tendermint-rpc/build/rpcclients/http.js +@@ -34,9 +34,11 @@ function isExperimental(nodeJsFunc) { + */ + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + async function http(method, url, headers, request) { ++ const timeout = Number(process.env.HTTP_TIMEOUT || 30000); + if (typeof fetch === "function" && !isExperimental(fetch)) { + const settings = { + method: method, ++ signal: AbortSignal.timeout(timeout), + body: request ? JSON.stringify(request) : undefined, + headers: { + // eslint-disable-next-line @typescript-eslint/naming-convention +@@ -50,7 +52,7 @@ async function http(method, url, headers, request) { + } + else { + return axios_1.default +- .request({ url: url, method: method, data: request, headers: headers }) ++ .request({ url: url, method: method, data: request, headers: headers, timeout: timeout }) + .then((res) => res.data); + } + } +diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js b/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js +index a426641..9f33204 100644 +--- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js ++++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/adaptor/responses.js +@@ -320,6 +320,7 @@ function decodeTxProof(data) { + } + function decodeTxResponse(data) { + return { ++ ...data, + tx: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.tx)), + result: decodeTxData((0, encodings_1.assertObject)(data.tx_result)), + height: (0, inthelpers_1.apiToSmallInt)((0, encodings_1.assertNotEmpty)(data.height)),