This guide will help you set up a basic minting dApp using TypeScript and OnchainKit.
- Github: Ensure you have a GitHub account for version control and collaboration.
- Coinbase Wallet: Use Coinbase Wallet for managing your assets and interacting with dApps.
- Install Visual Studio Code.
- Install Git for version control.
- Install Node Version Manager (NVM) (for Windows | Mac/Linux) or Node.js for managing Node versions.
- Solidity: For Solidity language support in VS Code.
- Solidity Inspector: For code inspection and syntax highlighting.
- ESLint: For identifying and reporting on patterns found in JavaScript and TypeScript code.
- GitHub Copilot: AI-powered code completion tool.
- GitLens: For enhanced Git capabilities within VS Code.
- Path Intellisense: Auto-completion for file paths in VS Code.
- Prettier: For code formatting and styling.
-
Clone the repository:
git clone <repository-url>
-
Install dependencies:
npm install
oryarn install
-
Start development server:
npm start
oryarn start
For additional setup instructions, please refer to the project's documentation.
npm create onchain@latest
Follow the prompts and enter your project name.
Get your Client API Key from:
🔗 https://portal.cdp.coinbase.com/products/onchainkit
⚠️ Important: Do not use Coinbase Smart Wallet.
cd yourprojectname
code .
npm install
Navigate to app/page.tsx
.
Follow this guide and complete steps 1 and 2 from the quickstart.
Replace the contract address in <NFTMintCard>
with your own contract address from your created NFT or use this contract address as a sample:
0xed2f34043387783b2727ff2799a46ce3ae1a34d2
"use client";
"use client";
import { NFTMintCard } from "@coinbase/onchainkit/nft";
import { NFTMedia } from "@coinbase/onchainkit/nft/view";
import {
NFTCreator,
NFTCollectionTitle,
NFTQuantitySelector,
NFTAssetCost,
NFTMintButton,
} from "@coinbase/onchainkit/nft/mint";
export default function Page() {
return (
<NFTMintCard
contractAddress="0xed2f34043387783b2727ff2799a46ce3ae1a34d2"
tokenId="2"
>
<NFTCreator />
<NFTMedia />
<NFTCollectionTitle />
<NFTQuantitySelector />
<NFTAssetCost />
<NFTMintButton />
</NFTMintCard>
);
}
npm run dev
Visit http://localhost:3000
to view your minting dApp in action.
Kindly double check your client API in your .env file
NEXT_PUBLIC_ONCHAINKIT_API_KEY=YOUR_CLIENT_API_HERE