Skip to content

Multicoyn/multicoyn-quick-start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Multicoyn Quick Start - NFT Marketplace

React TypeScript Vite Tailwind CSS wagmi

A modern NFT Marketplace demo application showcasing the usage of multicoyn-sdk - a Web3 payment SDK for multichain crypto payments.

✨ Features

  • 🎨 Modern UI/UX - Beautiful responsive design with dark/light theme support
  • πŸ”— Web3 Integration - Seamless wallet connection via RainbowKit
  • πŸ›’ NFT Marketplace - Browse, view details, and purchase NFTs
  • πŸ’³ Multi-Payment Options - Pay with Metamask or Multicoyn SDK
  • πŸ”„ Real-time Data - Live blockchain data fetching with wagmi hooks
  • πŸ“± Responsive Design - Works perfectly on desktop and mobile devices
  • ⚑ Fast Development - Powered by Vite for instant HMR

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm, yarn, or pnpm
  • MetaMask or any Web3 wallet

Installation

  1. Clone the repository

    git clone https://github.com/nicholaspai/multicoyn-quick-start.git
    cd multicoyn-quick-start
  2. Install dependencies

    npm install
    # or
    yarn install
    # or
    pnpm install
  3. Configure WalletConnect Project ID

    Get your project ID from WalletConnect Cloud and update src/wagmi.ts:

    export const config = getDefaultConfig({
      appName: "Multicoyn NFT Marketplace",
      projectId: "YOUR_PROJECT_ID", // Replace with your project ID
      chains: [liskSepolia],
      ssr: false,
    });
  4. Start the development server

    npm run dev
  5. Open your browser

    Navigate to http://localhost:5173

πŸ“¦ Project Structure

multicoyn-quick-start/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/              # Static assets (images, icons)
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ icons/           # SVG icon components
β”‚   β”‚   β”œβ”€β”€ CategoryTabs.tsx
β”‚   β”‚   β”œβ”€β”€ CustomConnectButton.tsx
β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”œβ”€β”€ NFTCard.tsx
β”‚   β”‚   β”œβ”€β”€ NFTDetailSidebar.tsx
β”‚   β”‚   β”œβ”€β”€ SearchBar.tsx
β”‚   β”‚   └── Sidebar.tsx
β”‚   β”œβ”€β”€ context/             # React context providers
β”‚   β”‚   └── ThemeContext.tsx
β”‚   β”œβ”€β”€ contracts/           # Smart contract configs & ABIs
β”‚   β”‚   β”œβ”€β”€ abis.ts
β”‚   β”‚   └── config.ts
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useERC20.ts
β”‚   β”‚   β”œβ”€β”€ useMarketplace.ts
β”‚   β”‚   └── useNFT.ts
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   β”‚   β”œβ”€β”€ format.ts
β”‚   β”‚   └── metadata.ts
β”‚   β”œβ”€β”€ App.tsx              # Main application component
β”‚   β”œβ”€β”€ main.tsx             # Application entry point
β”‚   β”œβ”€β”€ wagmi.ts             # Wagmi configuration
β”‚   └── index.css            # Global styles
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.ts
└── tsconfig.json

πŸ”§ Configuration

Smart Contracts (Lisk Sepolia)

The marketplace is deployed on Lisk Sepolia testnet:

Contract Address
Marketplace 0x6381858ddC6bBcb758C23608636f53f1C577E4e2
Mock NFT 0xd5B14514255B6a6B23930A9D779414D59aA4D64b
USDT 0x5734cD44e4DEe7Ec47a00d89a432d9a545a093fC
IDRX 0xEF226b25263F1688cD370b558f6e3B89975F097E

Network Configuration

// Lisk Sepolia Testnet
{
  id: 4202,
  name: "Lisk Sepolia",
  rpcUrls: ["https://rpc.sepolia-api.lisk.com"],
  blockExplorer: "https://sepolia-blockscout.lisk.com"
}

πŸ› οΈ Tech Stack

πŸ“– Usage Examples

Connecting Wallet

The app uses RainbowKit for seamless wallet connection:

import { CustomConnectButton } from "./components";

function MyComponent() {
  return <CustomConnectButton />;
}

Reading NFT Data

import { useGetAllMarketNFTs } from "./hooks/useMarketplace";
import { CONTRACTS } from "./contracts/config";

function NFTList() {
  const { data: nfts } = useGetAllMarketNFTs(CONTRACTS.MOCK_NFT);

  return (
    <div>
      {nfts?.map((nft) => (
        <NFTCard key={nft.tokenId} {...nft} />
      ))}
    </div>
  );
}

Buying an NFT

import { useBuyNFT } from "./hooks/useMarketplace";
import { useApproveToken } from "./hooks/useERC20";

function BuyButton({ listingId, price, paymentToken }) {
  const { buyNFT } = useBuyNFT();
  const { approve } = useApproveToken(paymentToken);

  const handleBuy = async () => {
    // First approve token spending
    await approve(CONTRACTS.MARKETPLACE, price);
    // Then buy the NFT
    buyNFT(listingId);
  };

  return <button onClick={handleBuy}>Buy NFT</button>;
}

🎨 Theming

The app supports both dark and light themes. Toggle between themes using the sidebar button:

import { useTheme } from "./context/ThemeContext";

function ThemeToggle() {
  const { theme, toggleTheme } = useTheme();

  return (
    <button onClick={toggleTheme}>
      {theme === "dark" ? "β˜€οΈ Light Mode" : "πŸŒ™ Dark Mode"}
    </button>
  );
}

πŸ“œ Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run preview Preview production build
npm run lint Run ESLint

πŸ”— Related Links

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the MIT License.


Built with ❀️ using multicoyn-sdk

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages