UserHandle
One host user's slice of the library (SPEC §7.1, §8).
Created by user; tenant_id is derived, never
supplied. Every operation is scoped to that tenant (rule #6).
__init__
__init__(self, facade: Auradefi, external_user_id: str, tenant_id: str) -> None
Bind the facade and the derived tenant id. No I/O.
Parameters
facaderequired, Auradefinone
external_user_idrequired, strnone
tenant_idrequired, strnone
connect_address
connect_address(self, chain: str, address: str) -> ConnectionRecord
Watch one address on one chain: validated NOW, not later.
In order, and each step before any HTTP can happen:
chains.evm.chain_id_from_caip2(chain): a vendor name like"ethereum"raisesauradefi.errors.CaipParseError.- ChainRegistry MEMBERSHIP: a well-formed CAIP-2 the registry
does not hold raises
auradefi.errors.UnknownChainErrornaming it. The decoder needs that entry, so accepting the chain stores a connection everysync()fails on (§5 #24). chains.evm.normalize_address(address). A non-address raisesauradefi.errors.ValidationError. The normalized (lowercased) address is what gets stored.- The connection id is DERIVED
(
embed.models.derive_connection_id) and CHAIN-SCOPED, so a re-connect of the same (chain, address), in any letter case in the 40 hex DIGITS, raisesauradefi.errors.ConflictErrorcarryingexisting_idwith ZERO requests made, while the SAME address on ANOTHER chain is a second, independent connection (§5 #26). The0xprefix is NOT case-insensitive:0X…never reaches here, step 3 rejects it. - A liveness probe: EXACTLY one request. Its
auradefi.errors.SourceErrorpropagates and NOTHING is stored; an EMPTY result is a valid fresh address. - The
ConnectionRecordis stored withcreated_at_ms = clock.now_ms()and returned.
Parameters
chainrequired, strCAIP-2 id, e.g. eip155:1. A vendor name like ethereum is refused, as is a chain the registry does not hold.
addressrequired, strChecksummed or lowercase; stored lowercased. The 0x prefix is not case-insensitive.
Raises
CaipParseError, ConflictError, SourceError, UnknownChainError, ValidationError
connections
connections(self) -> tuple[ConnectionRecord, ...]
This tenant's connections, in creation order.
sync
sync(self, budget: int = 5) -> SyncReport
sync restricted to THIS user's connections.
Parameters
budgetoptional, int, default 5none
holdings
holdings(self) -> tuple[HoldingsReport, ...]
holdings for THIS user's connections.
scalar_metrics
scalar_metrics(self) -> tuple[scalar_projection.Metric, ...]
scalar_metrics for THIS user's connections.