Skip to content

feat(toncenter): document Streaming API v2#2049

Merged
novusnota merged 9 commits intomainfrom
closes-1984/big-brother-is-streaming-you
Apr 9, 2026
Merged

feat(toncenter): document Streaming API v2#2049
novusnota merged 9 commits intomainfrom
closes-1984/big-brother-is-streaming-you

Conversation

@novusnota
Copy link
Copy Markdown
Collaborator

@novusnota novusnota commented Apr 2, 2026

Closes #1984.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Streaming API v2 docs: overview, notification reference, SSE and WebSocket transport guides.
    • Documented event types, delivery semantics, finality levels, invalidation behavior, subscription rules, and client handling guidance.
    • Described SSE/WebSocket usage: subscription formats, examples, keepalive/ping, unsubscribe behavior, reconnect limits.
    • Added navigation and overview cards linking Streaming API v2 across TON Center v2/v3 and sub-second resources.

@novusnota novusnota requested a review from a team as a code owner April 2, 2026 13:53
@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 2, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mintlify-ton-docs 🟢 Ready View Preview Apr 2, 2026, 1:55 PM

@github-actions

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@github-actions

This comment has been minimized.

github-actions[bot]

This comment was marked as resolved.

@novusnota
Copy link
Copy Markdown
Collaborator Author

novusnota commented Apr 2, 2026

from #2049 (comment):

Unfortunately, it is too large, with over 600 added lines, excluding some generated or otherwise special files. Thus, this pull request is challenging to review and iterate on.

Well, that's a bit unfortunate indeed, but it was intentional — this PR cannot be split into smaller ones without losing cohesion.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
ecosystem/api/toncenter/streaming/sse.mdx (1)

131-135: Clarify keepalive example as wire framing, not escaped string content.

Using : keepalive\n\n can be read as literal backslash characters. Prefer showing real SSE lines to avoid client-implementation mistakes.

