Skip to content

Fix nonce issues in 'near-js/client' #1594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AlexKushnir1
Copy link
Contributor

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this changes code in a published package: I have run pnpm changeset to create a changeset JSON document appropriate for this change.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Description

Improve error handling when JSON.stringify() fails on BigInt values, now 'BigInt' is safely converted to 'string' before serialization to prevent runtime errors.

Verify nonce and autoincrement it if tx was included. If nonce is not provided fetch the current one from the chain.

Related issues/PRs

Close #1592

AlexKushnir1 added 2 commits June 26, 2025 17:27
JSON.stringify cannot serialize a BigInt so cast it to safe String
Fetch nonce, if execution is NONE keep it, else increment since nonce is consumed
Copy link

changeset-bot bot commented Jul 2, 2025

⚠️ No Changeset found

Latest commit: cb65ae3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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
Status: NEW❗
Development

Successfully merging this pull request may close these issues.

Nonce related problems on the near-js/client package
1 participant