Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added full ConditionalProof2022 VerificationMethod type #3

Merged
merged 1 commit into from
Nov 23, 2022
Merged
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
21 changes: 13 additions & 8 deletions src/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export interface JsonWebKey extends Extensible {
y?: string
}


/**
* Represents the properties of a Verification Method listed in a DID document.
*
Expand All @@ -165,20 +166,24 @@ export interface VerificationMethod {
publicKeyMultibase?: string
blockchainAccountId?: string
ethereumAddress?: string
conditionWeightedThreshold?: ConditionWeightedThreshold[]

// ConditionalProof2022 subtypes
conditionOr: VerificationMethod[]
conditionAnd: VerificationMethod[]
threshold?: number
// TODO add other properties of VerifiableConditions: threshold, conditionThreshold, conditionAnd, conditionOr
conditionThreshold: VerificationMethod[]
conditionWeightedThreshold?: ConditionWeightedThreshold[]
conditionDelegated?: string
relationshipParent: string[]
relationshipChild: string[]
relationshipSibling: string[]
}

export interface ConditionWeightedThreshold {
condition: {
id: string
controller: string
type: string
publicKeyJwk: JsonWebKey
}
condition: VerificationMethod
weight: number
}

/**
* URI params resulting from parsing a DID URI
*/
Expand Down