From e905e4ea4975c73650a22cbcba91312e82c75dc7 Mon Sep 17 00:00:00 2001 From: Sam Hellawell Date: Thu, 21 Nov 2024 18:33:11 +0000 Subject: [PATCH] Allow supplying cheqd SDK wallet options --- packages/cheqd-blockchain-api/CHANGELOG.md | 6 ++++++ packages/cheqd-blockchain-api/package.json | 2 +- packages/cheqd-blockchain-api/src/index.js | 6 +++++- packages/cheqd-blockchain-modules/package.json | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/cheqd-blockchain-api/CHANGELOG.md b/packages/cheqd-blockchain-api/CHANGELOG.md index bcb0ee3bd..b2848560c 100644 --- a/packages/cheqd-blockchain-api/CHANGELOG.md +++ b/packages/cheqd-blockchain-api/CHANGELOG.md @@ -1,5 +1,11 @@ # @docknetwork/cheqd-blockchain-api +## 0.10.0 + +### Minor Changes + +- Support wallet options + ## 0.9.0 - Allow to use `MultiApiCoreModules` with `CheqdCoreModules` diff --git a/packages/cheqd-blockchain-api/package.json b/packages/cheqd-blockchain-api/package.json index a03f52be8..d174ceeca 100644 --- a/packages/cheqd-blockchain-api/package.json +++ b/packages/cheqd-blockchain-api/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/cheqd-blockchain-api", - "version": "0.9.0", + "version": "0.10.0", "license": "MIT", "main": "./dist/esm/index.js", "type": "module", diff --git a/packages/cheqd-blockchain-api/src/index.js b/packages/cheqd-blockchain-api/src/index.js index 89f5bfb45..d02d325e0 100644 --- a/packages/cheqd-blockchain-api/src/index.js +++ b/packages/cheqd-blockchain-api/src/index.js @@ -60,9 +60,12 @@ export class CheqdAPI extends AbstractApiProvider { * @param {string} [configuration.url] * @param {string} [configuration.mnemonic] * @param {string} [configuration.network] + * @param {object} [configuration.walletOptions] * @returns {this} */ - async init({ url, mnemonic, network } = {}) { + async init({ + url, mnemonic, walletOptions, network, + } = {}) { if (network !== CheqdNetwork.Mainnet && network !== CheqdNetwork.Testnet) { throw new Error( `Invalid network provided: \`${network}\`, expected one of \`${fmtIter( @@ -75,6 +78,7 @@ export class CheqdAPI extends AbstractApiProvider { this.ensureNotInitialized(); const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, { + ...walletOptions, prefix: 'cheqd', }); const options = { diff --git a/packages/cheqd-blockchain-modules/package.json b/packages/cheqd-blockchain-modules/package.json index a0a083abe..dfd545a31 100644 --- a/packages/cheqd-blockchain-modules/package.json +++ b/packages/cheqd-blockchain-modules/package.json @@ -42,7 +42,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/plugin-transform-modules-commonjs": "^7.24.1", "@babel/preset-env": "^7.24.3", - "@docknetwork/cheqd-blockchain-api": "0.9.0", + "@docknetwork/cheqd-blockchain-api": "0.10.0", "@rollup/plugin-alias": "^4.0.2", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^24.0.0",