Skip to content

Commit

Permalink
Fix JSON import + misc tweaks (#504)
Browse files Browse the repository at this point in the history
* Fix `JSON` import + misc tweaks
  • Loading branch information
olegnn authored Jan 21, 2025
1 parent 1c57e4e commit 9c2ba4c
Show file tree
Hide file tree
Showing 19 changed files with 3,180 additions and 3,114 deletions.
13 changes: 13 additions & 0 deletions examples/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @docknetwork/sdk-examples

## 0.9.0

### Minor Changes

- Fix `JSON` import + misc tweaks

### Patch Changes

- Updated dependencies
- @docknetwork/dock-blockchain-modules@0.15.0
- @docknetwork/dock-blockchain-api@0.11.0
- @docknetwork/credential-sdk@0.26.0

## 0.8.0

### Minor Changes
Expand Down
8 changes: 4 additions & 4 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@docknetwork/sdk-examples",
"private": true,
"type": "module",
"version": "0.8.0",
"version": "0.9.0",
"scripts": {
"bbs-dock-example": "babel-node ./bbs-dock.js",
"claim-deduction-example": "babel-node ./claim-deduction.js",
Expand All @@ -19,9 +19,9 @@
"lint": "eslint \"*.js\""
},
"dependencies": {
"@docknetwork/credential-sdk": "0.25.0",
"@docknetwork/dock-blockchain-api": "0.10.0",
"@docknetwork/dock-blockchain-modules": "0.14.0"
"@docknetwork/credential-sdk": "0.26.0",
"@docknetwork/dock-blockchain-api": "0.11.0",
"@docknetwork/dock-blockchain-modules": "0.15.0"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/cheqd-blockchain-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @docknetwork/cheqd-blockchain-api

## 0.20.0

### Minor Changes

- Fix `JSON` import + misc tweaks

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.26.0

## 0.19.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions 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.19.0",
"version": "0.20.0",
"license": "MIT",
"main": "./dist/esm/index.js",
"type": "module",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"@cheqd/sdk": "cjs",
"@docknetwork/credential-sdk": "0.25.0"
"@docknetwork/credential-sdk": "0.26.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
Expand Down
6 changes: 4 additions & 2 deletions packages/cheqd-blockchain-api/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ export class CheqdAPI extends AbstractApiProvider {
* @param {object} configuration.fee
* @returns {Promise<*>}
*/
async signAndSend(tx, { from, fee, memo } = {}) {
async signAndSend(tx, {
from, fee, memo, gas,
} = {}) {
this.ensureInitialized();
const { PayloadWrappers, Prefixes, Fees } = this.constructor;
const { typeUrl } = tx;
Expand All @@ -228,7 +230,7 @@ export class CheqdAPI extends AbstractApiProvider {
const sender = from ?? (await this.sdk.options.wallet.getAccounts())[0].address;
const payment = {
amount: [amount],
gas: '1400000', // TODO: dynamically calculate needed amount
gas: String(gas ?? 2e6), // TODO: dynamically calculate needed amount
payer: sender,
};

Expand Down
11 changes: 11 additions & 0 deletions packages/cheqd-blockchain-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @docknetwork/cheqd-blockchain-modules

## 0.17.0

### Minor Changes

- Fix `JSON` import + misc tweaks

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.26.0

## 0.16.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/cheqd-blockchain-modules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/cheqd-blockchain-modules",
"version": "0.16.0",
"version": "0.17.0",
"type": "module",
"license": "MIT",
"main": "./dist/esm/index.js",
Expand Down Expand Up @@ -33,7 +33,7 @@
"node": ">=18.0.0"
},
"dependencies": {
"@docknetwork/credential-sdk": "0.25.0"
"@docknetwork/credential-sdk": "0.26.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
Expand All @@ -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.19.0",
"@docknetwork/cheqd-blockchain-api": "0.20.0",
"@rollup/plugin-alias": "^4.0.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/credential-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @docknetwork/credential-sdk

## 0.26.0

### Minor Changes

- Fix `JSON` import + misc tweaks

## 0.25.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/credential-sdk",
"version": "0.25.0",
"version": "0.26.0",
"license": "MIT",
"type": "module",
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import withFromDockId, {
patchWithFromDock,
} from '../generic/with-from-dock-id';
import dockDidById from '../../utils/dock-did-by-id.json';
import dockDidById from '../../utils/dock-did-by-id';

export class DockAccumulatorIdValue extends sized(TypedBytes) {
static Size = 32;
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-sdk/src/types/blob/blob-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import withFromDockId, {
} from '../generic/with-from-dock-id';
import { CheqdBlobQualifier, DockBlobQualifier } from './const';
import { CheqdMainnetDid, CheqdTestnetDid, DidRef } from '../did';
import dockDidById from '../../utils/dock-did-by-id.json';
import dockDidById from '../../utils/dock-did-by-id';

export class BlobId extends withFrom(
withQualifier(TypedEnum, true),
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-sdk/src/types/did/document/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class DIDDocument extends withFrom(
const idx = this.controller.findIndex((ctrl) => ctrl.eq(controller));
// eslint-disable-next-line
if (!~idx) {
throw new Error(`Controller \`${controller}\` doesn't exists`);
throw new Error(`Controller \`${controller}\` doesn't exist`);
}
this.controller.splice(idx, 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
DockStatusList2021Qualifier,
CheqdStatusList2021Qualifier,
} from '../../vc/constants';
import dockDidById from '../../utils/dock-did-by-id.json';
import dockDidById from '../../utils/dock-did-by-id';

export class StatusListCredentialId extends withFrom(
withQualifier(TypedEnum, true),
Expand Down
Loading

0 comments on commit 9c2ba4c

Please sign in to comment.