Add missing subpath exports, delete dead horizon.ts, and add the RPC/hook regression tests (#100, #104, #107, #110) - #201
Merged
meshackyaro merged 11 commits intoAug 31, 2026
Conversation
The README Quick Start imports from `@trustflow/sdk/escrow`, `/wallet`, and `/utils`, but only `src/index.ts` and `src/hooks/index.ts` were built. Add the three barrels as their own build targets. Refs trustflow-protocol#100
…rts map
Node package-exports resolution makes any subpath not listed unresolvable,
so `import { createEscrow } from '@trustflow/sdk/escrow'` failed with
`ERR_PACKAGE_PATH_NOT_EXPORTED` for consumers of the published package.
Each subpath gets matching `types` / `import` / `require` conditions.
Closes trustflow-protocol#100
…xports map Static check: extracts every `@trustflow/sdk/*` specifier from README.md, asserts each is an `exports` key, that every condition points at a dist path, and that each non-root subpath is a tsup entry. Refs trustflow-protocol#100
…izon.ts `src/stellar/horizon.ts` exported a second `submitTransaction(client, xdr)` that nothing imports — not on the `src/stellar` barrel, no call sites. The used implementation is `(xdr, horizonUrl)` in `src/stellar/transaction.ts` (called by `MultiSigEscrowClient.submitWhenReady`). Remove the orphan so a future contributor can't extend the wrong one. Closes trustflow-protocol#110
Fails if a second `export async function submitTransaction` reappears anywhere in `src/stellar`, or if `horizon.ts` comes back. Refs trustflow-protocol#110
`src/contract/{invoke,read,simulate}.ts` use `rpc` (not the `SorobanRpc`
that does not exist in `@stellar/stellar-sdk@15`). This constructs
`rpc.Server` via `src/contract/index.ts` and asserts the old name stays
gone, so a future SDK bump breaking the import is caught at once.
Closes trustflow-protocol#104
…note `useEscrow` imports `createEscrow` / `releaseEscrow` from '../escrow' — both are re-exported there (from `create.ts` / `release.ts`), both take a `client: TrustFlowClient`, and both go through `invokeContract`, so the hook type-checks. The comment claiming the imports do not exist is now wrong. It ships from the `@trustflow/sdk/react` subpath, like the other hooks. Refs trustflow-protocol#107
React is stubbed (cell-array `useState`, identity `useCallback`) so the hook runs under Jest node. Covers: create resolves and stores the escrow, create rejects and surfaces the message, and the same for release. Closes trustflow-protocol#107
|
@Jaydbrown Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
6 tasks
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.
Four SDK issues — a packaging bug, two type-check bugs (already fixed on
mainby #148, so this adds the regression tests their acceptance criteria require), and a dead-code removal.#100 — missing
./escrowsubpath export (packaging bug)The README Quick Start does
import { createEscrow } from '@trustflow/sdk/escrow'(and/wallet,/utils), butpackage.json'sexportsonly declared.and./react, so those imports fail withERR_PACKAGE_PATH_NOT_EXPORTEDfor anyone installing the published package.tsup.config.tsbuildssrc/escrow/index.ts,src/wallet/index.ts,src/utils/index.tsas their own targets →dist/escrow/index.*etc.package.jsonexportsgains./escrow,./wallet,./utilswith matchingtypes/import/require.tests/exports-resolution.test.ts— a CI step (per the AC) that pulls every@trustflow/sdk/*specifier out ofREADME.mdand asserts each resolves against theexportsmap, every condition points at a./dist/…path, and each non-root subpath is a tsup entry.#104 —
SorobanRpcimport (already fixed onmain, test added)src/contract/{invoke,read,simulate}.tsalready importrpc(not the nonexistentSorobanRpc) and usenew rpc.Server(...). What was missing is the AC's "regression test would fail if this import broke again":tests/contract-rpc-smoke.test.tsconstructsrpc.Serverthroughsrc/contract/index.ts's dependency graph and asserts the oldSorobanRpcname stays gone.#107 —
useEscrowimport ofcreateEscrow/releaseEscrowsrc/escrow/index.tsnow re-exports both free functions (fromcreate.ts/release.ts), and both takeclient: TrustFlowClientand go throughinvokeContract— souseEscrowtype-checks against the real API, not a phantom one. This PR:useEscrowfromsrc/hooks/index.ts(it still ships only from the@trustflow/sdk/reactsubpath, per Export React hooks from package entrypoint and declare react as a peerDependency #81) and replaces the now-inaccurate "these imports don't exist" comment;tests/use-escrow.test.ts— React stubbed for Jest node, covering create/release success (resolves, stores, clears error) and failure (surfaces message, rethrows).#110 — dead duplicate
submitTransactionsrc/stellar/horizon.tsexported a secondsubmitTransaction(client, xdr)that nothing imports (not on thesrc/stellarbarrel, no call sites —MultiSigEscrowClient.submitWhenReadyuses the(xdr, horizonUrl)version insrc/stellar/transaction.ts). Deleted.tests/stellar-single-submit.test.tsfails if a second implementation reappears orhorizon.tscomes back.Not built or run in this environment.
srcchanges are limited totsup.config.ts,package.json,src/hooks/index.ts, and deletingsrc/stellar/horizon.ts; the rest are new test files and docs. CHANGELOG[Unreleased]updated (no version bump, sotests/version.test.tsis unaffected).Closes #100, closes #104, closes #107, closes #110