Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/controllers/did/DidController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ export class DidController extends Controller {
throw new BadRequestError('Invalid private key or not supported')
}

return this.agent.dids.create<PolygonDidCreateOptions>({
method: 'polygon',
const createDidResponse = await this.agent.dids.create<PolygonDidCreateOptions>({
method: DidMethod.Polygon,
options: {
network: networkName,
endpoint,
Expand All @@ -429,6 +429,11 @@ export class DidController extends Controller {
privateKey: TypedArrayEncoder.fromHex(`${privatekey}`),
},
})
const didResponse = {
did: createDidResponse?.didState?.did,
didDocument: createDidResponse?.didState?.didDocument,
}
return didResponse
}

@Get('/')
Expand All @@ -440,4 +445,4 @@ export class DidController extends Controller {
throw ErrorHandlingService.handle(error)
}
}
}
}
4 changes: 2 additions & 2 deletions src/controllers/multi-tenancy/MultiTenancyController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export class MultiTenancyController extends Controller {

if (!createDidOptions.did) {
await tenantAgent.wallet.createKey({
keyType: createDidOptions.keyType,
keyType: keyType,
seed: TypedArrayEncoder.fromString(seed),
})
const didKeyResponse = await tenantAgent.dids.create<KeyDidCreateOptions>({
Expand Down Expand Up @@ -538,7 +538,7 @@ export class MultiTenancyController extends Controller {
})
didResponse = {
did: createDidResponse?.didState?.did,
didDoc: createDidResponse?.didState?.didDocument,
didDocument: createDidResponse?.didState?.didDocument,
}
})
return didResponse
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export interface ResolvedDid {
}

export interface DidCreate {
keyType: KeyType
keyType?: KeyType
seed?: string
domain?: string
method: string
Expand Down Expand Up @@ -387,4 +387,4 @@ export interface SchemaMetadata {
/**
* @example "ea4e5e69-fc04-465a-90d2-9f8ff78aa71d"
*/
export type ThreadId = string
export type ThreadId = string