forked from github/github-mcp-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcheck_valid_tx.js
More file actions
55 lines (44 loc) Β· 2.17 KB
/
check_valid_tx.js
File metadata and controls
55 lines (44 loc) Β· 2.17 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
const { Connection } = require('@solana/web3.js');
const VALID_SIGNATURES = [
'2635rwgwvPekyQzkDPiPh1PH3WkqYydaBKY42rfUFnzqNtdWaApexipp32XGzcTHiGNdifSXEfuNWRMQovLHdoSd',
'2A5EXWVmemFrMFktCD4vmyKTBrhoqeQuDSRdvB2rnkJ7pnCxzixpt2BNDQyPJpVDHQ6Xf8wmMyvRCXTXPShdijKc',
'2AHAs1gdHSGn2REJbARigh5CLoRuR9gdNTMTKu5UJBVVovXUxhPYeLFYTVgov7gyes4QkwLhgw89PAsGZbUjK2Yv',
'2FVSeJQX3Sd8tVUSFGN7fY1fW5cKcnph9XzSYruvf88C4geMimDQNqkKadWXqioGwpwbvCsGQ9cjbKXUvNuZR1ca',
'2GtCKQ5AY1NMupCqDBrA58YZ48BaouMxoFRWiQLET2vn973BhuFUqeDXKzBiubvLqb5kzQ5huAxoCN5z2CE5ZeUU'
];
async function main() {
const connection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed');
console.log('π Valid Transaction Signature Check\n');
console.log('='.repeat(80));
const results = { confirmed: [], notFound: [] };
for (const sig of VALID_SIGNATURES) {
console.log(`\nπ ${sig.slice(0, 20)}...${sig.slice(-20)}`);
try {
const status = await connection.getSignatureStatus(sig);
if (status?.value) {
console.log(`β
FOUND`);
console.log(` Confirmations: ${status.value.confirmations || 'Finalized'}`);
console.log(` Error: ${status.value.err || 'None'}`);
const tx = await connection.getTransaction(sig, { maxSupportedTransactionVersion: 0 });
if (tx) {
console.log(` Slot: ${tx.slot}`);
console.log(` Fee: ${(tx.meta.fee / 1e9).toFixed(6)} SOL`);
console.log(` Time: ${new Date(tx.blockTime * 1000).toISOString()}`);
console.log(` π https://solscan.io/tx/${sig}`);
results.confirmed.push({ signature: sig, slot: tx.slot, fee: tx.meta.fee });
}
} else {
console.log(`β NOT FOUND`);
results.notFound.push(sig);
}
} catch (e) {
console.log(`β ERROR: ${e.message}`);
results.notFound.push(sig);
}
}
console.log('\n' + '='.repeat(80));
console.log(`\nπ Summary: ${results.confirmed.length} confirmed, ${results.notFound.length} not found`);
require('fs').writeFileSync('valid_tx_check.json', JSON.stringify(results, null, 2));
console.log('β
Saved to valid_tx_check.json');
}
main().catch(console.error);