bbgo_origin/examples/max-orders/main.go

26 lines
452 B
Go
Raw Permalink Normal View History

2020-10-10 03:26:25 +00:00
package main
import (
"log"
"os"
2020-10-11 08:46:15 +00:00
maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi"
2020-10-10 03:26:25 +00:00
)
func main() {
key := os.Getenv("MAX_API_KEY")
secret := os.Getenv("MAX_API_SECRET")
maxRest := maxapi.NewRestClient(maxapi.ProductionAPIURL)
maxRest.Auth(key, secret)
orders, err := maxRest.OrderService.All("maxusdt", 100, 1, maxapi.OrderStateDone)
if err != nil {
log.Fatal(err)
}
for _, order := range orders {
log.Printf("%+v", order)
}
}