bbgo: rename NewStandard to just New

This commit is contained in:
c9s 2023-05-16 18:24:06 +08:00
parent 5e8f8b492a
commit 420654c5ed
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 4 additions and 4 deletions

View File

@ -714,7 +714,7 @@ func (session *ExchangeSession) InitExchange(name string, ex types.Exchange) err
ex, err = exchange2.NewPublic(exchangeName)
} else {
if session.Key != "" && session.Secret != "" {
ex, err = exchange2.NewStandard(exchangeName, session.Key, session.Secret, session.Passphrase)
ex, err = exchange2.New(exchangeName, session.Key, session.Secret, session.Passphrase)
} else {
ex, err = exchange2.NewWithEnvVarPrefix(exchangeName, session.EnvVarPrefix)
}

View File

@ -13,10 +13,10 @@ import (
)
func NewPublic(exchangeName types.ExchangeName) (types.Exchange, error) {
return NewStandard(exchangeName, "", "", "")
return New(exchangeName, "", "", "")
}
func NewStandard(n types.ExchangeName, key, secret, passphrase string) (types.Exchange, error) {
func New(n types.ExchangeName, key, secret, passphrase string) (types.Exchange, error) {
switch n {
case types.ExchangeBinance:
@ -54,5 +54,5 @@ func NewWithEnvVarPrefix(n types.ExchangeName, varPrefix string) (types.Exchange
passphrase := os.Getenv(varPrefix + "_API_PASSPHRASE")
subAccount := os.Getenv(varPrefix + "_SUBACCOUNT")
return NewStandard(n, key, secret, passphrase)
return New(n, key, secret, passphrase)
}