Skip to main content

Proof

Proofs in the Cloud Wallet SDK involve handling proof requests and submitting verifiable presentations. This section covers methods to preview, submit, retrieve, and decline proof requests.

Preview Proof

Previews a proof request to inspect its details.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.previewProof({
protocol: 'openid',
});

Params

ParameterTypeDescription
protocolstring (Required)The protocol used for the proof request (e.g., openid).
proofRequestUri?string (Optional)The URI of the proof request to preview.
proofRecordId?string (Optional)The ID of the proof record to preview.
note
  • At least one of proofRequestUri or proofRecordId must be provided.
  • Use this to review proof request details before submitting or declining.

Submit Presentation

Submits a presentation in response to a proof request.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.submitPresentation({
protocol: 'openid',
});

Params

ParameterTypeDescription
protocolstring (Required)The protocol used for the proof request (e.g., openid).
proofRequestUri?string (Optional)The URI of the proof request to submit against.
proofRecordId?string (Optional)The ID of the proof record to submit.

note
  • At least one of proofRequestUri or proofRecordId must be provided.
  • This method submits a verifiable presentation based on stored credentials.

Get Proof Request by ID

Retrieves details of a specific proof request by its ID.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.getProofRequestById({
proofRecordId: 'proof-123',
});

Params

ParameterTypeDescription
proofRecordIdstring (Required)The ID of the proof record to retrieve.
note
  • Use this to fetch details of a specific proof request.
  • Ensure the proofRecordId is valid and associated with the wallet.

Get Proof Requests

Retrieves a list of all proof requests associated with the wallet.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.getProofRequests();

note
  • This method retrieves all proof requests without requiring parameters.
  • Check AllProofRequestsResponse for the full structure of returned objects.

Decline Proof Request

Declines a proof request, rejecting the need to submit a presentation.

import { CloudWallet } from '@hovi/cloudwallet-sdk';

const wallet = new CloudWallet({
apiKey: 'your-ecosystem-api-key',
});

const result = await wallet.declineProofRequest({
protocol: 'openid',
proofRecordId: 'proof-123',
});

Params

ParameterTypeDescription
protocolstring (Required)The protocol used for the proof request (e.g., openid).
proofRecordIdstring (Required)The ID of the proof record to decline.
note
  • Use this to reject unwanted proof requests.
  • Declined requests will not require a presentation submission.