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.
- package/bin/dacty-launch.mjs +14 -12
- package/lib/index.mjs +14 -12
- package/package.json +1 -1
package/bin/dacty-launch.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
|
|
12
|
+
// Polyfill fetch for Node.js - use undici
|
|
13
13
|
if (typeof globalThis.fetch === 'undefined') {
|
|
14
|
-
|
|
15
|
-
|
|
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({
|
|
133
|
-
|
|
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
|
|
12
|
+
// Polyfill fetch for Node.js - use undici
|
|
13
13
|
if (typeof globalThis.fetch === 'undefined') {
|
|
14
|
-
|
|
15
|
-
|
|
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({
|
|
133
|
-
|
|
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');
|