dacty-launch 1.4.4 ā 1.5.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/bin/dacty-launch.mjs +69 -80
- package/lib/index.mjs +69 -80
- package/package.json +1 -1
package/bin/dacty-launch.mjs
CHANGED
|
@@ -4,22 +4,7 @@ import fs from 'fs';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import readline from 'readline';
|
|
7
|
-
import
|
|
8
|
-
import { createWalletClient, createPublicClient, http } from 'viem';
|
|
9
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
10
|
-
import { base } from 'viem/chains';
|
|
11
|
-
|
|
12
|
-
// Polyfill fetch for Node.js if not available
|
|
13
|
-
if (typeof globalThis.fetch === 'undefined') {
|
|
14
|
-
try {
|
|
15
|
-
const fetch = await import('node-fetch').then(m => m.default);
|
|
16
|
-
globalThis.fetch = fetch;
|
|
17
|
-
} catch (e) {
|
|
18
|
-
// Fallback: use undici if node-fetch not available
|
|
19
|
-
const { fetch: undiciFetch } = await import('undici');
|
|
20
|
-
globalThis.fetch = undiciFetch;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
7
|
+
import crypto from 'crypto';
|
|
23
8
|
|
|
24
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
25
10
|
const __dirname = path.dirname(__filename);
|
|
@@ -113,80 +98,86 @@ async function main() {
|
|
|
113
98
|
const initialSupply = '1000000000'; // Default supply
|
|
114
99
|
|
|
115
100
|
console.log('\nš Configuration:');
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// Clanker protocol addresses (for interface rewards)
|
|
123
|
-
// Using Clanker's official fee recipient
|
|
124
|
-
const CLANKER_INTERFACE_ADMIN = agentConfig.wallet; // Can be agent or clanker
|
|
125
|
-
const CLANKER_INTERFACE_RECIPIENT = agentConfig.wallet; // Clanker fees go to agent for now
|
|
101
|
+
console.log(` Name: ${tokenName}`);
|
|
102
|
+
console.log(` Symbol: ${tokenSymbol}`);
|
|
103
|
+
console.log(` Supply: ${initialSupply}`);
|
|
104
|
+
console.log(` Agent Wallet: ${agentConfig.wallet}`);
|
|
105
|
+
console.log(` Fee Distribution: 80% Agent, 20% Clanker\n`);
|
|
126
106
|
|
|
127
107
|
try {
|
|
128
|
-
console.log('
|
|
129
|
-
|
|
130
|
-
//
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
108
|
+
console.log('š Deploying token via Clanker API...');
|
|
109
|
+
|
|
110
|
+
// Generate unique request key
|
|
111
|
+
const requestKey = crypto.randomBytes(16).toString('hex');
|
|
112
|
+
|
|
113
|
+
// Prepare deployment payload according to Clanker v4 API spec
|
|
114
|
+
const deploymentPayload = {
|
|
115
|
+
token: {
|
|
116
|
+
name: tokenName,
|
|
117
|
+
symbol: tokenSymbol,
|
|
118
|
+
tokenAdmin: agentConfig.wallet,
|
|
119
|
+
description: `${tokenName} - Created with DACTYCLAW`,
|
|
120
|
+
requestKey: requestKey,
|
|
121
|
+
},
|
|
122
|
+
rewards: [
|
|
123
|
+
{
|
|
124
|
+
admin: agentConfig.wallet,
|
|
125
|
+
recipient: agentConfig.wallet,
|
|
126
|
+
allocation: 80,
|
|
127
|
+
rewardsToken: 'Both',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
admin: '0x0000000000000000000000000000000000000000',
|
|
131
|
+
recipient: '0x0000000000000000000000000000000000000000',
|
|
132
|
+
allocation: 20,
|
|
133
|
+
rewardsToken: 'Both',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
pool: {
|
|
137
|
+
type: 'standard',
|
|
138
|
+
pairedToken: '0x4200000000000000000000000000000000000006', // WETH on Base
|
|
139
|
+
initialMarketCap: 10,
|
|
140
|
+
},
|
|
141
|
+
fees: {
|
|
142
|
+
type: 'static',
|
|
143
|
+
clankerFee: 1,
|
|
144
|
+
pairedFee: 1,
|
|
145
|
+
},
|
|
146
|
+
chainId: 8453, // Base network
|
|
147
|
+
};
|
|
146
148
|
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
rewards: {
|
|
154
|
-
recipients: [
|
|
155
|
-
{
|
|
156
|
-
recipient: agentConfig.wallet,
|
|
157
|
-
admin: agentConfig.wallet,
|
|
158
|
-
bps: 8000, // 80% to agent (basis points: 10000 = 100%)
|
|
159
|
-
token: 'Both', // Receive fees in both tokens
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
recipient: CLANKER_INTERFACE_RECIPIENT,
|
|
163
|
-
admin: CLANKER_INTERFACE_ADMIN,
|
|
164
|
-
bps: 2000, // 20% to clanker protocol
|
|
165
|
-
token: 'Both',
|
|
166
|
-
},
|
|
167
|
-
],
|
|
149
|
+
// Call Clanker API
|
|
150
|
+
const response = await fetch('https://www.clanker.world/api/tokens/deploy', {
|
|
151
|
+
method: 'POST',
|
|
152
|
+
headers: {
|
|
153
|
+
'Content-Type': 'application/json',
|
|
154
|
+
'x-api-key': 'public', // Public endpoint doesn't require API key
|
|
168
155
|
},
|
|
169
|
-
|
|
156
|
+
body: JSON.stringify(deploymentPayload),
|
|
170
157
|
});
|
|
171
158
|
|
|
172
|
-
|
|
173
|
-
console.log('ā³ Waiting for confirmation...\n');
|
|
159
|
+
const result = await response.json();
|
|
174
160
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
161
|
+
if (!response.ok || !result.success) {
|
|
162
|
+
console.error('ā Deployment error:');
|
|
163
|
+
if (result.data) {
|
|
164
|
+
result.data.forEach(err => {
|
|
165
|
+
console.error(` - ${err.path?.join('.')}: ${err.message}`);
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
console.error(` ${result.error || result.message || 'Unknown error'}`);
|
|
169
|
+
}
|
|
179
170
|
process.exit(1);
|
|
180
171
|
}
|
|
181
172
|
|
|
182
|
-
const tokenAddress = result.
|
|
173
|
+
const tokenAddress = result.expectedAddress;
|
|
183
174
|
|
|
184
|
-
console.log('ā
Token
|
|
175
|
+
console.log('ā
Token deployment enqueued!');
|
|
185
176
|
console.log(`\nš Token Details:`);
|
|
186
|
-
console.log(` Address: ${tokenAddress}`);
|
|
187
177
|
console.log(` Name: ${tokenName}`);
|
|
188
178
|
console.log(` Symbol: ${tokenSymbol}`);
|
|
189
179
|
console.log(` Supply: ${initialSupply}`);
|
|
180
|
+
console.log(` Expected Address: ${tokenAddress}`);
|
|
190
181
|
console.log(` Network: Base`);
|
|
191
182
|
console.log(` Explorer: https://basescan.org/token/${tokenAddress}`);
|
|
192
183
|
|
|
@@ -208,6 +199,7 @@ async function main() {
|
|
|
208
199
|
agent: 80,
|
|
209
200
|
clanker: 20,
|
|
210
201
|
},
|
|
202
|
+
requestKey: requestKey,
|
|
211
203
|
};
|
|
212
204
|
|
|
213
205
|
fs.writeFileSync(
|
|
@@ -239,11 +231,8 @@ async function main() {
|
|
|
239
231
|
rl.close();
|
|
240
232
|
} catch (error) {
|
|
241
233
|
console.error('ā Error:', error.message);
|
|
242
|
-
if (
|
|
243
|
-
console.error('
|
|
244
|
-
error.forEach(e => console.error(` - ${e.path?.join('.')}: ${e.message}`));
|
|
245
|
-
} else if (error.message.includes('invalid private key')) {
|
|
246
|
-
console.error(' Hint: Check that AGENT_PRIVATE_KEY in .env is valid and properly formatted');
|
|
234
|
+
if (error.message.includes('fetch')) {
|
|
235
|
+
console.error(' Hint: Network error. Check your internet connection.');
|
|
247
236
|
}
|
|
248
237
|
rl.close();
|
|
249
238
|
process.exit(1);
|
package/lib/index.mjs
CHANGED
|
@@ -4,22 +4,7 @@ import fs from 'fs';
|
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import readline from 'readline';
|
|
7
|
-
import
|
|
8
|
-
import { createWalletClient, createPublicClient, http } from 'viem';
|
|
9
|
-
import { privateKeyToAccount } from 'viem/accounts';
|
|
10
|
-
import { base } from 'viem/chains';
|
|
11
|
-
|
|
12
|
-
// Polyfill fetch for Node.js if not available
|
|
13
|
-
if (typeof globalThis.fetch === 'undefined') {
|
|
14
|
-
try {
|
|
15
|
-
const fetch = await import('node-fetch').then(m => m.default);
|
|
16
|
-
globalThis.fetch = fetch;
|
|
17
|
-
} catch (e) {
|
|
18
|
-
// Fallback: use undici if node-fetch not available
|
|
19
|
-
const { fetch: undiciFetch } = await import('undici');
|
|
20
|
-
globalThis.fetch = undiciFetch;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
7
|
+
import crypto from 'crypto';
|
|
23
8
|
|
|
24
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
25
10
|
const __dirname = path.dirname(__filename);
|
|
@@ -113,80 +98,86 @@ async function main() {
|
|
|
113
98
|
const initialSupply = '1000000000'; // Default supply
|
|
114
99
|
|
|
115
100
|
console.log('\nš Configuration:');
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// Clanker protocol addresses (for interface rewards)
|
|
123
|
-
// Using Clanker's official fee recipient
|
|
124
|
-
const CLANKER_INTERFACE_ADMIN = agentConfig.wallet; // Can be agent or clanker
|
|
125
|
-
const CLANKER_INTERFACE_RECIPIENT = agentConfig.wallet; // Clanker fees go to agent for now
|
|
101
|
+
console.log(` Name: ${tokenName}`);
|
|
102
|
+
console.log(` Symbol: ${tokenSymbol}`);
|
|
103
|
+
console.log(` Supply: ${initialSupply}`);
|
|
104
|
+
console.log(` Agent Wallet: ${agentConfig.wallet}`);
|
|
105
|
+
console.log(` Fee Distribution: 80% Agent, 20% Clanker\n`);
|
|
126
106
|
|
|
127
107
|
try {
|
|
128
|
-
console.log('
|
|
129
|
-
|
|
130
|
-
//
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
108
|
+
console.log('š Deploying token via Clanker API...');
|
|
109
|
+
|
|
110
|
+
// Generate unique request key
|
|
111
|
+
const requestKey = crypto.randomBytes(16).toString('hex');
|
|
112
|
+
|
|
113
|
+
// Prepare deployment payload according to Clanker v4 API spec
|
|
114
|
+
const deploymentPayload = {
|
|
115
|
+
token: {
|
|
116
|
+
name: tokenName,
|
|
117
|
+
symbol: tokenSymbol,
|
|
118
|
+
tokenAdmin: agentConfig.wallet,
|
|
119
|
+
description: `${tokenName} - Created with DACTYCLAW`,
|
|
120
|
+
requestKey: requestKey,
|
|
121
|
+
},
|
|
122
|
+
rewards: [
|
|
123
|
+
{
|
|
124
|
+
admin: agentConfig.wallet,
|
|
125
|
+
recipient: agentConfig.wallet,
|
|
126
|
+
allocation: 80,
|
|
127
|
+
rewardsToken: 'Both',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
admin: '0x0000000000000000000000000000000000000000',
|
|
131
|
+
recipient: '0x0000000000000000000000000000000000000000',
|
|
132
|
+
allocation: 20,
|
|
133
|
+
rewardsToken: 'Both',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
pool: {
|
|
137
|
+
type: 'standard',
|
|
138
|
+
pairedToken: '0x4200000000000000000000000000000000000006', // WETH on Base
|
|
139
|
+
initialMarketCap: 10,
|
|
140
|
+
},
|
|
141
|
+
fees: {
|
|
142
|
+
type: 'static',
|
|
143
|
+
clankerFee: 1,
|
|
144
|
+
pairedFee: 1,
|
|
145
|
+
},
|
|
146
|
+
chainId: 8453, // Base network
|
|
147
|
+
};
|
|
146
148
|
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
rewards: {
|
|
154
|
-
recipients: [
|
|
155
|
-
{
|
|
156
|
-
recipient: agentConfig.wallet,
|
|
157
|
-
admin: agentConfig.wallet,
|
|
158
|
-
bps: 8000, // 80% to agent (basis points: 10000 = 100%)
|
|
159
|
-
token: 'Both', // Receive fees in both tokens
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
recipient: CLANKER_INTERFACE_RECIPIENT,
|
|
163
|
-
admin: CLANKER_INTERFACE_ADMIN,
|
|
164
|
-
bps: 2000, // 20% to clanker protocol
|
|
165
|
-
token: 'Both',
|
|
166
|
-
},
|
|
167
|
-
],
|
|
149
|
+
// Call Clanker API
|
|
150
|
+
const response = await fetch('https://www.clanker.world/api/tokens/deploy', {
|
|
151
|
+
method: 'POST',
|
|
152
|
+
headers: {
|
|
153
|
+
'Content-Type': 'application/json',
|
|
154
|
+
'x-api-key': 'public', // Public endpoint doesn't require API key
|
|
168
155
|
},
|
|
169
|
-
|
|
156
|
+
body: JSON.stringify(deploymentPayload),
|
|
170
157
|
});
|
|
171
158
|
|
|
172
|
-
|
|
173
|
-
console.log('ā³ Waiting for confirmation...\n');
|
|
159
|
+
const result = await response.json();
|
|
174
160
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
161
|
+
if (!response.ok || !result.success) {
|
|
162
|
+
console.error('ā Deployment error:');
|
|
163
|
+
if (result.data) {
|
|
164
|
+
result.data.forEach(err => {
|
|
165
|
+
console.error(` - ${err.path?.join('.')}: ${err.message}`);
|
|
166
|
+
});
|
|
167
|
+
} else {
|
|
168
|
+
console.error(` ${result.error || result.message || 'Unknown error'}`);
|
|
169
|
+
}
|
|
179
170
|
process.exit(1);
|
|
180
171
|
}
|
|
181
172
|
|
|
182
|
-
const tokenAddress = result.
|
|
173
|
+
const tokenAddress = result.expectedAddress;
|
|
183
174
|
|
|
184
|
-
console.log('ā
Token
|
|
175
|
+
console.log('ā
Token deployment enqueued!');
|
|
185
176
|
console.log(`\nš Token Details:`);
|
|
186
|
-
console.log(` Address: ${tokenAddress}`);
|
|
187
177
|
console.log(` Name: ${tokenName}`);
|
|
188
178
|
console.log(` Symbol: ${tokenSymbol}`);
|
|
189
179
|
console.log(` Supply: ${initialSupply}`);
|
|
180
|
+
console.log(` Expected Address: ${tokenAddress}`);
|
|
190
181
|
console.log(` Network: Base`);
|
|
191
182
|
console.log(` Explorer: https://basescan.org/token/${tokenAddress}`);
|
|
192
183
|
|
|
@@ -208,6 +199,7 @@ async function main() {
|
|
|
208
199
|
agent: 80,
|
|
209
200
|
clanker: 20,
|
|
210
201
|
},
|
|
202
|
+
requestKey: requestKey,
|
|
211
203
|
};
|
|
212
204
|
|
|
213
205
|
fs.writeFileSync(
|
|
@@ -239,11 +231,8 @@ async function main() {
|
|
|
239
231
|
rl.close();
|
|
240
232
|
} catch (error) {
|
|
241
233
|
console.error('ā Error:', error.message);
|
|
242
|
-
if (
|
|
243
|
-
console.error('
|
|
244
|
-
error.forEach(e => console.error(` - ${e.path?.join('.')}: ${e.message}`));
|
|
245
|
-
} else if (error.message.includes('invalid private key')) {
|
|
246
|
-
console.error(' Hint: Check that AGENT_PRIVATE_KEY in .env is valid and properly formatted');
|
|
234
|
+
if (error.message.includes('fetch')) {
|
|
235
|
+
console.error(' Hint: Network error. Check your internet connection.');
|
|
247
236
|
}
|
|
248
237
|
rl.close();
|
|
249
238
|
process.exit(1);
|