max: apply margin settings struct

This commit is contained in:
c9s 2022-05-25 14:38:09 +08:00
parent eccee460ca
commit e5e505d65e
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,8 @@ var marketDataLimiter = rate.NewLimiter(rate.Every(2*time.Second), 10)
var log = logrus.WithField("exchange", "max")
type Exchange struct {
types.MarginSettings
client *maxapi.RestClient
key, secret string
}
@ -155,7 +157,9 @@ func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error) {
}
func (e *Exchange) NewStream() types.Stream {
return NewStream(e.key, e.secret)
stream := NewStream(e.key, e.secret)
stream.MarginSettings = e.MarginSettings
return stream
}
func (e *Exchange) QueryOrder(ctx context.Context, q types.OrderQuery) (*types.Order, error) {

View File

@ -18,6 +18,7 @@ import (
//go:generate callbackgen -type Stream
type Stream struct {
types.StandardStream
types.MarginSettings
key, secret string