The vault SDK is the client for a vault: create or open it, publish and read events, store objects, connect agents, read the Memory Bank, and manage members. It runs in Node and the browser.
Sign each request (the default when you pass signer).
new DelegationAuthProvider(token)
Authenticate with a delegation bearer token instead of signing.
new NoAuth()
Unauthenticated calls.
Opening a vault
Method
Returns
sdk.vault.ensure(opts?)
Your vault, creating it on first use. opts: onboard (default true), onProgress, chainUrl. Idempotent.
sdk.vault.current()
Your own vault.
sdk.vault.byId(vaultId)
A vault by id, typically an organization’s.
sdk.vault.rename(vaultId, displayName)
Sets the vault’s name. Owner only.
ensure() throws OnboardingRequiredError when the wallet still needs its on-chain gateway registration, and OnboardingTimeoutError when onboarding does not finish in time. onProgress reports inspecting-wallet, funding-wallet, gateway-authorization-required, and later steps.
Vault
Member
Does
id, bucketId, walletPubkey, displayName, status
Vault record. isDisconnected() is true when its storage credential can no longer be refreshed.
Set spend limits; 0 or absent means no limit on that axis.
cubby(alias)
query(sql, params) / exec(sql, params) on the agent’s cubby.
disconnect()
Remove the connection. Cubby data stays.
Memberships
sdk.memberships: mine() (vaults you belong to), list(vaultId), signedRoster(vaultId), put(…), putScopes(…), remove(vaultId, memberPubkey), scopes(vaultId, memberPubkey). put and putScopes need a signer: the owner signs the grant document. See Vault members.