mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
support max staging url orverride
This commit is contained in:
parent
3fa74164fc
commit
1c7d3d5481
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
@ -24,7 +25,12 @@ type Exchange struct {
|
|||
}
|
||||
|
||||
func New(key, secret string) *Exchange {
|
||||
client := maxapi.NewRestClient(maxapi.ProductionAPIURL)
|
||||
baseURL := maxapi.ProductionAPIURL
|
||||
if override := os.Getenv("MAX_API_BASE_URL") ; len(override) > 0 {
|
||||
baseURL = override
|
||||
}
|
||||
|
||||
client := maxapi.NewRestClient(baseURL)
|
||||
client.Auth(key, secret)
|
||||
return &Exchange{
|
||||
client: client,
|
||||
|
|
Loading…
Reference in New Issue
Block a user