Skip to content

feat: build full Soroban contract client service layer #14

Description

@ijeoma270

Right now every on-chain button in the app is faked. Create stream does a setTimeout, withdraw and cancel just show toasts. We need to actually talk to the contracts.

Instead of wiring each button individually, let's build a proper contract service layer first. One place that handles the full lifecycle — build the transaction XDR, simulate it to catch errors before the user even sees Freighter, sign it, submit, and poll for confirmation.

This should cover all the contract functions we have: stream (create, withdraw, cancel, balance_of, get_stream), vesting (create, claim, revoke, vested_of, get_schedule), and distributor (distribute, distribute_custom).

Needs @stellar/stellar-sdk added as a dep. The service should be network-aware (testnet/mainnet from env config) and throw typed errors matching the contract's error codes (NotFound, Unauthorized, AlreadyCancelled etc) so the UI can show meaningful messages.

Done when:

  • All contract functions callable through one service
  • Simulation runs before Freighter pops up
  • Contract errors get parsed into typed exceptions
  • Works on testnet and mainnet
  • Has unit tests for tx building and error parsing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions