npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

hunt-mint-swap

v0.1.3

Published

A React component library for swapping MINT / HUNT buildings

Readme

hunt-mint-swap

A React component library for seamless token swapping and minting functionality, built with modern web3 technologies.

Features

  • 🔄 MintSwap Component: Seamless token swapping interface
  • 🏗️ HuntBuildingsModal: Building minting and management interface
  • 🌐 Wagmi Integration: Robust wallet connection
  • ⚡ Viem/Wagmi Support: Robust Web3 interactions
  • 🎨 Modern UI with Tailwind CSS

Installation

npm install hunt-mint-swap
# or
yarn add hunt-mint-swap
# or
pnpm add hunt-mint-swap

Prerequisites

This package requires the following peer dependencies:

{
  "react": ">=19.1.0",
  "react-dom": ">=19.1.0",
  "viem": ">=2.29.2",
  "wagmi": ">=2.15.3"
}

Setup

1. Import Styles

The components use Tailwind CSS for styling. You must import the component styles in your application:

// In your app's entry point (e.g., App.tsx or index.tsx)
import "hunt-mint-swap/style.css";

2. Configure Tailwind CSS

If you're using Tailwind CSS in your project, add the component paths to your tailwind.config.js:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    // ... your other content paths
    "./node_modules/hunt-mint-swap/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};

3. Setup Required Providers

The library requires specific providers to be set up in your app. Create a wrapper component like this:

// App.tsx or your root component
import { WagmiProvider, createConfig, http } from "wagmi";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { mainnet, base } from "viem/chains";
import { HuntMintSwapProvider } from "hunt-mint-swap";

// Get your project ID from WalletConnect Cloud
const projectId = "YOUR_WALLET_CONNECT_PROJECT_ID";

// Create wagmi config
const config = createConfig({
  chains: [mainnet, base],
  transports: {
    [mainnet.id]: http(),
    [base.id]: http(),
  },
});

const queryClient = new QueryClient();

function App() {
  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <HuntMintSwapProvider>{/* Your app content */}</HuntMintSwapProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
}

export default App;

4. Environment Variables

Make sure to set up the following environment variables in your .env file:

VITE_DECENT_API_KEY=your_decent_api_key

Usage

MintSwap Component

import { MintSwap } from "hunt-mint-swap";

function App() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <MintSwap
      isOpen={isOpen}
      onClose={() => setIsOpen(false)}
      className="custom-class"
    />
  );
}

HuntBuildingsModal Component

import { HuntBuildingsModal } from "hunt-mint-swap";

function App() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <HuntBuildingsModal
      isOpen={isOpen}
      onClose={() => setIsOpen(false)}
      className="custom-class"
    />
  );
}

Component Props

MintSwap Props

| Prop | Type | Description | | --------- | ---------- | ------------------------------------------ | | isOpen | boolean | Controls the visibility of the swap modal | | onClose | () => void | Callback function when modal is closed | | className | string? | Optional CSS class for custom on container |

HuntBuildingsModal Props

| Prop | Type | Description | | --------- | ---------- | ---------------------------------------------- | | isOpen | boolean | Controls the visibility of the buildings modal | | onClose | () => void | Callback function when modal is closed | | className | string? | Optional CSS class for custom on container |

Troubleshooting

Common Issues

  1. White Screen: If you see a white screen, make sure you have:

    • Imported the CSS file
    • Set up all required providers
    • Set the WalletConnect project ID
    • Set the DECENT API key in your environment variables
  2. Provider Errors: Ensure your providers are in the correct order:

    WagmiProvider -> QueryClientProvider -> HuntMintSwapProvider
  3. Style Issues: If styles are not loading:

    • Check that you've imported the CSS file
    • Verify your Tailwind configuration includes the package path
    • Make sure PostCSS is properly configured in your build setup

Contributing

We welcome contributions! Please see our contributing guide for details.

License

MIT

Support

For support, please open an issue in the GitHub repository: https://github.com/yourusername/hunt-mint-swap/issues