skills/blockchain/nft/SKILL.md
Skill for creating, managing, and interacting with Non-Fungible Tokens (NFTs) on blockchain networks.
npx skillsauth add alphaonedev/openclaw-graph nftInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill allows OpenClaw to handle NFT-related tasks on blockchain networks, including minting, transferring, querying, and managing NFTs using web3 protocols.
Always initialize with authentication by setting the environment variable $NFT_API_KEY before commands. For scripts, wrap calls in error-handling blocks to manage network failures.
To mint an NFT programmatically:
export NFT_API_KEY=your_api_keyclaw nft create --network ethereum --wallet 0xYourWalletAddressFor querying, chain commands: First, fetch metadata, then process it. Example pattern for automation: Use claw nft query in loops for batch ownership checks, ensuring rate limits (e.g., <10 calls/min on Ethereum).
Config format: Use JSON files for metadata, e.g., {"name": "MyNFT", "description": "Token description", "image": "ipfs://hash"}. Load via --metadata path/to/file.json.
CLI Command: claw nft create --network <chain> --wallet <address> --metadata <file.json>
Flags: --network (e.g., ethereum, solana), --gas-limit 210000 for custom gas, --dry-run to simulate without executing.
Example: claw nft create --network ethereum --wallet 0x123abc --metadata nft_data.json (creates and returns token ID).
CLI Command: claw nft transfer --network <chain> --from <sender_address> --to <receiver_address> --tokenId <id>
Flags: --approve-first to handle approvals, --gas-price 20gwei for priority.
Example: claw nft transfer --network ethereum --from 0x123abc --to 0x456def --tokenId 1
API Endpoint: POST /api/nft/create
Body: {"network": "ethereum", "wallet": "0x123abc", "metadata": {"name": "ArtPiece"}}
Headers: Include Authorization: Bearer $NFT_API_KEY. Response: JSON with { "tokenId": "123", "transactionHash": "0xhash" }.
API Endpoint: GET /api/nft/{tokenId}/metadata
Query Params: ?network=ethereum. Example: curl -H "Authorization: Bearer $NFT_API_KEY" https://api.openclaw.com/api/nft/123/metadata
Authentication: Required for all; set $NFT_API_KEY as an environment variable. For config, use a .env file: NFT_API_KEY=sk_123abc.
Integrate by importing the skill in OpenClaw workflows, e.g., via import skill nft in scripts. Ensure blockchain RPC endpoints are configured, like setting $ETHEREUM_RPC_URL=https://mainnet.infura.io/v3/your_project_id.
For smart contracts: Provide ABI in a JSON config file, e.g., {"abi": [{"constant": true, "inputs": [], "name": "ownerOf", "outputs": [{"name": "", "type": "address"}], "type": "function"} ] }, and pass with --abi path/to/abi.json.
Combine with other skills: Use alongside "blockchain" cluster skills for wallet management—e.g., first call claw wallet balance to check funds, then claw nft create.
Testing: Run in a testnet environment by adding --testnet flag, which switches to networks like Goerli (for Ethereum).
Always use try-catch blocks for commands, e.g., in Python scripts: try: subprocess.run(['claw', 'nft', 'create', '--network', 'ethereum']) except subprocess.CalledProcessError as e: print(e.output).
Common errors:
$ETHEREUM_RPC_URL and retry with exponential backoff (e.g., wait 5s, then 10s).if not re.match(r'^0x[a-fA-F0-9]{40}$', address): raise ValueError before commands.$NFT_API_KEY is missing, commands return 401; handle by prompting for setup or exiting gracefully.claw nft estimate-gas --network ethereum --command create.Prescriptive: Before any operation, run a health check: claw nft status --network ethereum to verify node connectivity.
Minting an NFT on Ethereum:
Set up: export NFT_API_KEY=your_key and prepare metadata in metadata.json as {"name": "OpenClawArt", "description": "AI-generated piece"}.
Command: claw nft create --network ethereum --wallet 0xYourWallet --metadata metadata.json
This mints the NFT, outputs the token ID, and signs the transaction using your wallet.
Transferring an NFT:
Prerequisites: Ensure the sender has approved the transfer.
Command: claw nft transfer --network ethereum --from 0xSenderWallet --to 0xReceiverWallet --tokenId 42 --approve-first
This transfers the specified NFT, handles gas automatically, and returns the transaction hash for verification.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui