bybit

package module
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

golangci-lint test

bybit

bybit is an bybit client for the Go programing language.

Usage

REST API
import "github.com/oneart-dev/bybit"

client := bybit.NewClient().WithAuth("your api key", "your api secret")
res, err := client.Future().InversePerpetual().Balance(bybit.CoinBTC)
// do as you want
WebSocket API

for single use

import "github.com/oneart-dev/bybit"

wsClient := bybit.NewWebsocketClient()
svc, err := wsClient.Spot().V1().PublicV1()
if err != nil {
	return err
}
_, err = svc.SubscribeTrade(bybit.SymbolSpotBTCUSDT, func(response bybit.SpotWebsocketV1PublicV1TradeResponse) error {
	// do as you want
})
if err != nil {
	return err
}
svc.Start(context.Background())

for multiple use

import "github.com/oneart-dev/bybit"

wsClient := bybit.NewWebsocketClient()

executors := []bybit.WebsocketExecutor{}

svcRoot := wsClient.Spot().V1()
{
	svc, err := svcRoot.PublicV1()
	if err != nil {
		return err
	}
	_, err = svc.SubscribeTrade(bybit.SymbolSpotBTCUSDT, func(response bybit.SpotWebsocketV1PublicV1TradeResponse) error {
		// do as you want
	})
	if err != nil {
		return err
	}
	executors = append(executors, svc)
}
{
	svc, err := svcRoot.PublicV2()
	if err != nil {
		return err
	}
	_, err = svc.SubscribeTrade(bybit.SymbolSpotBTCUSDT, func(response bybit.SpotWebsocketV1PublicV2TradeResponse) error {
		// do as you want
	})
	if err != nil {
		return err
	}
	executors = append(executors, svc)
}

wsClient.Start(context.Background(), executors)

Implemented

The following API endpoints have been implemented

REST API
Inverse Perpetual
Market Data Endpoints
  • /v2/public/orderBook/L2 Order Book
  • /v2/public/kline/list Query Kline
  • /v2/public/tickers Latest Information for Symbol
  • /v2/public/trading-records Public Trading Records
  • /v2/public/symbols Query Symbol
  • /v2/public/mark-price-kline Query Mark Price Kline
  • /v2/public/index-price-kline Query Index Price Kline
  • /v2/public/premium-index-kline Query Premium Index Kline
  • /v2/public/open-interest Open Interest
  • /v2/public/big-deal Latest Big Deal
  • /v2/public/account-ratio Long-Short Ratio
Account Data Endpoints
  • /v2/private/order/create Place Active Order
  • /v2/private/order/list Get Active Order
  • /v2/private/order/cancel Cancel Active Order
  • /v2/private/position/list My Position
  • /v2/private/position/leverage/save Set Leverage
Wallet Data Endpoints
  • /v2/private/wallet/balance Get Wallet Balance
USDT Perpetual
Market Data Endpoints
  • /v2/public/orderBook/L2 Order Book
  • /v2/public/tickers Latest Information for Symbol
  • /v2/public/symbols Query Symbol
  • /v2/public/open-interest Open Interest
  • /v2/public/big-deal Latest Big Deal
  • /v2/public/account-ratio Long-Short Ratio
Account Data Endpoints
  • /private/linear/order/create Place Active Order
  • /private/linear/order/cancel Cancel Active Order
  • /private/linear/order/cancel-all Cancel All Active Orders
  • /private/linear/position/list My Position
  • /private/linear/position/set-leverage Set Leverage
  • /private/linear/trade/execution/list User Trade Records
Wallet Data Endpoints
  • /v2/private/wallet/balance Get Wallet Balance
Inverse Future
Market Data Endpoints
  • /v2/public/orderBook/L2 Order Book
  • /v2/public/kline/list Query Kline
  • /v2/public/tickers Latest Information for Symbol
  • /v2/public/trading-records Public Trading Records
  • /v2/public/symbols Query Symbol
  • /v2/public/mark-price-kline Query Index Price Kline
  • /v2/public/index-price-kline Query Index Price Kline
  • /v2/public/open-interest Open Interest
  • /v2/public/big-deal Latest Big Deal
  • /v2/public/account-ratio Long-Short Ratio
Wallet Data Endpoints
  • /v2/private/wallet/balance Get Wallet Balance
Spot
Market Data Endpoints
  • /spot/v1/symbols Query Symbol
  • /spot/quote/v1/depth Order Book
  • /spot/quote/v1/depth/merged Merged Order Book
  • /spot/quote/v1/trades Public Trading Records
  • /spot/quote/v1/kline Query Kline
  • /spot/quote/v1/ticker/24hr Latest Information for Symbol
  • /spot/quote/v1/ticker/price Last Traded Price
  • /spot/quote/v1/ticker/book_ticker Best Bid/Ask Price
Account Data Endpoints
  • /spot/v1/order
    • Place Active Order
    • Get Active Order
    • Cancel Active Order
    • Fast Cancel Active Order
  • /spot/v1/order/fast Fast Cancel Active Order
  • /spot/order/batch-cancel Batch Cancel Active Order
  • /spot/order/batch-fast-cancel Batch Fast Cancel Active Order
  • /spot/order/batch-cancel-by-ids Batch Cancel Active Order By IDs
WebSocket API
Spot v1
Public Topics
  • trade
Public Topics V2
  • trade
Private Topics
  • outboundAccountInfo

Documentation

Index

Constants

View Source
const (
	// MainNetBaseURL :
	MainNetBaseURL = "https://api.bybit.com"
	// MainNetBaseURL2 :
	MainNetBaseURL2 = "https://api.bytick.com"
)
View Source
const (
	// CoinBTC :
	CoinBTC = "BTC"
	// CoinETH :
	CoinETH = "ETH"
	// CoinEOS :
	CoinEOS = "EOS"
	// CoinXRP :
	CoinXRP = "XRP"
	// CoinUSDT :
	CoinUSDT = "USDT"
)
View Source
const (
	// SymbolInverseBTCUSD :
	SymbolInverseBTCUSD = SymbolInverse("BTCUSD")
	// SymbolInverseETHUSD :
	SymbolInverseETHUSD = SymbolInverse("ETHUSD")
	// SymbolInverseEOSUSD :
	SymbolInverseEOSUSD = SymbolInverse("EOSUSD")
	// SymbolInverseXRPUSD :
	SymbolInverseXRPUSD = SymbolInverse("XRPUSD")
)
View Source
const (
	// SymbolUSDTBTC :
	SymbolUSDTBTC = SymbolUSDT("BTCUSDT")
	// SymbolUSDTETH :
	SymbolUSDTETH = SymbolUSDT("ETHUSDT")
	// SymbolUSDTLTC :
	SymbolUSDTLTC = SymbolUSDT("LTCUSDT")
	// SymbolUSDTLINK :
	SymbolUSDTLINK = SymbolUSDT("LINKUSDT")
	// SymbolUSDTXTZ :
	SymbolUSDTXTZ = SymbolUSDT("XTZUSDT")
	// SymbolUSDTBCH :
	SymbolUSDTBCH = SymbolUSDT("BCHUSDT")
	// SymbolUSDTADA :
	SymbolUSDTADA = SymbolUSDT("ADAUSDT")
	// SymbolUSDTDOT :
	SymbolUSDTDOT = SymbolUSDT("DOTUSDT")
	// SymbolUSDTUNI :
	SymbolUSDTUNI = SymbolUSDT("UNIUSDT")
)
View Source
const (
	// SymbolSpotBTCUSDT :
	SymbolSpotBTCUSDT = SymbolSpot("BTCUSDT")
	// SymbolSpotETHUSDT :
	SymbolSpotETHUSDT = SymbolSpot("ETHUSDT")
	// SymbolSpotEOSUSDT :
	SymbolSpotEOSUSDT = SymbolSpot("EOSUSDT")
	// SymbolSpotXRPUSDT :
	SymbolSpotXRPUSDT = SymbolSpot("XRPUSDT")
	// SymbolSpotUNIUSDT :
	SymbolSpotUNIUSDT = SymbolSpot("UNIUSDT")
	// SymbolSpotBTCETH :
	SymbolSpotBTCETH = SymbolSpot("BTCETH")
	// SymbolSpotDOGEXRP :
	SymbolSpotDOGEXRP = SymbolSpot("DOGEXRP")
	// SymbolSpotXLMUSDT :
	SymbolSpotXLMUSDT = SymbolSpot("XLMUSDT")
	// SymbolSpotLTCUSDT :
	SymbolSpotLTCUSDT = SymbolSpot("LTCUSDT")
	// SymbolSpotXRPBTC :
	SymbolSpotXRPBTC = SymbolSpot("XRPBTC")
	// SymbolSpotDOGEUSDT :
	SymbolSpotDOGEUSDT = SymbolSpot("DOGEUSDT")
	// SymbolSpotBITUSDT :
	SymbolSpotBITUSDT = SymbolSpot("BITUSDT")
	// SymbolSpotMANAUSDT :
	SymbolSpotMANAUSDT = SymbolSpot("MANAUSDT")
	// SymbolSpotAXSUSDT :
	SymbolSpotAXSUSDT = SymbolSpot("AXSUSDT")
	// SymbolSpotDYDXUSDT :
	SymbolSpotDYDXUSDT = SymbolSpot("DYDXUSDT")
	// SymbolSpotPMTEST5BTC :
	SymbolSpotPMTEST5BTC = SymbolSpot("PMTEST5BTC")
	// SymbolSpotGENEUSDT :
	SymbolSpotGENEUSDT = SymbolSpot("GENEUSDT")
)
View Source
const (
	// SideNone : not defined officially
	SideNone = Side("None")
	// SideBuy :
	SideBuy = Side("Buy")
	// SideSell :
	SideSell = Side("Sell")
)
View Source
const (
	// OrderTypeLimit :
	OrderTypeLimit = OrderType("Limit")
	// OrderTypeMarket :
	OrderTypeMarket = OrderType("Market")
)
View Source
const (
	// OrderTypeSpotLimit :
	OrderTypeSpotLimit = OrderTypeSpot("LIMIT")
	// OrderTypeSpotMarket :
	OrderTypeSpotMarket = OrderTypeSpot("MARKET")
	// OrderTypeSpotLimitMaker :
	OrderTypeSpotLimitMaker = OrderTypeSpot("LIMIT_MAKER")
)
View Source
const (
	// OrderStatusCreated :
	OrderStatusCreated = OrderStatus("Created")
	// OrderStatusRejected :
	OrderStatusRejected = OrderStatus("Rejected")
	// OrderStatusNew :
	OrderStatusNew = OrderStatus("New")
	// OrderStatusPartiallyFilled :
	OrderStatusPartiallyFilled = OrderStatus("PartiallyFilled")
	// OrderStatusFilled :
	OrderStatusFilled = OrderStatus("Filled")
	// OrderStatusCancelled :
	OrderStatusCancelled = OrderStatus("Cancelled")
	// OrderStatusPendingCancel :
	OrderStatusPendingCancel = OrderStatus("PendingCancel")
)
View Source
const (
	// OrderStatusSpotNew :
	OrderStatusSpotNew = OrderStatusSpot("NEW")
	// OrderStatusSpotPartiallyFilled :
	OrderStatusSpotPartiallyFilled = OrderStatusSpot("PARTIALLY_FILLED")
	// OrderStatusSpotFilled :
	OrderStatusSpotFilled = OrderStatusSpot("FILLED")
	// OrderStatusSpotCanceled :
	OrderStatusSpotCanceled = OrderStatusSpot("CANCELED")
	// OrderStatusSpotPendingCancel :
	OrderStatusSpotPendingCancel = OrderStatusSpot("PENDING_CANCEL")
	// OrderStatusSpotPendingNew :
	OrderStatusSpotPendingNew = OrderStatusSpot("PENDING_NEW")
	// OrderStatusSpotRejected :
	OrderStatusSpotRejected = OrderStatusSpot("REJECTED")
)
View Source
const (
	// TimeInForceGoodTillCancel :
	TimeInForceGoodTillCancel = TimeInForce("GoodTillCancel")
	// TimeInForceImmediateOrCancel :
	TimeInForceImmediateOrCancel = TimeInForce("ImmediateOrCancel")
	// TimeInForceFillOrKill :
	TimeInForceFillOrKill = TimeInForce("FillOrKill")
	// TimeInForcePostOnly :
	TimeInForcePostOnly = TimeInForce("PostOnly")
)
View Source
const (
	// TimeInForceSpotGTC :
	TimeInForceSpotGTC = TimeInForceSpot("GTC")
	// TimeInForceSpotFOK :
	TimeInForceSpotFOK = TimeInForceSpot("FOK")
	// TimeInForceSpotIOC :
	TimeInForceSpotIOC = TimeInForceSpot("IOC")
)
View Source
const (
	// Interval1 :
	Interval1 = Interval("1")
	// Interval3 :
	Interval3 = Interval("3")
	// Interval5 :
	Interval5 = Interval("5")
	// Interval15 :
	Interval15 = Interval("15")
	// Interval30 :
	Interval30 = Interval("30")
	// Interval60 :
	Interval60 = Interval("60")
	// Interval120 :
	Interval120 = Interval("120")
	// Interval240 :
	Interval240 = Interval("240")
	// Interval360 :
	Interval360 = Interval("360")
	// Interval720 :
	Interval720 = Interval("720")
	// IntervalD :
	IntervalD = Interval("D")
	// IntervalW :
	IntervalW = Interval("W")
	// IntervalM :
	IntervalM = Interval("M")
)
View Source
const (
	// SpotInterval1m :
	SpotInterval1m = Interval("1m")
	// SpotInterval3m :
	SpotInterval3m = Interval("3m")
	// SpotInterval5m :
	SpotInterval5m = Interval("5m")
	// SpotInterval15m :
	SpotInterval15m = Interval("15m")
	// SpotInterval30m :
	SpotInterval30m = Interval("30m")
	// SpotInterval1h :
	SpotInterval1h = Interval("1h")
	// SpotInterval2h :
	SpotInterval2h = Interval("2h")
	// SpotInterval4h :
	SpotInterval4h = Interval("4h")
	// SpotInterval6h :
	SpotInterval6h = Interval("6h")
	// SpotInterval12h :
	SpotInterval12h = Interval("12h")
	// SpotInterval1d :
	SpotInterval1d = Interval("1d")
	// SpotInterval1w :
	SpotInterval1w = Interval("1w")
	// SpotInterval1M :
	SpotInterval1M = Interval("1M")
)
View Source
const (
	// TickDirectionPlusTick :
	TickDirectionPlusTick = TickDirection("PlusTick")
	// TickDirectionZeroPlusTick :
	TickDirectionZeroPlusTick = TickDirection("ZeroPlusTick")
	// TickDirectionMinusTick :
	TickDirectionMinusTick = TickDirection("MinusTick")
	// TickDirectionZeroMinusTick :
	TickDirectionZeroMinusTick = TickDirection("ZeroMinusTick")
)
View Source
const (
	// Period5min :
	Period5min = Period("5min")
	// Period15min :
	Period15min = Period("15min")
	// Period30min :
	Period30min = Period("30min")
	// Period1h :
	Period1h = Period("1h")
	// Period4h :
	Period4h = Period("4h")
	// Period1d :
	Period1d = Period("1d")
)
View Source
const (
	// TpSlModeFull :
	TpSlModeFull = TpSlMode("Full")
	// TpSlModePartial :
	TpSlModePartial = TpSlMode("Partial")
)
View Source
const (
	// ExecTypeTrade :
	ExecTypeTrade = ExecType("Trade")
	// ExecTypeAdlTrade :
	ExecTypeAdlTrade = ExecType("AdlTrade")
	// ExecTypeFunding :
	ExecTypeFunding = ExecType("Funding")
	// ExecTypeBustTrade :
	ExecTypeBustTrade = ExecType("BustTrade")
)
View Source
const (
	// DirectionPrev :
	DirectionPrev = Direction("prev")
	// DirectionNext :
	DirectionNext = Direction("next")
)
View Source
const (
	// CategoryV5Spot :
	CategoryV5Spot = CategoryV5("spot")
	// CategoryV5Linear :
	CategoryV5Linear = CategoryV5("linear")
	// CategoryV5Inverse :
	CategoryV5Inverse = CategoryV5("inverse")
	// CategoryV5Option :
	CategoryV5Option = CategoryV5("option")
)
View Source
const (
	// USDT Perpetual:
	SymbolV5BTCUSDT = SymbolV5("BTCUSDT")
	SymbolV5ETHUSDT = SymbolV5("ETHUSDT")

	// USDC Perpetual
	SymbolV5BTCPERP = SymbolV5("BTCPERP")
	SymbolV5ETHPERP = SymbolV5("ETHPERP")

	// Inverse Perpetual
	SymbolV5BTCUSD = SymbolV5("BTCUSD")
	SymbolV5ETHUSD = SymbolV5("ETHUSD")

	// Inverse Futures
	SymbolV5BTCUSDH23 = SymbolV5("BTCUSDH23")
	SymbolV5BTCUSDM23 = SymbolV5("BTCUSDM23")
	SymbolV5BTCUSDU23 = SymbolV5("BTCUSDU23")
	SymbolV5BTCUSDZ23 = SymbolV5("BTCUSDZ23")

	// Spot
	SymbolV5ETHUSDC = SymbolV5("ETHUSDC")
)

SymbolV5 :

View Source
const (
	// TriggerDirectionRise : triggered when market price rises
	TriggerDirectionRise = TriggerDirection(1)
	// TriggerDirectionFall : triggered when market price falls
	TriggerDirectionFall = TriggerDirection(2)
)
View Source
const (
	// IsLeverageFalse : false then spot trading
	IsLeverageFalse = TriggerDirection(0)
	// IsLeverageTrue : true then margin trading
	IsLeverageTrue = IsLeverage(1)
)
View Source
const (
	// OrderFilterOrder :
	OrderFilterOrder = OrderFilter("Order")
	// OrderFilterStopOrder :
	OrderFilterStopOrder = OrderFilter("StopOrder")
	// OrderFilterTpSlOrder :
	OrderFilterTpSlOrder = OrderFilter("tpslOrder")
)
View Source
const (
	// TriggerByLastPrice :
	TriggerByLastPrice = TriggerBy("LastPrice")
	// TriggerByIndexPrice :
	TriggerByIndexPrice = TriggerBy("IndexPrice")
	// TriggerByMarkPrice :
	TriggerByMarkPrice = TriggerBy("MarkPrice")
)
View Source
const (
	PositionIdxOneWay    = PositionIdx(0)
	PositionIdxHedgeBuy  = PositionIdx(1)
	PositionIdxHedgeSell = PositionIdx(2)
)

