Documentation ¶
Index ¶
- Constants
- type Account
- type AccountAsset
- type AccountPosition
- type AggTrade
- type AggTradesService
- func (s *AggTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*AggTrade, err error)
- func (s *AggTradesService) EndTime(endTime int64) *AggTradesService
- func (s *AggTradesService) FromID(fromID int64) *AggTradesService
- func (s *AggTradesService) Limit(limit int) *AggTradesService
- func (s *AggTradesService) StartTime(startTime int64) *AggTradesService
- func (s *AggTradesService) Symbol(symbol string) *AggTradesService
- type Ask
- type Balance
- type Bid
- type BookTicker
- type Bracket
- type CancelAllOpenOrdersService
- type CancelOrderResponse
- type CancelOrderService
- func (s *CancelOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CancelOrderResponse, err error)
- func (s *CancelOrderService) OrderID(orderID int64) *CancelOrderService
- func (s *CancelOrderService) OrigClientOrderID(origClientOrderID string) *CancelOrderService
- func (s *CancelOrderService) Symbol(symbol string) *CancelOrderService
- type ChangeLeverageService
- type ChangeMarginTypeService
- type ChangePositionModeService
- type Client
- func (c *Client) NewAggTradesService() *AggTradesService
- func (c *Client) NewCancelAllOpenOrdersService() *CancelAllOpenOrdersService
- func (c *Client) NewCancelOrderService() *CancelOrderService
- func (c *Client) NewChangeLeverageService() *ChangeLeverageService
- func (c *Client) NewChangeMarginTypeService() *ChangeMarginTypeService
- func (c *Client) NewChangePositionModeService() *ChangePositionModeService
- func (c *Client) NewCloseUserStreamService() *CloseUserStreamService
- func (c *Client) NewCreateOrderService() *CreateOrderService
- func (c *Client) NewDepthService() *DepthService
- func (c *Client) NewExchangeInfoService() *ExchangeInfoService
- func (c *Client) NewFundingRateService() *FundingRateService
- func (c *Client) NewGetAccountService() *GetAccountService
- func (c *Client) NewGetBalanceService() *GetBalanceService
- func (c *Client) NewGetIncomeHistoryService() *GetIncomeHistoryService
- func (c *Client) NewGetLeverageBracketService() *GetLeverageBracketService
- func (c *Client) NewGetOrderService() *GetOrderService
- func (c *Client) NewGetPositionMarginHistoryService() *GetPositionMarginHistoryService
- func (c *Client) NewGetPositionModeService() *GetPositionModeService
- func (c *Client) NewGetPositionRiskService() *GetPositionRiskService
- func (c *Client) NewHistoricalTradesService() *HistoricalTradesService
- func (c *Client) NewKeepaliveUserStreamService() *KeepaliveUserStreamService
- func (c *Client) NewKlinesService() *KlinesService
- func (c *Client) NewListBookTickersService() *ListBookTickersService
- func (c *Client) NewListLiquidationOrdersService() *ListLiquidationOrdersService
- func (c *Client) NewListOpenOrdersService() *ListOpenOrdersService
- func (c *Client) NewListOrdersService() *ListOrdersService
- func (c *Client) NewListPriceChangeStatsService() *ListPriceChangeStatsService
- func (c *Client) NewListPricesService() *ListPricesService
- func (c *Client) NewPingService() *PingService
- func (c *Client) NewPremiumIndexService() *PremiumIndexService
- func (c *Client) NewRecentTradesService() *RecentTradesService
- func (c *Client) NewServerTimeService() *ServerTimeService
- func (c *Client) NewSetServerTimeService() *SetServerTimeService
- func (c *Client) NewStartUserStreamService() *StartUserStreamService
- func (c *Client) NewUpdatePositionMarginService() *UpdatePositionMarginService
- type CloseUserStreamService
- type CreateOrderResponse
- type CreateOrderService
- func (s *CreateOrderService) ActivationPrice(activationPrice string) *CreateOrderService
- func (s *CreateOrderService) CallbackRate(callbackRate string) *CreateOrderService
- func (s *CreateOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CreateOrderResponse, err error)
- func (s *CreateOrderService) NewClientOrderID(newClientOrderID string) *CreateOrderService
- func (s *CreateOrderService) PositionSide(positionSide PositionSideType) *CreateOrderService
- func (s *CreateOrderService) Price(price string) *CreateOrderService
- func (s *CreateOrderService) Quantity(quantity string) *CreateOrderService
- func (s *CreateOrderService) ReduceOnly(reduceOnly bool) *CreateOrderService
- func (s *CreateOrderService) Side(side SideType) *CreateOrderService
- func (s *CreateOrderService) StopPrice(stopPrice string) *CreateOrderService
- func (s *CreateOrderService) Symbol(symbol string) *CreateOrderService
- func (s *CreateOrderService) TimeInForce(timeInForce TimeInForceType) *CreateOrderService
- func (s *CreateOrderService) Type(orderType OrderType) *CreateOrderService
- func (s *CreateOrderService) WorkingType(workingType WorkingType) *CreateOrderService
- type DepthResponse
- type DepthService
- type ExchangeInfo
- type ExchangeInfoService
- type FundingRate
- type FundingRateService
- func (s *FundingRateService) Do(ctx context.Context, opts ...RequestOption) (res []*FundingRate, err error)
- func (s *FundingRateService) EndTime(endTime int64) *FundingRateService
- func (s *FundingRateService) Limit(limit int) *FundingRateService
- func (s *FundingRateService) StartTime(startTime int64) *FundingRateService
- func (s *FundingRateService) Symbol(symbol string) *FundingRateService
- type GetAccountService
- type GetBalanceService
- type GetIncomeHistoryService
- func (s *GetIncomeHistoryService) Do(ctx context.Context, opts ...RequestOption) (res []*IncomeHistory, err error)
- func (s *GetIncomeHistoryService) EndTime(endTime int64) *GetIncomeHistoryService
- func (s *GetIncomeHistoryService) IncomeType(incomeType string) *GetIncomeHistoryService
- func (s *GetIncomeHistoryService) Limit(limit int64) *GetIncomeHistoryService
- func (s *GetIncomeHistoryService) StartTime(startTime int64) *GetIncomeHistoryService
- func (s *GetIncomeHistoryService) Symbol(symbol string) *GetIncomeHistoryService
- type GetLeverageBracketService
- type GetOrderService
- func (s *GetOrderService) Do(ctx context.Context, opts ...RequestOption) (res *Order, err error)
- func (s *GetOrderService) OrderID(orderID int64) *GetOrderService
- func (s *GetOrderService) OrigClientOrderID(origClientOrderID string) *GetOrderService
- func (s *GetOrderService) Symbol(symbol string) *GetOrderService
- type GetPositionMarginHistoryService
- func (s *GetPositionMarginHistoryService) Do(ctx context.Context, opts ...RequestOption) (res []*PositionMarginHistory, err error)
- func (s *GetPositionMarginHistoryService) EndTime(endTime int64) *GetPositionMarginHistoryService
- func (s *GetPositionMarginHistoryService) Limit(limit int64) *GetPositionMarginHistoryService
- func (s *GetPositionMarginHistoryService) StartTime(startTime int64) *GetPositionMarginHistoryService
- func (s *GetPositionMarginHistoryService) Symbol(symbol string) *GetPositionMarginHistoryService
- func (s *GetPositionMarginHistoryService) Type(_type int) *GetPositionMarginHistoryService
- type GetPositionModeService
- type GetPositionRiskService
- type HistoricalTradesService
- func (s *HistoricalTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*Trade, err error)
- func (s *HistoricalTradesService) FromID(fromID int64) *HistoricalTradesService
- func (s *HistoricalTradesService) Limit(limit int) *HistoricalTradesService
- func (s *HistoricalTradesService) Symbol(symbol string) *HistoricalTradesService
- type IncomeHistory
- type KeepaliveUserStreamService
- type Kline
- type KlinesService
- func (s *KlinesService) Do(ctx context.Context, opts ...RequestOption) (res []*Kline, err error)
- func (s *KlinesService) EndTime(endTime int64) *KlinesService
- func (s *KlinesService) Interval(interval string) *KlinesService
- func (s *KlinesService) Limit(limit int) *KlinesService
- func (s *KlinesService) StartTime(startTime int64) *KlinesService
- func (s *KlinesService) Symbol(symbol string) *KlinesService
- type LeverageBracket
- type LiquidationOrder
- type ListBookTickersService
- type ListLiquidationOrdersService
- func (s *ListLiquidationOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*LiquidationOrder, err error)
- func (s *ListLiquidationOrdersService) EndTime(endTime int64) *ListLiquidationOrdersService
- func (s *ListLiquidationOrdersService) Limit(limit int) *ListLiquidationOrdersService
- func (s *ListLiquidationOrdersService) StartTime(startTime int64) *ListLiquidationOrdersService
- func (s *ListLiquidationOrdersService) Symbol(symbol string) *ListLiquidationOrdersService
- type ListOpenOrdersService
- type ListOrdersService
- func (s *ListOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error)
- func (s *ListOrdersService) EndTime(endTime int64) *ListOrdersService
- func (s *ListOrdersService) Limit(limit int) *ListOrdersService
- func (s *ListOrdersService) OrderID(orderID int64) *ListOrdersService
- func (s *ListOrdersService) StartTime(startTime int64) *ListOrdersService
- func (s *ListOrdersService) Symbol(symbol string) *ListOrdersService
- type ListPriceChangeStatsService
- type ListPricesService
- type LotSizeFilter
- type MarginType
- type MarketLotSizeFilter
- type MaxNumOrdersFilter
- type NewOrderRespType
- type Order
- type OrderStatusType
- type OrderType
- type PercentPriceFilter
- type PingService
- type PositionMarginHistory
- type PositionMode
- type PositionRisk
- type PositionSideType
- type PremiumIndex
- type PremiumIndexService
- type PriceChangeStats
- type PriceFilter
- type RateLimit
- type RecentTradesService
- type RequestOption
- type ServerTimeService
- type SetServerTimeService
- type SideEffectType
- type SideType
- type StartUserStreamService
- type Symbol
- type SymbolFilterType
- type SymbolLeverage
- type SymbolPrice
- type SymbolStatusType
- type SymbolType
- type TimeInForceType
- type Trade
- type TradeV3
- type UpdatePositionMarginService
- func (s *UpdatePositionMarginService) Amount(amount string) *UpdatePositionMarginService
- func (s *UpdatePositionMarginService) Do(ctx context.Context, opts ...RequestOption) (err error)
- func (s *UpdatePositionMarginService) PositionSide(positionSide PositionSideType) *UpdatePositionMarginService
- func (s *UpdatePositionMarginService) Symbol(symbol string) *UpdatePositionMarginService
- func (s *UpdatePositionMarginService) Type(actionType int) *UpdatePositionMarginService
- type WorkingType
Constants ¶
const ( SideTypeBuy SideType = "BUY" SideTypeSell SideType = "SELL" PositionSideTypeBoth PositionSideType = "BOTH" PositionSideTypeLong PositionSideType = "LONG" PositionSideTypeShort PositionSideType = "SHORT" OrderTypeLimit OrderType = "LIMIT" OrderTypeMarket OrderType = "MARKET" OrderTypeStop OrderType = "STOP" OrderTypeStopMarket OrderType = "STOP_MARKET" OrderTypeTakeProfit OrderType = "TAKE_PROFIT" OrderTypeTakeProfitMarket OrderType = "TAKE_PROFIT_MARKET" OrderTypeTrailingStopMarket OrderType = "TRAILING_STOP_MARKET" TimeInForceTypeGTC TimeInForceType = "GTC" // Good Till Cancel TimeInForceTypeIOC TimeInForceType = "IOC" // Immediate or Cancel TimeInForceTypeFOK TimeInForceType = "FOK" // Fill or Kill TimeInForceTypeGTX TimeInForceType = "GTX" // Good Till Crossing (Post Only) NewOrderRespTypeACK NewOrderRespType = "ACK" NewOrderRespTypeRESULT NewOrderRespType = "RESULT" NewOrderRespTypeFULL NewOrderRespType = "FULL" OrderStatusTypeNew OrderStatusType = "NEW" OrderStatusTypePartiallyFilled OrderStatusType = "PARTIALLY_FILLED" OrderStatusTypeFilled OrderStatusType = "FILLED" OrderStatusTypeCanceled OrderStatusType = "CANCELED" OrderStatusTypeRejected OrderStatusType = "REJECTED" OrderStatusTypeExpired OrderStatusType = "EXPIRED" SymbolTypeFuture SymbolType = "FUTURE" WorkingTypeMarkPrice WorkingType = "MARK_PRICE" WorkingTypeContractPrice WorkingType = "CONTRACT_PRICE" SymbolStatusTypePreTrading SymbolStatusType = "PRE_TRADING" SymbolStatusTypeTrading SymbolStatusType = "TRADING" SymbolStatusTypePostTrading SymbolStatusType = "POST_TRADING" SymbolStatusTypeEndOfDay SymbolStatusType = "END_OF_DAY" SymbolStatusTypeHalt SymbolStatusType = "HALT" SymbolStatusTypeAuctionMatch SymbolStatusType = "AUCTION_MATCH" SymbolStatusTypeBreak SymbolStatusType = "BREAK" SymbolFilterTypeLotSize SymbolFilterType = "LOT_SIZE" SymbolFilterTypePrice SymbolFilterType = "PRICE_FILTER" SymbolFilterTypePercentPrice SymbolFilterType = "PERCENT_PRICE" SymbolFilterTypeMarketLotSize SymbolFilterType = "MARKET_LOT_SIZE" SymbolFilterTypeMaxNumOrders SymbolFilterType = "MAX_NUM_ORDERS" SideEffectTypeNoSideEffect SideEffectType = "NO_SIDE_EFFECT" SideEffectTypeMarginBuy SideEffectType = "MARGIN_BUY" SideEffectTypeAutoRepay SideEffectType = "AUTO_REPAY" MarginTypeIsolated MarginType = "ISOLATED" MarginTypeCrossed MarginType = "CROSSED" )
Global enums
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Assets []*AccountAsset `json:"assets"` CanDeposit bool `json:"canDeposit"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` FeeTier int `json:"feeTier"` MaxWithdrawAmount string `json:"maxWithdrawAmount"` Positions []*AccountPosition `json:"positions"` TotalInitialMargin string `json:"totalInitialMargin"` TotalMaintMargin string `json:"totalMaintMargin"` TotalMarginBalance string `json:"totalMarginBalance"` TotalOpenOrderInitialMargin string `json:"totalOpenOrderInitialMargin"` TotalPositionInitialMargin string `json:"totalPositionInitialMargin"` TotalUnrealizedProfit string `json:"totalUnrealizedProfit"` TotalWalletBalance string `json:"totalWalletBalance"` UpdateTime int64 `json:"updateTime"` }
Account define account info
type AccountAsset ¶
type AccountAsset struct { Asset string `json:"asset"` InitialMargin string `json:"initialMargin"` MaintMargin string `json:"maintMargin"` MarginBalance string `json:"marginBalance"` MaxWithdrawAmount string `json:"maxWithdrawAmount"` OpenOrderInitialMargin string `json:"openOrderInitialMargin"` PositionInitialMargin string `json:"positionInitialMargin"` UnrealizedProfit string `json:"unrealizedProfit"` WalletBalance string `json:"walletBalance"` }
AccountAsset define account asset
type AccountPosition ¶
type AccountPosition struct { Isolated bool `json:"isolated"` Leverage string `json:"leverage"` InitialMargin string `json:"initialMargin"` MaintMargin string `json:"maintMargin"` OpenOrderInitialMargin string `json:"openOrderInitialMargin"` PositionInitialMargin string `json:"positionInitialMargin"` Symbol string `json:"symbol"` UnrealizedProfit string `json:"unrealizedProfit"` }
AccountPosition define account position
type AggTrade ¶
type AggTrade struct { AggTradeID int64 `json:"a"` Price string `json:"p"` Quantity string `json:"q"` FirstTradeID int64 `json:"f"` LastTradeID int64 `json:"l"` Timestamp int64 `json:"T"` IsBuyerMaker bool `json:"m"` }
AggTrade define aggregate trade info
type AggTradesService ¶
type AggTradesService struct {
// contains filtered or unexported fields
}
AggTradesService list aggregate trades
func (*AggTradesService) Do ¶
func (s *AggTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*AggTrade, err error)
Do send request
func (*AggTradesService) EndTime ¶
func (s *AggTradesService) EndTime(endTime int64) *AggTradesService
EndTime set endTime
func (*AggTradesService) FromID ¶
func (s *AggTradesService) FromID(fromID int64) *AggTradesService
FromID set fromID
func (*AggTradesService) Limit ¶
func (s *AggTradesService) Limit(limit int) *AggTradesService
Limit set limit
func (*AggTradesService) StartTime ¶
func (s *AggTradesService) StartTime(startTime int64) *AggTradesService
StartTime set startTime
func (*AggTradesService) Symbol ¶
func (s *AggTradesService) Symbol(symbol string) *AggTradesService
Symbol set symbol
type Balance ¶
type Balance struct { AccountAlias string `json:"accountAlias"` Asset string `json:"asset"` Balance string `json:"balance"` WithdrawAvailable string `json:"withdrawAvailable"` }
Balance define user balance of your account
type BookTicker ¶
type BookTicker struct { Symbol string `json:"symbol"` BidPrice string `json:"bidPrice"` BidQuantity string `json:"bidQty"` AskPrice string `json:"askPrice"` AskQuantity string `json:"askQty"` }
BookTicker define book ticker info
type Bracket ¶
type Bracket struct { Bracket int `json:"bracket"` InitialLeverage int `json:"initialLeverage"` NotionalCap float64 `json:"notionalCap"` NotionalFloor float64 `json:"notionalFloor"` MaintMarginRatio float64 `json:"maintMarginRatio"` }
Bracket define the bracket
type CancelAllOpenOrdersService ¶
type CancelAllOpenOrdersService struct {
// contains filtered or unexported fields
}
CancelAllOpenOrdersService cancel all open orders
func (*CancelAllOpenOrdersService) Do ¶
func (s *CancelAllOpenOrdersService) Do(ctx context.Context, opts ...RequestOption) (err error)
Do send request
func (*CancelAllOpenOrdersService) Symbol ¶
func (s *CancelAllOpenOrdersService) Symbol(symbol string) *CancelAllOpenOrdersService
Symbol set symbol
type CancelOrderResponse ¶
type CancelOrderResponse struct { ClientOrderID string `json:"clientOrderId"` CumQuantity string `json:"cumQty"` CumQuote string `json:"cumQuote"` ExecutedQuantity string `json:"executedQty"` OrderID int64 `json:"orderId"` OrigQuantity string `json:"origQty"` Price string `json:"price"` ReduceOnly bool `json:"reduceOnly"` Side SideType `json:"side"` Status OrderStatusType `json:"status"` StopPrice string `json:"stopPrice"` Symbol string `json:"symbol"` TimeInForce TimeInForceType `json:"timeInForce"` Type OrderType `json:"type"` UpdateTime int64 `json:"updateTime"` WorkingType WorkingType `json:"workingType"` ActivatePrice string `json:"activatePrice"` PriceRate string `json:"priceRate"` OrigType string `json:"origType"` PositionSide PositionSideType `json:"positionSide"` }
CancelOrderResponse define response of canceling order
type CancelOrderService ¶
type CancelOrderService struct {
// contains filtered or unexported fields
}
CancelOrderService cancel an order
func (*CancelOrderService) Do ¶
func (s *CancelOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CancelOrderResponse, err error)
Do send request
func (*CancelOrderService) OrderID ¶
func (s *CancelOrderService) OrderID(orderID int64) *CancelOrderService
OrderID set orderID
func (*CancelOrderService) OrigClientOrderID ¶
func (s *CancelOrderService) OrigClientOrderID(origClientOrderID string) *CancelOrderService
OrigClientOrderID set origClientOrderID
func (*CancelOrderService) Symbol ¶
func (s *CancelOrderService) Symbol(symbol string) *CancelOrderService
Symbol set symbol
type ChangeLeverageService ¶
type ChangeLeverageService struct {
// contains filtered or unexported fields
}
ChangeLeverageService change user's initial leverage of specific symbol market
func (*ChangeLeverageService) Do ¶
func (s *ChangeLeverageService) Do(ctx context.Context, opts ...RequestOption) (res *SymbolLeverage, err error)
Do send request
func (*ChangeLeverageService) Leverage ¶
func (s *ChangeLeverageService) Leverage(leverage int) *ChangeLeverageService
Leverage set leverage
func (*ChangeLeverageService) Symbol ¶
func (s *ChangeLeverageService) Symbol(symbol string) *ChangeLeverageService
Symbol set symbol
type ChangeMarginTypeService ¶
type ChangeMarginTypeService struct {
// contains filtered or unexported fields
}
ChangeMarginTypeService change user's margin type of specific symbol market
func (*ChangeMarginTypeService) Do ¶
func (s *ChangeMarginTypeService) Do(ctx context.Context, opts ...RequestOption) (err error)
Do send request
func (*ChangeMarginTypeService) MarginType ¶
func (s *ChangeMarginTypeService) MarginType(marginType MarginType) *ChangeMarginTypeService
MarginType set margin type
func (*ChangeMarginTypeService) Symbol ¶
func (s *ChangeMarginTypeService) Symbol(symbol string) *ChangeMarginTypeService
Symbol set symbol
type ChangePositionModeService ¶
type ChangePositionModeService struct {
// contains filtered or unexported fields
}
ChangePositionModeService change user's position mode
func (*ChangePositionModeService) Do ¶
func (s *ChangePositionModeService) Do(ctx context.Context, opts ...RequestOption) (err error)
Do send request
func (*ChangePositionModeService) DualSide ¶
func (s *ChangePositionModeService) DualSide(dualSide bool) *ChangePositionModeService
Change user's position mode: true - Hedge Mode, false - One-way Mode
type Client ¶
type Client struct { APIKey string SecretKey string BaseURL string UserAgent string HTTPClient *http.Client Debug bool Logger *log.Logger TimeOffset int64 // contains filtered or unexported fields }
Client define API client
func NewClient ¶
NewClient initialize an API client instance with API key and secret key. You should always call this function before using this SDK. Services will be created by the form client.NewXXXService().
func (*Client) NewAggTradesService ¶
func (c *Client) NewAggTradesService() *AggTradesService
NewAggTradesService init aggregate trades service
func (*Client) NewCancelAllOpenOrdersService ¶
func (c *Client) NewCancelAllOpenOrdersService() *CancelAllOpenOrdersService
NewCancelAllOpenOrdersService init cancel all open orders service
func (*Client) NewCancelOrderService ¶
func (c *Client) NewCancelOrderService() *CancelOrderService
NewCancelOrderService init cancel order service
func (*Client) NewChangeLeverageService ¶
func (c *Client) NewChangeLeverageService() *ChangeLeverageService
NewChangeLeverageService init change leverage service
func (*Client) NewChangeMarginTypeService ¶
func (c *Client) NewChangeMarginTypeService() *ChangeMarginTypeService
NewChangeMarginTypeService init change margin type service
func (*Client) NewChangePositionModeService ¶
func (c *Client) NewChangePositionModeService() *ChangePositionModeService
ChangePositionModeService init change position mode service
func (*Client) NewCloseUserStreamService ¶
func (c *Client) NewCloseUserStreamService() *CloseUserStreamService
NewCloseUserStreamService init closing user stream service
func (*Client) NewCreateOrderService ¶
func (c *Client) NewCreateOrderService() *CreateOrderService
NewCreateOrderService init creating order service
func (*Client) NewDepthService ¶
func (c *Client) NewDepthService() *DepthService
NewDepthService init depth service
func (*Client) NewExchangeInfoService ¶
func (c *Client) NewExchangeInfoService() *ExchangeInfoService
NewExchangeInfoService init exchange info service
func (*Client) NewFundingRateService ¶
func (c *Client) NewFundingRateService() *FundingRateService
NewFundingRateService init funding rate service
func (*Client) NewGetAccountService ¶
func (c *Client) NewGetAccountService() *GetAccountService
NewGetAccountService init getting account service
func (*Client) NewGetBalanceService ¶
func (c *Client) NewGetBalanceService() *GetBalanceService
NewGetBalanceService init getting balance service
func (*Client) NewGetIncomeHistoryService ¶
func (c *Client) NewGetIncomeHistoryService() *GetIncomeHistoryService
NewGetIncomeHistoryService init getting income history service
func (*Client) NewGetLeverageBracketService ¶
func (c *Client) NewGetLeverageBracketService() *GetLeverageBracketService
NewGetLeverageBracketService init change leverage service
func (*Client) NewGetOrderService ¶
func (c *Client) NewGetOrderService() *GetOrderService
NewGetOrderService init get order service
func (*Client) NewGetPositionMarginHistoryService ¶
func (c *Client) NewGetPositionMarginHistoryService() *GetPositionMarginHistoryService
NewGetPositionMarginHistoryService init getting position margin history service
func (*Client) NewGetPositionModeService ¶
func (c *Client) NewGetPositionModeService() *GetPositionModeService
GetPositionModeService init get position mode service
func (*Client) NewGetPositionRiskService ¶
func (c *Client) NewGetPositionRiskService() *GetPositionRiskService
NewGetPositionRiskService init getting position risk service
func (*Client) NewHistoricalTradesService ¶
func (c *Client) NewHistoricalTradesService() *HistoricalTradesService
NewHistoricalTradesService init listing trades service
func (*Client) NewKeepaliveUserStreamService ¶
func (c *Client) NewKeepaliveUserStreamService() *KeepaliveUserStreamService
NewKeepaliveUserStreamService init keep alive user stream service
func (*Client) NewKlinesService ¶
func (c *Client) NewKlinesService() *KlinesService
NewKlinesService init klines service
func (*Client) NewListBookTickersService ¶
func (c *Client) NewListBookTickersService() *ListBookTickersService
NewListBookTickersService init listing booking tickers service
func (*Client) NewListLiquidationOrdersService ¶
func (c *Client) NewListLiquidationOrdersService() *ListLiquidationOrdersService
NewListLiquidationOrdersService init funding rate service
func (*Client) NewListOpenOrdersService ¶
func (c *Client) NewListOpenOrdersService() *ListOpenOrdersService
NewListOpenOrdersService init list open orders service
func (*Client) NewListOrdersService ¶
func (c *Client) NewListOrdersService() *ListOrdersService
NewListOrdersService init listing orders service
func (*Client) NewListPriceChangeStatsService ¶
func (c *Client) NewListPriceChangeStatsService() *ListPriceChangeStatsService
NewListPriceChangeStatsService init list prices change stats service
func (*Client) NewListPricesService ¶
func (c *Client) NewListPricesService() *ListPricesService
NewListPricesService init listing prices service
func (*Client) NewPingService ¶
func (c *Client) NewPingService() *PingService
NewPingService init ping service
func (*Client) NewPremiumIndexService ¶
func (c *Client) NewPremiumIndexService() *PremiumIndexService
NewPremiumIndexService init premium index service
func (*Client) NewRecentTradesService ¶
func (c *Client) NewRecentTradesService() *RecentTradesService
NewRecentTradesService init recent trades service
func (*Client) NewServerTimeService ¶
func (c *Client) NewServerTimeService() *ServerTimeService
NewServerTimeService init server time service
func (*Client) NewSetServerTimeService ¶
func (c *Client) NewSetServerTimeService() *SetServerTimeService
NewSetServerTimeService init set server time service
func (*Client) NewStartUserStreamService ¶
func (c *Client) NewStartUserStreamService() *StartUserStreamService
NewStartUserStreamService init starting user stream service
func (*Client) NewUpdatePositionMarginService ¶
func (c *Client) NewUpdatePositionMarginService() *UpdatePositionMarginService
NewUpdatePositionMarginService init update position margin
type CloseUserStreamService ¶
type CloseUserStreamService struct {
// contains filtered or unexported fields
}
CloseUserStreamService delete listen key
func (*CloseUserStreamService) Do ¶
func (s *CloseUserStreamService) Do(ctx context.Context, opts ...RequestOption) (err error)
Do send request
func (*CloseUserStreamService) ListenKey ¶
func (s *CloseUserStreamService) ListenKey(listenKey string) *CloseUserStreamService
ListenKey set listen key
type CreateOrderResponse ¶
type CreateOrderResponse struct { Symbol string `json:"symbol"` OrderID int64 `json:"orderId"` ClientOrderID string `json:"clientOrderId"` Price string `json:"price"` OrigQuantity string `json:"origQty"` ExecutedQuantity string `json:"executedQty"` CumQuote string `json:"cumQuote"` ReduceOnly bool `json:"reduceOnly"` Status OrderStatusType `json:"status"` StopPrice string `json:"stopPrice"` TimeInForce TimeInForceType `json:"timeInForce"` Type OrderType `json:"type"` Side SideType `json:"side"` UpdateTime int64 `json:"updateTime"` WorkingType WorkingType `json:"workingType"` ActivatePrice string `json:"activatePrice"` PriceRate string `json:"priceRate"` AvgPrice string `json:"avgPrice"` PositionSide PositionSideType `json:"positionSide"` }
CreateOrderResponse define create order response
type CreateOrderService ¶
type CreateOrderService struct {
// contains filtered or unexported fields
}
CreateOrderService create order
func (*CreateOrderService) ActivationPrice ¶
func (s *CreateOrderService) ActivationPrice(activationPrice string) *CreateOrderService
ActivationPrice set activationPrice
func (*CreateOrderService) CallbackRate ¶
func (s *CreateOrderService) CallbackRate(callbackRate string) *CreateOrderService
CallbackRate set callbackRate
func (*CreateOrderService) Do ¶
func (s *CreateOrderService) Do(ctx context.Context, opts ...RequestOption) (res *CreateOrderResponse, err error)
Do send request
func (*CreateOrderService) NewClientOrderID ¶
func (s *CreateOrderService) NewClientOrderID(newClientOrderID string) *CreateOrderService
NewClientOrderID set newClientOrderID
func (*CreateOrderService) PositionSide ¶
func (s *CreateOrderService) PositionSide(positionSide PositionSideType) *CreateOrderService
PositionSide set side
func (*CreateOrderService) Price ¶
func (s *CreateOrderService) Price(price string) *CreateOrderService
Price set price
func (*CreateOrderService) Quantity ¶
func (s *CreateOrderService) Quantity(quantity string) *CreateOrderService
Quantity set quantity
func (*CreateOrderService) ReduceOnly ¶
func (s *CreateOrderService) ReduceOnly(reduceOnly bool) *CreateOrderService
ReduceOnly set reduceOnly
func (*CreateOrderService) Side ¶
func (s *CreateOrderService) Side(side SideType) *CreateOrderService
Side set side
func (*CreateOrderService) StopPrice ¶
func (s *CreateOrderService) StopPrice(stopPrice string) *CreateOrderService
StopPrice set stopPrice
func (*CreateOrderService) Symbol ¶
func (s *CreateOrderService) Symbol(symbol string) *CreateOrderService
Symbol set symbol
func (*CreateOrderService) TimeInForce ¶
func (s *CreateOrderService) TimeInForce(timeInForce TimeInForceType) *CreateOrderService
TimeInForce set timeInForce
func (*CreateOrderService) Type ¶
func (s *CreateOrderService) Type(orderType OrderType) *CreateOrderService
Type set type
func (*CreateOrderService) WorkingType ¶
func (s *CreateOrderService) WorkingType(workingType WorkingType) *CreateOrderService
WorkingType set workingType
type DepthResponse ¶
type DepthResponse struct { LastUpdateID int64 `json:"lastUpdateId"` Bids []Bid `json:"bids"` Asks []Ask `json:"asks"` }
DepthResponse define depth info with bids and asks
type DepthService ¶
type DepthService struct {
// contains filtered or unexported fields
}
DepthService show depth info
func (*DepthService) Do ¶
func (s *DepthService) Do(ctx context.Context, opts ...RequestOption) (res *DepthResponse, err error)
Do send request
func (*DepthService) Symbol ¶
func (s *DepthService) Symbol(symbol string) *DepthService
Symbol set symbol
type ExchangeInfo ¶
type ExchangeInfo struct { Timezone string `json:"timezone"` ServerTime int64 `json:"serverTime"` RateLimits []RateLimit `json:"rateLimits"` ExchangeFilters []interface{} `json:"exchangeFilters"` Symbols []Symbol `json:"symbols"` }
ExchangeInfo exchange info
type ExchangeInfoService ¶
type ExchangeInfoService struct {
// contains filtered or unexported fields
}
ExchangeInfoService exchange info service
func (*ExchangeInfoService) Do ¶
func (s *ExchangeInfoService) Do(ctx context.Context, opts ...RequestOption) (res *ExchangeInfo, err error)
Do send request
type FundingRate ¶
type FundingRate struct { Symbol string `json:"symbol"` FundingRate string `json:"fundingRate"` FundingTime int64 `json:"fundingTime"` Time int64 `json:"time"` }
FundingRate define funding rate of mark price
type FundingRateService ¶
type FundingRateService struct {
// contains filtered or unexported fields
}
FundingRateService get funding rate
func (*FundingRateService) Do ¶
func (s *FundingRateService) Do(ctx context.Context, opts ...RequestOption) (res []*FundingRate, err error)
Do send request
func (*FundingRateService) EndTime ¶
func (s *FundingRateService) EndTime(endTime int64) *FundingRateService
EndTime set startTime
func (*FundingRateService) Limit ¶
func (s *FundingRateService) Limit(limit int) *FundingRateService
Limit set limit
func (*FundingRateService) StartTime ¶
func (s *FundingRateService) StartTime(startTime int64) *FundingRateService
StartTime set startTime
func (*FundingRateService) Symbol ¶
func (s *FundingRateService) Symbol(symbol string) *FundingRateService
Symbol set symbol
type GetAccountService ¶
type GetAccountService struct {
// contains filtered or unexported fields
}
GetAccountService get account info
func (*GetAccountService) Do ¶
func (s *GetAccountService) Do(ctx context.Context, opts ...RequestOption) (res *Account, err error)
Do send request
type GetBalanceService ¶
type GetBalanceService struct {
// contains filtered or unexported fields
}
GetBalanceService get account balance
func (*GetBalanceService) Do ¶
func (s *GetBalanceService) Do(ctx context.Context, opts ...RequestOption) (res []*Balance, err error)
Do send request
type GetIncomeHistoryService ¶
type GetIncomeHistoryService struct {
// contains filtered or unexported fields
}
GetIncomeHistoryService get position margin history service
func (*GetIncomeHistoryService) Do ¶
func (s *GetIncomeHistoryService) Do(ctx context.Context, opts ...RequestOption) (res []*IncomeHistory, err error)
Do send request
func (*GetIncomeHistoryService) EndTime ¶
func (s *GetIncomeHistoryService) EndTime(endTime int64) *GetIncomeHistoryService
EndTime set endTime
func (*GetIncomeHistoryService) IncomeType ¶
func (s *GetIncomeHistoryService) IncomeType(incomeType string) *GetIncomeHistoryService
IncomeType set income type
func (*GetIncomeHistoryService) Limit ¶
func (s *GetIncomeHistoryService) Limit(limit int64) *GetIncomeHistoryService
Limit set limit
func (*GetIncomeHistoryService) StartTime ¶
func (s *GetIncomeHistoryService) StartTime(startTime int64) *GetIncomeHistoryService
StartTime set startTime
func (*GetIncomeHistoryService) Symbol ¶
func (s *GetIncomeHistoryService) Symbol(symbol string) *GetIncomeHistoryService
Symbol set symbol
type GetLeverageBracketService ¶
type GetLeverageBracketService struct {
// contains filtered or unexported fields
}
GetLeverageBracketService get funding rate
func (*GetLeverageBracketService) Do ¶
func (s *GetLeverageBracketService) Do(ctx context.Context, opts ...RequestOption) (res []*LeverageBracket, err error)
Do send request
func (*GetLeverageBracketService) Symbol ¶
func (s *GetLeverageBracketService) Symbol(symbol string) *GetLeverageBracketService
Symbol set symbol
type GetOrderService ¶
type GetOrderService struct {
// contains filtered or unexported fields
}
GetOrderService get an order
func (*GetOrderService) Do ¶
func (s *GetOrderService) Do(ctx context.Context, opts ...RequestOption) (res *Order, err error)
Do send request
func (*GetOrderService) OrderID ¶
func (s *GetOrderService) OrderID(orderID int64) *GetOrderService
OrderID set orderID
func (*GetOrderService) OrigClientOrderID ¶
func (s *GetOrderService) OrigClientOrderID(origClientOrderID string) *GetOrderService
OrigClientOrderID set origClientOrderID
func (*GetOrderService) Symbol ¶
func (s *GetOrderService) Symbol(symbol string) *GetOrderService
Symbol set symbol
type GetPositionMarginHistoryService ¶
type GetPositionMarginHistoryService struct {
// contains filtered or unexported fields
}
GetPositionMarginHistoryService get position margin history service
func (*GetPositionMarginHistoryService) Do ¶
func (s *GetPositionMarginHistoryService) Do(ctx context.Context, opts ...RequestOption) (res []*PositionMarginHistory, err error)
Do send request
func (*GetPositionMarginHistoryService) EndTime ¶
func (s *GetPositionMarginHistoryService) EndTime(endTime int64) *GetPositionMarginHistoryService
EndTime set endTime
func (*GetPositionMarginHistoryService) Limit ¶
func (s *GetPositionMarginHistoryService) Limit(limit int64) *GetPositionMarginHistoryService
Limit set limit
func (*GetPositionMarginHistoryService) StartTime ¶
func (s *GetPositionMarginHistoryService) StartTime(startTime int64) *GetPositionMarginHistoryService
StartTime set startTime
func (*GetPositionMarginHistoryService) Symbol ¶
func (s *GetPositionMarginHistoryService) Symbol(symbol string) *GetPositionMarginHistoryService
Symbol set symbol
func (*GetPositionMarginHistoryService) Type ¶
func (s *GetPositionMarginHistoryService) Type(_type int) *GetPositionMarginHistoryService
Type set type
type GetPositionModeService ¶
type GetPositionModeService struct {
// contains filtered or unexported fields
}
GetPositionModeService get user's position mode
func (*GetPositionModeService) Do ¶
func (s *GetPositionModeService) Do(ctx context.Context, opts ...RequestOption) (res *PositionMode, err error)
Do send request
type GetPositionRiskService ¶
type GetPositionRiskService struct {
// contains filtered or unexported fields
}
GetPositionRiskService get account balance
func (*GetPositionRiskService) Do ¶
func (s *GetPositionRiskService) Do(ctx context.Context, opts ...RequestOption) (res []*PositionRisk, err error)
Do send request
type HistoricalTradesService ¶
type HistoricalTradesService struct {
// contains filtered or unexported fields
}
HistoricalTradesService trades
func (*HistoricalTradesService) Do ¶
func (s *HistoricalTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*Trade, err error)
Do send request
func (*HistoricalTradesService) FromID ¶
func (s *HistoricalTradesService) FromID(fromID int64) *HistoricalTradesService
FromID set fromID
func (*HistoricalTradesService) Limit ¶
func (s *HistoricalTradesService) Limit(limit int) *HistoricalTradesService
Limit set limit
func (*HistoricalTradesService) Symbol ¶
func (s *HistoricalTradesService) Symbol(symbol string) *HistoricalTradesService
Symbol set symbol
type IncomeHistory ¶
type IncomeHistory struct { Asset string `json:"asset"` Income string `json:"income"` IncomeType string `json:"incomeType"` Info string `json:"info"` Symbol string `json:"symbol"` Time int64 `json:"time"` }
IncomeHistory define position margin history info
type KeepaliveUserStreamService ¶
type KeepaliveUserStreamService struct {
// contains filtered or unexported fields
}
KeepaliveUserStreamService update listen key
func (*KeepaliveUserStreamService) Do ¶
func (s *KeepaliveUserStreamService) Do(ctx context.Context, opts ...RequestOption) (err error)
Do send request
func (*KeepaliveUserStreamService) ListenKey ¶
func (s *KeepaliveUserStreamService) ListenKey(listenKey string) *KeepaliveUserStreamService
ListenKey set listen key
type Kline ¶
type Kline struct { OpenTime int64 `json:"openTime"` Open string `json:"open"` High string `json:"high"` Low string `json:"low"` Close string `json:"close"` Volume string `json:"volume"` CloseTime int64 `json:"closeTime"` QuoteAssetVolume string `json:"quoteAssetVolume"` TradeNum int64 `json:"tradeNum"` TakerBuyBaseAssetVolume string `json:"takerBuyBaseAssetVolume"` TakerBuyQuoteAssetVolume string `json:"takerBuyQuoteAssetVolume"` }
Kline define kline info
type KlinesService ¶
type KlinesService struct {
// contains filtered or unexported fields
}
KlinesService list klines
func (*KlinesService) Do ¶
func (s *KlinesService) Do(ctx context.Context, opts ...RequestOption) (res []*Kline, err error)
Do send request
func (*KlinesService) EndTime ¶
func (s *KlinesService) EndTime(endTime int64) *KlinesService
EndTime set endTime
func (*KlinesService) Interval ¶
func (s *KlinesService) Interval(interval string) *KlinesService
Interval set interval
func (*KlinesService) Limit ¶
func (s *KlinesService) Limit(limit int) *KlinesService
Limit set limit
func (*KlinesService) StartTime ¶
func (s *KlinesService) StartTime(startTime int64) *KlinesService
StartTime set startTime
func (*KlinesService) Symbol ¶
func (s *KlinesService) Symbol(symbol string) *KlinesService
Symbol set symbol
type LeverageBracket ¶
LeverageBracket define the leverage bracket
type LiquidationOrder ¶
type LiquidationOrder struct { Symbol string `json:"symbol"` Price string `json:"price"` OrigQuantity string `json:"origQty"` ExecutedQuantity string `json:"executedQty"` AveragePrice string `json:"avragePrice"` Status OrderStatusType `json:"status"` TimeInForce TimeInForceType `json:"timeInForce"` Type OrderType `json:"type"` Side SideType `json:"side"` Time int64 `json:"time"` }
LiquidationOrder define liquidation order
type ListBookTickersService ¶
type ListBookTickersService struct {
// contains filtered or unexported fields
}
ListBookTickersService list best price/qty on the order book for a symbol or symbols
func (*ListBookTickersService) Do ¶
func (s *ListBookTickersService) Do(ctx context.Context, opts ...RequestOption) (res []*BookTicker, err error)
Do send request
func (*ListBookTickersService) Symbol ¶
func (s *ListBookTickersService) Symbol(symbol string) *ListBookTickersService
Symbol set symbol
type ListLiquidationOrdersService ¶
type ListLiquidationOrdersService struct {
// contains filtered or unexported fields
}
ListLiquidationOrdersService list liquidation orders
func (*ListLiquidationOrdersService) Do ¶
func (s *ListLiquidationOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*LiquidationOrder, err error)
Do send request
func (*ListLiquidationOrdersService) EndTime ¶
func (s *ListLiquidationOrdersService) EndTime(endTime int64) *ListLiquidationOrdersService
EndTime set startTime
func (*ListLiquidationOrdersService) Limit ¶
func (s *ListLiquidationOrdersService) Limit(limit int) *ListLiquidationOrdersService
Limit set limit
func (*ListLiquidationOrdersService) StartTime ¶
func (s *ListLiquidationOrdersService) StartTime(startTime int64) *ListLiquidationOrdersService
StartTime set startTime
func (*ListLiquidationOrdersService) Symbol ¶
func (s *ListLiquidationOrdersService) Symbol(symbol string) *ListLiquidationOrdersService
Symbol set symbol
type ListOpenOrdersService ¶
type ListOpenOrdersService struct {
// contains filtered or unexported fields
}
ListOpenOrdersService list opened orders
func (*ListOpenOrdersService) Do ¶
func (s *ListOpenOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error)
Do send request
func (*ListOpenOrdersService) Symbol ¶
func (s *ListOpenOrdersService) Symbol(symbol string) *ListOpenOrdersService
Symbol set symbol
type ListOrdersService ¶
type ListOrdersService struct {
// contains filtered or unexported fields
}
ListOrdersService all account orders; active, canceled, or filled
func (*ListOrdersService) Do ¶
func (s *ListOrdersService) Do(ctx context.Context, opts ...RequestOption) (res []*Order, err error)
Do send request
func (*ListOrdersService) EndTime ¶
func (s *ListOrdersService) EndTime(endTime int64) *ListOrdersService
EndTime set endtime
func (*ListOrdersService) Limit ¶
func (s *ListOrdersService) Limit(limit int) *ListOrdersService
Limit set limit
func (*ListOrdersService) OrderID ¶
func (s *ListOrdersService) OrderID(orderID int64) *ListOrdersService
OrderID set orderID
func (*ListOrdersService) StartTime ¶
func (s *ListOrdersService) StartTime(startTime int64) *ListOrdersService
StartTime set starttime
func (*ListOrdersService) Symbol ¶
func (s *ListOrdersService) Symbol(symbol string) *ListOrdersService
Symbol set symbol
type ListPriceChangeStatsService ¶
type ListPriceChangeStatsService struct {
// contains filtered or unexported fields
}
ListPriceChangeStatsService show stats of price change in last 24 hours for all symbols
func (*ListPriceChangeStatsService) Do ¶
func (s *ListPriceChangeStatsService) Do(ctx context.Context, opts ...RequestOption) (res []*PriceChangeStats, err error)
Do send request
func (*ListPriceChangeStatsService) Symbol ¶
func (s *ListPriceChangeStatsService) Symbol(symbol string) *ListPriceChangeStatsService
Symbol set symbol
type ListPricesService ¶
type ListPricesService struct {
// contains filtered or unexported fields
}
ListPricesService list latest price for a symbol or symbols
func (*ListPricesService) Do ¶
func (s *ListPricesService) Do(ctx context.Context, opts ...RequestOption) (res []*SymbolPrice, err error)
Do send request
func (*ListPricesService) Symbol ¶
func (s *ListPricesService) Symbol(symbol string) *ListPricesService
Symbol set symbol
type LotSizeFilter ¶
type LotSizeFilter struct { MaxQuantity string `json:"maxQty"` MinQuantity string `json:"minQty"` StepSize string `json:"stepSize"` }
LotSizeFilter define lot size filter of symbol
type MarketLotSizeFilter ¶
type MarketLotSizeFilter struct { MaxQuantity string `json:"maxQty"` MinQuantity string `json:"minQty"` StepSize string `json:"stepSize"` }
MarketLotSizeFilter define market lot size filter of symbol
type MaxNumOrdersFilter ¶
type MaxNumOrdersFilter struct {
Limit int64 `json:"limit"`
}
MaxNumOrdersFilter define max num orders filter of symbol
type NewOrderRespType ¶
type NewOrderRespType string
NewOrderRespType define response JSON verbosity
type Order ¶
type Order struct { Symbol string `json:"symbol"` OrderID int64 `json:"orderId"` ClientOrderID string `json:"clientOrderId"` Price string `json:"price"` ReduceOnly bool `json:"reduceOnly"` OrigQuantity string `json:"origQty"` ExecutedQuantity string `json:"executedQty"` CumQuantity string `json:"cumQty"` CumQuote string `json:"cumQuote"` Status OrderStatusType `json:"status"` TimeInForce TimeInForceType `json:"timeInForce"` Type OrderType `json:"type"` Side SideType `json:"side"` StopPrice string `json:"stopPrice"` Time int64 `json:"time"` UpdateTime int64 `json:"updateTime"` WorkingType WorkingType `json:"workingType"` ActivatePrice string `json:"activatePrice"` PriceRate string `json:"priceRate"` AvgPrice string `json:"avgPrice"` OrigType string `json:"origType"` PositionSide PositionSideType `json:"positionSide"` }
Order define order info
type PercentPriceFilter ¶
type PercentPriceFilter struct { MultiplierDecimal int `json:"multiplierDecimal"` MultiplierUp string `json:"multiplierUp"` MultiplierDown string `json:"multiplierDown"` }
PercentPriceFilter define percent price filter of symbol
type PingService ¶
type PingService struct {
// contains filtered or unexported fields
}
PingService ping server
func (*PingService) Do ¶
func (s *PingService) Do(ctx context.Context, opts ...RequestOption) (err error)
Do send request
type PositionMarginHistory ¶
type PositionMarginHistory struct { Amount string `json:"amount"` Asset string `json:"asset"` Symbol string `json:"symbol"` Time int64 `json:"time"` Type int `json:"type"` PositionSide string `json:"positionSide"` }
PositionMarginHistory define position margin history info
type PositionMode ¶
type PositionMode struct {
DualSidePosition bool `json:"dualSidePosition"`
}
Response of user's position mode
type PositionRisk ¶
type PositionRisk struct { EntryPrice string `json:"entryPrice"` MarginType string `json:"marginType"` IsAutoAddMargin string `json:"isAutoAddMargin"` IsolatedMargin string `json:"isolatedMargin"` Leverage string `json:"leverage"` LiquidationPrice string `json:"liquidationPrice"` MarkPrice string `json:"markPrice"` MaxNotionalValue string `json:"maxNotionalValue"` PositionAmt string `json:"positionAmt"` Symbol string `json:"symbol"` UnRealizedProfit string `json:"unRealizedProfit"` PositionSide string `json:"positionSide"` }
PositionRisk define position risk info
type PositionSideType ¶
type PositionSideType string
PositionSideType define position side type of order
type PremiumIndex ¶
type PremiumIndex struct { Symbol string `json:"symbol"` MarkPrice string `json:"markPrice"` LastFundingRate string `json:"lastFundingRate"` NextFundingTime int64 `json:"nextFundingTime"` Time int64 `json:"time"` }
PremiumIndex define premium index of mark price
type PremiumIndexService ¶
type PremiumIndexService struct {
// contains filtered or unexported fields
}
PremiumIndexService get premium index
func (*PremiumIndexService) Do ¶
func (s *PremiumIndexService) Do(ctx context.Context, opts ...RequestOption) (res *PremiumIndex, err error)
Do send request
func (*PremiumIndexService) Symbol ¶
func (s *PremiumIndexService) Symbol(symbol string) *PremiumIndexService
Symbol set symbol
type PriceChangeStats ¶
type PriceChangeStats struct { Symbol string `json:"symbol"` PriceChange string `json:"priceChange"` PriceChangePercent string `json:"priceChangePercent"` WeightedAvgPrice string `json:"weightedAvgPrice"` PrevClosePrice string `json:"prevClosePrice"` LastPrice string `json:"lastPrice"` LastQuantity string `json:"lastQty"` OpenPrice string `json:"openPrice"` HighPrice string `json:"highPrice"` LowPrice string `json:"lowPrice"` Volume string `json:"volume"` QuoteVolume string `json:"quoteVolume"` OpenTime int64 `json:"openTime"` CloseTime int64 `json:"closeTime"` FristID int64 `json:"firstId"` LastID int64 `json:"lastId"` Count int64 `json:"count"` }
PriceChangeStats define price change stats
type PriceFilter ¶
type PriceFilter struct { MaxPrice string `json:"maxPrice"` MinPrice string `json:"minPrice"` TickSize string `json:"tickSize"` }
PriceFilter define price filter of symbol
type RateLimit ¶
type RateLimit struct { RateLimitType string `json:"rateLimitType"` Interval string `json:"interval"` IntervalNum int64 `json:"intervalNum"` Limit int64 `json:"limit"` }
RateLimit struct
type RecentTradesService ¶
type RecentTradesService struct {
// contains filtered or unexported fields
}
RecentTradesService list recent trades
func (*RecentTradesService) Do ¶
func (s *RecentTradesService) Do(ctx context.Context, opts ...RequestOption) (res []*Trade, err error)
Do send request
func (*RecentTradesService) Limit ¶
func (s *RecentTradesService) Limit(limit int) *RecentTradesService
Limit set limit
func (*RecentTradesService) Symbol ¶
func (s *RecentTradesService) Symbol(symbol string) *RecentTradesService
Symbol set symbol
type RequestOption ¶
type RequestOption func(*request)
RequestOption define option type for request
func WithRecvWindow ¶
func WithRecvWindow(recvWindow int64) RequestOption
WithRecvWindow set recvWindow param for the request
type ServerTimeService ¶
type ServerTimeService struct {
// contains filtered or unexported fields
}
ServerTimeService get server time
func (*ServerTimeService) Do ¶
func (s *ServerTimeService) Do(ctx context.Context, opts ...RequestOption) (serverTime int64, err error)
Do send request
type SetServerTimeService ¶
type SetServerTimeService struct {
// contains filtered or unexported fields
}
SetServerTimeService set server time
func (*SetServerTimeService) Do ¶
func (s *SetServerTimeService) Do(ctx context.Context, opts ...RequestOption) (timeOffset int64, err error)
Do send request
type StartUserStreamService ¶
type StartUserStreamService struct {
// contains filtered or unexported fields
}
StartUserStreamService create listen key for user stream service
func (*StartUserStreamService) Do ¶
func (s *StartUserStreamService) Do(ctx context.Context, opts ...RequestOption) (listenKey string, err error)
Do send request
type Symbol ¶
type Symbol struct { Symbol string `json:"symbol"` Status string `json:"status"` MaintMarginPercent string `json:"maintMarginPercent"` PricePrecision int `json:"pricePrecision"` QuantityPrecision int `json:"quantityPrecision"` RequiredMarginPercent string `json:"requiredMarginPercent"` OrderType []OrderType `json:"OrderType"` TimeInForce []TimeInForceType `json:"timeInForce"` Filters []map[string]interface{} `json:"filters"` }
Symbol market symbol
func (*Symbol) LotSizeFilter ¶
func (s *Symbol) LotSizeFilter() *LotSizeFilter
LotSizeFilter return lot size filter of symbol
func (*Symbol) MarketLotSizeFilter ¶
func (s *Symbol) MarketLotSizeFilter() *MarketLotSizeFilter
MarketLotSizeFilter return market lot size filter of symbol
func (*Symbol) MaxNumOrdersFilter ¶
func (s *Symbol) MaxNumOrdersFilter() *MaxNumOrdersFilter
MaxNumOrdersFilter return max num orders filter of symbol
func (*Symbol) PercentPriceFilter ¶
func (s *Symbol) PercentPriceFilter() *PercentPriceFilter
PercentPriceFilter return percent price filter of symbol
func (*Symbol) PriceFilter ¶
func (s *Symbol) PriceFilter() *PriceFilter
PriceFilter return price filter of symbol
type SymbolLeverage ¶
type SymbolLeverage struct { Leverage int `json:"leverage"` MaxNotionalValue string `json:"maxNotionalValue"` Symbol string `json:"symbol"` }
SymbolLeverage define leverage info of symbol
type SymbolPrice ¶
SymbolPrice define symbol and price pair
type TimeInForceType ¶
type TimeInForceType string
TimeInForceType define time in force type of order
type Trade ¶
type Trade struct { ID int64 `json:"id"` Price string `json:"price"` Quantity string `json:"qty"` QuoteQuantity string `json:"quoteQty"` Time int64 `json:"time"` IsBuyerMaker bool `json:"isBuyerMaker"` }
Trade define trade info
type TradeV3 ¶
type TradeV3 struct { ID int64 `json:"id"` Symbol string `json:"symbol"` OrderID int64 `json:"orderId"` Price string `json:"price"` Quantity string `json:"qty"` QuoteQuantity string `json:"quoteQty"` Commission string `json:"commission"` CommissionAsset string `json:"commissionAsset"` Time int64 `json:"time"` IsBuyer bool `json:"isBuyer"` IsMaker bool `json:"isMaker"` IsBestMatch bool `json:"isBestMatch"` }
TradeV3 define v3 trade info
type UpdatePositionMarginService ¶
type UpdatePositionMarginService struct {
// contains filtered or unexported fields
}
UpdatePositionMarginService update isolated position margin
func (*UpdatePositionMarginService) Amount ¶
func (s *UpdatePositionMarginService) Amount(amount string) *UpdatePositionMarginService
Amount set position margin amount
func (*UpdatePositionMarginService) Do ¶
func (s *UpdatePositionMarginService) Do(ctx context.Context, opts ...RequestOption) (err error)
Do send request
func (*UpdatePositionMarginService) PositionSide ¶
func (s *UpdatePositionMarginService) PositionSide(positionSide PositionSideType) *UpdatePositionMarginService
Side set side
func (*UpdatePositionMarginService) Symbol ¶
func (s *UpdatePositionMarginService) Symbol(symbol string) *UpdatePositionMarginService
Symbol set symbol
func (*UpdatePositionMarginService) Type ¶
func (s *UpdatePositionMarginService) Type(actionType int) *UpdatePositionMarginService
Type set action type: 1: Add postion margin,2: Reduce postion margin