[FEATURE]: Centralize transaction initialization and quote fetching to avoid duplicate RPC calls in the widget
@CaptainLevi2k04 is already working on this.
Since Sep 1, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react
- Domain
- blockchain, frontend
Research direction
Read stablepay-sdk/src/widget/TokenDropdown.jsx and stablepay-sdk/src/widget/TransactionReview.jsx to trace the duplicate Transaction initialization and quote fetching. Then inspect the widget context entry point to see how shared state is exposed. Done means initialization and quote fetching have a single owner and both components consume the same normalized state.
Written by the indexing model from the issue text.
Description
Feature and its Use Cases
The widget currently initializes transaction state and fetches quote-related data in more than one component.
Both TokenDropdown.jsx and TransactionReview.jsx instantiate Transaction, call init(), and in native-token flows may fetch quote data separately.
Why this matters:
- unnecessary duplicate RPC calls for the same network/token selection
- harder-to-maintain state flow
- greater risk of inconsistent quote or transaction state across components
- makes future additions like preflight validation, allowance checks, and multi-Djed support harder
Expected outcome:
- transaction initialization and quote fetching should be owned by a single layer
- components should consume normalized shared state instead of rebuilding it independently
- the widget should perform one consistent initialization flow per network/token selection
Additional Context
Current evidence from the code:
stablepay-sdk/src/widget/TokenDropdown.jsxinitializesTransactionand may fetch trade data during token selectionstablepay-sdk/src/widget/TransactionReview.jsxrepeats transaction initialization and quote fetching in its own effect
A cleaner design would move this into context and expose:
- loading state
- quote state
- normalized transaction details
- initialization errors
This would also pair well with current and future payment-flow work like stablecoin balance checks, fee configuration cleanup, and support for additional Djed variants.
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- Dominant language
- JavaScript
- Stars
- 16
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StabilityNexus/StablePay
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
StabilityNexus/StablePay#64 · 1 comment ·
-
[BUG]: Missing SDK API documentation and incomplete developer-facing usage guide in StablePay READMEOpenbug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
StabilityNexus/StablePay#104 · 1 comment ·
-
[BUG]: `stablepay-sdk` README documents an unrelated thirdweb app instead of the actual SDK APIOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
StabilityNexus/StablePay#102 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
StabilityNexus/StablePay#96 · 1 comment ·
-
Bug: Missing import causes `calculateFutureScPrice` to fail at runtimePossibly taken @Rav1Chauhan claimed this 272 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 20/100
StabilityNexus/StablePay#85 · 1 comment ·
All issues in StabilityNexus/StablePay
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 Under an hour Newbie friendliness 82/100
Leonxlnx/taste-skill#216 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
all-contributors/cli#690 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day