Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow supplying cheqd SDK wallet options #485

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/cheqd-blockchain-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 1 addition & 1 deletion packages/cheqd-blockchain-api/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 5 additions & 1 deletion packages/cheqd-blockchain-api/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -75,6 +78,7 @@ export class CheqdAPI extends AbstractApiProvider {

this.ensureNotInitialized();
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
...walletOptions,
prefix: 'cheqd',
});
const options = {
Expand Down
2 changes: 1 addition & 1 deletion packages/cheqd-blockchain-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading