Skip to content

Fix BigInt serialization in SDK responses - #158

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
comzzy-comzzy:fix/bigint-response-serialization
Jul 29, 2026
Merged

Fix BigInt serialization in SDK responses#158
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
comzzy-comzzy:fix/bigint-response-serialization

Conversation

@comzzy-comzzy

Copy link
Copy Markdown
Contributor

Summary

  • Convert nested bigint values to decimal strings before grant read results leave the SDK.
  • Export the formatter for callers that need to sanitize their own payloads.
  • Update response types and cover large, nested values plus direct JSON.stringify() calls.

Testing

  • node node_modules/typescript/bin/tsc --target ES2022 --module NodeNext --moduleResolution NodeNext --strict --skipLibCheck --noEmit src/utils/formatters.ts tests/utils/formatters.test.ts
  • Manual runtime check confirmed a value above Number.MAX_SAFE_INTEGER keeps its exact decimal representation and serializes successfully.

The full test suite and project typecheck are currently blocked on main by a malformed package.json, a missing Rollup optional binary, and existing syntax errors in unrelated files.

Closes #155

@Lakes41
Lakes41 merged commit 808b1f2 into Adamantine-guild:main Jul 29, 2026
1 check passed
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.

Standardize BigInt serialization for API payload responses

2 participants