@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
| Parameter | Type |
|---|---|
opts | VaultClientOptions |
Returns
VaultClient
Methods
deleteBlob()
deleteBlob(envelopeId: string): Promise<void>;
Defined in: vault-core/src/sync.ts:182
Hard-delete one blob.
Parameters
| Parameter | Type |
|---|---|
envelopeId | string |
Returns
Promise<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
| Parameter | Type |
|---|---|
envelopeId | string |
Returns
Promise<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
| Parameter | Type | Default value |
|---|---|---|
refs | BlobRef[] | undefined |
concurrency | number | 8 |
Returns
Promise<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<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<string | null>
listBlobs()
listBlobs(): Promise<BlobRef[]>;
Defined in: vault-core/src/sync.ts:129
The change manifest — envelope ids + timestamps, no ciphertext.
Returns
Promise<BlobRef[]>
putBlob()
putBlob(envelopeId: string, ciphertext: string): Promise<void>;
Defined in: vault-core/src/sync.ts:174
Upsert one blob's packed ciphertext.
Parameters
| Parameter | Type |
|---|---|
envelopeId | string |
ciphertext | string |
Returns
Promise<void>