refactor: separate direct and related spot resolvers
Keep IsToken checks explicit across futures and direct spot symbols, move futures-derived spot mapping to a clearly named helper, and update token data collection to use related spot resolution. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,19 @@ func Token2FutureSymbols(token string) []string {
|
||||
}
|
||||
|
||||
func Token2SpotSymbols(token string) []string {
|
||||
if !stringx.IsAlphaNumeric(token) {
|
||||
return nil
|
||||
}
|
||||
|
||||
spotOnly := strings.ToUpper(token) + "USDT"
|
||||
if data.Market.IsSpotPair(spotOnly) {
|
||||
return []string{spotOnly}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func Token2RelatedSpotSymbols(token string) []string {
|
||||
futureSymbols := Token2FutureSymbols(token)
|
||||
spots := make([]string, 0, len(futureSymbols)+1)
|
||||
seen := make(map[string]struct{}, len(futureSymbols)+1)
|
||||
|
||||
Reference in New Issue
Block a user