Skip to content

fix: widen fetchAccountNonce key param to number | bigint - #224

Merged
Sednaoui merged 1 commit into
devfrom
fix/widen_fetchAccountNonce_param_type
Jul 24, 2026
Merged

fix: widen fetchAccountNonce key param to number | bigint#224
Sednaoui merged 1 commit into
devfrom
fix/widen_fetchAccountNonce_param_type

Conversation

@sherifahmed990

@sherifahmed990 sherifahmed990 commented Jul 24, 2026

Copy link
Copy Markdown
Member

The nonce key is a uint192, which a JS number cannot represent beyond 2^53-1 (e.g. keccak-derived parallel-lane keys). The implementation already coerces via BigInt(key); this aligns the declared type with it. number stays accepted for backward compatibility.

Summary by CodeRabbit

  • New Features
    • Account nonce retrieval now supports nonce keys provided as either numbers or bigints.
    • Enables reliable use of parallel nonce channels beyond JavaScript’s safe integer range.

The nonce key is a uint192, which a JS number cannot represent beyond
2^53-1 (e.g. keccak-derived parallel-lane keys). The implementation
already coerces via BigInt(key); this aligns the declared type with it.
number stays accepted for backward compatibility.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a28abe7f-1109-4ce9-9121-a7f2846206f4

📥 Commits

Reviewing files that changed from the base of the PR and between e76c8e6 and cc91632.

📒 Files selected for processing (1)
  • src/utils.ts

📝 Walkthrough

Walkthrough

fetchAccountNonce now accepts nonce keys as either number or bigint, documents support for large parallel nonce channels, and continues converting the key to BigInt for the RPC call.

Changes

Nonce Key Support

Layer / File(s) Summary
Widen fetchAccountNonce nonce key
src/utils.ts
The nonce key parameter accepts number or bigint, defaults to 0, and documents bigint support for values beyond JavaScript’s safe integer range.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

I’m a rabbit hopping light,
BigInt keys now fit just right.
Nonce channels stretch and grow,
RPC gets the value it should know.
Tidy types, a joyful byte!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, but it is missing the required Summary, Test, and Risk / Compatibility sections. Add the three required sections and include a brief test note plus any compatibility or migration impact.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately states the main change to widen fetchAccountNonce's key type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@Sednaoui
Sednaoui merged commit 36a9094 into dev Jul 24, 2026
3 checks passed
@Sednaoui
Sednaoui deleted the fix/widen_fetchAccountNonce_param_type branch July 24, 2026 09:48
@Sednaoui Sednaoui mentioned this pull request Jul 27, 2026
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.

2 participants