Matthew Raymer
1 year ago
commit
db5125314c
3 changed files with 59 additions and 0 deletions
@ -0,0 +1 @@ |
|||||
|
*~ |
@ -0,0 +1 @@ |
|||||
|
# endorser-types |
@ -0,0 +1,57 @@ |
|||||
|
|
||||
|
export interface AgreeVerifiableCredential { |
||||
|
"@context": string; |
||||
|
"@type": string; |
||||
|
// "any" because arbitrary objects can be subject of agreement
|
||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
object: Record<any, any>; |
||||
|
} |
||||
|
|
||||
|
export interface ClaimResult { |
||||
|
success: { claimId: string; handleId: string }; |
||||
|
error: { code: string; message: string }; |
||||
|
} |
||||
|
|
||||
|
export interface GenericClaim { |
||||
|
"@context": string; |
||||
|
"@type": string; |
||||
|
issuedAt: string; |
||||
|
// "any" because arbitrary objects can be subject of agreement
|
||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
claim: Record<any, any>; |
||||
|
} |
||||
|
|
||||
|
export interface GiveServerRecord { |
||||
|
agentDid: string; |
||||
|
amount: number; |
||||
|
amountConfirmed: number; |
||||
|
description: string; |
||||
|
fullClaim: GiveVerifiableCredential; |
||||
|
handleId: string; |
||||
|
issuedAt: string; |
||||
|
recipientDid: string; |
||||
|
unit: string; |
||||
|
} |
||||
|
|
||||
|
export interface GiveVerifiableCredential { |
||||
|
"@context"?: string; // optional when embedded, eg. in an Agree
|
||||
|
"@type": string; |
||||
|
agent?: { identifier: string }; |
||||
|
description?: string; |
||||
|
identifier?: string; |
||||
|
object?: { amountOfThisGood: number; unitCode: string }; |
||||
|
recipient: { identifier: string }; |
||||
|
} |
||||
|
|
||||
|
export interface RegisterVerifiableCredential { |
||||
|
"@context": string; |
||||
|
"@type": string; |
||||
|
agent: { identifier: string }; |
||||
|
object: string; |
||||
|
recipient: { identifier: string }; |
||||
|
} |
||||
|
|
||||
|
export interface InternalError { |
||||
|
error: string; // for system logging
|
||||
|
userMessage?: string; // for user display
|
||||
|
} |
Loading…
Reference in new issue