-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexplore-wallets.cjs
More file actions
89 lines (75 loc) · 2.91 KB
/
explore-wallets.cjs
File metadata and controls
89 lines (75 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const puppeteer = require('puppeteer');
const fs = require('fs');
const CONTRACT = '8oCRS5SYaf4t5PGnCeQfpV7rjxGCcGqNDGHmHJBooPhX';
const delay = ms => new Promise(r => setTimeout(r, ms));
async function exploreWallets() {
console.log('🧠 SNAP - Exploring wallet options');
console.log('===================================\n');
const browser = await puppeteer.launch({
headless: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'],
});
const page = await browser.newPage();
await page.setViewport({ width: 1920, height: 1080 });
console.log(`📺 Loading SNAP token page...`);
await page.goto(`https://pump.fun/coin/${CONTRACT}`, { waitUntil: 'networkidle2', timeout: 30000 });
await delay(2000);
// Dismiss the modal
console.log('🔘 Dismissing modal...');
try {
const modalButton = await page.evaluateHandle(() => {
const buttons = Array.from(document.querySelectorAll('button'));
return buttons.find(b => b.innerText.includes("I'm ready to pump"));
});
if (modalButton) {
await modalButton.click();
await delay(1500);
}
} catch (e) {}
// Click Log in
console.log('🔗 Clicking Log in...');
const loginButton = await page.evaluateHandle(() => {
const buttons = Array.from(document.querySelectorAll('button'));
return buttons.find(b => b.innerText.includes('Log in'));
});
if (loginButton) {
await loginButton.click();
await delay(2000);
}
// Click "more wallets"
console.log('💳 Clicking "more wallets"...');
const moreWalletsButton = await page.evaluateHandle(() => {
const buttons = Array.from(document.querySelectorAll('button'));
return buttons.find(b => b.innerText.includes('more wallets'));
});
if (moreWalletsButton) {
await moreWalletsButton.click();
await delay(2000);
await page.screenshot({ path: '/var/www/snap/wallets-list.png' });
console.log('📸 Screenshot: wallets list');
// Get the wallet options
const walletOptions = await page.evaluate(() => {
const buttons = Array.from(document.querySelectorAll('button'));
return buttons
.map(b => b.innerText.trim())
.filter(text => text.length > 0 && text.length < 100);
});
console.log('\n💳 Available wallets:');
walletOptions.forEach(w => console.log(' -', w));
// Look specifically for WalletConnect or similar
const dialogContent = await page.evaluate(() => {
const dialog = document.querySelector('[role="dialog"]');
return dialog ? dialog.innerText : document.body.innerText.substring(0, 2000);
});
console.log('\n📄 Dialog content:');
console.log(dialogContent.substring(0, 1000));
} else {
console.log(' "more wallets" button not found');
}
await browser.close();
console.log('\n✅ Done');
}
exploreWallets().catch(err => {
console.error('❌ Error:', err.message);
process.exit(1);
});