Stream events
createTotalis and createMaker start their own stream. To follow an account or a maker without them, use
TotalisStream directly:
statusisliveonly while it is caught up.serverNow()is the venue clock.- On close it follows the close reason’s
retry:BACKOFFresumes,REFRESH(or aresetframe) emitsresetand takes a fresh snapshot, andNEVERends it withStreamClosedError. - In a browser it authenticates with the
auth.<token>subprotocol and the page’s origin. In Node it sends the bearer header (Connection).
Page through lists
items walks every page of a list route and yields one item at a time. pages yields whole pages.
Money helpers
For example, a 3 USDC stake quoted at 9.18 USDC, with a 20 bps entry fee and a 100 bps profit fee, has a
netPayout of 9.118140 USDC.
UI adapter
createUiAdapter(totalis, { onInvalidate, onCatalogStale }) gives a frontend what it needs without tying it to
a framework:
- live quotes, with the best one picked
- the venue clock, as
serverNowandsecondsLeft - account invalidations, to refresh a query cache
- a catalog refresh, only when
catalog_generationmoves

