Skip to content

fix(sdk): validate numeric and bigint round IDs consistently #256

Description

@karagozemin

Problem

normalizeRoundId validates decimal strings as positive, but returns bigint values without validation and accepts zero, negative, or unsafe numeric values through other branches.

Task

Apply the same positive-integer contract to string, number, and bigint inputs. Reject unsafe JavaScript integers before conversion and add focused tests.

Acceptance criteria

  • Zero and negative number or bigint inputs are rejected.
  • Unsafe, fractional, and non-finite numbers are rejected.
  • Existing valid inputs remain unchanged.
  • SDK tests and typecheck pass.

Suggested implementation prompt

Make SDK round ID normalization enforce one positive safe-integer contract across string, number, and bigint inputs, add boundary tests, and keep the diff limited to the helper and tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions