import { AnonCredsDidCommCredentialFormatService, AnonCredsModule, AnonCredsDidCommProofFormatService, LegacyIndyDidCommCredentialFormatService, LegacyIndyDidCommProofFormatService } from '@credo-ts/anoncreds'; import { AskarModule, AskarModuleConfigStoreOptions } from '@credo-ts/askar'; import { Agent, AgentDependencies, DidsModule, InitConfig, W3cCredentialsModule } from '@credo-ts/core'; import { DidCommCredentialsModuleConfigOptions, DidCommCredentialV2Protocol, DidCommFeatureQueryOptions, DidCommJsonLdCredentialFormatService, DidCommModule, DidCommModuleConfigOptions, DidCommProofsModuleConfigOptions, DidCommProofV2Protocol } from '@credo-ts/didcomm'; import { VtFlowModule } from '@verana-labs/credo-ts-didcomm-vt-flow'; import { AuthorizationService } from '../blockchain/AuthorizationService'; import { VeranaChainService } from '../blockchain/VeranaChainService'; type VsAgentDidCommModule = DidCommModule ]>; proofs: DidCommProofsModuleConfigOptions<[ DidCommProofV2Protocol<[LegacyIndyDidCommProofFormatService, AnonCredsDidCommProofFormatService]> ]>; }>; export type BaseAgentModules = { askar: AskarModule; anoncreds: AnonCredsModule; dids: DidsModule; w3cCredentials: W3cCredentialsModule; didcomm: VsAgentDidCommModule; vtFlow: VtFlowModule; }; interface AgentOptions { config: InitConfig; modules?: TModules; dependencies: AgentDependencies; } export declare class VsAgent extends Agent { did?: string; autoDiscloseUserProfile?: boolean; publicApiBaseUrl: string; adminApiServiceEndpoint?: string; displayPictureUrl?: string; label: string; veranaChain?: VeranaChainService; authorizationService?: AuthorizationService; discoveryOptions?: DidCommFeatureQueryOptions[]; constructor(options: AgentOptions & { did?: string; autoDiscloseUserProfile?: boolean; publicApiBaseUrl: string; adminApiServiceEndpoint?: string; displayPictureUrl?: string; label: string; veranaChain?: VeranaChainService; authorizationService?: AuthorizationService; discoveryOptions?: DidCommFeatureQueryOptions[]; }); private get hasUserProfile(); initialize(): Promise; private findCreatedDid; private findEd25519VerificationMethodId; private getDidCommServices; private persistDidDocumentKey; /** * Fix a webvh update-key mapping whose `didDocumentRelativeKeyId` was stored as the full multibase * (e.g. `#z6Mk...`) while the DID document verification method uses a short fragment (e.g. `#BVhGnL79`). * `getKmsKeyIdForVerifiacationMethod` matches by suffix (`vm.id.endsWith(relativeKeyId)`), so the * mismatch leaves the update key unresolvable and every webvh update fails with * "The key ID must be present before the log can be edited." The private key is present in the KMS; * only the mapping label is wrong. Idempotent: a mapping that already correlates to a VM is left alone. */ private repairWebvhUpdateKeyMapping; private createAndAddDidCommKeysAndServices; private createAndAddLinkedVpServices; /** * Basic implicit webvh services, for the moment pointing to the service VP * and public base URL */ private createAndAddWebVhImplicitServices; private createAndAddAnonCredsServices; private applyAdminApiService; } export interface VsAgentOptions { config: InitConfig; did?: string; autoDiscloseUserProfile?: boolean; dependencies: AgentDependencies; publicApiBaseUrl: string; adminApiServiceEndpoint?: string; masterListCscaLocation?: string; endpoints: string[]; walletConfig: AskarModuleConfigStoreOptions; displayPictureUrl?: string; label: string; } export {};