Effect CommunityEC
Effect Community3y ago
5 replies
yura21002

Adapting Blockchain Event Subscription to Effect Ecosystem

Hello, I am building a simple discord bot that listens to blockchain events and sends messages to discord. I am currently trying to understand what is the best abstraction for events subscription.

The API to listen to events looks like this:
const unwatch = watchEvent({
  onLogs: (logs) => { ... },
});


What is the best way to adapt this to Effect ecosystem? As far as I understand there is an @effect/stream package that should cover this problem. I'd be very helpful if you provide some examples how to use it in my case and how to run such program.
Was this page helpful?