Skip to content

Commit

Permalink
update README formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ramin committed Mar 18, 2024
1 parent 8455a8e commit 33025db
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ It is possible to listen for a handful of events that the node emits. This is do
To open a channel and watch for events

```go
client = client.WithBaseURL("http://localhost:8282") // if you are using polar for a local setup

channel, err := client.Subscribe()
if err != nil {
panic(err)
return
}

// example fo handling events
for message := range channel {
switch message.Type {
case eclair.ChannelOpened:
// handle channel opened event
case eclair.ChannelClosed:
// handle channel closed event
case eclair.PaymentReceived
// handle channel closed event
//...etc for all/any message type
}
}
client = client.WithBaseURL("http://localhost:8282") // if you are using polar for a local setup

channel, err := client.Subscribe()
if err != nil {
panic(err)
return
}

// example fo handling events
for message := range channel {
switch message.Type {
case eclair.ChannelOpened:
// handle channel opened event
case eclair.ChannelClosed:
// handle channel closed event
case eclair.PaymentReceived
// handle channel closed event
//...etc for all/any message type
}
}
```

0 comments on commit 33025db

Please sign in to comment.