Skip to main content

Wallet

Wallets in the Cloud Wallet SDK are used to manage digital identities, credentials, and interactions with other entities. This section covers methods to create, retrieve, delete, and recover wallets.

Create Wallet

Creates a new digital wallet.

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

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

const result = await wallet.createWallet({
label: 'MyWallet',
secret: 'secure-secret',
});

Params

ParameterTypeDescription
labelstring (Required)A human-readable label for the wallet.
secretstring (Required)A secret key for securing the wallet.
note
  • The secret should be securely stored and never exposed.
  • Ensure the label is unique for easy identification.

Get Wallet

Retrieves details of an existing wallet.

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

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

const result = await wallet.getWallet({});

Params

ParameterTypeDescription
apiKey?string (Optional)The API key for authentication.
note
  • Use this method to fetch wallet details, such as stored credentials or configuration.

Delete Wallet

Deletes an existing wallet.

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

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

const result = await wallet.deleteWallet();

note
  • This action is irreversible and removes all associated data, including credentials.
  • Ensure no active operations rely on the wallet before deletion.

Recover Wallet

Recovers a wallet using its secret.

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

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

const result = await wallet.recoverWallet();

note
  • Use this method to recover access to a wallet if the access token is lost.
  • Requires the original secret used during wallet creation.