@@ -21,14 +21,8 @@ import {
2121import {
2222 DidCommAutoAcceptCredential ,
2323 DidCommAutoAcceptProof ,
24- DidCommConnectionsModule ,
25- DidCommCredentialsModule ,
2624 DidCommModule ,
2725 DidCommDifPresentationExchangeProofFormatService ,
28- DidCommMediatorModule ,
29- DidCommMessagePickupModule ,
30- DidCommOutOfBandModule ,
31- DidCommProofsModule ,
3226 DidCommCredentialV2Protocol ,
3327 DidCommProofV2Protocol ,
3428} from '@credo-ts/didcomm'
@@ -39,7 +33,7 @@ import {
3933 IndyVdrIndyDidResolver ,
4034 IndyVdrModule ,
4135} from '@credo-ts/indy-vdr'
42- import { OpenId4VcIssuerModule , OpenId4VcVerifierModule } from '@credo-ts/openid4vc'
36+ import { OpenId4VcModule } from '@credo-ts/openid4vc'
4337import { TenantsModule } from '@credo-ts/tenants'
4438import { anoncreds } from '@hyperledger/anoncreds-nodejs'
4539import { indyVdr } from '@hyperledger/indy-vdr-nodejs'
@@ -62,80 +56,79 @@ function getTenantModulesMap(appConfig: ConfigType<typeof AppConfig>, agencyConf
6256 const presentationExchangeProofFormatService = new DidCommDifPresentationExchangeProofFormatService ( )
6357
6458 const didResolvers : DidResolver [ ] = [ new KeyDidResolver ( ) ]
65- const didRegisters : DidRegistrar [ ] = [ new KeyDidRegistrar ( ) ]
66- const anoncredsRegstries : AnonCredsRegistry [ ] = [ ]
59+ const didRegistrars : DidRegistrar [ ] = [ new KeyDidRegistrar ( ) ]
60+ const anoncredsRegistries : AnonCredsRegistry [ ] = [ ]
6761
6862 if ( agencyConfig . didMethods . includes ( 'indy' ) ) {
6963 didResolvers . push ( new IndyVdrIndyDidResolver ( ) )
70- didRegisters . push ( new IndyVdrIndyDidRegistrar ( ) )
71- anoncredsRegstries . push ( new IndyVdrAnonCredsRegistry ( ) )
64+ didRegistrars . push ( new IndyVdrIndyDidRegistrar ( ) )
65+ anoncredsRegistries . push ( new IndyVdrAnonCredsRegistry ( ) )
7266 }
7367 if ( agencyConfig . didMethods . includes ( 'indybesu' ) ) {
7468 didResolvers . push ( new IndyBesuDidResolver ( ) )
75- didRegisters . push ( new IndyBesuDidRegistrar ( ) )
76- anoncredsRegstries . push ( new IndyBesuAnonCredsRegistry ( ) )
69+ didRegistrars . push ( new IndyBesuDidRegistrar ( ) )
70+ anoncredsRegistries . push ( new IndyBesuAnonCredsRegistry ( ) )
7771 }
7872 if ( agencyConfig . didMethods . includes ( 'hedera' ) ) {
7973 didResolvers . push ( new HederaDidResolver ( ) )
80- didRegisters . push ( new HederaDidRegistrar ( ) )
81- anoncredsRegstries . push ( new HederaAnonCredsRegistry ( ) )
74+ didRegistrars . push ( new HederaDidRegistrar ( ) )
75+ anoncredsRegistries . push ( new HederaAnonCredsRegistry ( ) )
8276 }
8377
8478 return {
85- connections : new DidCommConnectionsModule ( {
86- autoAcceptConnections : true ,
87- } ) ,
88- credentials : new DidCommCredentialsModule ( {
89- autoAcceptCredentials : DidCommAutoAcceptCredential . ContentApproved ,
90- credentialProtocols : [
91- new DidCommCredentialV2Protocol ( {
92- credentialFormats : [
93- credentialFormatService ,
94- legacyIndyCredentialFormatService ,
95- dataIntegrityCredentialFormatService ,
96- // new JsonLdCredentialFormatService()
97- ] ,
98- } ) ,
99- ] ,
100- } ) ,
101- proofs : new DidCommProofsModule ( {
102- autoAcceptProofs : DidCommAutoAcceptProof . ContentApproved ,
103- proofProtocols : [
104- new DidCommProofV2Protocol ( {
105- proofFormats : [ legacyIndyProofFormatService , proofFormatService , presentationExchangeProofFormatService ] ,
106- } ) ,
107- ] ,
108- } ) ,
109- didcomm : new DidCommModule ( agencyConfig . didCommConfig ) ,
110- oob : new DidCommOutOfBandModule ( ) ,
111- messagePickup : new DidCommMessagePickupModule ( ) ,
112- mediator : new DidCommMediatorModule ( {
113- autoAcceptMediationRequests : agencyConfig . autoAcceptMediationRequests ,
79+ didcomm : new DidCommModule ( {
80+ ...agencyConfig . didCommConfig ,
81+ messagePickup : true ,
82+ connections : {
83+ autoAcceptConnections : true ,
84+ } ,
85+ credentials : {
86+ autoAcceptCredentials : DidCommAutoAcceptCredential . ContentApproved ,
87+ credentialProtocols : [
88+ new DidCommCredentialV2Protocol ( {
89+ credentialFormats : [
90+ credentialFormatService ,
91+ legacyIndyCredentialFormatService ,
92+ dataIntegrityCredentialFormatService ,
93+ // new JsonLdCredentialFormatService()
94+ ] ,
95+ } ) ,
96+ ] ,
97+ } ,
98+ proofs : {
99+ autoAcceptProofs : DidCommAutoAcceptProof . ContentApproved ,
100+ proofProtocols : [
101+ new DidCommProofV2Protocol ( {
102+ proofFormats : [ legacyIndyProofFormatService , proofFormatService , presentationExchangeProofFormatService ] ,
103+ } ) ,
104+ ] ,
105+ } ,
114106 } ) ,
115107 dids : new DidsModule ( {
116108 resolvers : didResolvers ,
117- registrars : didRegisters ,
109+ registrars : didRegistrars ,
118110 } ) ,
119111 cache : new CacheModule ( {
120112 cache : new InMemoryLruCache ( { limit : 100 } ) ,
121113 } ) ,
122114 anoncreds : new AnonCredsModule ( {
123115 // @ts -ignore
124- registries : anoncredsRegstries ,
116+ registries : anoncredsRegistries ,
125117 anoncreds,
126118 tailsFileService : new TailsService ( appConfig ) ,
127119 } ) ,
128120 askar : new AskarModule ( {
129121 askar,
130122 store : agencyConfig . askarStoreConfig ,
131123 } ) ,
132- openId4VcIssuer : new OpenId4VcIssuerModule ( {
133- baseUrl : agencyConfig . oidConfig . issuanceEndpoint ,
134- app : agencyConfig . oidConfig . app ,
135- credentialRequestToCredentialMapper,
136- } ) ,
137- openId4VcVerifier : new OpenId4VcVerifierModule ( {
138- baseUrl : agencyConfig . oidConfig . verificationEndpoint ,
124+ openid4vc : new OpenId4VcModule ( {
125+ issuer : {
126+ baseUrl : agencyConfig . oidConfig . issuanceEndpoint ,
127+ credentialRequestToCredentialMapper,
128+ } ,
129+ verifier : {
130+ baseUrl : agencyConfig . oidConfig . verificationEndpoint ,
131+ } ,
139132 app : agencyConfig . oidConfig . app ,
140133 } ) ,
141134 ledgerSdk : new IndyVdrModule ( {
0 commit comments