diff --git a/portfolio.go b/portfolio.go index e9e0e54..88d3f46 100644 --- a/portfolio.go +++ b/portfolio.go @@ -6,7 +6,6 @@ import ( "net/url" "github.com/google/go-querystring/query" - "github.com/zerodhatech/go-kite-connect/models" ) // Holding is an individual holdings response. @@ -111,14 +110,13 @@ func (c *Client) ConvertPosition(positionParams ConvertPositionParams) (bool, er b bool err error params url.Values - out models.PlainResponse ) if params, err = query.Values(positionParams); err != nil { return false, NewError(InputError, fmt.Sprintf("Error decoding order params: %v", err), nil) } - if err = c.doEnvelope(http.MethodPut, URIConvertPosition, params, nil, &out); err == nil { + if err = c.doEnvelope(http.MethodPut, URIConvertPosition, params, nil, nil); err == nil { b = true } diff --git a/user.go b/user.go index d94be8d..4c21cf4 100644 --- a/user.go +++ b/user.go @@ -5,8 +5,6 @@ import ( "fmt" "net/http" "net/url" - - "github.com/zerodhatech/go-kite-connect/models" ) // UserSession represents the response after a successful authentication. @@ -110,18 +108,15 @@ func (c *Client) GenerateSession(requestToken string, apiSecret string) (UserSes return session, err } -func (c *Client) invalidateToken(tokenKey string, tokenValue string) (bool, error) { - var ( - b bool - out models.PlainResponse - ) +func (c *Client) invalidateToken(tokenType string, token string) (bool, error) { + var b bool // construct url values params := url.Values{} params.Add("api_key", c.apiKey) - params.Add(tokenKey, tokenValue) + params.Add(tokenType, token) - err := c.doEnvelope(http.MethodDelete, URIUserSessionInvalidate, params, nil, &out) + err := c.doEnvelope(http.MethodDelete, URIUserSessionInvalidate, params, nil, nil) if err == nil { b = true }