From 0eff5dbb31feecf0a84a28aedcac762f6048a222 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Tue, 12 Nov 2024 18:32:31 +0700 Subject: [PATCH 1/2] pumb cosmjs --- package.json | 14 +- .../@cosmjs+cosmwasm-stargate+0.31.1.patch | 51 ---- .../@cosmjs+cosmwasm-stargate+0.32.4.patch | 64 ++++ patches/@cosmjs+proto-signing+0.31.1.patch | 49 ---- patches/@cosmjs+stargate+0.32.4.patch | 72 +++++ patches/@cosmjs+tendermint-rpc+0.31.3.patch | 63 ---- yarn.lock | 273 +++++++++--------- 7 files changed, 279 insertions(+), 307 deletions(-) delete mode 100644 patches/@cosmjs+cosmwasm-stargate+0.31.1.patch create mode 100644 patches/@cosmjs+cosmwasm-stargate+0.32.4.patch delete mode 100644 patches/@cosmjs+proto-signing+0.31.1.patch create mode 100644 patches/@cosmjs+stargate+0.32.4.patch delete mode 100644 patches/@cosmjs+tendermint-rpc+0.31.3.patch diff --git a/package.json b/package.json index d6c154c0c..c4f72e109 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "author": "Oraichain Labs", "license": "Apache-2.0", "dependencies": { - "@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", "@leapwallet/cosmos-snap-provider": "0.1.25", @@ -123,7 +123,11 @@ "bech32": "1.1.4", "bitcoinjs-lib": "5.2.0", "axios": "0.26.1", - "@oraichain/oraidex-common": "1.1.28" + "@oraichain/oraidex-common": "1.1.28", + "@cosmjs/cosmwasm-stargate": "^0.32.4", + "@cosmjs/proto-signing": "^0.32.4", + "@cosmjs/stargate": "^0.32.4", + "@cosmjs/tendermint-rpc": "^0.32.4" }, "engines": { "node": "^18 || ^20" diff --git a/patches/@cosmjs+cosmwasm-stargate+0.31.1.patch b/patches/@cosmjs+cosmwasm-stargate+0.31.1.patch deleted file mode 100644 index 280007095..000000000 --- a/patches/@cosmjs+cosmwasm-stargate+0.31.1.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.d.ts b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.d.ts -index e0c0a30..3047021 100644 ---- a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.d.ts -+++ b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.d.ts -@@ -87,11 +87,22 @@ export interface ExecuteResult { - readonly logs: readonly logs.Log[]; - /** Block height in which the transaction is included */ - readonly height: number; -+ /** The position of the transaction within the block. This is a 0-based index. */ -+ readonly txIndex: number; - /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ - readonly transactionHash: string; - readonly events: readonly Event[]; - readonly gasWanted: number; - readonly gasUsed: number; -+ /** -+ * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) -+ * as `Any`s. -+ * This field is an empty list for chains running Cosmos SDK < 0.46. -+ */ -+ readonly msgResponses: Array<{ -+ readonly typeUrl: string; -+ readonly value: Uint8Array; -+ }>; - } - export interface SigningCosmWasmClientOptions { - readonly registry?: Registry; -diff --git a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js -index 646bbe7..01f9cad 100644 ---- a/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js -+++ b/node_modules/@cosmjs/cosmwasm-stargate/build/signingcosmwasmclient.js -@@ -274,6 +274,7 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient { - throw new Error(createDeliverTxResponseErrorMessage(result)); - } - return { -+ ...result, - logs: stargate_1.logs.parseRawLog(result.rawLog), - height: result.height, - transactionHash: result.transactionHash, -@@ -393,7 +394,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); - const { signature, signed } = await this.signer.signAmino(signerAddress, signDoc); 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 000000000..12b35992a --- /dev/null +++ b/patches/@cosmjs+cosmwasm-stargate+0.32.4.patch @@ -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; +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/patches/@cosmjs+proto-signing+0.31.1.patch b/patches/@cosmjs+proto-signing+0.31.1.patch deleted file mode 100644 index db4ed9a47..000000000 --- a/patches/@cosmjs+proto-signing+0.31.1.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/node_modules/@cosmjs/proto-signing/build/signer.d.ts b/node_modules/@cosmjs/proto-signing/build/signer.d.ts -index 71d6f72..0fadaf8 100644 ---- a/node_modules/@cosmjs/proto-signing/build/signer.d.ts -+++ b/node_modules/@cosmjs/proto-signing/build/signer.d.ts -@@ -19,5 +19,23 @@ export interface OfflineDirectSigner { - readonly getAccounts: () => Promise; - readonly signDirect: (signerAddress: string, signDoc: SignDoc) => Promise; - } --export type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner; -+ -+export interface OfflineEip191Signer { -+ /** -+ + * Get AccountData array from wallet. Rejects if not enabled. -+ + */ -+ readonly getAccounts: () => Promise; -+ /** -+ + * Request signature from whichever key corresponds to provided bech32-encoded address. Rejects if not enabled. -+ + * -+ + * The signer implementation may offer the user the ability to override parts of the signDoc. It must -+ + * return the doc that was signed in the response. -+ + * -+ + * @param signerAddress The address of the account that should sign the transaction -+ + * @param signDoc The content that should be signed -+ + */ -+ readonly signEip191: (signerAddress: string, signDoc: StdSignDoc) => Promise; -+} -+ -+export type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner | OfflineEip191Signer; - export declare function isOfflineDirectSigner(signer: OfflineSigner): signer is OfflineDirectSigner; -diff --git a/node_modules/@cosmjs/proto-signing/build/signer.js b/node_modules/@cosmjs/proto-signing/build/signer.js -index 5f3b8ee..4dd078c 100644 ---- a/node_modules/@cosmjs/proto-signing/build/signer.js -+++ b/node_modules/@cosmjs/proto-signing/build/signer.js -@@ -1,8 +1,14 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isOfflineDirectSigner = void 0; -+exports.isOfflineEip191Signer = void 0; - function isOfflineDirectSigner(signer) { - return signer.signDirect !== undefined; - } -+function isOfflineEip191Signer(signer) { -+ return signer.signEip191 !== undefined; -+} -+ - exports.isOfflineDirectSigner = isOfflineDirectSigner; -+exports.isOfflineEip191Signer = isOfflineEip191Signer; - //# sourceMappingURL=signer.js.map -\ No newline at end of file diff --git a/patches/@cosmjs+stargate+0.32.4.patch b/patches/@cosmjs+stargate+0.32.4.patch new file mode 100644 index 000000000..667a8c437 --- /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 726bc79dc..000000000 --- a/patches/@cosmjs+tendermint-rpc+0.31.3.patch +++ /dev/null @@ -1,63 +0,0 @@ -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)), -diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js b/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js -index f822f39..8889b81 100644 ---- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js -+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint34/tendermint34client.js -@@ -47,7 +47,7 @@ class Tendermint34Client { - // (our CI) when skipping the status call before doing other queries. Sleeping a little - // 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); -+ // const _version = await this.detectVersion(rpcClient); - return Tendermint34Client.create(rpcClient); - } - /** -diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.js b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.js -index 8f78cc6..a307de1 100644 ---- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.js -+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/tendermint37client.js -@@ -47,7 +47,7 @@ class Tendermint37Client { - // (our CI) when skipping the status call before doing other queries. Sleeping a little - // 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); -+ // const _version = await this.detectVersion(rpcClient); - return Tendermint37Client.create(rpcClient); - } - /** diff --git a/yarn.lock b/yarn.lock index 62c4f21eb..24e54322c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1245,7 +1245,7 @@ "@noble/hashes" "^1.0.0" protobufjs "^6.8.8" -"@cosmjs/amino@0.31.3", "@cosmjs/amino@^0.31.0", "@cosmjs/amino@^0.31.3": +"@cosmjs/amino@0.31.3", "@cosmjs/amino@^0.31.0": version "0.31.3" resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.31.3.tgz#0f4aa6bd68331c71bd51b187fa64f00eb075db0a" integrity sha512-36emtUq895sPRX8PTSOnG+lhJDCVyIcE0Tr5ct59sUbgQiI14y43vj/4WAlJ/utSOxy+Zhj9wxcs4AZfu0BHsw== @@ -1265,21 +1265,30 @@ "@cosmjs/math" "^0.30.1" "@cosmjs/utils" "^0.30.1" -"@cosmjs/cosmwasm-stargate@0.31.3", "@cosmjs/cosmwasm-stargate@^0.31.0": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.31.3.tgz#13066822f111832d57c2c5acc9e697ed389713f8" - integrity sha512-Uv9TmCn3650gdFeZm7SEfUZF3uX3lfJfFhXOk6I2ZLr/FrKximnlb+vwAfZaZnWYvlA7qrKtHIjeRNHvT23zcw== - dependencies: - "@cosmjs/amino" "^0.31.3" - "@cosmjs/crypto" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/proto-signing" "^0.31.3" - "@cosmjs/stargate" "^0.31.3" - "@cosmjs/tendermint-rpc" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - cosmjs-types "^0.8.0" - long "^4.0.0" +"@cosmjs/amino@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.4.tgz#3908946c0394e6d431694c8992c5147079a1c860" + integrity sha512-zKYOt6hPy8obIFtLie/xtygCkH9ZROiQ12UHfKsOkWaZfPQUvVbtgmu6R4Kn1tFLI/SRkw7eqhaogmW/3NYu/Q== + dependencies: + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + +"@cosmjs/cosmwasm-stargate@0.31.3", "@cosmjs/cosmwasm-stargate@^0.31.0", "@cosmjs/cosmwasm-stargate@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.32.4.tgz#2ee93f2cc0b1c146ac369b2bf8ef9ee2e159fd50" + integrity sha512-Fuo9BGEiB+POJ5WeRyBGuhyKR1ordvxZGLPuPosFJOH9U0gKMgcjwKMCgAlWFkMlHaTB+tNdA8AifWiHrI7VgA== + dependencies: + "@cosmjs/amino" "^0.32.4" + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/proto-signing" "^0.32.4" + "@cosmjs/stargate" "^0.32.4" + "@cosmjs/tendermint-rpc" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + cosmjs-types "^0.9.0" pako "^2.0.2" "@cosmjs/crypto@0.31.3", "@cosmjs/crypto@^0.31.0", "@cosmjs/crypto@^0.31.3": @@ -1308,6 +1317,19 @@ elliptic "^6.5.4" libsodium-wrappers "^0.7.6" +"@cosmjs/crypto@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.4.tgz#5d29633b661eaf092ddb3e7ea6299cfd6f4507a2" + integrity sha512-zicjGU051LF1V9v7bp8p7ovq+VyC91xlaHdsFOTo2oVry3KQikp8L/81RkXmUIT8FxMwdx1T7DmFwVQikcSDIw== + dependencies: + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.4" + libsodium-wrappers-sumo "^0.7.11" + "@cosmjs/encoding@^0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.30.1.tgz#b5c4e0ef7ceb1f2753688eb96400ed70f35c6058" @@ -1335,20 +1357,21 @@ bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/json-rpc@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz#16f21305fc167598c8a23a45549b85106b2372bc" - integrity sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ== +"@cosmjs/encoding@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.4.tgz#646e0e809f7f4f1414d8fa991fb0ffe6c633aede" + integrity sha512-tjvaEy6ZGxJchiizzTn7HVRiyTg1i4CObRRaTRPknm5EalE13SV+TCHq38gIDfyUeden4fCuaBVEdBR5+ti7Hw== dependencies: - "@cosmjs/stream" "^0.30.1" - xstream "^11.14.0" + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" -"@cosmjs/json-rpc@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.31.3.tgz#11e5cf0f6d9ab426dff470bb8d68d5d31cd6ab13" - integrity sha512-7LVYerXjnm69qqYR3uA6LGCrBW2EO5/F7lfJxAmY+iII2C7xO3a0vAjMSt5zBBh29PXrJVS6c2qRP22W1Le2Wg== +"@cosmjs/json-rpc@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.4.tgz#be91eb89ea78bd5dc02d0a9fa184dd6790790f0b" + integrity sha512-/jt4mBl7nYzfJ2J/VJ+r19c92mUKF0Lt0JxM3MXEJl7wlwW5haHAWtzRujHkyYMXOwIR+gBqT2S0vntXVBRyhQ== dependencies: - "@cosmjs/stream" "^0.31.3" + "@cosmjs/stream" "^0.32.4" xstream "^11.14.0" "@cosmjs/math@^0.30.1": @@ -1365,131 +1388,71 @@ dependencies: bn.js "^5.2.0" -"@cosmjs/proto-signing@0.31.3", "@cosmjs/proto-signing@^0.31.0", "@cosmjs/proto-signing@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.31.3.tgz#20440b7b96fb2cd924256a10e656fd8d4481cdcd" - integrity sha512-24+10/cGl6lLS4VCrGTCJeDRPQTn1K5JfknzXzDIHOx8THR31JxA7/HV5eWGHqWgAbudA7ccdSvEK08lEHHtLA== - dependencies: - "@cosmjs/amino" "^0.31.3" - "@cosmjs/crypto" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - cosmjs-types "^0.8.0" - long "^4.0.0" - -"@cosmjs/proto-signing@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz#f0dda372488df9cd2677150b89b3e9c72b3cb713" - integrity sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ== +"@cosmjs/math@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.4.tgz#87ac9eadc06696e30a30bdb562a495974bfd0a1a" + integrity sha512-++dqq2TJkoB8zsPVYCvrt88oJWsy1vMOuSOKcdlnXuOA/ASheTJuYy4+oZlTQ3Fr8eALDLGGPhJI02W2HyAQaw== dependencies: - "@cosmjs/amino" "^0.30.1" - "@cosmjs/crypto" "^0.30.1" - "@cosmjs/encoding" "^0.30.1" - "@cosmjs/math" "^0.30.1" - "@cosmjs/utils" "^0.30.1" - cosmjs-types "^0.7.1" - long "^4.0.0" + bn.js "^5.2.0" -"@cosmjs/socket@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.30.1.tgz#00b22f4b5e2ab01f4d82ccdb7b2e59536bfe5ce0" - integrity sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow== +"@cosmjs/proto-signing@0.31.3", "@cosmjs/proto-signing@^0.30.1", "@cosmjs/proto-signing@^0.31.0", "@cosmjs/proto-signing@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.4.tgz#5a06e087c6d677439c8c9b25b5223d5e72c4cd93" + integrity sha512-QdyQDbezvdRI4xxSlyM1rSVBO2st5sqtbEIl3IX03uJ7YiZIQHyv6vaHVf1V4mapusCqguiHJzm4N4gsFdLBbQ== dependencies: - "@cosmjs/stream" "^0.30.1" - isomorphic-ws "^4.0.1" - ws "^7" - xstream "^11.14.0" + "@cosmjs/amino" "^0.32.4" + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + cosmjs-types "^0.9.0" -"@cosmjs/socket@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.31.3.tgz#52086380f4de2fc3514b90b0484b4b1c4c50e39e" - integrity sha512-aqrDGGi7os/hsz5p++avI4L0ZushJ+ItnzbqA7C6hamFSCJwgOkXaOUs+K9hXZdX4rhY7rXO4PH9IH8q09JkTw== +"@cosmjs/socket@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.4.tgz#86ab6adf3a442314774c0810b7a7cfcddf4f2082" + integrity sha512-davcyYziBhkzfXQTu1l5NrpDYv0K9GekZCC9apBRvL1dvMc9F/ygM7iemHjUA+z8tJkxKxrt/YPjJ6XNHzLrkw== dependencies: - "@cosmjs/stream" "^0.31.3" + "@cosmjs/stream" "^0.32.4" isomorphic-ws "^4.0.1" ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@0.31.3", "@cosmjs/stargate@^0.31.0", "@cosmjs/stargate@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.31.3.tgz#a2b38e398097a00f897dbd8f02d4d347d8fed818" - integrity sha512-53NxnzmB9FfXpG4KjOUAYAvWLYKdEmZKsutcat/u2BrDXNZ7BN8jim/ENcpwXfs9/Og0K24lEIdvA4gsq3JDQw== - dependencies: - "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/proto-signing" "^0.31.3" - "@cosmjs/stream" "^0.31.3" - "@cosmjs/tendermint-rpc" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - cosmjs-types "^0.8.0" - long "^4.0.0" - protobufjs "~6.11.3" - xstream "^11.14.0" - -"@cosmjs/stargate@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.30.1.tgz#e1b22e1226cffc6e93914a410755f1f61057ba04" - integrity sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog== +"@cosmjs/stargate@0.31.3", "@cosmjs/stargate@^0.30.1", "@cosmjs/stargate@^0.31.0", "@cosmjs/stargate@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.4.tgz#bd0e4d3bf613b629addbf5f875d3d3b50f640af1" + integrity sha512-usj08LxBSsPRq9sbpCeVdyLx2guEcOHfJS9mHGCLCXpdAPEIEQEtWLDpEUc0LEhWOx6+k/ChXTc5NpFkdrtGUQ== dependencies: "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "^0.30.1" - "@cosmjs/encoding" "^0.30.1" - "@cosmjs/math" "^0.30.1" - "@cosmjs/proto-signing" "^0.30.1" - "@cosmjs/stream" "^0.30.1" - "@cosmjs/tendermint-rpc" "^0.30.1" - "@cosmjs/utils" "^0.30.1" - cosmjs-types "^0.7.1" - long "^4.0.0" - protobufjs "~6.11.3" - xstream "^11.14.0" - -"@cosmjs/stream@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.30.1.tgz#ba038a2aaf41343696b1e6e759d8e03a9516ec1a" - integrity sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ== - dependencies: - xstream "^11.14.0" - -"@cosmjs/stream@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.31.3.tgz#53428fd62487ec08fc3886a50a3feeb8b2af2e66" - integrity sha512-8keYyI7X0RjsLyVcZuBeNjSv5FA4IHwbFKx7H60NHFXszN8/MvXL6aZbNIvxtcIHHsW7K9QSQos26eoEWlAd+w== - dependencies: + "@cosmjs/amino" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/proto-signing" "^0.32.4" + "@cosmjs/stream" "^0.32.4" + "@cosmjs/tendermint-rpc" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + cosmjs-types "^0.9.0" xstream "^11.14.0" -"@cosmjs/tendermint-rpc@0.31.3", "@cosmjs/tendermint-rpc@^0.31.0", "@cosmjs/tendermint-rpc@^0.31.3": - version "0.31.3" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.3.tgz#d1a2bc5b3c98743631c9b55888589d352403c9b3" - integrity sha512-s3TiWkPCW4QceTQjpYqn4xttUJH36mTPqplMl+qyocdqk5+X5mergzExU/pHZRWQ4pbby8bnR7kMvG4OC1aZ8g== +"@cosmjs/stream@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.4.tgz#83e1f2285807467c56d9ea0e1113f79d9fa63802" + integrity sha512-Gih++NYHEiP+oyD4jNEUxU9antoC0pFSg+33Hpp0JlHwH0wXhtD3OOKnzSfDB7OIoEbrzLJUpEjOgpCp5Z+W3A== dependencies: - "@cosmjs/crypto" "^0.31.3" - "@cosmjs/encoding" "^0.31.3" - "@cosmjs/json-rpc" "^0.31.3" - "@cosmjs/math" "^0.31.3" - "@cosmjs/socket" "^0.31.3" - "@cosmjs/stream" "^0.31.3" - "@cosmjs/utils" "^0.31.3" - axios "^0.21.2" - readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/tendermint-rpc@^0.30.1": - version "0.30.1" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz#c16378892ba1ac63f72803fdf7567eab9d4f0aa0" - integrity sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ== - dependencies: - "@cosmjs/crypto" "^0.30.1" - "@cosmjs/encoding" "^0.30.1" - "@cosmjs/json-rpc" "^0.30.1" - "@cosmjs/math" "^0.30.1" - "@cosmjs/socket" "^0.30.1" - "@cosmjs/stream" "^0.30.1" - "@cosmjs/utils" "^0.30.1" - axios "^0.21.2" +"@cosmjs/tendermint-rpc@0.31.3", "@cosmjs/tendermint-rpc@^0.31.3", "@cosmjs/tendermint-rpc@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.4.tgz#b36f9ec657498e42c97e21bb7368798ef6279752" + integrity sha512-MWvUUno+4bCb/LmlMIErLypXxy7ckUuzEmpufYYYd9wgbdCXaTaO08SZzyFM5PI8UJ/0S2AmUrgWhldlbxO8mw== + dependencies: + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/encoding" "^0.32.4" + "@cosmjs/json-rpc" "^0.32.4" + "@cosmjs/math" "^0.32.4" + "@cosmjs/socket" "^0.32.4" + "@cosmjs/stream" "^0.32.4" + "@cosmjs/utils" "^0.32.4" + axios "^1.6.0" readonly-date "^1.0.0" xstream "^11.14.0" @@ -1503,6 +1466,11 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.31.3.tgz#f97bbfda35ad69e80cd5c7fe0a270cbda16db1ed" integrity sha512-VBhAgzrrYdIe0O5IbKRqwszbQa7ZyQLx9nEQuHQ3HUplQW7P44COG/ye2n6AzCudtqxmwdX7nyX8ta1J07GoqA== +"@cosmjs/utils@^0.32.4": + version "0.32.4" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.4.tgz#a9a717c9fd7b1984d9cefdd0ef6c6f254060c671" + integrity sha512-D1Yc+Zy8oL/hkUkFUL/bwxvuDBzRGpc4cF7/SkdhxX4iHpSLgdOuTt1mhCh9+kl6NQREy9t7SYZ6xeW5gFe60w== + "@csstools/normalize.css@*": version "12.1.1" resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-12.1.1.tgz#f0ad221b7280f3fc814689786fd9ee092776ef8f" @@ -3039,7 +3007,7 @@ react-use "^17.4.0" react-use-websocket "^4.5.0" -"@oraichain/oraidex-common@1.1.28", "@oraichain/oraidex-common@^1.1.23", "@oraichain/oraidex-common@^1.1.27": +"@oraichain/oraidex-common@1.1.28", "@oraichain/oraidex-common@^1.1.27": version "1.1.28" resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.28.tgz#9bf25c825e3ee7a76bf8c00174579ca2b81d6fdb" integrity sha512-+1CiI9E03MWtNQ3D7dDWtwbONikpdY1+USmvU6gOKd26uhDqDHKgi7MGnmz2t+Z8/4oqY36aySZhh3d9ybakxg== @@ -3061,6 +3029,28 @@ ethers "^5.0.15" tronweb "6.0.0-beta.4" +"@oraichain/oraidex-common@^1.1.28": + version "1.1.29" + resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.29.tgz#01ee382164e0d98c4929b322917c4efebe99886c" + integrity sha512-GHKpObLpOJEZ0LsMomxBw5yInQduikL5+AKrL09/fhuMihfCKCk2Bgc9Uyfxjmw6z5bBUaN5LOTEPau1U1uQLw== + dependencies: + "@cosmjs/amino" "^0.32.4" + "@cosmjs/cosmwasm-stargate" "^0.32.4" + "@cosmjs/crypto" "^0.32.4" + "@cosmjs/proto-signing" "^0.32.4" + "@cosmjs/stargate" "^0.32.4" + "@cosmjs/tendermint-rpc" "^0.32.4" + "@ethersproject/providers" "^5.0.10" + "@injectivelabs/sdk-ts" "1.12.1" + "@keplr-wallet/types" "^0.11.38" + "@oraichain/oraidex-contracts-sdk" latest + axios "1.7.2" + axios-extensions "3.1.7" + bignumber.js "^9.1.2" + cosmjs-types "^0.9.0" + ethers "^5.0.15" + tronweb "6.0.0-beta.4" + "@oraichain/oraidex-contracts-build@^1.0.22": version "1.0.22" resolved "https://registry.yarnpkg.com/@oraichain/oraidex-contracts-build/-/oraidex-contracts-build-1.0.22.tgz#70b765dd8ea3b500a77cc37e6a45ea9d75f0c5c4" @@ -5383,7 +5373,7 @@ axios-extensions@3.1.7: tslib "^2.1.0" util "^0.12.3" -axios@0.21.4, axios@0.26.1, axios@1.7.2, axios@^0.21.0, axios@^0.21.1, axios@^0.21.2, axios@^0.26.1, axios@^0.27.2, axios@^1.6.2, axios@^1.6.8: +axios@0.21.4, axios@0.26.1, axios@1.7.2, axios@^0.21.0, axios@^0.21.1, axios@^0.26.1, axios@^0.27.2, axios@^1.6.0, axios@^1.6.2, axios@^1.6.8: version "0.26.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== @@ -6728,6 +6718,11 @@ cosmjs-types@^0.7.1: long "^4.0.0" protobufjs "~6.11.2" +cosmjs-types@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.9.0.tgz#c3bc482d28c7dfa25d1445093fdb2d9da1f6cfcc" + integrity sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ== + crc-32@^1.2.0: version "1.2.2" resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" @@ -13551,7 +13546,7 @@ protobufjs@7.2.4: "@types/node" ">=13.7.0" long "^5.0.0" -protobufjs@^6.10.2, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: +protobufjs@^6.10.2, protobufjs@^6.8.8, protobufjs@~6.11.2: version "6.11.4" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== From e9b44d1b984e012b7456d1915d65faffb4fb3fc2 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Van Date: Tue, 12 Nov 2024 18:33:19 +0700 Subject: [PATCH 2/2] pumb cosmjs --- src/libs/keplr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/keplr.ts b/src/libs/keplr.ts index 29903c704..e3096f0db 100644 --- a/src/libs/keplr.ts +++ b/src/libs/keplr.ts @@ -10,7 +10,7 @@ import { getAddress, getAddressByEIP191 } from 'helper'; import { EIP_EIP_STORAGE_KEY_ACC, MetamaskOfflineSigner } from './eip191'; export default class Keplr extends CosmosWallet { - async createCosmosSigner(chainId: CosmosChainId): Promise { + async createCosmosSigner(chainId: CosmosChainId): Promise { const keplr = await this.getKeplr(); if (keplr) return await keplr.getOfflineSignerAuto(chainId); if (window.ethereum) return await MetamaskOfflineSigner.connect(window.ethereum, network.denom);