forked from L9T-Development/Solana-Raydium-Volume-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ts
20 lines (16 loc) · 759 Bytes
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Connection, PublicKey } from "@solana/web3.js";
import { retrieveEnvVariable, sleep } from "./src/utils";
const rpcUrl = retrieveEnvVariable("RPC_URL");
const connection = new Connection(rpcUrl, { commitment: "confirmed" });
const main = async () => {
const signatures = await connection.getSignaturesForAddress(new PublicKey("BgaaTbMTS9avcgFjbyZ2J8xyUt3DJ1vEL9jNZoestW7u"))
console.log(signatures.length, " signatures")
const data = signatures.map(async (sig, i) => {
await sleep(2 * i)
const data = await connection.getParsedTransaction(sig.signature, {commitment: "confirmed", maxSupportedTransactionVersion: 0})
console.log(data?.blockTime)
return data
})
console.log(data.length)
}
main().catch(e => console.log(e))