diff --git a/apps/agent-service/src/agent-service.service.ts b/apps/agent-service/src/agent-service.service.ts index fa7d4b527..24afced95 100644 --- a/apps/agent-service/src/agent-service.service.ts +++ b/apps/agent-service/src/agent-service.service.ts @@ -931,7 +931,9 @@ export class AgentServiceService { try { const { isPrimaryDid } = createDidPayload; const agentDetails = await this.agentServiceRepository.getOrgAgentDetails(orgId); - + if (createDidPayload.method === DidMethod.POLYGON) { + createDidPayload.endpoint = agentDetails.agentEndPoint; + } const getApiKey = await this.getOrgAgentApiKey(orgId); const getOrgAgentType = await this.agentServiceRepository.getOrgAgentType(agentDetails?.orgAgentTypeId); let url; @@ -940,7 +942,7 @@ export class AgentServiceService { } else if (getOrgAgentType.agent === OrgAgentType.SHARED) { url = `${agentDetails.agentEndPoint}${CommonConstants.URL_SHAGENT_CREATE_DID}${agentDetails.tenantId}`; } - + delete createDidPayload.isPrimaryDid; const didDetails = await this.commonService.httpPost(url, createDidPayload, { diff --git a/libs/common/src/did.validator.ts b/libs/common/src/did.validator.ts index cd36579cf..4aa0f626a 100644 --- a/libs/common/src/did.validator.ts +++ b/libs/common/src/did.validator.ts @@ -27,9 +27,6 @@ export function validateDid(createDid: IDidCreate): void { case DidMethod.POLYGON === createDid.method && createDid.privatekey && 64 !== createDid.privatekey.length: errors.push('Private key must be exactly 64 characters long'); break; - case DidMethod.POLYGON === createDid.method && !createDid.endpoint: - errors.push('endpoint is required for polygon method'); - break; case (DidMethod.INDY === createDid.method || DidMethod.KEY === createDid.method || DidMethod.WEB === createDid.method) && (!createDid.seed): errors.push('seed is required'); break;