An interface for interacting with the staking precompile on the Bittensor network
- Node.js 18+ and npm
- MetaMask or compatible Web3 wallet
- Access to an EVM-compatible blockchain
- Clone the repository and install dependencies:
npm install
- Start the development server:
npm run dev
- Open http://localhost:5173 in your browser
- Connect Wallet: Click "Connect Wallet" to connect your MetaMask wallet
- Set Contract Address: Enter your staking contract address in the configuration panel
- Start Interacting: Use the tabs to view stakes, remove stakes, or transfer stakes
The frontend interacts with these contract functions:
getStake(hotkey, coldkey, netuid)
- Returns the stake amount for given parameters
removeStake(hotkey, amount, netuid)
- Remove a specific amount of stakeremoveStakeFull(hotkey, netuid)
- Remove all stake for a hotkey/netuid pairtransferStake(destinationColdkey, hotkey, originNetuid, destinationNetuid, amount)
- Transfer stake between coldkeys
- Navigate to the "View Stake" tab
- Enter the hotkey address/identifier
- Enter the coldkey address/identifier
- Enter the network UID
- Click "Get Stake" to view the staked amount
- Navigate to the "Remove Stake" tab
- Enter the hotkey and network UID
- For partial removal: Enter the amount and click "Remove Partial"
- For full removal: Click "Remove Full" to remove all staked tokens
- Navigate to the "Transfer Stake" tab
- Enter the destination coldkey address
- Enter the hotkey address
- Specify origin and destination network UIDs
- Enter the amount to transfer
- Click "Transfer Stake"
src/
├── components/ # React components
│ ├── WalletConnect.tsx # Wallet connection interface
│ ├── StakeViewer.tsx # Stake viewing component
│ ├── RemoveStake.tsx # Stake removal interface
│ ├── TransferStake.tsx # Stake transfer interface
│ └── ContractConfig.tsx # Contract configuration
├── contracts/ # Smart contract interfaces
│ └── abi.ts # Contract ABI definition
├── services/ # Business logic
│ └── stakingService.ts # Web3 interaction service
├── types/ # TypeScript type definitions
│ └── index.ts # Shared interfaces and utilities
└── App.tsx # Main application component