|
| 1 | +#!/usr/bin/env node |
| 2 | +const https = require('https'); |
| 3 | + |
| 4 | +const HELIUS_RPC = 'https://mainnet.helius-rpc.com/?api-key=4fe39d22-5043-40d3-b2a1-dd8968ecf8a6'; |
| 5 | + |
| 6 | +const ADDRESSES = { |
| 7 | + jupiterProgram: 'JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4', |
| 8 | + programData: '4Ec7ZxZS6Sbdg5UGSLHbAnM7GQHp2eFd4KYWRexAipQT', |
| 9 | + currentAuthority: 'CvQZZ23qYDWF2RUpxYJ8y9K4skmuvYEEjH7fK58jtipQ', |
| 10 | + newController: 'GLzZk1sczzW6fM4uPFeQCtTZQaf8H5VaBt99tUMbJAAW', |
| 11 | + squadsProgram: 'SMPLecH534NA9acpos4G6x7uf3LWbCAwZQE9e8ZekMu', |
| 12 | + multisig: '7ZyDFzet6sKgZLN4D89JLfo7chu2n7nYdkFt5RCFk8Sf' |
| 13 | +}; |
| 14 | + |
| 15 | +const MULTISIG_MEMBERS = [ |
| 16 | + '2MgqMXdwSf3bRZ6S8uKJSffZAaoZBhD2mjst3phJXE7p', |
| 17 | + '89FnbsKH8n6FXCghGUijxh3snqx3e6VXJ7q1fQAHWkQQ', |
| 18 | + 'BYidGfUnfoQtqi4nHiuo57Fjreizbej6hawJLnbwJmYr', |
| 19 | + 'CHRDWWqUs6LyeeoD7pJb3iRfnvYeMfwMUtf2N7zWk7uh', |
| 20 | + 'Dg5NLa5JuwfRMkuwZEguD9RpVrcQD3536GxogUv7pLNV', |
| 21 | + 'EhJqf1p39c8NnH5iuZAJyw778LQua1AhZWxarT5SF8sT', |
| 22 | + 'GGG2JyBtwbPAsYwUQED8GBbj9UMi7NQa3uwN3DmyGNtz' |
| 23 | +]; |
| 24 | + |
| 25 | +function rpcCall(method, params) { |
| 26 | + return new Promise((resolve, reject) => { |
| 27 | + const data = JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }); |
| 28 | + const url = new URL(HELIUS_RPC); |
| 29 | + |
| 30 | + const req = https.request({ |
| 31 | + hostname: url.hostname, |
| 32 | + path: url.pathname + url.search, |
| 33 | + method: 'POST', |
| 34 | + headers: { 'Content-Type': 'application/json', 'Content-Length': data.length } |
| 35 | + }, res => { |
| 36 | + let body = ''; |
| 37 | + res.on('data', chunk => body += chunk); |
| 38 | + res.on('end', () => resolve(JSON.parse(body))); |
| 39 | + }); |
| 40 | + |
| 41 | + req.on('error', reject); |
| 42 | + req.write(data); |
| 43 | + req.end(); |
| 44 | + }); |
| 45 | +} |
| 46 | + |
| 47 | +async function getSignatures(address, limit = 10) { |
| 48 | + const res = await rpcCall('getSignaturesForAddress', [address, { limit }]); |
| 49 | + return res.result || []; |
| 50 | +} |
| 51 | + |
| 52 | +async function getTransaction(signature) { |
| 53 | + const res = await rpcCall('getTransaction', [signature, { encoding: 'jsonParsed', maxSupportedTransactionVersion: 0 }]); |
| 54 | + return res.result; |
| 55 | +} |
| 56 | + |
| 57 | +async function checkAddress(address, name) { |
| 58 | + const res = await rpcCall('getAccountInfo', [address, { encoding: 'base64' }]); |
| 59 | + const exists = res.result?.value !== null && res.result?.value !== undefined; |
| 60 | + const balance = exists ? res.result.value.lamports / 1e9 : 0; |
| 61 | + return { name, address, exists, balance }; |
| 62 | +} |
| 63 | + |
| 64 | +async function main() { |
| 65 | + console.log('🔍 Transfer Ownership Signature Check\n'); |
| 66 | + console.log('Using Helius RPC:', HELIUS_RPC.split('?')[0]); |
| 67 | + console.log('━'.repeat(70)); |
| 68 | + |
| 69 | + // Check all addresses |
| 70 | + console.log('\n📋 Address Status:'); |
| 71 | + for (const [key, addr] of Object.entries(ADDRESSES)) { |
| 72 | + const info = await checkAddress(addr, key); |
| 73 | + console.log(`${info.exists ? '✅' : '❌'} ${info.name}: ${info.address.slice(0, 8)}... (${info.balance} SOL)`); |
| 74 | + } |
| 75 | + |
| 76 | + // Check multisig members |
| 77 | + console.log('\n👥 Multisig Members (4 of 7 required):'); |
| 78 | + for (let i = 0; i < MULTISIG_MEMBERS.length; i++) { |
| 79 | + const info = await checkAddress(MULTISIG_MEMBERS[i], `Member ${i + 1}`); |
| 80 | + console.log(`${info.exists ? '✅' : '❌'} ${i + 1}. ${info.address} (${info.balance} SOL)`); |
| 81 | + } |
| 82 | + |
| 83 | + // Get signatures for key accounts |
| 84 | + console.log('\n📝 Recent Signatures:'); |
| 85 | + |
| 86 | + const accounts = [ |
| 87 | + ['Program Data', ADDRESSES.programData], |
| 88 | + ['Current Authority', ADDRESSES.currentAuthority], |
| 89 | + ['Multisig', ADDRESSES.multisig] |
| 90 | + ]; |
| 91 | + |
| 92 | + for (const [name, addr] of accounts) { |
| 93 | + const sigs = await getSignatures(addr, 5); |
| 94 | + console.log(`\n${name} (${addr}):`); |
| 95 | + |
| 96 | + if (sigs.length === 0) { |
| 97 | + console.log(' No signatures found'); |
| 98 | + continue; |
| 99 | + } |
| 100 | + |
| 101 | + for (const sig of sigs) { |
| 102 | + const tx = await getTransaction(sig.signature); |
| 103 | + const fee = tx?.meta?.fee ? (tx.meta.fee / 1e9).toFixed(6) : 'N/A'; |
| 104 | + const status = sig.err ? '❌ ERROR' : '✅ SUCCESS'; |
| 105 | + console.log(` ${status} ${sig.signature.slice(0, 16)}... | Fee: ${fee} SOL`); |
| 106 | + } |
| 107 | + } |
| 108 | + |
| 109 | + console.log('\n━'.repeat(70)); |
| 110 | + console.log('✅ Scan Complete'); |
| 111 | +} |
| 112 | + |
| 113 | +main().catch(console.error); |
0 commit comments