diff --git a/packages/cactus-core-api/src/main/typescript/plugin/consortium/i-plugin-consortium.ts b/packages/cactus-core-api/src/main/typescript/plugin/consortium/i-plugin-consortium.ts new file mode 100644 index 0000000000..f14439b210 --- /dev/null +++ b/packages/cactus-core-api/src/main/typescript/plugin/consortium/i-plugin-consortium.ts @@ -0,0 +1,27 @@ +import { ICactusPlugin } from "../i-cactus-plugin"; + +/** + * Common interface to be implemented by plugins which are implementing the connection to ledgers. + */ +export interface IPluginConsortium< + GetNodeJwsIn, + GetNodeJwsOut, + GetConsortiumJwsIn, + GetConsortiumJwsOut +> extends ICactusPlugin { + /** + * Returns the JSON Web Signature of the consortium metadata, as issued by the + * **current node** that the request has been issued to. + * @param req The parameters of the request, if any. + */ + getNodeJws(req?: GetNodeJwsIn): Promise; + + /** + * Returns the JSON Web Signature of the consortium metadata, as issued by + * **all the nodes in the consortium** that are known to be in the consortium + * by this current node that the request has been issued to. + * + * @param req The parameters of the request, if any. + */ + getConsortiumJws(req?: GetConsortiumJwsIn): Promise; +} diff --git a/packages/cactus-core-api/src/main/typescript/public-api.ts b/packages/cactus-core-api/src/main/typescript/public-api.ts index b0e2215385..422da181f9 100755 --- a/packages/cactus-core-api/src/main/typescript/public-api.ts +++ b/packages/cactus-core-api/src/main/typescript/public-api.ts @@ -2,6 +2,7 @@ export * from "./generated/openapi/typescript-axios/index"; export * from "./generated/openapi/typescript-axios/base"; export { IPluginLedgerConnector } from "./plugin/ledger-connector/i-plugin-ledger-connector"; +export { IPluginConsortium } from "./plugin/consortium/i-plugin-consortium"; export { IPluginKeychain } from "./plugin/keychain/i-plugin-keychain"; export { IExpressRequestHandler } from "./plugin/web-service/i-express-request-handler";