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

feat(ui): two-step signing process to add staking pools #128

Merged
merged 7 commits into from
May 9, 2024

Conversation

drichar
Copy link
Collaborator

@drichar drichar commented May 8, 2024

Transaction signing will fail in certain wallets if the signature request isn't triggered by a user action (e.g., a button click). This is a security measure to prevent an app from initiating transaction signatures without the user's knowledge or consent.

Adding a staking pool is a two step process:

  1. select a node and create the pool
  2. MBR payment to satisfy the pool's storage requirements

The AddPoolModal component now presents these actions on a numbered timeline with a progress bar underneath. Once the user selects a node and submits the form, the first signature request is triggered.

Upon success a green check appears next to step 1 and its content collapses, while step 2 is expanded/highlighted and the progress bar advances. A button must be clicked again to initiate the MBR payment.

Previously the MBR payment would automatically be triggered on successful pool creation. While Pera/Defly/KMD all support this, Lute Wallet does not and the second transaction request fails (leaving the pool in an invalid "limbo" state).

Other Changes

Speaking of that "limbo" state, I've also limited the ways this modal can be closed. This is to prevent someone from creating the pool and closing the modal (intentionally or accidentally) before sending the MBR payment. Now the only ways to close theAddPoolModal are:

  • clicking the X button in the top corner
  • pressing Esc
  • (Ideally) clicking the "Finish (Close)" button that appears after both transactions have been signed and sent

Finally, a proper ErrorAlert component is added here that will be used going forward vs the simple placeholder <p>Error</p> that has been used since early development.

drichar added 5 commits May 7, 2024 16:17
This also adds a reusable ErrorAlert component that should replace any placeholder content to convey error state.
This also improves the entire workflow and enhances validation to include balance checks.
@drichar drichar requested a review from pbennett as a code owner May 8, 2024 03:10
Copy link

vercel bot commented May 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
reti ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2024 4:12pm

@drichar drichar merged commit 2574152 into dev May 9, 2024
3 checks passed
@drichar drichar deleted the feat/ui-two-step-add-pool branch May 9, 2024 22:28
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.

1 participant