Skip to content

fix(api): make request identifiers exclusive - #579

Open
kriss39 wants to merge 1 commit into
lifinance:mainfrom
kriss39:fix/exclusive-api-request-identifiers
Open

fix(api): make request identifiers exclusive#579
kriss39 wants to merge 1 commit into
lifinance:mainfrom
kriss39:fix/exclusive-api-request-identifiers

Conversation

@kriss39

@kriss39 kriss39 commented Sep 12, 2026

Copy link
Copy Markdown

Which Linear task is linked to this PR?

None.

Why was it implemented this way?

ContractCallsQuoteRequest has two mutually exclusive quote modes, but its union accepted an object containing both fromAmount and toAmount. Similarly, GetStatusRequest accepted both txHash and taskId.

Adding the opposite key as ?: never makes these alternatives exclusive while preserving valid request shapes. The accompanying type-contract tests cover both valid modes and ensure the two ambiguous forms remain rejected.

Visual showcase (Screenshots or Videos)

Not applicable.

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the Types API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

Verification

  • tsc --project tests/tsconfig.json
  • CJS, ESM, and declaration builds using the package build compiler arguments
  • prettier --check src/api.ts tests/api.contract.ts

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.

1 participant