Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelSyntronic committed Mar 17, 2024
1 parent 7317e9b commit 4cc0b70
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions client/TurboBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class TurboBot {

let isCheckingPool = false
this.onLogsSubscriptionId = this.connection.onLogs(raydium, async (txLogs) => {
console.log(`Log received. ${txLogs.signature}`)
//console.log(`Log received. ${txLogs.signature}`)
if (isCheckingPool || this.seenTxs.has(txLogs.signature)) { return }
isCheckingPool = true
this.seenTxs.add(txLogs.signature)
Expand Down Expand Up @@ -112,31 +112,33 @@ export class TurboBot {
isCheckingPool = false
})

// const ws = new WebSocket(config.rpcWsURL)
// ws.onopen = () => {
// ws.send(
// JSON.stringify({
// "jsonrpc": "2.0",
// "id": 1,
// "method": "logsSubscribe",
// "params": ["all"]
// }
// )
// )

// ws.onmessage = (evt) => {
// try {
// console.log(`New logs from WS: ${evt.data.toString()}`)
// } catch (e) {
// console.log(e)
// }
// }
// }
// ws.onerror = (e) => {
// console.log(`WS error1: ${e.error.errors[0]}`)
// console.log(`WS error2: ${e.error.errors[1]}`)
// }
const ws = new WebSocket(config.rpcWsURL)
ws.onopen = () => {
ws.send(
JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "logsSubscribe",
"params": ["all"]
}
)
)

ws.onmessage = (evt) => {
try {
console.log(`New logs from WS: ${evt.data.toString()}`)
} catch (e) {
console.log(e)
}
}
}
ws.onerror = (e) => {
console.log(`WS error1: ${e.error.errors[0]}`)
console.log(`WS error2: ${e.error.errors[1]}`)
}
})


}

private async parseTx(txLogs: Logs): Promise<ParsedPoolCreationTx | null> {
Expand Down

0 comments on commit 4cc0b70

Please sign in to comment.