| 
						
						
							
								
							
						
						
					 | 
					@ -1315,17 +1315,29 @@ export async function createEndorserJwtVcFromClaim( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  return createEndorserJwtForDid(issuerDid, vcPayload); | 
					 | 
					 | 
					  return createEndorserJwtForDid(issuerDid, vcPayload); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					/** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 * Create a JWT for a RegisterAction claim. | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 * | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 * @param activeDid - The DID of the user creating the invite | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 * @param contact - The contact to register, with a 'did' field (all optional for invites) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 * @param identifier - The identifier for the invite, usually random | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 * @param expiresIn - The number of seconds until the invite expires | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 * @returns The JWT for the RegisterAction claim | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					 */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					export async function createInviteJwt( | 
					 | 
					 | 
					export async function createInviteJwt( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  activeDid: string, | 
					 | 
					 | 
					  activeDid: string, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  contact: Contact, | 
					 | 
					 | 
					  contact?: Contact, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  identifier?: string, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  expiresIn?: number, // in seconds
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					): Promise<string> { | 
					 | 
					 | 
					): Promise<string> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  const vcClaim: RegisterVerifiableCredential = { | 
					 | 
					 | 
					  const vcClaim: RegisterVerifiableCredential = { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    "@context": SCHEMA_ORG_CONTEXT, | 
					 | 
					 | 
					    "@context": SCHEMA_ORG_CONTEXT, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    "@type": "RegisterAction", | 
					 | 
					 | 
					    "@type": "RegisterAction", | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    agent: { identifier: activeDid }, | 
					 | 
					 | 
					    agent: { identifier: activeDid }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    object: SERVICE_ID, | 
					 | 
					 | 
					    object: SERVICE_ID, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    identifier: identifier, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  }; | 
					 | 
					 | 
					  }; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  if (contact) { | 
					 | 
					 | 
					  if (contact?.did) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    vcClaim.participant = { identifier: contact.did }; | 
					 | 
					 | 
					    vcClaim.participant = { identifier: contact.did }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -1340,7 +1352,7 @@ export async function createInviteJwt( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  }; | 
					 | 
					 | 
					  }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  // Create a signature using private key of identity
 | 
					 | 
					 | 
					  // Create a signature using private key of identity
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  const vcJwt = await createEndorserJwtForDid(activeDid, vcPayload); | 
					 | 
					 | 
					  const vcJwt = await createEndorserJwtForDid(activeDid, vcPayload, expiresIn); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					  return vcJwt; | 
					 | 
					 | 
					  return vcJwt; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |