Skip to content

Commit

Permalink
rea logs
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelSyntronic committed Mar 14, 2024
1 parent 8d4c04e commit 225c293
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions client/TurboBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ export class TurboBot {
const raydium = new PublicKey(RAYDIUM_PUBLIC_KEY);

let isCheckingPool = false
/*
const subId = 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 @@ -113,30 +112,6 @@ export class TurboBot {
isCheckingPool = false
})
this.onLogsSubscriptionId = subId
*/

const ws = new WebSocket(config.rpcWsURL)
ws.onopen = () => {
ws.send(
JSON.stringify({
"jsonrpc": "2.0",
"id": "1",
"method": "slotSubscribe"
})
)

ws.onmessage = (evt) => {
try {
console.log(`New slot 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 225c293

Please sign in to comment.