Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions smart-wallet/coin-your-joke/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# env
.env
.env.example
77 changes: 77 additions & 0 deletions smart-wallet/coin-your-joke/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Coin Your Joke

A fun onchain app that allows users to coin their jokes, powered by Base Smart Wallet and Zora SDK.

## Overview

Coin Your Joke is a playful application that demonstrates the power of blockchains by allowing users to:
- Input any joke
- Generate a coin name and metadata using OpenAI API
- Generate a unique Coin through Zora SDK
- Mint the coin as an NFT using Zora's protocol
- View and share their joke coins

## Technologies Used

- [**Base Smart Wallet**](https://docs.base.org/identity/smart-wallet/quickstart): For seamless onchain identity management
- [**Zora SDK**](https://docs.zora.co/coins): For coining content
- [**Wagmi**](https://wagmi.sh/): For building the onchain app
- **OpenAI API**: For generating coin params from jokes
- **TypeScript**: For type-safe development

## Key Components

### CoinButton Component
The `CoinButton` component is a reusable UI element that handles:
- User input for jokes
- Coin generation process
- Smart wallet connection
- Coining content
- Transaction status display

### Page Component
The main page (`page.tsx`) provides:
- A clean, intuitive interface for joke input
- Visual feedback during coin generation
- Display of generated coin details
- Integration with the Smart Wallet for authentication
- Connection to Zora's coining protocol

## Getting Started

1. Clone the repository
2. Install dependencies:
```bash
pnpm install
```
3. Set up environment variables:
- You can use the `.env.example` to know how the structure of your `.env` should look like
- Copy .env.example, name it `.env` and set up your variables

```
NEXT_PUBLIC_URL=your_deployment_url
ENV=local
OPENAI_API_KEY=your_openai_api_key
```
4. Run the development server:
```bash
pnpm run dev
```

## How It Works

1. User enters a joke
2. The application uses OpenAI to generate coin parameters (name and symbol)
3. A unique coin ID is generated
4. Coin metadata is stored and associated with the ID
5. The coin is deployed using Zora SDK

## Environment Configuration

The application supports both local and production environments:
- Local: Uses hardcoded image URLs and localhost endpoints
- Production: Uses the deployed API endpoints and dynamic image generation

## Contributing

Feel free to submit issues and enhancement requests!
21 changes: 21 additions & 0 deletions smart-wallet/coin-your-joke/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
4 changes: 4 additions & 0 deletions smart-wallet/coin-your-joke/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}

module.exports = nextConfig
51 changes: 51 additions & 0 deletions smart-wallet/coin-your-joke/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "zora-coiner",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@radix-ui/react-alert-dialog": "^1.1.10",
"@radix-ui/react-dialog": "^1.1.10",
"@radix-ui/react-slot": "^1.2.0",
"@radix-ui/react-toast": "^1.2.10",
"@tailwindcss/postcss": "^4.1.4",
"@tanstack/react-query": "5.45.1",
"@zoralabs/coins-sdk": "^0.1.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.503.0",
"next": "14.2.4",
"next-themes": "^0.4.6",
"openai": "^4.95.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sonner": "^2.0.3",
"tailwind-merge": "^3.2.0",
"viem": "^2.27.2",
"wagmi": "latest"
},
"devDependencies": {
"@types/node": "^20.12.10",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@wagmi/cli": "latest",
"autoprefixer": "^10.4.21",
"bufferutil": "^4.0.8",
"encoding": "^0.1.13",
"lokijs": "^1.5.12",
"pino-pretty": "^10.3.1",
"postcss": "^8.4.35",
"postcss-import": "^16.1.0",
"postcss-nesting": "^13.0.1",
"supports-color": "^9.4.0",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.4.5",
"utf-8-validate": "^5.0.2"
}
}
Loading