@cfxlabsinc/b2b-services
    Preparing search index...

    Management of the Utila vaults: which customer each belongs to, the generic vault the rest share, and the service accounts that act in them. The table's only writer: every write busts the cache UtilaVaultService reads.

    Hierarchy (View Summary)

    Index
    • Parameters

      • __namedParameters: {
            cosignerHost: CosignerHostClient | null;
            db: B2bDatabase;
            internalEventPublisher: InternalEventPublisher | null;
            valkeyClient: ValkeyClient | null;
        }

      Returns UtilaVaultAdminService

    cache: ServiceCache<CachedSearchPage<UtilaVault>>
    db: B2bDatabase
    instance: (...args: []) => UtilaVaultAdminService = ...

    The process default: built from each dependency's own instance().

    • Registers a vault bought from Utila. customerId: null is the generic vault; a customer's own vault takes that customer's NEW wallets from here on. A vault given a cosigner account then has a device registered on the host; the vault exists whatever the outcome, which signingStatus records.

      Parameters

      • input: {
            adminServiceAccountEmail?: string | null;
            cosignerServiceAccountEmail?: string | null;
            customerId: string | null;
            name: string;
            utilaId: string;
            viewerServiceAccountEmail?: string | null;
        }

      Returns Promise<{ ok: true; value: UtilaVault } | { error: ServiceError; ok: false }>

    • Soft-deletes a vault, so its customer's NEW wallets fall back to the internal or generic vault. Refused for the generic vault, and while any wallet row names it, deleted or disabled too: a deleted vault is no longer synced.

      Parameters

      • __namedParameters: { id: string }

      Returns Promise<{ ok: true; value: undefined } | { error: ServiceError; ok: false }>

    • Clear each customer's membership tag and each record tag wherever cached, and always this namespace's collection tag. keys are exact deletes in this instance's key space: the only bust a null client honours.

      Parameters

      • __namedParameters: {
            customerIds: readonly string[];
            keys?: readonly CacheKey[];
            records?: readonly string[];
        }

      Returns Promise<void>

    • Stored rows only; the getFor* reads apply the fallbacks.

      Parameters

      • __namedParameters: UtilaVaultFilters & { includeDeleted?: boolean } = {}

      Returns Promise<
          {
              ok: true;
              value: { hasNext: boolean; items: UtilaVault[]; total: number };
          },
      >

    • Tags for a page: the scope its query searched (each customer's membership tag, else the collection tag), so an empty page is bustable too, plus the records it projects and the fields that chose or ordered its rows.

      Parameters

      • __namedParameters: {
            customerIds: readonly string[] | undefined;
            fields?: readonly string[];
            records?: readonly string[];
        }

      Returns string[]

    • Renames a live vault, changes its service accounts, or gives it to another customer (null: nobody). Only NEW wallets follow: existing rows never move, so a customer cannot be given a vault holding another customer's wallets.

      Parameters

      • input: {
            adminServiceAccountEmail?: string | null;
            customerId?: string | null;
            id: string;
            name?: string;
            viewerServiceAccountEmail?: string | null;
        }

      Returns Promise<{ ok: true; value: UtilaVault } | { error: ServiceError; ok: false }>