account

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// https://bybit-exchange.github.io/docs/v5/account/wallet-balance
	EndpointBalance = "/v5/account/wallet-balance"
)

Variables

This section is empty.

Functions

func BalanceData

func BalanceData(connRest ConnectorRest, parm BalanceParam) ([]byte, error)

Types

type BalanceParam

type BalanceParam struct {
	AccountType AccountType `structs:"accountType"`    // Account type
	Coin        string      `structs:"coin,omitempty"` // optional	 Coin name
	RecvWindow  int         `structs:"-"`              // optional
}

type BalanceResp

type BalanceResp struct {
	RetCode int    `json:"retCode"` // Success/Error code
	RetMsg  string `json:"retMsg"`  // Success/Error msg. OK, success, SUCCESS indicate a successful response
	Result  struct {
		List []struct {
			AccountType            string `json:"accountType"`            // Account type
			AccountLTV             string `json:"accountLTV"`             // Account LTV
			AccountIMRate          string `json:"accountIMRate"`          // Initial Margin Rate
			AccountMMRate          string `json:"accountMMRate"`          // Maintenance Margin Rate
			TotalEquity            string `json:"totalEquity"`            // Equity of account converted to usd
			TotalWalletBalance     string `json:"totalWalletBalance"`     // Wallet Balance of account converted to usd
			TotalMarginBalance     string `json:"totalMarginBalance"`     // Margin Balance of account converted to usd
			TotalAvailableBalance  string `json:"totalAvailableBalance"`  // Available Balance of account converted to usd
			TotalPerpUPL           string `json:"totalPerpUPL"`           // Unrealised P&L of perpetuals of account converted to usd
			TotalInitialMargin     string `json:"totalInitialMargin"`     // Initial Margin of account converted to usd
			TotalMaintenanceMargin string `json:"totalMaintenanceMargin"` // Maintenance Margin of account converted to usd
			Coin                   []struct {
				Coin                string `json:"coin"`                // Coin name, such as BTC, ETH, USDT, USDC
				Equity              string `json:"equity"`              // Equity of current coin
				UsdValue            string `json:"usdValue"`            // USD value of current coin
				WalletBalance       string `json:"walletBalance"`       // Wallet balance of current coin
				Free                string `json:"free"`                // Available balance for Spot wallet. This is a unique field for Normal SPOT
				Locked              string `json:"locked"`              // Locked balance for Spot wallet. This is a unique field for Normal SPOT
				BorrowAmount        string `json:"borrowAmount"`        // Borrow amount of current coin
				AvailableToBorrow   string `json:"availableToBorrow"`   // Available amount to borrow of current coin
				AvailableToWithdraw string `json:"availableToWithdraw"` // Available amount to withdraw of current coin
				AccruedInterest     string `json:"accruedInterest"`     // Accrued interest
				TotalOrderIM        string `json:"totalOrderIM"`        // Pre-occupied margin for order
				TotalPositionIM     string `json:"totalPositionIM"`     // Sum of initial margin of all positions + Pre-occupied liquidation fee
				TotalPositionMM     string `json:"totalPositionMM"`     // Sum of maintenance margin for all positions
				UnrealisedPnl       string `json:"unrealisedPnl"`       // Unrealised P&L
				CumRealisedPnl      string `json:"cumRealisedPnl"`      // Cumulative Realised P&L
				Bonus               string `json:"bonus"`               // Bonus. This is a unique field for UNIFIED account
			} `json:"coin"`
		} `json:"list"`
	} `json:"result"`
	RetExtInfo struct{} `json:"retExtInfo"` // Extend info. Most of the time, it is {}
	Time       int64    `json:"time"`       // Current timestamp (ms)
}

func Balance

func Balance(connRest ConnectorRest, parm BalanceParam) (BalanceResp, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL