diff --git a/clients/horizonclient/client.go b/clients/horizonclient/client.go index 1f88e36c1f..a354940caf 100644 --- a/clients/horizonclient/client.go +++ b/clients/horizonclient/client.go @@ -17,7 +17,6 @@ import ( "github.com/manucorporat/sse" hProtocol "github.com/stellar/go/protocols/horizon" "github.com/stellar/go/protocols/horizon/operations" - "github.com/stellar/go/support/app" "github.com/stellar/go/support/errors" ) @@ -94,7 +93,6 @@ func (c *Client) stream( } req.Header.Set("Accept", "text/event-stream") c.setDefaultClient() - // to do: confirm name and version c.setClientAppHeaders(req) // We can use c.HTTP here because we set Timeout per request not on the client. See sendRequest() @@ -199,7 +197,7 @@ func (c *Client) stream( func (c *Client) setClientAppHeaders(req *http.Request) { req.Header.Set("X-Client-Name", "go-stellar-sdk") - req.Header.Set("X-Client-Version", app.Version()) + req.Header.Set("X-Client-Version", c.Version()) req.Header.Set("X-App-Name", c.AppName) req.Header.Set("X-App-Version", c.AppVersion) } @@ -523,5 +521,10 @@ func (c *Client) Root() (root hProtocol.Root, err error) { return } +// Version returns the current version. +func (c *Client) Version() string { + return version +} + // ensure that the horizon client implements ClientInterface var _ ClientInterface = &Client{} diff --git a/clients/horizonclient/version.go b/clients/horizonclient/version.go new file mode 100644 index 0000000000..862c1174d3 --- /dev/null +++ b/clients/horizonclient/version.go @@ -0,0 +1,5 @@ +package horizonclient + +// version is the current version of the horizonclient. +// This is updated for every release. +const version = "1.1"