Skip to content

Coding-Alchemist-Abhijay/Eth-Wallet-Adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โšก Eth-Wallet-Adapter

๐Ÿช™ A modern React + Vite Ethereum wallet adapter with wallet connection, balance check, and transaction features โ€” wrapped in a stunning black-and-gold UI.


๐ŸŒŸ Overview

Eth-Wallet-Adapter is a plug-and-play Web3 starter that makes integrating wallet connection, ETH balance display, and transaction sending dead-simple โ€” powered by wagmi, viem, and React.

Built with a premium dark aesthetic (black + yellow theme), itโ€™s perfect for modern decentralized apps, dashboards, or DeFi frontends.


โœจ Features

  • ๐ŸฆŠ Connect / Disconnect Wallets via wagmi hooks
  • ๐Ÿ’ฐ Check Live ETH Balance with one click
  • ๐Ÿ’ธ Send Transactions easily using useSendTransaction
  • โšก Instant Feedback โ€” shows wallet address & TX hash
  • ๐ŸŽจ Sleek Animated UI โ€” gold hover effects, glowing cards, and motion transitions
  • ๐Ÿงฉ Modular Components โ€” reusable ConnectWallet, SendTransaction, and CheckBalance
  • ๐Ÿง  Built with Vite + React for speed and simplicity

๐Ÿงฐ Tech Stack

Technology Purpose
๐Ÿฆ„ React (Vite) Frontend Framework
๐Ÿ”— wagmi Web3 React Hooks
๐Ÿงฎ viem EVM Interaction Utility
๐ŸŽจ Custom CSS (Black + Gold) Premium UI styling
๐Ÿ’ป ES Modules / Modern JS Clean lightweight build

๐Ÿš€ Getting Started

1๏ธโƒฃ Clone the repository

git clone https://github.com/Coding-Alchemist-Abhijay/Eth-Wallet-Adapter.git
cd Eth-Wallet-Adapter

2๏ธโƒฃ Install dependencies

npm install

3๏ธโƒฃ Start the development server

npm run dev

4๏ธโƒฃ Build for production

npm run build

๐Ÿงฉ Components

๐Ÿ” ConnectWallet.jsx

Handles wallet connections using wagmi.

import { useConnect, useDisconnect, useAccount } from 'wagmi';

const ConnectWallet = () => {
  const { address, isConnected } = useAccount();
  const { connectors, connect } = useConnect();
  const { disconnect } = useDisconnect();

  return (
    <div className="connect-wallet-container">
      <h2>Connect Your Wallet</h2>
      {isConnected ? (
        <>
          <p>Connected: {address.slice(0, 6)}...{address.slice(-4)}</p>
          <button onClick={() => disconnect()}>Disconnect</button>
        </>
      ) : (
        connectors.map((connector) => (
          <button key={connector.id} onClick={() => connect({ connector })}>
            {connector.name}
          </button>
        ))
      )}
    </div>
  );
};

๐Ÿ’ธ SendTransaction.jsx

Send ETH to any address in one click.

import { useSendTransaction } from 'wagmi';
import { parseEther } from 'viem';

export function SendTransaction() {
  const { data: hash, sendTransaction } = useSendTransaction();

  async function sendTx() {
    const to = document.getElementById("to").value;
    const value = document.getElementById("value").value;
    sendTransaction({ to, value: parseEther(value) });
  }

  return (
    <div className="tx-container">
      <div className="tx-card">
        <h2 className="tx-heading">Send ETH</h2>
        <div className="tx-inputs">
          <input id="to" className="tx-input" placeholder="Recipient Address" required />
          <input id="value" className="tx-input" placeholder="Amount (ETH)" required />
        </div>
        <button className="tx-btn" onClick={sendTx}>Send Transaction</button>
        {hash && <div className="tx-hash">Hash: {hash}</div>}
      </div>
    </div>
  );
}

๐Ÿ’ฐ CheckBalance.jsx

Displays connected walletโ€™s ETH balance in real-time.

import { useBalance, useAccount } from 'wagmi';

const CheckBalance = () => {
  const { address, isConnected } = useAccount();
  const { data: balance } = useBalance({ address });

  return (
    <div className="check-balance-container">
      <div className="balance-card">
        {isConnected ? (
          <>
            <h2 className="card-title">Wallet Balance</h2>
            <p className="wallet-address">{address.slice(0, 6)}...{address.slice(-4)}</p>
            <div className="balance-display">
              <h3 className="balance-number">{balance?.formatted ?? '0.00'}</h3>
              <span className="balance-currency">ETH</span>
            </div>
          </>
        ) : (
          <p>Please connect your wallet first.</p>
        )}
      </div>
    </div>
  );
};

๐Ÿ–Œ๏ธ Styling (Theme Highlights)

  • Black + Gold Palette โ€” a rich, elegant dark theme
  • Glowing Borders โ€” yellow neon pulse around cards
  • Hover Animations โ€” subtle motion + shimmer effects
  • Smooth Typography โ€” Poppins & Courier New for contrast
  • Responsive Design โ€” optimized for all screen sizes

๐Ÿง  Folder Structure

Eth-Wallet-Adapter/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ ConnectWallet.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ SendTransaction.jsx
โ”‚   โ”‚   โ””โ”€โ”€ CheckBalance.jsx
โ”‚   โ”œโ”€โ”€ styles/
โ”‚   โ”‚   โ”œโ”€โ”€ ConnectWallet.css
โ”‚   โ”‚   โ”œโ”€โ”€ Transaction.css
โ”‚   โ”‚   โ””โ”€โ”€ CheckBalance.css
โ”‚   โ”œโ”€โ”€ App.jsx
โ”‚   โ””โ”€โ”€ main.jsx
โ”‚
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ vite.config.js

๐Ÿงช Future Enhancements

โœ… Add Token (ERC-20) Transfers
โœ… Display Network Name & Switcher
โœ… Add Transaction Status Updates
โœ… Integrate WalletConnect QR
โœ… Light Theme Toggle


๐Ÿ“œ License

This project is MIT Licensed โ€” feel free to use, modify, and share!


๐Ÿ’› Author

๐Ÿ‘จโ€๐Ÿ’ป Coding-Alchemist-Abhijay

Building beautiful Web3 tools for the modern internet.

๐Ÿ”— GitHub: Coding-Alchemist-Abhijay

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published