mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 15:09:51 +00:00
* all in a days work * cleanup * cleanup for real, also stop it binance.json * minor coverage * adds gateio to the slurry * cleanup of types * verbose verbose verbose verbose verbose verbose * fixes huobi parsing issue * fix bybit contract identification * cleanup * merge fixes * addresses many big problems raised by SHAZ * tracking errors and fixes * funding rate if avail, fixes currency formatting * Addresses nits and sneaks in extra fixes * lint * minor fixes after rebase * better contract splitter for currencies like T-USDT * forgot to add the exchange name like a fool * merge fixes x1 * kucoin, direction, contract size * rn direction, fix kucoin time * WHOOPS * Update exchanges/kucoin/kucoin_wrapper.go Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * misdirection --------- Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
36 lines
662 B
Go
36 lines
662 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/futures"
|
|
)
|
|
|
|
var (
|
|
errInvalidPair = errors.New("invalid currency pair supplied")
|
|
errInvalidAsset = errors.New("invalid asset supplied")
|
|
)
|
|
|
|
func validPair(pair string) bool {
|
|
return strings.Contains(pair, pairDelimiter)
|
|
}
|
|
|
|
func validAsset(i string) bool {
|
|
_, err := asset.New(i)
|
|
return err == nil
|
|
}
|
|
|
|
func isFuturesAsset(a string) error {
|
|
i, err := asset.New(a)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if !i.IsFutures() {
|
|
return fmt.Errorf("%w '%s'", futures.ErrNotFuturesAsset, a)
|
|
}
|
|
return nil
|
|
}
|