live · mainnetoc · docs
specs · api · guides
docs / documentation

@orangecheck/vault-core


@orangecheck/vault-core / VaultClient

Class: VaultClient

Defined in: vault-core/src/sync.ts:62

A thin, transport-agnostic client for the vault.ochk.io ciphertext API.

Constructors

Constructor

new VaultClient(opts?: VaultClientOptions): VaultClient;

Defined in: vault-core/src/sync.ts:69

Parameters

ParameterType
optsVaultClientOptions

Returns

VaultClient

Methods

deleteBlob()

deleteBlob(envelopeId: string): Promise<void>;

Defined in: vault-core/src/sync.ts:182

Hard-delete one blob.

Parameters

ParameterType
envelopeIdstring

Returns

Promise&lt;void>


fetchBlob()

fetchBlob(envelopeId: string): Promise<string | null>;

Defined in: vault-core/src/sync.ts:135

One blob's packed ciphertext, or null when it is gone.

Parameters

ParameterType
envelopeIdstring

Returns

Promise&lt;string | null>


fetchBlobs()

fetchBlobs(refs: BlobRef[], concurrency?: number): Promise<FetchedBlob[]>;

Defined in: vault-core/src/sync.ts:151

Fetch many blobs with bounded concurrency — fast, but not a thundering herd against the rate limiter. A blob that fails transiently is omitted; the next sync re-fetches it.

Parameters

ParameterTypeDefault value
refsBlobRef[]undefined
concurrencynumber8

Returns

Promise&lt;FetchedBlob[]>


fetchEscrow()

fetchEscrow(): Promise<WrappedKey | null>;

Defined in: vault-core/src/sync.ts:109

The escrowed, passphrase-wrapped vault key, or null when no vault exists.

Returns

Promise&lt;WrappedKey | null>


fetchIdentity()

fetchIdentity(): Promise<string | null>;

Defined in: vault-core/src/sync.ts:117

The signed-in OrangeCheck identity (did:oc:…), or null.

Returns

Promise&lt;string | null>


listBlobs()

listBlobs(): Promise<BlobRef[]>;

Defined in: vault-core/src/sync.ts:129

The change manifest — envelope ids + timestamps, no ciphertext.

Returns

Promise&lt;BlobRef[]>


putBlob()

putBlob(envelopeId: string, ciphertext: string): Promise<void>;

Defined in: vault-core/src/sync.ts:174

Upsert one blob's packed ciphertext.

Parameters

ParameterType
envelopeIdstring
ciphertextstring

Returns

Promise&lt;void>