dacty-launch 1.1.6 → 1.3.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 CHANGED
@@ -40,10 +40,10 @@ npx dacty-launch
40
40
 
41
41
  The CLI will prompt you for:
42
42
 
43
- 1. **Agent DNA** - The DNA of your agent (from `npx dacty-create`)
44
- 2. **Token Name** - The name of your token
45
- 3. **Token Symbol** - The symbol (3-10 characters)
46
- 4. **Total Supply** - Initial token supply (e.g., 1000000000)
43
+ 1. **Token Name** - The name of your token
44
+ 2. **Token Symbol** - The symbol (3-10 characters)
45
+
46
+ Initial supply defaults to 1,000,000,000 tokens.
47
47
 
48
48
  ## Workflow
49
49
 
@@ -63,9 +63,9 @@ npx dacty-launch
63
63
 
64
64
  1. **Loads agent configuration** from `agent.config.json`
65
65
  2. **Reads private key** from `.env` file
66
- 3. **Signs transaction** with private key
67
- 4. **Calls Clanker API** to deploy token
68
- 5. **Configures fee distribution** (80/20 split)
66
+ 3. **Initializes Clanker SDK** with viem wallet
67
+ 4. **Calls deployToken()** with correct rewardsConfig structure
68
+ 5. **Configures fee distribution** (80% Agent, 20% Dactyclaw)
69
69
  6. **Returns token address** and deployment details
70
70
 
71
71
  ## Fee Distribution
@@ -25,15 +25,41 @@ function question(prompt) {
25
25
  });
26
26
  }
27
27
 
