Skip to content
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

fix(wallet-utilities): fix balance display issue and ensure accurate … #1345

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

Pawar7349
Copy link
Contributor

Summary

This PR addresses the balance display issue in the SendNear component, ensuring that the available balance is accurately calculated and displayed. Additionally, it resolves an ESLint issue related to the prefer-const rule.

Changes

  • Balance Calculation: Updated the balance calculation logic to use Math.max(balance - requiredGas, 0) to prevent displaying negative values.
  • Formatting: Improved the formatting of the balance using toFixed(5) to ensure consistency in decimal places.
  • Code Quality: Changed let to const in the SendNear component to adhere to the ESLint prefer-const rule and improve code quality.

Testing

  • Local Testing: Verified that the balance is displayed correctly before and after transactions.
  • Linting: Ensured that there are no ESLint warnings or errors.
  • TypeScript Check: Confirmed that all TypeScript checks pass without issues.

Related Issues

Fixes #1343 (Issue tracking the balance display bug)

Copy link

vercel bot commented Nov 19, 2024

@Pawar7349 is attempting to deploy a commit to the Near Developer Console Team on Vercel.

A member of the Team first needs to authorize it.

@gagdiez gagdiez merged commit fd49528 into near:develop Nov 21, 2024
0 of 2 checks passed
@flmel
Copy link
Member

flmel commented Nov 21, 2024

@race-of-sloths score 1

@race-of-sloths
Copy link

@flmel Thank you for calling!

@Pawar7349 Thank you for the contribution! Join Race of Sloths by simply mentioning me in your comment/PRs description and start collecting Sloth Points through contributions to open source projects.

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths and receive a reward
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Shipped 🚀
Development

Successfully merging this pull request may close these issues.

Fix formatting on wallet utilities
4 participants