@harvarduqt/oracle-ts-sdk
v1.0.0
Published
Oracle TypeScript SDK
Readme
run
flatc \
--ts \
--gen-object-api \
--filename-suffix _generated \
-o src/fbs \
fbs/gateway/gateway.fbsto generate the flat buffer objects.
These objects are how we receive messages from the server! There are two ways streams work:
Snapshot streams: simply replace current value of object with new value. Streams that have this property are ledger meta, domain meta, and l2 book.
Delta streams: The first item is a snapshot! this includes account orders, account positions.
Appending streams: these are fills and trades - the first message is a snapshot of the latest items, and each message after that appends. We want to set a max amount of these displayed on the frontend of course.
For delta/appending streams, we care about maintaining some kind of continuity, so messages are timestamped. Make sure you don't miss any time stamps! The canonical timestamp of a snapshot is the next timestamp. Any "end_ts" is exclusive. Hence, the idea is that your state always holds onto the next timestamp and tries to find the updates from then on.
