Realtime, errors, and quotas
Realtime subscriptions reduce display latency. Indexed API reads and receipt status endpoints remain the durable way to establish state after startup, reconnect, or uncertainty.Subscribe
close() cancels a pending reconnect and closes the socket. At least one channel is
required.
Error model
API and RPC failures useTayhoError:
The server can return additional stable lowercase codes for route-specific failures. Record
requestId in diagnostics. Respect retryAfterSeconds instead of selecting a shorter delay.
Safe retries
- Reads are safe to retry with bounded exponential backoff.
- For an action or order submission, call
submit()again on the same prepared object. It reuses the same signed envelope and idempotency key. - Do not call the prepare method again just to retry a transient submission failure; that creates a new nonce and idempotency key.
- A
duplicateintent receipt is an accepted replay of the same submission. - After an ambiguous timeout, query the returned receipt/status capability when available before creating a new action.
- Fix configuration, authentication, scope, chain mismatch, and validation failures instead of retrying them.
Quota classes
Keys can grantread, realtime, and actions:submit scopes. Projects enforce separate budgets for
indexed reads, live reads, realtime connection creation, and submissions. They can also cap pending
actions, per-transaction sponsored gas, and daily sponsored gas. IP and wallet protections may be
stricter than the project limit.
Exact allocations belong to the issued project and key; the SDK does not assume universal numeric
limits. On HTTP 429, inspect retryAfterSeconds and the response’s request ID. Realtime clients
should let the built-in reconnect backoff obtain a fresh ticket rather than creating parallel
subscriptions.