PositionIdx :

View Source
const (
	ContractTypeInversePerpetual = ContractType("InversePerpetual")
	ContractTypeLinearPerpetual  = ContractType("LinearPerpetual")
	ContractTypeInverseFutures   = ContractType("InverseFutures")
)

ContractType :

View Source
const (
	// linear & inverse:
	InstrumentStatusPending  = InstrumentStatus("Pending")
	InstrumentStatusTrading  = InstrumentStatus("Trading")
	InstrumentStatusSettling = InstrumentStatus("Settling")
	InstrumentStatusClosed   = InstrumentStatus("Closed")

	// option
	InstrumentStatusWaitingOnline = InstrumentStatus("WAITING_ONLINE")
	InstrumentStatusOnline        = InstrumentStatus("ONLINE")
	InstrumentStatusDelivering    = InstrumentStatus("DELIVERING")
	InstrumentStatusOffline       = InstrumentStatus("OFFLINE")

	// spot
	InstrumentStatusAvailable = InstrumentStatus("1")
)

InstrumentStatus :

View Source
const (
	OptionsTypeCall = OptionsType("Call")
	OptionsTypePut  = OptionsType("Put")
)

OptionsType :

View Source
const (
	InnovationFalse = Innovation("0")
	InnovationTrue  = Innovation("1")
)

Innovation :

View Source
const (
	// SpotWebsocketV1PublicV1EventSubscribe :
	SpotWebsocketV1PublicV1EventSubscribe = "sub"
	// SpotWebsocketV1PublicV1EventUnsubscribe :
	SpotWebsocketV1PublicV1EventUnsubscribe = "cancel"
)
View Source
const (
	// SpotWebsocketV1PublicV2EventSubscribe :
	SpotWebsocketV1PublicV2EventSubscribe = "sub"
	// SpotWebsocketV1PublicV2EventUnsubscribe :
	SpotWebsocketV1PublicV2EventUnsubscribe = "cancel"
)
View Source
const (
	// SpotWebsocketV1PrivateEventTypeOutboundAccountInfo :
	SpotWebsocketV1PrivateEventTypeOutboundAccountInfo = "outboundAccountInfo"
)
View Source
const (
	// SpotWebsocketV1PrivatePath :
	SpotWebsocketV1PrivatePath = "/spot/ws"
)
View Source
const (
	// SpotWebsocketV1PublicV1Path :
	SpotWebsocketV1PublicV1Path = "/spot/quote/ws/v1"
)
View Source
const (
	// SpotWebsocketV1PublicV1TopicTrade :
	SpotWebsocketV1PublicV1TopicTrade = SpotWebsocketV1PublicV1Topic("trade")
)
View Source
const (
	// SpotWebsocketV1PublicV2Path :
	SpotWebsocketV1PublicV2Path = "/spot/quote/ws/v2"
)
View Source
const (
	// SpotWebsocketV1PublicV2TopicTrade :
	SpotWebsocketV1PublicV2TopicTrade = SpotWebsocketV1PublicV2Topic("trade")
)
View Source
const (
	// TestNetBaseURL :
	TestNetBaseURL = "https://api-testnet.bybit.com"
)
View Source
const (
	// TestWebsocketBaseURL :
	TestWebsocketBaseURL = "wss://stream-testnet.bybit.com"
)
View Source
const (
	// WebsocketBaseURL :
	WebsocketBaseURL = "wss://stream.bybit.com"
)

Variables

View Source
var (
	// ErrPathNotFound : Request path not found
	ErrPathNotFound = errors.New("path not found")
	// ErrAccessDenied : Access denied
	ErrAccessDenied = errors.New("access denied")
)

Functions

func IsErrWebsocketClosed

func IsErrWebsocketClosed(err error) bool

IsErrWebsocketClosed :

func MinimumVolumeUSDT

func MinimumVolumeUSDT(symbol SymbolUSDT) float64

MinimumVolumeUSDT :

Types

type APIKeyResponse

type APIKeyResponse struct {
	CommonResponse `json:",inline"`
	Result         []ApiKey `json:"result"`
}

APIKeyResponse :

type AccountAssetService

type AccountAssetService struct {
	// contains filtered or unexported fields
}

AccountAssetService :

type AccountRatioParam

type AccountRatioParam struct {
	Symbol SymbolInverse `url:"symbol"`
	Period Period        `url:"period"`

	Limit *int `url:"limit,omitempty"`
}

AccountRatioParam :

type AccountRatioResponse

type AccountRatioResponse struct {
	CommonResponse `json:",inline"`
	Result         []AccountRatioResult `json:"result"`
}

AccountRatioResponse :

type AccountRatioResult

type AccountRatioResult struct {
	Symbol    SymbolInverse `json:"symbol"`
	BuyRatio  float64       `json:"buy_ratio"`
	SellRatio float64       `json:"sell_ratio"`
	Timestamp int           `json:"timestamp"`
}

AccountRatioResult :

type AccountType added in v0.0.21

type AccountType string

AccountType :

const (
	AccountTypeUnified AccountType = "UNIFIED"
	AccountTypeNormal  AccountType = "CONTRACT"
)

type ApiKey

type ApiKey struct {
	APIKey           string   `json:"api_key"`
	Type             string   `json:"type"`
	UserID           int      `json:"user_id"`
	InviterID        int      `json:"inviter_id"`
	IPs              []string `json:"ips"`
	Note             string   `json:"note"`
	Permissions      []string `json:"permissions"`
	CreatedAt        string   `json:"created_at"`
	ExpiredAt        string   `json:"expired_at"`
	ReadOnly         bool     `json:"read_only"`
	VipLevel         string   `json:"vip_level"`
	MarketMakerLevel string   `json:"mkt_maker_level"`
	AffiliateID      int      `json:"affiliate_id"`
}

type Balance

type Balance struct {
	Equity           float64 `json:"equity"`
	AvailableBalance float64 `json:"available_balance"`
	UsedMargin       float64 `json:"used_margin"`
	OrderMargin      float64 `json:"order_margin"`
	PositionMargin   float64 `json:"position_margin"`
	OccClosingFee    float64 `json:"occ_closing_fee"`
	OccFundingFee    float64 `json:"occ_funding_fee"`
	WalletBalance    float64 `json:"wallet_balance"`
	RealisedPnl      float64 `json:"realised_pnl"`
	UnrealisedPnl    float64 `json:"unrealised_pnl"`
	CumRealisedPnl   float64 `json:"cum_realised_pnl"`
	GivenCash        float64 `json:"given_cash"`
	ServiceCash      float64 `json:"service_cash"`
}

Balance :

type BalanceResponse

type BalanceResponse struct {
	CommonResponse `json:",inline"`
	Result         BalanceResult `json:"result"`
}

BalanceResponse :

type BalanceResult

type BalanceResult struct {
	Balance map[Coin]Balance
}

BalanceResult :

func (*BalanceResult) UnmarshalJSON

func (r *BalanceResult) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type BigDealParam

type BigDealParam struct {
	Symbol SymbolInverse `url:"symbol"`

	Limit *int `url:"limit,omitempty"`
}

BigDealParam :

type BigDealResponse

type BigDealResponse struct {
	CommonResponse `json:",inline"`
	Result         []BigDealResult `json:"result"`
}

BigDealResponse :

type BigDealResult

type BigDealResult struct {
	Symbol    SymbolInverse `json:"symbol"`
	Side      Side          `json:"side"`
	Timestamp int           `json:"timestamp"`
	Value     int           `json:"value"`
}

BigDealResult :

type CancelLinearOrder

type CancelLinearOrder struct {
	OrderID string `json:"order_id"`
}

CancelLinearOrder :

type CancelLinearOrderParam

type CancelLinearOrderParam struct {
	Symbol SymbolUSDT `json:"symbol"`

	OrderID     *string `json:"order_id,omitempty"`
	OrderLinkID *string `json:"order_link_id,omitempty"`
}

CancelLinearOrderParam :

type CancelLinearOrderResponse

type CancelLinearOrderResponse struct {
	CommonResponse `json:",inline"`
	Result         CancelLinearOrderResult `json:"result"`
}

CancelLinearOrderResponse :

type CancelLinearOrderResult

type CancelLinearOrderResult struct {
	CancelLinearOrder `json:",inline"`
}

CancelLinearOrderResult :

type CancelOrder

type CancelOrder struct {
	UserID        int           `json:"user_id"`
	OrderID       string        `json:"order_id"`
	Symbol        SymbolInverse `json:"symbol"`
	Side          Side          `json:"side"`
	OrderType     OrderType     `json:"order_type"`
	Price         float64       `json:"price"`
	Qty           float64       `json:"qty"`
	TimeInForce   TimeInForce   `json:"time_in_force"`
	OrderStatus   OrderStatus   `json:"order_status"`
	LastExecTime  float64       `json:"last_exec_time"`
	LastExecPrice float64       `json:"last_exec_price"`
	LeavesQty     float64       `json:"leaves_qty"`
	CumExecQty    float64       `json:"cum_exec_qty"`
	CumExecValue  float64       `json:"cum_exec_value"`
	CumExecFee    float64       `json:"cum_exec_fee"`
	RejectReason  string        `json:"reject_reason"`
	OrderLinkID   string        `json:"order_link_id"`
	CreatedAt     string        `json:"created_at"`
	UpdatedAt     string        `json:"updated_at"`
}

CancelOrder : so far, same as CreateOrder

type CancelOrderParam

type CancelOrderParam struct {
	Symbol SymbolInverse `json:"symbol"`

	OrderID     *string `json:"order_id,omitempty"`
	OrderLinkID *string `json:"order_link_id,omitempty"`
}

CancelOrderParam :

type CancelOrderResponse

type CancelOrderResponse struct {
	CommonResponse `json:",inline"`
	Result         CancelOrderResult `json:"result"`
}

CancelOrderResponse :

type CancelOrderResult

type CancelOrderResult struct {
	CancelOrder `json:",inline"`
}

CancelOrderResult :

type CategoryV5 added in v0.0.21

type CategoryV5 string

CategoryV5 :

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client :

func NewClient

func NewClient() *Client

NewClient :

func (*Client) AccountAsset

func (c *Client) AccountAsset() *AccountAssetService

AccountAsset :

func (*Client) CopyTrading

func (c *Client) CopyTrading() *CopyTradingService

CopyTrading :

func (*Client) Debug added in v0.0.2

func (c *Client) Debug(logger Logger) *Client

WithHTTPClient :

func (*Client) Derivative

func (c *Client) Derivative() *DerivativeService

Derivative :

func (*Client) Future

func (c *Client) Future() FutureServiceI

func (*Client) Request added in v0.0.21

func (c *Client) Request(req *http.Request, dst interface{}) error

Request :

func (*Client) Spot

func (c *Client) Spot() SpotServiceI

Spot :

func (*Client) USDCContract

func (c *Client) USDCContract() USDCContractServiceI

USDCContract :

func (*Client) V5 added in v0.0.21

func (c *Client) V5() V5ServiceI

V5 :

func (*Client) V5Request added in v0.0.22

func (c *Client) V5Request(req *http.Request, dst interface{}) error

Request :

func (*Client) WithAuth

func (c *Client) WithAuth(key string, secret string) *Client

WithAuth :

func (*Client) WithBaseURL added in v0.0.21

func (c *Client) WithBaseURL(url string) *Client

WithBaseURL :

func (*Client) WithHTTPClient

func (c *Client) WithHTTPClient(httpClient *http.Client) *Client

WithHTTPClient :

type Coin

type Coin string

Coin :

type CommonResponse

type CommonResponse struct {
	RetCode          int    `json:"ret_code"`
	RetMsg           string `json:"ret_msg"`
	ExtCode          string `json:"ext_code"`
	ExtInfo          string `json:"ext_info"`
	TimeNow          string `json:"time_now"`
	RateLimitStatus  int    `json:"rate_limit_status"`
	RateLimitResetMs int    `json:"rate_limit_reset_ms"`
	RateLimit        int    `json:"rate_limit"`
}

CommonResponse :

type CommonV3Response added in v0.0.21

type CommonV3Response struct {
	RetCode    int         `json:"retCode"`
	RetMsg     string      `json:"retMsg"`
	RetExtInfo interface{} `json:"retExtInfo"`
	Time       int         `json:"time"`
}

CommonV3Response :

type CommonV5Response added in v0.0.21

type CommonV5Response struct {
	RetCode          int         `json:"retCode"`
	RetMsg           string      `json:"retMsg"`
	RetExtInfo       interface{} `json:"retExtInfo"`
	Time             int         `json:"time"`
	RateLimitStatus  int         `json:"rate_limit_status"`
	RateLimitResetMs int         `json:"rate_limit_reset_ms"`
	RateLimit        int         `json:"rate_limit"`
}

CommonV5Response :

type ContractBalance added in v0.0.13

type ContractBalance struct {
	Coin             string          `json:"coin"`
	Equity           decimal.Decimal `json:"equity"`
	AvailableBalance decimal.Decimal `json:"availableBalance"`
	UsedMargin       decimal.Decimal `json:"used_margin"`
	OrderMargin      decimal.Decimal `json:"orderMargin"`
	PositionMargin   decimal.Decimal `json:"positionMargin"`
	OccClosingFee    decimal.Decimal `json:"occClosingFee"`
	OccFundingFee    decimal.Decimal `json:"occFundingFee"`
	WalletBalance    decimal.Decimal `json:"walletBalance"`
	RealisedPnl      decimal.Decimal `json:"realised_pnl"`
	UnrealisedPnl    decimal.Decimal `json:"unrealisedPnl"`
	CumRealisedPnl   decimal.Decimal `json:"cumRealisedPnl"`
	GivenCash        decimal.Decimal `json:"givenCash"`
	ServiceCash      decimal.Decimal `json:"serviceCash"`
}

Balance :

type ContractBalanceResponse added in v0.0.13

type ContractBalanceResponse struct {
	CommonResponse `json:",inline"`
	Result         ContractBalanceResult `json:"result"`
}

BalanceResponse :

type ContractBalanceResult added in v0.0.13

type ContractBalanceResult struct {
	Balance []ContractBalance `json:"list"`
}

BalanceResult :

type ContractExecutionHistoryListParam added in v0.0.13

type ContractExecutionHistoryListParam struct {
	Symbol SymbolUSDT `url:"symbol"`

	StartTime *int      `url:"start_time,omitempty"`
	EndTime   *int      `url:"end_time,omitempty"`
	ExecType  *ExecType `url:"exec_type,omitempty"`
	PageToken *string   `url:"cursor,omitempty"`
	Limit     *int      `url:"limit,omitempty"`
}

ContractExecutionHistoryListParam :

type ContractExecutionHistoryListResponse added in v0.0.13

type ContractExecutionHistoryListResponse struct {
	CommonResponse `json:",inline"`
	Result         ContractExecutionHistoryListResult `json:"result"`
}

ContractExecutionHistoryListResponse :

type ContractExecutionHistoryListResult added in v0.0.13

type ContractExecutionHistoryListResult struct {
	PageToken              string                  `json:"nextPageCursor"`
	ContractExecutionLists []ContractExecutionList `json:"list"`
}

ContractExecutionHistoryListResult :

type ContractExecutionList added in v0.0.13

type ContractExecutionList struct {
	OrderID          string          `json:"orderId"`
	OrderLinkID      string          `json:"orderLinkId"`
	Side             Side            `json:"side"`
	Symbol           string          `json:"symbol"`
	OrderPrice       decimal.Decimal `json:"orderPrice"`
	OrderQty         decimal.Decimal `json:"orderQty"`
	OrderType        OrderType       `json:"orderType"`
	FeeRate          decimal.Decimal `json:"feeRate"`
	ExecID           string          `json:"execId"`
	ExecPrice        decimal.Decimal `json:"execPrice"`
	ExecType         ExecType        `json:"execType"`
	ExecQty          decimal.Decimal `json:"execQty"`
	ExecFee          decimal.Decimal `json:"execFee"`
	ExecValue        decimal.Decimal `json:"execValue"`
	LeavesQty        decimal.Decimal `json:"leavesQty"`
	ClosedSize       decimal.Decimal `json:"closedSize"`
	LastLiquidityInd string          `json:"lastLiquidityInd"`
	TradeTimeMs      string          `json:"execTime"`
}

type ContractLeverageFilter added in v0.0.13

type ContractLeverageFilter struct {
	MinLeverage  string `json:"minLeverage"`
	MaxLeverage  string `json:"maxLeverage"`
	LeverageStep string `json:"leverageStep"`
}

LeverageFilter :

type ContractListKlineParam added in v0.0.13

type ContractListKlineParam struct {
	Category string        `url:"category"`
	Symbol   SymbolInverse `url:"symbol"`
	Interval Interval      `url:"interval"`
	Start    int           `url:"start"`
	End      int           `url:"end"`

	Limit *int `url:"limit,omitempty"`
}

type ContractListKlineResponse added in v0.0.13

type ContractListKlineResponse struct {
	CommonResponse `json:",inline"`
	Result         ContractListKlineResult `json:"result"`
}

type ContractListKlineResult added in v0.0.13

type ContractListKlineResult struct {
	Category string        `json:"category"`
	Symbol   SymbolInverse `json:"symbol"`
	Interval string        `json:"interval"`
	List     [][]string    `json:"list"`
}

ListKlineResult :

type ContractLotSizeFilter added in v0.0.13

type ContractLotSizeFilter struct {
	MaxTradingQty string `json:"maxTradingQty"`
	MinTradingQty string `json:"minTradingQty"`
	QtyStep       string `json:"qtyStep"`
}

LotSizeFilter :

type ContractPriceFilter added in v0.0.13

type ContractPriceFilter struct {
	MinPrice string `json:"minPrice"`
	MaxPrice string `json:"maxPrice"`
	TickSize string `json:"tickSize"`
}

PriceFilter :

type ContractSymbol added in v0.0.13

type ContractSymbol struct {
	Name           string                 `json:"symbol"`
	Status         string                 `json:"status"`
	BaseCurrency   string                 `json:"baseCoin"`
	QuoteCurrency  string                 `json:"quoteCoin"`
	PriceScale     string                 `json:"priceScale"`
	TakerFee       string                 `json:"taker_fee"`
	MakerFee       string                 `json:"maker_fee"`
	LeverageFilter ContractLeverageFilter `json:"leverageFilter"`
	PriceFilter    ContractPriceFilter    `json:"priceFilter"`
	LotSizeFilter  ContractLotSizeFilter  `json:"lotSizeFilter"`
}

SymbolsResult :

type ContractSymbolData added in v0.0.13

