Context & Impact
The current API layer in src/lib/api.ts contains mock/placeholder implementations instead of real Soroban contract invocations. Every contract call — stream creation, withdrawal, distribution — returns fabricated data rather than interacting with the deployed smart contracts. This means the entire app is non-functional against a live or testnet blockchain.
Why this matters: This is the single biggest blocker to production readiness. Without real contract calls, the platform cannot process any actual payments, streams, or distributions. Users interacting with the app are getting fake responses, and no on-chain transactions are occurring.
Scope
- Replace all mock implementations in
src/lib/api.ts with real Soroban RPC calls using the SDK (@fundable/sdk)
- Wire up
PaymentStreamClient for stream creation, withdrawal, pause, resume, and cancel operations
- Wire up
DistributorClient for equal and weighted token distribution
- Ensure all contract calls go through proper transaction signing via
StellarWalletProvider
- Remove all hardcoded/mock response data
- Handle Soroban simulation before submitting transactions
Implementation Guidelines
- Use the existing SDK clients in
packages/sdk/src/ — PaymentStreamClient.ts and DistributorClient.ts
- All contract invocations must be simulated before submission (
simulateTransaction)
- Transaction signing must use the wallet kit from
StellarWalletProvider
- Maintain the same function signatures so hooks (
use-create-stream.ts, use-streams.ts, etc.) continue to work
- Use the existing error classes in
services/errors.ts to wrap contract errors meaningfully
- Test against Stellar Testnet with deployed contract IDs from environment variables
Acceptance Criteria
Getting Started
- Read the existing mock layer:
src/lib/api.ts
- Study the SDK clients:
packages/sdk/src/PaymentStreamClient.ts and DistributorClient.ts
- Review how the wallet provider exposes signing:
src/providers/StellarWalletProvider.tsx
- Review the generated contract bindings:
packages/sdk/src/generated/
- Replace each mock function with real SDK calls, starting with
createStream
- Test each operation on Stellar Testnet using Freighter wallet
- Verify error handling by simulating failures (wrong address, insufficient funds, etc.)
PR Submission Guide
This section applies to every PR for this issue. Follow it exactly.
Before You Start
While Working
Before Submitting the PR
PR Requirements
PRs without a screen recording or without a linked issue will not be reviewed.
Context & Impact
The current API layer in
src/lib/api.tscontains mock/placeholder implementations instead of real Soroban contract invocations. Every contract call — stream creation, withdrawal, distribution — returns fabricated data rather than interacting with the deployed smart contracts. This means the entire app is non-functional against a live or testnet blockchain.Why this matters: This is the single biggest blocker to production readiness. Without real contract calls, the platform cannot process any actual payments, streams, or distributions. Users interacting with the app are getting fake responses, and no on-chain transactions are occurring.
Scope
src/lib/api.tswith real Soroban RPC calls using the SDK (@fundable/sdk)PaymentStreamClientfor stream creation, withdrawal, pause, resume, and cancel operationsDistributorClientfor equal and weighted token distributionStellarWalletProviderImplementation Guidelines
packages/sdk/src/—PaymentStreamClient.tsandDistributorClient.tssimulateTransaction)StellarWalletProvideruse-create-stream.ts,use-streams.ts, etc.) continue to workservices/errors.tsto wrap contract errors meaningfullyAcceptance Criteria
src/lib/api.tsare replaced with real Soroban contract callscreateStream()submits a real transaction and returns the on-chain stream IDgetStreams()fetches actual stream data from the payment-stream contractwithdraw(),pause(),resume(),cancel()invoke the correct contract methodsdistribute()calls the distributor contract for both equal and weighted distributionsGetting Started
src/lib/api.tspackages/sdk/src/PaymentStreamClient.tsandDistributorClient.tssrc/providers/StellarWalletProvider.tsxpackages/sdk/src/generated/createStreamPR Submission Guide
Before You Start
mainbranch:git checkout main && git pull origin mainmain:git checkout -b feat/<issue-number>-replace-mock-apiWhile Working
feat(scope): description,fix(scope): descriptiongit pull origin main --rebaseregularlyBefore Submitting the PR
mainand rebase:git checkout main && git pull origin main && git checkout <your-branch> && git rebase mainpnpm buildpnpm lintPR Requirements
Closes #<issue-number>PRs without a screen recording or without a linked issue will not be reviewed.