diff --git a/pkg/exchange/okex/convert.go b/pkg/exchange/okex/convert.go index dfd9b8c92..fb19b6641 100644 --- a/pkg/exchange/okex/convert.go +++ b/pkg/exchange/okex/convert.go @@ -6,6 +6,7 @@ func toGlobalSymbol(symbol string) string { return strings.ReplaceAll(symbol, "-", "") } +//go:generate sh -c "echo \"package okex\nvar symbolMap = map[string]string{\n\" $(curl -s -L 'https://okex.com/api/v5/public/instruments?instType=SPOT' | jq -r '.data[] | \"\\(.instId | sub(\"-\" ; \"\") | tojson ): \\( .instId | tojson),\n\"') \"\n}\" > symbols.go" func toLocalSymbol(symbol string) string { if s, ok := symbolMap[symbol]; ok { return s diff --git a/pkg/exchange/okex/exchange.go b/pkg/exchange/okex/exchange.go index 24eca2725..15a16fb7a 100644 --- a/pkg/exchange/okex/exchange.go +++ b/pkg/exchange/okex/exchange.go @@ -9,7 +9,6 @@ import ( "github.com/sirupsen/logrus" ) -//go:generate sh -c "echo \"package okex\nvar symbolMap = map[string]string{\n\" $(curl -s -L 'https://okex.com/api/v5/public/instruments?instType=SPOT' | jq -r '.data[] | \"\\(.instId | sub(\"-\" ; \"\") | tojson ): \\( .instId | tojson),\n\"') \"\n}\" > symbols.go" // OKB is the platform currency of OKEx, pre-allocate static string here const OKB = "OKB"