Skip to content

Document the React and JavaScript SDKs for v2 - #11

Merged
armandocodecr merged 3 commits into
feature/core-api-v2-supportfrom
feature/sdk-v2-support
Sep 11, 2026
Merged

armandocodecr merged 3 commits into
feature/core-api-v2-supportfrom
feature/sdk-v2-support

Conversation

@armandocodecr

@armandocodecr armandocodecr commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Documents both v2 SDKs. Read from the SDK sources, not from existing docs.

Stacked on #10. This branch targets feature/core-api-v2-support, because both SDK files link to the Core API v2 reference that PR introduces. Merge #10 first; this PR then retargets main cleanly.

What it adds

skills/react-sdk/v2/react-sdk.md — @trustless-work/escrow 5.x: provider setup, the build/sign/submit loop, all 12 transaction hooks with their required signer, the 7 read hooks, the new GraphQL hooks, and attribution headers.

skills/js-sdk/js-sdk.md — @trustless-work/escrow-js: client construction, the same method surface without React, error classes, runtime requirements, and a hook-to-method migration table for people coming from React.

SKILL.md routes to both, and the version markers now say the V2 Blocks surface is the only one still undocumented.

Things a developer would otherwise get wrong

  • SDK 5.x is v2-only. Every transaction method builds /escrow/{type}/v2/.... A V1 integration needs SDK 3.x. This also settles an open question from an earlier PR: that /v2 is the contract version, not an API-only version.
  • The build response is unsignedXdr, not unsignedTransaction.
  • Submission moved to /stellar/send-transaction.
  • QueryClientProvider is no longer required. SDK 5.x has no TanStack Query dependency — its only dependency is axios. Carrying the 3.x provider pattern over is a common migration error.
  • STELLAR_TX_SUBMITTED_INDEXER_LAGGING is a success. The transaction landed; only the read model is behind. Do not retry.
  • Reads go to the read model at /escrows/..., which carries no version or type segment — not to the v2 transaction routes. Both SDKs behave this way, and both files say so.
  • Read amounts are decimal strings while operate payloads take numbers.

JavaScript SDK specifics

  • Zero runtime dependencies, native fetch, Node 18+.
  • Install with the @beta dist-tag while Core v2 is beta.
  • getAccessToken may be async here; in the React SDK it is sync only.
  • mainNet and development both resolve to the beta host today. mainNet does not mean production — V2 is not deployed to mainnet, and the export name invites the wrong conclusion.
  • Errors surface as TrustlessWorkApiError or TrustlessWorkNetworkError; the Axios-specific Problem Details helper does not exist here.

Not included

The V2 Blocks surface, which is not finished. skills/js-sdk is a compressed, agent-facing reference; the JS SDK repository separately holds a 34-page GitBook set under .gitbook-migration/ that is the fuller developer documentation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: eee8aaf6-11c3-4521-b54a-cdb4234b215e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

armandocodecr and others added 2 commits September 11, 2026 11:42
The update lock is the cumulative funded amount, which never decreases,
not a zero live balance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- approveAndReleaseMilestones is multi-release only in both SDKs
  (hardcoded to the multi route, no type argument); the API does
  expose the single-release route, the SDKs just do not wrap it
- extend-ttl has no SDK method in either package; call the API route
- React package also exports mainNet/development constants that point
  at the beta backend's internal URL: warn against reading them as
  environments and prefer an explicit baseURL

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@armandocodecr
armandocodecr merged commit 6da592d into feature/core-api-v2-support Sep 11, 2026
3 of 4 checks passed
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