Proposed doc tweak
-To keep the subscription alive, the server sends the following `keepalive` line every 15 seconds:
+To keep the subscription alive, the server sends an SSE comment frame every 15 seconds:

 ```text
-: keepalive\n\n
+: keepalive
+
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @ecosystem/api/toncenter/streaming/sse.mdx around lines 131 - 135, The SSE
keepalive example currently shows escaped backslashes (": keepalive\n\n") which
can be misread; update the example in ecosystem/api/toncenter/streaming/sse.mdx
to show the actual wire framing lines instead of an escaped string — i.e.,
display a literal colon-prefixed comment line ": keepalive" followed by a blank
line (the terminating CRLF) so readers see the true SSE payload framing for the
keepalive message.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Inline comments:
In @ecosystem/api/toncenter/streaming/overview.mdx:

  • Around line 88-92: The WebSocket Card component currently points to the SSE
    route; locate the Card element with title="WebSocket" (the JSX element using
    props title="WebSocket", icon="signal-stream") and change its href from
    "/ecosystem/api/toncenter/streaming/sse" to the correct WebSocket route (e.g.
    "/ecosystem/api/toncenter/streaming/websocket") so the WebSocket card links to
    the WebSocket page.

In @ecosystem/api/toncenter/streaming/reference.mdx:

  • Around line 66-68: This file uses the MDX component Aside but never imports
    it, causing build errors; add an import for Aside at the top of the MDX (before
    the first usage) — e.g. add a single-line import for the Aside component
    from the project's MDX/component exports so the blocks at the spots
    referencing action_types (the ones around the earlier usage and the repeated
    block later) render correctly; ensure the same import covers both occurrences.

In @ecosystem/api/toncenter/streaming/sse.mdx:

  • Line 143: Replace the escaped sequence "\~1 minute" with either a plain tilde
    "~1 minute" or the phrase "about 1 minute" in the sentence describing
    reconnection behavior to remove unnecessary backslash escaping and fix the
    Markdown/formatter error; update the text near the reconnect guidance so it
    reads e.g. "the previous connection may still be open for ~1 minute" or "about 1
    minute" and ensure no extra backslashes remain.

In @ecosystem/api/toncenter/streaming/wss.mdx:

  • Line 25: The sentence in the subscribe description ("Subscribe operation
    replaces the entire subscription snapshot the current connection") is missing
    the word "for"; update the Subscribe operation description in
    ecosystem/api/toncenter/streaming/wss.mdx to read "Subscribe operation replaces
    the entire subscription snapshot for the current connection" so the grammar is
    correct and the meaning is clear.

Nitpick comments:
In @ecosystem/api/toncenter/streaming/sse.mdx:

  • Around line 131-135: The SSE keepalive example currently shows escaped
    backslashes (": keepalive\n\n") which can be misread; update the example in
    ecosystem/api/toncenter/streaming/sse.mdx to show the actual wire framing lines
    instead of an escaped string — i.e., display a literal colon-prefixed comment
    line ": keepalive" followed by a blank line (the terminating CRLF) so readers
    see the true SSE payload framing for the keepalive message.

</details>

<details>
<summary>🪄 Autofix (Beta)</summary>

Fix all unresolved CodeRabbit comments on this PR:

- [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended)
- [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `85ceb47b-1f37-4ed7-99b6-acf367e9fc41`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between c9da5b6c05720a4cbe5ef11df6b89c89673f0e09 and b6a56afb8d19202b64e91da9e9460294c2140340.

</details>

<details>
<summary>📒 Files selected for processing (9)</summary>

* `docs.json`
* `ecosystem/api/toncenter/introduction.mdx`
* `ecosystem/api/toncenter/streaming/overview.mdx`
* `ecosystem/api/toncenter/streaming/reference.mdx`
* `ecosystem/api/toncenter/streaming/sse.mdx`
* `ecosystem/api/toncenter/streaming/wss.mdx`
* `ecosystem/api/toncenter/v2/overview.mdx`
* `ecosystem/api/toncenter/v3/overview.mdx`
* `ecosystem/subsecond.mdx`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
ecosystem/api/toncenter/streaming/overview.mdx (1)

50-71: Tighten wording for consistency and readability.

At Line 51, “very small” is a bit vague, and Lines 69–71 repeat the same sentence start. Consider a small wording pass for crisper tone.

Suggested wording tweak
-- `confirmed` — trace or transactions are included in a candidate shard block. Rollback chance is very small, but still possible.
+- `confirmed` — trace or transactions are included in a candidate shard block. Rollback risk is low, but still possible.

- - Use `pending` for the lowest latency.
- - Use `confirmed` for lower rollback risk with near-real-time delivery.
- - Use `finalized` when only settled data is acceptable.
+ - Choose `pending` for the lowest latency.
+ - Choose `confirmed` for lower rollback risk with near-real-time delivery.
+ - Choose `finalized` when only settled data is acceptable.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ecosystem/api/toncenter/streaming/overview.mdx` around lines 50 - 71, Tighten
the wording for clarity and consistency: replace vague phrasing like "very
small" with a firmer term such as "unlikely" in the description of `confirmed`,
remove the repeated sentence starts in the delivery recommendations (lines that
begin with "Use") by consolidating or rephrasing into a single succinct guidance
list, and ensure the terms `pending`, `confirmed`, `finalized`, `min_finality`,
`account_state_change`, `jettons_change`, and `trace_invalidated` are used
consistently and exactly as shown to avoid ambiguity.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@ecosystem/api/toncenter/streaming/overview.mdx`:
- Around line 50-71: Tighten the wording for clarity and consistency: replace
vague phrasing like "very small" with a firmer term such as "unlikely" in the
description of `confirmed`, remove the repeated sentence starts in the delivery
recommendations (lines that begin with "Use") by consolidating or rephrasing
into a single succinct guidance list, and ensure the terms `pending`,
`confirmed`, `finalized`, `min_finality`, `account_state_change`,
`jettons_change`, and `trace_invalidated` are used consistently and exactly as
shown to avoid ambiguity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4365e9fe-2dd1-4e4e-bd63-026c9c865e35

📥 Commits

Reviewing files that changed from the base of the PR and between b6a56af and f8fdc0a.

📒 Files selected for processing (2)
  • ecosystem/api/toncenter/introduction.mdx
  • ecosystem/api/toncenter/streaming/overview.mdx
✅ Files skipped from review due to trivial changes (1)
  • ecosystem/api/toncenter/introduction.mdx

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
ecosystem/api/toncenter/streaming/overview.mdx (2)

73-74: Improve transport-selection sentence clarity

Line 73 reads awkwardly (“SSE and a WebSocket” / “its usage”). Consider tightening phrasing for smoother reading, e.g., “The Streaming API exposes two transports: SSE and WebSocket. Choose one transport to get started.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ecosystem/api/toncenter/streaming/overview.mdx` around lines 73 - 74, The
sentence describing available transports is awkward; update the line that
currently reads “The Streaming API exposes two transports: SSE and a WebSocket.
Choose either of the transports to proceed with its usage:” to a clearer
phrasing such as “The Streaming API exposes two transports: SSE and WebSocket.
Choose one transport to get started.” Replace the original sentence in
overview.mdx (the transport-selection sentence) accordingly to improve clarity
and concision.