28
+ // Find agent.config.json in current directory or subdirectories
29
+ function findAgentConfig(startPath = process.cwd()) {
30
+ // Check current directory first
31
+ const currentPath = path.join(startPath, 'agent.config.json');
32
+ if (fs.existsSync(currentPath)) {
33
+ return currentPath;
34
+ }
35
+
36
+ // Check subdirectories (one level deep)
37
+ try {
38
+ const entries = fs.readdirSync(startPath, { withFileTypes: true });
39
+ for (const entry of entries) {
40
+ if (entry.isDirectory() && !entry.name.startsWith('.')) {
41
+ const subPath = path.join(startPath, entry.name, 'agent.config.json');
42
+ if (fs.existsSync(subPath)) {
43
+ return subPath;
44
+ }
45
+ }
46
+ }
47
+ } catch (error) {
48
+ // Ignore read errors
49
+ }
50
+
51
+ return null;
52
+ }
53
+
28
54
  async function main() {
29
55
  console.log('\n╔═══════════════════════════════════════╗');
30
56
  console.log('║ DACTYCLAW - Token Launch ║');
31
57
  console.log('║ Powered by Clanker v4.0.0 ║');
32
58
  console.log('╚═══════════════════════════════════════╝\n');
33
59
 
34
- // Check if agent.config.json exists
35
- const agentConfigPath = path.join(process.cwd(), 'agent.config.json');
36
- if (!fs.existsSync(agentConfigPath)) {
60
+ // Find agent.config.json (current dir or subdirectories)
61
+ const agentConfigPath = findAgentConfig();
62
+ if (!agentConfigPath) {
37
63
  console.error('❌ Error: agent.config.json not found!');
38
64
  console.error(' Please run `npx dacty-create` first to create an agent.');
39
65
  process.exit(1);
@@ -44,8 +70,9 @@ async function main() {
44
70
  console.log(`✓ Agent loaded: ${agentConfig.name} (DNA: ${agentConfig.dna})`);
45
71
  console.log(`✓ Wallet: ${agentConfig.wallet}\n`);
46
72
 
47
- // Check if .env exists with private key
48
- const envPath = path.join(process.cwd(), '.env');
73
+ // Check if .env exists with private key (same directory as agent.config.json)
74
+ const agentDir = path.dirname(agentConfigPath);
75
+ const envPath = path.join(agentDir, '.env');
49
76
  if (!fs.existsSync(envPath)) {
50
77
  console.error('❌ Error: .env file not found!');
51
78
  console.error(' Private key should be in .env file.');
@@ -53,6 +80,7 @@ async function main() {
53
80
  }
54
81
 
55
82
  const envContent = fs.readFileSync(envPath, 'utf-8');
83
+ process.chdir(agentDir); // Change to agent directory for token config save
56
84
  const privateKeyMatch = envContent.match(/PRIVATE_KEY=(.+)/);
57
85
  if (!privateKeyMatch) {
58
86
  console.error('❌ Error: PRIVATE_KEY not found in .env file!');
@@ -75,7 +103,7 @@ async function main() {
75
103
  console.log(` Fee Distribution: 80% Agent, 20% Dactyclaw\n`);
76
104
 
77
105
  // Dactyclaw wallet address (should be configured)
78
- const DACTYCLAW_WALLET = process.env.DACTYCLAW_WALLET || '0x0000000000000000000000000000000000000000';
106
+ const DACTYCLAW_WALLET = process.env.DACTYCLAW_WALLET || '0x1eaf444ebDf6495C57aD52A04C61521bBf564ace';
79
107
 
80
108
  try {
81
109
  console.log('🔄 Initializing Clanker SDK...');
@@ -97,58 +125,34 @@ async function main() {
97
125
 
98
126
  console.log('\n🚀 Deploying token...');
99
127
 
100
- // Deploy token with 80/20 reward split
101
- const { txHash, waitForTransaction, error } = await clanker.deploy({
128
+ // Deploy token with 80/20 reward split using correct SDK structure
129
+ const tokenAddress = await clanker.deployToken({
102
130
  name: tokenName,
103
131
  symbol: tokenSymbol,
104
- tokenAdmin: account.address,
105
- vanity: true, // Generate vanity address with "b07" suffix
106
- rewards: {
107
- recipients: [
108
- {
109
- recipient: agentConfig.wallet,
110
- admin: agentConfig.wallet,
111
- bps: 8_000, // 80% of rewards
112
- token: 'Paired', // Take fees in WETH
113
- },
114
- {
115
- recipient: DACTYCLAW_WALLET,
116
- admin: DACTYCLAW_WALLET,
117
- bps: 2_000, // 20% of rewards
118
- token: 'Both', // Take fees in both tokens
119
- },
120
- ],
121
- },
122
- fees: {
123
- type: 'static',
124
- clankerFee: 100, // 1%
125
- pairedFee: 100, // 1%
126
- },
127
132
  metadata: {
128
133
  description: `${tokenName} - Created with DACTYCLAW`,
129
134
  },
130
135
  context: {
131
136
  interface: 'DACTYCLAW',
132
137
  },
138
+ pool: {
139
+ quoteToken: '0x4200000000000000000000000000000000000006', // WETH on Base
140
+ initialMarketCap: '10', // 10 ETH initial market cap
141
+ },
142
+ rewardsConfig: {
143
+ creatorReward: 80, // 80% to agent
144
+ creatorAdmin: agentConfig.wallet,
145
+ creatorRewardRecipient: agentConfig.wallet,
146
+ interfaceAdmin: DACTYCLAW_WALLET,
147
+ interfaceRewardRecipient: DACTYCLAW_WALLET,
148
+ },
133
149
  });
134
150
 
135
- if (error) {
136
- console.error('❌ Deployment error:', error);
137
- process.exit(1);
138
- }
139
-
140
- console.log(`✓ Transaction submitted: ${txHash}`);
141
- console.log('⏳ Waiting for confirmation...\n');
142
-
143
- const result = await waitForTransaction();
144
-
145
- if (result.error) {
146
- console.error('❌ Transaction failed:', result.error);
151
+ if (!tokenAddress) {
152
+ console.error('❌ Deployment error: No token address returned');
147
153
  process.exit(1);
148
154
  }
149
155
 
150
- const tokenAddress = result.address;
151
-
152
156
  console.log('✅ Token deployed successfully!');
153
157
  console.log(`\n📊 Token Details:`);
154
158
  console.log(` Address: ${tokenAddress}`);
@@ -168,7 +172,6 @@ async function main() {
168
172
  symbol: tokenSymbol,
169
173
  address: tokenAddress,
170
174
  supply: initialSupply,
171
- txHash,
172
175
  deployedAt: new Date().toISOString(),
173
176
  network: 'base',
174
177
  agentDNA: agentConfig.dna,
@@ -180,7 +183,7 @@ async function main() {
180
183
  };
181
184
 
182
185
  fs.writeFileSync(
183
- path.join(process.cwd(), 'token.config.json'),
186
+ path.join(agentDir, 'token.config.json'),
184
187
  JSON.stringify(tokenConfig, null, 2)
185
188
  );
186
189
 
package/lib/index.mjs CHANGED
@@ -25,15 +25,41 @@ function question(prompt) {
25
25
  });
26
26
  }
27
27
 
28
+ // Find agent.config.json in current directory or subdirectories
29
+ function findAgentConfig(startPath = process.cwd()) {
30
+ // Check current directory first
31
+ const currentPath = path.join(startPath, 'agent.config.json');
32
+ if (fs.existsSync(currentPath)) {
33
+ return currentPath;
34
+ }
35
+
36
+ // Check subdirectories (one level deep)
37
+ try {
38
+ const entries = fs.readdirSync(startPath, { withFileTypes: true });
39
+ for (const entry of entries) {
40
+ if (entry.isDirectory() && !entry.name.startsWith('.')) {
41
+ const subPath = path.join(startPath, entry.name, 'agent.config.json');
42
+ if (fs.existsSync(subPath)) {
43
+ return subPath;
44
+ }
45
+ }
46
+ }
47
+ } catch (error) {
48
+ // Ignore read errors
49
+ }
50
+
51
+ return null;
52
+ }
53
+
28
54
  async function main() {
29
55
  console.log('\n╔═══════════════════════════════════════╗');
30
56
  console.log('║ DACTYCLAW - Token Launch ║');
31
57
  console.log('║ Powered by Clanker v4.0.0 ║');
32
58
  console.log('╚═══════════════════════════════════════╝\n');
33
59
 
34
- // Check if agent.config.json exists
35
- const agentConfigPath = path.join(process.cwd(), 'agent.config.json');
36
- if (!fs.existsSync(agentConfigPath)) {
60
+ // Find agent.config.json (current dir or subdirectories)
61
+ const agentConfigPath = findAgentConfig();
62
+ if (!agentConfigPath) {
37
63
  console.error('❌ Error: agent.config.json not found!');
38
64
  console.error(' Please run `npx dacty-create` first to create an agent.');
39
65
  process.exit(1);
@@ -44,8 +70,9 @@ async function main() {
44
70
  console.log(`✓ Agent loaded: ${agentConfig.name} (DNA: ${agentConfig.dna})`);
45
71
  console.log(`✓ Wallet: ${agentConfig.wallet}\n`);
46
72
 
47
- // Check if .env exists with private key
48
- const envPath = path.join(process.cwd(), '.env');
73
+ // Check if .env exists with private key (same directory as agent.config.json)
74
+ const agentDir = path.dirname(agentConfigPath);
75
+ const envPath = path.join(agentDir, '.env');
49
76
  if (!fs.existsSync(envPath)) {
50
77
  console.error('❌ Error: .env file not found!');
51
78
  console.error(' Private key should be in .env file.');
@@ -53,6 +80,7 @@ async function main() {
53
80
  }
54
81
 
55
82
  const envContent = fs.readFileSync(envPath, 'utf-8');
83
+ process.chdir(agentDir); // Change to agent directory for token config save
56
84
  const privateKeyMatch = envContent.match(/PRIVATE_KEY=(.+)/);
57
85
  if (!privateKeyMatch) {
58
86
  console.error('❌ Error: PRIVATE_KEY not found in .env file!');
@@ -75,7 +103,7 @@ async function main() {
75
103
  console.log(` Fee Distribution: 80% Agent, 20% Dactyclaw\n`);
76
104
 
77
105
  // Dactyclaw wallet address (should be configured)
78
- const DACTYCLAW_WALLET = process.env.DACTYCLAW_WALLET || '0x0000000000000000000000000000000000000000';
106
+ const DACTYCLAW_WALLET = process.env.DACTYCLAW_WALLET || '0x1eaf444ebDf6495C57aD52A04C61521bBf564ace';
79
107
 
80
108
  try {
81
109
  console.log('🔄 Initializing Clanker SDK...');
@@ -97,58 +125,34 @@ async function main() {
97
125
 
98
126
  console.log('\n🚀 Deploying token...');
99
127
 
100
- // Deploy token with 80/20 reward split
101
- const { txHash, waitForTransaction, error } = await clanker.deploy({
128
+ // Deploy token with 80/20 reward split using correct SDK structure
129
+ const tokenAddress = await clanker.deployToken({
102
130
  name: tokenName,
103
131
  symbol: tokenSymbol,
104
- tokenAdmin: account.address,
105
- vanity: true, // Generate vanity address with "b07" suffix
106
- rewards: {
107
- recipients: [
108
- {
109
- recipient: agentConfig.wallet,
110
- admin: agentConfig.wallet,
111
- bps: 8_000, // 80% of rewards
112
- token: 'Paired', // Take fees in WETH
113
- },
114
- {
115
- recipient: DACTYCLAW_WALLET,
116
- admin: DACTYCLAW_WALLET,
117
- bps: 2_000, // 20% of rewards
118
- token: 'Both', // Take fees in both tokens
119
- },
120
- ],
121
- },
122
- fees: {
123
- type: 'static',
124
- clankerFee: 100, // 1%
125
- pairedFee: 100, // 1%
126
- },
127
132
  metadata: {
128
133
  description: `${tokenName} - Created with DACTYCLAW`,
129
134
  },
130
135
  context: {
131
136
  interface: 'DACTYCLAW',
132
137
  },
138
+ pool: {
139
+ quoteToken: '0x4200000000000000000000000000000000000006', // WETH on Base
140
+ initialMarketCap: '10', // 10 ETH initial market cap
141
+ },
142
+ rewardsConfig: {
143
+ creatorReward: 80, // 80% to agent
144
+ creatorAdmin: agentConfig.wallet,
145
+ creatorRewardRecipient: agentConfig.wallet,
146
+ interfaceAdmin: DACTYCLAW_WALLET,
147
+ interfaceRewardRecipient: DACTYCLAW_WALLET,
148
+ },
133
149
  });
134
150
 
135
- if (error) {
136
- console.error('❌ Deployment error:', error);
137
- process.exit(1);
138
- }
139
-
140
- console.log(`✓ Transaction submitted: ${txHash}`);
141
- console.log('⏳ Waiting for confirmation...\n');
142
-
143
- const result = await waitForTransaction();
144
-
145
- if (result.error) {
146
- console.error('❌ Transaction failed:', result.error);
151
+ if (!tokenAddress) {
152
+ console.error('❌ Deployment error: No token address returned');
147
153
  process.exit(1);
148
154
  }
149
155
 
150
- const tokenAddress = result.address;
151
-
152
156
  console.log('✅ Token deployed successfully!');
153
157
  console.log(`\n📊 Token Details:`);
154
158
  console.log(` Address: ${tokenAddress}`);
@@ -168,7 +172,6 @@ async function main() {
168
172
  symbol: tokenSymbol,
169
173
  address: tokenAddress,
170
174
  supply: initialSupply,
171
- txHash,
172
175
  deployedAt: new Date().toISOString(),
173
176
  network: 'base',
174
177
  agentDNA: agentConfig.dna,
@@ -180,7 +183,7 @@ async function main() {
180
183
  };
181
184
 
182
185
  fs.writeFileSync(
183
- path.join(process.cwd(), 'token.config.json'),
186
+ path.join(agentDir, 'token.config.json'),
184
187
  JSON.stringify(tokenConfig, null, 2)
185
188
  );
186
189
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dacty-launch",
3
- "version": "1.1.6",
3
+ "version": "1.3.0",
4
4
  "description": "Launch tokens for agents in the Dactyclaw ecosystem",
5
5
  "type": "module",
6
6
  "bin": {