Skip to content

Instantly share code, notes, and snippets.

@tomericco
Created August 23, 2018 17:15
Show Gist options
  • Save tomericco/8b06895153827cf55743a60b5c4183c1 to your computer and use it in GitHub Desktop.
Save tomericco/8b06895153827cf55743a60b5c4183c1 to your computer and use it in GitHub Desktop.
Navigate to an HD wallet specific address on MEW
var button = document.querySelector('.m-addresses td a.ng-scope[translate=MNEM_more]');
async function navigateToIndex(addr) {
let addresses = [];
let navCount = 0;
while (addresses.indexOf(addr.toLowerCase()) === -1) {
await (() => {
return new Promise((resolve) => {
button.click();
setTimeout(() => {
console.log(`Showing addresses ${navCount * 5}-${(navCount + 1) * 5}`);
addresses = Array.prototype.slice.call(document.querySelectorAll('.table-mnemonic td label span.small')).map(e => e.innerText && e.innerText.toLowerCase());
navCount++;
resolve();
}, 200);
})
})();
}
}
navigateToIndex('<ETH_ADDRESS>').then(() => console.log('Address reached!'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment