diff --git a/cmd/tezgen/template/contract.tmpl b/cmd/tezgen/template/contract.tmpl index feb94d1..47b0c8c 100644 --- a/cmd/tezgen/template/contract.tmpl +++ b/cmd/tezgen/template/contract.tmpl @@ -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), diff --git a/tzkt/data/consts.go b/tzkt/data/consts.go index 870d621..1a71705 100644 --- a/tzkt/data/consts.go +++ b/tzkt/data/consts.go @@ -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" ) diff --git a/tzkt/events/README.md b/tzkt/events/README.md index bd9b410..d73e39a 100644 --- a/tzkt/events/README.md +++ b/tzkt/events/README.md @@ -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") ``` \ No newline at end of file diff --git a/tzkt/events/tzkt.go b/tzkt/events/tzkt.go index 09e575d..aa8632d 100644 --- a/tzkt/events/tzkt.go +++ b/tzkt/events/tzkt.go @@ -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