47-47: Polish wording for consistency in bullets

Line 47 uses “very small,” and Lines 65–67 start three consecutive bullets with “Use…”. Consider light rewording to improve tone and flow without changing meaning.

Also applies to: 65-67

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ecosystem/api/toncenter/streaming/overview.mdx` at line 47, Replace the
phrasing in the `confirmed` bullet (the text containing the word "very small")
to match the tone used elsewhere (for example change "very small" to "very
unlikely") and adjust the three consecutive bullets that begin with "Use…" (the
bullets referenced on lines 65–67) to vary wording for flow—e.g., rephrase one
or two to start with alternate verbs or nouns while preserving meaning so the
bullets no longer repeat the exact "Use…" opener.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@ecosystem/api/toncenter/streaming/overview.mdx`:
- Around line 73-74: The sentence describing available transports is awkward;
update the line that currently reads “The Streaming API exposes two transports:
SSE and a WebSocket. Choose either of the transports to proceed with its usage:”
to a clearer phrasing such as “The Streaming API exposes two transports: SSE and
WebSocket. Choose one transport to get started.” Replace the original sentence
in overview.mdx (the transport-selection sentence) accordingly to improve
clarity and concision.
- Line 47: Replace the phrasing in the `confirmed` bullet (the text containing
the word "very small") to match the tone used elsewhere (for example change
"very small" to "very unlikely") and adjust the three consecutive bullets that
begin with "Use…" (the bullets referenced on lines 65–67) to vary wording for
flow—e.g., rephrase one or two to start with alternate verbs or nouns while
preserving meaning so the bullets no longer repeat the exact "Use…" opener.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b799bc1-4dfd-4eec-b48e-56c032007647

📥 Commits

Reviewing files that changed from the base of the PR and between b3d6c22 and 02209e3.

📒 Files selected for processing (1)
  • ecosystem/api/toncenter/streaming/overview.mdx

Kaladin13
Kaladin13 previously approved these changes Apr 9, 2026
Copy link
Copy Markdown
Collaborator

@Kaladin13 Kaladin13 left a comment

Choose a reason for hiding this comment

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

two security comments, overall good

@novusnota novusnota merged commit f372205 into main Apr 9, 2026
11 of 12 checks passed
@novusnota novusnota deleted the closes-1984/big-brother-is-streaming-you branch April 9, 2026 12:16
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.

[Ecosystem > APIs > TON Center] Document Streaming API v2

3 participants