diff --git a/CHANGELOG.md b/CHANGELOG.md index d29b61cb..0c7f338a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [1.3.5](https://github.com/cheqd/sdk/compare/1.3.4...1.3.5) (2022-10-17) + +## [1.3.4](https://github.com/cheqd/sdk/compare/1.3.3...1.3.4) (2022-10-17) + +## [1.3.3](https://github.com/cheqd/sdk/compare/1.3.2...1.3.3) (2022-10-16) + +## [1.3.2](https://github.com/cheqd/sdk/compare/1.3.1...1.3.2) (2022-10-16) + + +### Bug Fixes + +* **keys:** Added deep equality lambda ([edcc15f](https://github.com/cheqd/sdk/commit/edcc15f5ece115893cd5f3e876cf4927379b0a55)) + ## [1.3.1](https://github.com/cheqd/sdk/compare/1.3.0...1.3.1) (2022-10-03) ## [1.3.0](https://github.com/cheqd/sdk/compare/1.2.10...1.3.0) (2022-09-01) diff --git a/package-lock.json b/package-lock.json index a0851576..69bb1fe9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,22 @@ { "name": "@cheqd/sdk", - "version": "1.3.1", + "version": "1.3.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@cheqd/sdk", - "version": "1.3.1", + "version": "1.3.4", "license": "Apache-2.0", "dependencies": { "@cheqd/ts-proto": "^1.0.13", - "@cosmjs/amino": "^0.29.0", - "@cosmjs/encoding": "^0.28.11", - "@cosmjs/math": "^0.28.11", + "@cosmjs/amino": "^0.28.11", + "@cosmjs/encoding": "^0.29.2", + "@cosmjs/math": "^0.29.2", "@cosmjs/proto-signing": "^0.28.10", "@cosmjs/stargate": "^0.28.13", "@cosmjs/tendermint-rpc": "^0.28.10", - "@cosmjs/utils": "^0.28.11", + "@cosmjs/utils": "^0.29.2", "@stablelib/ed25519": "^1.0.3", "cosmjs-types": "^0.5.1", "did-jwt": "^6.8.0", @@ -673,34 +673,20 @@ } }, "node_modules/@cosmjs/amino": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.0.tgz", - "integrity": "sha512-/ZUVx6nRN5YE36H3SDq9+i8g2nZ8DJQnN9fVRC8rSHQKauNkoEuK4NxTNcQ2o2EBLUT0kyYAFY2550HVsPMrgw==", - "dependencies": { - "@cosmjs/crypto": "^0.29.0", - "@cosmjs/encoding": "^0.29.0", - "@cosmjs/math": "^0.29.0", - "@cosmjs/utils": "^0.29.0" - } - }, - "node_modules/@cosmjs/amino/node_modules/@cosmjs/crypto": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.0.tgz", - "integrity": "sha512-MPJoebRGh7AcZgbfR25ci7iV+XzJiKwVq4wL8n6M5P2QdrIv7DqqniyFXcBbn9dQjMLMHnOSgT9LRv+VXzUVCA==", + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.28.13.tgz", + "integrity": "sha512-IHnH2zGwaY69qT4mVAavr/pfzx6YE+ud1NHJbvVePlbGiz68CXTi5LHR+K0lrKB5mQ7E+ZErWz2mw5U/x+V1wQ==", "dependencies": { - "@cosmjs/encoding": "^0.29.0", - "@cosmjs/math": "^0.29.0", - "@cosmjs/utils": "^0.29.0", - "@noble/hashes": "^1", - "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "libsodium-wrappers": "^0.7.6" + "@cosmjs/crypto": "0.28.13", + "@cosmjs/encoding": "0.28.13", + "@cosmjs/math": "0.28.13", + "@cosmjs/utils": "0.28.13" } }, "node_modules/@cosmjs/amino/node_modules/@cosmjs/encoding": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.0.tgz", - "integrity": "sha512-6HDBtid/YLbyXapY6PdMMIigAtGKyD1w0dUCLU1dOIkPf1q3y43kqoA7WnLkRw0g0/lZY1VGM2fX+2RWU0wxYg==", + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", "dependencies": { "base64-js": "^1.3.0", "bech32": "^1.1.4", @@ -708,17 +694,17 @@ } }, "node_modules/@cosmjs/amino/node_modules/@cosmjs/math": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.0.tgz", - "integrity": "sha512-ufRRmyDQtJUrH8r1V4N7Q6rTOk9ZX7XIXjJto7cfXP8kcxm7IJXKYk+r0EfDnNHFkxTidYvW/1YXeeNoy8xZYw==", + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", "dependencies": { "bn.js": "^5.2.0" } }, "node_modules/@cosmjs/amino/node_modules/@cosmjs/utils": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.0.tgz", - "integrity": "sha512-NiJk3ISX+FU1cQcTTgmJcY84A8mV/p8L5CRewp/2jc/lUmo8j9lMGbX17U7NxVQ9RX5RmrwgdjYnBASzhRCVmA==" + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" }, "node_modules/@cosmjs/crypto": { "version": "0.28.13", @@ -734,7 +720,7 @@ "libsodium-wrappers": "^0.7.6" } }, - "node_modules/@cosmjs/encoding": { + "node_modules/@cosmjs/crypto/node_modules/@cosmjs/encoding": { "version": "0.28.13", "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", @@ -744,6 +730,29 @@ "readonly-date": "^1.0.0" } }, + "node_modules/@cosmjs/crypto/node_modules/@cosmjs/math": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmjs/crypto/node_modules/@cosmjs/utils": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" + }, + "node_modules/@cosmjs/encoding": { + "version": "0.29.2", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.2.tgz", + "integrity": "sha512-v62YsTVvDOSbSAHpD2u5oe0yk/ljitkgi+CM/hpL1qytaVKIlr1RSwBDhJ5cW11oqkIjMWM8UNsGeIG8lyt9JA==", + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, "node_modules/@cosmjs/json-rpc": { "version": "0.28.13", "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.28.13.tgz", @@ -754,9 +763,9 @@ } }, "node_modules/@cosmjs/math": { - "version": "0.28.13", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", - "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", + "version": "0.29.2", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.2.tgz", + "integrity": "sha512-WhgvinqNauEG0GNF7OMNU/cWqBZQ537Zy5d6FAO1+5lOpLhxxBPshEJIO4l2VPU702/JcC5qa49AxyiV3JuGmA==", "dependencies": { "bn.js": "^5.2.0" } @@ -775,17 +784,29 @@ "long": "^4.0.0" } }, - "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/amino": { + "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/encoding": { "version": "0.28.13", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.28.13.tgz", - "integrity": "sha512-IHnH2zGwaY69qT4mVAavr/pfzx6YE+ud1NHJbvVePlbGiz68CXTi5LHR+K0lrKB5mQ7E+ZErWz2mw5U/x+V1wQ==", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" } }, + "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/math": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmjs/proto-signing/node_modules/@cosmjs/utils": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" + }, "node_modules/@cosmjs/proto-signing/node_modules/cosmjs-types": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", @@ -855,17 +876,29 @@ "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/stargate/node_modules/@cosmjs/amino": { + "node_modules/@cosmjs/stargate/node_modules/@cosmjs/encoding": { "version": "0.28.13", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.28.13.tgz", - "integrity": "sha512-IHnH2zGwaY69qT4mVAavr/pfzx6YE+ud1NHJbvVePlbGiz68CXTi5LHR+K0lrKB5mQ7E+ZErWz2mw5U/x+V1wQ==", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", "dependencies": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmjs/stargate/node_modules/@cosmjs/math": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", + "dependencies": { + "bn.js": "^5.2.0" } }, + "node_modules/@cosmjs/stargate/node_modules/@cosmjs/utils": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" + }, "node_modules/@cosmjs/stargate/node_modules/cosmjs-types": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", @@ -930,11 +963,34 @@ "xstream": "^11.14.0" } }, - "node_modules/@cosmjs/utils": { + "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/encoding": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/math": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc/node_modules/@cosmjs/utils": { "version": "0.28.13", "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" }, + "node_modules/@cosmjs/utils": { + "version": "0.29.2", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.2.tgz", + "integrity": "sha512-gckp8mbNXF8XCAEwCzH90fpaA0K2O9CC5Rg5v75zsRySYkAaoJIm9f+f8yW2qn6ADge2BnmIT1IkAfmswThCJQ==" + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -2812,9 +2868,9 @@ } }, "node_modules/cosmjs-types": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.1.tgz", - "integrity": "sha512-NcC58xUIVLlKdIimWWQAmSlmCjiMrJnuHf4i3LiD8PCextfHR0fT3V5/WlXZZreyMgdmh6ML1zPUfGTbbo3Z5g==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.2.tgz", + "integrity": "sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg==", "dependencies": { "long": "^4.0.0", "protobufjs": "~6.11.2" @@ -10303,34 +10359,20 @@ } }, "@cosmjs/amino": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.0.tgz", - "integrity": "sha512-/ZUVx6nRN5YE36H3SDq9+i8g2nZ8DJQnN9fVRC8rSHQKauNkoEuK4NxTNcQ2o2EBLUT0kyYAFY2550HVsPMrgw==", + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.28.13.tgz", + "integrity": "sha512-IHnH2zGwaY69qT4mVAavr/pfzx6YE+ud1NHJbvVePlbGiz68CXTi5LHR+K0lrKB5mQ7E+ZErWz2mw5U/x+V1wQ==", "requires": { - "@cosmjs/crypto": "^0.29.0", - "@cosmjs/encoding": "^0.29.0", - "@cosmjs/math": "^0.29.0", - "@cosmjs/utils": "^0.29.0" + "@cosmjs/crypto": "0.28.13", + "@cosmjs/encoding": "0.28.13", + "@cosmjs/math": "0.28.13", + "@cosmjs/utils": "0.28.13" }, "dependencies": { - "@cosmjs/crypto": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.0.tgz", - "integrity": "sha512-MPJoebRGh7AcZgbfR25ci7iV+XzJiKwVq4wL8n6M5P2QdrIv7DqqniyFXcBbn9dQjMLMHnOSgT9LRv+VXzUVCA==", - "requires": { - "@cosmjs/encoding": "^0.29.0", - "@cosmjs/math": "^0.29.0", - "@cosmjs/utils": "^0.29.0", - "@noble/hashes": "^1", - "bn.js": "^5.2.0", - "elliptic": "^6.5.3", - "libsodium-wrappers": "^0.7.6" - } - }, "@cosmjs/encoding": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.0.tgz", - "integrity": "sha512-6HDBtid/YLbyXapY6PdMMIigAtGKyD1w0dUCLU1dOIkPf1q3y43kqoA7WnLkRw0g0/lZY1VGM2fX+2RWU0wxYg==", + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", "requires": { "base64-js": "^1.3.0", "bech32": "^1.1.4", @@ -10338,17 +10380,17 @@ } }, "@cosmjs/math": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.0.tgz", - "integrity": "sha512-ufRRmyDQtJUrH8r1V4N7Q6rTOk9ZX7XIXjJto7cfXP8kcxm7IJXKYk+r0EfDnNHFkxTidYvW/1YXeeNoy8xZYw==", + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", "requires": { "bn.js": "^5.2.0" } }, "@cosmjs/utils": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.0.tgz", - "integrity": "sha512-NiJk3ISX+FU1cQcTTgmJcY84A8mV/p8L5CRewp/2jc/lUmo8j9lMGbX17U7NxVQ9RX5RmrwgdjYnBASzhRCVmA==" + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" } } }, @@ -10364,12 +10406,37 @@ "bn.js": "^5.2.0", "elliptic": "^6.5.3", "libsodium-wrappers": "^0.7.6" + }, + "dependencies": { + "@cosmjs/encoding": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/math": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", + "requires": { + "bn.js": "^5.2.0" + } + }, + "@cosmjs/utils": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" + } } }, "@cosmjs/encoding": { - "version": "0.28.13", - "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", - "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", + "version": "0.29.2", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.2.tgz", + "integrity": "sha512-v62YsTVvDOSbSAHpD2u5oe0yk/ljitkgi+CM/hpL1qytaVKIlr1RSwBDhJ5cW11oqkIjMWM8UNsGeIG8lyt9JA==", "requires": { "base64-js": "^1.3.0", "bech32": "^1.1.4", @@ -10386,9 +10453,9 @@ } }, "@cosmjs/math": { - "version": "0.28.13", - "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", - "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", + "version": "0.29.2", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.2.tgz", + "integrity": "sha512-WhgvinqNauEG0GNF7OMNU/cWqBZQ537Zy5d6FAO1+5lOpLhxxBPshEJIO4l2VPU702/JcC5qa49AxyiV3JuGmA==", "requires": { "bn.js": "^5.2.0" } @@ -10407,17 +10474,29 @@ "long": "^4.0.0" }, "dependencies": { - "@cosmjs/amino": { + "@cosmjs/encoding": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/math": { "version": "0.28.13", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.28.13.tgz", - "integrity": "sha512-IHnH2zGwaY69qT4mVAavr/pfzx6YE+ud1NHJbvVePlbGiz68CXTi5LHR+K0lrKB5mQ7E+ZErWz2mw5U/x+V1wQ==", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", "requires": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" + "bn.js": "^5.2.0" } }, + "@cosmjs/utils": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" + }, "cosmjs-types": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", @@ -10484,17 +10563,29 @@ "xstream": "^11.14.0" }, "dependencies": { - "@cosmjs/amino": { + "@cosmjs/encoding": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/math": { "version": "0.28.13", - "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.28.13.tgz", - "integrity": "sha512-IHnH2zGwaY69qT4mVAavr/pfzx6YE+ud1NHJbvVePlbGiz68CXTi5LHR+K0lrKB5mQ7E+ZErWz2mw5U/x+V1wQ==", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", "requires": { - "@cosmjs/crypto": "0.28.13", - "@cosmjs/encoding": "0.28.13", - "@cosmjs/math": "0.28.13", - "@cosmjs/utils": "0.28.13" + "bn.js": "^5.2.0" } }, + "@cosmjs/utils": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" + }, "cosmjs-types": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.4.1.tgz", @@ -10554,12 +10645,37 @@ "axios": "^0.21.2", "readonly-date": "^1.0.0", "xstream": "^11.14.0" + }, + "dependencies": { + "@cosmjs/encoding": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.28.13.tgz", + "integrity": "sha512-jtXbAYtV77rLHxoIrjGFsvgGjeTKttuHRv6cvuy3toCZzY7JzTclKH5O2g36IIE4lXwD9xwuhGJ2aa6A3dhNkA==", + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/math": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.28.13.tgz", + "integrity": "sha512-PDpL8W/kbyeWi0mQ2OruyqE8ZUAdxPs1xCbDX3WXJwy2oU+X2UTbkuweJHVpS9CIqmZulBoWQAmlf6t6zr1N/g==", + "requires": { + "bn.js": "^5.2.0" + } + }, + "@cosmjs/utils": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", + "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" + } } }, "@cosmjs/utils": { - "version": "0.28.13", - "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.28.13.tgz", - "integrity": "sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg==" + "version": "0.29.2", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.2.tgz", + "integrity": "sha512-gckp8mbNXF8XCAEwCzH90fpaA0K2O9CC5Rg5v75zsRySYkAaoJIm9f+f8yW2qn6ADge2BnmIT1IkAfmswThCJQ==" }, "@cspotcode/source-map-support": { "version": "0.8.1", @@ -12094,9 +12210,9 @@ } }, "cosmjs-types": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.1.tgz", - "integrity": "sha512-NcC58xUIVLlKdIimWWQAmSlmCjiMrJnuHf4i3LiD8PCextfHR0fT3V5/WlXZZreyMgdmh6ML1zPUfGTbbo3Z5g==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.2.tgz", + "integrity": "sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg==", "requires": { "long": "^4.0.0", "protobufjs": "~6.11.2" diff --git a/package.json b/package.json index 728ec413..52e74037 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cheqd/sdk", - "version": "1.3.1", + "version": "1.3.5", "description": "A TypeScript SDK built with CosmJS to interact with cheqd network ledger", "license": "Apache-2.0", "author": "Cheqd Foundation Limited (https://github.com/cheqd)", @@ -43,13 +43,13 @@ }, "dependencies": { "@cheqd/ts-proto": "^1.0.13", - "@cosmjs/amino": "^0.29.0", - "@cosmjs/encoding": "^0.28.11", - "@cosmjs/math": "^0.28.11", + "@cosmjs/amino": "^0.29.2", + "@cosmjs/encoding": "^0.29.2", + "@cosmjs/math": "^0.29.2", "@cosmjs/proto-signing": "^0.28.10", "@cosmjs/stargate": "^0.28.13", "@cosmjs/tendermint-rpc": "^0.28.10", - "@cosmjs/utils": "^0.28.11", + "@cosmjs/utils": "^0.29.2", "@stablelib/ed25519": "^1.0.3", "cosmjs-types": "^0.5.1", "did-jwt": "^6.8.0", diff --git a/src/utils.ts b/src/utils.ts index d605a56c..76ec4689 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -30,6 +30,10 @@ export function parseToKeyValuePair(object: { [key: string]: any }): IKeyValuePa return Object.entries(object).map(([key, value]) => ({ key, value })) } +export function isEqualKeyValuePair(kv1: IKeyValuePair[], kv2: IKeyValuePair[]): boolean { + return kv1.every((item, index) => item.key === kv2[index].key && item.value === kv2[index].value) +} + export function createSignInputsFromImportableEd25519Key(key: TImportableEd25519Key, verificationMethod: VerificationMethod[]): ISignInputs { if (verificationMethod?.length === 0) throw new Error('No verification methods provided') @@ -52,7 +56,7 @@ export function createSignInputsFromImportableEd25519Key(key: TImportableEd25519 kty: 'OKP', x: toString( publicKey, 'base64url' ) }) - if (method.publicKeyJwk === publicKeyJWK) { + if (isEqualKeyValuePair(method.publicKeyJwk, publicKeyJWK)) { return { verificationMethodId: method.id, privateKeyHex: key.privateKeyHex diff --git a/tests/utils.test.ts b/tests/utils.test.ts index 68211d3d..a1df3597 100644 --- a/tests/utils.test.ts +++ b/tests/utils.test.ts @@ -23,4 +23,24 @@ describe('createSignInputsFromImportableEd25519Key', () => { expect(signInput).toEqual({ verificationMethodId: verificationKeys.keyId, privateKeyHex: importableEd25519Key.privateKeyHex }) }) + + it('should create a sign input from an importable ed25519 key with VM type JWK', () => { + const keyPair = createKeyPairRaw() + const importableEd25519Key: TImportableEd25519Key = { + publicKeyHex: toString(keyPair.publicKey, 'hex'), + privateKeyHex: toString(keyPair.secretKey, 'hex'), + kid: toString(keyPair.publicKey, 'hex'), + type: 'Ed25519' + } + const keyPairBase64: IKeyPair = { + publicKey: toString(keyPair.publicKey, 'base64'), + privateKey: toString(keyPair.secretKey, 'base64'), + } + + const verificationKeys = createVerificationKeys(keyPairBase64, MethodSpecificIdAlgo.Base58, 'key-1', 16) + const verificationMethod = createDidVerificationMethod([VerificationMethods.JWK], [verificationKeys]) + const signInput = createSignInputsFromImportableEd25519Key(importableEd25519Key, verificationMethod) + + expect(signInput).toEqual({ verificationMethodId: verificationKeys.keyId, privateKeyHex: importableEd25519Key.privateKeyHex }) + }) }) \ No newline at end of file