From e297fa256d36eeba9dda0b6ac73377420af1132f Mon Sep 17 00:00:00 2001 From: Oleg Nosov Date: Fri, 15 Nov 2024 22:04:21 +0100 Subject: [PATCH] Allow to instantiate `cheqd` core modules (#478) --- .../cheqd-blockchain-modules/CHANGELOG.md | 6 +++++ .../cheqd-blockchain-modules/package.json | 2 +- .../cheqd-blockchain-modules/src/index.js | 23 +++++++++++-------- .../tests/offchain-signatures-module.test.js | 6 ++++- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/packages/cheqd-blockchain-modules/CHANGELOG.md b/packages/cheqd-blockchain-modules/CHANGELOG.md index cf94b6689..627efd4b7 100644 --- a/packages/cheqd-blockchain-modules/CHANGELOG.md +++ b/packages/cheqd-blockchain-modules/CHANGELOG.md @@ -1,5 +1,11 @@ # @docknetwork/cheqd-blockchain-modules +## 0.7.0 + +### Minor Changes + +- Allow to instantiate `CheqdCoreModules` + ## 0.6.0 ### Minor Changes diff --git a/packages/cheqd-blockchain-modules/package.json b/packages/cheqd-blockchain-modules/package.json index 451c0d315..e85b402b0 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.6.0", + "version": "0.7.0", "type": "module", "license": "MIT", "main": "./dist/esm/index.js", diff --git a/packages/cheqd-blockchain-modules/src/index.js b/packages/cheqd-blockchain-modules/src/index.js index 50c00032b..250687de1 100644 --- a/packages/cheqd-blockchain-modules/src/index.js +++ b/packages/cheqd-blockchain-modules/src/index.js @@ -14,9 +14,17 @@ import CheqdPSModule from './offchain-signatures/ps'; // import CheqdTrustRegistryModule from './trust-registry/module'; export class CheqdCoreModules extends AbstractCoreModules { - // static AccumulatorModule = CheqdAccumulatorModule; - - // static AnchorModule = CheqdAnchorModule; + static get ModuleMap() { + return { + ...super.ModuleMap, + AccumulatorModule: { key: 'accumulator', optional: true }, + StatusListCredentialModule: { + key: 'statusListCredential', + optional: true, + }, + TrustRegistryModule: { key: 'trustRegistry', optional: true }, + }; + } static AttestModule = CheqdAttestModule; @@ -43,12 +51,9 @@ export { CheqdBlobModule, CheqdOffchainSignaturesModule, // CheqdAccumulatorModule, - // CheqdAnchorModule, - // , - // CheqdOffchainSignaturesModule, - // CheqdBBSModule, - // CheqdBBSPlusModule, - // CheqdPSModule, + CheqdBBSModule, + CheqdBBSPlusModule, + CheqdPSModule, // CheqdStatusListCredentialModule, // CheqdTrustRegistryModule, }; diff --git a/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js b/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js index 556880e51..3acd17d49 100644 --- a/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js +++ b/packages/cheqd-blockchain-modules/tests/offchain-signatures-module.test.js @@ -6,7 +6,11 @@ import { import { MultiApiOffchainSignaturesModule } from "@docknetwork/credential-sdk/modules"; import generateOffchainSignaturesModuleTests from "@docknetwork/credential-sdk/modules/tests/offchain-signatures-module"; import { faucet } from "./constants"; -import { CheqdOffchainSignaturesModule, CheqdDIDModule } from "../src"; +import { + CheqdOffchainSignaturesModule, + CheqdDIDModule, + CheqdCoreModules, +} from "../src"; import { MultiApiDIDModule } from "@docknetwork/credential-sdk/modules"; import CheqdBBSModule from "../src/offchain-signatures/bbs"; import CheqdBBSPlusModule from "../src/offchain-signatures/bbs-plus";