howlonghasitBen

surf-waves-mint

0
0
# Install this skill:
npx skills add howlonghasitBen/openclaw-skills --skill "surf-waves-mint"

Install specific skill from multi-skill repository

# Description

Mint SURF Waves Cards NFTs on Base with proper metadata, IPFS uploads, and card rendering.

# SKILL.md


name: surf-waves-mint
description: Mint SURF Waves Cards NFTs on Base with proper metadata, IPFS uploads, and card rendering.


SURF Waves Cards Minting Skill 🏄🎴

Mint 1/1 trading cards to the SURF Waves Cards collection on Base L2.

Prerequisites

  • Node.js 18+ with npm
  • Ollama running locally (for flavor text generation)
  • Pinata account with JWT token
  • Funded wallet on Base mainnet (for gas)
  • Puppeteer for card rendering

Environment Setup

Create ~/.env with:

PRIVATE_KEY=0x... # Your wallet private key
PINATA_JWT=eyJ...  # Pinata API JWT token

Contracts

Contract Address Notes
SURF Waves Cards (main) 0xcc2d6ba8564541e6e51fe5522e26d4f4bbdd458b 60s cooldown between mints
Test Contract 0x765fe6515094d28f0db61c8211b7c524380be47e No cooldown (if you're owner)

Card Data Source

Cards are loaded from: https://howlonghasitben.github.io/surf-works/cardData.json

This contains:
- 267 unique cards with stats, themes, and artwork
- Theme definitions (CSS gradients, colors)
- Card metadata (type, level, mana cost, etc.)

Minting Flow

1. Single Card Mint

node ~/.openclaw/skills/surf-waves-mint/scripts/mintCard.mjs <card-id>

This will:
1. Load card data from surf-works
2. Resolve theme (string → CSS object)
3. Check if flavor text is filler → generate via Ollama
4. Render card to PNG using Puppeteer
5. Upload PNG + HTML to IPFS via Pinata
6. Create ERC-721 metadata with animation_url
7. Mint to contract

2. Batch Mint All Cards

node ~/.openclaw/skills/surf-waves-mint/scripts/batchMint.mjs

Features:
- Respects 60s cooldown on main contract
- Saves progress to mint-progress.json
- Auto-resumes if interrupted
- Generates flavor text for filler cards
- Logs all transactions

3. Check Progress

cat ~/pepeArtGen-fork/mini-app/scripts/mint-progress.json | jq '.minted | length'

Metadata Format

{
  "name": "Card Name ⟨Subtitle⟩",
  "description": "1/1 Legendary Card from the Waves Collection. [flavor text]",
  "image": "https://gateway.pinata.cloud/ipfs/[CID]",
  "animation_url": "https://gateway.pinata.cloud/ipfs/[HTML_CID]",
  "external_url": "https://howlonghasitben.github.io/surf-works",
  "attributes": [
    { "trait_type": "Rarity", "value": "1/1" },
    { "trait_type": "Level", "value": "3" },
    { "trait_type": "Attack", "value": "5" },
    { "trait_type": "Defense", "value": "4" },
    { "trait_type": "Type", "value": "Creature — Phoenix" },
    { "trait_type": "Health Points", "value": "10" },
    { "trait_type": "Mana Cost", "value": "5" },
    { "trait_type": "Terrain", "value": "?" }
  ]
}

Key Files

File Purpose
mintCard.mjs Single card mint script
batchMint.mjs Batch mint all cards
cardRenderer.mjs HTML → PNG rendering
ipfsUpload.mjs Pinata upload helpers
flavorGen.mjs Ollama flavor text generation

Troubleshooting

Cooldown Error

The main contract has a 60-second cooldown between mints per wallet. Wait or use a different wallet.

IPFS Upload Fails

Check Pinata JWT is valid. Use pinata.upload.public.file() for SDK v2.

Card Renders Wrong

Ensure theme is resolved from string to object. The frontend expects full CSS objects, not theme names.

baseURI Issues

If metadata URLs are broken, the contract baseURI might be concatenating. Set it to empty string:

await contract.setBaseURI('')

OpenSea

Collection: https://opensea.io/collection/surf-waves-cards

Cards appear after indexing (~5-10 min). The animation_url enables interactive card display.

Credits

  • Contract: WavesTCG team
  • Card Art: SURF FINANCE STUDIOS
  • Themes: surf-works collection
  • Minting: surfGod69 🏄

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.