Skip to main content

StorageClient

High-level keyshare storage manager with transaction support.

Implements

  • IStorageClient

Constructors

new StorageClient()

new StorageClient(provider): StorageClient

Parameters

provider

IStorageProvider = ...

Returns

StorageClient

Properties

provider

provider: IStorageProvider

Implementation of

IStorageClient.provider

Methods

loadTransaction()

loadTransaction(keyId): Promise<PreparedTransaction>

Loads a pending transaction.

Parameters

keyId

string

The keyId for the keyshare.

Returns

Promise<PreparedTransaction>

The transaction object.

Throws

If no pending transaction exists.

Implementation of

IStorageClient.loadTransaction


saveKeyshare()

saveKeyshare(keyId, item): Promise<PreparedTransaction>

Saves a new keyshare (starts a transaction).

Parameters

keyId

string

The keyId for the keyshare.

item

string

The keyshare bytes data to store (Base64 format) string.

Returns

Promise<PreparedTransaction>

A transaction object for commit/rollback.

Throws

If a pending transaction already exists.

Implementation of

IStorageClient.saveKeyshare