Skip to content

feat(ts-sdk): activity as per-batch entries, one feed per account - #318

Merged
majesticwizardcat merged 3 commits into
mainfrom
giannis/activity-frames
Oct 22, 2026
Merged

majesticwizardcat merged 3 commits into
mainfrom
giannis/activity-frames

Conversation

@majesticwizardcat

@majesticwizardcat majesticwizardcat commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Follows https://code.pod.network/pod/pod/pulls/170 (merged): GET /clob/activity/{account} and pod_activity serve one account's activity as one entry list per batch, {"<batch>": [{k, …}]}, with a type filter, newest-first whole-batch paging and next passed back as to. The SDK reads that shape and keeps client.activity(account, query) as the one feed of everything that happened to an account.

Public API

  • One feed per account: client.activity(account) holds the one pod_activity subscription 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.
  • ActivityEntry rows keep activityType and timeMs (the batch) and gain the kinds the node now stores: fill (this fill with its own fee, running totals, closedAs, positionAfter), modify (new and old terms), termination (how the order left the book), modify_reject and cancel_reject (the refusal's reason text, stored by the node like a rejected placement's invalid_reason). The order row is the order as /clob/orders serves it, with its current state on REST and the admission state on the stream; live entries update the held order.
  • Order.fills is gone, on /clob/orders too: fills are the activity fill rows and /clob/fills. OrderEvent.fill keeps the live fill's payload.
  • A transfer row carries counterparty: the receiver when amount is 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.
  • ActivityType is the nine kinds, usable as the filter; ActivityQuery.from/to are inclusive batch bounds in ms, limit counts entries per REST page.
  • OrderStatus/TerminalStatus gain self_trade_canceled; OrderEvent gains cancel_reject with cancelRejection, so onEvent reports a refused cancel instead of dropping it.
  • PodRestClient.activity takes {types, fromUs, toUs, limit} and returns the page as batches newest first with nextUs.

Behaviour

  • ActivityHistory seeds from the newest page, subscribes from solution_now, folds every batch in order into the orders it holds, and loadOlder passes next back as to. 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.
  • pnlHistoryStream reads money flows with activity_types=backstop,bridge_transfer,transfer again.
  • Version 0.13.0: the public types changed.

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

@majesticwizardcat majesticwizardcat changed the title feat(ts-sdk): activity history as per-batch frames feat(ts-sdk): activity as per-batch entries, every kind a row Oct 19, 2026
@majesticwizardcat
majesticwizardcat force-pushed the giannis/activity-frames branch 2 times, most recently from 2bedd86 to 2ce2afe Compare October 19, 2026 14:28
@majesticwizardcat majesticwizardcat changed the title feat(ts-sdk): activity as per-batch entries, every kind a row feat(ts-sdk): activity as per-batch entries, one feed per account Oct 19, 2026
@majesticwizardcat
majesticwizardcat force-pushed the giannis/activity-frames branch 6 times, most recently from d0a0c49 to 7940ed0 Compare October 20, 2026 16:02
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>
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
majesticwizardcat marked this pull request as ready for review October 22, 2026 08:52

@0zzy-o 0zzy-o left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@majesticwizardcat
majesticwizardcat merged commit 2b2e590 into main Oct 22, 2026
8 of 9 checks passed
@majesticwizardcat
majesticwizardcat deleted the giannis/activity-frames branch October 22, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants