dacty-create 1.0.3 → 1.0.5

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.
@@ -8,6 +8,7 @@ import path from 'path';
8
8
  import { fileURLToPath } from 'url';
9
9
  import { dirname } from 'path';
10
10
  import crypto from 'crypto';
11
+ import { privateKeyToAccount } from 'viem/accounts';
11
12
 
12
13
  const __filename = fileURLToPath(import.meta.url);
13
14
  const __dirname = dirname(__filename);
@@ -19,12 +20,12 @@ function generateDNA() {
19
20
 
20
21
  // Generate wallet (Ethereum-style)
21
22
  function generateWallet() {
22
- const privateKey = crypto.randomBytes(32).toString('hex');
23
+ const privateKey = '0x' + crypto.randomBytes(32).toString('hex');
24
+ // Derive address from private key using viem
25
+ const account = privateKeyToAccount(privateKey);
23
26
  return {
24
- privateKey: '0x' + privateKey,
25
- // Note: In production, derive address from private key using ethers.js
26
- // For now, generate a mock address
27
- address: '0x' + crypto.randomBytes(20).toString('hex')
27
+ privateKey: privateKey,
28
+ address: account.address
28
29
  };
29
30
  }
30
31
 
@@ -36,7 +37,7 @@ async function createAgent() {
36
37
  console.log(chalk.cyan.bold('╚════════════════════════════════════════╝'));
37
38
  console.log('\n');
38
39
 
39
- // Prompt user for agent details
40
+ // Prompt user for agent details (simplified - no type selection)
40
41
  const answers = await inquirer.prompt([
41
42
  {
42
43
  type: 'input',
@@ -48,20 +49,9 @@ async function createAgent() {
48
49
  {
49
50
  type: 'input',
50
51
  name: 'description',
51
- message: 'Agent Description:',
52
+ message: 'Agent Description (optional):',
52
53
  default: 'An autonomous agent in the Dactyclaw ecosystem'
53
54
  },
54
- {
55
- type: 'list',
56
- name: 'agentType',
57
- message: 'Agent Type:',
58
- choices: [
59
- { name: 'Monitor Agent (tracks blockchain activity)', value: 'monitor' },
60
- { name: 'Trading Agent (executes trades)', value: 'trading' },
61
- { name: 'Utility Agent (general purpose)', value: 'utility' },
62
- { name: 'Custom Agent', value: 'custom' }
63
- ]
64
- },
65
55
  {
66
56
  type: 'input',
67
57
  name: 'githubUsername',
@@ -69,6 +59,9 @@ async function createAgent() {
69
59
  default: ''
70
60
  }
71
61
  ]);
62
+
63
+ // Set default agent type to 'utility' (can be used for anything)
64
+ answers.agentType = 'utility';
72
65
 
73
66
  const spinner = ora();
74
67
 
@@ -362,7 +355,7 @@ package-lock.json
362
355
  console.log(chalk.white(` Name: ${agentConfig.name}`));
363
356
  console.log(chalk.white(` DNA: ${agentConfig.dna}`));
364
357
  console.log(chalk.white(` Wallet Address: ${wallet.address}`));
365
- console.log(chalk.white(` Type: ${agentConfig.agentType}`));
358
+ console.log(chalk.white(` Type: Utility Agent (flexible for any use)`));
366
359
  console.log(chalk.white(` Network: ${agentConfig.network}`));
367
360
  console.log(chalk.white(` Directory: ${agentDir}`));
368
361
  console.log(chalk.gray('─'.repeat(60)));
@@ -370,18 +363,17 @@ package-lock.json
370
363
 
371
364
  console.log(chalk.cyan('Security Notice:'));
372
365
  console.log(chalk.gray('─'.repeat(60)));
373
- console.log(chalk.yellow(` ⚠️ Your private key is stored in .env file`));
374
- console.log(chalk.yellow(` ⚠️ NEVER commit .env to version control`));
375
- console.log(chalk.yellow(` ⚠️ Keep your private key safe and secure`));
366
+ console.log(chalk.white(` Private key stored in .env (gitignored)`));
367
+ console.log(chalk.white(` Ready to launch token with npx dacty-launch`));
376
368
  console.log(chalk.gray('─'.repeat(60)));
377
369
  console.log('\n');
378
370
 
379
371
  console.log(chalk.cyan('Next Steps:'));
380
372
  console.log(chalk.gray('─'.repeat(60)));
381
373
  console.log(chalk.white(` 1. cd ${path.basename(agentDir)}`));
382
- console.log(chalk.white(` 2. npm install`));
383
- console.log(chalk.white(` 3. npm run dev`));
384
- console.log(chalk.white(` 4. npx dacty-launch (to launch token)`));
374
+ console.log(chalk.white(` 2. npx dacty-launch (to deploy token)`));
375
+ console.log(chalk.white(` 3. Monitor on Clanker.world`));
376
+ console.log(chalk.white(` 4. Earn 80% of trading fees`));
385
377
  console.log(chalk.gray('─'.repeat(60)));
386
378
  console.log('\n');
387
379
 
package/lib/index.mjs CHANGED
@@ -8,6 +8,7 @@ import path from 'path';
8
8
  import { fileURLToPath } from 'url';
9
9
  import { dirname } from 'path';
10
10
  import crypto from 'crypto';
11
+ import { privateKeyToAccount } from 'viem/accounts';
11
12
 
12
13
  const __filename = fileURLToPath(import.meta.url);
13
14
  const __dirname = dirname(__filename);
@@ -19,12 +20,12 @@ function generateDNA() {
19
20
 
20
21
  // Generate wallet (Ethereum-style)
21
22
  function generateWallet() {
22
- const privateKey = crypto.randomBytes(32).toString('hex');
23
+ const privateKey = '0x' + crypto.randomBytes(32).toString('hex');
24
+ // Derive address from private key using viem
25
+ const account = privateKeyToAccount(privateKey);
23
26
  return {
24
- privateKey: '0x' + privateKey,
25
- // Note: In production, derive address from private key using ethers.js
26
- // For now, generate a mock address
27
- address: '0x' + crypto.randomBytes(20).toString('hex')
27
+ privateKey: privateKey,
28
+ address: account.address
28
29
  };
29
30
  }
30
31
 
@@ -36,7 +37,7 @@ async function createAgent() {
36
37
  console.log(chalk.cyan.bold('╚════════════════════════════════════════╝'));
37
38
  console.log('\n');
38
39
 
39
- // Prompt user for agent details
40
+ // Prompt user for agent details (simplified - no type selection)
40
41
  const answers = await inquirer.prompt([
41
42
  {
42
43
  type: 'input',
@@ -48,20 +49,9 @@ async function createAgent() {
48
49
  {
49
50
  type: 'input',
50
51
  name: 'description',
51
- message: 'Agent Description:',
52
+ message: 'Agent Description (optional):',
52
53
  default: 'An autonomous agent in the Dactyclaw ecosystem'
53
54
  },
54
- {
55
- type: 'list',
56
- name: 'agentType',
57
- message: 'Agent Type:',
58
- choices: [
59
- { name: 'Monitor Agent (tracks blockchain activity)', value: 'monitor' },
60
- { name: 'Trading Agent (executes trades)', value: 'trading' },
61
- { name: 'Utility Agent (general purpose)', value: 'utility' },
62
- { name: 'Custom Agent', value: 'custom' }
63
- ]
64
- },
65
55
  {
66
56
  type: 'input',
67
57
  name: 'githubUsername',
@@ -69,6 +59,9 @@ async function createAgent() {
69
59
  default: ''
70
60
  }
71
61
  ]);
62
+
63
+ // Set default agent type to 'utility' (can be used for anything)
64
+ answers.agentType = 'utility';
72
65
 
73
66
  const spinner = ora();
74
67
 
@@ -362,7 +355,7 @@ package-lock.json
362
355
  console.log(chalk.white(` Name: ${agentConfig.name}`));
363
356
  console.log(chalk.white(` DNA: ${agentConfig.dna}`));
364
357
  console.log(chalk.white(` Wallet Address: ${wallet.address}`));
365
- console.log(chalk.white(` Type: ${agentConfig.agentType}`));
358
+ console.log(chalk.white(` Type: Utility Agent (flexible for any use)`));
366
359
  console.log(chalk.white(` Network: ${agentConfig.network}`));
367
360
  console.log(chalk.white(` Directory: ${agentDir}`));
368
361
  console.log(chalk.gray('─'.repeat(60)));
@@ -370,18 +363,17 @@ package-lock.json
370
363
 
371
364
  console.log(chalk.cyan('Security Notice:'));
372
365
  console.log(chalk.gray('─'.repeat(60)));
373
- console.log(chalk.yellow(` ⚠️ Your private key is stored in .env file`));
374
- console.log(chalk.yellow(` ⚠️ NEVER commit .env to version control`));
375
- console.log(chalk.yellow(` ⚠️ Keep your private key safe and secure`));
366
+ console.log(chalk.white(` Private key stored in .env (gitignored)`));
367
+ console.log(chalk.white(` Ready to launch token with npx dacty-launch`));
376
368
  console.log(chalk.gray('─'.repeat(60)));
377
369
  console.log('\n');
378
370
 
379
371
  console.log(chalk.cyan('Next Steps:'));
380
372
  console.log(chalk.gray('─'.repeat(60)));
381
373
  console.log(chalk.white(` 1. cd ${path.basename(agentDir)}`));
382
- console.log(chalk.white(` 2. npm install`));
383
- console.log(chalk.white(` 3. npm run dev`));
384
- console.log(chalk.white(` 4. npx dacty-launch (to launch token)`));
374
+ console.log(chalk.white(` 2. npx dacty-launch (to deploy token)`));
375
+ console.log(chalk.white(` 3. Monitor on Clanker.world`));
376
+ console.log(chalk.white(` 4. Earn 80% of trading fees`));
385
377
  console.log(chalk.gray('─'.repeat(60)));
386
378
  console.log('\n');
387
379
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dacty-create",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Create and deploy agents in the Dactyclaw ecosystem",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,11 +21,12 @@
21
21
  "author": "Dactyclaw",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
+ "axios": "^1.6.5",
24
25
  "chalk": "^5.3.0",
26
+ "dotenv": "^16.3.1",
25
27
  "inquirer": "^9.2.12",
26
28
  "ora": "^8.0.1",
27
- "axios": "^1.6.5",
28
- "dotenv": "^16.3.1"
29
+ "viem": "^2.46.3"
29
30
  },
30
31
  "devDependencies": {
31
32
  "@types/node": "^20.10.5"