0.2.0 • Published 7 months ago

@iqai/plugin-agentkit v0.2.0

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

šŸŽ§ Plugin AgentKit

AgentKit plugin for Eliza that enables interaction with CDP AgentKit tools for NFT and token management on Coinbase's CDP platform.

šŸ“Œ Overview

This plugin integrates Coinbase's CDP AgentKit tools into your agent, providing:

āœ… Wallet management for blockchain interactions āœ… NFT creation, deployment, and minting capabilities āœ… Token creation and management functionality āœ… Trading and transfer operations for digital assets āœ… Network support for Base Sepolia and Base Mainnet

šŸ›  Installation

Install the plugin using pnpm:

pnpm install @iqai/plugin-agentkit

After installation, you can use the plugin like this:

import { AgentKit } from "@iqai/plugin-agentkit";

// Initialize the plugin with your configuration
const agentKitPlugin = new AgentKit({
  apiKeyName: process.env.CDP_API_KEY_NAME,
  privateKey: process.env.CDP_API_KEY_PRIVATE_KEY,
  network: process.env.CDP_AGENT_KIT_NETWORK || 'base-sepolia'
});

// Add to your agent configuration
const agent = new AgentBuilder()
  .withPlugin(agentKitPlugin)
  .build();

āš™ Configuration

šŸ”§ Variable Name🌜 Description
CDP_API_KEY_NAMEYour CDP API key name for authentication šŸ”‘
CDP_API_KEY_PRIVATE_KEYYour private key for transactions šŸ›”ļø
CDP_AGENT_KIT_NETWORKNetwork to use (defaults to base-sepolia) 🌐

šŸŽÆ Actions

šŸ’¼ GET_WALLET_DETAILS

Retrieve information about the agent's wallet including address and balances.

šŸ’¬ Examples:

  • "Can you show me my wallet details?"
  • "What's my wallet address?"
  • "Display my wallet information"

šŸ–¼ļø DEPLOY_NFT

Deploy a new NFT collection on the blockchain.

šŸ’¬ Examples:

  • "Deploy a new NFT collection called 'Music NFTs' with symbol 'MUSIC'"
  • "Create an NFT collection named 'Digital Art' with the symbol 'DART'"

šŸ’° DEPLOY_TOKEN

Deploy a new token on the blockchain.

šŸ’¬ Examples:

  • "Deploy a new token called 'Artist Token' with symbol 'ART'"
  • "Create a token with the name 'Community Points' and symbol 'CPS'"

šŸ’µ GET_BALANCE

Check token or NFT balance in the wallet.

šŸ’¬ Examples:

  • "What's my current balance?"
  • "Check my NFT balance for collection 0x1234..."
  • "How many tokens do I have?"

šŸŽØ MINT_NFT

Mint new NFTs from an existing collection.

šŸ’¬ Examples:

  • "Mint 5 NFTs from my 'Music NFTs' collection"
  • "Create 3 new NFTs in my collection at 0x5678..."

šŸ“ REGISTER_BASENAME

Register a basename for NFTs.

šŸ’¬ Examples:

  • "Register 'myartcollection' as a basename for my NFTs"
  • "Create a new basename 'digitalart' for my collection"

🚰 REQUEST_FAUCET_FUNDS

Request testnet funds for development and testing.

šŸ’¬ Examples:

  • "Request testnet funds"
  • "Get some test ETH for development"

šŸ”„ TRADE

Execute trades between tokens.

šŸ’¬ Examples:

  • "Trade 10 DAI for ETH"
  • "Swap 5 USDC for BTC"

ā†—ļø TRANSFER

Transfer tokens or NFTs to another address.

šŸ’¬ Examples:

  • "Transfer 20 USDC to 0x1234..."
  • "Send my NFT with ID #42 to 0x5678..."

šŸ›’ WOW_BUY_TOKEN

Buy WOW tokens.

šŸ’¬ Examples:

  • "Buy 50 WOW tokens"
  • "Purchase WOW tokens with 10 USDC"

šŸ’± WOW_SELL_TOKEN

Sell WOW tokens.

šŸ’¬ Examples:

  • "Sell 30 WOW tokens"
  • "Exchange my WOW tokens for USDC"

✨ WOW_CREATE_TOKEN

Create new WOW tokens.

šŸ’¬ Examples:

  • "Create a new WOW token called 'Creator Coin' with symbol 'CC'"
  • "Make a WOW token named 'Community Token'"

🌜 Response Format

Responses from the plugin typically include:

  • āœ” Status: Success or failure of the operation
  • šŸ”— Transaction Hash: When blockchain transactions are executed
  • šŸ’² Asset Details: Information about tokens or NFTs
  • šŸ·ļø Collection Information: For NFT operations
  • šŸ“Š Balances: Current wallet balances when requested

āŒ Error Handling

The plugin handles various error scenarios:

  • 🚨 Authentication Errors: Issues with API keys or credentials
  • 🌐 Network Issues: Problems connecting to the blockchain network
  • šŸ’ø Insufficient Funds: Not enough balance for transactions
  • šŸ”„ Transaction Failures: When blockchain operations fail
  • 🚫 Invalid Parameters: When provided inputs are incorrect

🌐 Network Support

The plugin supports the following networks:

  • Base Sepolia (default)
  • Base Mainnet

Configure the network using the CDP_AGENT_KIT_NETWORK environment variable.

šŸ”§ Development

Build the plugin:

pnpm build

Run in development mode:

pnpm dev

šŸ“¦ Dependencies

  • @elizaos/core
  • @coinbase/cdp-agentkit-core
  • @coinbase/cdp-langchain
  • @langchain/core

šŸ“„ License

MIT