ProtectedentityThe wallet owner's display name — the identity's full name for a person,
the organization's name for a business. Built here rather than inlined
because it is needed twice: once in the projection and once in the q
predicate (Postgres can't reference a select alias from WHERE).
OptionalcreatedAt?: DbTimestampCriteriaOptionalcustomerIds?: string[]OptionalentityIds?: string[]OptionalentityTypes?: ("PERSON" | "BUSINESS")[]Narrow to wallets owned by people (identity_id) or by businesses
(organization_id). Distinct from entityIds, which names specific
entities — this is the "all people" / "all businesses" cut.
Optionalids?: string[]OptionalincludeDeleted?: booleanInclude soft-deleted wallets. Off by default so every caller that forgets it gets the live set. Admin-only: the consumer service has no such flag, because a deleted wallet is precisely one a customer must not see.
OptionalorderBy?: DbOrderByCriterion<Optionalpage?: numberDefaults to 1
OptionalpageSize?: numberDefaults to 10
Optionalq?: stringCase-insensitive substring over the Utila wallet id, the owning customer's name, the entity's name, and the derived addresses — an operator most often arrives holding an address off a block explorer and needs the wallet it belongs to.
OptionalupdatedAt?: DbTimestampCriteria
How many of a customer's custodial wallets are live, and how many are hidden.
One scan with FILTER aggregates rather than two
searchcalls: the deleted count is only meaningful next to the live one — "2, 1 deleted" is a single fact about the customer, so it should cost a single round trip. Exact, unlike counting a capped page.