Skip to content

feat: integrate staking on pool#80

Merged
Akshola00 merged 10 commits intoWeb3Novalabs:mainfrom
zintarh:stake_pool
Jul 31, 2025
Merged

feat: integrate staking on pool#80
Akshola00 merged 10 commits intoWeb3Novalabs:mainfrom
zintarh:stake_pool

Conversation

@zintarh
Copy link
Contributor

@zintarh zintarh commented Jul 30, 2025

closes #47

PR: Integrate Staking on Pools + Wallet Balance Hook & Input Validations

https://www.loom.com/share/b78d1b05ba6342589ee2d64e0e84f407?sid=6d52ccea-8e4f-4908-a8e2-33792ee9b184

Overview

This PR implements staking functionality on the Pools screen, enabling users to stake tokens directly via smart contract interaction. It also introduces a reusable wallet balance hook and input-level validations for a smooth and safe staking experience.


✅ What’s Included

1. UI Design & Implementation

  • Designed and implemented the staking interface on the Pools screen.
  • Includes a responsive input field for staking amount and action buttons.

2. Smart Contract Integration

  • Integrated the staking functionality with the relevant smart contract.
  • Handles contract calls using the connected wallet’s address.

3. Hooks

  • useWalletBalance Hook: Created a reusable hook to fetch and return the current balance of the connected wallet.

4. Input Validations

  • Ensures users cannot stake more than their wallet balance.
  • Prevents staking below the minimum required amount.
  • Displays real-time error messages for invalid or insufficient input values.
  • Protects contract interaction by validating before any on-chain call.

Notes for Reviewers

  • Make sure your wallet is connected when testing.
  • The balance hook depends on the correct token contract; confirm config if issues arise.
  • For now, error handling is displayed inline with the input. Can be improved with toasts or modals in a future update.

@martinvibes
Copy link
Contributor

lgtm

Copy link
Contributor

@Yunusabdul38 Yunusabdul38 left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks for your contribution on Predifi

Copy link
Contributor

@Akshola00 Akshola00 left a comment

Choose a reason for hiding this comment

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

lgtm thanks for your contribution

@Akshola00 Akshola00 merged commit 59bbf02 into Web3Novalabs:main Jul 31, 2025
1 check passed
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.

[Frontend] Integrate Staking on Pools (stake)

4 participants