mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
bitget: add minimal bitget exchange
This commit is contained in:
parent
6bed2a31f6
commit
5f8bda7d72
45
pkg/exchange/bitget/exchange.go
Normal file
45
pkg/exchange/bitget/exchange.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
package bitget
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/exchange/bitget/bitgetapi"
|
||||
"github.com/c9s/bbgo/pkg/types"
|
||||
)
|
||||
|
||||
const ID = "bitget"
|
||||
|
||||
const PlatformToken = "BGB"
|
||||
|
||||
var log = logrus.WithFields(logrus.Fields{
|
||||
"exchange": ID,
|
||||
})
|
||||
|
||||
type Exchange struct {
|
||||
key, secret, passphrase string
|
||||
|
||||
client *bitgetapi.RestClient
|
||||
}
|
||||
|
||||
func New(key, secret, passphrase string) *Exchange {
|
||||
client := bitgetapi.NewClient()
|
||||
|
||||
if len(key) > 0 && len(secret) > 0 {
|
||||
client.Auth(key, secret, passphrase)
|
||||
}
|
||||
|
||||
return &Exchange{
|
||||
key: key,
|
||||
secret: secret,
|
||||
passphrase: passphrase,
|
||||
client: client,
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Exchange) Name() types.ExchangeName {
|
||||
return types.ExchangeBitget
|
||||
}
|
||||
|
||||
func (e *Exchange) PlatformFeeCurrency() string {
|
||||
return PlatformToken
|
||||
}
|
Loading…
Reference in New Issue
Block a user