qbtrade/pkg/exchange/binance/binanceapi/futures_get_account_balance_request.go

40 lines
1.3 KiB
Go
Raw Normal View History

2024-06-27 14:42:38 +00:00
package binanceapi
import (
"github.com/c9s/requestgen"
"git.qtrade.icu/lychiyu/qbtrade/pkg/fixedpoint"
"git.qtrade.icu/lychiyu/qbtrade/pkg/types"
)
type FuturesBalance struct {
AccountAlias string `json:"accountAlias"`
Asset string `json:"asset"`
// Balance - wallet balance
Balance fixedpoint.Value `json:"balance"`
CrossWalletBalance fixedpoint.Value `json:"crossWalletBalance"`
// CrossUnPnL unrealized profit of crossed positions
CrossUnPnl fixedpoint.Value `json:"crossUnPnl"`
AvailableBalance fixedpoint.Value `json:"availableBalance"`
// MaxWithdrawAmount - maximum amount for transfer out
MaxWithdrawAmount fixedpoint.Value `json:"maxWithdrawAmount"`
// MarginAvailable - whether the asset can be used as margin in Multi-Assets mode
MarginAvailable bool `json:"marginAvailable"`
UpdateTime types.MillisecondTimestamp `json:"updateTime"`
}
//go:generate requestgen -method GET -url "/fapi/v2/balance" -type FuturesGetAccountBalanceRequest -responseType []FuturesBalance
type FuturesGetAccountBalanceRequest struct {
client requestgen.AuthenticatedAPIClient
}
func (c *FuturesRestClient) NewFuturesGetAccountBalanceRequest() *FuturesGetAccountBalanceRequest {
return &FuturesGetAccountBalanceRequest{client: c}
}