Β© 2025 Cordy StackX (@cordystackx)
Licensed under the MIT License.
Unauthorized removal of this notice violates the license terms.
A lightweight, production-ready Web3 toolkit for building wallet UIs, controllers, and provider wrappers β designed for modern frameworks like Next.js and Vite.
Built with Wagmi, Viem, Ethers, and TypeScript.
π¦ NPM Package | π GitHub Repository
- π Wallet Connect/Disconnect β Simple hooks and buttons for EVM-based wallets
- π§° Prebuilt UI Components β Ready-to-use
ConnectWalletBT,UI_Comp, and more - βοΈ Smart Controllers β Manage wallet actions, balances, and transactions effortlessly
- πΈ Transaction Helpers β Built-in ERC20 and native token transfer functions
- π¨ Themeable CSS β CSS Modules with variables for easy dark/light mode support
- π¦ Tree-shakable & Typed β Optimized bundle size with full TypeScript definitions
- π§© Framework-Agnostic β Works seamlessly with Next.js, Vite, and more
- π Multi-Chain Support β Custom chain configuration support
npm install @cordystackx/cordy_minikit@latest
# or
pnpm add @cordystackx/cordy_minikit@latest
# or
yarn add @cordystackx/cordy_minikit@latestCreate a .env.local file in your project root:
NEXT_PUBLIC_RPC_ENDPOINT=https://your-rpc-endpoint.com
NEXT_PUBLIC_TOKENADDRESS=0x...
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_idCreate a providers file at /app/providers.tsx or /services/minikit/providers.tsx:
"use client";
import { ReactNode } from "react";
import { ProvidersClientWrapper } from "@cordystackx/cordy_minikit";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
const queryClient = new QueryClient();
export default function Providers({ children }: { children: ReactNode }) {
return (
<QueryClientProvider client={queryClient}>
<ProvidersClientWrapper>
{children}
</ProvidersClientWrapper>
</QueryClientProvider>
);
}Note: Install
@tanstack/react-queryas a peer dependency:npm install @tanstack/react-query
Import the providers and CSS in your /app/layout.tsx:
import Providers from "@/app/providers";
import "@cordystackx/cordy_minikit/dist/css/UI_Comp/styles.module.css";
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>
<Providers>
{children}
</Providers>
</body>
</html>
);
}The ConnectWalletBT component provides a plug-and-play wallet connection button.
import { ConnectWalletBT } from "@cordystackx/cordy_minikit";
export default function Header() {
return (
<nav>
<ConnectWalletBT className="your-custom-class" />
</nav>
);
}Features:
- Automatically shows "Connect Wallet" when disconnected
- Displays wallet address when connected
- Fully customizable with
classNameprop
Use the useWalletModal hook to trigger the wallet modal programmatically:
import { useWalletModal } from "@cordystackx/cordy_minikit";
function CustomButton() {
const { openModal, closeModal } = useWalletModal();
return (
<button onClick={openModal}>
Open Wallet
</button>
);
}The CordyStackTrans function handles ERC20 and native token transfers:
import { CordyStackTrans } from "@cordystackx/cordy_minikit";
async function handlePayment() {
const recipientAddress = "0x...";
const amount = 10; // Token amount
const success = await CordyStackTrans(recipientAddress, amount);
if (success) {
console.log("Transaction successful!");
} else {
console.log("Transaction failed or rejected");
}
}Configure custom chains for your dApp:
import { getConfig, ProvidersClientWrapper } from "@cordystackx/cordy_minikit";
import { defineChain } from "viem";
// Define your custom chain
const myCustomChain = defineChain({
id: 1114,
name: "Core Blockchain Testnet",
network: "core-testnet",
nativeCurrency: { name: "tCORE", symbol: "tCORE", decimals: 18 },
rpcUrls: {
default: { http: ["https://rpc.test.btcs.network"] },
public: { http: ["https://rpc.test.btcs.network"] },
},
blockExplorers: {
default: { name: "Core Scan", url: "https://scan.test.btcs.network" },
},
});
// Get config with custom chain
const customConfig = getConfig({ myCustomChain });
// Use in provider
export default function Providers({ children }: { children: ReactNode }) {
return (
<ProvidersClientWrapper config={customConfig}>
{children}
</ProvidersClientWrapper>
);
}cordy_minikit/
βββ assets/ # Image Sources for logo
βββ components/ # UI components (ConnectWalletBT, UI_Comp)
βββ controllers/ # Transaction logic and wallet operations
βββ config/ # ABIs and static configurations
βββ css/ # CSS Modules and theming
βββ dist/ # Compiled output (published to npm)
βββ index.ts # Main export entry point
βββ package.json
| File/Folder | Description |
|---|---|
assets/ |
Image Sources for logo |
client__provider.tsx |
React provider wrapper for Wagmi/Viem |
components/ |
Reusable UI components for wallet interactions |
controllers/ |
Business logic for Web3 operations |
config/ |
ERC20 ABI and configuration files |
css/ |
Scoped CSS Modules with theming support |
dist/ |
Compiled JavaScript + TypeScript declarations |
@cordystackx/cordy_minikit is built as a modular Web3 toolkit that sits on top of Wagmi, Viem, Ethers, and Coinbase Wallet SDK, providing developers with prebuilt UI components, controllers, and configuration files for seamless wallet and transaction management.
flowchart TD
%% Layer 1 - External Dependencies
subgraph External_Libraries["π External Libraries"]
A1["wagmi (Wallet & Hooks)"]
A2["viem (RPC / EVM Utils)"]
A3["ethers.js (Tx + ABI Handling)"]
A4["Coinbase Wallet SDK (Wallet Provider)"]
end
%% Layer 2 - Core Logic
subgraph Core["βοΈ Core Logic Layer"]
B1["client__provider.tsx (Wagmi & Viem Client Context)"]
B2["controllers/ (Balance, Tx, WagmiButton)"]
B3["config/ (ERC20_ABI, walletConfig, links.json)"]
end
%% Layer 3 - UI Components
subgraph UI["π§© UI Components"]
C1["Connect_wallet_bt.tsx (Connect/Disconnect Button)"]
C2["UI_Comp.tsx (Visual/Interactive UI Elements)"]
C3["CSS Modules (Dark/Light Theme Styles)"]
end
%% Layer 4 - Assets & Static Files
subgraph Assets["πΌοΈ Assets"]
D1["Wallet Logos (Coinbase, Metamask, WalletConnect)"]
D2["Static Config Files (Image.json, etc.)"]
end
%% Layer 5 - Output
subgraph Output["π¦ Build & Distribution"]
E1["dist/ (Compiled JS + .d.ts Types)"]
E2["index.ts (Library Entry Point)"]
E3["NPM Registry (Public Package)"]
end
%% Connections
A1 & A2 & A3 & A4 --> B1
B1 --> B2
B2 --> B3
B2 --> C1
C1 --> C2
C2 --> C3
B3 --> C1
C3 --> D1
D1 --> E1
E1 --> E2
E2 --> E3
<ConnectWalletBT className?: string />- Props:
className(optional) - Custom CSS class
const { openModal, closeModal } = useWalletModal();- Returns:
{ openModal: () => void, closeModal: () => void }
const success = await CordyStackTrans(recipientAddress: string, amount: number);- Returns:
Promise<boolean>- Transaction success status
const config = getConfig({ myChain: customChainDefinition });- Returns: Wagmi configuration with custom chains
<ConnectWalletBT className="my-custom-button" />.my-custom-button {
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
border-radius: 8px;
padding: 12px 24px;
font-weight: 600;
}- React: ^18.3.1
- Next.js: ^14.2.33 (for Next.js projects)
- @tanstack/react-query: ^5.90.3
- wagmi: ^2.18.1
- viem: Latest version
- ethers: ^6.15.0
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- NPM Package: https://www.npmjs.com/package/@cordystackx/cordy_minikit
- GitHub Repository: https://github.com/cordyStackX/cordy_minikit_official
- Official Website: https://cordy-stack-x.vercel.app/
For issues, questions, or feature requests:
Built with β€οΈ by CordyStackX