Skip to content

Commit

Permalink
fixup! Kraken: Generate N+ subs for pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Apr 15, 2024
1 parent 5d21222 commit 7ad509c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions currency/pair.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ func NewBTCUSD() Pair {
return NewPair(BTC, USD)
}

// NewPairDelimiter splits the desired currency string at delimiter, the returns
// a Pair struct
// NewPairDelimiter splits the desired currency string at delimiter, the returns a Pair struct
func NewPairDelimiter(currencyPair, delimiter string) (Pair, error) {
if !strings.Contains(currencyPair, delimiter) {
return EMPTYPAIR,
Expand Down
2 changes: 1 addition & 1 deletion exchanges/kraken/kraken_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ func (k *Kraken) handleSubResps(s *subscription.Subscription, resps [][]byte, op
if err != nil {
return fmt.Errorf("%w parsing WS pair from message: %s", err, resp)
}
pair, err := currency.NewPairFromString(pName)
pair, err := currency.NewPairDelimiter(pName, "/")
if err != nil {
return fmt.Errorf("%w parsing WS pair; Channel: %s Pair: %s", err, s.Channel, pName)
}
Expand Down

0 comments on commit 7ad509c

Please sign in to comment.