Skip to content

Instantly share code, notes, and snippets.

@barry-the-sender
Last active July 13, 2021 08:14
Show Gist options
  • Save barry-the-sender/d877a87f23d8d52d32fdd71c01f71481 to your computer and use it in GitHub Desktop.
Save barry-the-sender/d877a87f23d8d52d32fdd71c01f71481 to your computer and use it in GitHub Desktop.
import { Connection, PublicKey } from '@solana/web3.js'
const connection = new Connection('https://solana-api.projectserum.com')
const publicKey = new PublicKey('HTr2pYDBQZP13YTzLdsPzmh6e4hsNeqoGy3B777ejqTT')
async function sleep() {
return new Promise((resolve) => {
setTimeout(resolve, 1000)
})
}
;(async () => {
let i = 0
while (i < 10) {
i++
const result = await connection.getAccountInfo(publicKey, {
commitment: 'confirmed'
})
console.log(result.error)
await sleep()
}
process.exit()
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment