Skip to content

fix(api): replace AssembledTransaction<unknown> casts with concrete g… - #495

Merged
Idrhas merged 1 commit into
Fundable-Protocol:mainfrom
bashir1738:fix/assembled-transaction-type-safety
Jul 29, 2026
Merged

fix(api): replace AssembledTransaction<unknown> casts with concrete g…#495
Idrhas merged 1 commit into
Fundable-Protocol:mainfrom
bashir1738:fix/assembled-transaction-type-safety

Conversation

@bashir1738

@bashir1738 bashir1738 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

…eneric types

  • Define concrete generic interfaces for AssembledTransaction return types
  • Replace unsafe as AssembledTransaction casts in api.ts write helpers
  • Provide proper autocompletion for contract execution return types
  • Eliminate unknown escapes from client API interfaces

Closes #375

Summary by CodeRabbit

  • Bug Fixes
    • Improved transaction handling for stream creation, withdrawals, distributions, and stream controls.
    • Ensured transaction signing works consistently across supported contract actions.

…eneric types

- Define concrete generic interfaces for AssembledTransaction return types
- Replace unsafe as AssembledTransaction<unknown> casts in api.ts write helpers
- Provide proper autocompletion for contract execution return types
- Eliminate unknown escapes from client API interfaces

Closes Fundable-Protocol#375
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 984f0011-1580-4ebf-a692-9bcd16a13c89

📥 Commits

Reviewing files that changed from the base of the PR and between 10d6e55 and 981115e.

📒 Files selected for processing (1)
  • apps/web/src/lib/api.ts

📝 Walkthrough

Walkthrough

The web API makes signAndSendTx generic over assembled transaction result types and removes AssembledTransaction<unknown> casts from all affected contract-write helpers.

Changes

Typed transaction submission

Layer / File(s) Summary
Generic transaction submission and call-site updates
apps/web/src/lib/api.ts
signAndSendTx accepts typed assembled transactions, while stream creation, withdrawal, distribution, pause, resume, and cancellation helpers pass transactions directly without casts.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

  • #275: Updates the same transaction helpers by making signAndSendTx generic and removing AssembledTransaction<unknown> casts.

Suggested reviewers: idrhas

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: replacing unknown casts with concrete generic transaction typing.
Linked Issues check ✅ Passed The write helpers now use typed AssembledTransaction values, matching issue #375's acceptance criteria.
Out of Scope Changes check ✅ Passed The only changes are in api.ts and they stay focused on the typed transaction helper update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Idrhas
Idrhas merged commit ae397e3 into Fundable-Protocol:main Jul 29, 2026
1 check passed
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.

web(api): AssembledTransaction type casting bypasses TypeScript safety

2 participants