flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Frontend] Replace `any` at the stellar-sdk boundary

Open blurbeast opened this issue 1 week ago • 4 comments

Overview & Background

Every contract call in the frontend is built through any-typed SDK handles: soroban.ts:233-240 (args: any[], const sdk: any = await import("@stellar/stellar-sdk"), const rpc: any = ...), the same pattern at soroban.ts:168-172 and soroban.ts:98-99, and an identical block in amount.ts:295-299 (each with eslint-disable-next-line @typescript-eslint/no-explicit-any). A wrong ScVal, misspelled method, or RPC API change compiles cleanly and fails only at runtime on-chain. The untyped dynamic-import block is duplicated four times.


Technical Specification & Architecture

  1. Add a typed wrapper module for the dynamic import (the import returns real types).
  2. Type args as xdr.ScVal[].
  3. Narrow simResult with a proper interface instead of any.

Target Files

  • frontend/src/lib/soroban.ts
  • frontend/src/utils/amount.ts

Acceptance Criteria

  • [ ] No any at the stellar-sdk call boundary.
  • [ ] The dynamic-import block exists once, typed.
  • [ ] The eslint-disable comments are removed.

blurbeast avatar Nov 18 '26 19:11 blurbeast

@danvenger has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

Hi team! I'm ready to take on this task. My background fits this issue well, and I can deliver a clean, tested PR within the expected timeframe. Please assign me so I can get started.

ℹ️ Repo Maintainers: To accept this application, review their application or assign @danvenger to this issue.

danvenger avatar Nov 20 '26 22:11 danvenger

@abercrombie04 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

i can solve

ℹ️ Repo Maintainers: To accept this application, review their application or assign @abercrombie04 to this issue.

abercrombie04 avatar Nov 21 '26 07:11 abercrombie04

Congratulations, @abercrombie04! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.

🧑‍💻 @abercrombie04: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Nov 21 '26 07:11 drips-wave[bot]

This issue has been completed by @abercrombie04 as part of the Stellar Wave Program's 11th Wave 🥳

😎 @abercrombie04: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

drips-wave[bot] avatar Nov 21 '26 17:11 drips-wave[bot]