Skip to content

Commit

Permalink
Merge pull request #1031 from oraidex/pumb-version-cosmjs
Browse files Browse the repository at this point in the history
pumb cosmjs mainnet v0.50
  • Loading branch information
haunv3 authored Nov 12, 2024
2 parents f475488 + 75b8611 commit 045bf91
Show file tree
Hide file tree
Showing 7 changed files with 335 additions and 201 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"type": "module",
"dependencies": {
"@babel/plugin-proposal-import-wasm-source": "^7.24.7",
"@cosmjs/cosmwasm-stargate": "^0.31.0",
"@cosmjs/proto-signing": "^0.31.0",
"@cosmjs/stargate": "^0.31.0",
"@cosmjs/tendermint-rpc": "^0.31.0",
"@cosmjs/cosmwasm-stargate": "^0.32.4",
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
"@cosmjs/tendermint-rpc": "^0.32.4",
"@duckdb/duckdb-wasm": "1.28.0",
"@injectivelabs/sdk-ts": "1.12.1",
"@keplr-wallet/unit": "0.10.24-ibc.go.v7.hot.fix",
Expand All @@ -24,8 +24,8 @@
"@oraichain/kawaiiverse-txs": "^0.0.3",
"@oraichain/orai-bitcoin": "2.0.0",
"@oraichain/oraidex-common-ui": "1.0.11",
"@oraichain/oraidex-contracts-sdk": "1.0.51-beta.3",
"@oraichain/oraidex-universal-swap": "1.1.19",
"@oraichain/oraidex-contracts-sdk": "1.0.55",
"@oraichain/oraidex-universal-swap": "1.1.20",
"@react-spring/web": "^9.7.5",
"@reduxjs/toolkit": "^1.9.3",
"@sentry/react": "7.99.0",
Expand Down Expand Up @@ -83,7 +83,7 @@
"@oraichain/common-contracts-build": "1.0.35",
"@oraichain/cw-simulate": "^2.8.75",
"@oraichain/oraidex-contracts-build": "1.0.22",
"@oraichain/oraiswap-v3": "0.1.22",
"@oraichain/oraiswap-v3": "1.1.0",
"@sentry/webpack-plugin": "^2.10.3",
"@testing-library/jest-dom": "^6.5.0",
"@types/classnames": "^2.2.10",
Expand Down Expand Up @@ -150,7 +150,7 @@
"bitcoinjs-lib": "5.2.0",
"axios": "0.26.1",
"@sentry/react": "7.99.0",
"@oraichain/oraidex-common": "1.1.28"
"@oraichain/oraidex-common": "1.1.29"
},
"engines": {
"node": "^18 || ^20"
Expand Down
51 changes: 0 additions & 51 deletions patches/@cosmjs+cosmwasm-stargate+0.31.1.patch

This file was deleted.

64 changes: 64 additions & 0 deletions patches/@cosmjs+cosmwasm-stargate+0.32.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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<string>;
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);
49 changes: 0 additions & 49 deletions patches/@cosmjs+proto-signing+0.31.1.patch

This file was deleted.

72 changes: 72 additions & 0 deletions patches/@cosmjs+stargate+0.32.4.patch
Original file line number Diff line number Diff line change
@@ -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<Uint8Array>;
}
-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(),
26 changes: 0 additions & 26 deletions patches/@cosmjs+tendermint-rpc+0.31.3.patch

This file was deleted.

Loading

0 comments on commit 045bf91

Please sign in to comment.