add 'offer' on contact screen

This commit is contained in:
2024-04-21 07:38:59 -06:00
parent 676882978a
commit bba183dc46
4 changed files with 32 additions and 9 deletions

View File

@@ -143,6 +143,7 @@ export interface OfferVerifiableCredential {
isPartOf?: { identifier?: string; lastClaimId?: string; "@type"?: string };
};
offeredBy?: { identifier: string };
recipient?: { identifier: string };
validThrough?: string;
}
@@ -582,6 +583,7 @@ export async function createAndSubmitOffer(
amount?: number,
unitCode?: string,
expirationDate?: string,
recipientDid?: string,
fulfillsProjectHandleId?: string,
): Promise<CreateAndSubmitClaimResult> {
const vcClaim: OfferVerifiableCredential = {
@@ -599,6 +601,9 @@ export async function createAndSubmitOffer(
if (description) {
vcClaim.itemOffered = { description };
}
if (recipientDid) {
vcClaim.recipient = { identifier: recipientDid };
}
if (fulfillsProjectHandleId) {
vcClaim.itemOffered = vcClaim.itemOffered || {};
vcClaim.itemOffered.isPartOf = {