Skip to content

feat: fix memory leak, add estimateFee for all ops, add WalletConnect v2 and XDEFI adapters - #494

Merged
Chuks-coderr merged 2 commits into
SoroStream:mainfrom
Smartdevs17:feat/issues-365-366-367-368
Aug 27, 2026
Merged

Chuks-coderr merged 2 commits into
SoroStream:mainfrom
Smartdevs17:feat/issues-365-366-367-368

Conversation

@Smartdevs17

Copy link
Copy Markdown
Contributor

Summary

This PR addresses 4 open issues:

Closes #365 - Fix memory leak in stream watcher polling loop

  • Added AbortController to StreamMonitor to cancel in-flight RPC requests when stop() is called during a pending poll
  • The abort signal is checked before initiating RPC calls and between sequential fetchers, preventing resource leaks

Closes #366 - Add estimateFee method for all stream operations

Added fee estimation methods for all stream operations:

  • estimateUpdateFlowRateFee
  • estimateSetOperatorFee
  • estimateOperatorCancelStreamFee
  • estimateOperatorTopUpFee
  • estimateSplitStreamFee
  • estimateTransferStreamFee
  • estimatePauseFee
  • estimateResumeFee

Closes #367 - Add WalletConnect v2 adapter for mobile wallet support

  • Added createWalletConnectV2Adapter() function
  • Dynamically imports @walletconnect/sign-client to avoid SSR issues
  • Supports session management, signing via stellar_signXDR, and session cleanup

Closes #368 - Add XDEFI wallet adapter

  • Added createXDEFIAdapter() function
  • Connects to the XDEFI Wallet browser extension via window.xdefi.stellar or window.xfi.stellar
  • Supports isConnected, getPublicKey, and signTransaction

Changes

  • src/stream-monitor.ts: Added AbortController for in-flight request cancellation
  • src/SoroStreamClient.ts: Added 8 new fee estimation methods for all stream operations
  • src/wallet.ts: Added WalletConnect v2 and XDEFI wallet adapters
  • src/wallets.ts: Updated browser wallet barrel exports
  • src/index.ts: Updated main barrel exports

Acceptance Criteria

  • All 4 issues are fully implemented
  • No new dependencies are required (WalletConnect adapter uses dynamic import)
  • All existing exports remain unchanged
  • No breaking changes to existing APIs

… v2 and XDEFI adapters

- Fix SoroStream#365: Add AbortController to StreamMonitor to cancel in-flight RPC
  requests when stop() is called during a pending poll, preventing resource leaks
- Fix SoroStream#366: Add fee estimation methods for all stream operations
  (updateFlowRate, setOperator, operatorCancelStream, operatorTopUp,
  splitStream, transferStream, pause, resume)
- Fix SoroStream#367: Add WalletConnect v2 adapter for mobile wallet support
  via QR code or deep link using @walletconnect/sign-client
- Fix SoroStream#368: Add XDEFI wallet adapter for XDEFI browser extension users
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Smartdevs17 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

@Chuks-coderr
Chuks-coderr merged commit e38b02f into SoroStream:main Aug 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants