plugin-my
Version:
COTI blockchain plugin for ElizaOS - enables private token operations and encrypted transactions
112 lines (78 loc) • 2.63 kB
Markdown
# My COTI Plugin
COTI blockchain plugin for ElizaOS - enables private token operations and encrypted transactions on the COTI network.
## Features
- **Native COTI Balance Checking**: Get COTI token balances for any address
- **COTI Token Transfers**: Send COTI tokens to other addresses
- **Account Management**: List and manage COTI accounts
- **Wallet Information**: Get detailed wallet and network information
- **Privacy-Focused**: Built for COTI's privacy-enhanced blockchain
## Installation
```bash
npm install plugin-my
```
## Configuration
Set the following environment variables:
- `COTI_PRIVATE_KEY`: Private key for your COTI wallet (required)
- `COTI_RPC_URL`: RPC URL for COTI network (optional, defaults to testnet)
- `COTI_NETWORK_ID`: Network ID for COTI blockchain (optional, defaults to 7701)
Example `.env` file:
```
COTI_PRIVATE_KEY=your_private_key_here
COTI_RPC_URL=https://testnet.coti.io/rpc
COTI_NETWORK_ID=7701
```
## Usage
```typescript
import { myPlugin } from 'plugin-my';
// Use the plugin in your ElizaOS agent
```
## Available Actions
### GET_NATIVE_BALANCE
Check COTI token balance for an address.
**Triggers**: "What's my COTI balance?", "Check balance for 0x..."
### TRANSFER_NATIVE
Transfer COTI tokens to another address.
**Triggers**: "Send 10 COTI to 0x...", "Transfer 5.5 COTI to alice"
### LIST_ACCOUNTS
List all configured COTI accounts.
**Triggers**: "Show me my COTI accounts", "What accounts do I have?"
### WALLET_INFO
Get detailed wallet and network information.
**Triggers**: "Show me my wallet information", "What's my wallet status?"
## Structure
```
plugin-my/
├── src/
│ ├── actions/ # COTI blockchain actions
│ │ ├── getNativeBalance.ts
│ │ ├── transferNative.ts
│ │ ├── listAccounts.ts
│ │ └── walletInfo.ts
│ ├── providers/ # Blockchain providers
│ │ ├── cotiProvider.ts
│ │ └── wallet.ts
│ ├── types/ # Type definitions
│ │ └── index.ts
│ └── index.ts # Plugin export
├── package.json # Dependencies and config
└── README.md # This file
```
## Development Commands
```bash
# Start in development mode with hot reload
bun run dev
# Start in production mode
bun run start
# Build the plugin
bun run build
# Run tests
bun test
# Format code
bun run format
```
## Security
- Never share your private key
- Use testnet for development and testing
- Verify all transaction details before confirming
## License
UNLICENSED