You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
180 lines
3.7 KiB
180 lines
3.7 KiB
// similar to VerifiableCredentialSubject... maybe rename this
|
|
export interface GenericVerifiableCredential {
|
|
"@context": string | string[];
|
|
"@type": string;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface GenericCredWrapper<T extends GenericVerifiableCredential> {
|
|
claim: T;
|
|
claimType?: string;
|
|
handleId: string;
|
|
id: string;
|
|
issuedAt: string;
|
|
issuer: string;
|
|
publicUrls?: Record<string, string>;
|
|
}
|
|
|
|
export interface ResultWithType {
|
|
type: string;
|
|
}
|
|
|
|
export interface ErrorResponse {
|
|
error?: {
|
|
message?: string;
|
|
};
|
|
}
|
|
|
|
export interface InternalError {
|
|
error: string;
|
|
userMessage?: string;
|
|
}
|
|
|
|
export interface ErrorResult extends ResultWithType {
|
|
type: "error";
|
|
error: InternalError;
|
|
}
|
|
|
|
export interface KeyMeta {
|
|
did: string;
|
|
name?: string;
|
|
publicKeyHex: string;
|
|
mnemonic: string;
|
|
derivationPath: string;
|
|
registered?: boolean;
|
|
profileImageUrl?: string;
|
|
identity?: string; // Stringified IIdentifier object from Veramo
|
|
passkeyCredIdHex?: string; // The Webauthn credential ID in hex, if this is from a passkey
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface QuantitativeValue extends GenericVerifiableCredential {
|
|
"@type": "QuantitativeValue";
|
|
"@context": string | string[];
|
|
amountOfThisGood: number;
|
|
unitCode: string;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface AxiosErrorResponse {
|
|
message?: string;
|
|
response?: {
|
|
data?: {
|
|
error?: {
|
|
message?: string;
|
|
};
|
|
[key: string]: unknown;
|
|
};
|
|
status?: number;
|
|
config?: unknown;
|
|
};
|
|
config?: unknown;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface UserInfo {
|
|
did: string;
|
|
name: string;
|
|
publicEncKey: string;
|
|
registered: boolean;
|
|
profileImageUrl?: string;
|
|
nextPublicEncKeyHash?: string;
|
|
}
|
|
|
|
export interface CreateAndSubmitClaimResult {
|
|
success: boolean;
|
|
error?: string;
|
|
handleId?: string;
|
|
}
|
|
|
|
export interface PlanSummaryRecord {
|
|
handleId: string;
|
|
issuer: string;
|
|
claim: GenericVerifiableCredential;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface Agent {
|
|
identifier?: string;
|
|
did?: string;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface ClaimObject {
|
|
"@type": string;
|
|
"@context"?: string | string[];
|
|
fulfills?: Array<{
|
|
"@type": string;
|
|
identifier?: string;
|
|
[key: string]: unknown;
|
|
}>;
|
|
object?: GenericVerifiableCredential;
|
|
agent?: Agent;
|
|
participant?: {
|
|
identifier?: string;
|
|
[key: string]: unknown;
|
|
};
|
|
identifier?: string;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface VerifiableCredentialClaim {
|
|
"@context": string | string[];
|
|
"@type": string;
|
|
type: string[];
|
|
credentialSubject: ClaimObject;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface GiveVerifiableCredential extends GenericVerifiableCredential {
|
|
"@type": "GiveAction";
|
|
"@context": string | string[];
|
|
object?: GenericVerifiableCredential;
|
|
agent?: Agent;
|
|
participant?: {
|
|
identifier?: string;
|
|
[key: string]: unknown;
|
|
};
|
|
fulfills?: Array<{
|
|
"@type": string;
|
|
identifier?: string;
|
|
[key: string]: unknown;
|
|
}>;
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface OfferVerifiableCredential extends GenericVerifiableCredential {
|
|
"@type": "OfferAction";
|
|
"@context": string | string[];
|
|
object?: GenericVerifiableCredential;
|
|
agent?: Agent;
|
|
participant?: {
|
|
identifier?: string;
|
|
[key: string]: unknown;
|
|
};
|
|
itemOffered?: {
|
|
description?: string;
|
|
isPartOf?: {
|
|
"@type": string;
|
|
identifier: string;
|
|
[key: string]: unknown;
|
|
};
|
|
[key: string]: unknown;
|
|
};
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export interface RegisterVerifiableCredential
|
|
extends GenericVerifiableCredential {
|
|
"@type": "RegisterAction";
|
|
"@context": string | string[];
|
|
agent: {
|
|
identifier: string;
|
|
};
|
|
object: string;
|
|
participant?: {
|
|
identifier: string;
|
|
};
|
|
identifier?: string;
|
|
[key: string]: unknown;
|
|
}
|
|
|