Skip to content

Commit 8b1aad7

Browse files
committed
fix: get or create primary identifier was not searching for the correct DID methods
1 parent b0776a1 commit 8b1aad7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/did-utils/src/did-functions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const getOrCreatePrimaryIdentifier = async (
141141
context: IAgentContext<IDIDManager>,
142142
opts?: CreateOrGetIdentifierOpts
143143
): Promise<GetOrCreateResult<IIdentifier>> => {
144-
const primaryIdentifier = await getPrimaryIdentifier(context, opts?.createOpts?.options)
144+
const primaryIdentifier = await getPrimaryIdentifier(context, {...opts?.createOpts?.options, ...(opts?.method && {method: opts.method})})
145145
if (primaryIdentifier !== undefined) {
146146
return {
147147
created: false,

packages/did-utils/src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export interface IIdentifierOpts {
4343
export type IdentifierProviderOpts = {
4444
type?: TKeyType
4545
use?: string
46+
method?: SupportedDidMethodEnum
4647
[x: string]: any
4748
}
4849

0 commit comments

Comments
 (0)