dacty-launch 1.3.0 → 1.4.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.
@@ -81,13 +81,16 @@ async function main() {
81
81
 
82
82
  const envContent = fs.readFileSync(envPath, 'utf-8');
83
83
  process.chdir(agentDir); // Change to agent directory for token config save
84
- const privateKeyMatch = envContent.match(/PRIVATE_KEY=(.+)/);
84
+ const privateKeyMatch = envContent.match(/AGENT_PRIVATE_KEY=(.+)/);
85
85
  if (!privateKeyMatch) {
86
- console.error('❌ Error: PRIVATE_KEY not found in .env file!');
86
+ console.error('❌ Error: AGENT_PRIVATE_KEY not found in .env file!');
87
87
  process.exit(1);
88
88
  }
89
89
 
90
- const privateKey = privateKeyMatch[1].trim();
90
+ // Parse private key: remove quotes, trim whitespace
91
+ let privateKey = privateKeyMatch[1].trim();
92
+ privateKey = privateKey.replace(/^["']|["']$/g, ''); // Remove surrounding quotes
93
+ privateKey = privateKey.trim(); // Trim again after removing quotes
91
94
  console.log('✓ Private key loaded from .env\n');
92
95
 
93
96
  // Get token details from user
@@ -100,16 +103,16 @@ async function main() {
100
103
  console.log(` Symbol: ${tokenSymbol}`);
101
104
  console.log(` Supply: ${initialSupply}`);
102
105
  console.log(` Agent Wallet: ${agentConfig.wallet}`);
103
- console.log(` Fee Distribution: 80% Agent, 20% Dactyclaw\n`);
106
+ console.log(` Fee Distribution: 80% Agent, 20% Clanker\n`);
104
107
 
105
- // Dactyclaw wallet address (should be configured)
106
- const DACTYCLAW_WALLET = process.env.DACTYCLAW_WALLET || '0x1eaf444ebDf6495C57aD52A04C61521bBf564ace';
108
+ // Clanker wallet address for fee distribution
109
+ const CLANKER_WALLET = '0x0000000000000000000000000000000000000000'; // Clanker protocol address
107
110
 
108
111
  try {
109
112
  console.log('🔄 Initializing Clanker SDK...');
110
113
 
111
114
  // Setup viem clients
112
- const account = privateKeyToAccount(`0x${privateKey.replace(/^0x/, '')}`);
115
+ const account = privateKeyToAccount(privateKey);
113
116
  const publicClient = createPublicClient({ chain: base, transport: http() });
114
117
  const walletClient = createWalletClient({ account, chain: base, transport: http() });
115
118
 
@@ -125,34 +128,42 @@ async function main() {
125
128
 
126
129
  console.log('\n🚀 Deploying token...');
127
130
 
128
- // Deploy token with 80/20 reward split using correct SDK structure
129
- const tokenAddress = await clanker.deployToken({
131
+ // Deploy token with 80/20 fee split
132
+ // Using Clanker v4 deploy() method with correct token structure
133
+ const { txHash, waitForTransaction } = await clanker.deploy({
130
134
  name: tokenName,
131
135
  symbol: tokenSymbol,
132
- metadata: {
133
- description: `${tokenName} - Created with DACTYCLAW`,
134
- },
135
- context: {
136
- interface: 'DACTYCLAW',
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,
136
+ rewards: {
137
+ recipients: [
138
+ {
139
+ recipient: agentConfig.wallet,
140
+ admin: agentConfig.wallet,
141
+ bps: 8000, // 80% to agent
142
+ token: 'Both', // Receive fees in both tokens
143
+ },
144
+ {
145
+ recipient: CLANKER_WALLET,
146
+ admin: CLANKER_WALLET,
147
+ bps: 2000, // 20% to clanker protocol
148
+ token: 'Both',
149
+ },
150
+ ],
148
151
  },
152
+ vanity: true, // Try to get vanity address with "b07" suffix
149
153
  });
150
154
 
151
- if (!tokenAddress) {
152
- console.error(' Deployment error: No token address returned');
155
+ console.log(`✓ Transaction submitted: ${txHash}`);
156
+ console.log(' Waiting for confirmation...\n');
157
+
158
+ const result = await waitForTransaction();
159
+
160
+ if (result.error) {
161
+ console.error('❌ Deployment error:', result.error);
153
162
  process.exit(1);
154
163
  }
155
164
 
165
+ const tokenAddress = result.address;
166
+
156
167
  console.log('✅ Token deployed successfully!');
157
168
  console.log(`\n📊 Token Details:`);
158
169
  console.log(` Address: ${tokenAddress}`);
@@ -164,7 +175,7 @@ async function main() {
164
175
 
165
176
  console.log(`\n💰 Fee Distribution:`);
166
177
  console.log(` Agent (${agentConfig.wallet}): 80%`);
167
- console.log(` Dactyclaw: 20%`);
178
+ console.log(` Clanker Protocol: 20%`);
168
179
 
169
180
  // Save token configuration
170
181
  const tokenConfig = {
@@ -178,7 +189,7 @@ async function main() {
178
189
  agentWallet: agentConfig.wallet,
179
190
  fees: {
180
191
  agent: 80,
181
- dactyclaw: 20,
192
+ clanker: 20,
182
193
  },
183
194
  };
184
195
 
@@ -211,6 +222,9 @@ async function main() {
211
222
  rl.close();
212
223
  } catch (error) {
213
224
  console.error('❌ Error:', error.message);
225
+ if (error.message.includes('invalid private key')) {
226
+ console.error(' Hint: Check that AGENT_PRIVATE_KEY in .env is valid and properly formatted');
227
+ }
214
228
  rl.close();
215
229
  process.exit(1);
216
230
  }
package/lib/index.mjs CHANGED
@@ -81,13 +81,16 @@ async function main() {
81
81
 
82
82
  const envContent = fs.readFileSync(envPath, 'utf-8');
83
83
  process.chdir(agentDir); // Change to agent directory for token config save
84
- const privateKeyMatch = envContent.match(/PRIVATE_KEY=(.+)/);
84
+ const privateKeyMatch = envContent.match(/AGENT_PRIVATE_KEY=(.+)/);
85
85
  if (!privateKeyMatch) {
86
- console.error('❌ Error: PRIVATE_KEY not found in .env file!');
86
+ console.error('❌ Error: AGENT_PRIVATE_KEY not found in .env file!');
87
87
  process.exit(1);
88
88
  }
89
89
 
90
- const privateKey = privateKeyMatch[1].trim();
90
+ // Parse private key: remove quotes, trim whitespace
91
+ let privateKey = privateKeyMatch[1].trim();
92
+ privateKey = privateKey.replace(/^["']|["']$/g, ''); // Remove surrounding quotes
93
+ privateKey = privateKey.trim(); // Trim again after removing quotes
91
94
  console.log('✓ Private key loaded from .env\n');
92
95
 
93
96
  // Get token details from user
@@ -100,16 +103,16 @@ async function main() {
100
103
  console.log(` Symbol: ${tokenSymbol}`);
101
104
  console.log(` Supply: ${initialSupply}`);
102
105
  console.log(` Agent Wallet: ${agentConfig.wallet}`);
103
- console.log(` Fee Distribution: 80% Agent, 20% Dactyclaw\n`);
106
+ console.log(` Fee Distribution: 80% Agent, 20% Clanker\n`);
104
107
 
105
- // Dactyclaw wallet address (should be configured)
106
- const DACTYCLAW_WALLET = process.env.DACTYCLAW_WALLET || '0x1eaf444ebDf6495C57aD52A04C61521bBf564ace';
108
+ // Clanker wallet address for fee distribution
109
+ const CLANKER_WALLET = '0x0000000000000000000000000000000000000000'; // Clanker protocol address
107
110
 
108
111
  try {
109
112
  console.log('🔄 Initializing Clanker SDK...');
110
113
 
111
114
  // Setup viem clients
112
- const account = privateKeyToAccount(`0x${privateKey.replace(/^0x/, '')}`);
115
+ const account = privateKeyToAccount(privateKey);
113
116
  const publicClient = createPublicClient({ chain: base, transport: http() });
114
117
  const walletClient = createWalletClient({ account, chain: base, transport: http() });
115
118
 
@@ -125,34 +128,42 @@ async function main() {
125
128
 
126
129
  console.log('\n🚀 Deploying token...');
127
130
 
128
- // Deploy token with 80/20 reward split using correct SDK structure
129
- const tokenAddress = await clanker.deployToken({
131
+ // Deploy token with 80/20 fee split
132
+ // Using Clanker v4 deploy() method with correct token structure
133
+ const { txHash, waitForTransaction } = await clanker.deploy({
130
134
  name: tokenName,
131
135
  symbol: tokenSymbol,
132
- metadata: {
133
- description: `${tokenName} - Created with DACTYCLAW`,
134
- },
135
- context: {
136
- interface: 'DACTYCLAW',
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,
136
+ rewards: {
137
+ recipients: [
138
+ {
139
+ recipient: agentConfig.wallet,
140
+ admin: agentConfig.wallet,
141
+ bps: 8000, // 80% to agent
142
+ token: 'Both', // Receive fees in both tokens
143
+ },
144
+ {
145
+ recipient: CLANKER_WALLET,
146
+ admin: CLANKER_WALLET,
147
+ bps: 2000, // 20% to clanker protocol
148
+ token: 'Both',
149
+ },
150
+ ],
148
151
  },
152
+ vanity: true, // Try to get vanity address with "b07" suffix
149
153
  });
150
154
 
151
- if (!tokenAddress) {
152
- console.error(' Deployment error: No token address returned');
155
+ console.log(`✓ Transaction submitted: ${txHash}`);
156
+ console.log(' Waiting for confirmation...\n');
157
+
158
+ const result = await waitForTransaction();
159
+
160
+ if (result.error) {
161
+ console.error('❌ Deployment error:', result.error);
153
162
  process.exit(1);
154
163
  }
155
164
 
165
+ const tokenAddress = result.address;
166
+
156
167
  console.log('✅ Token deployed successfully!');
157
168
  console.log(`\n📊 Token Details:`);
158
169
  console.log(` Address: ${tokenAddress}`);
@@ -164,7 +175,7 @@ async function main() {
164
175
 
165
176
  console.log(`\n💰 Fee Distribution:`);
166
177
  console.log(` Agent (${agentConfig.wallet}): 80%`);
167
- console.log(` Dactyclaw: 20%`);
178
+ console.log(` Clanker Protocol: 20%`);
168
179
 
169
180
  // Save token configuration
170
181
  const tokenConfig = {
@@ -178,7 +189,7 @@ async function main() {
178
189
  agentWallet: agentConfig.wallet,
179
190
  fees: {
180
191
  agent: 80,
181
- dactyclaw: 20,
192
+ clanker: 20,
182
193
  },
183
194
  };
184
195
 
@@ -211,6 +222,9 @@ async function main() {
211
222
  rl.close();
212
223
  } catch (error) {
213
224
  console.error('❌ Error:', error.message);
225
+ if (error.message.includes('invalid private key')) {
226
+ console.error(' Hint: Check that AGENT_PRIVATE_KEY in .env is valid and properly formatted');
227
+ }
214
228
  rl.close();
215
229
  process.exit(1);
216
230
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dacty-launch",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Launch tokens for agents in the Dactyclaw ecosystem",
5
5
  "type": "module",
6
6
  "bin": {