type ContractSymbolData struct {
	Category string           `json:"category"`
	List     []ContractSymbol `json:"list"`
	Page     string           `json:"nextPageCursor"`
}

type ContractSymbolsResponse added in v0.0.13

type ContractSymbolsResponse struct {
	CommonResponse `json:",inline"`
	Result         ContractSymbolData `json:"result"`
}

SymbolsResponse :

type ContractTicker added in v0.0.13

type ContractTicker struct {
	Symbol            string        `json:"symbol"`
	BidPrice          string        `json:"bidPrice"`
	AskPrice          string        `json:"askPrice"`
	LastPrice         string        `json:"lastPrice"`
	LastTickDirection TickDirection `json:"lastTickDirection"`
	PrevPrice24h      string        `json:"prevPrice24h"`
	Price24hPcnt      string        `json:"price24hPcnt"`
	HighPrice24h      string        `json:"highPrice24h"`
	LowPrice24h       string        `json:"lowPrice24h"`
	PrevPrice1h       string        `json:"prevPrice1h"`
	MarkPrice         string        `json:"markPrice"`
	IndexPrice        string        `json:"indexPrice"`
	OpenInterest      string        `json:"openInterest"`
	OpenValue         string        `json:"open_value"`
	TotalTurnover     string        `json:"turnover24h"`
	Turnover24h       string        `json:"turnover_24h"`
	TotalVolume       string        `json:"total_volume"`
	Volume24h         string        `json:"volume24h"`
	FundingRate       string        `json:"fundingRate"`
	NextFundingTime   string        `json:"nextFundingTime"`
}

type ContractTickersResponse added in v0.0.13

type ContractTickersResponse struct {
	CommonResponse `json:",inline"`
	Result         ContractTickersResult `json:"result"`
}

TickersResponse :

type ContractTickersResult added in v0.0.13

type ContractTickersResult struct {
	Category string           `json:"category"`
	List     []ContractTicker `json:"list"`
}

TickersResult :

type ContractType added in v0.0.21

type ContractType string

ContractType :

type CopyTradingService

type CopyTradingService struct {
	// contains filtered or unexported fields
}

CopyTradingService :

type CreateLinearOrder

type CreateLinearOrder struct {
	OrderID        string      `json:"order_id"`
	UserID         int         `json:"user_id"`
	Symbol         SymbolUSDT  `json:"symbol"`
	Side           Side        `json:"side"`
	OrderType      OrderType   `json:"order_type"`
	Price          float64     `json:"price"`
	Qty            float64     `json:"qty"`
	TimeInForce    TimeInForce `json:"time_in_force"`
	OrderStatus    OrderStatus `json:"order_status"`
	LastExecPrice  float64     `json:"last_exec_price"`
	CumExecQty     float64     `json:"cum_exec_qty"`
	CumExecValue   float64     `json:"cum_exec_value"`
	CumExecFee     float64     `json:"cum_exec_fee"`
	ReduceOnly     bool        `json:"reduce_only"`
	CloseOnTrigger bool        `json:"close_on_trigger"`
	OrderLinkID    string      `json:"order_link_id"`
	CreatedTime    string      `json:"created_time"`
	UpdatedTime    string      `json:"updated_time"`
	TakeProfit     float64     `json:"take_profit"`
	StopLoss       float64     `json:"stop_loss"`
	TpTriggerBy    string      `json:"tp_trigger_by"`
	SlTriggerBy    string      `json:"sl_trigger_by"`
}

CreateLinearOrder :

type CreateLinearOrderParam

type CreateLinearOrderParam struct {
	Side           Side        `json:"side"`
	Symbol         SymbolUSDT  `json:"symbol"`
	OrderType      OrderType   `json:"order_type"`
	Qty            float64     `json:"qty"`
	TimeInForce    TimeInForce `json:"time_in_force"`
	ReduceOnly     bool        `json:"reduce_only"`
	CloseOnTrigger bool        `json:"close_on_trigger"`

	Price       *float64 `json:"price,omitempty"`
	TakeProfit  *float64 `json:"take_profit,omitempty"`
	StopLoss    *float64 `json:"stop_loss,omitempty"`
	TpTriggerBy *string  `json:"tp_trigger_by"`
	SlTriggerBy *string  `json:"sl_trigger_by"`
	OrderLinkID *string  `json:"order_link_id,omitempty"`
}

CreateLinearOrderParam :

type CreateLinearOrderResponse

type CreateLinearOrderResponse struct {
	CommonResponse `json:",inline"`
	Result         CreateLinearOrderResult `json:"result"`
}

CreateLinearOrderResponse :

type CreateLinearOrderResult

type CreateLinearOrderResult struct {
	CreateLinearOrder `json:",inline"`
}

CreateLinearOrderResult :

type CreateOrder

type CreateOrder struct {
	UserID        int           `json:"user_id"`
	OrderID       string        `json:"order_id"`
	Symbol        SymbolInverse `json:"symbol"`
	Side          Side          `json:"side"`
	OrderType     OrderType     `json:"order_type"`
	Price         float64       `json:"price"`
	Qty           float64       `json:"qty"`
	TimeInForce   TimeInForce   `json:"time_in_force"`
	OrderStatus   OrderStatus   `json:"order_status"`
	LastExecTime  float64       `json:"last_exec_time"`
	LastExecPrice float64       `json:"last_exec_price"`
	LeavesQty     float64       `json:"leaves_qty"`
	CumExecQty    float64       `json:"cum_exec_qty"`
	CumExecValue  float64       `json:"cum_exec_value"`
	CumExecFee    float64       `json:"cum_exec_fee"`
	RejectReason  string        `json:"reject_reason"`
	OrderLinkID   string        `json:"order_link_id"`
	CreatedAt     string        `json:"created_at"`
	UpdatedAt     string        `json:"updated_at"`
}

CreateOrder :

type CreateOrderParam

type CreateOrderParam struct {
	Side        Side          `json:"side"`
	Symbol      SymbolInverse `json:"symbol"`
	OrderType   OrderType     `json:"order_type"`
	Qty         int           `json:"qty"`
	TimeInForce TimeInForce   `json:"time_in_force"`

	Price          *float64 `json:"price,omitempty"`
	TakeProfit     *float64 `json:"take_profit,omitempty"`
	StopLoss       *float64 `json:"stop_loss,omitempty"`
	ReduceOnly     *bool    `json:"reduce_only,omitempty"`
	CloseOnTrigger *bool    `json:"close_on_trigger,omitempty"`
	OrderLinkID    *string  `json:"order_link_id,omitempty"`
}

CreateOrderParam :

type CreateOrderResponse

type CreateOrderResponse struct {
	CommonResponse `json:",inline"`
	Result         CreateOrderResult `json:"result"`
}

CreateOrderResponse :

type CreateOrderResult

type CreateOrderResult struct {
	CreateOrder `json:",inline"`
}

CreateOrderResult :

type DerivativeService

type DerivativeService struct {
	// contains filtered or unexported fields
}

DerivativeService :

type Direction

type Direction string

Direction :

type ErrorResponse added in v0.0.21

type ErrorResponse struct {
	RetCode int    `json:"ret_code"`
	RetMsg  string `json:"ret_msg"`
}

ErrorResponse :

func (*ErrorResponse) Error added in v0.0.21

func (r *ErrorResponse) Error() string

Error :

type ExecType

type ExecType string

ExecType :

type FutureCommonService

type FutureCommonService struct {
	// contains filtered or unexported fields
}

FutureCommonService :

func (*FutureCommonService) APIKey

func (s *FutureCommonService) APIKey() (*APIKeyResponse, error)

Balance :

func (*FutureCommonService) AccountRatio

AccountRatio :

func (*FutureCommonService) Balance

func (s *FutureCommonService) Balance(coin Coin) (*BalanceResponse, error)

Balance :

func (*FutureCommonService) BigDeal

func (s *FutureCommonService) BigDeal(param BigDealParam) (*BigDealResponse, error)

BigDeal :

func (*FutureCommonService) IndexPriceKline

IndexPriceKline :

func (*FutureCommonService) ListKline

ListKline :

func (*FutureCommonService) MarkPriceKline

MarkPriceKline :

func (*FutureCommonService) OpenInterest

OpenInterest :

func (*FutureCommonService) OrderBook

func (s *FutureCommonService) OrderBook(symbol SymbolInverse) (*OrderBookResponse, error)

OrderBook :

func (*FutureCommonService) Symbols

func (s *FutureCommonService) Symbols() (*SymbolsResponse, error)

Symbols :

func (*FutureCommonService) Tickers

func (s *FutureCommonService) Tickers(symbol SymbolInverse) (*TickersResponse, error)

Tickers :

func (*FutureCommonService) TradingRecords

TradingRecords :

type FutureContractService added in v0.0.13

type FutureContractService struct {
	*FutureCommonService
	// contains filtered or unexported fields
}

FutureContractService :

func (*FutureContractService) Balance added in v0.0.13

Balance :

func (*FutureContractService) ContractExecutionHistoryList added in v0.0.13

ContractExecutionHistoryList :

func (*FutureContractService) ListKline added in v0.0.13

ListKline :

func (*FutureContractService) Symbols added in v0.0.13

Symbols :

func (*FutureContractService) Tickers added in v0.0.13

func (s *FutureContractService) Tickers(category string, symbol string) (*ContractTickersResponse, error)

Tickers :

type FutureContractServiceI added in v0.0.13

type FutureContractServiceI interface {
	// Market Data Endpoints
	Tickers(category string, symbol string) (*ContractTickersResponse, error)
	Symbols() (*ContractSymbolsResponse, error)
	ListKline(ContractListKlineParam) (*ContractListKlineResponse, error)

	// Account Data Endpoints
	ContractExecutionHistoryList(param ContractExecutionHistoryListParam) (*ContractExecutionHistoryListResponse, error)

	// Wallet Data Endpoints
	Balance(Coin) (*ContractBalanceResponse, error)
}

FutureContractServiceI :

type FutureInverseFutureService

type FutureInverseFutureService struct {
	*FutureCommonService
	// contains filtered or unexported fields
}

FutureInverseFutureService :

type FutureInverseFutureServiceI

type FutureInverseFutureServiceI interface {
	// Market Data Endpoints
	OrderBook(SymbolInverse) (*OrderBookResponse, error)
	ListKline(ListKlineParam) (*ListKlineResponse, error)
	Tickers(SymbolInverse) (*TickersResponse, error)
	TradingRecords(TradingRecordsParam) (*TradingRecordsResponse, error)
	Symbols() (*SymbolsResponse, error)
	MarkPriceKline(MarkPriceKlineParam) (*MarkPriceKlineResponse, error)
	IndexPriceKline(IndexPriceKlineParam) (*IndexPriceKlineResponse, error)
	OpenInterest(OpenInterestParam) (*OpenInterestResponse, error)
	BigDeal(BigDealParam) (*BigDealResponse, error)
	AccountRatio(AccountRatioParam) (*AccountRatioResponse, error)

	// Wallet Data Endpoints
	Balance(Coin) (*BalanceResponse, error)

	// Account Data Endpoints
	APIKey() (*APIKeyResponse, error)
}

FutureInverseFutureServiceI :

type FutureInversePerpetualService

type FutureInversePerpetualService struct {
	*FutureCommonService
	// contains filtered or unexported fields
}

FutureInversePerpetualService :

func (*FutureInversePerpetualService) CancelOrder

CancelOrder :

func (*FutureInversePerpetualService) CreateOrder

CreateOrder :

func (*FutureInversePerpetualService) ListOrder

ListOrder :

func (*FutureInversePerpetualService) ListPosition

ListPosition :

func (*FutureInversePerpetualService) ListPositions

ListPositions :

func (*FutureInversePerpetualService) PremiumIndexKline

PremiumIndexKline :

func (*FutureInversePerpetualService) SaveLeverage

SaveLeverage :

type FutureInversePerpetualServiceI

type FutureInversePerpetualServiceI interface {
	// Market Data Endpoints
	OrderBook(SymbolInverse) (*OrderBookResponse, error)
	ListKline(ListKlineParam) (*ListKlineResponse, error)
	Tickers(SymbolInverse) (*TickersResponse, error)
	TradingRecords(TradingRecordsParam) (*TradingRecordsResponse, error)
	Symbols() (*SymbolsResponse, error)
	MarkPriceKline(MarkPriceKlineParam) (*MarkPriceKlineResponse, error)
	IndexPriceKline(IndexPriceKlineParam) (*IndexPriceKlineResponse, error)
	PremiumIndexKline(PremiumIndexKlineParam) (*PremiumIndexKlineResponse, error)
	OpenInterest(OpenInterestParam) (*OpenInterestResponse, error)
	BigDeal(BigDealParam) (*BigDealResponse, error)
	AccountRatio(AccountRatioParam) (*AccountRatioResponse, error)

	// Account Data Endpoints
	CreateOrder(CreateOrderParam) (*CreateOrderResponse, error)
	ListOrder(ListOrderParam) (*ListOrderResponse, error)
	CancelOrder(CancelOrderParam) (*CancelOrderResponse, error)
	ListPosition(SymbolInverse) (*ListPositionResponse, error)
	ListPositions() (*ListPositionsResponse, error)
	SaveLeverage(SaveLeverageParam) (*SaveLeverageResponse, error)

	// Wallet Data Endpoints
	Balance(Coin) (*BalanceResponse, error)
}

FutureInversePerpetualServiceI :

type FutureService

type FutureService struct {
	// contains filtered or unexported fields
}

FutureService :

func (*FutureService) Contract added in v0.0.14

func (s *FutureService) Contract() FutureContractServiceI

ContractFuture :

func (*FutureService) InverseFuture

func (s *FutureService) InverseFuture() FutureInverseFutureServiceI

InverseFuture :

func (*FutureService) InversePerpetual

func (s *FutureService) InversePerpetual() FutureInversePerpetualServiceI

InversePerpetual :

func (*FutureService) USDTPerpetual

func (s *FutureService) USDTPerpetual() FutureUSDTPerpetualServiceI

USDTPerpetual :

type FutureServiceI

type FutureServiceI interface {
	InversePerpetual() FutureInversePerpetualServiceI
	USDTPerpetual() FutureUSDTPerpetualServiceI
	InverseFuture() FutureInverseFutureServiceI
	Contract() FutureContractServiceI
}

FutureServiceI :

type FutureUSDTPerpetualService

type FutureUSDTPerpetualService struct {
	*FutureCommonService
	// contains filtered or unexported fields
}

FutureUSDTPerpetualService :

func (*FutureUSDTPerpetualService) CancelLinearOrder

CancelLinearOrder :

func (*FutureUSDTPerpetualService) CreateLinearOrder

CreateLinearOrder :

func (*FutureUSDTPerpetualService) LinearCancelAllOrder

LinearCancelAllOrder : Cancel all active orders that are unfilled or partially filled. Fully filled orders cannot be cancelled.

func (*FutureUSDTPerpetualService) LinearExecutionHistoryList added in v0.0.3

LinearExecutionHistoryList :

func (*FutureUSDTPerpetualService) LinearExecutionList

LinearExecutionList :

func (*FutureUSDTPerpetualService) ListKline added in v0.0.6

ListKline :

func (*FutureUSDTPerpetualService) ListLinearPosition

func (s *FutureUSDTPerpetualService) ListLinearPosition(symbol SymbolUSDT) (*ListLinearPositionResponse, error)

ListLinearPosition :

func (*FutureUSDTPerpetualService) ListLinearPositions

func (s *FutureUSDTPerpetualService) ListLinearPositions() (*ListLinearPositionsResponse, error)

ListLinearPositions :

func (*FutureUSDTPerpetualService) SaveLinearLeverage

SaveLinearLeverage :

type FutureUSDTPerpetualServiceI

type FutureUSDTPerpetualServiceI interface {
	// Market Data Endpoints
	OrderBook(SymbolInverse) (*OrderBookResponse, error)
	Tickers(SymbolInverse) (*TickersResponse, error)
	Symbols() (*SymbolsResponse, error)
	OpenInterest(OpenInterestParam) (*OpenInterestResponse, error)
	BigDeal(BigDealParam) (*BigDealResponse, error)
	AccountRatio(AccountRatioParam) (*AccountRatioResponse, error)
	ListKline(ListKlineParam) (*ListKlineResponse, error)

	// Account Data Endpoints
	CreateLinearOrder(CreateLinearOrderParam) (*CreateLinearOrderResponse, error)
	CancelLinearOrder(CancelLinearOrderParam) (*CancelLinearOrderResponse, error)
	LinearCancelAllOrder(LinearCancelAllParam) (*LinearCancelAllResponse, error)
	ListLinearPosition(SymbolUSDT) (*ListLinearPositionResponse, error)
	ListLinearPositions() (*ListLinearPositionsResponse, error)
	SaveLinearLeverage(SaveLinearLeverageParam) (*SaveLinearLeverageResponse, error)
	LinearExecutionList(LinearExecutionListParam) (*LinearExecutionListResponse, error)
	LinearExecutionHistoryList(param LinearExecutionHistoryListParam) (*LinearExecutionHistoryListResponse, error)

	// Wallet Data Endpoints
	Balance(Coin) (*BalanceResponse, error)
}

FutureUSDTPerpetualServiceI :

type IndexPriceKlineParam

type IndexPriceKlineParam struct {
	Symbol   SymbolInverse `url:"symbol"`
	Interval Interval      `url:"interval"`
	From     int           `url:"from"`

	Limit *int `url:"limit,omitempty"`
}

IndexPriceKlineParam :

type IndexPriceKlineResponse

type IndexPriceKlineResponse struct {
	CommonResponse `json:",inline"`
	Result         []IndexPriceKlineResult `json:"result"`
}

IndexPriceKlineResponse :

type IndexPriceKlineResult

type IndexPriceKlineResult struct {
	Symbol   SymbolInverse `json:"symbol"`
	Period   Period        `json:"period"`
	OpenTime int           `json:"open_time"`
	Open     string        `json:"open"`
	High     string        `json:"high"`
	Low      string        `json:"low"`
	Close    string        `json:"close"`
}

IndexPriceKlineResult :

type Innovation added in v0.0.21

type Innovation string

Innovation :

type InstrumentStatus added in v0.0.21

type InstrumentStatus string

InstrumentStatus :

type Interval

type Interval string

Interval :

type IsLeverage added in v0.0.21

type IsLeverage int

IsLeverage : Valid for spot only

type LeverageFilter

type LeverageFilter struct {
	MinLeverage  float64 `json:"min_leverage"`
	MaxLeverage  float64 `json:"max_leverage"`
	LeverageStep string  `json:"leverage_step"`
}

LeverageFilter :

type LinearCancelAllParam

