Skip to content

refactor: streamline Stellar announcement fetching and add sdk-react …#99

Merged
truthixify merged 2 commits into
wraith-protocol:developfrom
emarkees:feature/companion-hooks-package
Jun 26, 2026
Merged

refactor: streamline Stellar announcement fetching and add sdk-react …#99
truthixify merged 2 commits into
wraith-protocol:developfrom
emarkees:feature/companion-hooks-package

Conversation

@emarkees

@emarkees emarkees commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Closes #53


🚀 Description
This PR introduces the new @wraith-protocol/sdk-react companion hooks package, providing standardized React 18+ integrations to prevent integrators from writing repetitive useState/useEffect glue. It also includes fixes for underlying SDK bugs discovered during integration, and ships with a working example application.

📦 Features & Scope

New Workspace Package:

  • Scaffolded packages/sdk-react and added it to pnpm-workspace.yaml.

Core Hooks Implemented:

  • useStellarStealthKeys
  • useStellarAnnouncementScan
  • useStellarSendStealthPayment
  • useStellarName
  • useStellarBalance
  • React 18 Strict Mode: Added safe cleanup handling in useEffects to prevent race conditions and memory leaks during double-mounting.
    Testing & Build Pipeline: Fully configured vitest with jsdom testing environments.

@emarkees

Copy link
Copy Markdown
Contributor Author

Close #53

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@emarkees 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! 🚀

Learn more about application limits

@truthixify

Copy link
Copy Markdown
Contributor

The actual issue #53 work would be Stellar announcement streamlining + sdk-react. But this PR contains the exact same agent-generated cruft files we've been clearing out of #95 and #97:

  • BENCHMARK_IMPLEMENTATION.md
  • CONTEXT_BENCHMARKS_COMPLETE.md
  • bench/README.md, bench/baseline.md
  • docs/fee-estimation.md
  • examples/react-native-stellar/*
  • .github/workflows/benchmark.yml
git rm BENCHMARK_IMPLEMENTATION.md CONTEXT_BENCHMARKS_COMPLETE.md
git rm -r bench/ examples/react-native-stellar/
git rm docs/fee-estimation.md
git rm .github/workflows/benchmark.yml
git commit --amend --no-edit
git push --force-with-lease

Once those are gone, the actual streamlining + sdk-react work can land.

@emarkees emarkees force-pushed the feature/companion-hooks-package branch from c025f9f to 6c64b06 Compare June 26, 2026 09:05
@emarkees emarkees force-pushed the feature/companion-hooks-package branch from 6c64b06 to 3270b0d Compare June 26, 2026 09:22
@truthixify

Copy link
Copy Markdown
Contributor

Hey @emarkees — quick correction on my prior feedback. Since #97 landed, develop now has the examples/react-native-stellar/ directory intentionally (it's a working example). My earlier "delete those" advice was wrong in retrospect.

Updated cleanup:

git fetch origin
git rebase origin/develop
# in examples/react-native-stellar/*: take develop's version (don't delete)
# Still drop these (they ARE leftover agent cruft):
git rm BENCHMARK_IMPLEMENTATION.md CONTEXT_BENCHMARKS_COMPLETE.md
git rm -r bench/
git rm docs/fee-estimation.md
git rm .github/workflows/benchmark.yml
git rm src/chains/stellar/fee-estimation.ts test/chains/stellar/fee-estimation.test.ts test/chains/stellar/bench/stellar.bench.ts
# For src/chains/stellar/announcements.ts and src/chains/stellar/index.ts:
#   keep develop's version (it has the audit fixes from #93) and re-apply your refactor on top
git rebase --continue
git push --force-with-lease

Sorry for the back-and-forth.

@emarkees emarkees force-pushed the feature/companion-hooks-package branch from 3270b0d to d749faf Compare June 26, 2026 14:20

@emarkees emarkees left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@truthixify kindly check for a review, Correction has been made on request

@emarkees emarkees force-pushed the feature/companion-hooks-package branch from 2d8e940 to 4afefea Compare June 26, 2026 14:33
Mathew2k-hash and others added 2 commits June 26, 2026 15:41
Atomic transaction that swaps fromAsset → toAsset via pathPaymentStrictReceive
and delivers the output to a one-time stealth address, with an on-chain
announcement in the same envelope.

- Native XLM toAsset: 2 ops (pathPayment directly to stealth + announce)
- Non-native toAsset: 3 ops (pathPayment to sender + claimableBalance + announce)
- sendMax provides configurable slippage protection
- Exports: buildStellarSwapAndStealth, BuildStellarSwapAndStealthOptions, SwapAndStealthResult
- Unit tests (7) and integration tests (3, INTEGRATION=1 gated)
- Docs: docs/guides/stellar-swap-and-stealth.mdx
@emarkees emarkees force-pushed the feature/companion-hooks-package branch from 4afefea to 836a5c9 Compare June 26, 2026 14:44
@emarkees

Copy link
Copy Markdown
Contributor Author

@truthixify you can now merge as conflicts has been resolved

@truthixify

Copy link
Copy Markdown
Contributor

Cruft cleaned, rebased. The actual work — sdk-react package + hooks + react-stellar-app example — looks good. Thanks for sticking with the cleanup, @emarkees.

@truthixify truthixify merged commit a64318e into wraith-protocol:develop Jun 26, 2026
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.

@wraith-protocol/sdk-react companion hooks package

3 participants