dactyclaw 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/agent.json +7 -0
- package/api/tokens.js +20 -0
- package/api/top-tokens.js +25 -0
- package/bin/dacty-create.js +44 -0
- package/bin/dacty-launch.js +40 -0
- package/index.html +1395 -0
- package/package.json +32 -0
- package/proxy.js +112 -0
- package/vercel.json +6 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# DACTYCLAW
|
|
2
|
+
|
|
3
|
+
**Agent Monitor & Deployer for Clawn Ecosystem on Base**
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Live Token Leaderboard** — Real-time feed from [clawn.ch/api/tokens](https://clawn.ch/api/tokens) tracking 58,000+ agent-launched tokens
|
|
8
|
+
- **Deploy Agents** — One-command CLI to create autonomous AI agents with unique DNA and wallet
|
|
9
|
+
- **Launch Tokens** — Deploy ERC-20 tokens on Base network via [Clanker](https://clanker.world)
|
|
10
|
+
- **80/20 Fee Split** — Agents earn 80% of trading fees automatically
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
$ npx dacty-create # Create an agent
|
|
16
|
+
$ npx dacty-launch # Launch token on Base
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Website
|
|
20
|
+
|
|
21
|
+
The DACTYCLAW website includes:
|
|
22
|
+
- **Home** — Overview and features
|
|
23
|
+
- **Leaderboard** — Live token feed from Clawn ecosystem (auto-refreshes every 30s)
|
|
24
|
+
- **Deploy** — Step-by-step deployment guide + direct links to Clanker
|
|
25
|
+
- **Documentation** — Complete CLI reference and guides
|
|
26
|
+
|
|
27
|
+
## Links
|
|
28
|
+
|
|
29
|
+
- [Clawn.ch](https://clawn.ch) — Token infrastructure for agents
|
|
30
|
+
- [Clawnchpad](https://clawn.ch/pad/) — Ecosystem dashboard
|
|
31
|
+
- [Clanker.world](https://clanker.world) — ERC-20 token deployment on Base
|
|
32
|
+
- [API: /api/tokens](https://clawn.ch/api/tokens) — Public token data
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
MIT
|
package/agent.json
ADDED
package/api/tokens.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default async function handler(req, res) {
|
|
2
|
+
const url = new URL('https://clawn.ch/api/tokens');
|
|
3
|
+
|
|
4
|
+
// Forward query params (offset, limit, etc.)
|
|
5
|
+
const { searchParams } = new URL(req.url, 'http://localhost');
|
|
6
|
+
searchParams.forEach((val, key) => url.searchParams.set(key, val));
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const response = await fetch(url.toString(), {
|
|
10
|
+
headers: { 'User-Agent': 'dactyclaw/2.2' }
|
|
11
|
+
});
|
|
12
|
+
const data = await response.json();
|
|
13
|
+
|
|
14
|
+
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
15
|
+
res.setHeader('Cache-Control', 's-maxage=10, stale-while-revalidate=30');
|
|
16
|
+
res.status(200).json(data);
|
|
17
|
+
} catch (err) {
|
|
18
|
+
res.status(500).json({ success: false, error: 'Failed to fetch tokens' });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default async function handler(req, res) {
|
|
2
|
+
// Always append prices=1, sort=hot, and limit=10 to the request
|
|
3
|
+
const url = new URL('https://clawn.ch/api/tokens?prices=1&sort=hot&limit=10');
|
|
4
|
+
|
|
5
|
+
// Forward any other query params
|
|
6
|
+
const { searchParams } = new URL(req.url, 'http://localhost');
|
|
7
|
+
searchParams.forEach((val, key) => {
|
|
8
|
+
if (key !== 'prices' && key !== 'sort' && key !== 'limit') {
|
|
9
|
+
url.searchParams.set(key, val);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const response = await fetch(url.toString(), {
|
|
15
|
+
headers: { 'User-Agent': 'dactyclaw/2.2' }
|
|
16
|
+
});
|
|
17
|
+
const data = await response.json();
|
|
18
|
+
|
|
19
|
+
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
20
|
+
res.setHeader('Cache-Control', 's-maxage=30, stale-while-revalidate=60');
|
|
21
|
+
res.status(200).json(data);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
res.status(500).json({ success: false, error: 'Failed to fetch top tokens' });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { program } = require('commander');
|
|
3
|
+
const { ethers } = require('ethers');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
program
|
|
8
|
+
.version('1.0.0')
|
|
9
|
+
.description('Create a new autonomous agent and generate a Base wallet')
|
|
10
|
+
.argument('[name]', 'Name of the agent')
|
|
11
|
+
.option('-t, --ticker <ticker>', 'Token ticker symbol')
|
|
12
|
+
.action((name, options) => {
|
|
13
|
+
const agentName = name || 'New Agent';
|
|
14
|
+
const ticker = options.ticker || agentName.substring(0, 4).toUpperCase();
|
|
15
|
+
|
|
16
|
+
console.log(`[DACTYCLAW] Generating DNA and autonomous wallet for ${agentName}...`);
|
|
17
|
+
|
|
18
|
+
// Generate a random wallet
|
|
19
|
+
const wallet = ethers.Wallet.createRandom();
|
|
20
|
+
|
|
21
|
+
const envContent = `AGENT_PRIVATE_KEY=${wallet.privateKey}\n`;
|
|
22
|
+
fs.writeFileSync(path.join(process.cwd(), '.env'), envContent);
|
|
23
|
+
|
|
24
|
+
const agentConfig = {
|
|
25
|
+
name: agentName,
|
|
26
|
+
ticker: ticker,
|
|
27
|
+
address: wallet.address,
|
|
28
|
+
dna: wallet.privateKey.substring(2, 10).toUpperCase() + '-' + Date.now().toString().slice(-4),
|
|
29
|
+
created_at: new Date().toISOString()
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
fs.writeFileSync(path.join(process.cwd(), 'agent.json'), JSON.stringify(agentConfig, null, 2));
|
|
33
|
+
|
|
34
|
+
console.log(`\n✅ Agent successfully created!\n`);
|
|
35
|
+
console.log(`Name: ${agentName}`);
|
|
36
|
+
console.log(`Ticker: $${ticker}`);
|
|
37
|
+
console.log(`DNA ID: ${agentConfig.dna}`);
|
|
38
|
+
console.log(`Wallet: ${wallet.address}`);
|
|
39
|
+
console.log(`\n⚠️ Private key saved to .env (DO NOT COMMIT THIS FILE)`);
|
|
40
|
+
console.log(`📄 Agent config saved to agent.json`);
|
|
41
|
+
console.log(`\nNext step: Run 'npx dacty-launch --developer <your_address>' to deploy token on Base via Clanker`);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
program.parse(process.argv);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { program } = require('commander');
|
|
5
|
+
|
|
6
|
+
program
|
|
7
|
+
.version('1.0.0')
|
|
8
|
+
.description("Launch your agent's token via Clanker on the Base network")
|
|
9
|
+
.option('-d, --developer <address>', 'Developer fee recipient address')
|
|
10
|
+
.action((options) => {
|
|
11
|
+
const configPath = path.join(process.cwd(), 'agent.json');
|
|
12
|
+
if (!fs.existsSync(configPath)) {
|
|
13
|
+
console.error('❌ Error: agent.json not found. Run `npx dacty-create <name>` first.');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
18
|
+
console.log(`[DACTYCLAW] Preparing Clanker launch for $${config.ticker} (${config.name})...`);
|
|
19
|
+
|
|
20
|
+
let devAddress = options.developer;
|
|
21
|
+
if (!devAddress) {
|
|
22
|
+
console.log(`\n⚠️ No developer fee address provided.`);
|
|
23
|
+
console.log(`💡 You can earn 80% of Clanker fees by providing your wallet address.`);
|
|
24
|
+
console.log(`💡 Example: npx dacty-launch --developer 0xYourWalletAddress\n`);
|
|
25
|
+
devAddress = '0x0000000000000000000000000000000000000000'; // placeholder or random
|
|
26
|
+
} else {
|
|
27
|
+
console.log(`💰 Developer fee recipient set to: ${devAddress}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.log(`\n🚀 Ready to launch on Base!`);
|
|
31
|
+
console.log(`Launch via Clanker smart contracts is currently a browser-based transaction.`);
|
|
32
|
+
console.log(`\nClick the link below to deploy your token (Wallet: ${config.address}):`);
|
|
33
|
+
|
|
34
|
+
// Simulate Clanker URL construction
|
|
35
|
+
const clankerUrl = `https://clanker.world/deploy?name=${encodeURIComponent(config.name)}&symbol=${encodeURIComponent(config.ticker)}&dev=${devAddress}`;
|
|
36
|
+
|
|
37
|
+
console.log(`\x1b[36m${clankerUrl}\x1b[0m\n`);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
program.parse(process.argv);
|