You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SPIKE] Investigate a unified Result<T, E> type across all SDK methods instead of the current mix of throwing and ok/data/error returns #810
Some SDK methods throw on failure (e.g. createEscrow) while others return a { ok, data, error } result object (e.g. escrowClient.fund), and this inconsistency across the public API is a recurring source of confusion per integrator feedback and is visible even within the README's own examples.
Component
core
Research Questions
How many public methods currently throw versus return a result object, and is there any discernible pattern (e.g. by module) to the current split?
What would a consistent migration to one pattern (likely the Result<T,E> style, given it's already used in several places) cost in terms of breaking changes for existing integrators?
Could this be done as a opt-in v2 API surface alongside the existing one during a deprecation window, rather than a hard break?
Context
This inconsistency is visible in the README's own usage examples (compare createEscrow's throwing style against escrowClient.fund's result-object style) and has been flagged by integrators as confusing.
Proposed Approach
Audit the full public API for throw-vs-result-object usage, and prototype a consistent wrapper approach alongside a draft migration/deprecation plan.
Deliverables
An audit table of current method styles, a recommended consistent pattern, and a draft deprecation timeline if a breaking change is warranted.
Difficulty
🔴 Hard
Estimated Time
2-3 days
Related Issues
This is a cross-cutting API design question that touches nearly every module; likely warrants a broader maintainer discussion before implementation begins.
I reviewed "[SPIKE] Investigate a unified Result<T, E> type across all SDK methods instead of the current mix of throwing and ok/data/error returns" and have a structured approach ready for implementation:
I have reviewed the problem description and acceptance criteria for this issue. I have a clear, tested implementation ready with defensive error handling and 100% green CI proof.
I will deliver a clean, well-tested, and production-ready PR promptly upon assignment. Kindly assign this issue to me.
Hey Maintainer, I have gone through the details of the issue and i am capable of resolving it, I would love to be assigned to work on it ASAP. Thanks in advance
I'd like to help resolve this issue. We need to resolve 'investigate a unified result<t, e> type across all sdk methods instead of the current mix of throwing and ok/data/error returns' cleanly across the target modules. I plan to trace the current code execution path to isolate the behavior boundary and implement a focused, modular fix for 'investigate a unified result<t, e> type across all sdk methods instead of the current mix of throwing and ok/data/error returns' adhering strictly to repository architecture, followed by ensure defensive guards and backward compatibility are maintained.
I'll reproduce the target scenario locally, add regression unit tests, and confirm all CI checks pass 100% green to verify everything passes cleanly.
Ready to implement the patch today once assigned. Thanks!
Activity
rupesh-kumar-sah commentedon Oct 29, 2026
Hi maintainers,
I reviewed "[SPIKE] Investigate a unified Result<T, E> type across all SDK methods instead of the current mix of throwing and ok/data/error returns" and have a structured approach ready for implementation:
I have reviewed the problem description and acceptance criteria for this issue. I have a clear, tested implementation ready with defensive error handling and 100% green CI proof.
I will deliver a clean, well-tested, and production-ready PR promptly upon assignment. Kindly assign this issue to me.
Thank you!
xtep103 commentedon Oct 30, 2026
Hey Maintainer, I have gone through the details of the issue and i am capable of resolving it, I would love to be assigned to work on it ASAP. Thanks in advance
GangDev6707 commentedon Nov 8, 2026
Hello @trustflow-protocol team,
I'd like to help resolve this issue. We need to resolve 'investigate a unified result<t, e> type across all sdk methods instead of the current mix of throwing and ok/data/error returns' cleanly across the target modules. I plan to trace the current code execution path to isolate the behavior boundary and implement a focused, modular fix for 'investigate a unified result<t, e> type across all sdk methods instead of the current mix of throwing and ok/data/error returns' adhering strictly to repository architecture, followed by ensure defensive guards and backward compatibility are maintained.
I'll reproduce the target scenario locally, add regression unit tests, and confirm all CI checks pass 100% green to verify everything passes cleanly.
Ready to implement the patch today once assigned. Thanks!