Rewrite Rosetta samples as wrappers over mina-repo examples#1201
Draft
dkijania wants to merge 2 commits into
Draft
Rewrite Rosetta samples as wrappers over mina-repo examples#1201dkijania wants to merge 2 commits into
dkijania wants to merge 2 commits into
Conversation
The samples pages now narrate the integration patterns and Mina-specific spec deltas, with each page linking to the corresponding TypeScript example in src/app/rosetta/examples/ts/ in the mina repo (PR MinaProtocol/mina#18833). Same pattern as the docker-compose docs: docs2 owns narrative and Mina-specific knowledge, mina repo owns runnable artifacts. Examples stay in sync with the daemon they target via co-location and CI. Pages updated: - index.mdx: explains the SDK situation (no maintained TS Rosetta SDK, Cardano/Stacks use the same axios pattern) and points at the examples directory for quickstart - scan-blocks.mdx: 10-line core loop excerpt + Mina notes (reorgs, confirmations, skipped slots) - track-deposits.mdx: deposit filter excerpt + Mina notes (operation types, account creation fee, memo guidance) - send-transactions.mdx: full Construction API flow with mina-signer's rosettaCombinePayload helper, plus cold-signing variant - requests.mdx: trimmed intro to point at runnable scripts; curl snippets remain as illustrative quick-exploration tools Regenerate llms-full.txt accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
7 tasks
dkijania
added a commit
to MinaProtocol/mina
that referenced
this pull request
May 14, 2026
The PR's original `commons.ts` (300 lines: typed RosettaClient + Mina
operation builder) has graduated into its own published-on-npm SDK at
`o1-labs/mina-rosetta-sdk-js`. The examples now consume it as a regular
dependency.
- `commons.ts` deleted (−300 lines).
- `package.json`: `axios` removed (HTTP is the SDK's concern now);
`@o1-labs/mina-rosetta-sdk@^0.0.1` added; `dotenv` + `mina-signer`
kept.
- Each example imports types/client/helpers from the SDK; `requireEnv`
+ `sleep` inlined per-file so each script stays self-contained for
copy-paste reading.
- README updated: "no Rosetta TS SDK exists" → "install the SDK
directly", drops the layout entry for `commons.ts`.
- `package-lock.json` removed for now — the SDK is not yet on npm, so
`npm ci` would fail anyway. Will regenerate once the SDK publishes
`0.0.1`. The other PR docs in MinaProtocol/docs2#1201 don't depend
on this lockfile.
Net: −780 lines across the directory; example code-to-comment ratio
improves and "what does this example actually do" reads faster.
Blocks on: @o1-labs/mina-rosetta-sdk@0.0.1 being published to npm
(awaiting NPM_TOKEN regeneration on the shared o1-labs account).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The runnable mina-repo TS examples now depend on @o1-labs/mina-rosetta-sdk (published to npm 2026-05-13) rather than the inline axios+commons.ts pattern this PR originally documented. Refresh prose accordingly: - index.mdx setup paragraph: "axios + commons.ts" → SDK + signer - index.mdx "Why no SDK?" callout: pivots from "Mina follows the hand-rolled axios pattern" to "Mina ships its own SDK; upstream Coinbase still has the same gap for everyone else" - index.mdx network-identifier note: "RosettaClient in commons.ts" → "SDK's RosettaClient" - send-transactions.mdx: buildTransferOperations attribution follows the helper into the SDK Regenerate llms-full.txt accordingly. Pairs with MinaProtocol/mina#18833. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Rewrites the Rosetta Code Samples pages as narrative wrappers over the runnable TypeScript examples being added to the mina repo in MinaProtocol/mina#18833. Same pattern as the docker-compose docs: docs2 owns narrative and Mina-specific knowledge, mina repo owns runnable artifacts.
Why
The current pages (landed in #1192) replaced TypeScript samples with curl + jq. That made the pages shorter but pushed integrators toward fragile shell heredocs for production code. Looking at how comparable chains handle this:
dfinity/rosetta-client); it was archived August 2025So the TS path that integrators actually use is exactly what Cardano ships. This PR replicates that approach for Mina by linking each samples page to a runnable script in
mina/src/app/rosetta/examples/ts/.What changed
index.mdxscan-blocks.mdxtrack-deposits.mdxsend-transactions.mdxmina-signer.rosettaCombinePayload, plus cold-signing variant pointing atoffline-sign.tsrequests.mdxstatic/llms-full.txtregenerated.Dependency
Links to runnable examples won't resolve until MinaProtocol/mina#18833 merges into
develop. Hence this PR is opened as draft — same workflow as #1175 → mina#18827.Test plan
npm startand click through/node-operators/rosetta/samples/*pages🤖 Generated with Claude Code