const { Connection } = require('@solana/web3.js');
async function logHighestSnapshotSlot() {
const connection = new Connection('https://mainnet.helius-rpc.com/?api-key=<api-key>');
try {
const snapshotSlotInfo = await connection.getHighestSnapshotSlot();
console.log('Highest Snapshot Slot Information:');
console.log(` Full Snapshot Slot: ${snapshotSlotInfo.full}`);
console.log(` Incremental Snapshot Slot: ${snapshotSlotInfo.incremental !== null ? snapshotSlotInfo.incremental : 'N/A'}`);
} catch (error) {
console.error('Error fetching highest snapshot slot:', error);
}
}
logHighestSnapshotSlot();