fix(api): resolve multiple documentation and type inconsistencies - #571
Open
leonschh wants to merge 1 commit into
Open
fix(api): resolve multiple documentation and type inconsistencies#571leonschh wants to merge 1 commit into
leonschh wants to merge 1 commit into
Conversation
## Summary Fixed multiple documentation and type inconsistencies in `api.ts` that affect developer experience, type safety, and code maintainability. All changes are **backward compatible** and do not affect runtime behavior. --- ## Changes ### 1. Fix misleading comment for `containsSwitchChain` (Line ~351) **Before:** `// Features required for route execution` **After:** `// Whether the route contains a chain switch during execution` **Why:** The comment had no relation to the actual boolean flag semantics. This field indicates whether the route requires switching chains (multiple signatures), not a list of features. ### 2. Fix broken `@deprecated` annotation (Line ~675) **Before:** `/* @deprecated */` **After:** ```typescript /** * @deprecated ContractCallQuoteRequest is deprecated and will be removed in future versions. */
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Linear task is linked to this PR?
This PR was written during a project review.
Why was it implemented this way?
Four independent issues fixed in one PR since all changes are in the same file (
src/api.ts):containsSwitchChain (Line ~351)Why: The comment
// Features required for route executionwas semantically incorrect - the field is a boolean flag indicating chain switches, not a feature listChosen: Updated to accurately describe the field's purpose
@deprecated annotation (Line ~591)Why: Block comments
/* */are not recognized by TypeScript/IDE tooling; only JSDoc/** */triggers deprecation warningsChosen: Converted to proper JSDoc format, consistent with other deprecated types in the file
INVALID status comment (Line ~673)Why: The comment
// A third party service is not availablecontradicts official LI.FI documentation where INVALID means "Hash is not tied to the requested tool"Chosen: Updated to match official docs
RelayStatusRequest.taskId type (Lines ~1094)Why:
RelayResponseData.taskIdreturns a string (UUID), butRelayStatusRequest.taskIdexpectedHash(0x${string}), causing type errors when passing taskId from response to status requestChosen: Changed
RelayStatusRequest.taskIdtostring- widens the type safely (Hashis subset ofstring) and enables type-safe usage withoutas HashassertionsAll changes are backward compatible and maintain the same runtime behavior.