import { AssetFields } from '../@types/AssetTypes.js'; import { CredentialSubject, DDOFields, Proof, UpdateFields, VersionedDDO } from '../@types/index.js'; export declare abstract class DDOManager { private ddoData; /** * Constructor for DDOManager. * @param ddoData - The data object representing the DDO. */ constructor(ddoData: Record); /** * Abstract method to generate a DID (Decentralized Identifier). * @param nftAddress - The NFT address. * @param chainId - The chain ID. * @returns A string representing the DID. */ abstract makeDid(nftAddress: string, chainId: string): string; /** * Abstract method to retrieve DDO fields. * `DDOFields` or `CredentialSubject` contains the following structure: * - **id**: The Decentralized Identifier (DID) of the asset. * - **metadata**: The metadata describing the asset. * - **services**: An array of services associated with the asset. * - **credentials**: An array of verifiable credentials. * - **chainId**: The blockchain chain ID where the asset is registered. * - **nftAddress**: The address of the NFT representing the asset. * - **event** (optional): The last event related to the asset. * * @returns The DDO fields as `DDOFields` or `CredentialSubject`. */ abstract getDDOFields(): DDOFields | CredentialSubject; /** * Abstract method to retrieve asset fields. * `AssetFields` contains the following structure: * - **datatokens** (optional): The datatokens associated with the asset. * - **event** (optional): The last event related to the asset. * - **nft** (optional): Information about the NFT representing the asset. * - **purgatory** (optional): Purgatory status of the asset, if applicable. * - **stats** (optional): Statistical information about the asset (e.g., usage, views). * * @returns The asset fields as `AssetFields`. */ abstract getAssetFields(): AssetFields; /** * Abstract method to update multiple fields. * @param fields - Partial object containing fields to update. * @returns The updated DDO data. */ abstract updateFields(fields: UpdateFields): Record; /** * Retrieves the DDO data. * @returns The DDO data as a record. */ getDDOData(): Record; /** * Method to retrieve the DID. * @returns The DID of ddo. */ getDid(): string; deleteIndexedMetadataIfExists(ddo: Record): Record; /** * Returns the SHACL schema content for a given version. * @param version - The schema version (default: CURRENT_VERSION). * @returns The schema content as a string. * @throws An error if the version is not supported. */ getSchema(version?: string): string; /** * Parses schema and data, runs SHACL validation. * @returns Validation report or null if parsing failed (errors added to extraErrors). */ protected runShaclValidation(ddoCopy: Record, extraErrors: Record): Promise<{ conforms: boolean; results: any[]; dataset: any; } | null>; /** * Factory method to get a DDO class instance based on version. * @param ddoData - The DDO data object. * @returns An instance of `V4DDO` or `V5DDO` or `DeprecatedDDO`. * @throws An error if the version is not supported. */ static getDDOClass(ddoData: Record): VersionedDDO; } export declare class V4DDO extends DDOManager { constructor(ddoData: Record); makeDid(nftAddress: string, chainId: string): string; getDDOFields(): DDOFields; getAssetFields(): AssetFields; updateFields(fields: UpdateFields): Record; validate(): Promise<[boolean, Record]>; } export declare class V5DDO extends DDOManager { constructor(ddoData: Record); makeDid(nftAddress: string, chainId: string): string; getDDOFields(): CredentialSubject; getAssetFields(): AssetFields; getProof(): Proof; getIssuer(): string; updateFields(fields: UpdateFields): Record; validate(): Promise<[boolean, Record]>; } export declare class DeprecatedDDO extends DDOManager { constructor(ddoData: Record); makeDid(nftAddress: string, chainId: string): string; getDDOFields(): DDOFields; getAssetFields(): AssetFields; updateFields(fields: UpdateFields): Record; validate(): Promise<[boolean, Record]>; } export declare function validateDDO(ddoData: Record): Promise<[boolean, Record]>;