import type { ProofFormatCredentialForRequestPayload, ProofFormatPayload } from './formats' import type { AutoAcceptProof } from './models' import type { ProofProtocol } from './protocol/ProofProtocol' import type { DeleteProofOptions, GetProofFormatDataReturn, ProofFormatsFromProtocols, } from './protocol/ProofProtocolOptions' // re-export GetFormatDataReturn type from protocol, as it is also used in the api export type { GetProofFormatDataReturn, DeleteProofOptions } export type FindProofProposalMessageReturn = ReturnType export type FindProofRequestMessageReturn = ReturnType export type FindProofPresentationMessageReturn = ReturnType< PPs[number]['findPresentationMessage'] > /** * Get the supported protocol versions based on the provided proof protocols. */ export type ProofsProtocolVersionType = PPs[number]['version'] interface BaseOptions { autoAcceptProof?: AutoAcceptProof comment?: string } /** * Interface for ProofsApi.proposeProof. Will send a proposal. */ export interface ProposeProofOptions extends BaseOptions { connectionId: string protocolVersion: ProofsProtocolVersionType proofFormats: ProofFormatPayload, 'createProposal'> goalCode?: string parentThreadId?: string } /** * Interface for ProofsApi.acceptProposal. Will send a request * * proofFormats is optional because this is an accept method */ export interface AcceptProofProposalOptions extends BaseOptions { proofRecordId: string proofFormats?: ProofFormatPayload, 'acceptProposal'> goalCode?: string /** @default true */ willConfirm?: boolean } /** * Interface for ProofsApi.negotiateProposal. Will send a request */ export interface NegotiateProofProposalOptions extends BaseOptions { proofRecordId: string proofFormats: ProofFormatPayload, 'createRequest'> goalCode?: string /** @default true */ willConfirm?: boolean } /** * Interface for ProofsApi.createRequest. Will create an out of band request */ export interface CreateProofRequestOptions extends BaseOptions { protocolVersion: ProofsProtocolVersionType proofFormats: ProofFormatPayload, 'createRequest'> goalCode?: string parentThreadId?: string /** @default true */ willConfirm?: boolean } /** * Interface for ProofsApi.requestCredential. Extends CreateProofRequestOptions, will send a request */ export interface RequestProofOptions extends BaseOptions, CreateProofRequestOptions { connectionId: string } /** * Interface for ProofsApi.acceptRequest. Will send a presentation */ export interface AcceptProofRequestOptions extends BaseOptions { proofRecordId: string /** * whether to enable return routing on the send presentation message. This value only * has an effect for connectionless exchanges. */ useReturnRoute?: boolean proofFormats?: ProofFormatPayload, 'acceptRequest'> goalCode?: string /** @default true */ willConfirm?: boolean } /** * Interface for ProofsApi.negotiateRequest. Will send a proposal */ export interface NegotiateProofRequestOptions extends BaseOptions { proofRecordId: string proofFormats: ProofFormatPayload, 'createProposal'> goalCode?: string } /** * Interface for ProofsApi.acceptPresentation. Will send an ack message */ export interface AcceptProofOptions { proofRecordId: string } /** * Interface for ProofsApi.getCredentialsForRequest. Will return the credentials that match the proof request */ export interface GetCredentialsForProofRequestOptions { proofRecordId: string proofFormats?: ProofFormatCredentialForRequestPayload< ProofFormatsFromProtocols, 'getCredentialsForRequest', 'input' > } export interface GetCredentialsForProofRequestReturn { proofFormats: ProofFormatCredentialForRequestPayload< ProofFormatsFromProtocols, 'getCredentialsForRequest', 'output' > } /** * Interface for ProofsApi.selectCredentialsForRequest. Will automatically select return the first/best * credentials that match the proof request */ export interface SelectCredentialsForProofRequestOptions { proofRecordId: string proofFormats?: ProofFormatCredentialForRequestPayload< ProofFormatsFromProtocols, 'getCredentialsForRequest', 'input' > } export interface SelectCredentialsForProofRequestReturn { proofFormats: ProofFormatCredentialForRequestPayload< ProofFormatsFromProtocols, 'selectCredentialsForRequest', 'output' > } /** * Interface for ProofsApi.sendProblemReport. Will send a problem-report message */ export interface SendProofProblemReportOptions { proofRecordId: string description: string } /** * Interface for ProofsApi.declineRequest. Decline a received proof request and optionally send a problem-report message to Verifier */ export interface DeclineProofRequestOptions { proofRecordId: string sendProblemReport?: boolean }