Repository navigation
feat(ts-sdk): activity as per-batch entries, one feed per account - #318
Merged
Merged
Conversation
majesticwizardcat
force-pushed
the
giannis/activity-frames
branch
from
October 19, 2026 10:17
468ee45 to
b3dccbb
Compare
majesticwizardcat
force-pushed
the
giannis/activity-frames
branch
2 times, most recently
from
October 19, 2026 14:28
2bedd86 to
2ce2afe
Compare
majesticwizardcat
force-pushed
the
giannis/activity-frames
branch
6 times, most recently
from
October 20, 2026 16:02
d0a0c49 to
7940ed0
Compare
Reads pod#170's wire: GET /clob/activity serves {"<batch>": [{k, …}]}
newest first with a type filter and `next` passed back as `to`, and
pod_activity sends the same map one tick at a time. ActivityEntry rows
keep activityType and timeMs and gain fill, modify, termination and the
stream-only refusals; the order row is the order as /clob/orders serves
it (current state on REST, admission state on the stream), so pre-upgrade
orders read correctly without folding, and live entries update the held
order. One ActivityHistory per account holds the one subscription and
the paging state; views filter it by types and window. Order.fills is
gone, on /clob/orders too: fills are the fill rows and /clob/fills.
drainFlows filters by type again. Version 0.13.0.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
majesticwizardcat
force-pushed
the
giannis/activity-frames
branch
from
October 21, 2026 15:18
7940ed0 to
424f5fa
Compare
The node will not serve placed terms for now, so Order drops size and initialPrice and modify updates initialSize again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The doc/api-reference changes are now #323, so this PR is the SDK code alone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
majesticwizardcat
marked this pull request as ready for review
October 22, 2026 08:52
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows https://code.pod.network/pod/pod/pulls/170 (merged):
GET /clob/activity/{account}andpod_activityserve one account's activity as one entry list per batch,{"<batch>": [{k, …}]}, with a type filter, newest-first whole-batch paging andnextpassed back asto. The SDK reads that shape and keepsclient.activity(account, query)as the one feed of everything that happened to an account.Public API
client.activity(account)holds the onepod_activitysubscription and the one paging state;activity.view({ types, from, to })is a filtered view over its rows (client.activity(account, query)returns one), so the activity page, the chart and any other reader share a single subscription.ActivityEntryrows keepactivityTypeandtimeMs(the batch) and gain the kinds the node now stores:fill(this fill with its ownfee, running totals,closedAs,positionAfter),modify(new and old terms),termination(how the order left the book),modify_rejectandcancel_reject(the refusal's reason text, stored by the node like a rejected placement'sinvalid_reason). Theorderrow is the order as/clob/ordersserves it, with its current state on REST and the admission state on the stream; live entries update the held order.Order.fillsis gone, on/clob/orderstoo: fills are the activityfillrows and/clob/fills.OrderEvent.fillkeeps the live fill's payload.transferrow carriescounterparty: the receiver whenamountis negative, the sender otherwise. On the wire the money kinds use short names (tok,amt,err,cp,sz,eq); the public rows keep their names.ActivityTypeis the nine kinds, usable as the filter;ActivityQuery.from/toare inclusive batch bounds in ms,limitcounts entries per REST page.OrderStatus/TerminalStatusgainself_trade_canceled;OrderEventgainscancel_rejectwithcancelRejection, soonEventreports a refused cancel instead of dropping it.PodRestClient.activitytakes{types, fromUs, toUs, limit}and returns the page as batches newest first withnextUs.Behaviour
ActivityHistoryseeds from the newest page, subscribes fromsolution_now, folds every batch in order into the orders it holds, andloadOlderpassesnextback asto. One batch map is the dedupe point for both sources; a reconnect re-seed fills the gap from the stream cursor and keeps the paging position.pnlHistoryStreamreads money flows withactivity_types=backstop,bridge_transfer,transferagain.Docs
The API reference for the new shape is its own PR, #323; this one carries the SDK code and its README.
🤖 Generated with Claude Code