diff --git a/package-lock.json b/package-lock.json index 719048de..e96775e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cheqd/sdk", - "version": "3.7.5-develop.1", + "version": "3.7.5-develop.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cheqd/sdk", - "version": "3.7.5-develop.1", + "version": "3.7.5-develop.2", "license": "Apache-2.0", "dependencies": { "@cheqd/ts-proto": "^3.3.7", @@ -20,7 +20,7 @@ "@cosmjs/utils": "^0.31.3", "@stablelib/ed25519": "^1.0.3", "@types/secp256k1": "^4.0.6", - "cosmjs-types": "^0.8.0", + "cosmjs-types": "^0.9.0", "did-jwt": "^7.4.5", "did-resolver": "^4.1.0", "file-type": "^18.7.0", @@ -36,18 +36,17 @@ "@semantic-release/npm": "^11.0.1", "@semantic-release/release-notes-generator": "^12.1.0", "@types/jest": "^29.5.10", - "@types/node": "^20.9.4", + "@types/node": "^20.10.0", "@types/uuid": "^9.0.7", "conventional-changelog-conventionalcommits": "^7.0.2", "cross-env": "^7.0.3", "jest": "^29.7.0", - "long": "^4.0.0", "prettier": "^3.1.0", "semantic-release": "^22.0.8", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "typescript": "^5.3.2", - "uint8arrays": "^4.0.6" + "uint8arrays": "^4.0.9" }, "engines": { "node": ">=18.0.0" @@ -718,11 +717,6 @@ "node": ">=18.0.0" } }, - "node_modules/@cheqd/ts-proto/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" - }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -742,6 +736,11 @@ "protobufjs": "^6.8.8" } }, + "node_modules/@confio/ics23/node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "node_modules/@confio/ics23/node_modules/protobufjs": { "version": "6.11.4", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", @@ -833,6 +832,45 @@ "long": "^4.0.0" } }, + "node_modules/@cosmjs/proto-signing/node_modules/cosmjs-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.8.0.tgz", + "integrity": "sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg==", + "dependencies": { + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, + "node_modules/@cosmjs/proto-signing/node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/@cosmjs/proto-signing/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, "node_modules/@cosmjs/socket": { "version": "0.31.3", "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.31.3.tgz", @@ -863,6 +901,20 @@ "xstream": "^11.14.0" } }, + "node_modules/@cosmjs/stargate/node_modules/cosmjs-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.8.0.tgz", + "integrity": "sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg==", + "dependencies": { + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, + "node_modules/@cosmjs/stargate/node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "node_modules/@cosmjs/stargate/node_modules/protobufjs": { "version": "6.11.4", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", @@ -2287,9 +2339,9 @@ "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" }, "node_modules/@types/node": { - "version": "20.9.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.4.tgz", - "integrity": "sha512-wmyg8HUhcn6ACjsn8oKYjkN/zUzQeNtMy44weTJSM6p4MMzEOuKbA3OjJ267uPCOW7Xex9dyrNTful8XTQYoDA==", + "version": "20.10.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", + "integrity": "sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==", "dependencies": { "undici-types": "~5.26.4" } @@ -2751,9 +2803,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001564", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz", - "integrity": "sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg==", + "version": "1.0.30001565", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001565.tgz", + "integrity": "sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w==", "dev": true, "funding": [ { @@ -3060,38 +3112,9 @@ } }, "node_modules/cosmjs-types": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.8.0.tgz", - "integrity": "sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg==", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - } - }, - "node_modules/cosmjs-types/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.9.0.tgz", + "integrity": "sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ==" }, "node_modules/create-jest": { "version": "29.7.0", @@ -3358,9 +3381,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.592", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.592.tgz", - "integrity": "sha512-D3NOkROIlF+d5ixnz7pAf3Lu/AuWpd6AYgI9O67GQXMXTcCP1gJQRotOq35eQy5Sb4hez33XH1YdTtILA7Udww==", + "version": "1.4.594", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.594.tgz", + "integrity": "sha512-xT1HVAu5xFn7bDfkjGQi9dNpMqGchUkebwf1GL7cZN32NSwwlHRPMSDJ1KN6HkS0bWUtndbSQZqvpQftKG2uFQ==", "dev": true }, "node_modules/elliptic": { @@ -5411,9 +5434,9 @@ "dev": true }, "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/lru-cache": { "version": "5.1.1", @@ -5684,9 +5707,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.0.tgz", - "integrity": "sha512-PbZERfeFdrHQOOXiAKOY0VPbykZy90ndPKk0d+CFDegTKmWp1VgOTz2xACVbr1BjCWxrQp68CXtvNsveFhqDJg==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz", + "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -9234,11 +9257,6 @@ "node": ">=12.0.0" } }, - "node_modules/protobufjs/node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" - }, "node_modules/pure-rand": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", @@ -10550,9 +10568,9 @@ } }, "node_modules/uint8arrays": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.6.tgz", - "integrity": "sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==", + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.9.tgz", + "integrity": "sha512-iHU8XJJnfeijILZWzV7RgILdPHqe0mjJvyzY4mO8aUUtHsDbPa2Gc8/02Kc4zeokp2W6Qq8z9Ap1xkQ1HfbKwg==", "dev": true, "dependencies": { "multiformats": "^12.0.1" diff --git a/package.json b/package.json index f1c79b92..d2d3bab0 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@cosmjs/utils": "^0.31.3", "@stablelib/ed25519": "^1.0.3", "@types/secp256k1": "^4.0.6", - "cosmjs-types": "^0.8.0", + "cosmjs-types": "^0.9.0", "did-jwt": "^7.4.5", "did-resolver": "^4.1.0", "file-type": "^18.7.0", @@ -79,18 +79,17 @@ "@semantic-release/npm": "^11.0.1", "@semantic-release/release-notes-generator": "^12.1.0", "@types/jest": "^29.5.10", - "@types/node": "^20.9.4", + "@types/node": "^20.10.0", "@types/uuid": "^9.0.7", "conventional-changelog-conventionalcommits": "^7.0.2", "cross-env": "^7.0.3", "jest": "^29.7.0", - "long": "^4.0.0", "prettier": "^3.1.0", "semantic-release": "^22.0.8", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "typescript": "^5.3.2", - "uint8arrays": "^4.0.6" + "uint8arrays": "^4.0.9" }, "publishConfig": { "registry": "https://registry.npmjs.org/", diff --git a/src/signer.ts b/src/signer.ts index 16a05ff9..97c86f0b 100644 --- a/src/signer.ts +++ b/src/signer.ts @@ -34,7 +34,6 @@ import { AuthInfo, SignerInfo, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.j import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing.js'; import { Any } from 'cosmjs-types/google/protobuf/any.js'; import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin.js'; -import Long from 'long'; export function calculateDidFee(gasLimit: number, gasPrice: string | GasPrice): DidStdFee { return calculateFee(gasLimit, gasPrice); @@ -50,7 +49,7 @@ export function makeSignerInfos( modeInfo: { single: { mode: signMode }, }, - sequence: Long.fromNumber(sequence), + sequence: BigInt(sequence), }) ); } @@ -58,7 +57,7 @@ export function makeSignerInfos( export function makeDidAuthInfoBytes( signers: ReadonlyArray<{ readonly pubkey: Any; readonly sequence: number }>, feeAmount: readonly Coin[], - gasLimit: number, + gasLimit: bigint, feePayer: string, signMode = SignMode.SIGN_MODE_DIRECT ): Uint8Array { @@ -66,7 +65,7 @@ export function makeDidAuthInfoBytes( signerInfos: makeSignerInfos(signers, signMode), fee: { amount: [...feeAmount], - gasLimit: Long.fromNumber(gasLimit), + gasLimit: gasLimit, payer: feePayer, }, }; @@ -170,7 +169,7 @@ export class CheqdSigningStargateClient extends SigningStargateClient { }; const txBodyBytes = this.registry.encode(txBodyEncodeObject); const gasLimit = Int53.fromString(fee.gas).toNumber(); - const authInfoBytes = makeDidAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit, fee.payer!); + const authInfoBytes = makeDidAuthInfoBytes([{ pubkey, sequence }], fee.amount, BigInt(gasLimit), fee.payer!); const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber); const { signature, signed } = await this._signer.signDirect(signerAddress, signDoc); return TxRaw.fromPartial({