diff --git a/packages/indy-vdr/src/IndyVdrModule.ts b/packages/indy-vdr/src/IndyVdrModule.ts index 6150435c51..cd6b7244bf 100644 --- a/packages/indy-vdr/src/IndyVdrModule.ts +++ b/packages/indy-vdr/src/IndyVdrModule.ts @@ -15,6 +15,17 @@ export class IndyVdrModule implements Module { } public register(dependencyManager: DependencyManager) { + try { + // eslint-disable-next-line import/no-extraneous-dependencies + require('@hyperledger/indy-vdr-nodejs') + } catch (error) { + try { + require('@hyperledger/indy-vdr-react-native') + } catch (error) { + throw new Error('Error registering bindings for Indy VDR') + } + } + // Config dependencyManager.registerInstance(IndyVdrModuleConfig, this.config) diff --git a/packages/indy-vdr/src/anoncreds/index.ts b/packages/indy-vdr/src/anoncreds/index.ts new file mode 100644 index 0000000000..c1e469b307 --- /dev/null +++ b/packages/indy-vdr/src/anoncreds/index.ts @@ -0,0 +1 @@ +export * from './IndyVdrAnonCredsRegistry' diff --git a/packages/indy-vdr/src/index.ts b/packages/indy-vdr/src/index.ts index 8278d55827..be45d47b96 100644 --- a/packages/indy-vdr/src/index.ts +++ b/packages/indy-vdr/src/index.ts @@ -1,8 +1,4 @@ export { IndyVdrSovDidResolver } from './dids' - -try { - // eslint-disable-next-line import/no-extraneous-dependencies - require('@hyperledger/indy-vdr-nodejs') -} catch (error) { - throw new Error('Error registering nodejs bindings for Indy VDR') -} +export * from './IndyVdrModule' +export * from './IndyVdrModuleConfig' +export * from './anoncreds' diff --git a/packages/indy-vdr/tests/setup.ts b/packages/indy-vdr/tests/setup.ts index d69181fd10..a570fb8396 100644 --- a/packages/indy-vdr/tests/setup.ts +++ b/packages/indy-vdr/tests/setup.ts @@ -1,4 +1,6 @@ // Needed to register indy-vdr node bindings import '../src/index' +require('@hyperledger/indy-vdr-nodejs') + jest.setTimeout(60000)