Repository navigation
fix(sdk): tighten percentageString validator and guard BigInt pct parsing - #275
devtechedge wants to merge 1 commit into
Conversation
|
@devtechedge is attempting to deploy a commit to the UMA Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 039a9ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Hi - light nudge on this suggested-fees parsing harden whenever review time opens up.
The PR tightens the validator regex to Diff is localized to Happy to rebase, expand fixtures, or adjust the error messaging if that helps - no pressure on timing. |
Fixes #266
Summary of Changes
percentageStringregex inpackages/sdk/src/api/validators.tsfrom/^\d+(\.\d+)?$/to/^\d+$/so percentage strings with decimal points are caught and rejected at the validation boundary rather than crashing downstream consumers.BigIntconversion: Inpackages/sdk/src/actions/getSuggestedFees.ts, wrapped pct assignments inparseSuggestedFeeswith safe parsing (toBigIntPct) so unexpected float strings will not throw an uncaughtSyntaxError: Cannot convert ... to a BigIntat runtime.@across-protocol/app-sdkpatch changeset via.changeset/fix-suggested-fees-pct-bigint.md.test/unit/api/suggested-fees.test.tsverifying decimal rejection bypercentageStringand safe conversion inparseSuggestedFees.