This pull request introduces a new newLogs event to the WebSocketProvider class. This enhancement allows for real-time emission of logs that match specified filters, improving our ability to handle and respond to blockchain events efficiently.
Example
import { WebSocketEvents, WebSocketProvider } from "js-moi-sdk";
const ws = new WebSocketProvider("ws://141.94.161.24:1602/ws");
ws.on(WebSocketEvents.CONNECT, () => {
console.log("Connected to the WebSocket server");
});
const logEvent = {
address: "0xb90f39fcf346ba3260518669495f5d368a8d1bb8023584f67e8a5671cf3c56ce",
topics: [],
height: [-1, -1],
};
ws.on(logEvent, (response) => console.log(response));
closes #87
Changes include
[ ] Bugfix (non-breaking change that solves an issue)
[X] New feature (non-breaking change that adds functionality)
[ ] Breaking change (change that is not backwards-compatible and/or changes current functionality)
Checklist
[X] I have assigned this PR to myself
[X] I have added at least 1 reviewer
[X] I have tested this code
[X] I have updated the README and other relevant documents (guides...)
This pull request introduces a new
newLogs
event to theWebSocketProvider
class. This enhancement allows for real-time emission of logs that match specified filters, improving our ability to handle and respond to blockchain events efficiently.Example
Changes include
Checklist