Skip to content

Commit

Permalink
ohoh
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelSyntronic committed Mar 17, 2024
1 parent edba8b5 commit d2b266a
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 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,30 +112,30 @@ 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]}`)
// }
})


Expand Down

0 comments on commit d2b266a

Please sign in to comment.