Last active
February 23, 2023 15:24
-
-
Save H-Gomez/178e2c476b61febf10ef75ed866b39b8 to your computer and use it in GitHub Desktop.
Koinly Solana Browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// select all list items | |
const explorerUrl = 'https://solscan.io/tx/'; | |
const nodes = document.querySelectorAll('.well') | |
// open all dropdowns for transactions. | |
nodes.forEach(node => { | |
node.click() | |
}) | |
// get all txhashs from the dropdowns | |
const txHashes = document.querySelectorAll('.react-slidedown > .txn-slidedown-inner > .px-2 > .row > div:nth-child(1) > .mt-2 > .pt-1') | |
// loop over hashes and remove the front text | |
txHashes.forEach(hash => { | |
const cleanedHash = hash.textContent.split(" ")[1] | |
const link = document.createElement('a'); | |
link.href = explorerUrl + cleanedHash; | |
link.target = '_blank'; | |
const span = document.createElement('span') | |
span.textContent = cleanedHash | |
link.appendChild(span) | |
hash.appendChild(link); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment