2023-08-09 07:20:33 +00:00
|
|
|
package bitget
|
|
|
|
|
2023-08-09 07:30:28 +00:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/c9s/bbgo/pkg/exchange/bitget/bitgetapi"
|
|
|
|
"github.com/c9s/bbgo/pkg/fixedpoint"
|
|
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
|
|
)
|
2023-08-09 07:20:33 +00:00
|
|
|
|
|
|
|
func toGlobalSymbol(s string) string {
|
|
|
|
return strings.ToUpper(s)
|
|
|
|
}
|
2023-08-09 07:30:28 +00:00
|
|
|
|
|
|
|
func toGlobalBalance(asset bitgetapi.AccountAsset) types.Balance {
|
|
|
|
return types.Balance{
|
|
|
|
Currency: asset.CoinName,
|
|
|
|
Available: asset.Available,
|
|
|
|
Locked: asset.Lock.Add(asset.Frozen),
|
|
|
|
Borrowed: fixedpoint.Zero,
|
|
|
|
Interest: fixedpoint.Zero,
|
|
|
|
NetAsset: fixedpoint.Zero,
|
|
|
|
MaxWithdrawAmount: fixedpoint.Zero,
|
|
|
|
}
|
|
|
|
}
|