dacty-launch 1.4.4 → 1.4.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.
@@ -9,16 +9,10 @@ import { createWalletClient, createPublicClient, http } from 'viem';
9
9
  import { privateKeyToAccount } from 'viem/accounts';
10
10
  import { base } from 'viem/chains';
11
11
 
12
- // Polyfill fetch for Node.js if not available
12
+ // Polyfill fetch for Node.js - use undici
13
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
- }
14
+ const { fetch: undiciFetch } = await import('undici');
15
+ globalThis.fetch = undiciFetch;
22
16
  }
23
17
 
24
18
  const __filename = fileURLToPath(import.meta.url);
@@ -127,15 +121,23 @@ async function main() {
127
121
  try {
128
122
  console.log('🔄 Initializing Clanker SDK...');
129
123
 
130
- // Setup viem clients
124
+ // Setup viem clients with explicit fetch
131
125
  const account = privateKeyToAccount(privateKey);
132
- const publicClient = createPublicClient({ chain: base, transport: http() });
133
- const walletClient = createWalletClient({ account, chain: base, transport: http() });
126
+ const publicClient = createPublicClient({
127
+ chain: base,
128
+ transport: http(undefined, { fetch: globalThis.fetch })
129
+ });
130
+ const walletClient = createWalletClient({
131
+ account,
132
+ chain: base,
133
+ transport: http(undefined, { fetch: globalThis.fetch })
134
+ });
134
135
 
135
136
  // Initialize Clanker SDK
136
137
  const clanker = new Clanker({
137
138
  publicClient,
138
139
  wallet: walletClient,
140
+ fetch: globalThis.fetch,
139
141
  });
140
142
 
141
143
  console.log('✓ Clanker SDK initialized');
package/lib/index.mjs CHANGED
@@ -9,16 +9,10 @@ import { createWalletClient, createPublicClient, http } from 'viem';
9
9
  import { privateKeyToAccount } from 'viem/accounts';
10
10
  import { base } from 'viem/chains';
11
11
 
12
- // Polyfill fetch for Node.js if not available
12
+ // Polyfill fetch for Node.js - use undici
13
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
- }
14
+ const { fetch: undiciFetch } = await import('undici');
15
+ globalThis.fetch = undiciFetch;
22
16
  }
23
17
 
24
18
  const __filename = fileURLToPath(import.meta.url);
@@ -127,15 +121,23 @@ async function main() {
127
121
  try {
128
122
  console.log('🔄 Initializing Clanker SDK...');
129
123
 
130
- // Setup viem clients
124
+ // Setup viem clients with explicit fetch
131
125
  const account = privateKeyToAccount(privateKey);
132
- const publicClient = createPublicClient({ chain: base, transport: http() });
133
- const walletClient = createWalletClient({ account, chain: base, transport: http() });
126
+ const publicClient = createPublicClient({
127
+ chain: base,
128
+ transport: http(undefined, { fetch: globalThis.fetch })
129
+ });
130
+ const walletClient = createWalletClient({
131
+ account,
132
+ chain: base,
133
+ transport: http(undefined, { fetch: globalThis.fetch })
134
+ });
134
135
 
135
136
  // Initialize Clanker SDK
136
137
  const clanker = new Clanker({
137
138
  publicClient,
138
139
  wallet: walletClient,
140
+ fetch: globalThis.fetch,
139
141
  });
140
142
 
141
143
  console.log('✓ Clanker SDK initialized');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dacty-launch",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "Launch tokens for agents in the Dactyclaw ecosystem",
5
5
  "type": "module",
6
6
  "bin": {