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
| Parameter | Type | Description | 
|---|---|---|
| protocol | string (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 
proofRequestUriorproofRecordIdmust 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
| Parameter | Type | Description | 
|---|---|---|
| protocol | string (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 
proofRequestUriorproofRecordIdmust 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
| Parameter | Type | Description | 
|---|---|---|
| proofRecordId | string (Required) | The ID of the proof record to retrieve. | 
note
- Use this to fetch details of a specific proof request.
 - Ensure the 
proofRecordIdis 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 
AllProofRequestsResponsefor 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
| Parameter | Type | Description | 
|---|---|---|
| protocol | string (Required) | The protocol used for the proof request (e.g., openid). | 
| proofRecordId | string (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.