diff --git a/.eslintrc.json b/.eslintrc.json index a72685098..202f7660a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -49,6 +49,7 @@ "no-useless-constructor": "off", "no-console": "off", "no-else-return": "off", + "import/extensions": "off", "no-restricted-syntax": [ "error", { diff --git a/examples/CHANGELOG.md b/examples/CHANGELOG.md index 84202c986..263766f44 100644 --- a/examples/CHANGELOG.md +++ b/examples/CHANGELOG.md @@ -1,5 +1,18 @@ # @docknetwork/sdk-examples +## 0.4.0 + +### Minor Changes + +- Fix exports + +### Patch Changes + +- Updated dependencies + - @docknetwork/dock-blockchain-modules@0.5.0 + - @docknetwork/dock-blockchain-api@0.4.0 + - @docknetwork/credential-sdk@0.5.0 + ## 0.3.0 ### Minor Changes diff --git a/examples/bbs-dock.js b/examples/bbs-dock.js index 419799137..8988d3e81 100644 --- a/examples/bbs-dock.js +++ b/examples/bbs-dock.js @@ -1,6 +1,6 @@ import { initializeWasm } from '@docknetwork/credential-sdk/crypto'; import { Resolver } from '@docknetwork/credential-sdk/resolver'; -import Bls12381G2KeyPairDock2022 from '@docknetwork/credential-sdk/vc/crypto/Bls12381G2KeyPairDock2022'; +import { Bls12381G2KeyPairDock2022 } from '@docknetwork/credential-sdk/vc/crypto'; import { issueCredential, verifyCredential, diff --git a/examples/loader.mjs b/examples/loader.mjs deleted file mode 100644 index 5ff5be1fd..000000000 --- a/examples/loader.mjs +++ /dev/null @@ -1,26 +0,0 @@ -const solutions = [ - (s) => s, - (s) => `${s}/index.js`, - (s) => `${s}.js`, - (s) => `${s}/lib/index.js`, -]; - -export async function resolve(specifier, context, defaultResolve) { - for (const solve of solutions) { - const resolvedPath = solve(specifier); - - try { - return await defaultResolve(resolvedPath, context, defaultResolve); - } catch (err) { - if ( - err.code !== "ERR_MODULE_NOT_FOUND" && - err.code !== "ERR_PACKAGE_PATH_NOT_EXPORTED" && - err.code !== "ERR_UNSUPPORTED_DIR_IMPORT" - ) { - console.error(`Error resolving path: ${resolvedPath}`, err); - } - } - } - - throw new Error(`Module not found: ${specifier}`); -} diff --git a/examples/package.json b/examples/package.json index 5a2d4655a..1a20161e7 100644 --- a/examples/package.json +++ b/examples/package.json @@ -2,26 +2,26 @@ "name": "@docknetwork/sdk-examples", "private": true, "type": "module", - "version": "0.3.0", + "version": "0.4.0", "scripts": { - "bbs-dock-example": "babel-node --loader=./loader.mjs ./bbs-dock.js", - "claim-deduction-example": "babel-node --loader=./loader.mjs ./claim-deduction.js", - "open-badges-example": "babel-node --loader=./loader.mjs ./open-badges.js", - "schema-validation-example": "babel-node --loader=./loader.mjs ./schema-validation.js", - "standard-schemas-example": "babel-node --loader=./loader.mjs ./standard-schemas.js", - "dock-did-example": "babel-node --loader=./loader.mjs ./dock-did.js", - "did-resolver-example": "babel-node --loader=./loader.mjs ./resolver.js", - "schema-example": "babel-node --loader=./loader.mjs ./schema.js", - "blob-example": "babel-node --loader=./loader.mjs ./blob.js", - "anchor-example": "babel-node --loader=./loader.mjs ./anchor.js", + "bbs-dock-example": "babel-node ./bbs-dock.js", + "claim-deduction-example": "babel-node ./claim-deduction.js", + "open-badges-example": "babel-node ./open-badges.js", + "schema-validation-example": "babel-node ./schema-validation.js", + "standard-schemas-example": "babel-node ./standard-schemas.js", + "dock-did-example": "babel-node ./dock-did.js", + "did-resolver-example": "babel-node ./resolver.js", + "schema-example": "babel-node ./schema.js", + "blob-example": "babel-node ./blob.js", + "anchor-example": "babel-node ./anchor.js", "examples": "yarn bbs-dock-example && yarn claim-deduction-example && yarn open-badges-example && yarn schema-validation-example && yarn standard-schemas-example && yarn dock-did-example && yarn did-resolver-example && yarn schema-example && yarn blob-example && yarn anchor-example", "examples-with-node": "../scripts/with_dock_docker_test_node yarn examples", "lint": "eslint \"*.js\"" }, "dependencies": { - "@docknetwork/credential-sdk": "0.4.0", - "@docknetwork/dock-blockchain-api": "0.3.0", - "@docknetwork/dock-blockchain-modules": "0.4.0" + "@docknetwork/credential-sdk": "0.5.0", + "@docknetwork/dock-blockchain-api": "0.4.0", + "@docknetwork/dock-blockchain-modules": "0.5.0" }, "devDependencies": { "babel-eslint": "^10.1.0", diff --git a/examples/schema-validation.js b/examples/schema-validation.js index 8e07422fc..15a7f3033 100644 --- a/examples/schema-validation.js +++ b/examples/schema-validation.js @@ -1,7 +1,7 @@ import { Schema } from '@docknetwork/credential-sdk/modules/abstract/schema'; // BOL Schema, its valid -import bolSchema from './schemas/bol'; +import bolSchema from './schemas/bol.js'; // Invalid example schema const invalidSchema = { diff --git a/examples/schemas/immunity_event_record.js b/examples/schemas/immunity_event_record.js index 4a23e8851..29808bd98 100644 --- a/examples/schemas/immunity_event_record.js +++ b/examples/schemas/immunity_event_record.js @@ -1,4 +1,4 @@ -import proofOfHealthCoreSchema from "./proof_of_health_core"; +import proofOfHealthCoreSchema from "./proof_of_health_core.js"; const schema = { $schema: "http://json-schema.org/draft-07/schema#", diff --git a/examples/schemas/infection_diagnosis.js b/examples/schemas/infection_diagnosis.js index a1eb9a929..0716fe14d 100644 --- a/examples/schemas/infection_diagnosis.js +++ b/examples/schemas/infection_diagnosis.js @@ -1,4 +1,4 @@ -import proofOfHealthCoreSchema from "./proof_of_health_core"; +import proofOfHealthCoreSchema from "./proof_of_health_core.js"; const schema = { $schema: "http://json-schema.org/draft-07/schema#", diff --git a/examples/schemas/non_infection_check.js b/examples/schemas/non_infection_check.js index 9bfddbb00..60feb5d17 100644 --- a/examples/schemas/non_infection_check.js +++ b/examples/schemas/non_infection_check.js @@ -1,4 +1,4 @@ -import proofOfHealthCoreSchema from "./proof_of_health_core"; +import proofOfHealthCoreSchema from "./proof_of_health_core.js"; const schema = { $schema: "http://json-schema.org/draft-07/schema#", diff --git a/examples/standard-schemas.js b/examples/standard-schemas.js index 661c6995c..d87df46d1 100644 --- a/examples/standard-schemas.js +++ b/examples/standard-schemas.js @@ -5,10 +5,10 @@ import { validateCredentialSchema, } from '@docknetwork/credential-sdk/vc'; -import prCardSchema from './schemas/pr_card'; -import infectionDiagnosisSchema from './schemas/infection_diagnosis'; -import immunityEventRecordSchema from './schemas/immunity_event_record'; -import noInfectionSchema from './schemas/non_infection_check'; +import prCardSchema from './schemas/pr_card.js'; +import infectionDiagnosisSchema from './schemas/infection_diagnosis.js'; +import immunityEventRecordSchema from './schemas/immunity_event_record.js'; +import noInfectionSchema from './schemas/non_infection_check.js'; // Schema from here https://github.com/w3c-ccg/vc-examples/blob/master/plugfest-2020/vendors/sicpa/credentials/PermanentResidentCard.json const credPRCard = { diff --git a/package.json b/package.json index a4126ad26..8372de77f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "root", - "version": "0.4.0", + "version": "0.5.0", "private": true, "workspaces": [ "packages/*", diff --git a/packages/cheqd-blockchain-api/CHANGELOG.md b/packages/cheqd-blockchain-api/CHANGELOG.md index 72613c08c..642c0a41d 100644 --- a/packages/cheqd-blockchain-api/CHANGELOG.md +++ b/packages/cheqd-blockchain-api/CHANGELOG.md @@ -1,5 +1,11 @@ # @docknetwork/cheqd-blockchain-api +## 0.4.0 + +### Minor Changes + +- Fix exports + ## 0.3.0 ### Minor Changes diff --git a/packages/cheqd-blockchain-api/package.json b/packages/cheqd-blockchain-api/package.json index 65aca5dfd..61d23043e 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.3.0", + "version": "0.4.0", "license": "MIT", "main": "./dist/esm/index.js", "type": "module", @@ -11,13 +11,13 @@ "exports": { ".": { "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js", + "require": "./dist/cjs/index.cjs", "default": "./dist/esm/index.js" }, "./*": { - "import": "./dist/esm/*", - "require": "./dist/cjs/*", - "default": "./dist/esm/*" + "import": "./dist/esm/*/index.js", + "require": "./dist/cjs/*/index.cjs", + "default": "./dist/esm/*/index.js" } }, "repository": { diff --git a/packages/cheqd-blockchain-modules/CHANGELOG.md b/packages/cheqd-blockchain-modules/CHANGELOG.md index cced69ade..a4d409e33 100644 --- a/packages/cheqd-blockchain-modules/CHANGELOG.md +++ b/packages/cheqd-blockchain-modules/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/cheqd-blockchain-modules +## 0.5.0 + +### Minor Changes + +- Fix exports + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.5.0 + ## 0.4.0 ### Minor Changes diff --git a/packages/cheqd-blockchain-modules/package.json b/packages/cheqd-blockchain-modules/package.json index 73243de0c..a6f8ca725 100644 --- a/packages/cheqd-blockchain-modules/package.json +++ b/packages/cheqd-blockchain-modules/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/cheqd-blockchain-modules", - "version": "0.4.0", + "version": "0.5.0", "type": "module", "license": "MIT", "main": "./dist/esm/index.js", @@ -11,13 +11,13 @@ "exports": { ".": { "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js", + "require": "./dist/cjs/index.cjs", "default": "./dist/esm/index.js" }, "./*": { - "import": "./dist/esm/*", - "require": "./dist/cjs/*", - "default": "./dist/esm/*" + "import": "./dist/esm/*/index.js", + "require": "./dist/cjs/*/index.cjs", + "default": "./dist/esm/*/index.js" } }, "repository": { @@ -28,7 +28,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@docknetwork/credential-sdk": "0.4.0" + "@docknetwork/credential-sdk": "0.5.0" }, "devDependencies": { "@babel/cli": "^7.24.1", @@ -37,7 +37,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.3.0", + "@docknetwork/cheqd-blockchain-api": "0.4.0", "@rollup/plugin-alias": "^4.0.2", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^24.0.0", diff --git a/packages/cheqd-blockchain-modules/src/attest/module.js b/packages/cheqd-blockchain-modules/src/attest/module.js index 2a92591cf..81df0037b 100644 --- a/packages/cheqd-blockchain-modules/src/attest/module.js +++ b/packages/cheqd-blockchain-modules/src/attest/module.js @@ -1,4 +1,4 @@ -import AbstractAttestModule from '@docknetwork/credential-sdk/modules/abstract/attest/module'; +import { AbstractAttestModule } from '@docknetwork/credential-sdk/modules'; import { injectCheqd } from '../common'; import CheqdInternalAttestModule from './internal'; diff --git a/packages/cheqd-blockchain-modules/src/blob/module.js b/packages/cheqd-blockchain-modules/src/blob/module.js index c49cff2f6..439d63d7d 100644 --- a/packages/cheqd-blockchain-modules/src/blob/module.js +++ b/packages/cheqd-blockchain-modules/src/blob/module.js @@ -1,5 +1,5 @@ -import AbstractBlobModule from '@docknetwork/credential-sdk/modules/abstract/blob/module'; -import { NoBlobError } from '@docknetwork/credential-sdk/modules/abstract/blob/errors'; +import { AbstractBlobModule } from '@docknetwork/credential-sdk/modules'; +import { NoBlobError } from '@docknetwork/credential-sdk/modules/abstract/blob'; import { CheqdBlobId } from '@docknetwork/credential-sdk/types'; import { injectCheqd } from '../common'; import CheqdInternalBlobModule from './internal'; diff --git a/packages/cheqd-blockchain-modules/src/common/cheqd-api-provider.js b/packages/cheqd-blockchain-modules/src/common/cheqd-api-provider.js index 517d4b5c5..cba3003f8 100644 --- a/packages/cheqd-blockchain-modules/src/common/cheqd-api-provider.js +++ b/packages/cheqd-blockchain-modules/src/common/cheqd-api-provider.js @@ -1,5 +1,5 @@ import { ApiProvider } from '@docknetwork/credential-sdk/modules/abstract/common'; -import { ensureInstanceOf } from '@docknetwork/credential-sdk/utils/type-helpers'; +import { ensureInstanceOf } from '@docknetwork/credential-sdk/utils'; class CheqdApiProvider extends ApiProvider { constructor(cheqd) { diff --git a/packages/cheqd-blockchain-modules/src/common/inject-cheqd.js b/packages/cheqd-blockchain-modules/src/common/inject-cheqd.js index d9319b432..cebd60980 100644 --- a/packages/cheqd-blockchain-modules/src/common/inject-cheqd.js +++ b/packages/cheqd-blockchain-modules/src/common/inject-cheqd.js @@ -1,4 +1,4 @@ -import { withExtendedStaticProperties } from '@docknetwork/credential-sdk/utils/inheritance'; +import { withExtendedStaticProperties } from '@docknetwork/credential-sdk/utils'; import CheqdAPIProvider from './cheqd-api-provider'; export default function injectCheqd(klass) { diff --git a/packages/cheqd-blockchain-modules/src/did/internal.js b/packages/cheqd-blockchain-modules/src/did/internal.js index 122a63410..6d09fb6b4 100644 --- a/packages/cheqd-blockchain-modules/src/did/internal.js +++ b/packages/cheqd-blockchain-modules/src/did/internal.js @@ -3,7 +3,7 @@ import { TypedUUID, TypedStruct, } from '@docknetwork/credential-sdk/types/generic'; -import { DIDDocument } from '@docknetwork/credential-sdk/types/did/document'; +import { DIDDocument } from '@docknetwork/credential-sdk/types/did'; import { createInternalCheqdModule } from '../common'; const parseDocument = (document) => DIDDocument.from(document).toCheqd(); diff --git a/packages/credential-sdk/CHANGELOG.md b/packages/credential-sdk/CHANGELOG.md index b3df2953d..731c033b2 100644 --- a/packages/credential-sdk/CHANGELOG.md +++ b/packages/credential-sdk/CHANGELOG.md @@ -1,5 +1,11 @@ # @docknetwork/credential-sdk +## 0.5.0 + +### Minor Changes + +- Fix exports + ## 0.4.0 ### Minor Changes diff --git a/packages/credential-sdk/package.json b/packages/credential-sdk/package.json index f3cf43118..e3cea8a1f 100644 --- a/packages/credential-sdk/package.json +++ b/packages/credential-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/credential-sdk", - "version": "0.4.0", + "version": "0.5.0", "license": "MIT", "type": "module", "files": [ @@ -9,13 +9,13 @@ "exports": { ".": { "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js", + "require": "./dist/cjs/index.cjs", "default": "./dist/esm/index.js" }, "./*": { - "import": "./dist/esm/*", - "require": "./dist/cjs/*", - "default": "./dist/esm/*" + "import": "./dist/esm/*/index.js", + "require": "./dist/cjs/*/index.cjs", + "default": "./dist/esm/*/index.js" } }, "repository": { @@ -30,7 +30,7 @@ "@digitalcredentials/vc-status-list": "^8.0.0", "@docknetwork/crypto-wasm-ts": "^0.63.0", "@juanelas/base64": "^1.1.5", - "@stablelib/ed25519": "^2.0.0", + "@stablelib/ed25519": "^1.0.0", "@subsquid/ss58-codec": "latest", "@transmute/json-web-signature": "^0.7.0-unstable.82", "blakejs": "^1.2.1", diff --git a/packages/credential-sdk/src/crypto/index.js b/packages/credential-sdk/src/crypto/index.js index 9901d0768..e4bb9e591 100644 --- a/packages/credential-sdk/src/crypto/index.js +++ b/packages/credential-sdk/src/crypto/index.js @@ -1 +1 @@ -export * from '@docknetwork/crypto-wasm-ts'; +export * from '@docknetwork/crypto-wasm-ts/lib/index.js'; diff --git a/packages/credential-sdk/src/modules/abstract/blob/index.js b/packages/credential-sdk/src/modules/abstract/blob/index.js index c65e80080..c86c03e48 100644 --- a/packages/credential-sdk/src/modules/abstract/blob/index.js +++ b/packages/credential-sdk/src/modules/abstract/blob/index.js @@ -1 +1,2 @@ export { default as AbstractBlobModule } from './module'; +export * from './errors'; diff --git a/packages/credential-sdk/src/vc/crypto/Bls12381BBDT16MACDock2024.js b/packages/credential-sdk/src/vc/crypto/Bls12381BBDT16MACDock2024.js index a746d62c6..78c31e241 100644 --- a/packages/credential-sdk/src/vc/crypto/Bls12381BBDT16MACDock2024.js +++ b/packages/credential-sdk/src/vc/crypto/Bls12381BBDT16MACDock2024.js @@ -1,7 +1,4 @@ -import { - BBDT16Credential, - BBDT16CredentialBuilder, -} from '@docknetwork/crypto-wasm-ts/'; +import { BBDT16Credential, BBDT16CredentialBuilder } from '../../crypto'; import { Bls12381BBDT16MacDockName } from './constants'; diff --git a/packages/credential-sdk/src/vc/crypto/Bls12381BDDT16MACDock2024.js b/packages/credential-sdk/src/vc/crypto/Bls12381BDDT16MACDock2024.js index a746d62c6..78c31e241 100644 --- a/packages/credential-sdk/src/vc/crypto/Bls12381BDDT16MACDock2024.js +++ b/packages/credential-sdk/src/vc/crypto/Bls12381BDDT16MACDock2024.js @@ -1,7 +1,4 @@ -import { - BBDT16Credential, - BBDT16CredentialBuilder, -} from '@docknetwork/crypto-wasm-ts/'; +import { BBDT16Credential, BBDT16CredentialBuilder } from '../../crypto'; import { Bls12381BBDT16MacDockName } from './constants'; diff --git a/packages/credential-sdk/src/vc/crypto/common/DockCryptoSignature.js b/packages/credential-sdk/src/vc/crypto/common/DockCryptoSignature.js index a796b2dfe..8b4259feb 100644 --- a/packages/credential-sdk/src/vc/crypto/common/DockCryptoSignature.js +++ b/packages/credential-sdk/src/vc/crypto/common/DockCryptoSignature.js @@ -8,7 +8,7 @@ import jsonld from 'jsonld'; import jsigs from 'jsonld-signatures'; import stringify from 'json-stringify-deterministic'; -import semver from 'semver/preload'; +import semver from 'semver/preload.js'; import { u8aToU8a } from '../../../utils/bytes'; import { withExtendedStaticProperties } from '../../../utils/inheritance'; import CustomLinkedDataSignature from './CustomLinkedDataSignature'; diff --git a/packages/credential-sdk/src/vc/crypto/index.js b/packages/credential-sdk/src/vc/crypto/index.js new file mode 100644 index 000000000..3e6c77ce0 --- /dev/null +++ b/packages/credential-sdk/src/vc/crypto/index.js @@ -0,0 +1,23 @@ +export { default as Bls12381BBDT16KeyPairDock2024 } from './Bls12381BBDT16KeyPairDock2024'; +export { default as Bls12381BBDT16MACDock2024 } from './Bls12381BBDT16MACDock2024'; +export { default as Bls12381BBDT16MACProofDock2024 } from './Bls12381BBDT16MACProofDock2024'; +export { default as Bls12381BBSKeyPairDock2023 } from './Bls12381BBSKeyPairDock2023'; +export { default as Bls12381BBSSignatureDock2022 } from './Bls12381BBSSignatureDock2022'; +export { default as Bls12381BBSSignatureDock2023 } from './Bls12381BBSSignatureDock2023'; +export { default as Bls12381BBSSignatureProofDock2022 } from './Bls12381BBSSignatureProofDock2022'; +export { default as Bls12381BBSSignatureProofDock2023 } from './Bls12381BBSSignatureProofDock2023'; +export { default as Bls12381BDDT16KeyPairDock2024 } from './Bls12381BDDT16KeyPairDock2024'; +export { default as Bls12381BDDT16MACDock2024 } from './Bls12381BDDT16MACDock2024'; +export { default as Bls12381BDDT16MACProofDock2024 } from './Bls12381BDDT16MACProofDock2024'; +export { default as Bls12381G2KeyPairDock2022 } from './Bls12381G2KeyPairDock2022'; +export { default as Bls12381PSKeyPairDock2023 } from './Bls12381PSKeyPairDock2023'; +export { default as Bls12381PSSignatureDock2023 } from './Bls12381PSSignatureDock2023'; +export { default as Bls12381PSSignatureProofDock2023 } from './Bls12381PSSignatureProofDock2023'; +export { default as EcdsaSecp256k1Signature2019 } from './EcdsaSecp256k1Signature2019'; +export { default as EcdsaSecp256k1VerificationKey2019 } from './EcdsaSecp256k1VerificationKey2019'; +export { default as Ed25519Signature2018 } from './Ed25519Signature2018'; +export { default as Ed25519Signature2020 } from './Ed25519Signature2020'; +export { default as Ed25519VerificationKey2018 } from './Ed25519VerificationKey2018'; +export { default as Ed25519VerificationKey2020 } from './Ed25519VerificationKey2020'; +export { default as JsonWebSignature2020 } from './JsonWebSignature2020'; +export * from './constants'; diff --git a/packages/dock-blockchain-api/CHANGELOG.md b/packages/dock-blockchain-api/CHANGELOG.md index 16e4ec64a..c38e71a2a 100644 --- a/packages/dock-blockchain-api/CHANGELOG.md +++ b/packages/dock-blockchain-api/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/dock-blockchain-api +## 0.4.0 + +### Minor Changes + +- Fix exports + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.5.0 + ## 0.3.0 ### Minor Changes diff --git a/packages/dock-blockchain-api/package.json b/packages/dock-blockchain-api/package.json index d6529bec1..a561fc1f6 100644 --- a/packages/dock-blockchain-api/package.json +++ b/packages/dock-blockchain-api/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/dock-blockchain-api", - "version": "0.3.0", + "version": "0.4.0", "license": "MIT", "main": "./dist/esm/index.js", "type": "module", @@ -11,13 +11,13 @@ "exports": { ".": { "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js", + "require": "./dist/cjs/index.cjs", "default": "./dist/esm/index.js" }, "./*": { - "import": "./dist/esm/*", - "require": "./dist/cjs/*", - "default": "./dist/esm/*" + "import": "./dist/esm/*/index.js", + "require": "./dist/cjs/*/index.cjs", + "default": "./dist/esm/*/index.js" } }, "repository": { @@ -84,7 +84,7 @@ "@polkadot/api": "10.12.4" }, "dependencies": { - "@docknetwork/credential-sdk": "0.4.0", + "@docknetwork/credential-sdk": "0.5.0", "@docknetwork/node-types": "^0.17.0", "@juanelas/base64": "^1.0.5", "@polkadot/api": "10.12.4", diff --git a/packages/dock-blockchain-api/scripts/loader.mjs b/packages/dock-blockchain-api/scripts/loader.mjs deleted file mode 100644 index 5ff5be1fd..000000000 --- a/packages/dock-blockchain-api/scripts/loader.mjs +++ /dev/null @@ -1,26 +0,0 @@ -const solutions = [ - (s) => s, - (s) => `${s}/index.js`, - (s) => `${s}.js`, - (s) => `${s}/lib/index.js`, -]; - -export async function resolve(specifier, context, defaultResolve) { - for (const solve of solutions) { - const resolvedPath = solve(specifier); - - try { - return await defaultResolve(resolvedPath, context, defaultResolve); - } catch (err) { - if ( - err.code !== "ERR_MODULE_NOT_FOUND" && - err.code !== "ERR_PACKAGE_PATH_NOT_EXPORTED" && - err.code !== "ERR_UNSUPPORTED_DIR_IMPORT" - ) { - console.error(`Error resolving path: ${resolvedPath}`, err); - } - } - } - - throw new Error(`Module not found: ${specifier}`); -} diff --git a/packages/dock-blockchain-api/src/api/retry.js b/packages/dock-blockchain-api/src/api/retry.js index fbb1e6f3a..bd1e5ee16 100644 --- a/packages/dock-blockchain-api/src/api/retry.js +++ b/packages/dock-blockchain-api/src/api/retry.js @@ -1,7 +1,7 @@ import { createSubmittable } from '@polkadot/api/submittable'; import { SubmittableResult } from '@polkadot/api/cjs/submittable/Result'; import { filterEvents } from '@polkadot/api/util'; -import { retry } from '@docknetwork/credential-sdk/utils/async'; +import { retry } from '@docknetwork/credential-sdk/utils'; import { ensureExtrinsicSucceeded, findExtrinsicBlock, diff --git a/packages/dock-blockchain-api/src/utils/block.js b/packages/dock-blockchain-api/src/utils/block.js index 6211c4653..0d5b9041a 100644 --- a/packages/dock-blockchain-api/src/utils/block.js +++ b/packages/dock-blockchain-api/src/utils/block.js @@ -4,7 +4,7 @@ import { ApiPromise } from "@polkadot/api"; // eslint-disable-line import { ReusablePromiseMap, ReusablePromise, -} from '@docknetwork/credential-sdk/utils/async'; +} from '@docknetwork/credential-sdk/utils'; /** * Fetches and caches blocks by their hashes and optionally numbers. diff --git a/packages/dock-blockchain-api/src/utils/index.js b/packages/dock-blockchain-api/src/utils/index.js new file mode 100644 index 000000000..05e6a9f1c --- /dev/null +++ b/packages/dock-blockchain-api/src/utils/index.js @@ -0,0 +1,3 @@ +export * from './block'; +export * from './extrinsic'; +export * from './chain-ops'; diff --git a/packages/dock-blockchain-modules/CHANGELOG.md b/packages/dock-blockchain-modules/CHANGELOG.md index 46f73eba2..79990b480 100644 --- a/packages/dock-blockchain-modules/CHANGELOG.md +++ b/packages/dock-blockchain-modules/CHANGELOG.md @@ -1,5 +1,16 @@ # @docknetwork/dock-blockchain-modules +## 0.5.0 + +### Minor Changes + +- Fix exports + +### Patch Changes + +- Updated dependencies + - @docknetwork/credential-sdk@0.5.0 + ## 0.4.0 ### Minor Changes diff --git a/packages/dock-blockchain-modules/package.json b/packages/dock-blockchain-modules/package.json index 0afecf386..8cb2b0272 100644 --- a/packages/dock-blockchain-modules/package.json +++ b/packages/dock-blockchain-modules/package.json @@ -1,6 +1,6 @@ { "name": "@docknetwork/dock-blockchain-modules", - "version": "0.4.0", + "version": "0.5.0", "license": "MIT", "type": "module", "main": "./dist/esm/index.js", @@ -11,13 +11,13 @@ "exports": { ".": { "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js", + "require": "./dist/cjs/index.cjs", "default": "./dist/esm/index.js" }, "./*": { - "import": "./dist/esm/*", - "require": "./dist/cjs/*", - "default": "./dist/esm/*" + "import": "./dist/esm/*/index.js", + "require": "./dist/cjs/*/index.cjs", + "default": "./dist/esm/*/index.js" } }, "repository": { @@ -28,7 +28,7 @@ "node": ">=18.0.0" }, "dependencies": { - "@docknetwork/credential-sdk": "0.4.0" + "@docknetwork/credential-sdk": "0.5.0" }, "devDependencies": { "@babel/cli": "^7.24.1", @@ -37,7 +37,7 @@ "@babel/plugin-syntax-import-attributes": "^7.25.6", "@babel/plugin-transform-modules-commonjs": "^7.24.1", "@babel/preset-env": "^7.24.3", - "@docknetwork/dock-blockchain-api": "0.3.0", + "@docknetwork/dock-blockchain-api": "0.4.0", "@rollup/plugin-alias": "^4.0.2", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^24.0.0", diff --git a/packages/dock-blockchain-modules/src/accumulator/index.js b/packages/dock-blockchain-modules/src/accumulator/index.js new file mode 100644 index 000000000..07e2ba137 --- /dev/null +++ b/packages/dock-blockchain-modules/src/accumulator/index.js @@ -0,0 +1,3 @@ +export * from './actions'; +export { default as DockAccumulatorModuleInternal } from './internal'; +export { default as DockAccumulatorModule } from './module'; diff --git a/packages/dock-blockchain-modules/src/accumulator/module.js b/packages/dock-blockchain-modules/src/accumulator/module.js index 36765fef4..3ed9d6160 100644 --- a/packages/dock-blockchain-modules/src/accumulator/module.js +++ b/packages/dock-blockchain-modules/src/accumulator/module.js @@ -12,7 +12,7 @@ import { DockAccumulatorIdIdent, } from '@docknetwork/credential-sdk/types'; import { option, withProp } from '@docknetwork/credential-sdk/types/generic'; -import { AbstractAccumulatorModule } from '@docknetwork/credential-sdk/modules/abstract/accumulator'; +import { AbstractAccumulatorModule } from '@docknetwork/credential-sdk/modules/abstract'; import DockInternalAccumulatorModule from './internal'; import { withParamsAndPublicKeys } from '../common'; diff --git a/packages/dock-blockchain-modules/src/anchor/index.js b/packages/dock-blockchain-modules/src/anchor/index.js new file mode 100644 index 000000000..70df9a347 --- /dev/null +++ b/packages/dock-blockchain-modules/src/anchor/index.js @@ -0,0 +1,2 @@ +export { default as DockAnchorModuleInternal } from './internal'; +export { default as DockAnchorModule } from './module'; diff --git a/packages/dock-blockchain-modules/src/attest/index.js b/packages/dock-blockchain-modules/src/attest/index.js new file mode 100644 index 000000000..28876b6ec --- /dev/null +++ b/packages/dock-blockchain-modules/src/attest/index.js @@ -0,0 +1,3 @@ +export * from './actions'; +export { default as DockAttestModuleInternal } from './internal'; +export { default as DockAttestModule } from './module'; diff --git a/packages/dock-blockchain-modules/src/attest/module.js b/packages/dock-blockchain-modules/src/attest/module.js index b480b89dd..f87f50051 100644 --- a/packages/dock-blockchain-modules/src/attest/module.js +++ b/packages/dock-blockchain-modules/src/attest/module.js @@ -1,4 +1,4 @@ -import AbstractAttestModule from '@docknetwork/credential-sdk/modules/abstract/attest/module'; +import { AbstractAttestModule } from '@docknetwork/credential-sdk/modules'; import { ensureTargetKeypair, injectDock } from '../common'; import DockInternalAttestModule from './internal'; diff --git a/packages/dock-blockchain-modules/src/blob/index.js b/packages/dock-blockchain-modules/src/blob/index.js new file mode 100644 index 000000000..42567c799 --- /dev/null +++ b/packages/dock-blockchain-modules/src/blob/index.js @@ -0,0 +1,4 @@ +export * from './actions'; +export { default as DockBlobModuleInternal } from './internal'; +export { default as DockBlobModule } from './module'; +export * from './types'; diff --git a/packages/dock-blockchain-modules/src/blob/module.js b/packages/dock-blockchain-modules/src/blob/module.js index 62cbc7a66..d2e042da8 100644 --- a/packages/dock-blockchain-modules/src/blob/module.js +++ b/packages/dock-blockchain-modules/src/blob/module.js @@ -1,13 +1,12 @@ -import { NoBlobError } from '@docknetwork/credential-sdk/modules/abstract/blob/errors'; +import { NoBlobError, AbstractBlobModule } from '@docknetwork/credential-sdk/modules/abstract/blob'; import { option } from '@docknetwork/credential-sdk/types/generic'; import { DockBlobId } from '@docknetwork/credential-sdk/types'; -import { AbstractBlobModule } from '@docknetwork/credential-sdk/modules/abstract/blob'; import { injectDock } from '../common'; import { OwnerWithBlob } from './types'; import DockBlobModuleInternal from './internal'; /** Class to create and update Blobs on chain. */ -export default class BlobModule extends injectDock(AbstractBlobModule) { +export default class DockBlobModule extends injectDock(AbstractBlobModule) { static DockOnly = DockBlobModuleInternal; /** diff --git a/packages/dock-blockchain-modules/src/common/builders.js b/packages/dock-blockchain-modules/src/common/builders.js index b581f444e..5de3464e9 100644 --- a/packages/dock-blockchain-modules/src/common/builders.js +++ b/packages/dock-blockchain-modules/src/common/builders.js @@ -3,7 +3,7 @@ import { ensureInstanceOf, } from '@docknetwork/credential-sdk/utils'; import { DockDidOrDidMethodKey } from '@docknetwork/credential-sdk/types/did'; -import DidKeypair from '@docknetwork/credential-sdk/keypairs/did-keypair'; +import { DidKeypair } from '@docknetwork/credential-sdk/keypairs'; const fnNameToMethodName = (methodName) => `${methodName[0].toUpperCase()}${methodName.slice(1)}`; diff --git a/packages/dock-blockchain-modules/src/common/dock-api-provider.js b/packages/dock-blockchain-modules/src/common/dock-api-provider.js index a9487220d..7e194e4b9 100644 --- a/packages/dock-blockchain-modules/src/common/dock-api-provider.js +++ b/packages/dock-blockchain-modules/src/common/dock-api-provider.js @@ -1,6 +1,6 @@ import { ApiProvider } from '@docknetwork/credential-sdk/modules/abstract/common'; -import { ensureInstanceOf } from '@docknetwork/credential-sdk/utils/type-helpers'; -import { DockDIDModuleInternal } from '../did/internal'; +import { ensureInstanceOf } from '@docknetwork/credential-sdk/utils'; +import DockDIDModuleInternal from '../did/internal'; class DockApiProvider extends ApiProvider { constructor(dock) { diff --git a/packages/dock-blockchain-modules/src/common/inject-dock.js b/packages/dock-blockchain-modules/src/common/inject-dock.js index c2f36de1e..d6dced19b 100644 --- a/packages/dock-blockchain-modules/src/common/inject-dock.js +++ b/packages/dock-blockchain-modules/src/common/inject-dock.js @@ -1,4 +1,4 @@ -import { withExtendedStaticProperties } from '@docknetwork/credential-sdk/utils/inheritance'; +import { withExtendedStaticProperties } from '@docknetwork/credential-sdk/utils'; import DockApiProvider from './dock-api-provider'; export default function injectDock(klass) { diff --git a/packages/dock-blockchain-modules/src/common/with-params-and-public-keys.js b/packages/dock-blockchain-modules/src/common/with-params-and-public-keys.js index 18756846b..9eaae4bfa 100644 --- a/packages/dock-blockchain-modules/src/common/with-params-and-public-keys.js +++ b/packages/dock-blockchain-modules/src/common/with-params-and-public-keys.js @@ -11,7 +11,7 @@ import { DockDidOrDidMethodKey } from '@docknetwork/credential-sdk/types'; import { isEqualToOrPrototypeOf, withExtendedStaticProperties, -} from '@docknetwork/credential-sdk/utils/inheritance'; +} from '@docknetwork/credential-sdk/utils'; import injectDock from './inject-dock'; /** diff --git a/packages/dock-blockchain-modules/src/did/index.js b/packages/dock-blockchain-modules/src/did/index.js new file mode 100644 index 000000000..faab91422 --- /dev/null +++ b/packages/dock-blockchain-modules/src/did/index.js @@ -0,0 +1,3 @@ +export * from './actions'; +export { default as DockDIDModuleInternal } from './internal'; +export { default as DockDIDModule } from './module'; diff --git a/packages/dock-blockchain-modules/src/did/internal.js b/packages/dock-blockchain-modules/src/did/internal.js index 608b4d73b..23c52ebcf 100644 --- a/packages/dock-blockchain-modules/src/did/internal.js +++ b/packages/dock-blockchain-modules/src/did/internal.js @@ -19,7 +19,7 @@ import { NoDIDError, NoOffchainDIDError, NoOnchainDIDError, -} from '@docknetwork/credential-sdk/modules/abstract/did/errors'; +} from '@docknetwork/credential-sdk/modules/abstract/did'; import { maybeToHuman } from '@docknetwork/credential-sdk/utils'; import { DidMethodKeyDetails } from '@docknetwork/credential-sdk/types/did/onchain'; import { @@ -113,7 +113,7 @@ const accountMethods = { ], }; -export class DockDIDModuleInternal extends createInternalDockModule({ +export default class DockDIDModuleInternal extends createInternalDockModule({ didMethods, accountMethods, }) { diff --git a/packages/dock-blockchain-modules/src/did/module.js b/packages/dock-blockchain-modules/src/did/module.js index fa7572ba4..640680730 100644 --- a/packages/dock-blockchain-modules/src/did/module.js +++ b/packages/dock-blockchain-modules/src/did/module.js @@ -8,8 +8,8 @@ import { DIDDocument, Service, CONTEXT_URI, -} from '@docknetwork/credential-sdk/types/did/document'; -import { DockDIDModuleInternal } from './internal'; +} from '@docknetwork/credential-sdk/types/did'; +import DockDIDModuleInternal from './internal'; import injectDock from '../common/inject-dock'; import DockAttestModule from '../attest/module'; import DockOffchainSignaturesModule from '../offchain-signatures/module'; diff --git a/packages/dock-blockchain-modules/src/offchain-signatures/bbs-plus.js b/packages/dock-blockchain-modules/src/offchain-signatures/bbs-plus.js index 262f75b80..f3b06e4d2 100644 --- a/packages/dock-blockchain-modules/src/offchain-signatures/bbs-plus.js +++ b/packages/dock-blockchain-modules/src/offchain-signatures/bbs-plus.js @@ -8,7 +8,7 @@ import DockOffchainSignaturesModule from './module'; import DockInternalOffchainSignaturesModule from './internal'; /** Class to write `BBS+` parameters and keys on chain */ -export default class BBSPlusModule extends DockOffchainSignaturesModule { +export default class DockBBSPlusModule extends DockOffchainSignaturesModule { static DockOnly = class DockInternalBBSPlusModuleOverrides extends DockInternalOffchainSignaturesModule { static PublicKey = BBSPlusPublicKey; diff --git a/packages/dock-blockchain-modules/src/offchain-signatures/bbs.js b/packages/dock-blockchain-modules/src/offchain-signatures/bbs.js index 5b9635b33..32527b34e 100644 --- a/packages/dock-blockchain-modules/src/offchain-signatures/bbs.js +++ b/packages/dock-blockchain-modules/src/offchain-signatures/bbs.js @@ -5,7 +5,7 @@ import DockOffchainSignaturesModule from './module'; import DockInternalOffchainSignaturesModule from './internal'; /** Class to write `BBS` parameters and keys on chain */ -export default class BBSModule extends DockOffchainSignaturesModule { +export default class DockBBSModule extends DockOffchainSignaturesModule { static DockOnly = class DockInternalBBSModuleOverrides extends DockInternalOffchainSignaturesModule { static PublicKey = BBSPublicKey; diff --git a/packages/dock-blockchain-modules/src/offchain-signatures/index.js b/packages/dock-blockchain-modules/src/offchain-signatures/index.js new file mode 100644 index 000000000..78c093a70 --- /dev/null +++ b/packages/dock-blockchain-modules/src/offchain-signatures/index.js @@ -0,0 +1,5 @@ +export * from './actions'; +export { default as DockBBSModule } from './bbs'; +export { default as DockBBSPlusModule } from './bbs-plus'; +export { default as DockPSModule } from './bbs-plus'; +export { default as DockOffchainSignaturesModule } from './module'; diff --git a/packages/dock-blockchain-modules/src/offchain-signatures/internal.js b/packages/dock-blockchain-modules/src/offchain-signatures/internal.js index ddf19785f..4ece4d91f 100644 --- a/packages/dock-blockchain-modules/src/offchain-signatures/internal.js +++ b/packages/dock-blockchain-modules/src/offchain-signatures/internal.js @@ -12,7 +12,7 @@ import { RemoveOffchainSignatureParams, RemoveOffchainSignaturePublicKey, } from './actions'; -import { DockDIDModuleInternal } from '../did/internal'; +import DockDIDModuleInternal from '../did/internal'; export default class DockInternalOffchainSignaturesModule extends ParamsAndPublicKeys { static Prop = 'offchainSignatures'; diff --git a/packages/dock-blockchain-modules/src/offchain-signatures/ps.js b/packages/dock-blockchain-modules/src/offchain-signatures/ps.js index 0f9e273c1..645187b5c 100644 --- a/packages/dock-blockchain-modules/src/offchain-signatures/ps.js +++ b/packages/dock-blockchain-modules/src/offchain-signatures/ps.js @@ -5,7 +5,7 @@ import DockOffchainSignaturesModule from './module'; import DockInternalOffchainSignaturesModule from './internal'; /** Class to write `Pointcheval-Sanders` parameters and keys on chain */ -export default class PSModule extends DockOffchainSignaturesModule { +export default class DockPSModule extends DockOffchainSignaturesModule { static DockOnly = class DockInternalPSModuleOverrides extends DockInternalOffchainSignaturesModule { static PublicKey = PSPublicKey; diff --git a/packages/dock-blockchain-modules/src/status-list-credential/index.js b/packages/dock-blockchain-modules/src/status-list-credential/index.js new file mode 100644 index 000000000..50b1537ad --- /dev/null +++ b/packages/dock-blockchain-modules/src/status-list-credential/index.js @@ -0,0 +1,4 @@ +export * from './actions'; +export { default as DockInternalStatusListCredentialModule } from './internal'; +export { default as DockStatusListCredentialModule } from './module'; +export * from './types'; diff --git a/packages/dock-blockchain-modules/src/trust-registry/index.js b/packages/dock-blockchain-modules/src/trust-registry/index.js new file mode 100644 index 000000000..8456ee828 --- /dev/null +++ b/packages/dock-blockchain-modules/src/trust-registry/index.js @@ -0,0 +1,3 @@ +export * from './actions'; +export { default as DockInternalTrustRegistryModule } from './internal'; +export { default as DockTrustRegistryModule } from './module'; diff --git a/packages/dock-blockchain-modules/src/trust-registry/internal.js b/packages/dock-blockchain-modules/src/trust-registry/internal.js index 20116c0d6..db2031f17 100644 --- a/packages/dock-blockchain-modules/src/trust-registry/internal.js +++ b/packages/dock-blockchain-modules/src/trust-registry/internal.js @@ -6,10 +6,9 @@ import { import { isHexWithGivenByteSize, u8aToHex, -} from '@docknetwork/credential-sdk/utils/bytes'; -import { ensureMatchesPattern } from '@docknetwork/credential-sdk/utils/misc'; + ensureMatchesPattern, maybeToJSON, +} from '@docknetwork/credential-sdk/utils'; import { IssuersSet } from '@docknetwork/credential-sdk/types/trust-registry'; -import { maybeToJSON } from '@docknetwork/credential-sdk/utils'; import { createInternalDockModule } from '../common'; const callValueMethodOrObjectMethod = (method) => (value) => (typeof value[method] === 'function' diff --git a/packages/dock-blockchain-modules/tests/integration/anoncreds/presentation.test.js b/packages/dock-blockchain-modules/tests/integration/anoncreds/presentation.test.js index ab5d9db2e..d608229cb 100644 --- a/packages/dock-blockchain-modules/tests/integration/anoncreds/presentation.test.js +++ b/packages/dock-blockchain-modules/tests/integration/anoncreds/presentation.test.js @@ -1,4 +1,4 @@ -import { u8aToHex, stringToU8a } from "@docknetwork/credential-sdk/utils/bytes"; +import { u8aToHex, stringToU8a } from "@docknetwork/credential-sdk/utils"; import b58 from "bs58"; import { BBDT16MacSecretKey, diff --git a/packages/dock-blockchain-modules/tests/integration/anoncreds/r1cs-circom.test.js b/packages/dock-blockchain-modules/tests/integration/anoncreds/r1cs-circom.test.js index f8b8737f4..2b29b33fe 100644 --- a/packages/dock-blockchain-modules/tests/integration/anoncreds/r1cs-circom.test.js +++ b/packages/dock-blockchain-modules/tests/integration/anoncreds/r1cs-circom.test.js @@ -2,7 +2,7 @@ import { hexToU8a, stringToHex, u8aToHex, -} from "@docknetwork/credential-sdk/utils/bytes"; +} from "@docknetwork/credential-sdk/utils"; import { Encoder, diff --git a/packages/dock-blockchain-modules/tests/integration/anoncreds/saver-and-bound-check.test.js b/packages/dock-blockchain-modules/tests/integration/anoncreds/saver-and-bound-check.test.js index f3350daa8..a3263fafc 100644 --- a/packages/dock-blockchain-modules/tests/integration/anoncreds/saver-and-bound-check.test.js +++ b/packages/dock-blockchain-modules/tests/integration/anoncreds/saver-and-bound-check.test.js @@ -3,7 +3,7 @@ import { stringToHex, stringToU8a, u8aToHex, -} from "@docknetwork/credential-sdk/utils/bytes"; +} from "@docknetwork/credential-sdk/utils"; import { Statement, diff --git a/packages/dock-blockchain-modules/tests/integration/anoncreds/wallet-util.js b/packages/dock-blockchain-modules/tests/integration/anoncreds/wallet-util.js index 2ffc9af30..2bc5cd851 100644 --- a/packages/dock-blockchain-modules/tests/integration/anoncreds/wallet-util.js +++ b/packages/dock-blockchain-modules/tests/integration/anoncreds/wallet-util.js @@ -1,6 +1,6 @@ import b58 from "bs58"; import { u8aToHex } from "@docknetwork/credential-sdk/utils"; -import Bls12381G2KeyPairDock2022 from "@docknetwork/credential-sdk/vc/crypto/Bls12381G2KeyPairDock2022"; +import { Bls12381G2KeyPairDock2022 } from "@docknetwork/credential-sdk/vc/crypto"; import { Secp256k1Keypair } from "@docknetwork/credential-sdk/keypairs"; function createSecp256k1Keypair(privateKeyHex) { diff --git a/packages/dock-blockchain-modules/tests/integration/helpers.js b/packages/dock-blockchain-modules/tests/integration/helpers.js index 4a500c8e2..e1f040441 100644 --- a/packages/dock-blockchain-modules/tests/integration/helpers.js +++ b/packages/dock-blockchain-modules/tests/integration/helpers.js @@ -3,7 +3,7 @@ import { randomAsHex } from "@docknetwork/credential-sdk/utils"; import { MaxGas, MinGasPrice } from "../test-constants"; import { DockDid, DidKey } from "@docknetwork/credential-sdk/types/did"; import { Ed25519Keypair } from "@docknetwork/credential-sdk/keypairs"; -import { DIDDocument } from "@docknetwork/credential-sdk/types/did/document"; +import { DIDDocument } from "@docknetwork/credential-sdk/types/did"; import DockDIDModule from "../../src/did/module"; /** diff --git a/packages/dock-blockchain-modules/tests/integration/trust-registry-module.test.js b/packages/dock-blockchain-modules/tests/integration/trust-registry-module.test.js index aa3108ec9..cd2b30c3e 100644 --- a/packages/dock-blockchain-modules/tests/integration/trust-registry-module.test.js +++ b/packages/dock-blockchain-modules/tests/integration/trust-registry-module.test.js @@ -2,7 +2,7 @@ import { randomAsHex, u8aToHex, stringToU8a, -} from "@docknetwork/credential-sdk/utils/bytes"; +} from "@docknetwork/credential-sdk/utils"; import { DockAPI } from "@docknetwork/dock-blockchain-api"; diff --git a/packages/dock-blockchain-modules/tests/test-constants.js b/packages/dock-blockchain-modules/tests/test-constants.js index fcc0848a1..4ebd5d81e 100644 --- a/packages/dock-blockchain-modules/tests/test-constants.js +++ b/packages/dock-blockchain-modules/tests/test-constants.js @@ -22,14 +22,16 @@ import { import dotenv from "dotenv"; import { DockBBSModule, DockBBSPlusModule, DockPSModule } from "../src"; import Presentation from "@docknetwork/credential-sdk/vc/presentation"; -import Bls12381PSSignatureProofDock2023 from "@docknetwork/credential-sdk/vc/crypto/Bls12381PSSignatureProofDock2023"; -import Bls12381BBSSignatureProofDock2023 from "@docknetwork/credential-sdk/vc/crypto/Bls12381BBSSignatureProofDock2023"; -import Bls12381BBSSignatureProofDock2022 from "@docknetwork/credential-sdk/vc/crypto/Bls12381BBSSignatureProofDock2022"; -import Bls12381BBSKeyPairDock2023 from "@docknetwork/credential-sdk/vc/crypto/Bls12381BBSKeyPairDock2023"; -import Bls12381G2KeyPairDock2022 from "@docknetwork/credential-sdk/vc/crypto/Bls12381G2KeyPairDock2022"; -import Bls12381PSKeyPairDock2023 from "@docknetwork/credential-sdk/vc/crypto/Bls12381PSKeyPairDock2023"; -import Bls12381BBDT16KeyPairDock2024 from "@docknetwork/credential-sdk/vc/crypto/Bls12381BBDT16KeyPairDock2024"; -import Bls12381BBDT16MACProofDock2024 from "@docknetwork/credential-sdk/vc/crypto/Bls12381BBDT16MACProofDock2024"; +import { + Bls12381PSSignatureProofDock2023, + Bls12381BBSSignatureProofDock2023, + Bls12381BBSSignatureProofDock2022, + Bls12381BBSKeyPairDock2023, + Bls12381G2KeyPairDock2022, + Bls12381PSKeyPairDock2023, + Bls12381BBDT16KeyPairDock2024, + Bls12381BBDT16MACProofDock2024, +} from "@docknetwork/credential-sdk/vc/crypto"; dotenv.config(); const DefaultFullNodeEndpoint = "ws://127.0.0.1:9944"; diff --git a/yarn.lock b/yarn.lock index d42f43b0c..d16e090a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5009,13 +5009,6 @@ dependencies: "@stablelib/int" "^1.0.1" -"@stablelib/binary@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@stablelib/binary/-/binary-2.0.0.tgz#2f23f6f7d4fe11044f9108925b258a2c71f3c82f" - integrity sha512-dHejKHMtq5OtNwDSMcFx+djhixVAnZ76Rqga3WOOKe6KV3NlnE7JBXlmdLIn04G4FxqhRSEx+zkoO4Izdw10ZA== - dependencies: - "@stablelib/int" "^2.0.0" - "@stablelib/blockcipher@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/blockcipher/-/blockcipher-1.0.1.tgz#535f067d147ecdc9625ccd2b0d129f6d53d563d2" @@ -5051,7 +5044,7 @@ resolved "https://registry.yarnpkg.com/@stablelib/constant-time/-/constant-time-1.0.1.tgz#bde361465e1cf7b9753061b77e376b0ca4c77e35" integrity sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg== -"@stablelib/ed25519@^1.0.1", "@stablelib/ed25519@^1.0.2", "@stablelib/ed25519@^1.0.3": +"@stablelib/ed25519@^1.0.0", "@stablelib/ed25519@^1.0.1", "@stablelib/ed25519@^1.0.2", "@stablelib/ed25519@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@stablelib/ed25519/-/ed25519-1.0.3.tgz#f8fdeb6f77114897c887bb6a3138d659d3f35996" integrity sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg== @@ -5060,35 +5053,16 @@ "@stablelib/sha512" "^1.0.1" "@stablelib/wipe" "^1.0.1" -"@stablelib/ed25519@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@stablelib/ed25519/-/ed25519-2.0.0.tgz#304e033a5233bc6b0f3cec2321869d901ef5d443" - integrity sha512-4q/Kv7/yl0VcL1ZCbX63BG7wkDhiJR6QBPYV10WO37jjWhQhdUCcnSsKYwZ4t9fQngrULo5thnCc8jZqqufM4g== - dependencies: - "@stablelib/random" "^2.0.0" - "@stablelib/sha512" "^2.0.0" - "@stablelib/wipe" "^2.0.0" - "@stablelib/hash@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/hash/-/hash-1.0.1.tgz#3c944403ff2239fad8ebb9015e33e98444058bc5" integrity sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg== -"@stablelib/hash@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@stablelib/hash/-/hash-2.0.0.tgz#7b74c372dc07187e273844e970a475f1338e92cf" - integrity sha512-u3WPSqGido8lwJuMcrBgM5K54LrPGhkWAdtsyccf7dGsLixAZUds77zOAbu7bvKPwQlmoByH0txBi5rTmEKuHg== - "@stablelib/int@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/int/-/int-1.0.1.tgz#75928cc25d59d73d75ae361f02128588c15fd008" integrity sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w== -"@stablelib/int@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@stablelib/int/-/int-2.0.0.tgz#2b19f82c7831e91ed1a00a75cb2f23839c767c9d" - integrity sha512-EiSYDisTYKk1wuCqoh7wuBySmE0A1isq7TQbsijQ6XFi6nIAozchgAT7Zv2PCl2iY8BTe0URScC4PdYHOe3Yow== - "@stablelib/keyagreement@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/keyagreement/-/keyagreement-1.0.1.tgz#4612efb0a30989deb437cd352cee637ca41fc50f" @@ -5112,14 +5086,6 @@ "@stablelib/binary" "^1.0.1" "@stablelib/wipe" "^1.0.1" -"@stablelib/random@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@stablelib/random/-/random-2.0.0.tgz#538f796e1689e2d24125a57bf03e7d44c9cd6ab7" - integrity sha512-qvOSbiPq2B3ajvn/IDftC1mzL/W89OGv59gdJ7klMjm327Yk/54NyGl4Jtrwcz35GjCPy/ScVnQXC8YQk8uAUQ== - dependencies: - "@stablelib/binary" "^2.0.0" - "@stablelib/wipe" "^2.0.0" - "@stablelib/sha512@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/sha512/-/sha512-1.0.1.tgz#6da700c901c2c0ceacbd3ae122a38ac57c72145f" @@ -5129,25 +5095,11 @@ "@stablelib/hash" "^1.0.1" "@stablelib/wipe" "^1.0.1" -"@stablelib/sha512@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@stablelib/sha512/-/sha512-2.0.0.tgz#ea75ffc36ff57507f482f285f45ab68e3142d80e" - integrity sha512-JiIub0BfK+dDsymA8b4mUdT9hnFMPfbXqEp/NXR3MUsunf1WMyUQPQr/dhCVL8tt63oYLV9ItUFDP7B2wyIRwA== - dependencies: - "@stablelib/binary" "^2.0.0" - "@stablelib/hash" "^2.0.0" - "@stablelib/wipe" "^2.0.0" - "@stablelib/wipe@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-1.0.1.tgz#d21401f1d59ade56a62e139462a97f104ed19a36" integrity sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg== -"@stablelib/wipe@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-2.0.0.tgz#b4b17fedfad02dbfc7120c10160f2b71a7dadc41" - integrity sha512-VBMpCJx8py9j9F5DxV5dGmSSO+vkYDnXHXG4alkfpaD08UTfNTqsQoRlUh5obeqBNHiO+3Iv40GxKpM0gfd5xA== - "@stablelib/x25519@^1.0.0": version "1.0.3" resolved "https://registry.yarnpkg.com/@stablelib/x25519/-/x25519-1.0.3.tgz#13c8174f774ea9f3e5e42213cbf9fc68a3c7b7fd" @@ -9558,7 +9510,7 @@ jsonld@digitalcredentials/jsonld.js#v10.x: version "8.3.3-0" resolved "https://codeload.github.com/digitalcredentials/jsonld.js/tar.gz/14357f7a1181ae769ecc50fee9303468f17665ff" dependencies: - "@digitalbazaar/http-client" "^4.1.1" + "@digitalbazaar/http-client" "^4.1.0" canonicalize "^1.0.1" lru-cache "^6.0.0" rdf-canonize "^4.0.1"