Skip to content

Commit

Permalink
refactor: mediation config
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
  • Loading branch information
sairanjit committed May 27, 2024
1 parent d686aa8 commit dece220
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions packages/ssi/src/agent/agent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { InitConfig } from '@credo-ts/core'
import type { InitConfig, MediatorPickupStrategy } from '@credo-ts/core'
import type { AgentModulesInput } from '@credo-ts/core/build/agent/AgentModules'
import type { IndyVdrPoolConfig } from '@credo-ts/indy-vdr'

Expand Down Expand Up @@ -27,7 +27,6 @@ import {
HttpOutboundTransport,
WsOutboundTransport,
ConnectionsModule,
MediatorPickupStrategy,
JsonLdCredentialFormatService,
DifPresentationExchangeProofFormatService
} from '@credo-ts/core'
Expand All @@ -44,10 +43,19 @@ import { anoncreds } from '@hyperledger/anoncreds-react-native'
import { ariesAskar } from '@hyperledger/aries-askar-react-native'
import { indyVdr } from '@hyperledger/indy-vdr-react-native'

export const getAgentModules = (
mediatorInvitationUrl: string,
export type AdeyaAgentModuleOptions = {
mediatorInvitationUrl: string
mediatorPickupStrategy: MediatorPickupStrategy
indyNetworks: [IndyVdrPoolConfig, ...IndyVdrPoolConfig[]]
) => {
maximumMessagePickup?: number
}

export const getAgentModules = ({
mediatorInvitationUrl,
mediatorPickupStrategy,
indyNetworks,
maximumMessagePickup = 5
}: AdeyaAgentModuleOptions) => {
return {
askar: new AskarModule({
ariesAskar
Expand All @@ -57,8 +65,9 @@ export const getAgentModules = (
anoncreds
}),
mediationRecipient: new MediationRecipientModule({
mediatorPickupStrategy: MediatorPickupStrategy.Implicit,
mediatorInvitationUrl: mediatorInvitationUrl
mediatorInvitationUrl,
mediatorPickupStrategy,
maximumMessagePickup
}),
dids: new DidsModule({
registrars: [],
Expand Down

0 comments on commit dece220

Please sign in to comment.