Skip to content

Commit

Permalink
TzKT: events => ws
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Feb 4, 2024
1 parent b22ec32 commit 1912118
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/tezgen/template/contract.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type {{.TypeName}} struct {
func New(baseURL string) *{{.TypeName}} {
return &{{.TypeName}} {
tzktAPI: api.New(baseURL),
tzktEvents: events.NewTzKT(fmt.Sprintf("%s/v1/events", baseURL)),
tzktEvents: events.NewTzKT(fmt.Sprintf("%s/v1/ws", baseURL)),
address: "{{ .Contract }}",
{{- range $key, $value := .EntrypointTypes }}
{{ $value.Var }}: make(chan {{ $value.Type }}Tx, 1024),
Expand Down
2 changes: 1 addition & 1 deletion tzkt/data/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ const (
// urls
const (
BaseURL = "https://api.tzkt.io"
BaseEventsURL = "https://api.tzkt.io/v1/events"
BaseEventsURL = "https://api.tzkt.io/v1/ws"
)
2 changes: 1 addition & 1 deletion tzkt/events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ If you want to write custom client or re-use SignalR in another package you can
```golang
import "github.com/dipdup-net/go-lib/tzkt/events/signalr"

client := signalr.NewSignalR("https://api.tzkt.io/v1/events")
client := signalr.NewSignalR("https://api.tzkt.io/v1/ws")
```
2 changes: 1 addition & 1 deletion tzkt/events/tzkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type TzKT struct {
wg sync.WaitGroup
}

// NewTzKT - constructor of `TzKT`. `url` is TzKT events base URL. If it's empty https://api.tzkt.io/v1/events is set.
// NewTzKT - constructor of `TzKT`. `url` is TzKT events base URL. If it's empty https://api.tzkt.io/v1/ws is set.
func NewTzKT(url string) *TzKT {
if url == "" {
url = tzktData.BaseEventsURL
Expand Down

0 comments on commit 1912118

Please sign in to comment.