Skip to content

fix(sdk): tighten percentageString validator and guard BigInt pct parsing - #275

Open
devtechedge wants to merge 1 commit into
across-protocol:masterfrom
devtechedge:fix/suggested-fees-pct-bigint
Open

fix(sdk): tighten percentageString validator and guard BigInt pct parsing#275
devtechedge wants to merge 1 commit into
across-protocol:masterfrom
devtechedge:fix/suggested-fees-pct-bigint

Conversation

@devtechedge

Copy link
Copy Markdown

Fixes #266

Summary of Changes

  • Validator schema tightening: Updated percentageString regex in packages/sdk/src/api/validators.ts from /^\d+(\.\d+)?$/ to /^\d+$/ so percentage strings with decimal points are caught and rejected at the validation boundary rather than crashing downstream consumers.
  • Defensive BigInt conversion: In packages/sdk/src/actions/getSuggestedFees.ts, wrapped pct assignments in parseSuggestedFees with safe parsing (toBigIntPct) so unexpected float strings will not throw an uncaught SyntaxError: Cannot convert ... to a BigInt at runtime.
  • Changeset: Added @across-protocol/app-sdk patch changeset via .changeset/fix-suggested-fees-pct-bigint.md.
  • Unit Tests: Added test cases in test/unit/api/suggested-fees.test.ts verifying decimal rejection by percentageString and safe conversion in parseSuggestedFees.

@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

@devtechedge is attempting to deploy a commit to the UMA Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 039a9ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@across-protocol/app-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

getSuggestedFees: decimal pct fields validated with percentageString then passed to BigInt() → SyntaxError

1 participant