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: toast for You do not have enough tokens to pay the transaction fee #1116

Merged
merged 12 commits into from
Jan 12, 2024

Conversation

gluneau
Copy link
Contributor

@gluneau gluneau commented Jan 9, 2024

Pull Request Summary

  • We now check to see if your account balance is less than 0.05 token.
  • If it is, it will display an error saying You do not have enough tokens to pay the transaction fee
  • And it will not proceed with the transaction.
  • Both for EVM and native transactions

Check list

  • contains breaking changes
  • adds new feature
  • modifies existing feature (bug fix or improvements)
  • relies on other tasks
  • documentation changes
  • tested on mobile devices

Copy link

github-actions bot commented Jan 9, 2024

Visit the preview URL for this PR (updated for commit fa0b636):

https://astar-apps--pr1116-fix-toasts-cwl2oc65.web.app

(expires Fri, 19 Jan 2024 14:20:48 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: dd76fe72958fe2910fef9d53f0b4539b82b849db

@gluneau gluneau changed the title Minimum balance on the network is 0.01 Minimum balance on the network is 0.05 Jan 9, 2024
@gluneau gluneau changed the title Minimum balance on the network is 0.05 fix: Minimum balance on the network is 0.05 Jan 9, 2024
@gluneau gluneau marked this pull request as ready for review January 9, 2024 15:06
@gluneau gluneau changed the title fix: Minimum balance on the network is 0.05 fix: toast for You do not have enough tokens to pay the transaction fee Jan 9, 2024
@bobo-k2
Copy link
Contributor

bobo-k2 commented Jan 9, 2024

Greg, please fill in the PR summary and checklist

@Kahonnohak
Copy link
Contributor

Kahonnohak commented Jan 9, 2024

Thank you!

Hmmm,

local transfer I still have

https://gyazo.com/cc5416a2a4feb2f79e11a34f16a8d515

claim, I did get the toast but I had more than 0.05. or maybe this is already calculated how many eras I need to claim and how much I would need?

Screenshot 2024-01-10 at 00 26 30

Can we have the same messages of lacking the balance to pay the fee?

Copy link
Contributor

@bobo-k2 bobo-k2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we are checking if user balance is greater than 0.05. I believe the main reason is because we want user to have some tokens in the future to be able to pay transaction fees.
What we are not checking here is how much tokens will remain in the user wallet after transaction (e.g. balance transfer).

src/modules/toast/index.ts Show resolved Hide resolved
src/v2/services/implementations/PolkadotWalletService.ts Outdated Show resolved Hide resolved
Copy link
Member

@impelcrypto impelcrypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gluneau gluneau merged commit c9e4b30 into main Jan 12, 2024
6 of 7 checks passed
@gluneau gluneau deleted the fix/toasts branch January 12, 2024 16:29
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.

4 participants