import { W3cCredential, W3cPresentation, W3cCredentialSchema, W3cCredentialSubject, W3cJsonLdVerifiableCredential, W3cJsonLdVerifiablePresentation, W3cCredentialOptions, DidRecord, W3cPresentationOptions, Logger } from '@credo-ts/core'; import { AnySchemaObject } from 'ajv/dist/2020'; import { VsAgent } from '../agent/VsAgent'; interface SelfTrDefaults { agentLabel: string; agentInvitationImageUrl?: string; fallbackBase64?: string; serviceType: string; serviceDescription: string; serviceMinimumAgeRequired: number; serviceTermsAndConditions: string; servicePrivacyPolicy: string; orgRegistryId: string; orgRegistryUrl: string; orgAddress: string; orgType: string; orgCountryCode: string; } export declare const presentations: { name: string; schemaUrl: string; }[]; export declare const credentials: { name: string; credUrl: string; schemaUrl: string; }[]; export declare const createJsonSchema: W3cCredentialSchema; export declare const createJsonSubjectRef: (id: string) => W3cCredentialSubject; export declare const mapToSelfTr: (url: string, publicApiBaseUrl: string) => string; export declare const setupSelfTr: ({ agent, publicApiBaseUrl, defaults, }: { agent: VsAgent; publicApiBaseUrl: string; defaults: SelfTrDefaults; }) => Promise; export declare function createCredential(options: Partial): W3cCredential; /** * Signs a W3C Verifiable Credential or Presentation using the provided agent and verification method. * * The function determines whether the input object is a `W3cCredential` or a `W3cPresentation`, * and applies the appropriate signing operation using Linked Data Proofs (`Ed25519Signature2020`). * * @param agent - The agent instance. * @param obj - The credential or presentation object to be signed. * @param verificationMethod - The DID verification method used to generate the proof. * @returns A signed W3C Verifiable Credential or Presentation in JSON-LD format. */ export declare function signerW3c(agent: VsAgent, obj: W3cCredential, verificationMethod: string): Promise; export declare function signerW3c(agent: VsAgent, obj: W3cPresentation, verificationMethod: string): Promise; /** * Generates and signs a verifiable presentation containing a verifiable credential. * Stores the signed presentation and its integrity metadata in the DID record. * * - Retrieves and validates claims for the agent's DID. * - Computes an integrity digest for the claims. * - If a presentation with the same integrity already exists in the DID metadata, it is returned. * - Otherwise, a new presentation is created, signed, and stored in the DID metadata. * * @param agent - The VsAgent instance used for signing and DID management. * @param logger - Logger instance for logging operations. * @param ecsSchemas - Map of ECS schemas for validation. * @param schemaKey - Unique identifier for the presentation type and metadata key. * @param type - Array of credential types to include. * @param credentialSchema - Schema definition for the credential. * @returns The signed verifiable presentation, with integrity metadata. */ export declare function generateVerifiablePresentation(agent: VsAgent, id: string, ecsSchemas: Record, schemaKey: string, type: string[], credentialSchema: W3cCredentialSchema, defaults: SelfTrDefaults): Promise; export declare function createPresentation(options: Partial): W3cPresentation; /** * Retrieves and validates claims for a credential subject. * If claims are not found, builds default claims based on the schemaKey. * Validates claims against the ECS schema for the given schemaKey. * * @param ecsSchemas - Map of ECS schemas for validation. * @param subject - Credential subject, including ID. * @param schemaKey - Unique identifier for the credential type. * @returns The validated claims object. * @throws If claims are invalid or schema is missing. */ export declare function getClaims(logger: Logger, ecsSchemas: Record, { id, claims }: W3cCredentialSubject, schemaKey: string, defaults: SelfTrDefaults): Promise>; /** * Validate a validateSchema object against the corresponding AJV schema. * Throws an Error if the schema is missing or validation fails. */ export declare function validateSchema(ecsSchema: AnySchemaObject, credentialSubject: Record): void; /** * Adds a Subresource Integrity (SRI) digest to the provided data using the schema content * fetched from the provided URL or from a local schema map as fallback. * * @template T - The type of the data object. * @param id - The URL of the schema to fetch. * @param data - The object to which the digest will be added. * @param ecsSchemas - Optional map of local schemas to use as fallback if the fetch fails. * @returns A new object combining the original data and a `digestSRI` property. * @throws Error if both the fetch and local fallback fail. */ export declare function addDigestSRI(id?: string, data?: T, ecsSchemas?: Record): Promise; /** * Generates a SRI digest string for the given content using the specified algorithm. * @param content - The content to hash. * @param algorithm - The hash algorithm to use (default: sha256). * @returns The SRI digest string. */ export declare function generateDigestSRI(content: string, algorithm?: string): string; /** * Converts an image URL to a Base64-encoded data URI string. * * @param url - The image URL to convert. * @returns A Base64 data URI string, or a fallback placeholder if the image cannot be fetched or is invalid. */ export declare function urlToBase64(logger: Logger, url: string | undefined, fallback: string): Promise; export declare function getVerificationMethodId(logger: Logger, didRecord: DidRecord): string; export {};