forked from jsnbuchanan/crowd-funder-for-time-pwa
fix: Adjust VC types.
This commit is contained in:
@@ -1,10 +1,7 @@
|
|||||||
// similar to VerifiableCredentialSubject... maybe rename this
|
// similar to VerifiableCredentialSubject... maybe rename this
|
||||||
export interface GenericVerifiableCredential {
|
export interface GenericVerifiableCredential {
|
||||||
"@context"?: string;
|
"@context"?: string;
|
||||||
"@type": string;
|
"@type"?: string;
|
||||||
name?: string;
|
|
||||||
description?: string;
|
|
||||||
agent?: string | { identifier: string };
|
|
||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +44,7 @@ export interface KeyMetaWithPrivate extends KeyMeta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface QuantitativeValue extends GenericVerifiableCredential {
|
export interface QuantitativeValue extends GenericVerifiableCredential {
|
||||||
"@type": "QuantitativeValue";
|
"@type"?: "QuantitativeValue";
|
||||||
"@context"?: string;
|
"@context"?: string;
|
||||||
amountOfThisGood: number;
|
amountOfThisGood: number;
|
||||||
unitCode: string;
|
unitCode: string;
|
||||||
@@ -97,8 +94,7 @@ export interface ClaimObject {
|
|||||||
|
|
||||||
export interface VerifiableCredentialClaim {
|
export interface VerifiableCredentialClaim {
|
||||||
"@context"?: string;
|
"@context"?: string;
|
||||||
"@type": string;
|
"@type"?: string;
|
||||||
type: string[];
|
|
||||||
credentialSubject: ClaimObject;
|
credentialSubject: ClaimObject;
|
||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -697,7 +697,6 @@ export function hydrateGive(
|
|||||||
|
|
||||||
if (amount && !isNaN(amount)) {
|
if (amount && !isNaN(amount)) {
|
||||||
const quantitativeValue: QuantitativeValue = {
|
const quantitativeValue: QuantitativeValue = {
|
||||||
"@type": "QuantitativeValue",
|
|
||||||
amountOfThisGood: amount,
|
amountOfThisGood: amount,
|
||||||
unitCode: unitCode || "HUR",
|
unitCode: unitCode || "HUR",
|
||||||
};
|
};
|
||||||
@@ -1342,7 +1341,6 @@ export async function createEndorserJwtVcFromClaim(
|
|||||||
vc: {
|
vc: {
|
||||||
"@context": "https://www.w3.org/2018/credentials/v1",
|
"@context": "https://www.w3.org/2018/credentials/v1",
|
||||||
"@type": "VerifiableCredential",
|
"@type": "VerifiableCredential",
|
||||||
type: ["VerifiableCredential"],
|
|
||||||
credentialSubject: claim,
|
credentialSubject: claim,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -1380,7 +1378,6 @@ export async function createInviteJwt(
|
|||||||
vc: {
|
vc: {
|
||||||
"@context": "https://www.w3.org/2018/credentials/v1",
|
"@context": "https://www.w3.org/2018/credentials/v1",
|
||||||
"@type": "VerifiableCredential",
|
"@type": "VerifiableCredential",
|
||||||
type: ["VerifiableCredential"],
|
|
||||||
credentialSubject: vcClaim as unknown as ClaimObject, // Type assertion needed due to object being string
|
credentialSubject: vcClaim as unknown as ClaimObject, // Type assertion needed due to object being string
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user