type LinearCancelAllParam struct {
	Symbol SymbolUSDT `json:"symbol"`
}

LinearCancelAllParam : Parameters to be supplied to cancel all endpoint

type LinearCancelAllResponse

type LinearCancelAllResponse struct {
	CommonResponse `json:",inline"`
	Result         LinearCancelAllResult `json:"result"`
}

LinearCancelAllResponse : Response from cancel all endpoint

type LinearCancelAllResult

type LinearCancelAllResult []string

type LinearExecutionHistoryListParam added in v0.0.3

type LinearExecutionHistoryListParam struct {
	Symbol SymbolUSDT `url:"symbol"`

	StartTime *int      `url:"start_time,omitempty"`
	EndTime   *int      `url:"end_time,omitempty"`
	ExecType  *ExecType `url:"exec_type,omitempty"`
	PageToken *string   `url:"page_token,omitempty"`
	Limit     *int      `url:"limit,omitempty"`
}

LinearExecutionHistoryListParam :

type LinearExecutionHistoryListResponse added in v0.0.3

type LinearExecutionHistoryListResponse struct {
	CommonResponse `json:",inline"`
	Result         LinearExecutionHistoryListResult `json:"result"`
}

LinearExecutionHistoryListResponse :

type LinearExecutionHistoryListResult added in v0.0.3

type LinearExecutionHistoryListResult struct {
	PageToken            string                `json:"page_token"`
	LinearExecutionLists []LinearExecutionList `json:"data"`
}

LinearExecutionHistoryListResult :

type LinearExecutionList

type LinearExecutionList struct {
	OrderID          string     `json:"order_id"`
	OrderLinkID      string     `json:"order_link_id"`
	Side             Side       `json:"side"`
	Symbol           SymbolUSDT `json:"symbol"`
	OrderPrice       float64    `json:"order_price"`
	OrderQty         float64    `json:"order_qty"`
	OrderType        OrderType  `json:"order_type"`
	FeeRate          float64    `json:"fee_rate"`
	ExecID           string     `json:"exec_id"`
	ExecPrice        float64    `json:"exec_price"`
	ExecType         ExecType   `json:"exec_type"`
	ExecQty          float64    `json:"exec_qty"`
	ExecFee          float64    `json:"exec_fee"`
	ExecValue        float64    `json:"exec_value"`
	LeavesQty        float64    `json:"leaves_qty"`
	ClosedSize       float64    `json:"closed_size"`
	LastLiquidityInd string     `json:"last_liquidity_ind"`
	TradeTimeMs      int64      `json:"trade_time_ms"`
}

LinearExecutionList :

type LinearExecutionListParam

type LinearExecutionListParam struct {
	Symbol SymbolUSDT `url:"symbol"`

	StartTime *int      `url:"start_time,omitempty"`
	EndTime   *int      `url:"end_time,omitempty"`
	ExecType  *ExecType `url:"exec_type,omitempty"`
	Page      *int      `url:"page,omitempty"`
	Limit     *int      `url:"limit,omitempty"`
}

LinearExecutionListParam :

type LinearExecutionListResponse

type LinearExecutionListResponse struct {
	CommonResponse `json:",inline"`
	Result         LinearExecutionListResult `json:"result"`
}

LinearExecutionListResponse :

type LinearExecutionListResult

type LinearExecutionListResult struct {
	CurrentPage          int                   `json:"current_page"`
	LinearExecutionLists []LinearExecutionList `json:"data"`
}

LinearExecutionListResult :

type ListKlineParam

type ListKlineParam struct {
	Symbol   SymbolInverse `url:"symbol"`
	Interval Interval      `url:"interval"`
	From     int           `url:"from"`

	Limit *int `url:"limit,omitempty"`
}

ListKlineParam :

type ListKlineResponse

type ListKlineResponse struct {
	CommonResponse `json:",inline"`
	Result         []ListKlineResult `json:"result"`
}

ListKlineResponse :

type ListKlineResult

type ListKlineResult struct {
	Symbol   SymbolInverse `json:"symbol"`
	Interval string        `json:"interval"`
	OpenTime int           `json:"open_time"`
	Open     float64       `json:"open"`
	High     float64       `json:"high"`
	Low      float64       `json:"low"`
	Close    float64       `json:"close"`
	Volume   float64       `json:"volume"`
	Turnover float64       `json:"turnover"`
}

ListKlineResult :

type ListLinearPositionResponse

type ListLinearPositionResponse struct {
	CommonResponse `json:",inline"`
	Result         []ListLinearPositionResult `json:"result"`
}

ListLinearPositionResponse :

type ListLinearPositionResult

type ListLinearPositionResult struct {
	UserID              int           `json:"user_id"`
	Symbol              SymbolInverse `json:"symbol"`
	Side                Side          `json:"side"`
	Size                float64       `json:"size"`
	PositionValue       float64       `json:"position_value"`
	EntryPrice          float64       `json:"entry_price"`
	LiqPrice            float64       `json:"liq_price"`
	BustPrice           float64       `json:"bust_price"`
	Leverage            float64       `json:"leverage"`
	AutoAddMargin       float64       `json:"auto_add_margin"`
	IsIsolated          bool          `json:"is_isolated"`
	PositionMargin      float64       `json:"position_margin"`
	OccClosingFee       float64       `json:"occ_closing_fee"`
	RealisedPnl         float64       `json:"realised_pnl"`
	CumRealisedPnl      float64       `json:"cum_realised_pnl"`
	FreeQty             float64       `json:"free_qty"`
	TpSlMode            TpSlMode      `json:"tp_sl_mode"`
	DeleverageIndicator int           `json:"deleverage_indicator"`
	UnrealisedPnl       float64       `json:"unrealised_pnl"`
	RiskID              int           `json:"risk_id"`
}

ListLinearPositionResult :

type ListLinearPositionsResponse

type ListLinearPositionsResponse struct {
	CommonResponse `json:",inline"`
	Result         []ListLinearPositionsResult `json:"result"`
}

ListLinearPositionsResponse :

type ListLinearPositionsResult

type ListLinearPositionsResult struct {
	IsValid                  bool `json:"is_valid"`
	ListLinearPositionResult `json:"data,inline"`
}

ListLinearPositionsResult :

type ListOrder

type ListOrder struct {
	UserID       int           `json:"user_id"`
	Symbol       SymbolInverse `json:"symbol"`
	Side         Side          `json:"side"`
	OrderType    OrderType     `json:"order_type"`
	Price        string        `json:"price"`
	Qty          string        `json:"qty"`
	TimeInForce  TimeInForce   `json:"time_in_force"`
	OrderStatus  OrderStatus   `json:"order_status"`
	LeavesQty    string        `json:"leaves_qty"`
	LeavesValue  string        `json:"leaves_value"`
	CumExecQty   string        `json:"cum_exec_qty"`
	CumExecValue string        `json:"cum_exec_value"`
	CumExecFee   string        `json:"cum_exec_fee"`
	RejectReason string        `json:"reject_reason"`
	OrderLinkID  string        `json:"order_link_id"`
	CreatedAt    string        `json:"created_at"`
	OrderID      string        `json:"order_id"`
	TakeProfit   string        `json:"take_profit"`
	StopLoss     string        `json:"stop_loss"`
	TpTriggerBy  string        `json:"tp_trigger_by"`
	SlTriggerBy  string        `json:"sl_trigger_by"`
}

ListOrder :

type ListOrderParam

type ListOrderParam struct {
	Symbol SymbolInverse `url:"symbol"`

	OrderStatus *OrderStatus `url:"order_status,omitempty"`
	Direction   *Direction   `url:"direction,omitempty"`
	Size        *int         `url:"size,omitempty"`
	Cursor      *string      `url:"cursor,omitempty"`
}

ListOrderParam :

type ListOrderResponse

type ListOrderResponse struct {
	CommonResponse `json:",inline"`
	Result         ListOrderResult `json:"result"`
}

ListOrderResponse :

type ListOrderResult

type ListOrderResult struct {
	ListOrders []ListOrder `json:"data"`
}

ListOrderResult :

type ListPositionResponse

type ListPositionResponse struct {
	CommonResponse `json:",inline"`
	Result         ListPositionResult `json:"result"`
}

ListPositionResponse :

type ListPositionResult

type ListPositionResult struct {
	ID                  int           `json:"id"`
	UserID              int           `json:"user_id"`
	RiskID              int           `json:"risk_id"`
	Symbol              SymbolInverse `json:"symbol"`
	Side                Side          `json:"side"`
	Size                float64       `json:"size"`
	PositionValue       string        `json:"position_value"`
	EntryPrice          string        `json:"entry_price"`
	IsIsolated          bool          `json:"is_isolated"`
	AutoAddMargin       float64       `json:"auto_add_margin"`
	Leverage            string        `json:"leverage"`
	EffectiveLeverage   string        `json:"effective_leverage"`
	PositionMargin      string        `json:"position_margin"`
	LiqPrice            string        `json:"liq_price"`
	BustPrice           string        `json:"bust_price"`
	OccClosingFee       string        `json:"occ_closing_fee"`
	OccFundingFee       string        `json:"occ_funding_fee"`
	TakeProfit          string        `json:"take_profit"`
	StopLoss            string        `json:"stop_loss"`
	TrailingStop        string        `json:"trailing_stop"`
	PositionStatus      string        `json:"position_status"`
	DeleverageIndicator int           `json:"deleverage_indicator"`
	OcCalcData          string        `json:"oc_calc_data"`
	OrderMargin         string        `json:"order_margin"`
	WalletBalance       string        `json:"wallet_balance"`
	RealisedPnl         string        `json:"realised_pnl"`
	UnrealisedPnl       float64       `json:"unrealised_pnl"`
	CumRealisedPnl      string        `json:"cum_realised_pnl"`
	CrossSeq            float64       `json:"cross_seq"`
	PositionSeq         float64       `json:"position_seq"`
	CreatedAt           string        `json:"created_at"`
	UpdatedAt           string        `json:"updated_at"`
}

ListPositionResult :

type ListPositionsResponse

type ListPositionsResponse struct {
	CommonResponse `json:",inline"`
	Result         []ListPositionsResult `json:"result"`
}

ListPositionsResponse :

type ListPositionsResult

type ListPositionsResult struct {
	IsValid            bool `json:"is_valid"`
	ListPositionResult `json:"data,inline"`
}

ListPositionsResult :

type Logger added in v0.0.29

type Logger interface {
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Errorf(template string, args ...interface{})
}

type LotSizeFilter

type LotSizeFilter struct {
	MaxTradingQty float64 `json:"max_trading_qty"`
	MinTradingQty float64 `json:"min_trading_qty"`
	QtyStep       float64 `json:"qty_step"`
}

LotSizeFilter :

type MarkPriceKlineParam

type MarkPriceKlineParam struct {
	Symbol   SymbolInverse `url:"symbol"`
	Interval Interval      `url:"interval"`
	From     int           `url:"from"`

	Limit *int `url:"limit,omitempty"`
}

MarkPriceKlineParam :

type MarkPriceKlineResponse

type MarkPriceKlineResponse struct {
	CommonResponse `json:",inline"`
	Result         []MarkPriceKlineResult `json:"result"`
}

MarkPriceKlineResponse :

type MarkPriceKlineResult

type MarkPriceKlineResult struct {
	Symbol  SymbolInverse `json:"symbol"`
	Period  Period        `json:"period"`
	StartAt int           `json:"start_at"`
	Open    float64       `json:"open"`
	High    float64       `json:"high"`
	Low     float64       `json:"low"`
	Close   float64       `json:"close"`
}

MarkPriceKlineResult :

type OpenInterestParam

type OpenInterestParam struct {
	Symbol SymbolInverse `url:"symbol"`
	Period Period        `url:"period"`

	Limit *int `url:"limit,omitempty"`
}

OpenInterestParam :

type OpenInterestResponse

type OpenInterestResponse struct {
	CommonResponse `json:",inline"`
	Result         []OpenInterestResult `json:"result"`
}

OpenInterestResponse :

type OpenInterestResult

type OpenInterestResult struct {
	OpenInterest int           `json:"open_interest"`
	Timestamp    int           `json:"timestamp"`
	Symbol       SymbolInverse `json:"symbol"`
}

OpenInterestResult :

type OptionsType added in v0.0.21

type OptionsType string

OptionsType :

type OrderBookResponse

type OrderBookResponse struct {
	CommonResponse `json:",inline"`
	Result         []OrderBookResult `json:"result"`
}

OrderBookResponse :

type OrderBookResult

type OrderBookResult struct {
	Symbol SymbolInverse `json:"symbol"`
	Price  string        `json:"price"`
	Size   float64       `json:"size"`
	Side   Side          `json:"side"`
}

OrderBookResult :

type OrderFilter added in v0.0.21

type OrderFilter string

OrderFilter : Valid for spot only

type OrderStatus

type OrderStatus string

OrderStatus :

type OrderStatusSpot

type OrderStatusSpot string

OrderStatusSpot :

type OrderType

type OrderType string

OrderType :

type OrderTypeSpot

type OrderTypeSpot string

OrderTypeSpot :

type Period

type Period string

Period :

type PositionIdx added in v0.0.21

type PositionIdx int

PositionIdx :

type PremiumIndexKlineParam

type PremiumIndexKlineParam struct {
	Symbol   SymbolInverse `url:"symbol"`
	Interval Interval      `url:"interval"`
	From     int           `url:"from"`

	Limit *int `url:"limit,omitempty"`
}

PremiumIndexKlineParam :

type PremiumIndexKlineResponse

type PremiumIndexKlineResponse struct {
	CommonResponse `json:",inline"`
	Result         []PremiumIndexKlineResult `json:"result"`
}

PremiumIndexKlineResponse :

type PremiumIndexKlineResult

type PremiumIndexKlineResult struct {
	Symbol   SymbolInverse `json:"symbol"`
	Period   Period        `json:"period"`
	OpenTime int           `json:"open_time"`
	Open     string        `json:"open"`
	High     string        `json:"high"`
	Low      string        `json:"low"`
	Close    string        `json:"close"`
}

PremiumIndexKlineResult :

type PriceFilter

type PriceFilter struct {
	MinPrice string `json:"min_price"`
	MaxPrice string `json:"max_price"`
	TickSize string `json:"tick_size"`
}

PriceFilter :

type RateLimitError added in v0.0.21

type RateLimitError struct {
	*CommonResponse `json:",inline"`
}

RateLimitError :

func (*RateLimitError) Error added in v0.0.21

func (r *RateLimitError) Error() string

type RateLimitHeaders added in v0.0.22

type RateLimitHeaders struct {
	RateLimitStatus  int `json:"rate_limit_status"`
	RateLimitResetMs int `json:"rate_limit_reset_ms"`
	RateLimit        int `json:"rate_limit"`
}

type SaveLeverageParam

type SaveLeverageParam struct {
	Symbol   SymbolInverse `json:"symbol"`
	Leverage float64       `json:"leverage"`
}

SaveLeverageParam :

type SaveLeverageResponse

type SaveLeverageResponse struct {
	CommonResponse `json:",inline"`
	Result         float64 `json:"result"`
}

SaveLeverageResponse :

type SaveLinearLeverageParam

type SaveLinearLeverageParam struct {
	Symbol       SymbolUSDT `json:"symbol"`
	BuyLeverage  float64    `json:"buy_leverage"`
	SellLeverage float64    `json:"sell_leverage"`
}

SaveLinearLeverageParam :

type SaveLinearLeverageResponse

type SaveLinearLeverageResponse struct {
	CommonResponse `json:",inline"`
}

SaveLinearLeverageResponse :

type Side

type Side string

Side :

type SpotDeleteOrderFastParam

type SpotDeleteOrderFastParam struct {
	Symbol SymbolSpot `url:"symbolId"`

	OrderID     *string `url:"orderId,omitempty"`
	OrderLinkID *string `url:"orderLinkId,omitempty"`
}

type SpotDeleteOrderFastResponse

type SpotDeleteOrderFastResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotDeleteOrderFastResult `json:"result"`
}

type SpotDeleteOrderFastResult

type SpotDeleteOrderFastResult struct {
	IsCancelled bool `json:"isCancelled"`
}

type SpotDeleteOrderParam

type SpotDeleteOrderParam struct {
	OrderID     *string `url:"orderId,omitempty"`
	OrderLinkID *string `url:"orderLinkId,omitempty"`
}

SpotDeleteOrderParam :

type SpotDeleteOrderResponse

type SpotDeleteOrderResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotDeleteOrderResult `json:"result"`
}

SpotDeleteOrderResponse :

type SpotDeleteOrderResult

type SpotDeleteOrderResult struct {
	OrderId      string `json:"orderId"`
	OrderLinkId  string `json:"orderLinkId"`
	Symbol       string `json:"symbol"`
	Status       string `json:"status"`
	AccountId    string `json:"accountId"`
	TransactTime string `json:"transactTime"`
	Price        string `json:"price"`
	OrigQty      string `json:"origQty"`
	ExecutedQty  string `json:"executedQty"`
	TimeInForce  string `json:"timeInForce"`
	Type         string `json:"type"`
	Side         string `json:"side"`
}

SpotDeleteOrderResult :

type SpotGetOrderParam

type SpotGetOrderParam struct {
	OrderID     *string `url:"orderId,omitempty"`
	OrderLinkID *string `url:"orderLinkId,omitempty"`
}

SpotGetOrderParam :

type SpotGetOrderResponse

type SpotGetOrderResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotGetOrderResult `json:"result"`
}

SpotGetOrderResponse :

type SpotGetOrderResult

