function loadAllTransactions() {
return new Promise((resolve, reject) => {
let lastHeight = 0;
const maxAttempts = 20;
let attempts = 0;
const scrollInterval = setInterval(() => {
// Scroll to bottom of the page
window.scrollTo(0, document.body.scrollHeight);
// Wait a moment for new content to load
setTimeout(() => {
const currentHeight = document.body.scrollHeight;
// If no new content loaded
if (currentHeight === lastHeight) {
attempts++;
// Stop if we've made max attempts or no new content
if (attempts >= maxAttempts) {
clearInterval(scrollInterval);
resolve();
}
} else {
// Reset attempts if new content found
attempts = 0;
}
lastHeight = currentHeight;
}, 1000);
}, 1500);
});
}
// Execute and log
loadAllTransactions().then(() => {
console.log('All transactions loaded');
});