mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1635 from c9s/edwin/okx/update-symbols-map
FIX: [okx] update okx symbols
This commit is contained in:
commit
4c1d3f1c44
|
@ -14,8 +14,7 @@ func toGlobalSymbol(symbol string) string {
|
|||
return strings.ReplaceAll(symbol, "-", "")
|
||||
}
|
||||
|
||||
// //go:generate sh -c "echo \"package okex\nvar spotSymbolMap = 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"
|
||||
//
|
||||
//go:generate sh -c "echo \"package okex\nvar spotSymbolMap = map[string]string{\n\" $(curl -s -L 'https://www.okx.com/api/v5/public/instruments?instType=SPOT' | jq -r '.data[] | \"\\(.instId | sub(\"-\" ; \"\") | tojson ): \\( .instId | tojson),\n\"') \"\n}\" > symbols.go"
|
||||
//go:generate go run gensymbols.go
|
||||
func toLocalSymbol(symbol string) string {
|
||||
if s, ok := spotSymbolMap[symbol]; ok {
|
||||
|
|
|
@ -27,7 +27,7 @@ var spotSymbolMap = map[string]string{
|
|||
func main() {
|
||||
ctx := context.Background()
|
||||
client := okexapi.NewClient()
|
||||
instruments, err := client.PublicDataService.NewGetInstrumentsRequest().InstrumentType(okexapi.InstrumentTypeSpot).Do(ctx)
|
||||
instruments, err := client.NewGetInstrumentsInfoRequest().InstType(okexapi.InstrumentTypeSpot).Do(ctx)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user