type SpotGetOrderResult struct {
	AccountId           string `json:"accountId"`
	ExchangeId          string `json:"exchangeId"`
	Symbol              string `json:"symbol"`
	SymbolName          string `json:"symbolName"`
	OrderLinkId         string `json:"orderLinkId"`
	OrderId             string `json:"orderId"`
	Price               string `json:"price"`
	OrigQty             string `json:"origQty"`
	ExecutedQty         string `json:"executedQty"`
	CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
	AvgPrice            string `json:"avgPrice"`
	Status              string `json:"status"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	Side                string `json:"side"`
	StopPrice           string `json:"stopPrice"`
	IcebergQty          string `json:"icebergQty"`
	Time                string `json:"time"`
	UpdateTime          string `json:"updateTime"`
	IsWorking           bool   `json:"isWorking"`
}

SpotGetOrderResult :

type SpotInterval

type SpotInterval string

SpotInterval :

type SpotOrderBatchCancelByIDsResponse

type SpotOrderBatchCancelByIDsResponse struct {
	CommonResponse `json:",inline"`
	Result         []SpotOrderBatchCancelByIDsResult `json:"result"`
}

type SpotOrderBatchCancelByIDsResult

type SpotOrderBatchCancelByIDsResult struct {
	OrderID string `json:"orderId"`
	Code    string `json:"code"`
}

type SpotOrderBatchCancelParam

type SpotOrderBatchCancelParam struct {
	Symbol SymbolSpot `url:"symbolId"`

	Side  *Side           `url:"side,omitempty"`
	Types []OrderTypeSpot `url:"orderTypes,omitempty" del:","`
}

type SpotOrderBatchCancelResponse

type SpotOrderBatchCancelResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotOrderBatchCancelResult `json:"result"`
}

type SpotOrderBatchCancelResult

type SpotOrderBatchCancelResult struct {
	Success bool `json:"success"`
}

type SpotOrderBatchFastCancelParam

type SpotOrderBatchFastCancelParam struct {
	Symbol SymbolSpot `url:"symbolId"`

	Side  *Side           `url:"side,omitempty"`
	Types []OrderTypeSpot `url:"orderTypes,omitempty" del:","`
}

type SpotOrderBatchFastCancelResponse

type SpotOrderBatchFastCancelResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotOrderBatchFastCancelResult `json:"result"`
}

type SpotOrderBatchFastCancelResult

type SpotOrderBatchFastCancelResult struct {
	Success bool `json:"success"`
}

type SpotPostOrderParam

type SpotPostOrderParam struct {
	Symbol SymbolSpot    `url:"symbol"`
	Qty    float64       `url:"qty"`
	Side   Side          `url:"side"`
	Type   OrderTypeSpot `url:"type"`

	TimeInForce *TimeInForceSpot `url:"timeInForce,omitempty"`
	Price       *float64         `url:"price,omitempty"`
	OrderLinkID *string          `url:"orderLinkId,omitempty"`
}

SpotPostOrderParam :

type SpotPostOrderResponse

type SpotPostOrderResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotPostOrderResult `json:"result"`
}

SpotPostOrderResponse :

type SpotPostOrderResult

type SpotPostOrderResult struct {
	OrderID      string          `json:"orderId"`
	OrderLinkID  string          `json:"orderLinkId"`
	Symbol       string          `json:"symbol"`
	TransactTime string          `json:"transactTime"`
	Price        string          `json:"price"`
	OrigQty      string          `json:"origQty"`
	Type         OrderTypeSpot   `json:"type"`
	Side         string          `json:"side"`
	Status       OrderStatusSpot `json:"status"`
	TimeInForce  TimeInForceSpot `json:"timeInForce"`
	AccountID    string          `json:"accountId"`
	SymbolName   string          `json:"symbolName"`
	ExecutedQty  string          `json:"executedQty"`
}

SpotPostOrderResult :

type SpotQuoteDepthBidAsk

type SpotQuoteDepthBidAsk struct {
	Price    string
	Quantity string
}

SpotQuoteDepthBidAsk :

type SpotQuoteDepthBidsAsks

type SpotQuoteDepthBidsAsks []SpotQuoteDepthBidAsk

SpotQuoteDepthBidsAsks :

func (*SpotQuoteDepthBidsAsks) UnmarshalJSON

func (r *SpotQuoteDepthBidsAsks) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type SpotQuoteDepthMergedParam

type SpotQuoteDepthMergedParam struct {
	Symbol SymbolSpot `url:"symbol"`

	Scale *int `url:"scale,omitempty"`
	Limit *int `url:"limit,omitempty"`
}

SpotQuoteDepthMergedParam :

type SpotQuoteDepthMergedResponse

type SpotQuoteDepthMergedResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotQuoteDepthMergedResult `json:"result"`
}

SpotQuoteDepthMergedResponse :

type SpotQuoteDepthMergedResult

type SpotQuoteDepthMergedResult struct {
	Time int                    `json:"time"`
	Bids SpotQuoteDepthBidsAsks `json:"bids"`
	Asks SpotQuoteDepthBidsAsks `json:"asks"`
}

SpotQuoteDepthMergedResult :

type SpotQuoteDepthParam

type SpotQuoteDepthParam struct {
	Symbol SymbolSpot `url:"symbol"`

	Limit *int `url:"limit,omitempty"`
}

SpotQuoteDepthParam :

type SpotQuoteDepthResponse

type SpotQuoteDepthResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotQuoteDepthResult `json:"result"`
}

SpotQuoteDepthResponse :

type SpotQuoteDepthResult

type SpotQuoteDepthResult struct {
	Time int                    `json:"time"`
	Bids SpotQuoteDepthBidsAsks `json:"bids"`
	Asks SpotQuoteDepthBidsAsks `json:"asks"`
}

SpotQuoteDepthResult :

type SpotQuoteKline

type SpotQuoteKline struct {
	StartTime        int
	Open             string
	High             string
	Low              string
	Close            string
	Volume           string
	EndTime          int
	QuoteAssetVolume string
	Trades           int
	TakerBaseVolume  string
	TakerQuoteVolume string
}

SpotQuoteKline :

type SpotQuoteKlineParam

type SpotQuoteKlineParam struct {
	Symbol   SymbolSpot `url:"symbol"`
	Interval Interval   `url:"interval"`

	Limit     *int `url:"limit,omitempty"`
	StartTime *int `url:"startTime,omitempty"`
	EndTime   *int `url:"endTime,omitempty"`
}

SpotQuoteKlineParam :

type SpotQuoteKlineResponse

type SpotQuoteKlineResponse struct {
	CommonResponse `json:",inline"`
	Result         []SpotQuoteKlineResult `json:"result"`
}

SpotQuoteKlineResponse :

type SpotQuoteKlineResult

type SpotQuoteKlineResult struct {
	SpotQuoteKline SpotQuoteKline
}

SpotQuoteKlineResult :

func (*SpotQuoteKlineResult) UnmarshalJSON

func (r *SpotQuoteKlineResult) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type SpotQuoteTicker24hrParam

type SpotQuoteTicker24hrParam struct {
	Symbol *SymbolSpot `url:"symbol,omitempty"`
}

SpotQuoteTicker24hrParam :

type SpotQuoteTicker24hrResponse

type SpotQuoteTicker24hrResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotQuoteTicker24hrResult `json:"result"`
}

SpotQuoteTicker24hrResponse :

type SpotQuoteTicker24hrResult

type SpotQuoteTicker24hrResult struct {
	Time         int    `json:"time"`
	Symbol       string `json:"symbol"`
	BestBidPrice string `json:"bestBidPrice"`
	BestAskPrice string `json:"bestAskPrice"`
	LastPrice    string `json:"lastPrice"`
	OpenPrice    string `json:"openPrice"`
	HighPrice    string `json:"highPrice"`
	LowPrice     string `json:"lowPrice"`
	Volume       string `json:"volume"`
	QuoteVolume  string `json:"quoteVolume"`
}

SpotQuoteTicker24hrResult :

type SpotQuoteTickerBookTickerParam

type SpotQuoteTickerBookTickerParam struct {
	Symbol *SymbolSpot `url:"symbol,omitempty"`
}

SpotQuoteTickerBookTickerParam :

type SpotQuoteTickerBookTickerResponse

type SpotQuoteTickerBookTickerResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotQuoteTickerBookTickerResult `json:"result"`
}

SpotQuoteTickerBookTickerResponse :

type SpotQuoteTickerBookTickerResult

type SpotQuoteTickerBookTickerResult struct {
	Symbol   string `json:"symbol"`
	BidPrice string `json:"bidPrice"`
	BidQty   string `json:"bidQty"`
	AskPrice string `json:"askPrice"`
	AskQty   string `json:"askQty"`
	Time     int    `json:"time"`
}

SpotQuoteTickerBookTickerResult :

type SpotQuoteTickerPriceParam

type SpotQuoteTickerPriceParam struct {
	Symbol *SymbolSpot `url:"symbol,omitempty"`
}

SpotQuoteTickerPriceParam :

type SpotQuoteTickerPriceResponse

type SpotQuoteTickerPriceResponse struct {
	CommonResponse `json:",inline"`
	Result         SpotQuoteTickerPriceResult `json:"result"`
}

SpotQuoteTickerPriceResponse :

type SpotQuoteTickerPriceResult

type SpotQuoteTickerPriceResult struct {
	Symbol string `json:"symbol"`
	Price  string `json:"price"`
}

SpotQuoteTickerPriceResult :

type SpotQuoteTradesParam

type SpotQuoteTradesParam struct {
	Symbol SymbolSpot `url:"symbol"`

	Limit *int `url:"limit,omitempty"`
}

SpotQuoteTradesParam :

type SpotQuoteTradesResponse

type SpotQuoteTradesResponse struct {
	CommonResponse `json:",inline"`
	Result         []SpotQuoteTradesResult `json:"result"`
}

SpotQuoteTradesResponse :

type SpotQuoteTradesResult

type SpotQuoteTradesResult struct {
	Price        string `json:"price"`
	Time         int    `json:"time"`
	Qty          string `json:"qty"`
	IsBuyerMaker bool   `json:"isBuyerMaker"`
}

SpotQuoteTradesResult :

type SpotService

type SpotService struct {
	// contains filtered or unexported fields
}

SpotService :

func (*SpotService) V1

func (s *SpotService) V1() SpotV1ServiceI

V1 :

func (*SpotService) V3

func (s *SpotService) V3() *SpotV3Service

V3 :

type SpotServiceI

type SpotServiceI interface {
	V1() SpotV1ServiceI
	V3() *SpotV3Service
}

SpotServiceI :

type SpotSymbolsResponse

type SpotSymbolsResponse struct {
	CommonResponse `json:",inline"`
	Result         []SpotSymbolsResult `json:"result"`
}

SpotSymbolsResponse :

type SpotSymbolsResult

type SpotSymbolsResult struct {
	Name              string `json:"name"`
	Alias             string `json:"alias"`
	BaseCurrency      string `json:"baseCurrency"`
	QuoteCurrency     string `json:"quoteCurrency"`
	BasePrecision     string `json:"basePrecision"`
	QuotePrecision    string `json:"quotePrecision"`
	MinTradeQuantity  string `json:"minTradeQuantity"`
	MinTradeAmount    string `json:"minTradeAmount"`
	MinPricePrecision string `json:"minPricePrecision"`
	MaxTradeQuantity  string `json:"maxTradeQuantity"`
	MaxTradeAmount    string `json:"maxTradeAmount"`
	Category          int    `json:"category"`
}

SpotSymbolsResult :

type SpotV1Service

type SpotV1Service struct {
	// contains filtered or unexported fields
}

SpotV1Service :

func (*SpotV1Service) SpotDeleteOrder

func (s *SpotV1Service) SpotDeleteOrder(param SpotDeleteOrderParam) (*SpotDeleteOrderResponse, error)

SpotDeleteOrder :

func (*SpotV1Service) SpotDeleteOrderFast

func (s *SpotV1Service) SpotDeleteOrderFast(param SpotDeleteOrderFastParam) (*SpotDeleteOrderFastResponse, error)

SpotDeleteOrderFast :

func (*SpotV1Service) SpotGetOrder

func (s *SpotV1Service) SpotGetOrder(param SpotGetOrderParam) (*SpotGetOrderResponse, error)

SpotGetOrder :

func (*SpotV1Service) SpotOrderBatchCancel

func (*SpotV1Service) SpotOrderBatchCancelByIDs

func (s *SpotV1Service) SpotOrderBatchCancelByIDs(orderIDs []string) (*SpotOrderBatchCancelByIDsResponse, error)

TODO : have bug multiple orderIds

func (*SpotV1Service) SpotOrderBatchFastCancel

func (*SpotV1Service) SpotPostOrder

func (s *SpotV1Service) SpotPostOrder(param SpotPostOrderParam) (*SpotPostOrderResponse, error)

SpotPostOrder :

func (*SpotV1Service) SpotQuoteDepth

func (s *SpotV1Service) SpotQuoteDepth(param SpotQuoteDepthParam) (*SpotQuoteDepthResponse, error)

SpotQuoteDepth :

func (*SpotV1Service) SpotQuoteDepthMerged

SpotQuoteDepthMerged :

func (*SpotV1Service) SpotQuoteKline

func (s *SpotV1Service) SpotQuoteKline(param SpotQuoteKlineParam) (*SpotQuoteKlineResponse, error)

SpotQuoteKline :

func (*SpotV1Service) SpotQuoteTicker24hr

func (s *SpotV1Service) SpotQuoteTicker24hr(param SpotQuoteTicker24hrParam) (*SpotQuoteTicker24hrResponse, error)

SpotQuoteTicker24hr :

func (*SpotV1Service) SpotQuoteTickerBookTicker

SpotQuoteTickerBookTicker :

func (*SpotV1Service) SpotQuoteTickerPrice

SpotQuoteTickerPrice :

func (*SpotV1Service) SpotQuoteTrades

func (s *SpotV1Service) SpotQuoteTrades(param SpotQuoteTradesParam) (*SpotQuoteTradesResponse, error)

SpotQuoteTrades :

func (*SpotV1Service) SpotSymbols

func (s *SpotV1Service) SpotSymbols() (*SpotSymbolsResponse, error)

SpotSymbols :

type SpotV1ServiceI

SpotV1ServiceI :

type SpotV3Service

type SpotV3Service struct {
	// contains filtered or unexported fields
}

SpotV3Service :

type SpotWebsocketService

type SpotWebsocketService struct {
	// contains filtered or unexported fields
}

SpotWebsocketService :

func (*SpotWebsocketService) V1

V1 :

type SpotWebsocketV1PrivateEventType

type SpotWebsocketV1PrivateEventType string

SpotWebsocketV1PrivateEventType :

type SpotWebsocketV1PrivateOutboundAccountInfoResponse

type SpotWebsocketV1PrivateOutboundAccountInfoResponse struct {
	Content SpotWebsocketV1PrivateOutboundAccountInfoResponseContent
}

SpotWebsocketV1PrivateOutboundAccountInfoResponse :

func (*SpotWebsocketV1PrivateOutboundAccountInfoResponse) Key

Key :

func (*SpotWebsocketV1PrivateOutboundAccountInfoResponse) MarshalJSON

MarshalJSON :

func (*SpotWebsocketV1PrivateOutboundAccountInfoResponse) UnmarshalJSON

UnmarshalJSON :

type SpotWebsocketV1PrivateOutboundAccountInfoResponseContent

type SpotWebsocketV1PrivateOutboundAccountInfoResponseContent struct {
	EventType            SpotWebsocketV1PrivateEventType                                        `json:"e"`
	Timestamp            string                                                                 `json:"E"`
	AllowTrade           bool                                                                   `json:"T"`
	AllowWithdraw        bool                                                                   `json:"W"`
	AllowWDeposit        bool                                                                   `json:"D"`
	WalletBalanceChanges []SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange `json:"B"`
}

SpotWebsocketV1PrivateOutboundAccountInfoResponseContent :

type SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange

type SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange struct {
	SymbolName       string `json:"a"`
	AvailableBalance string `json:"f"`
	ReservedBalance  string `json:"l"`
}

SpotWebsocketV1PrivateOutboundAccountInfoResponseWalletBalanceChange :

type SpotWebsocketV1PrivateParamKey

type SpotWebsocketV1PrivateParamKey struct {
	EventType SpotWebsocketV1PrivateEventType
}

SpotWebsocketV1PrivateParamKey :

type SpotWebsocketV1PrivateService

type SpotWebsocketV1PrivateService struct {
	// contains filtered or unexported fields
}

SpotWebsocketV1PrivateService :

func (*SpotWebsocketV1PrivateService) Close

Close :

func (*SpotWebsocketV1PrivateService) Ping

Ping :

func (*SpotWebsocketV1PrivateService) RegisterFuncOutboundAccountInfo

RegisterFuncOutboundAccountInfo :

func (*SpotWebsocketV1PrivateService) Run

Run :

func (*SpotWebsocketV1PrivateService) Start

Start :

func (*SpotWebsocketV1PrivateService) Subscribe

func (s *SpotWebsocketV1PrivateService) Subscribe() error

Subscribe :

type SpotWebsocketV1PublicV1Event

type SpotWebsocketV1PublicV1Event string

SpotWebsocketV1PublicV1Event :

type SpotWebsocketV1PublicV1Service

type SpotWebsocketV1PublicV1Service struct {
	// contains filtered or unexported fields
}

SpotWebsocketV1PublicV1Service :

func (*SpotWebsocketV1PublicV1Service) Close

Close :

func (*SpotWebsocketV1PublicV1Service) Ping

Ping :

func (*SpotWebsocketV1PublicV1Service) Run

Run :

func (*SpotWebsocketV1PublicV1Service) Start

Start :

func (*SpotWebsocketV1PublicV1Service) SubscribeTrade

func (s *SpotWebsocketV1PublicV1Service) SubscribeTrade(symbol SymbolSpot, f func(response SpotWebsocketV1PublicV1TradeResponse) error) (func() error, error)

SubscribeTrade :

type SpotWebsocketV1PublicV1Topic

type SpotWebsocketV1PublicV1Topic string

SpotWebsocketV1PublicV1Topic :

type SpotWebsocketV1PublicV1TradeContent

type SpotWebsocketV1PublicV1TradeContent struct {
	TradeID        string `json:"v"`
	Timestamp      int    `json:"t"`
	Price          string `json:"p"`
	Quantity       string `json:"q"`
	IsBuySideTaker bool   `json:"m"`
}

SpotWebsocketV1PublicV1TradeContent :

type SpotWebsocketV1PublicV1TradeParam

type SpotWebsocketV1PublicV1TradeParam struct {
	Symbol SymbolSpot                             `json:"symbol"`
	Topic  SpotWebsocketV1PublicV1Topic           `json:"topic"`
	Event  SpotWebsocketV1PublicV1Event           `json:"event"`
	Params SpotWebsocketV1PublicV1TradeParamChild `json:"params"`
}

SpotWebsocketV1PublicV1TradeParam :

func (*SpotWebsocketV1PublicV1TradeParam) Key

Key :

type SpotWebsocketV1PublicV1TradeParamChild

type SpotWebsocketV1PublicV1TradeParamChild struct {
	Binary bool `json:"binary"`
}

SpotWebsocketV1PublicV1TradeParamChild :

type SpotWebsocketV1PublicV1TradeParamKey

type SpotWebsocketV1PublicV1TradeParamKey struct {
	Symbol SymbolSpot
	Topic  SpotWebsocketV1PublicV1Topic
}

SpotWebsocketV1PublicV1TradeParamKey :

type SpotWebsocketV1PublicV1TradeResponse

type SpotWebsocketV1PublicV1TradeResponse struct {
	Symbol         SymbolSpot                   `json:"symbol"`
	SymbolName     string                       `json:"symbolName"`
	Topic          SpotWebsocketV1PublicV1Topic `json:"topic"`
	SendTime       int                          `json:"sendTime"`
	IsFirstMessage bool                         `json:"f"`

	Params SpotWebsocketV1PublicV1TradeResponseParams `json:"params"`
	Data   []SpotWebsocketV1PublicV1TradeContent      `json:"data"`
}

SpotWebsocketV1PublicV1TradeResponse :

func (*SpotWebsocketV1PublicV1TradeResponse) Key

Key :

type SpotWebsocketV1PublicV1TradeResponseParams

type SpotWebsocketV1PublicV1TradeResponseParams struct {
	RealtimeInterval string `json:"realtimeInterval"`
	Binary           string `json:"binary"`
}

SpotWebsocketV1PublicV1TradeResponseParams :

type SpotWebsocketV1PublicV2Event

type SpotWebsocketV1PublicV2Event string

SpotWebsocketV1PublicV2Event :

type SpotWebsocketV1PublicV2Service

type SpotWebsocketV1PublicV2Service struct {
	// contains filtered or unexported fields
}

SpotWebsocketV1PublicV2Service :

func (*SpotWebsocketV1PublicV2Service) Close

Close :

func (*SpotWebsocketV1PublicV2Service) Ping

Ping :

func (*SpotWebsocketV1PublicV2Service) Run

Run :

func (*SpotWebsocketV1PublicV2Service) Start

Start :

func (*SpotWebsocketV1PublicV2Service) SubscribeTrade

func (s *SpotWebsocketV1PublicV2Service) SubscribeTrade(symbol SymbolSpot, f func(response SpotWebsocketV1PublicV2TradeResponse) error) (func() error, error)

SubscribeTrade :

type SpotWebsocketV1PublicV2Topic

type SpotWebsocketV1PublicV2Topic string

SpotWebsocketV1PublicV2Topic :

type SpotWebsocketV1PublicV2TradeContent

type SpotWebsocketV1PublicV2TradeContent struct {
	TradeID        string `json:"v"`
	Timestamp      int    `json:"t"`
	Price          string `json:"p"`
	Quantity       string `json:"q"`
	IsBuySideTaker bool   `json:"m"`
}

SpotWebsocketV1PublicV2TradeContent :

type SpotWebsocketV1PublicV2TradeParam

type SpotWebsocketV1PublicV2TradeParam struct {
	Topic  SpotWebsocketV1PublicV2Topic           `json:"topic"`
	Event  SpotWebsocketV1PublicV2Event           `json:"event"`
	Params SpotWebsocketV1PublicV2TradeParamChild `json:"params"`
}

SpotWebsocketV1PublicV2TradeParam :

func (*SpotWebsocketV1PublicV2TradeParam) Key

Key :

type SpotWebsocketV1PublicV2TradeParamChild

type SpotWebsocketV1PublicV2TradeParamChild struct {
	Symbol SymbolSpot `json:"symbol"`
	Binary bool       `json:"binary"`
}

SpotWebsocketV1PublicV2TradeParamChild :

type SpotWebsocketV1PublicV2TradeParamKey

type SpotWebsocketV1PublicV2TradeParamKey struct {
	Symbol SymbolSpot
	Topic  SpotWebsocketV1PublicV2Topic
}

SpotWebsocketV1PublicV2TradeParamKey :

type SpotWebsocketV1PublicV2TradeResponse

type SpotWebsocketV1PublicV2TradeResponse struct {
	Topic  SpotWebsocketV1PublicV2Topic               `json:"topic"`
	Params SpotWebsocketV1PublicV2TradeResponseParams `json:"params"`
	Data   SpotWebsocketV1PublicV2TradeContent        `json:"data"`
}

SpotWebsocketV1PublicV2TradeResponse :

func (*SpotWebsocketV1PublicV2TradeResponse) Key

Key :

type SpotWebsocketV1PublicV2TradeResponseParams

type SpotWebsocketV1PublicV2TradeResponseParams struct {
	Symbol     SymbolSpot `json:"symbol"`
	SymbolName string     `json:"symbolName"`
	Binary     string     `json:"binary"`
}

SpotWebsocketV1PublicV2TradeResponseParams :

type SpotWebsocketV1Service

type SpotWebsocketV1Service struct {
	// contains filtered or unexported fields
}

SpotWebsocketV1Service :

func (*SpotWebsocketV1Service) Private

Private :

func (*SpotWebsocketV1Service) PublicV1

PublicV1 :

func (*SpotWebsocketV1Service) PublicV2

PublicV2 :

type SymbolInverse

type SymbolInverse string

SymbolInverse :

type SymbolSpot

type SymbolSpot string

SymbolSpot :

type SymbolUSDT

type SymbolUSDT string

SymbolUSDT :

type SymbolV5 added in v0.0.21

type SymbolV5 string

SymbolV5 :

type SymbolsResponse

type SymbolsResponse struct {
	CommonResponse `json:",inline"`
	Result         []SymbolsResult `json:"result"`
}

SymbolsResponse :

type SymbolsResult

type SymbolsResult struct {
	Name           string         `json:"name"`
	BaseCurrency   string         `json:"base_currency"`
	QuoteCurrency  string         `json:"quote_currency"`
	PriceScale     float64        `json:"price_scale"`
	TakerFee       string         `json:"taker_fee"`
	MakerFee       string         `json:"maker_fee"`
	LeverageFilter LeverageFilter `json:"leverage_filter"`
	PriceFilter    PriceFilter    `json:"price_filter"`
	LotSizeFilter  LotSizeFilter  `json:"lot_size_filter"`
}

SymbolsResult :

type TestClient

type TestClient struct {
	*Client
}

TestClient :

func NewTestClient

func NewTestClient() *TestClient

NewTestClient :

func (*TestClient) WithAuthFromEnv

func (c *TestClient) WithAuthFromEnv() *TestClient

WithAuthFromEnv :

func (*TestClient) WithBaseURL

func (c *TestClient) WithBaseURL(url string) *TestClient

WithBaseURL :

type TestWebSocketClient

type TestWebSocketClient struct {
	*WebSocketClient
}

TestWebSocketClient :

func NewTestWebsocketClient

func NewTestWebsocketClient() *TestWebSocketClient

NewTestWebsocketClient :

func (*TestWebSocketClient) WithAuthFromEnv

func (c *TestWebSocketClient) WithAuthFromEnv() *TestWebSocketClient

WithAuthFromEnv :

func (*TestWebSocketClient) WithBaseURL

func (c *TestWebSocketClient) WithBaseURL(url string) *TestWebSocketClient

WithBaseURL :

type TickDirection

type TickDirection string

TickDirection :

type TickersResponse

type TickersResponse struct {
	CommonResponse `json:",inline"`
	Result         []TickersResult `json:"result"`
}

TickersResponse :

type TickersResult

type TickersResult struct {
	Symbol               SymbolInverse `json:"symbol"`
	BidPrice             string        `json:"bid_price"`
	AskPrice             string        `json:"ask_price"`
	LastPrice            string        `json:"last_price"`
	LastTickDirection    TickDirection `json:"last_tick_direction"`
	PrevPrice24h         string        `json:"prev_price_24h"`
	Price24hPcnt         string        `json:"price_24h_pcnt"`
	HighPrice24h         string        `json:"high_price_24h"`
	LowPrice24h          string        `json:"low_price_24h"`
	PrevPrice1h          string        `json:"prev_price_1h"`
	Price1hPcnt          string        `json:"price_1h_pcnt"`
	MarkPrice            string        `json:"mark_price"`
	IndexPrice           string        `json:"index_price"`
	OpenInterest         float64       `json:"open_interest"`
	OpenValue            string        `json:"open_value"`
	TotalTurnover        string        `json:"total_turnover"`
	Turnover24h          string        `json:"turnover_24h"`
	TotalVolume          float64       `json:"total_volume"`
	Volume24h            float64       `json:"volume_24h"`
	FundingRate          string        `json:"funding_rate"`
	PredictedFundingRate string        `json:"predicted_funding_rate"`
	NextFundingTime      string        `json:"next_funding_time"`
	CountdownHour        float64       `json:"countdown_hour"`
}

TickersResult :

type TimeInForce

type TimeInForce string

TimeInForce :

type TimeInForceSpot

type TimeInForceSpot string

TimeInForceSpot :

type TpSlMode

type TpSlMode string

TpSlMode :

type TradingRecordsParam

type TradingRecordsParam struct {
	Symbol SymbolInverse `url:"symbol"`

	From  *int `url:"from,omitempty"`
	Limit *int `url:"limit,omitempty"`
}

TradingRecordsParam :

type TradingRecordsResponse

type TradingRecordsResponse struct {
	CommonResponse `json:",inline"`
	Result         []TradingRecordsResult `json:"result"`
}

TradingRecordsResponse :

type TradingRecordsResult

type TradingRecordsResult struct {
	ID     float64       `json:"id"`
	Symbol SymbolInverse `json:"symbol"`
	Price  float64       `json:"price"`
	Qty    float64       `json:"qty"`
	Side   Side          `json:"side"`
	Time   string        `json:"time"`
}

TradingRecordsResult :

type TriggerBy added in v0.0.21

type TriggerBy string

TriggerBy :

type TriggerDirection added in v0.0.21

type TriggerDirection int

TriggerDirection :

type USDCContractOptionService

type USDCContractOptionService struct {
	// contains filtered or unexported fields
}

USDCContractOptionService :

type USDCContractPerpetualService

type USDCContractPerpetualService struct {
	// contains filtered or unexported fields
}

USDCContractPerpetualService :

type USDCContractService

type USDCContractService struct {
	// contains filtered or unexported fields
}

USDCContractService :

func (*USDCContractService) Option

Option :

func (*USDCContractService) Perpetual

Perpetual :

type USDCContractServiceI

type USDCContractServiceI interface {
	Option() *USDCContractOptionService
	Perpetual() *USDCContractPerpetualService
}

USDCContractServiceI :

type V5APIKeyResponse added in v0.0.21

type V5APIKeyResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5ApiKeyResult `json:"result"`
}

V5APIKeyResponse :

type V5AccountService added in v0.0.21

type V5AccountService struct {
	// contains filtered or unexported fields
}

V5AccountService :

func (*V5AccountService) GetWalletBalance added in v0.0.21

func (s *V5AccountService) GetWalletBalance(at AccountType, coins []Coin) (*V5WalletBalanceResponse, error)

GetWalletBalance :

at: UNIFIED or CONTRACT

coin: If not passed, it returns non-zero asset info You can pass multiple coins to query, separated by comma. "USDT,USDC".

type V5AccountServiceI added in v0.0.21

type V5AccountServiceI interface {
	GetWalletBalance(AccountType, []Coin) (*V5WalletBalanceResponse, error)
}

V5AccountServiceI :

type V5ApiKeyResult added in v0.0.21

type V5ApiKeyResult struct {
	ID          string `json:"id"`
	Note        string `json:"note"`
	APIKey      string `json:"apiKey"`
	ReadOnly    int    `json:"readOnly"`
	Secret      string `json:"secret"`
	Permissions struct {
		ContractTrade []string `json:"ContractTrade"`
		Spot          []string `json:"Spot"`
		Wallet        []string `json:"Wallet"`
		Options       []string `json:"Options"`
		Derivatives   []string `json:"Derivatives"`
		CopyTrading   []string `json:"CopyTrading"`
		BlockTrade    []string `json:"BlockTrade"`
		Exchange      []string `json:"Exchange"`
		Nft           []string `json:"NFT"`
	} `json:"permissions"`
	Ips           []string  `json:"ips"`
	Type          int       `json:"type"`
	DeadlineDay   int       `json:"deadlineDay"`
	ExpiredAt     time.Time `json:"expiredAt"`
	CreatedAt     time.Time `json:"createdAt"`
	Unified       int       `json:"unified"`
	Uta           int       `json:"uta"`
	UserID        int       `json:"userID"`
	InviterID     int       `json:"inviterID"`
	VipLevel      string    `json:"vipLevel"`
	MktMakerLevel string    `json:"mktMakerLevel"`
	AffiliateID   int       `json:"affiliateID"`
}

V5ApiKeyResult :

type V5AssetService added in v0.0.21

type V5AssetService struct {
	// contains filtered or unexported fields
}

V5AssetService :

type V5AssetServiceI added in v0.0.21

type V5AssetServiceI interface {
}

V5AssetServiceI :

type V5CancelOrderParam added in v0.0.21

type V5CancelOrderParam struct {
	Category CategoryV5 `json:"category"`
	Symbol   SymbolV5   `json:"symbol"`

	OrderID     *string      `json:"orderId,omitempty"`
	OrderLinkID *string      `json:"orderLinkId,omitempty"`
	OrderFilter *OrderFilter `json:"orderFilter,omitempty"` // If not passed, Order by default
}

V5CancelOrderParam :

type V5CancelOrderResponse added in v0.0.21

type V5CancelOrderResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5CancelOrderResult `json:"result"`
}

V5CancelOrderResponse :

type V5CancelOrderResult added in v0.0.21

type V5CancelOrderResult struct {
	OrderID     string `json:"orderId"`
	OrderLinkID string `json:"orderLinkId"`
}

V5CancelOrderResult :

type V5CreateOrderParam added in v0.0.21

type V5CreateOrderParam struct {
	Category  CategoryV5 `json:"category"`
	Symbol    SymbolV5   `json:"symbol"`
	Side      Side       `json:"side"`
	OrderType OrderType  `json:"orderType"`
	Qty       string     `json:"qty"`

	IsLeverage            *IsLeverage       `json:"isLeverage,omitempty"`
	Price                 *string           `json:"price,omitempty"`
	TriggerDirection      *TriggerDirection `json:"triggerDirection,omitempty"`
	OrderFilter           *OrderFilter      `json:"orderFilter,omitempty"` // If not passed, Order by default
	TriggerPrice          *string           `json:"triggerPrice,omitempty"`
	TriggerBy             *TriggerBy        `json:"triggerBy,omitempty"`
	OrderIv               *string           `json:"orderIv,omitempty"`     // option only.
	TimeInForce           *TimeInForce      `json:"timeInForce,omitempty"` // If not passed, GTC is used by default
	PositionIdx           *PositionIdx      `json:"positionIdx,omitempty"` // Under hedge-mode, this param is required
	OrderLinkID           *string           `json:"orderLinkId,omitempty"`
	TakeProfit            *string           `json:"takeProfit,omitempty"`
	StopLoss              *string           `json:"stopLoss,omitempty"`
	TpTriggerBy           *TriggerBy        `json:"tpTriggerBy,omitempty"`
	SlTriggerBy           *TriggerBy        `json:"slTriggerBy,omitempty"`
	ReduceOnly            *bool             `json:"reduce_only,omitempty"`
	CloseOnTrigger        *bool             `json:"closeOnTrigger,omitempty"`
	MarketMakerProtection *bool             `json:"mmp,omitempty"` // option only
}

V5CreateOrderParam :

type V5CreateOrderResponse added in v0.0.21

type V5CreateOrderResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5CreateOrderResult `json:"result"`
}

V5CreateOrderResponse :

type V5CreateOrderResult added in v0.0.21

type V5CreateOrderResult struct {
	OrderID     string `json:"orderId"`
	OrderLinkID string `json:"orderLinkId"`
}

V5CreateOrderResult :

type V5ExecutionService added in v0.0.21

type V5ExecutionService struct {
	// contains filtered or unexported fields
}

V5ExecutionService :

type V5ExecutionServiceI added in v0.0.21

type V5ExecutionServiceI interface {
}

V5ExecutionServiceI :

type V5GetClosedPnl added in v0.0.27

type V5GetClosedPnl struct {
	Symbol    SymbolV5  `json:"symbol"`
	OrderType OrderType `json:"orderType"`
	OrderID   string    `json:"orderId"`

	Leverage      string `json:"leverage"`
	UpdatedTime   string `json:"updatedTime"`
	Side          Side   `json:"side"`
	ClosedPnl     string `json:"closedPnl"`
	AvgEntryPrice string `json:"avgEntryPrice"`
	Qty           string `json:"qty"`
	CumEntryValue string `json:"cumEntryValue"`
	CreatedTime   string `json:"createdTime"`
	OrderPrice    string `json:"orderPrice"`
	ClosedSize    string `json:"closedSize"`
	AvgExitPrice  string `json:"avgExitPrice"`
	ExecType      string `json:"execType"`
	FillCount     string `json:"fillCount"`
	CumExitValue  string `json:"cumExitValue"`
}

type V5GetClosedPnlParam added in v0.0.27

type V5GetClosedPnlParam struct {
	Category CategoryV5 `url:"category"`

	StartTime *int      `url:"startTime,omitempty"`
	EndTime   *int      `url:"endTime,omitempty"`
	Symbol    *SymbolV5 `url:"symbol,omitempty"`
	Limit     *int      `url:"limit,omitempty"`
	Cursor    *string   `url:"cursor,omitempty"`
}

type V5GetClosedPnlResponse added in v0.0.27

type V5GetClosedPnlResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetClosedPnlResult `json:"result"`
}

V5GetOpenOrdersResponse :

type V5GetClosedPnlResult added in v0.0.27

type V5GetClosedPnlResult struct {
	Category       CategoryV5       `json:"category"`
	NextPageCursor string           `json:"nextPageCursor"`
	List           []V5GetClosedPnl `json:"list"`
}

V5GetOpenOrdersResult :

type V5GetExecutionListParam added in v0.0.21

type V5GetExecutionListParam struct {
	Category CategoryV5 `url:"category"`

	PreUpgrade  *bool     `url:"-"`
	StartTime   *int      `url:"startTime,omitempty"`
	EndTime     *int      `url:"endTime,omitempty"`
	ExecType    *ExecType `url:"execType,omitempty"`
	Symbol      *SymbolV5 `url:"symbol,omitempty"`
	BaseCoin    *Coin     `url:"baseCoin,omitempty"`
	OrderID     *string   `url:"orderId,omitempty"`
	OrderLinkID *string   `url:"orderLinkId,omitempty"`
	Limit       *int      `url:"limit,omitempty"`
	Cursor      *string   `url:"cursor,omitempty"`
}

type V5GetExecutionListResponse added in v0.0.21

type V5GetExecutionListResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetExecutionListResult `json:"result"`
}

V5GetOpenOrdersResponse :

type V5GetExecutionListResult added in v0.0.21

type V5GetExecutionListResult struct {
	Category       CategoryV5            `json:"category"`
	NextPageCursor string                `json:"nextPageCursor"`
	List           []V5GetExecutionOrder `json:"list"`
}

V5GetOpenOrdersResult :

type V5GetExecutionOrder added in v0.0.21

type V5GetExecutionOrder struct {
	Symbol        SymbolV5  `json:"symbol"`
	OrderType     OrderType `json:"orderType"`
	OrderLinkID   string    `json:"orderLinkId"`
	Side          Side      `json:"side"`
	OrderID       string    `json:"orderId"`
	StopOrderType string    `json:"stopOrderType"`
	LeavesQty     string    `json:"leavesQty"`
	ExecTime      string    `json:"execTime"`
	IsMaker       bool      `json:"isMaker"`
	ExecFee       string    `json:"execFee"`
	FeeRate       string    `json:"feeRate"`
	ExecID        string    `json:"execId"`
	MarkPrice     string    `json:"markPrice"`
	ExecPrice     string    `json:"execPrice"`
	OrderQty      string    `json:"orderQty"`
	OrderPrice    string    `json:"orderPrice"`
	ExecValue     string    `json:"execValue"`
	ExecType      ExecType  `json:"execType"`
	ExecQty       string    `json:"execQty"`
	ClosedSize    string    `json:"closedSize"`
}

type V5GetIndexPriceKlineItem added in v0.0.21

type V5GetIndexPriceKlineItem struct {
	StartTime string
	Open      string
	High      string
	Low       string
	Close     string
}

V5GetIndexPriceKlineItem :

type V5GetIndexPriceKlineList added in v0.0.21

type V5GetIndexPriceKlineList []V5GetIndexPriceKlineItem

V5GetIndexPriceKlineList :

func (*V5GetIndexPriceKlineList) UnmarshalJSON added in v0.0.21

func (l *V5GetIndexPriceKlineList) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type V5GetIndexPriceKlineParam added in v0.0.21

type V5GetIndexPriceKlineParam struct {
	Category CategoryV5 `url:"category"`
	Symbol   SymbolV5   `url:"symbol"`
	Interval Interval   `url:"interval"`
	Start    *int       `url:"start,omitempty"` // timestamp point for result, in milliseconds
	End      *int       `url:"end,omitempty"`   // timestamp point for result, in milliseconds
	Limit    *int       `url:"limit,omitempty"` // Limit for data size per page. [1, 200]. Default: 200
}

V5GetIndexPriceKlineParam :

type V5GetIndexPriceKlineResponse added in v0.0.21

type V5GetIndexPriceKlineResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetIndexPriceKlineResult `json:"result"`
}

V5GetIndexPriceKlineResponse :

type V5GetIndexPriceKlineResult added in v0.0.21

type V5GetIndexPriceKlineResult struct {
	Category CategoryV5               `json:"category"`
	Symbol   SymbolV5                 `json:"symbol"`
	List     V5GetIndexPriceKlineList `json:"list"`
}

V5GetIndexPriceKlineResult :

type V5GetInstrumentsInfoLinearInverseResult added in v0.0.21

type V5GetInstrumentsInfoLinearInverseResult struct {
	Category       CategoryV5 `json:"category"`
	NextPageCursor string     `json:"nextPageCursor"`
	List           []struct {
		Symbol          SymbolV5         `json:"symbol"`
		ContractType    ContractType     `json:"contractType"`
		Status          InstrumentStatus `json:"status"`
		BaseCoin        Coin             `json:"baseCoin"`
		QuoteCoin       Coin             `json:"quoteCoin"`
		SettleCoin      Coin             `json:"settleCoin"`
		LaunchTime      string           `json:"launchTime"`
		DeliveryTime    string           `json:"deliveryTime"`
		DeliveryFeeRate string           `json:"deliveryFeeRate"`
		PriceScale      string           `json:"priceScale"`
		LeverageFilter  struct {
			MinLeverage  string `json:"minLeverage"`
			MaxLeverage  string `json:"maxLeverage"`
			LeverageStep string `json:"leverageStep"`
		} `json:"leverageFilter"`
		PriceFilter struct {
			MinPrice string `json:"minPrice"`
			MaxPrice string `json:"maxPrice"`
			TickSize string `json:"tickSize"`
		} `json:"priceFilter"`
		LotSizeFilter struct {
			MaxOrderQty         string `json:"maxOrderQty"`
			MinOrderQty         string `json:"minOrderQty"`
			QtyStep             string `json:"qtyStep"`
			PostOnlyMaxOrderQty string `json:"postOnlyMaxOrderQty"`
		} `json:"lotSizeFilter"`
		UnifiedMarginTrade bool `json:"unifiedMarginTrade"`
		FundingInterval    int  `json:"fundingInterval"`
	} `json:"list"`
}

V5GetInstrumentsInfoLinearInverseResult :

type V5GetInstrumentsInfoOptionResult added in v0.0.21

type V5GetInstrumentsInfoOptionResult struct {
	Category       CategoryV5 `json:"category"`
	NextPageCursor string     `json:"nextPageCursor"`
	List           []struct {
		Symbol          SymbolV5         `json:"symbol"`
		OptionsType     OptionsType      `json:"optionsType"`
		Status          InstrumentStatus `json:"status"`
		BaseCoin        Coin             `json:"baseCoin"`
		QuoteCoin       Coin             `json:"quoteCoin"`
		SettleCoin      Coin             `json:"settleCoin"`
		LaunchTime      string           `json:"launchTime"`
		DeliveryTime    string           `json:"deliveryTime"`
		DeliveryFeeRate string           `json:"deliveryFeeRate"`
		PriceFilter     struct {
			MinPrice string `json:"minPrice"`
			MaxPrice string `json:"maxPrice"`
			TickSize string `json:"tickSize"`
		} `json:"priceFilter"`
		LotSizeFilter struct {
			MaxOrderQty string `json:"maxOrderQty"`
			MinOrderQty string `json:"minOrderQty"`
			QtyStep     string `json:"qtyStep"`
		} `json:"lotSizeFilter"`
	} `json:"list"`
}

V5GetInstrumentsInfoOptionResult :

type V5GetInstrumentsInfoParam added in v0.0.21

type V5GetInstrumentsInfoParam struct {
	Category CategoryV5 `url:"category"`

	Symbol   *SymbolV5 `url:"symbol,omitempty"`
	BaseCoin *Coin     `url:"baseCoin,omitempty"` // Base coin. linear,inverse,option only
	Limit    *int      `url:"limit,omitempty"`    // Limit for data size per page. [1, 1000]. Default: 500
	Cursor   *string   `url:"cursor,omitempty"`
}

V5GetInstrumentsInfoParam : Spot does not support pagination, so limit, cursor are invalid. When query by baseCoin, regardless of category=linear or inverse, the result will have Linear contract and Inverse contract symbols.

type V5GetInstrumentsInfoResponse added in v0.0.21

type V5GetInstrumentsInfoResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetInstrumentsInfoResult `json:"result"`
}

V5GetInstrumentsInfoResponse :

type V5GetInstrumentsInfoResult added in v0.0.21

type V5GetInstrumentsInfoResult struct {
	LinearInverse *V5GetInstrumentsInfoLinearInverseResult
	Option        *V5GetInstrumentsInfoOptionResult
	Spot          *V5GetInstrumentsInfoSpotResult
}

V5GetInstrumentsInfoResult : Responses are filled according to category.

func (*V5GetInstrumentsInfoResult) UnmarshalJSON added in v0.0.21

func (r *V5GetInstrumentsInfoResult) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type V5GetInstrumentsInfoSpotResult added in v0.0.21

type V5GetInstrumentsInfoSpotResult struct {
	Category CategoryV5 `json:"category"`
	List     []struct {
		Symbol        SymbolV5         `json:"symbol"`
		BaseCoin      Coin             `json:"baseCoin"`
		QuoteCoin     Coin             `json:"quoteCoin"`
		Innovation    Innovation       `json:"innovation"`
		Status        InstrumentStatus `json:"status"`
		LotSizeFilter struct {
			BasePrecision  string `json:"basePrecision"`
			QuotePrecision string `json:"quotePrecision"`
			MaxOrderQty    string `json:"maxOrderQty"`
			MinOrderQty    string `json:"minOrderQty"`
			MinOrderAmt    string `json:"minOrderAmt"`
			MaxOrderAmt    string `json:"maxOrderAmt"`
		} `json:"lotSizeFilter"`
		PriceFilter struct {
			TickSize string `json:"tickSize"`
		} `json:"priceFilter"`
	} `json:"list"`
}

V5GetInstrumentsInfoSpotResult :

type V5GetKlineItem added in v0.0.21

type V5GetKlineItem struct {
	StartTime string
	Open      string
	High      string
	Low       string
	Close     string
	Volume    string
	Turnover  string
}

V5GetKlineItem :

type V5GetKlineList added in v0.0.21

type V5GetKlineList []V5GetKlineItem

V5GetKlineList :

func (*V5GetKlineList) UnmarshalJSON added in v0.0.21

func (l *V5GetKlineList) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type V5GetKlineParam added in v0.0.21

type V5GetKlineParam struct {
	Category CategoryV5 `url:"category"`
	Symbol   SymbolV5   `url:"symbol"`
	Interval Interval   `url:"interval"`
	Start    *int       `url:"start,omitempty"` // timestamp point for result, in milliseconds
	End      *int       `url:"end,omitempty"`   // timestamp point for result, in milliseconds

	Limit *int `url:"limit,omitempty"` // Limit for data size per page. [1, 200]. Default: 200
}

V5GetKlineParam :

type V5GetKlineResponse added in v0.0.21

type V5GetKlineResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetKlineResult `json:"result"`
}

V5GetKlineResponse :

type V5GetKlineResult added in v0.0.21

type V5GetKlineResult struct {
	Category CategoryV5     `json:"category"`
	Symbol   SymbolV5       `json:"symbol"`
	List     V5GetKlineList `json:"list"`
}

V5GetKlineResult :

type V5GetMarkPriceKlineItem added in v0.0.21

type V5GetMarkPriceKlineItem struct {
	StartTime string
	Open      string
	High      string
	Low       string
	Close     string
}

V5GetMarkPriceKlineItem :

type V5GetMarkPriceKlineList added in v0.0.21

type V5GetMarkPriceKlineList []V5GetMarkPriceKlineItem

V5GetMarkPriceKlineList :

func (*V5GetMarkPriceKlineList) UnmarshalJSON added in v0.0.21

func (l *V5GetMarkPriceKlineList) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type V5GetMarkPriceKlineParam added in v0.0.21

type V5GetMarkPriceKlineParam struct {
	Category CategoryV5 `url:"category"`
	Symbol   SymbolV5   `url:"symbol"`
	Interval Interval   `url:"interval"`
	Start    *int       `url:"start,omitempty"` // timestamp point for result, in milliseconds
	End      *int       `url:"end,omitempty"`   // timestamp point for result, in milliseconds
	Limit    *int       `url:"limit,omitempty"` // Limit for data size per page. [1, 200]. Default: 200
}

V5GetMarkPriceKlineParam :

type V5GetMarkPriceKlineResponse added in v0.0.21

type V5GetMarkPriceKlineResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetMarkPriceKlineResult `json:"result"`
}

V5GetMarkPriceKlineResponse :

type V5GetMarkPriceKlineResult added in v0.0.21

type V5GetMarkPriceKlineResult struct {
	Category CategoryV5              `json:"category"`
	Symbol   SymbolV5                `json:"symbol"`
	List     V5GetMarkPriceKlineList `json:"list"`
}

V5GetMarkPriceKlineResult :

type V5GetOpenOrder added in v0.0.21

type V5GetOpenOrder struct {
	Symbol             SymbolV5    `json:"symbol"`
	OrderType          OrderType   `json:"orderType"`
	OrderLinkID        string      `json:"orderLinkId"`
	OrderID            string      `json:"orderId"`
	CancelType         string      `json:"cancelType"`
	AvgPrice           string      `json:"avgPrice"`
	StopOrderType      string      `json:"stopOrderType"`
	LastPriceOnCreated string      `json:"lastPriceOnCreated"`
	OrderStatus        OrderStatus `json:"orderStatus"`
	TakeProfit         string      `json:"takeProfit"`
	CumExecValue       string      `json:"cumExecValue"`
	TriggerDirection   int         `json:"triggerDirection"`
	IsLeverage         string      `json:"isLeverage"`
	RejectReason       string      `json:"rejectReason"`
	Price              string      `json:"price"`
	OrderIv            string      `json:"orderIv"`
	CreatedTime        string      `json:"createdTime"`
	TpTriggerBy        string      `json:"tpTriggerBy"`
	PositionIdx        int         `json:"positionIdx"`
	TimeInForce        TimeInForce `json:"timeInForce"`
	LeavesValue        string      `json:"leavesValue"`
	UpdatedTime        string      `json:"updatedTime"`
	Side               Side        `json:"side"`
	TriggerPrice       string      `json:"triggerPrice"`
	CumExecFee         string      `json:"cumExecFee"`
	LeavesQty          string      `json:"leavesQty"`
	SlTriggerBy        string      `json:"slTriggerBy"`
	CloseOnTrigger     bool        `json:"closeOnTrigger"`
	CumExecQty         string      `json:"cumExecQty"`
	ReduceOnly         bool        `json:"reduceOnly"`
	Qty                string      `json:"qty"`
	StopLoss           string      `json:"stopLoss"`
	TriggerBy          TriggerBy   `json:"triggerBy"`
}

type V5GetOpenOrdersParam added in v0.0.21

type V5GetOpenOrdersParam struct {
	Category CategoryV5 `url:"category"`

	Symbol      *SymbolV5    `url:"symbol,omitempty"`
	BaseCoin    *Coin        `url:"baseCoin,omitempty"`
	SettleCoin  *Coin        `url:"settleCoin,omitempty"`
	OrderID     *string      `url:"orderId,omitempty"`
	OrderLinkID *string      `url:"orderLinkId,omitempty"`
	OpenOnly    *int         `url:"openOnly,omitempty"`
	OrderFilter *OrderFilter `url:"orderFilter,omitempty"` // If not passed, Order by default
	Limit       *int         `url:"limit,omitempty"`
	Cursor      *string      `url:"cursor,omitempty"`
}

V5GetOpenOrdersParam :

type V5GetOpenOrdersResponse added in v0.0.21

type V5GetOpenOrdersResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetOpenOrdersResult `json:"result"`
}

V5GetOpenOrdersResponse :

type V5GetOpenOrdersResult added in v0.0.21

type V5GetOpenOrdersResult struct {
	Category       CategoryV5       `json:"category"`
	NextPageCursor string           `json:"nextPageCursor"`
	List           []V5GetOpenOrder `json:"list"`
}

V5GetOpenOrdersResult :

type V5GetOrder added in v0.0.24

type V5GetOrder struct {
	Symbol      SymbolV5  `json:"symbol"`
	OrderType   OrderType `json:"orderType"`
	OrderLinkID string    `json:"orderLinkId"`
	OrderID     string    `json:"orderId"`

	AvgPrice           string `json:"avgPrice"`
	StopOrderType      string `json:"stopOrderType"`
	LastPriceOnCreated string `json:"lastPriceOnCreated"`
	OrderStatus        string `json:"orderStatus"`
	TakeProfit         string `json:"takeProfit"`
	CumExecValue       string `json:"cumExecValue"`
	TriggerDirection   int    `json:"triggerDirection"`
	BlockTradeID       string `json:"blockTradeId"`
	RejectReason       string `json:"rejectReason"`
	IsLeverage         string `json:"isLeverage"`
	Price              string `json:"price"`
	OrderIV            string `json:"orderIv"`
	CreatedTime        string `json:"createdTime"`
	TPTriggerBy        string `json:"tpTriggerBy"`
	PositionIdx        int    `json:"positionIdx"`
	TimeInForce        string `json:"timeInForce"`
	LeavesValue        string `json:"leavesValue"`
	UpdatedTime        string `json:"updatedTime"`
	Side               Side   `json:"side"`
	TriggerPrice       string `json:"triggerPrice"`
	CumExecFee         string `json:"cumExecFee"`
	SLTriggerBy        string `json:"slTriggerBy"`
	LeavesQty          string `json:"leavesQty"`
	CloseOnTrigger     bool   `json:"closeOnTrigger"`
	CumExecQty         string `json:"cumExecQty"`
	ReduceOnly         bool   `json:"reduceOnly"`
	Qty                string `json:"qty"`
	StopLoss           string `json:"stopLoss"`
	TriggerBy          string `json:"triggerBy"`
}

type V5GetOrderListParam added in v0.0.24

type V5GetOrderListParam struct {
	Category CategoryV5 `url:"category"`

	StartTime   *int      `url:"startTime,omitempty"`
	EndTime     *int      `url:"endTime,omitempty"`
	ExecType    *ExecType `url:"execType,omitempty"`
	Symbol      *SymbolV5 `url:"symbol,omitempty"`
	BaseCoin    *Coin     `url:"baseCoin,omitempty"`
	OrderID     *string   `url:"orderId,omitempty"`
	OrderLinkID *string   `url:"orderLinkId,omitempty"`
	Limit       *int      `url:"limit,omitempty"`
	Cursor      *string   `url:"cursor,omitempty"`
}

type V5GetOrderListResponse added in v0.0.24

type V5GetOrderListResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetOrderListResult `json:"result"`
}

V5GetOpenOrdersResponse :

type V5GetOrderListResult added in v0.0.24

type V5GetOrderListResult struct {
	Category       CategoryV5   `json:"category"`
	NextPageCursor string       `json:"nextPageCursor"`
	List           []V5GetOrder `json:"list"`
}

V5GetOpenOrdersResult :

type V5GetOrderbookBidAsk added in v0.0.21

type V5GetOrderbookBidAsk struct {
	Price    string `json:"price"`
	Quantity string `json:"quantity"`
}

V5GetOrderbookBidAsk :

type V5GetOrderbookBidAsks added in v0.0.21

type V5GetOrderbookBidAsks []V5GetOrderbookBidAsk

V5GetOrderbookBidAsks :

func (*V5GetOrderbookBidAsks) UnmarshalJSON added in v0.0.21

func (b *V5GetOrderbookBidAsks) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type V5GetOrderbookParam added in v0.0.21

type V5GetOrderbookParam struct {
	Category CategoryV5 `url:"category"`
	Symbol   SymbolV5   `url:"symbol"`

	// spot: [1, 50]. Default: 1.
	// linear&inverse: [1, 200]. Default: 25.
	// option: [1, 25]. Default: 1.
	Limit *int `url:"limit,omitempty"`
}

V5GetOrderbookParam :

type V5GetOrderbookResponse added in v0.0.21

type V5GetOrderbookResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetOrderbookResult `json:"result"`
}

V5GetOrderbookResponse :

type V5GetOrderbookResult added in v0.0.21

type V5GetOrderbookResult struct {
	Symbol    SymbolV5              `json:"s"`
	Bids      V5GetOrderbookBidAsks `json:"b"`
	Asks      V5GetOrderbookBidAsks `json:"a"`
	Timestamp int64                 `json:"ts"`
	UpdateID  int                   `json:"u"`
}

V5GetOrderbookResult :

type V5GetPositionInfoItem added in v0.0.21

type V5GetPositionInfoItem struct {
	Symbol         SymbolV5 `json:"symbol"`
	Leverage       string   `json:"leverage"`
	AvgPrice       string   `json:"avgPrice"`
	LiqPrice       string   `json:"liqPrice"`
	RiskLimitValue string   `json:"riskLimitValue"`
	TakeProfit     string   `json:"takeProfit"`
	PositionValue  string   `json:"positionValue"`
	TpSlMode       TpSlMode `json:"tpslMode"`
	RiskID         int      `json:"riskId"`
	TrailingStop   string   `json:"trailingStop"`
	UnrealisedPnl  string   `json:"unrealisedPnl"`
	MarkPrice      string   `json:"markPrice"`
	CumRealisedPnl string   `json:"cumRealisedPnl"`
	PositionMM     string   `json:"positionMM"`
	CreatedTime    string   `json:"createdTime"`
	PositionIdx    int      `json:"positionIdx"`
	PositionIM     string   `json:"positionIM"`
	UpdatedTime    string   `json:"updatedTime"`
	Side           Side     `json:"side"`
	BustPrice      string   `json:"bustPrice"`
	Size           string   `json:"size"`
	PositionStatus string   `json:"positionStatus"`
	StopLoss       string   `json:"stopLoss"`
	TradeMode      int      `json:"tradeMode"`
}

V5GetPositionInfoItem :

type V5GetPositionInfoList added in v0.0.21

type V5GetPositionInfoList []V5GetPositionInfoItem

V5GetPositionInfoList :

type V5GetPositionInfoParam added in v0.0.21

type V5GetPositionInfoParam struct {
	Category CategoryV5 `url:"category"`

	Symbol     *SymbolV5 `url:"symbol,omitempty"`
	BaseCoin   *Coin     `url:"baseCoin,omitempty"`   // option only
	SettleCoin *Coin     `url:"settleCoin,omitempty"` // Settle coin. For linear & inverse, either symbol or settleCon is required. symbol has a higher priority
	Limit      *int      `url:"limit,omitempty"`      // Limit for data size per page. [1, 200]. Default: 200
	Cursor     *string   `url:"cursor,omitempty"`     // Cursor. Used for pagination
}

V5GetPositionInfoParam :

type V5GetPositionInfoResponse added in v0.0.21

type V5GetPositionInfoResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetPositionInfoResult `json:"result"`
}

V5GetPositionInfoResponse :

type V5GetPositionInfoResult added in v0.0.21

type V5GetPositionInfoResult struct {
	Category       CategoryV5            `json:"category"`
	NextPageCursor string                `json:"nextPageCursor"`
	List           V5GetPositionInfoList `json:"list"`
}

V5GetPositionInfoResult :

type V5GetPremiumIndexPriceKlineItem added in v0.0.21

type V5GetPremiumIndexPriceKlineItem struct {
	StartTime string
	Open      string
	High      string
	Low       string
	Close     string
}

V5GetPremiumIndexPriceKlineItem :

type V5GetPremiumIndexPriceKlineList added in v0.0.21

type V5GetPremiumIndexPriceKlineList []V5GetPremiumIndexPriceKlineItem

V5GetPremiumIndexPriceKlineList :

func (*V5GetPremiumIndexPriceKlineList) UnmarshalJSON added in v0.0.21

func (l *V5GetPremiumIndexPriceKlineList) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type V5GetPremiumIndexPriceKlineParam added in v0.0.21

type V5GetPremiumIndexPriceKlineParam struct {
	Category CategoryV5 `url:"category"`
	Symbol   SymbolV5   `url:"symbol"`
	Interval Interval   `url:"interval"`
	Start    *int       `url:"start,omitempty"` // timestamp point for result, in milliseconds
	End      *int       `url:"end,omitempty"`   // timestamp point for result, in milliseconds
	Limit    *int       `url:"limit,omitempty"` // Limit for data size per page. [1, 200]. Default: 200
}

V5GetPremiumIndexPriceKlineParam :

type V5GetPremiumIndexPriceKlineResponse added in v0.0.21

type V5GetPremiumIndexPriceKlineResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetPremiumIndexPriceKlineResult `json:"result"`
}

V5GetPremiumIndexPriceKlineResponse :

type V5GetPremiumIndexPriceKlineResult added in v0.0.21

type V5GetPremiumIndexPriceKlineResult struct {
	Category CategoryV5                      `json:"category"`
	Symbol   SymbolV5                        `json:"symbol"`
	List     V5GetPremiumIndexPriceKlineList `json:"list"`
}

V5GetPremiumIndexPriceKlineResult :

type V5GetTickersLinearInverseResult added in v0.0.21

type V5GetTickersLinearInverseResult struct {
	Category CategoryV5 `json:"category"`
	List     []struct {
		Symbol                 SymbolV5 `json:"symbol"`
		LastPrice              string   `json:"lastPrice"`
		IndexPrice             string   `json:"indexPrice"`
		MarkPrice              string   `json:"markPrice"`
		PrevPrice24H           string   `json:"prevPrice24h"`
		Price24HPcnt           string   `json:"price24hPcnt"`
		HighPrice24H           string   `json:"highPrice24h"`
		LowPrice24H            string   `json:"lowPrice24h"`
		PrevPrice1H            string   `json:"prevPrice1h"`
		OpenInterest           string   `json:"openInterest"`
		OpenInterestValue      string   `json:"openInterestValue"`
		Turnover24H            string   `json:"turnover24h"`
		Volume24H              string   `json:"volume24h"`
		FundingRate            string   `json:"fundingRate"`
		NextFundingTime        string   `json:"nextFundingTime"`
		PredictedDeliveryPrice string   `json:"predictedDeliveryPrice"`
		BasisRate              string   `json:"basisRate"`
		DeliveryFeeRate        string   `json:"deliveryFeeRate"`
		DeliveryTime           string   `json:"deliveryTime"`
		Ask1Size               string   `json:"ask1Size"`
		Bid1Price              string   `json:"bid1Price"`
		Ask1Price              string   `json:"ask1Price"`
		Bid1Size               string   `json:"bid1Size"`
	} `json:"list"`
}

V5GetTickersLinearInverseResult :

type V5GetTickersOptionResult added in v0.0.21

type V5GetTickersOptionResult struct {
	Category CategoryV5 `json:"category"`
	List     []struct {
		Symbol                 SymbolV5 `json:"symbol"`
		Bid1Price              string   `json:"bid1Price"`
		Bid1Size               string   `json:"bid1Size"`
		Bid1Iv                 string   `json:"bid1Iv"`
		Ask1Price              string   `json:"ask1Price"`
		Ask1Size               string   `json:"ask1Size"`
		Ask1Iv                 string   `json:"ask1Iv"`
		LastPrice              string   `json:"lastPrice"`
		HighPrice24H           string   `json:"highPrice24h"`
		LowPrice24H            string   `json:"lowPrice24h"`
		MarkPrice              string   `json:"markPrice"`
		IndexPrice             string   `json:"indexPrice"`
		MarkIv                 string   `json:"markIv"`
		UnderlyingPrice        string   `json:"underlyingPrice"`
		OpenInterest           string   `json:"openInterest"`
		Turnover24H            string   `json:"turnover24h"`
		Volume24H              string   `json:"volume24h"`
		TotalVolume            string   `json:"totalVolume"`
		TotalTurnover          string   `json:"totalTurnover"`
		Delta                  string   `json:"delta"`
		Gamma                  string   `json:"gamma"`
		Vega                   string   `json:"vega"`
		Theta                  string   `json:"theta"`
		PredictedDeliveryPrice string   `json:"predictedDeliveryPrice"`
		Change24H              string   `json:"change24h"`
	} `json:"list"`
}

V5GetTickersOptionResult :

type V5GetTickersParam added in v0.0.21

type V5GetTickersParam struct {
	Category CategoryV5 `url:"category"`

	Symbol   *SymbolV5 `url:"symbol,omitempty"`
	BaseCoin *Coin     `url:"baseCoin,omitempty"` // Base coin. For option only
	ExpDate  *string   `url:"expDate,omitempty"`  // Expiry date. e.g., 25DEC22. For option only
}

V5GetTickersParam :

type V5GetTickersResponse added in v0.0.21

type V5GetTickersResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5GetTickersResult `json:"result"`
}

V5GetTickersResponse :

type V5GetTickersResult added in v0.0.21

type V5GetTickersResult struct {
	LinearInverse *V5GetTickersLinearInverseResult
	Option        *V5GetTickersOptionResult
	Spot          *V5GetTickersSpotResult
}

V5GetTickersResult : Responses are filled according to category.

func (*V5GetTickersResult) UnmarshalJSON added in v0.0.21

func (r *V5GetTickersResult) UnmarshalJSON(data []byte) error

UnmarshalJSON :

type V5GetTickersSpotResult added in v0.0.21

type V5GetTickersSpotResult struct {
	Category CategoryV5 `json:"category"`
	List     []struct {
		Symbol        SymbolV5 `json:"symbol"`
		Bid1Price     string   `json:"bid1Price"`
		Bid1Size      string   `json:"bid1Size"`
		Ask1Price     string   `json:"ask1Price"`
		Ask1Size      string   `json:"ask1Size"`
		LastPrice     string   `json:"lastPrice"`
		PrevPrice24H  string   `json:"prevPrice24h"`
		Price24HPcnt  string   `json:"price24hPcnt"`
		HighPrice24H  string   `json:"highPrice24h"`
		LowPrice24H   string   `json:"lowPrice24h"`
		Turnover24H   string   `json:"turnover24h"`
		Volume24H     string   `json:"volume24h"`
		UsdIndexPrice string   `json:"usdIndexPrice"`
	} `json:"list"`
}

V5GetTickersSpotResult :

type V5MarketService added in v0.0.21

type V5MarketService struct {
	// contains filtered or unexported fields
}

V5MarketService :

func (*V5MarketService) GetIndexPriceKline added in v0.0.21

GetIndexPriceKline :

func (*V5MarketService) GetInstrumentsInfo added in v0.0.21

GetInstrumentsInfo :

func (*V5MarketService) GetKline added in v0.0.21

GetKline :

func (*V5MarketService) GetMarkPriceKline added in v0.0.21

GetMarkPriceKline :

func (*V5MarketService) GetOrderbook added in v0.0.21

GetOrderbook :

func (*V5MarketService) GetPremiumIndexPriceKline added in v0.0.21

GetPremiumIndexPriceKline :

func (*V5MarketService) GetTickers added in v0.0.21

GetTickers :

type V5OrderService added in v0.0.21

type V5OrderService struct {
	// contains filtered or unexported fields
}

V5OrderService :

func (*V5OrderService) CancelOrder added in v0.0.21

CancelOrder :

func (*V5OrderService) CreateOrder added in v0.0.21

CreateOrder :

func (*V5OrderService) GetClosedPnl added in v0.0.27

GetOrderList :

func (*V5OrderService) GetExecutionList added in v0.0.21

GetExecutionList :

func (*V5OrderService) GetOpenOrders added in v0.0.21

GetOpenOrders :

func (*V5OrderService) GetOrderList added in v0.0.24

GetOrderList :

type V5OrderServiceI added in v0.0.21

V5OrderServiceI :

type V5PositionService added in v0.0.21

type V5PositionService struct {
	// contains filtered or unexported fields
}

V5PositionService :

func (*V5PositionService) GetPositionInfo added in v0.0.21

GetPositionInfo :

func (*V5PositionService) SetLeverage added in v0.0.21

SetLeverage :

type V5PositionServiceI added in v0.0.21

type V5PositionServiceI interface {
	GetPositionInfo(V5GetPositionInfoParam) (*V5GetPositionInfoResponse, error)
	SetLeverage(V5SetLeverageParam) (*V5SetLeverageResponse, error)
}

V5PositionServiceI :

type V5Service added in v0.0.21

type V5Service struct {
	// contains filtered or unexported fields
}

V5Service :

func (*V5Service) Account added in v0.0.21

func (s *V5Service) Account() V5AccountServiceI

Account :

func (*V5Service) Asset added in v0.0.21

func (s *V5Service) Asset() V5AssetServiceI

Asset :

func (*V5Service) Execution added in v0.0.21

func (s *V5Service) Execution() V5ExecutionServiceI

Execution :

func (*V5Service) Market added in v0.0.21

func (s *V5Service) Market() V5MarketServiceI

Market :

func (*V5Service) Order added in v0.0.21

func (s *V5Service) Order() V5OrderServiceI

Order :

func (*V5Service) Position added in v0.0.21

func (s *V5Service) Position() V5PositionServiceI

Position :

func (*V5Service) SpotLeverageToken added in v0.0.21

func (s *V5Service) SpotLeverageToken() V5SpotLeverageTokenServiceI

SpotLeverageToken :

func (*V5Service) SpotMarginTrade added in v0.0.21

func (s *V5Service) SpotMarginTrade() V5SpotMarginTradeServiceI

SpotMarginTrade :

func (*V5Service) User added in v0.0.21

func (s *V5Service) User() V5UserServiceI

User :

type V5ServiceI added in v0.0.21

type V5ServiceI interface {
	Market() V5MarketServiceI
	Order() V5OrderServiceI
	Position() V5PositionServiceI
	Execution() V5ExecutionServiceI
	Account() V5AccountServiceI
	SpotLeverageToken() V5SpotLeverageTokenServiceI
	SpotMarginTrade() V5SpotMarginTradeServiceI
	Asset() V5AssetServiceI
	User() V5UserServiceI
}

V5ServiceI :

type V5SetLeverageParam added in v0.0.21

type V5SetLeverageParam struct {
	Category     CategoryV5 `json:"category"`
	Symbol       SymbolV5   `json:"symbol"`
	BuyLeverage  string     `json:"buyLeverage"`
	SellLeverage string     `json:"sellLeverage"`
}

V5SetLeverageParam :

type V5SetLeverageResponse added in v0.0.21

type V5SetLeverageResponse struct {
	CommonV5Response `json:",inline"`
	Result           interface{} `json:"result"`
}

V5SetLeverageResponse :

type V5SpotLeverageTokenService added in v0.0.21

type V5SpotLeverageTokenService struct {
	// contains filtered or unexported fields
}

V5SpotLeverageTokenService :

type V5SpotLeverageTokenServiceI added in v0.0.21

type V5SpotLeverageTokenServiceI interface {
}

V5SpotLeverageTokenServiceI :

type V5SpotMarginTradeService added in v0.0.21

type V5SpotMarginTradeService struct {
	// contains filtered or unexported fields
}

V5SpotMarginTradeService :

type V5SpotMarginTradeServiceI added in v0.0.21

type V5SpotMarginTradeServiceI interface {
}

V5SpotMarginTradeServiceI :

type V5UserService added in v0.0.21

type V5UserService struct {
	// contains filtered or unexported fields
}

V5UserService :

func (*V5UserService) GetAPIKey added in v0.0.21

func (s *V5UserService) GetAPIKey() (*V5APIKeyResponse, error)

GetAPIKey :

type V5UserServiceI added in v0.0.21

type V5UserServiceI interface {
	GetAPIKey() (*V5APIKeyResponse, error)
}

V5UserServiceI :

type V5WalletBalanceCoin added in v0.0.21

type V5WalletBalanceCoin struct {
	AvailableToBorrow   string `json:"availableToBorrow"`
	AccruedInterest     string `json:"accruedInterest"`
	AvailableToWithdraw string `json:"availableToWithdraw"`
	TotalOrderIM        string `json:"totalOrderIM"`
	Equity              string `json:"equity"`
	TotalPositionMM     string `json:"totalPositionMM"`
	UsdValue            string `json:"usdValue"`
	UnrealisedPnl       string `json:"unrealisedPnl"`
	BorrowAmount        string `json:"borrowAmount"`
	TotalPositionIM     string `json:"totalPositionIM"`
	WalletBalance       string `json:"walletBalance"`
	CumRealisedPnl      string `json:"cumRealisedPnl"`
	Coin                Coin   `json:"coin"`
}

V5WalletBalanceCoin :

type V5WalletBalanceList added in v0.0.21

type V5WalletBalanceList struct {
	TotalEquity            string                `json:"totalEquity"`
	AccountIMRate          string                `json:"accountIMRate"`
	TotalMarginBalance     string                `json:"totalMarginBalance"`
	TotalInitialMargin     string                `json:"totalInitialMargin"`
	AccountType            string                `json:"accountType"`
	TotalAvailableBalance  string                `json:"totalAvailableBalance"`
	AccountMMRate          string                `json:"accountMMRate"`
	TotalPerpUPL           string                `json:"totalPerpUPL"`
	TotalWalletBalance     string                `json:"totalWalletBalance"`
	TotalMaintenanceMargin string                `json:"totalMaintenanceMargin"`
	Coin                   []V5WalletBalanceCoin `json:"coin"`
}

V5WalletBalanceList :

type V5WalletBalanceResponse added in v0.0.21

type V5WalletBalanceResponse struct {
	CommonV5Response `json:",inline"`
	Result           V5WalletBalanceResult `json:"result"`
}

V5WalletBalanceResponse :

type V5WalletBalanceResult added in v0.0.21

type V5WalletBalanceResult struct {
	List []V5WalletBalanceList `json:"list"`
}

V5WalletBalanceResult :

type WebSocketClient

type WebSocketClient struct {
	// contains filtered or unexported fields
}

WebSocketClient :

func NewWebsocketClient

func NewWebsocketClient() *WebSocketClient

NewWebsocketClient :

func (*WebSocketClient) Spot

Spot :

func (*WebSocketClient) Start

func (c *WebSocketClient) Start(ctx context.Context, executors []WebsocketExecutor)

Start :

func (*WebSocketClient) WithAuth

func (c *WebSocketClient) WithAuth(key string, secret string) *WebSocketClient

WithAuth :

type WebsocketExecutor

type WebsocketExecutor interface {
	Run() error
	Close() error
	Ping() error
}

WebsocketExecutor :

Directories

Path Synopsis
integrationtest
integrationtest-ws

Jump to

Keyboard shortcuts

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