hexbook.near and serves history, a live stream, stats and
charts.
From the chain
hexbook.near receipts come from:
Events are in the logs of
hexbook.near’s own successful receipts. Ignore intents.near receipts: their
mt_transfer events duplicate the token movements.
FastNEAR
FastNEAR indexes transactions by account:authorization: Bearer <key>.
desc: true pages newest first. Full request shape: FastNEAR’s OpenAPI (docs.fastnear.com/openapi/transactions.json).
NEAR RPC
Without an index, use a NEAR archival RPC:EXPERIMENTAL_tx_status { tx_hash, sender_account_id, wait_until: "FINAL" }returns every receipt outcome with its logs;- or follow blocks (
block,chunk) and keep receipts withreceiver_id == "hexbook.near", thenEXPERIMENTAL_receipt/ the transaction outcome for their logs; - or a NEAR Lake / streamer framework filtered on
hexbook.near.
get_orderbook, get_active_pairs, get_quote_pub, get_user_balance) go to any RPC with call_function.
The HEX API
Base URL:https://hex-api.app/orderbook. :contract is hexbook.near (or orderbook.fi.tg, HOT’s book). Token ids
are URL-encoded.
It is meant for server-side use: browser requests from other origins are rejected (CORS). Rate limits per IP: 300
reads and 30 POST /tx per minute.
Rows are history entries (
order_created, order_closed, market_swap) normalized for display, not raw contract
events. They do not carry deposits, skips, epochs, payout modes or internal-balance credits: for those, and for exact
settlement, index the contract logs yourself.
Latency: the HEX API syncs every ~10 s plus FastNEAR’s lag; POST /tx right after your transaction makes it visible
at once.
Example: follow your fills
Backfill strategy
1
Snapshot first
Read
get_active_pairs, then get_orders({ token_pair, skip, limit }) per book (pages of 100–200). This gives every
resting order (dead ones included; see get_order_meta) with its maker, side, price, created_ts and balance.2
Place the forward cursor
Remember the snapshot’s block height and follow new transactions from there (FastNEAR
/v0/account ascending from
the cursor minus ~60 blocks, or a block stream).3
Backfill history backwards
Page
/v0/account newest first from the cursor down to the book’s first transaction. Make the backfill idempotent.4
Key rows idempotently
Use
{receipt id}:{log index} as the unique key of an event so the overlap of forward sync, backfill and on-demand
indexing stores nothing twice.5
Handle out-of-order reads
A backfill that goes newest first reads an
order_closed or a fill before its order_created. Store the hash and
fill in maker, side and price once the order is read (or from get_order while it is still open).