-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.ts
More file actions
46 lines (42 loc) · 1.3 KB
/
cli.ts
File metadata and controls
46 lines (42 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import dayjs from "dayjs";
import { run } from "@autoclickpro/run";
import { createPfGrpcClient } from "./src/grpc";
run({
start() {
const res1: number[] = [];
const client1 = createPfGrpcClient(
"https://solana-yellowstone-grpc.publicnode.com:443",
""
);
// "http://37.114.51.69:10900",
// "NbGKPFXCWuBvf9Ss623VQ5DA"
client1.onToken({
onCreate: async ({ metadata, sig, amm, ext }) => {
const diff = dayjs().diff(dayjs(metadata.createdAt));
res1.push(diff);
console.log({
mint: metadata.mint,
diff,
publicNode: res1.reduce((a, b) => a + b, 0) / res1.length,
cd: res2.reduce((a, b) => a + b, 0) / res2.length,
});
},
});
const res2: number[] = [];
const client2 = createPfGrpcClient("http://37.114.51.69:10900", "");
// "http://37.114.51.69:10900",
// "NbGKPFXCWuBvf9Ss623VQ5DA"
client2.onToken({
onCreate: async ({ metadata, sig, amm, ext }) => {
const diff = dayjs().diff(dayjs(metadata.createdAt));
res2.push(diff);
console.log({
mint: metadata.mint,
diff,
publicNode: res1.reduce((a, b) => a + b, 0) / res1.length,
cd: res2.reduce((a, b) => a + b, 0) / res2.length,
});
},
});
},
});