Skip to content

Commit

Permalink
Add UnsubscribeCandles and UnsubscribeBook (#31)
Browse files Browse the repository at this point in the history
* Add UnsubscribeCandles and UnsubscribeBook
  • Loading branch information
kjkraw authored Jul 5, 2021
1 parent 41100be commit e65ac31
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions websocket/kraken.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,30 @@ func (k *Kraken) Unsubscribe(channelType string, pairs []string) error {
})
}

// UnsubscribeCandles - Unsubscribe from candles subscription, can specify multiple currency pairs.
func (k *Kraken) UnsubscribeCandles(pairs []string, interval int64) error {
return k.send(UnsubscribeRequest{
Event: EventUnsubscribe,
Pairs: pairs,
Subscription: Subscription{
Name: ChanCandles,
Interval: interval,
},
})
}

// UnsubscribeBook - Unsubscribe from order book subscription, can specify multiple currency pairs.
func (k *Kraken) UnsubscribeBook(pairs []string, depth int64) error {
return k.send(UnsubscribeRequest{
Event: EventUnsubscribe,
Pairs: pairs,
Subscription: Subscription{
Name: ChanBook,
Depth: depth,
},
})
}

// Authenticate - authenticate in private Websocket API
func (k *Kraken) Authenticate(key, secret string) error {
data, err := rest.New(key, secret).GetWebSocketsToken()
Expand Down

0 comments on commit e65ac31

Please sign in to comment.