mybinanceapi

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 24 Imported by: 1

README

mybinanceapi

Documentation

Index

Constants

View Source
const (
	BIT_BASE_10 = 10
	BIT_SIZE_64 = 64
)
View Source
const (
	GET    = "GET"
	POST   = "POST"
	DELETE = "DELETE"
	PUT    = "PUT"
)
View Source
const (
	BINANCE_API_SPOT_HTTP        = "api.binance.com"
	BINANCE_API_FUTURE_HTTP      = "fapi.binance.com"
	BINANCE_API_SWAP_HTTP        = "dapi.binance.com"
	BINANCE_API_PM_HTTP          = "papi.binance.com" //zsk修改
	TEST_BINANCE_API_SPOT_HTTP   = "testnet.binance.vision"
	TEST_BINANCE_API_FUTURE_HTTP = "testnet.binancefuture.com"
	TEST_BINANCE_API_SWAP_HTTP   = "testnet.binancefuture.com"
	IS_GZIP                      = true
)
View Source
const (
	BINANCE_API_SPOT_WS_STREAM        = "stream.binance.com:9443"
	BINANCE_API_SWAP_WS_STREAM        = "dstream.binance.com"
	BINANCE_API_FUTURE_WS_STREAM      = "fstream.binance.com"
	BINANCE_API_SWAP_WS_STREAM_GZIP   = "sdstream.binance.com"
	BINANCE_API_FUTURE_WS_STREAM_GZIP = "sfstream.binance.com"
	BINANCE_API_PM_WS_STREAM          = "fstream.binance.com/pm" //zsk修改

	BINANCE_API_SPOT_WS_API   = "ws-api.binance.com:9443"
	BINANCE_API_FUTURE_WS_API = "ws-fapi.binance.com"

	TEST_BINANCE_API_SPOT_WS_STREAM   = "testnet.binance.vision"
	TEST_BINANCE_API_FUTURE_WS_STREAM = "fstream.binancefuture.com"
	TEST_BINANCE_API_SWAP_WS_STREAM   = "dstream.binancefuture.com"

	TEST_BINANCE_API_SPOT_WS_API   = "testnet.binance.vision"
	TEST_BINANCE_API_FUTURE_WS_API = "testnet.binancefuture.com"
)
View Source
const (
	SUBSCRIBE          = "SUBSCRIBE"
	UNSUBSCRIBE        = "UNSUBSCRIBE"
	LIST_SUBSCRIPTIONS = "LIST_SUBSCRIPTIONS"
)

Variables

View Source
var (
	// WebsocketTimeout is an interval for sending ping/pong messages if WebsocketKeepalive is enabled
	WebsocketTimeout = time.Second * 10
	// WebsocketKeepalive enables sending ping/pong messages to check the connection stability
	WebsocketKeepalive = true

	ListenKeyRefreshInterval = 30 * time.Minute
)
View Source
var FutureApiMap = map[FutureApi]string{

	FutureAccount:               "/fapi/v2/account",
	FuturePositionSideDualGet:   "/fapi/v1/positionSide/dual",
	FutureMultiAssetsMarginGet:  "/fapi/v1/multiAssetsMargin",
	FuturePositionSideDualPost:  "/fapi/v1/positionSide/dual",
	FutureMultiAssetsMarginPost: "/fapi/v1/multiAssetsMargin",
	FutureLeverage:              "/fapi/v1/leverage",
	FutureMarginType:            "/fapi/v1/marginType",
	FutureLeverageBracket:       "/fapi/v1/leverageBracket",
	FuturePositionRisk:          "/fapi/v2/positionRisk",

	FutureOpenOrders:        "/fapi/v1/openOrders",
	FutureAllOrders:         "/fapi/v1/allOrders",
	FutureOrderPost:         "/fapi/v1/order",
	FutureOrderPut:          "/fapi/v1/order",
	FutureOrderGet:          "/fapi/v1/order",
	FutureOrderDelete:       "/fapi/v1/order",
	FutureBatchOrdersPost:   "/fapi/v1/batchOrders",
	FutureBatchOrdersPut:    "/fapi/v1/batchOrders",
	FutureBatchOrdersDelete: "/fapi/v1/batchOrders",
	FutureUserTrades:        "/fapi/v1/userTrades",
	FutureCommissionRate:    "/fapi/v1/commissionRate",

	FuturePing:         "/fapi/v1/ping",
	FutureServerTime:   "/fapi/v1/time",
	FutureExchangeInfo: "/fapi/v1/exchangeInfo",

	FutureKlines:           "/fapi/v1/klines",
	FutureDepth:            "/fapi/v1/depth",
	FutureTrades:           "/fapi/v1/trades",
	FutureHistoricalTrades: "/fapi/v1/historicalTrades",
	FutureAggTrades:        "/fapi/v1/aggTrades",
	FuturePremiumIndex:     "/fapi/v1/premiumIndex",
	FutureFundingRate:      "/fapi/v1/fundingRate",
	FutureFundingInfo:      "/fapi/v1/fundingInfo",
	FutureTicker24hr:       "/fapi/v1/ticker/24hr",
	FutureTickerPrice:      "/fapi/v1/ticker/price",
	FutureTickerBookTicker: "/fapi/v1/ticker/bookTicker",
	FutureDataBasis:        "/futures/data/basis",

	FutureListenKeyPost:   "/fapi/v1/listenKey",
	FutureListenKeyPut:    "/fapi/v1/listenKey",
	FutureListenKeyDelete: "/fapi/v1/listenKey",
}
View Source
var NowNetType = MAIN_NET
View Source
var PmCApiMap = map[PmCApi]string{

	PmCAccount:        "/papi/v1/account",
	PmCAccountBalance: "/papi/v1/balance",
	PmCAccountForC:    "/papi/v2/cm/account",
	PmCCommissionRate: "/papi/v1/cm/commissionRate",

	PmCOpenOrders:                 "/papi/v1/cm/openOrders",
	PmCAllOrders:                  "/papi/v1/cm/allOrders",
	PmCOrderPost:                  "/papi/v1/cm/order",
	PmCOrderPut:                   "/papi/v1/cm/order",
	PmCOrderGet:                   "/papi/v1/cm/order",
	PmCOrderDelete:                "/papi/v1/cm/order",
	PmCAllOrderDelete:             "/papi/v1/cm/allOpenOrders",
	PmCConditionalOrderPost:       "/papi/v1/cm/conditional/order",
	PmCConditionalOrderDelete:     "/papi/v1/cm/conditional/order",
	PmCAllConditionnalOrderDelete: "/papi/v1/cm/conditional/allOpenOrders",
	PmCUserTrades:                 "/papi/v1/cm/userTrades",

	PmCPing:         "/fapi/v1/ping",
	PmCServerTime:   "/fapi/v1/time",
	PmCExchangeInfo: "/fapi/v1/exchangeInfo",

	PmCKlines:           "/fapi/v1/klines",
	PmCDepth:            "/fapi/v1/depth",
	PmCTrades:           "/fapi/v1/trades",
	PmCHistoricalTrades: "/fapi/v1/historicalTrades",
	PmCAggTrades:        "/fapi/v1/aggTrades",
	PmCPremiumIndex:     "/fapi/v1/premiumIndex",
	PmCFundingRate:      "/fapi/v1/fundingRate",
	PmCFundingInfo:      "/fapi/v1/fundingInfo",
	PmCTicker24hr:       "/fapi/v1/ticker/24hr",
	PmCTickerPrice:      "/fapi/v1/ticker/price",
	PmCTickerBookTicker: "/fapi/v1/ticker/bookTicker",
	PmCDataBasis:        "/futures/data/basis",

	PmCListenKeyPost:   "/papi/v1/listenKey",
	PmCListenKeyPut:    "/papi/v1/listenKey",
	PmCListenKeyDelete: "/papi/v1/listenKey",
}
View Source
var PmMApiMap = map[PmMApi]string{

	PmMAccount:               "/papi/v1/account",
	PmMAccountBalance:        "/papi/v1/balance",
	PmMMarginMaxBorrowable:   "/papi/v1/margin/maxBorrowable",
	PmMMarginMaxTransferable: "/papi/v1/margin/maxWithdraw",
	PmMMarginInterestHistory: "/papi/v1/margin/marginInterestHistory",

	PmMMarginOrderGet:    "/papi/v1/margin/order",
	PmMMarginOrderPost:   "/papi/v1/margin/order",
	PmMMarginOrderDelete: "/papi/v1/margin/order",
	PmMMarginAllOrders:   "/papi/v1/margin/allOrders",
	PmMMarginOpenOrders:  "/papi/v1/margin/openOrders",

	PmMMarginOCOOrderGet:    "/papi/v1/margin/orderList",
	PmMMarginOCOOrderPost:   "/papi/v1/margin/order/oco",
	PmMMarginOCOOrderDelete: "/papi/v1/margin/orderList",
	PmMMarginOCOAllOrders:   "/papi/v1/margin/allOrderList",
	PmMMarginOCOOpenOrders:  "/papi/v1/margin/openOrderList",

	PmMPing:         "/api/v3/ping",
	PmMServerTime:   "/api/v3/time",
	PmMExchangeInfo: "/api/v3/exchangeInfo",

	PmMTickerPrice:      "/api/v3/ticker/price",
	PmMKlines:           "/api/v3/klines",
	PmMDepth:            "/api/v3/depth",
	PmMTrades:           "/api/v3/trades",
	PmMHistoricalTrades: "/api/v3/historicalTrades",
	PmMAggTrades:        "/api/v3/aggTrades",
	PmMAvgPrice:         "/api/v3/avgPrice",
	PmMUiKlines:         "/api/v3/uiKlines",
	PmMTicker24hr:       "/api/v3/ticker/24hr",
	PmMTickerBookTicker: "/api/v3/ticker/bookTicker",
	PmMTicker:           "/api/v3/ticker",

	PmMListenKeyPost:   "/papi/v1/listenKey",
	PmMListenKeyPut:    "/papi/v1/listenKey",
	PmMListenKeyDelete: "/papi/v1/listenKey",
}
View Source
var PmUApiMap = map[PmUApi]string{

	PmUAccount:        "/papi/v1/account",
	PmUAccountBalance: "/papi/v1/balance",
	PmUAccountForU:    "/papi/v2/um/account",
	PmUCommissionRate: "/papi/v1/um/commissionRate",

	PmUOpenOrders:                 "/papi/v1/um/openOrders",
	PmUAllOrders:                  "/papi/v1/um/allOrders",
	PmUOrderPost:                  "/papi/v1/um/order",
	PmUOrderPut:                   "/papi/v1/um/order",
	PmUOrderGet:                   "/papi/v1/um/order",
	PmUOrderDelete:                "/papi/v1/um/order",
	PmUAllOrderDelete:             "/papi/v1/um/allOpenOrders",
	PmUConditionalOrderPost:       "/papi/v1/um/conditional/order",
	PmUConditionalOrderDelete:     "/papi/v1/um/conditional/order",
	PmUAllConditionnalOrderDelete: "/papi/v1/um/conditional/allOpenOrders",
	PmUUserTrades:                 "/papi/v1/um/userTrades",

	PmUPing:         "/fapi/v1/ping",
	PmUServerTime:   "/fapi/v1/time",
	PmUExchangeInfo: "/fapi/v1/exchangeInfo",

	PmUKlines:           "/fapi/v1/klines",
	PmUDepth:            "/fapi/v1/depth",
	PmUTrades:           "/fapi/v1/trades",
	PmUHistoricalTrades: "/fapi/v1/historicalTrades",
	PmUAggTrades:        "/fapi/v1/aggTrades",
	PmUPremiumIndex:     "/fapi/v1/premiumIndex",
	PmUFundingRate:      "/fapi/v1/fundingRate",
	PmUFundingInfo:      "/fapi/v1/fundingInfo",
	PmUTicker24hr:       "/fapi/v1/ticker/24hr",
	PmUTickerPrice:      "/fapi/v1/ticker/price",
	PmUTickerBookTicker: "/fapi/v1/ticker/bookTicker",
	PmUDataBasis:        "/futures/data/basis",

	PmUListenKeyPost:   "/papi/v1/listenKey",
	PmUListenKeyPut:    "/papi/v1/listenKey",
	PmUListenKeyDelete: "/papi/v1/listenKey",
}
View Source
var SpotApiMap = map[SpotApi]string{

	SpotSubAccountList:                     "/sapi/v1/sub-account/list",
	SpotSubAccountUniversalTransferHistory: "/sapi/v1/sub-account/universalTransfer",
	SpotSubAccountAssets:                   "/sapi/v4/sub-account/assets",
	SpotSubAccountFuturesAccount:           "/sapi/v2/sub-account/futures/account",
	SpotSubAccountApiIpRestriction:         "/sapi/v1/sub-account/subAccountApi/ipRestriction",
	SpotSubAccountTransferSubUserHistory:   "/sapi/v1/sub-account/transfer/subUserHistory",
	SpotManagedSubAccountQueryTransLog:     "/sapi/v1/managed-subaccount/query-trans-log",
	SpotSubAccountVirtualSubAccount:        "/sapi/v1/sub-account/virtualSubAccount",
	SpotSubAccountUniversalTransfer:        "/sapi/v1/sub-account/universalTransfer",
	SpotSubAccountFuturesEnable:            "/sapi/v1/sub-account/futures/enable",

	SpotMarginAllPairs:         "/sapi/v1/margin/allPairs",
	SpotMarginIsolatedAllPairs: "/sapi/v1/margin/isolated/allPairs",
	SpotMarginAccount:          "/sapi/v1/margin/account",
	SpotMarginIsolatedAccount:  "/sapi/v1/margin/isolated/account",
	SpotMarginMaxBorrowable:    "/sapi/v1/margin/maxBorrowable",
	SpotMarginMaxTransferable:  "/sapi/v1/margin/maxTransferable",
	SpotMarginInterestHistory:  "/sapi/v1/margin/interestHistory",

	SpotMarginOrderGet:    "/sapi/v1/margin/order",
	SpotMarginOrderPost:   "/sapi/v1/margin/order",
	SpotMarginOrderDelete: "/sapi/v1/margin/order",
	SpotMarginAllOrders:   "/sapi/v1/margin/allOrders",
	SpotMarginOpenOrders:  "/sapi/v1/margin/openOrders",

	SpotMarginTransfer:         "/sapi/v1/margin/transfer",
	SpotMarginIsolatedTransfer: "/sapi/v1/margin/isolated/transfer",
	SpotMarginLoan:             "/sapi/v1/margin/loan",
	SpotMarginRepay:            "/sapi/v1/margin/repay",

	SpotAccountApiTradingStatus: "/sapi/v1/account/apiTradingStatus",
	SpotAccount:                 "/api/v3/account",
	SpotAssetGetFundingAsset:    "/sapi/v1/asset/get-funding-asset",
	SpotAssetTransferPost:       "/sapi/v1/asset/transfer",
	SpotAssetTransferGet:        "/sapi/v1/asset/transfer",
	SpotAssetTradeFee:           "/sapi/v1/asset/tradeFee",

	SpotOpenOrders: "/api/v3/openOrders",
	SpotAllOrders:  "/api/v3/allOrders",

	SpotOrderGet:           "/api/v3/order",
	SpotOrderPost:          "/api/v3/order",
	SpotOrderDelete:        "/api/v3/order",
	SpotOrderCancelReplace: "/api/v3/order/cancelReplace",
	SpotMyTrades:           "/api/v3/myTrades",

	SpotPing:         "/api/v3/ping",
	SpotServerTime:   "/api/v3/time",
	SpotExchangeInfo: "/api/v3/exchangeInfo",

	SpotTickerPrice:      "/api/v3/ticker/price",
	SpotKlines:           "/api/v3/klines",
	SpotDepth:            "/api/v3/depth",
	SpotTrades:           "/api/v3/trades",
	SpotHistoricalTrades: "/api/v3/historicalTrades",
	SpotAggTrades:        "/api/v3/aggTrades",
	SpotAvgPrice:         "/api/v3/avgPrice",
	SpotUiKlines:         "/api/v3/uiKlines",
	SpotTicker24hr:       "/api/v3/ticker/24hr",
	SpotTickerBookTicker: "/api/v3/ticker/bookTicker",
	SpotTicker:           "/api/v3/ticker",

	SpotUserDataStreamPost:   "/api/v3/userDataStream",
	SpotUserDataStreamPut:    "/api/v3/userDataStream",
	SpotUserDataStreamDelete: "/api/v3/userDataStream",

	SpotMarginUserDataStreamPost:   "/sapi/v1/userDataStream",
	SpotMarginUserDataStreamPut:    "/sapi/v1/userDataStream",
	SpotMarginUserDataStreamDelete: "/sapi/v1/userDataStream",

	SpotMarginIsolatedUserDataStreamPost:   "/sapi/v1/userDataStream/isolated",
	SpotMarginIsolatedUserDataStreamPut:    "/sapi/v1/userDataStream/isolated",
	SpotMarginIsolatedUserDataStreamDelete: "/sapi/v1/userDataStream/isolated",
}
View Source
var SwapApiMap = map[SwapApi]string{

	SwapAccount:              "/dapi/v1/account",
	SwapPositionSideDualGet:  "/dapi/v1/positionSide/dual",
	SwapLeverageBracket:      "/dapi/v2/leverageBracket",
	SwapPositionSideDualPost: "/dapi/v1/positionSide/dual",
	SwapLeverage:             "/dapi/v1/leverage",
	SwapMarginType:           "/dapi/v1/marginType",
	SwapPositionRisk:         "/dapi/v1/positionRisk",

	SwapOpenOrders:     "/dapi/v1/openOrders",
	SwapAllOrders:      "/dapi/v1/allOrders",
	SwapOrderPost:      "/dapi/v1/order",
	SwapOrderPut:       "/dapi/v1/order",
	SwapOrderGet:       "/dapi/v1/order",
	SwapOrderDelete:    "/dapi/v1/order",
	SwapUserTrades:     "/dapi/v1/userTrades",
	SwapCommissionRate: "/dapi/v1/commissionRate",

	SwapBatchOrdersPost:   "/dapi/v1/batchOrders",
	SwapBatchOrdersPut:    "/dapi/v1/batchOrders",
	SwapBatchOrdersDelete: "/dapi/v1/batchOrders",

	SwapPing:         "/dapi/v1/ping",
	SwapServerTime:   "/dapi/v1/time",
	SwapExchangeInfo: "/dapi/v1/exchangeInfo",

	SwapKlines:      "/dapi/v1/klines",
	SwapTickerPrice: "/dapi/v1/ticker/price",
	SwapDepth:       "/dapi/v1/depth",

	SwapListenKeyPost: "/dapi/v1/listenKey",
	SwapListenKeyPut:  "/dapi/v1/listenKey",
	SwapListenKeyDel:  "/dapi/v1/listenKey",
}
View Source
var UseProxy = false

Functions

func BinanceGetRestHostByApiType

func BinanceGetRestHostByApiType(apiType ApiType) string

func GetPointer

func GetPointer[T any](v T) *T

func HandleWsPayloadResult

func HandleWsPayloadResult[T any](data []byte) (*T, error)

func HmacSha256

func HmacSha256(secret, data string) string

func RequestWithHeader

func RequestWithHeader(urlStr string, method string, headerMap map[string]string, isGzip bool) ([]byte, error)

func SetHttpTimeout

func SetHttpTimeout(timeout time.Duration)

func SetLogger

func SetLogger(logger *logrus.Logger)

func SetNetType

func SetNetType(netType NetType)

func SetServerTimeDelta

func SetServerTimeDelta(delta int64)

func SetUseProxy

func SetUseProxy(useProxy bool, proxyUrls ...string)

Types

type ApiType

type ApiType int
const (
	SPOT ApiType = iota
	FUTURE
	SWAP
	PMU //zsk修改
	PMC
	PMM
)

func (*ApiType) String

func (apiType *ApiType) String() string

type AssertTransferType

type AssertTransferType string
const (
	MAIN_UMFUTURE                 AssertTransferType = "MAIN_UMFUTURE"                 //现货钱包转向U本位合约钱包
	MAIN_CMFUTURE                 AssertTransferType = "MAIN_CMFUTURE"                 //现货钱包转向币本位合约钱包
	MAIN_MARGIN                   AssertTransferType = "MAIN_MARGIN"                   //现货钱包转向杠杆全仓钱包
	UMFUTURE_MAIN                 AssertTransferType = "UMFUTURE_MAIN"                 //U本位合约钱包转向现货钱包
	UMFUTURE_MARGIN               AssertTransferType = "UMFUTURE_MARGIN"               //U本位合约钱包转向杠杆全仓钱包
	CMFUTURE_MAIN                 AssertTransferType = "CMFUTURE_MAIN"                 //币本位合约钱包转向现货钱包
	MARGIN_MAIN                   AssertTransferType = "MARGIN_MAIN"                   //杠杆全仓钱包转向现货钱包
	MARGIN_UMFUTURE               AssertTransferType = "MARGIN_UMFUTURE"               //杠杆全仓钱包转向U本位合约钱包
	MARGIN_CMFUTURE               AssertTransferType = "MARGIN_CMFUTURE"               //杠杆全仓钱包转向币本位合约钱包
	CMFUTURE_MARGIN               AssertTransferType = "CMFUTURE_MARGIN"               //币本位合约钱包转向杠杆全仓钱包
	ISOLATEDMARGIN_MARGIN         AssertTransferType = "ISOLATEDMARGIN_MARGIN"         //杠杆逐仓钱包转向杠杆全仓钱包
	MARGIN_ISOLATEDMARGIN         AssertTransferType = "MARGIN_ISOLATEDMARGIN"         //杠杆全仓钱包转向杠杆逐仓钱包
	ISOLATEDMARGIN_ISOLATEDMARGIN AssertTransferType = "ISOLATEDMARGIN_ISOLATEDMARGIN" //杠杆逐仓钱包转向杠杆逐仓钱包
	MAIN_FUNDING                  AssertTransferType = "MAIN_FUNDING"                  //现货钱包转向资金钱包
	FUNDING_MAIN                  AssertTransferType = "FUNDING_MAIN"                  //资金钱包转向现货钱包
	FUNDING_UMFUTURE              AssertTransferType = "FUNDING_UMFUTURE"              //资金钱包转向U本位合约钱包
	UMFUTURE_FUNDING              AssertTransferType = "UMFUTURE_FUNDING"              //U本位合约钱包转向资金钱包
	MARGIN_FUNDING                AssertTransferType = "MARGIN_FUNDING"                //杠杆全仓钱包转向资金钱包
	FUNDING_MARGIN                AssertTransferType = "FUNDING_MARGIN"                //资金钱包转向杠杆全仓钱包
	FUNDING_CMFUTURE              AssertTransferType = "FUNDING_CMFUTURE"              //资金钱包转向币本位合约钱包
	CMFUTURE_FUNDING              AssertTransferType = "CMFUTURE_FUNDING"              //币本位合约钱包转向资金钱包
	MAIN_OPTION                   AssertTransferType = "MAIN_OPTION"                   //现货钱包转向期权钱包
	OPTION_MAIN                   AssertTransferType = "OPTION_MAIN"                   //期权钱包转向现货钱包
	UMFUTURE_OPTION               AssertTransferType = "UMFUTURE_OPTION"               //U本位合约钱包转向期权钱包
	OPTION_UMFUTURE               AssertTransferType = "OPTION_UMFUTURE"               //期权钱包转向U本位合约钱包
	MARGIN_OPTION                 AssertTransferType = "MARGIN_OPTION"                 //杠杆全仓钱包转向期权钱包
	OPTION_MARGIN                 AssertTransferType = "OPTION_MARGIN"                 //期权全仓钱包转向杠杆钱包
	FUNDING_OPTION                AssertTransferType = "FUNDING_OPTION"                //资金钱包转向期权钱包
	OPTION_FUNDING                AssertTransferType = "OPTION_FUNDING"                //期权钱包转向资金钱包
	MAIN_PORTFOLIO_MARGIN         AssertTransferType = "MAIN_PORTFOLIO_MARGIN"         //现货钱包转向统一账户钱包
	PORTFOLIO_MARGIN_MAIN         AssertTransferType = "PORTFOLIO_MARGIN_MAIN"         //统一账户钱包转向现货钱包
	MAIN_ISOLATED_MARGIN          AssertTransferType = "MAIN_ISOLATED_MARGIN"          //现货钱包转向逐仓账户钱包
	ISOLATED_MARGIN_MAIN          AssertTransferType = "ISOLATED_MARGIN_MAIN"          //逐仓钱包转向现货账户钱包

)

type BinanceErrorRes

type BinanceErrorRes struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

type BinanceRestRes

type BinanceRestRes[T any] struct {
	Result          T //请求结果
	BinanceErrorRes   //错误信息
}

type Client

type Client struct {
	ApiKey    string
	ApiSecret string
}

type DepthGear

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

func (*DepthGear) ParseDecimal

func (gear *DepthGear) ParseDecimal() (decimal.Decimal, decimal.Decimal, error)

type FutureAccountApi

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

func (*FutureAccountApi) Do

func (api *FutureAccountApi) Do() (*FutureAccountRes, error)

func (*FutureAccountApi) RecvWindow

func (api *FutureAccountApi) RecvWindow(RecvWindow int64) *FutureAccountApi

func (*FutureAccountApi) Timestamp

func (api *FutureAccountApi) Timestamp(Timestamp int64) *FutureAccountApi

type FutureAccountReq

type FutureAccountReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

FutureAccount

type FutureAccountRes

type FutureAccountRes struct {
	FeeTier                     int64                      `json:"feeTier"`     // 手续费等级
	CanTrade                    bool                       `json:"canTrade"`    // 是否可以交易
	CanDeposit                  bool                       `json:"canDeposit"`  // 是否可以入金
	CanWithdraw                 bool                       `json:"canWithdraw"` // 是否可以出金
	UpdateTime                  int64                      `json:"updateTime"`  // 保留字段,请忽略
	MultiAssetsMargin           bool                       `json:"multiAssetsMargin"`
	TotalInitialMargin          string                     `json:"totalInitialMargin"`          // 当前所需起始保证金总额(存在逐仓请忽略), 仅计算u
	TotalMaintMargin            string                     `json:"totalMaintMargin"`            // 维持保证金总额, 仅计算usdt资产
	TotalWalletBalance          string                     `json:"totalWalletBalance"`          // 账户总余额, 仅计算usdt资产
	TotalUnrealizedProfit       string                     `json:"totalUnrealizedProfit"`       // 持仓未实现盈亏总额, 仅计算usdt资产
	TotalMarginBalance          string                     `json:"totalMarginBalance"`          // 保证金总余额, 仅计算usdt资产
	TotalPositionInitialMargin  string                     `json:"totalPositionInitialMargin"`  // 持仓所需起始保证金(基于最新标记价格), 仅计算usdt
	TotalOpenOrderInitialMargin string                     `json:"totalOpenOrderInitialMargin"` // 当前挂单所需起始保证金(基于最新标记价格), 仅计算
	TotalCrossWalletBalance     string                     `json:"totalCrossWalletBalance"`     // 全仓账户余额, 仅计算usdt资产
	TotalCrossUnPnl             string                     `json:"totalCrossUnPnl"`             // 全仓持仓未实现盈亏总额, 仅计算usdt资产
	AvailableBalance            string                     `json:"availableBalance"`            // 可用余额, 仅计算usdt资产
	MaxWithdrawAmount           string                     `json:"maxWithdrawAmount"`           // 最大可转出余额, 仅计算usdt资产
	Assets                      []FutureAccountResAsset    `json:"assets"`
	Positions                   []FutureAccountResPosition `json:"positions"` // 头寸,将返回所有市场symbol。
}

type FutureAccountResAsset

type FutureAccountResAsset struct {
	Asset                  string `json:"asset"`                  //资产
	WalletBalance          string `json:"walletBalance"`          //余额
	UnrealizedProfit       string `json:"unrealizedProfit"`       // 未实现盈亏
	MarginBalance          string `json:"marginBalance"`          // 保证金余额
	MaintMargin            string `json:"maintMargin"`            // 维持保证金
	InitialMargin          string `json:"initialMargin"`          // 当前所需起始保证金
	PositionInitialMargin  string `json:"positionInitialMargin"`  // 持仓所需起始保证金(基于最新标记价格)
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // 当前挂单所需起始保证金(基于最新标记价格)
	CrossWalletBalance     string `json:"crossWalletBalance"`     //全仓账户余额
	CrossUnPnl             string `json:"crossUnPnl"`             // 全仓持仓未实现盈亏
	AvailableBalance       string `json:"availableBalance"`       // 可用余额
	MaxWithdrawAmount      string `json:"maxWithdrawAmount"`      // 最大可转出余额
	MarginAvailable        bool   `json:"marginAvailable"`        // 是否可用作联合保证金
	UpdateTime             int64  `json:"updateTime"`             //更新时间
}

type FutureAccountResPosition

type FutureAccountResPosition struct {
	//根据用户持仓模式展示持仓方向,即单向模式下只返回BOTH持仓情况,双向模式下只返回 LONG 和 SHORT 持仓情况
	Symbol                 string `json:"symbol"`                 // 交易对
	InitialMargin          string `json:"initialMargin"`          // 当前所需起始保证金(基于最新标记价格)
	MaintMargin            string `json:"maintMargin"`            //维持保证金
	UnrealizedProfit       string `json:"unrealizedProfit"`       // 持仓未实现盈亏
	PositionInitialMargin  string `json:"positionInitialMargin"`  // 持仓所需起始保证金(基于最新标记价格)
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // 当前挂单所需起始保证金(基于最新标记价格)
	Leverage               string `json:"leverage"`               // 杠杆倍率
	Isolated               bool   `json:"isolated"`               // 是否是逐仓模式
	EntryPrice             string `json:"entryPrice"`             // 持仓成本价
	MaxNotional            string `json:"maxNotional"`            // 当前杠杆下用户可用的最大名义价值
	BidNotional            string `json:"bidNotional"`            // 买单净值,忽略
	AskNotional            string `json:"askNotional"`            // 卖单净值,忽略
	PositionSide           string `json:"positionSide"`           // 持仓方向
	PositionAmt            string `json:"positionAmt"`            // 持仓数量
	UpdateTime             int64  `json:"updateTime"`             // 更新时间
}

type FutureAggTradesApi

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

func (*FutureAggTradesApi) Do

func (*FutureAggTradesApi) EndTime

func (api *FutureAggTradesApi) EndTime(EndTime int64) *FutureAggTradesApi

NO 返回该时刻为止的成交记录

func (*FutureAggTradesApi) FromId

func (api *FutureAggTradesApi) FromId(FromId int64) *FutureAggTradesApi

NO 从包含fromID的成交开始返回结果

func (*FutureAggTradesApi) Limit

func (api *FutureAggTradesApi) Limit(Limit int) *FutureAggTradesApi

NO 默认 500; 最大 1000.

func (*FutureAggTradesApi) StartTime

func (api *FutureAggTradesApi) StartTime(StartTime int64) *FutureAggTradesApi

NO 从该时刻之后的成交记录开始返回结果

func (*FutureAggTradesApi) Symbol

func (api *FutureAggTradesApi) Symbol(Symbol string) *FutureAggTradesApi

YES 交易对

type FutureAggTradesReq

type FutureAggTradesReq struct {
	Symbol    *string `json:"symbol"`    //YES	交易对
	FromId    *int64  `json:"fromId"`    //NO	从包含fromID的成交开始返回结果
	StartTime *int64  `json:"startTime"` //NO	从该时刻之后的成交记录开始返回结果
	EndTime   *int64  `json:"endTime"`   //NO	返回该时刻为止的成交记录
	Limit     *int    `json:"limit"`     //NO	默认 500; 最大 1000.
}

type FutureAggTradesRes

type FutureAggTradesRes []FutureAggTradesResRow

type FutureAggTradesResRow

type FutureAggTradesResRow struct {
	Id           int64  `json:"a"` // 归集成交ID
	Price        string `json:"p"` // 成交价
	Qty          string `json:"q"` // 成交量
	FirstTradeId int64  `json:"f"` // 被归集的首个成交ID
	LastTradeId  int64  `json:"l"` // 被归集的末个成交ID
	Time         int64  `json:"T"` // 成交时间
	IsBuyerMaker bool   `json:"m"` // 是否为主动卖出单
}

type FutureAllOrdersApi

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

func (*FutureAllOrdersApi) Do

func (*FutureAllOrdersApi) EndTime

func (api *FutureAllOrdersApi) EndTime(EndTime int64) *FutureAllOrdersApi

func (*FutureAllOrdersApi) Limit

func (api *FutureAllOrdersApi) Limit(Limit int64) *FutureAllOrdersApi

func (*FutureAllOrdersApi) OrderId

func (api *FutureAllOrdersApi) OrderId(OrderId int64) *FutureAllOrdersApi

func (*FutureAllOrdersApi) RecvWindow

func (api *FutureAllOrdersApi) RecvWindow(RecvWindow int64) *FutureAllOrdersApi

func (*FutureAllOrdersApi) StartTime

func (api *FutureAllOrdersApi) StartTime(StartTime int64) *FutureAllOrdersApi

func (*FutureAllOrdersApi) Symbol

func (api *FutureAllOrdersApi) Symbol(Symbol string) *FutureAllOrdersApi

func (*FutureAllOrdersApi) Timestamp

func (api *FutureAllOrdersApi) Timestamp(Timestamp int64) *FutureAllOrdersApi

type FutureAllOrdersReq

type FutureAllOrdersReq struct {
	Symbol     *string `json:"symbol"`    //No	交易对
	OrderId    *int64  `json:"orderId"`   //No	只返回此orderID及之后的订单,缺省返回最近的订单
	StartTime  *int64  `json:"startTime"` //No	起始时间
	EndTime    *int64  `json:"endTime"`   //No	结束时间
	Limit      *int64  `json:"limit"`     //No	返回的结果集数量 默认值:500 最大值:1000
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type FutureAllOrdersRes

type FutureAllOrdersRes []FutureOrderOrder

type FutureApi

type FutureApi int
const (
	//账户接口
	FutureAccount               FutureApi = iota //GET接口 账户信息V2 (USER_DATA)
	FuturePositionSideDualGet                    //GET接口 (HMAC SHA256)查询持仓模式(USER_DATA)
	FutureMultiAssetsMarginGet                   //GET接口 (HMAC SHA256)查询联合保证金模式(USER_DATA)
	FuturePositionSideDualPost                   //POST接口 (HMAC SHA256)更改持仓模式(TRADE)
	FutureMultiAssetsMarginPost                  //POST接口 (HMAC SHA256)更改联合保证金模式(TRADE)
	FutureLeverage                               //POST接口 (HMAC SHA256)调整开仓杠杆 (TRADE)
	FutureMarginType                             //POST接口 (HMAC SHA256)变换逐全仓模式 (TRADE)
	FutureLeverageBracket                        //GET接口 杠杆分层标准 (USER_DATA)
	FuturePositionRisk                           //GET接口 用户持仓风险V2 (USER_DATA)

	//交易接口
	FutureOpenOrders        //GET接口 (HMAC SHA256)查询当前挂单 (USER_DATA)
	FutureAllOrders         //GET接口 (HMAC SHA256)查询所有订单 (USER_DATA)
	FutureOrderPost         //POST接口 (HMAC SHA256)下单 (TRADE)
	FutureOrderPut          //PUT接口 (HMAC SHA256)修改订单 (TRADE)
	FutureOrderGet          //GET接口 (HMAC SHA256)查询订单 (USER_DATA)
	FutureOrderDelete       //DELETE接口 (HMAC SHA256)撤销订单 (TRADE)
	FutureBatchOrdersPost   //POST接口 (HMAC SHA256)批量下单 (TRADE)
	FutureBatchOrdersPut    //PUT接口 (HMAC SHA256)批量修改订单 (TRADE)
	FutureBatchOrdersDelete //DELETE接口 (HMAC SHA256)批量撤销订单 (TRADE)
	FutureUserTrades        //GET接口 (HMAC SHA256)账户成交历史 (USER_DATA)
	FutureCommissionRate    //GET接口 (HMAC SHA256)查询用户当前的手续费率

	//通用接口
	FuturePing         //GET接口 测试服务器连通性
	FutureServerTime   //GET接口 获取服务器时间
	FutureExchangeInfo //GET接口 交易规则和交易对信息

	//行情接口
	FutureKlines           //K线数据
	FutureDepth            //深度信息
	FutureTrades           //最新成交
	FutureHistoricalTrades //历史成交
	FutureAggTrades        //近期成交(归集)
	FuturePremiumIndex     //最新标记价格和资金费率
	FutureFundingRate      //查询资金费率历史
	FutureFundingInfo      //查询资金费率信息
	FutureTicker24hr       //24hr价格变动情况
	FutureTickerPrice      //最新价格
	FutureTickerBookTicker //当前最优挂单
	FutureDataBasis        //基差数据

	//Ws账户推送相关接口
	FutureListenKeyPost   //生成listenKey (USER_STREAM)
	FutureListenKeyPut    //延长listenKey有效期 (USER_STREAM)
	FutureListenKeyDelete //关闭listenKey (USER_STREAM)
)

type FutureBatchOrdersDeleteApi

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

func (*FutureBatchOrdersDeleteApi) Do

func (*FutureBatchOrdersDeleteApi) OrderIdList

func (api *FutureBatchOrdersDeleteApi) OrderIdList(OrderIdList []int64) *FutureBatchOrdersDeleteApi

func (*FutureBatchOrdersDeleteApi) OrigClientOrderIdList

func (api *FutureBatchOrdersDeleteApi) OrigClientOrderIdList(OrigClientOrderIdList []string) *FutureBatchOrdersDeleteApi

func (*FutureBatchOrdersDeleteApi) RecvWindow

func (api *FutureBatchOrdersDeleteApi) RecvWindow(RecvWindow int64) *FutureBatchOrdersDeleteApi

func (*FutureBatchOrdersDeleteApi) Symbol

func (*FutureBatchOrdersDeleteApi) Timestamp

func (api *FutureBatchOrdersDeleteApi) Timestamp(Timestamp int64) *FutureBatchOrdersDeleteApi

type FutureBatchOrdersDeleteReq

type FutureBatchOrdersDeleteReq struct {
	Symbol                *string   `json:"symbol"`                //YES 交易对
	OrderIdList           *[]int64  `json:"orderIdList"`           //NO 系统订单号, 最多支持10个订单
	OrigClientOrderIdList *[]string `json:"origClientOrderIdList"` //NO 用户自定义的订单号, 最多支持10个订单
	RecvWindow            *int64    `json:"recvWindow"`            //NO
	Timestamp             *int64    `json:"timestamp"`             //YES
}

type FutureBatchOrdersDeleteRes

type FutureBatchOrdersDeleteRes []FutureOrderDeleteRes

type FutureBatchOrdersPostApi

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

func (*FutureBatchOrdersPostApi) AddOrders

func (*FutureBatchOrdersPostApi) Do

func (*FutureBatchOrdersPostApi) RecvWindow

func (api *FutureBatchOrdersPostApi) RecvWindow(RecvWindow int64) *FutureBatchOrdersPostApi

func (*FutureBatchOrdersPostApi) SetOrders

func (*FutureBatchOrdersPostApi) Timestamp

func (api *FutureBatchOrdersPostApi) Timestamp(Timestamp int64) *FutureBatchOrdersPostApi

type FutureBatchOrdersPostReq

type FutureBatchOrdersPostReq struct {
	BatchOrders *[]FutureOrderPostReq `json:"batchOrders"` //YES	批量下单 最多支持5个
	RecvWindow  *int64                `json:"recvWindow"`  //NO
	Timestamp   *int64                `json:"timestamp"`   //YES
}

type FutureBatchOrdersPostRes

type FutureBatchOrdersPostRes []FutureOrderPostResRow

type FutureBatchOrdersPutApi

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

func (*FutureBatchOrdersPutApi) AddOrders

func (*FutureBatchOrdersPutApi) Do

func (*FutureBatchOrdersPutApi) RecvWindow

func (api *FutureBatchOrdersPutApi) RecvWindow(RecvWindow int64) *FutureBatchOrdersPutApi

func (*FutureBatchOrdersPutApi) SetOrders

func (*FutureBatchOrdersPutApi) Timestamp

func (api *FutureBatchOrdersPutApi) Timestamp(Timestamp int64) *FutureBatchOrdersPutApi

type FutureBatchOrdersPutReq

type FutureBatchOrdersPutReq struct {
	BatchOrders *[]FutureOrderPutReq `json:"batchOrders"` //YES	批量下单 最多支持5个
	RecvWindow  *int64               `json:"recvWindow"`  //NO
	Timestamp   *int64               `json:"timestamp"`   //YES
}

type FutureBatchOrdersPutRes

type FutureBatchOrdersPutRes []FutureBatchOrdersPutResRow

type FutureBatchOrdersPutResRow

type FutureBatchOrdersPutResRow struct {
	BinanceErrorRes
	FutureOrderPutRes
}

type FutureCommissionRateApi

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

func (*FutureCommissionRateApi) Do

func (*FutureCommissionRateApi) RecvWindow

func (api *FutureCommissionRateApi) RecvWindow(RecvWindow int64) *FutureCommissionRateApi

func (*FutureCommissionRateApi) Symbol

func (*FutureCommissionRateApi) Timestamp

func (api *FutureCommissionRateApi) Timestamp(Timestamp int64) *FutureCommissionRateApi

type FutureCommissionRateReq

type FutureCommissionRateReq struct {
	Symbol     *string `json:"symbol"`     //NO	交易对
	RecvWindow *int64  `json:"recvWindow"` //NO
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type FutureCommissionRateRes

type FutureCommissionRateRes struct {
	Symbol              string `json:"symbol"`
	MakerCommissionRate string `json:"makerCommissionRate"`
	TakerCommissionRate string `json:"takerCommissionRate"`
}

type FutureCommonPostRes

type FutureCommonPostRes struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
}

type FutureDataBasisApi

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

func (*FutureDataBasisApi) ContractType

func (api *FutureDataBasisApi) ContractType(ContractType string) *FutureDataBasisApi

YES CURRENT_QUARTER, NEXT_QUARTER, PERPETUAL

func (*FutureDataBasisApi) Do

func (*FutureDataBasisApi) EndTime

func (api *FutureDataBasisApi) EndTime(EndTime int64) *FutureDataBasisApi

NO

func (*FutureDataBasisApi) Limit

func (api *FutureDataBasisApi) Limit(Limit int64) *FutureDataBasisApi

NO Default 30,Max 500

func (*FutureDataBasisApi) Pair

func (api *FutureDataBasisApi) Pair(Pair string) *FutureDataBasisApi

YES BTCUSDT

func (*FutureDataBasisApi) Period

func (api *FutureDataBasisApi) Period(Period string) *FutureDataBasisApi

YES "5m","15m","30m","1h","2h","4h","6h","12h","1d"

func (*FutureDataBasisApi) StartTime

func (api *FutureDataBasisApi) StartTime(StartTime int64) *FutureDataBasisApi

NO

type FutureDataBasisReq

type FutureDataBasisReq struct {
	Pair         *string `json:"pair"`         //YES	BTCUSDT
	ContractType *string `json:"contractType"` //YES	CURRENT_QUARTER, NEXT_QUARTER, PERPETUAL
	Period       *string `json:"period"`       //YES	"5m","15m","30m","1h","2h","4h","6h","12h","1d"
	Limit        *int64  `json:"limit"`        //NO	Default 30,Max 500
	StartTime    *int64  `json:"startTime"`    //NO
	EndTime      *int64  `json:"endTime"`      //NO
}

type FutureDataBasisRes

type FutureDataBasisRes []FutureDataBasisResRow

type FutureDataBasisResRow

type FutureDataBasisResRow struct {
	IndexPrice          string `json:"indexPrice"`
	ContractType        string `json:"contractType"`
	BasisRate           string `json:"basisRate"`
	FuturesPrice        string `json:"futuresPrice"`
	AnnualizedBasisRate string `json:"annualizedBasisRate"`
	Basis               string `json:"basis"`
	Pair                string `json:"pair"`
	Timestamp           int64  `json:"timestamp"`
}

type FutureDepthApi

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

func (*FutureDepthApi) Do

func (api *FutureDepthApi) Do() (*FutureDepthRes, error)

func (*FutureDepthApi) Limit

func (api *FutureDepthApi) Limit(Limit int) *FutureDepthApi

NO 默认 500; 可选值:[5, 10, 20, 50, 100, 500, 1000]

func (*FutureDepthApi) Symbol

func (api *FutureDepthApi) Symbol(Symbol string) *FutureDepthApi

YES 交易对

type FutureDepthReq

type FutureDepthReq struct {
	Symbol *string `json:"symbol"` //YES	交易对
	Limit  *int    `json:"limit"`  //NO	默认 500; 可选值:[5, 10, 20, 50, 100, 500, 1000]
}

type FutureDepthRes

type FutureDepthRes struct {
	LastUpdateId int64       `json:"lastUpdateId"` // 最后更新ID
	MessageTime  int64       `json:"E"`            // 消息时间
	EngineTime   int64       `json:"T"`            // 撮合引擎时间
	Bids         []DepthGear `json:"bids"`         // 买单
	Asks         []DepthGear `json:"asks"`         // 卖单
}

type FutureDepthResMiddle

type FutureDepthResMiddle struct {
	LastUpdateId int64           `json:"lastUpdateId"` // 最后更新ID
	MessageTime  int64           `json:"E"`            // 消息时间
	EngineTime   int64           `json:"T"`            // 撮合引擎时间
	Bids         [][]interface{} `json:"bids"`         // 买单
	Asks         [][]interface{} `json:"asks"`         // 卖单
}

func (*FutureDepthResMiddle) ConvertToRes

func (middle *FutureDepthResMiddle) ConvertToRes() *FutureDepthRes

type FutureExchangeInfoApi

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

func (*FutureExchangeInfoApi) Do

type FutureExchangeInfoReq

type FutureExchangeInfoReq struct {
}

type FutureExchangeInfoRes

type FutureExchangeInfoRes struct {
	ExchangeFilters []map[string]interface{}         `json:"exchangeFilters"`
	RateLimits      []FutureExchangeInfoResRateLimit `json:"rateLimits"` // API访问的限制
	Assets          []FutureExchangeInfoResAsset     `json:"assets"`     // 资产信息
	Symbols         []FutureExchangeInfoResSymbol    `json:"symbols"`    // 交易对信息
	Timezone        string                           `json:"timezone"`   // 服务器所用的时间区域
}

type FutureExchangeInfoResAsset

type FutureExchangeInfoResAsset struct {
	Asset             string `json:"asset"`             // 资产
	MarginAvailable   bool   `json:"marginAvailable"`   // 是否可用作保证金
	AutoAssetExchange string `json:"autoAssetExchange"` // 保证金资产自动兑换阈值
}

type FutureExchangeInfoResRateLimit

type FutureExchangeInfoResRateLimit struct {
	Interval      string `json:"interval"`      // 限制的时间间隔
	IntervalNum   int64  `json:"intervalNum"`   // 限制的时间间隔数量
	Limit         int64  `json:"limit"`         // 限制的请求数量
	RateLimitType string `json:"rateLimitType"` // 限制的请求数量的类型
}

type FutureExchangeInfoResSymbol

type FutureExchangeInfoResSymbol struct {
	Symbol             string                   `json:"symbol"`             // 交易对
	Pair               string                   `json:"pair"`               // 标的交易对
	ContractType       string                   `json:"contractType"`       // 合约类型
	DeliveryDate       int64                    `json:"deliveryDate"`       // 交割日期
	OnboardDate        int64                    `json:"onboardDate"`        // 上线日期
	Status             string                   `json:"status"`             // 交易对状态
	BaseAsset          string                   `json:"baseAsset"`          // 标的资产
	QuoteAsset         string                   `json:"quoteAsset"`         // 报价资产
	MarginAsset        string                   `json:"marginAsset"`        // 保证金资产
	PricePrecision     int                      `json:"pricePrecision"`     // 价格小数点位数(仅作为系统精度使用,注意同tickSize 区分)
	QuantityPrecision  int                      `json:"quantityPrecision"`  // 数量小数点位数(仅作为系统精度使用,注意同stepSize 区分)
	BaseAssetPrecision int                      `json:"baseAssetPrecision"` // 标的资产精度
	QuotePrecision     int                      `json:"quotePrecision"`     // 报价资产精度
	UnderlyingType     string                   `json:"underlyingType"`
	UnderlyingSubType  []string                 `json:"underlyingSubType"`
	SettlePlan         int                      `json:"settlePlan"`
	TriggerProtect     string                   `json:"triggerProtect"` // 开启"priceProtect"的条件订单的触发阈值
	Filters            []map[string]interface{} `json:"filters"`
	OrderType          []string                 `json:"OrderType"`       // 订单类型
	TimeInForce        []string                 `json:"timeInForce"`     // 有效方式
	LiquidationFee     string                   `json:"liquidationFee"`  // 强平费率
	MarketTakeBound    string                   `json:"marketTakeBound"` // 市价吃单(相对于标记价格)允许可造成的最大价格偏离比例
}

type FutureFundingInfoApi

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

func (*FutureFundingInfoApi) Do

type FutureFundingInfoReq

type FutureFundingInfoReq struct {
}

type FutureFundingInfoRes

type FutureFundingInfoRes []FutureFundingInfoResRow

type FutureFundingInfoResRow

type FutureFundingInfoResRow struct {
	Symbol                   string `json:"symbol"`                   // 交易对
	AdjustedFundingRateCap   string `json:"adjustedFundingRateCap"`   // 资金费率上限
	AdjustedFundingRateFloor string `json:"adjustedFundingRateFloor"` // 资金费率下限
	FundingIntervalHours     int64  `json:"fundingIntervalHours"`     // 资金费率间隔时间
	Disclaimer               bool   `json:"disclaimer"`
}

type FutureFundingRateApi

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

func (*FutureFundingRateApi) Do

func (*FutureFundingRateApi) EndTime

func (api *FutureFundingRateApi) EndTime(EndTime int64) *FutureFundingRateApi

NO 结束时间

func (*FutureFundingRateApi) Limit

func (api *FutureFundingRateApi) Limit(Limit int) *FutureFundingRateApi

NO 默认值:100 最大值:1000

func (*FutureFundingRateApi) StartTime

func (api *FutureFundingRateApi) StartTime(StartTime int64) *FutureFundingRateApi

NO 起始时间

func (*FutureFundingRateApi) Symbol

func (api *FutureFundingRateApi) Symbol(Symbol string) *FutureFundingRateApi

NO 交易对

type FutureFundingRateReq

type FutureFundingRateReq struct {
	Symbol    *string `json:"symbol"`    //交易对
	StartTime *int64  `json:"startTime"` //起始时间
	EndTime   *int64  `json:"endTime"`   //结束时间
	Limit     *int    `json:"limit"`     //默认值:100 最大值:1000
}

type FutureFundingRateRes

type FutureFundingRateRes []FutureFundingRateResRow

type FutureFundingRateResRow

type FutureFundingRateResRow struct {
	Symbol      string `json:"symbol"`      // 交易对
	FundingTime int64  `json:"fundingTime"` // 资金费率
	FundingRate string `json:"fundingRate"` // 资金费时间
	MarkPrice   string `json:"markPrice"`   // 资金费对应标记价格
}

type FutureHistoricalTradesApi

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

func (*FutureHistoricalTradesApi) Do

func (*FutureHistoricalTradesApi) FromId

NO 从哪一条成交id开始返回. 缺省返回最近的成交记录

func (*FutureHistoricalTradesApi) Limit

NO 默认值:500 最大值:1000.

func (*FutureHistoricalTradesApi) Symbol

YES 交易对

type FutureHistoricalTradesReq

type FutureHistoricalTradesReq struct {
	Symbol *string `json:"symbol"` //YES	交易对
	Limit  *int    `json:"limit"`  //NO	默认值:500 最大值:1000.
	FromId *int64  `json:"fromId"` //NO	从哪一条成交id开始返回. 缺省返回最近的成交记录
}

type FutureHistoricalTradesRes

type FutureHistoricalTradesRes []FutureTradesResRow

type FutureKlinesApi

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

func (*FutureKlinesApi) Do

func (api *FutureKlinesApi) Do() (*KlinesRes, error)

func (*FutureKlinesApi) EndTime

func (api *FutureKlinesApi) EndTime(EndTime int64) *FutureKlinesApi

func (*FutureKlinesApi) Interval

func (api *FutureKlinesApi) Interval(Interval string) *FutureKlinesApi

func (*FutureKlinesApi) Limit

func (api *FutureKlinesApi) Limit(Limit int) *FutureKlinesApi

func (*FutureKlinesApi) StartTime

func (api *FutureKlinesApi) StartTime(StartTime int64) *FutureKlinesApi

func (*FutureKlinesApi) Symbol

func (api *FutureKlinesApi) Symbol(Symbol string) *FutureKlinesApi

type FutureKlinesReq

type FutureKlinesReq struct {
	Symbol    *string `json:"symbol"`    //YES
	Interval  *string `json:"interval"`  //YES	详见枚举定义:K线间隔
	StartTime *int64  `json:"startTime"` //NO
	EndTime   *int64  `json:"endTime"`   //NO
	Limit     *int    `json:"limit"`     //NO	默认 500; 最大 1000.
}

type FutureLeverageApi

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

func (*FutureLeverageApi) Do

func (*FutureLeverageApi) Leverage

func (api *FutureLeverageApi) Leverage(Leverage int64) *FutureLeverageApi

func (*FutureLeverageApi) RecvWindow

func (api *FutureLeverageApi) RecvWindow(RecvWindow int64) *FutureLeverageApi

func (*FutureLeverageApi) Symbol

func (api *FutureLeverageApi) Symbol(Symbol string) *FutureLeverageApi

func (*FutureLeverageApi) Timestamp

func (api *FutureLeverageApi) Timestamp(Timestamp int64) *FutureLeverageApi

type FutureLeverageBracketApi

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

func (*FutureLeverageBracketApi) Do

func (*FutureLeverageBracketApi) RecvWindow

func (api *FutureLeverageBracketApi) RecvWindow(RecvWindow int64) *FutureLeverageBracketApi

func (*FutureLeverageBracketApi) Symbol

func (*FutureLeverageBracketApi) Timestamp

func (api *FutureLeverageBracketApi) Timestamp(Timestamp int64) *FutureLeverageBracketApi

type FutureLeverageBracketReq

type FutureLeverageBracketReq struct {
	Symbol     *string `json:"symbol"` //No	交易对
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

FutureLeverageBracket

type FutureLeverageBracketRes

type FutureLeverageBracketRes []FutureLeverageBracketResResult

type FutureLeverageBracketResResult

type FutureLeverageBracketResResult struct {
	Symbol   string                                   `json:"symbol"`   // 交易对
	Brackets []FutureLeverageBracketResResultBrackets `json:"brackets"` // 交易对
}

type FutureLeverageBracketResResultBrackets

type FutureLeverageBracketResResultBrackets struct {
	Bracket          int64           `json:"bracket"`          // 层级
	InitialLeverage  int64           `json:"initialLeverage"`  // 该层允许的最高初始杠杆倍数
	NotionalCap      int64           `json:"notionalCap"`      // 该层对应的名义价值上限
	NotionalFloor    int64           `json:"notionalFloor"`    // 该层对应的名义价值下限
	MaintMarginRatio decimal.Decimal `json:"maintMarginRatio"` // 该层对应的维持保证金率
	Cum              decimal.Decimal `json:"cum"`              // 速算数
}

type FutureLeverageReq

type FutureLeverageReq struct {
	Symbol     *string `json:"symbol"`   //YES	交易对
	Leverage   *int64  `json:"leverage"` //YES	目标杠杆倍数:1 到 125 整数
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

FutureLeverage

type FutureLeverageRes

type FutureLeverageRes struct {
	Leverage         int64  `json:"leverage"`         // 杠杆倍数
	MaxNotionalValue string `json:"maxNotionalValue"` // 当前杠杆倍数下允许的最大名义价值
	Symbol           string `json:"symbol"`           // 交易对
}

type FutureListenKeyDeleteApi

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

func (*FutureListenKeyDeleteApi) Do

type FutureListenKeyDeleteReq

type FutureListenKeyDeleteReq struct{}

type FutureListenKeyDeleteRes

type FutureListenKeyDeleteRes struct{}

type FutureListenKeyPostApi

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

func (*FutureListenKeyPostApi) Do

type FutureListenKeyPostReq

type FutureListenKeyPostReq struct{}

listenKey相关

type FutureListenKeyPostRes

type FutureListenKeyPostRes struct {
	ListenKey string `json:"listenKey"`
}

type FutureListenKeyPutApi

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

func (*FutureListenKeyPutApi) Do

type FutureListenKeyPutReq

type FutureListenKeyPutReq struct{}

type FutureListenKeyPutRes

type FutureListenKeyPutRes struct{}

type FutureMarginTypeApi

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

func (*FutureMarginTypeApi) Do

func (*FutureMarginTypeApi) MarginType

func (api *FutureMarginTypeApi) MarginType(MarginType string) *FutureMarginTypeApi

func (*FutureMarginTypeApi) RecvWindow

func (api *FutureMarginTypeApi) RecvWindow(RecvWindow int64) *FutureMarginTypeApi

func (*FutureMarginTypeApi) Symbol

func (api *FutureMarginTypeApi) Symbol(Symbol string) *FutureMarginTypeApi

func (*FutureMarginTypeApi) Timestamp

func (api *FutureMarginTypeApi) Timestamp(Timestamp int64) *FutureMarginTypeApi

type FutureMarginTypeReq

type FutureMarginTypeReq struct {
	Symbol     *string `json:"symbol"`     //YES	交易对
	MarginType *string `json:"marginType"` //YES	保证金模式 ISOLATED(逐仓), CROSSED(全仓)
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

FutureMarginType

type FutureMarginTypeRes

type FutureMarginTypeRes FutureCommonPostRes

type FutureMultiAssetsMarginGetApi

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

func (*FutureMultiAssetsMarginGetApi) Do

func (*FutureMultiAssetsMarginGetApi) RecvWindow

func (*FutureMultiAssetsMarginGetApi) Timestamp

type FutureMultiAssetsMarginGetReq

type FutureMultiAssetsMarginGetReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

FutureMultiAssetsMarginGet

type FutureMultiAssetsMarginGetRes

type FutureMultiAssetsMarginGetRes struct {
	MultiAssetsMargin bool `json:"multiAssetsMargin"` // "true": 联合保证金模式开启;"false": 联合保证金模式关闭
}

type FutureMultiAssetsMarginPostApi

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

func (*FutureMultiAssetsMarginPostApi) Do

func (*FutureMultiAssetsMarginPostApi) MultiAssetsMargin

func (api *FutureMultiAssetsMarginPostApi) MultiAssetsMargin(MultiAssetsMargin string) *FutureMultiAssetsMarginPostApi

func (*FutureMultiAssetsMarginPostApi) RecvWindow

func (*FutureMultiAssetsMarginPostApi) Timestamp

type FutureMultiAssetsMarginPostReq

type FutureMultiAssetsMarginPostReq struct {
	MultiAssetsMargin *string `json:"multiAssetsMargin"` //YES "true": 联合保证金模式开启;"false": 联合保证金模式关闭
	RecvWindow        *int64  `json:"recvWindow"`
	Timestamp         *int64  `json:"timestamp"`
}

FutureMultiAssetsMarginPost

type FutureMultiAssetsMarginPostRes

type FutureMultiAssetsMarginPostRes FutureCommonPostRes

type FutureOpenOrdersApi

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

func (*FutureOpenOrdersApi) Do

func (*FutureOpenOrdersApi) RecvWindow

func (api *FutureOpenOrdersApi) RecvWindow(RecvWindow int64) *FutureOpenOrdersApi

func (*FutureOpenOrdersApi) Symbol

func (api *FutureOpenOrdersApi) Symbol(Symbol string) *FutureOpenOrdersApi

func (*FutureOpenOrdersApi) Timestamp

func (api *FutureOpenOrdersApi) Timestamp(Timestamp int64) *FutureOpenOrdersApi

type FutureOpenOrdersReq

type FutureOpenOrdersReq struct {
	Symbol     *string `json:"symbol"` //No	交易对
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type FutureOpenOrdersRes

type FutureOpenOrdersRes []FutureOrderOrder

type FutureOrderDeleteApi

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

func (*FutureOrderDeleteApi) Do

func (*FutureOrderDeleteApi) OrderId

func (api *FutureOrderDeleteApi) OrderId(OrderId int64) *FutureOrderDeleteApi

func (*FutureOrderDeleteApi) OrigClientOrderId

func (api *FutureOrderDeleteApi) OrigClientOrderId(OrigClientOrderId string) *FutureOrderDeleteApi

func (*FutureOrderDeleteApi) RecvWindow

func (api *FutureOrderDeleteApi) RecvWindow(RecvWindow int64) *FutureOrderDeleteApi

func (*FutureOrderDeleteApi) Symbol

func (api *FutureOrderDeleteApi) Symbol(Symbol string) *FutureOrderDeleteApi

func (*FutureOrderDeleteApi) Timestamp

func (api *FutureOrderDeleteApi) Timestamp(Timestamp int64) *FutureOrderDeleteApi

type FutureOrderDeleteReq

type FutureOrderDeleteReq struct {
	Symbol            *string `json:"symbol"`                      //YES 交易对
	OrderId           *int64  `json:"orderId,omitempty"`           //NO 系统订单号
	OrigClientOrderId *string `json:"origClientOrderId,omitempty"` //NO 用户自定义的订单号
	RecvWindow        *int64  `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64  `json:"timestamp"`                   //YES
}

type FutureOrderDeleteRes

type FutureOrderDeleteRes struct {
	BinanceErrorRes
	FutureOrderOrder
}

type FutureOrderGetApi

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

func (*FutureOrderGetApi) Do

func (*FutureOrderGetApi) OrderId

func (api *FutureOrderGetApi) OrderId(OrderId int64) *FutureOrderGetApi

func (*FutureOrderGetApi) OrigClientOrderId

func (api *FutureOrderGetApi) OrigClientOrderId(OrigClientOrderId string) *FutureOrderGetApi

func (*FutureOrderGetApi) RecvWindow

func (api *FutureOrderGetApi) RecvWindow(RecvWindow int64) *FutureOrderGetApi

func (*FutureOrderGetApi) Symbol

func (api *FutureOrderGetApi) Symbol(Symbol string) *FutureOrderGetApi

func (*FutureOrderGetApi) Timestamp

func (api *FutureOrderGetApi) Timestamp(Timestamp int64) *FutureOrderGetApi

type FutureOrderGetReq

type FutureOrderGetReq struct {
	Symbol            *string `json:"symbol"`                      //YES 交易对
	OrderId           *int64  `json:"orderId,omitempty"`           //NO 系统订单号
	OrigClientOrderId *string `json:"origClientOrderId,omitempty"` //NO 用户自定义的订单号
	RecvWindow        *int64  `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64  `json:"timestamp"`                   //YES
}

type FutureOrderGetRes

type FutureOrderGetRes FutureOrderOrder

type FutureOrderOrder

type FutureOrderOrder struct {
	AvgPrice      string `json:"avgPrice"`                  // 平均成交价
	ClientOrderId string `json:"clientOrderId"`             // 用户自定义的订单号
	CumQuote      string `json:"cumQuote"`                  // 成交金额
	ExecutedQty   string `json:"executedQty"`               // 成交量
	OrderId       int64  `gorm:"primaryKey" json:"orderId"` // 系统订单号
	OrigQty       string `json:"origQty"`                   // 原始委托数量
	OrigType      string `json:"origType"`                  // 触发前订单类型
	Price         string `json:"price"`                     // 委托价格
	ReduceOnly    bool   `json:"reduceOnly"`                // 是否仅减仓
	Side          string `json:"side"`                      // 买卖方向
	Status        string `json:"status"`                    // 订单状态
	PositionSide  string `json:"positionSide"`              // 持仓方向
	StopPrice     string `json:"stopPrice"`                 // 触发价,对`TRAILING_STOP_MARKET`无效
	ClosePosition bool   `json:"closePosition"`             // 是否条件全平仓
	Symbol        string `json:"symbol"`                    // 交易对
	Time          int64  `json:"time"`                      // 订单时间
	TimeInForce   string `json:"timeInForce"`               // 有效方法
	Type          string `json:"type"`                      // 订单类型
	ActivatePrice string `json:"activatePrice"`             // 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段
	PriceRate     string `json:"priceRate"`                 // 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段
	UpdateTime    int64  `json:"updateTime"`                // 更新时间
	WorkingType   string `json:"workingType"`               // 条件价格触发类型
	PriceProtect  bool   `json:"priceProtect"`              // 是否开启条件单触发保护
}

type FutureOrderPostApi

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

func (*FutureOrderPostApi) ActivationPrice

func (api *FutureOrderPostApi) ActivationPrice(ActivationPrice decimal.Decimal) *FutureOrderPostApi

func (*FutureOrderPostApi) CallbackRate

func (api *FutureOrderPostApi) CallbackRate(CallbackRate decimal.Decimal) *FutureOrderPostApi

func (*FutureOrderPostApi) ClosePosition

func (api *FutureOrderPostApi) ClosePosition(ClosePosition string) *FutureOrderPostApi

func (*FutureOrderPostApi) Do

func (*FutureOrderPostApi) NewClientOrderId

func (api *FutureOrderPostApi) NewClientOrderId(NewClientOrderId string) *FutureOrderPostApi

func (*FutureOrderPostApi) NewOrderRespType

func (api *FutureOrderPostApi) NewOrderRespType(NewOrderRespType string) *FutureOrderPostApi

func (*FutureOrderPostApi) PositionSide

func (api *FutureOrderPostApi) PositionSide(PositionSide string) *FutureOrderPostApi

func (*FutureOrderPostApi) Price

func (*FutureOrderPostApi) PriceProtect

func (api *FutureOrderPostApi) PriceProtect(PriceProtect string) *FutureOrderPostApi

func (*FutureOrderPostApi) Quantity

func (api *FutureOrderPostApi) Quantity(Quantity decimal.Decimal) *FutureOrderPostApi

func (*FutureOrderPostApi) RecvWindow

func (api *FutureOrderPostApi) RecvWindow(RecvWindow int64) *FutureOrderPostApi

func (*FutureOrderPostApi) ReduceOnly

func (api *FutureOrderPostApi) ReduceOnly(ReduceOnly string) *FutureOrderPostApi

func (*FutureOrderPostApi) Side

func (api *FutureOrderPostApi) Side(Side string) *FutureOrderPostApi

func (*FutureOrderPostApi) StopPrice

func (api *FutureOrderPostApi) StopPrice(StopPrice decimal.Decimal) *FutureOrderPostApi

func (*FutureOrderPostApi) Symbol

func (api *FutureOrderPostApi) Symbol(Symbol string) *FutureOrderPostApi

func (*FutureOrderPostApi) TimeInForce

func (api *FutureOrderPostApi) TimeInForce(TimeInForce string) *FutureOrderPostApi

func (*FutureOrderPostApi) Timestamp

func (api *FutureOrderPostApi) Timestamp(Timestamp int64) *FutureOrderPostApi

func (*FutureOrderPostApi) Type

func (api *FutureOrderPostApi) Type(Type string) *FutureOrderPostApi

func (*FutureOrderPostApi) WorkingType

func (api *FutureOrderPostApi) WorkingType(WorkingType string) *FutureOrderPostApi

type FutureOrderPostReq

type FutureOrderPostReq struct {
	Symbol           *string          `json:"symbol"`                     //Yes	交易对
	Side             *string          `json:"side"`                       //Yes	买卖方向 SELL, BUY
	PositionSide     *string          `json:"positionSide,omitempty"`     //No	持仓方向,单向持仓模式下非必填,默认且仅可填BOTH;在双向持仓模式下必填,且仅可选择 LONG 或 SHORT
	Type             *string          `json:"type"`                       //Yes	订单类型 LIMIT, MARKET, STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET
	ReduceOnly       *string          `json:"reduceOnly,omitempty"`       //No	true, false; 非双开模式下默认false;双开模式下不接受此参数; 使用closePosition不支持此参数。
	Quantity         *decimal.Decimal `json:"quantity,omitempty"`         //No	下单数量,使用closePosition不支持此参数。
	Price            *decimal.Decimal `json:"price,omitempty"`            //No	委托价格
	NewClientOrderId *string          `json:"newClientOrderId,omitempty"` //No	用户自定义的订单号,不可以重复出现在挂单中。如空缺系统会自动赋值。必须满足正则规则 ^[\.A-Z\:/a-z0-9_-]{1,36}$
	StopPrice        *decimal.Decimal `json:"stopPrice,omitempty"`        //No	触发价, 仅 STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET 需要此参数
	ClosePosition    *string          `json:"closePosition,omitempty"`    //No	true, false;触发后全部平仓,仅支持STOP_MARKET和TAKE_PROFIT_MARKET;不与quantity合用;自带只平仓效果,不与reduceOnly 合用
	ActivationPrice  *decimal.Decimal `json:"activationPrice,omitempty"`  //No	追踪止损激活价格,仅TRAILING_STOP_MARKET 需要此参数, 默认为下单当前市场价格(支持不同workingType)
	CallbackRate     *decimal.Decimal `json:"callbackRate,omitempty"`     //No	追踪止损回调比例,可取值范围[0.1, 5],其中 1代表1% ,仅TRAILING_STOP_MARKET 需要此参数
	TimeInForce      *string          `json:"timeInForce,omitempty"`      //No	有效方法
	WorkingType      *string          `json:"workingType,omitempty"`      //No	stopPrice 触发类型: MARK_PRICE(标记价格), CONTRACT_PRICE(合约最新价). 默认 CONTRACT_PRICE
	PriceProtect     *string          `json:"priceProtect,omitempty"`     //No	条件单触发保护:"TRUE","FALSE", 默认"FALSE". 仅 STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET 需要此参数
	NewOrderRespType *string          `json:"newOrderRespType,omitempty"` //No	"ACK", "RESULT", 默认 "ACK"
	RecvWindow       *int64           `json:"recvWindow,omitempty"`       //No
	Timestamp        *int64           `json:"timestamp,omitempty"`        //Yes
}

type FutureOrderPostRes

type FutureOrderPostRes struct {
	ClientOrderId string `json:"clientOrderId"` // 用户自定义的订单号
	CumQty        string `json:"cumQty"`
	CumQuote      string `json:"cumQuote"` // 成交金额
	ExecutedQty   string `json:"executedQty"`
	OrderId       int64  `json:"orderId"` // 系统订单号
	AvgPrice      string `json:"avgPrice"`
	OrigQty       string `json:"origQty"` // 原始委托数量
	Price         string `json:"price"`   // 委托价格
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`         // 买卖方向
	PositionSide  string `json:"positionSide"` // 持仓方向
	Status        string `json:"status"`       // 订单状态
	StopPrice     string `json:"stopPrice"`    // 触发价,对`TRAILING_STOP_MARKET`无效
	ClosePosition bool   `json:"closePosition"`
	Symbol        string `json:"symbol"`      // 交易对
	TimeInForce   string `json:"timeInForce"` // 有效方法
	Type          string `json:"type"`        // 订单类型
	OrigType      string `json:"origType"`    // 触发前订单类型
}

type FutureOrderPostResRow

type FutureOrderPostResRow struct {
	BinanceErrorRes
	FutureOrderPostRes
}

type FutureOrderPutApi

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

func (*FutureOrderPutApi) Do

func (*FutureOrderPutApi) OrderId

func (api *FutureOrderPutApi) OrderId(OrderId int64) *FutureOrderPutApi

func (*FutureOrderPutApi) OrigClientOrderId

func (api *FutureOrderPutApi) OrigClientOrderId(OrigClientOrderId string) *FutureOrderPutApi

func (*FutureOrderPutApi) Price

func (*FutureOrderPutApi) PriceMatch

func (api *FutureOrderPutApi) PriceMatch(PriceMatch string) *FutureOrderPutApi

func (*FutureOrderPutApi) Quantity

func (api *FutureOrderPutApi) Quantity(Quantity decimal.Decimal) *FutureOrderPutApi

func (*FutureOrderPutApi) RecvWindow

func (api *FutureOrderPutApi) RecvWindow(RecvWindow int64) *FutureOrderPutApi

func (*FutureOrderPutApi) Side

func (api *FutureOrderPutApi) Side(Side string) *FutureOrderPutApi

func (*FutureOrderPutApi) Symbol

func (api *FutureOrderPutApi) Symbol(Symbol string) *FutureOrderPutApi

func (*FutureOrderPutApi) Timestamp

func (api *FutureOrderPutApi) Timestamp(Timestamp int64) *FutureOrderPutApi

type FutureOrderPutReq

type FutureOrderPutReq struct {
	Symbol            *string          `json:"symbol"`                      //YES	交易对
	OrderId           *string          `json:"orderId,omitempty"`           //NO	系统订单号
	OrigClientOrderId *string          `json:"origClientOrderId,omitempty"` //NO	用户自定义的订单号
	Side              *string          `json:"side"`                        //YES	买卖方向 SELL, BUY; side需要和原订单相同
	Quantity          *decimal.Decimal `json:"quantity"`                    //YES	下单数量,使用closePosition不支持此参数。
	Price             *decimal.Decimal `json:"price"`                       //YES	委托价格
	PriceMatch        *string          `json:"priceMatch,omitempty"`        //NO	OPPONENT/ OPPONENT_5/ OPPONENT_10/ OPPONENT_20/QUEUE/ QUEUE_5/ QUEUE_10/ QUEUE_20;不能与price同时传
	RecvWindow        *int64           `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64           `json:"timestamp,omitempty"`         //YES
}

type FutureOrderPutRes

type FutureOrderPutRes FutureOrderPostRes

type FuturePingApi

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

func (*FuturePingApi) Do

func (api *FuturePingApi) Do() (*FuturePingRes, error)

type FuturePingReq

type FuturePingReq struct {
}

type FuturePingRes

type FuturePingRes struct {
}

type FuturePositionRiskApi

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

func (*FuturePositionRiskApi) Do

func (*FuturePositionRiskApi) RecvWindow

func (api *FuturePositionRiskApi) RecvWindow(RecvWindow int64) *FuturePositionRiskApi

func (*FuturePositionRiskApi) Symbol

func (api *FuturePositionRiskApi) Symbol(Symbol string) *FuturePositionRiskApi

func (*FuturePositionRiskApi) Timestamp

func (api *FuturePositionRiskApi) Timestamp(Timestamp int64) *FuturePositionRiskApi

type FuturePositionRiskReq

type FuturePositionRiskReq struct {
	Symbol     *string `json:"symbol"` //No	交易对
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type FuturePositionRiskRes

type FuturePositionRiskRes []FuturePositionRiskRow

type FuturePositionRiskRow

type FuturePositionRiskRow struct {
	EntryPrice       string `json:"entryPrice"`       //开仓均价
	BreakEvenPrice   string `json:"breakEvenPrice"`   //盈亏平衡价
	MarginType       string `json:"marginType"`       //逐仓模式或全仓模式
	IsAutoAddMargin  string `json:"isAutoAddMargin"`  //是否自动追加保证金
	IsolatedMargin   string `json:"isolatedMargin"`   //逐仓保证金
	Leverage         string `json:"leverage"`         //当前杠杆倍数
	LiquidationPrice string `json:"liquidationPrice"` //参考强平价格
	MarkPrice        string `json:"markPrice"`        //当前标记价格
	MaxNotionalValue string `json:"maxNotionalValue"` //当前杠杆倍数允许的名义价值上限
	PositionAmt      string `json:"positionAmt"`      //头寸数量,符号代表多空方向, 正数为多,负数为空
	Notional         string `json:"notional"`         //名义价值
	IsolatedWallet   string `json:"isolatedWallet"`   //逐仓钱包余额
	Symbol           string `json:"symbol"`           //交易对
	UnRealizedProfit string `json:"unRealizedProfit"` //持仓未实现盈亏
	PositionSide     string `json:"positionSide"`     //持仓方向
	UpdateTime       int64  `json:"updateTime"`       //更新时间
}

type FuturePositionSideDualGetApi

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

func (*FuturePositionSideDualGetApi) Do

func (*FuturePositionSideDualGetApi) RecvWindow

func (*FuturePositionSideDualGetApi) Timestamp

type FuturePositionSideDualGetReq

type FuturePositionSideDualGetReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

FuturePositionSideDualGet

type FuturePositionSideDualGetRes

type FuturePositionSideDualGetRes struct {
	DualSidePosition bool `json:"dualSidePosition"` // "true": 双向持仓模式;"false": 单向持仓模式
}

type FuturePositionSideDualPostApi

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

func (*FuturePositionSideDualPostApi) Do

func (*FuturePositionSideDualPostApi) DualSidePosition

func (api *FuturePositionSideDualPostApi) DualSidePosition(DualSidePosition string) *FuturePositionSideDualPostApi

func (*FuturePositionSideDualPostApi) RecvWindow

func (*FuturePositionSideDualPostApi) Timestamp

type FuturePositionSideDualPostReq

type FuturePositionSideDualPostReq struct {
	DualSidePosition *string `json:"dualSidePosition"` //YES "true": 双向持仓模式;"false": 单向持仓模式
	RecvWindow       *int64  `json:"recvWindow"`
	Timestamp        *int64  `json:"timestamp"`
}

FuturePositionSideDualPost

type FuturePositionSideDualPostRes

type FuturePositionSideDualPostRes FutureCommonPostRes

type FuturePremiumIndexApi

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

func (*FuturePremiumIndexApi) Do

func (*FuturePremiumIndexApi) Symbol

func (api *FuturePremiumIndexApi) Symbol(Symbol string) *FuturePremiumIndexApi

NO 交易对

type FuturePremiumIndexReq

type FuturePremiumIndexReq struct {
	Symbol *string `json:"symbol"` //NO	交易对
}

symbol STRING NO 交易对

type FuturePremiumIndexRes

type FuturePremiumIndexRes []FuturePremiumIndexResRow

type FuturePremiumIndexResRow

type FuturePremiumIndexResRow struct {
	Symbol               string `json:"symbol"`               // 交易对
	MarkPrice            string `json:"markPrice"`            // 标记价格
	IndexPrice           string `json:"indexPrice"`           // 指数价格
	EstimatedSettlePrice string `json:"estimatedSettlePrice"` // 预估结算价,仅在交割开始前最后一小时有意义
	LastFundingRate      string `json:"lastFundingRate"`      // 最近更新的资金费率
	NextFundingTime      int64  `json:"nextFundingTime"`      // 下次资金费时间
	InterestRate         string `json:"interestRate"`         // 标的资产基础利率
	Time                 int64  `json:"time"`                 // 更新时间
}

type FutureRestClient

type FutureRestClient RestClient

func (*FutureRestClient) NewAllOrders

func (client *FutureRestClient) NewAllOrders() *FutureAllOrdersApi

binance FUTURE FutureAllOrders rest查询所有订单 (USER_DATA)

func (*FutureRestClient) NewExchangeInfo

func (client *FutureRestClient) NewExchangeInfo() *FutureExchangeInfoApi

binance FUTURE FutureExchangeInfo rest交易规范信息和交易对信息 (NONE)

func (*FutureRestClient) NewFutureAccount

func (client *FutureRestClient) NewFutureAccount() *FutureAccountApi

账户接口 binance FUTURE FutureAccount rest账户信息 (USER_DATA)

func (*FutureRestClient) NewFutureAggTrades

func (client *FutureRestClient) NewFutureAggTrades() *FutureAggTradesApi

binance FUTURE FutureAggTrades rest近期成交(归集) (MARKET_DATA)

func (*FutureRestClient) NewFutureBatchOrdersDelete

func (client *FutureRestClient) NewFutureBatchOrdersDelete() *FutureBatchOrdersDeleteApi

binance FUTURE FutureBatchOrdersDelete rest批量撤销订单 (TRADE)

func (*FutureRestClient) NewFutureBatchOrdersPost

func (client *FutureRestClient) NewFutureBatchOrdersPost() *FutureBatchOrdersPostApi

binance FUTURE FutureBatchOrdersPost rest批量下单 (TRADE)

func (*FutureRestClient) NewFutureBatchOrdersPut

func (client *FutureRestClient) NewFutureBatchOrdersPut() *FutureBatchOrdersPutApi

binance FUTURE FutureBatchOrdersPut rest批量修改订单 (TRADE)

func (*FutureRestClient) NewFutureCommissionRate

func (client *FutureRestClient) NewFutureCommissionRate() *FutureCommissionRateApi

binance FUTURE FutureCommissionRate rest查询用户当前的手续费率 (USER_DATA)

func (*FutureRestClient) NewFutureDataBasis

func (client *FutureRestClient) NewFutureDataBasis() *FutureDataBasisApi

binance FUTURE FutureDataBasis rest基差数据 (MARKET_DATA)

func (*FutureRestClient) NewFutureDepth

func (client *FutureRestClient) NewFutureDepth() *FutureDepthApi

binance FUTURE FutureDepth rest深度信息 (MARKET_DATA)

func (*FutureRestClient) NewFutureFundingInfo

func (client *FutureRestClient) NewFutureFundingInfo() *FutureFundingInfoApi

binance FUTURE FutureFundingInfo rest查询资金费率信息 (MARKET_DATA)

func (*FutureRestClient) NewFutureFundingRate

func (client *FutureRestClient) NewFutureFundingRate() *FutureFundingRateApi

binance FUTURE FutureFundingRate rest查询资金费率历史 (MARKET_DATA)

func (*FutureRestClient) NewFutureHistoricalTrades

func (client *FutureRestClient) NewFutureHistoricalTrades() *FutureHistoricalTradesApi

binance FUTURE FutureHistoricalTrades rest历史成交 (MARKET_DATA)

func (*FutureRestClient) NewFutureKlines

func (client *FutureRestClient) NewFutureKlines() *FutureKlinesApi

行情接口 binance FUTURE FutureKlines restK线数据 (MARKET_DATA)

func (*FutureRestClient) NewFutureLeverage

func (client *FutureRestClient) NewFutureLeverage() *FutureLeverageApi

binance FUTURE FutureLeverage rest调整开仓杠杆 (TRADE)

func (*FutureRestClient) NewFutureLeverageBracket

func (client *FutureRestClient) NewFutureLeverageBracket() *FutureLeverageBracketApi

binance FUTURE FutureLeverageBracket rest杠杆分层标准 (USER_DATA)

func (*FutureRestClient) NewFutureListenKeyDelete

func (client *FutureRestClient) NewFutureListenKeyDelete() *FutureListenKeyDeleteApi

binance FUTURE FutureListenKeyDelete rest关闭listenKey (USER_STREAM)

func (*FutureRestClient) NewFutureListenKeyPost

func (client *FutureRestClient) NewFutureListenKeyPost() *FutureListenKeyPostApi

Ws账户推送相关 binance FUTURE FutureListenKeyPost rest生成listenKey (USER_STREAM)

func (*FutureRestClient) NewFutureListenKeyPut

func (client *FutureRestClient) NewFutureListenKeyPut() *FutureListenKeyPutApi

binance FUTURE FutureListenKeyPut rest延长listenKey有效期 (USER_STREAM)

func (*FutureRestClient) NewFutureMarginType

func (client *FutureRestClient) NewFutureMarginType() *FutureMarginTypeApi

binance FUTURE FutureMarginType rest变换逐全仓模式 (TRADE)

func (*FutureRestClient) NewFutureMultiAssetsMarginGet

func (client *FutureRestClient) NewFutureMultiAssetsMarginGet() *FutureMultiAssetsMarginGetApi

binance FUTURE FutureMultiAssetsMarginGet rest查询联合保证金模式 (USER_DATA)

func (*FutureRestClient) NewFutureMultiAssetsMarginPost

func (client *FutureRestClient) NewFutureMultiAssetsMarginPost() *FutureMultiAssetsMarginPostApi

binance FUTURE FutureMultiAssetsMarginPost rest更改联合保证金模式 (TRADE)

func (*FutureRestClient) NewFutureOrderDelete

func (client *FutureRestClient) NewFutureOrderDelete() *FutureOrderDeleteApi

binance FUTURE FutureOrderDelete rest撤销订单 (TRADE)

func (*FutureRestClient) NewFutureOrderGet

func (client *FutureRestClient) NewFutureOrderGet() *FutureOrderGetApi

binance FUTURE FutureOrderGet rest查询订单 (USER_DATA)

func (*FutureRestClient) NewFutureOrderPost

func (client *FutureRestClient) NewFutureOrderPost() *FutureOrderPostApi

binance FUTURE FutureOrderPost rest下单 (TRADE)

func (*FutureRestClient) NewFutureOrderPut

func (client *FutureRestClient) NewFutureOrderPut() *FutureOrderPutApi

binance FUTURE FutureOrderPut rest修改订单 (TRADE)

func (*FutureRestClient) NewFuturePositionRisk

func (client *FutureRestClient) NewFuturePositionRisk() *FuturePositionRiskApi

binance FUTURE FuturePositionRisk rest用户持仓风险V2 (USER_DATA)

func (*FutureRestClient) NewFuturePositionSideDualGet

func (client *FutureRestClient) NewFuturePositionSideDualGet() *FuturePositionSideDualGetApi

binance FUTURE FuturePositionSideDualGet rest查询持仓模式 (USER_DATA)

func (*FutureRestClient) NewFuturePositionSideDualPost

func (client *FutureRestClient) NewFuturePositionSideDualPost() *FuturePositionSideDualPostApi

binance FUTURE FuturePositionSideDualPost rest更改持仓模式 (TRADE)

func (*FutureRestClient) NewFuturePremiumIndex

func (client *FutureRestClient) NewFuturePremiumIndex() *FuturePremiumIndexApi

binance FUTURE FuturePremiumIndex rest最新标记价格和资金费率 (MARKET_DATA)

func (*FutureRestClient) NewFutureTicker24hr

func (client *FutureRestClient) NewFutureTicker24hr() *FutureTicker24hrApi

binance FUTURE FutureTicker24hr rest24hr价格变动情况 (MARKET_DATA)

func (*FutureRestClient) NewFutureTickerBookTicker

func (client *FutureRestClient) NewFutureTickerBookTicker() *FutureTickerBookTickerApi

binance FUTURE FutureTickerBookTicker rest当前最优挂单 (MARKET_DATA)

func (*FutureRestClient) NewFutureTickerPrice

func (client *FutureRestClient) NewFutureTickerPrice() *FutureTickerPriceApi

binance FUTURE FutureTickerPrice rest最新价格 (MARKET_DATA)

func (*FutureRestClient) NewFutureTrades

func (client *FutureRestClient) NewFutureTrades() *FutureTradesApi

binance FUTURE FutureTrades rest最新成交 (MARKET_DATA)

func (*FutureRestClient) NewFutureUserTrades

func (client *FutureRestClient) NewFutureUserTrades() *FutureUserTradesApi

binance FUTURE FutureUserTrades rest账户成交历史 (USER_DATA)

func (*FutureRestClient) NewOpenOrders

func (client *FutureRestClient) NewOpenOrders() *FutureOpenOrdersApi

交易接口 binance FUTURE FutureOpenOrders rest查询当前挂单 (USER_DATA)

func (*FutureRestClient) NewPing

func (client *FutureRestClient) NewPing() *FuturePingApi

通用接口 binance FUTURE FuturePing rest测试服务器连通性 (NONE)

func (*FutureRestClient) NewServerTime

func (client *FutureRestClient) NewServerTime() *FutureServerTimeApi

binance FUTURE FutureTime rest获取服务器时间 (NONE)

type FutureServerTimeApi

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

func (*FutureServerTimeApi) Do

func (api *FutureServerTimeApi) Do() (*FutureTimeRes, error)

type FutureServerTimeReq

type FutureServerTimeReq struct {
}

type FutureTicker24hrApi

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

func (*FutureTicker24hrApi) Do

func (*FutureTicker24hrApi) Symbol

func (api *FutureTicker24hrApi) Symbol(Symbol string) *FutureTicker24hrApi

NO 交易对

type FutureTicker24hrReq

type FutureTicker24hrReq struct {
	Symbol *string `json:"symbol"` //NO	交易对
}

symbol STRING NO 交易对

type FutureTicker24hrRes

type FutureTicker24hrRes []FutureTicker24hrResRow

type FutureTicker24hrResRow

type FutureTicker24hrResRow struct {
	Symbol             string `json:"symbol"`             // 交易对
	PriceChange        string `json:"priceChange"`        // 24小时价格变动
	PriceChangePercent string `json:"priceChangePercent"` // 24小时价格变动百分比
	WeightedAvgPrice   string `json:"weightedAvgPrice"`   // 加权平均价
	LastPrice          string `json:"lastPrice"`          // 最近一次成交价
	LastQty            string `json:"lastQty"`            // 最近一次成交额
	OpenPrice          string `json:"openPrice"`          // 24小时内第一次成交的价格
	HighPrice          string `json:"highPrice"`          // 24小时最高价
	LowPrice           string `json:"lowPrice"`           // 24小时最低价
	Volume             string `json:"volume"`             // 24小时成交量
	QuoteVolume        string `json:"quoteVolume"`        // 24小时成交额
	OpenTime           int64  `json:"openTime"`           // 24小时内,第一笔交易的发生时间
	CloseTime          int64  `json:"closeTime"`          // 24小时内,最后一笔交易的发生时间
	FirstId            int64  `json:"firstId"`            // 首笔成交id
	LastId             int64  `json:"lastId"`             // 末笔成交id
	Count              int64  `json:"count"`              // 成交笔数
}

type FutureTickerBookTickerApi

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

func (*FutureTickerBookTickerApi) Do

func (*FutureTickerBookTickerApi) Symbol

NO 交易对

type FutureTickerBookTickerReq

type FutureTickerBookTickerReq struct {
	Symbol *string `json:"symbol"` //NO	交易对
}

type FutureTickerBookTickerRes

type FutureTickerBookTickerRes []FutureTickerBookTickerResRow

type FutureTickerBookTickerResRow

type FutureTickerBookTickerResRow struct {
	LastUpdateId int64  `json:"lastUpdateId"` // 最后更新ID
	Symbol       string `json:"symbol"`       // 交易对
	BidPrice     string `json:"bidPrice"`     // 最优买单价
	BidQty       string `json:"bidQty"`       // 挂单量
	AskPrice     string `json:"askPrice"`     // 最优卖单价
	AskQty       string `json:"askQty"`       // 挂单量
	Time         int64  `json:"time"`         // 撮合引擎时间
}

type FutureTickerPriceApi

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

func (*FutureTickerPriceApi) Do

func (*FutureTickerPriceApi) Symbol

func (api *FutureTickerPriceApi) Symbol(Symbol string) *FutureTickerPriceApi

NO 交易对

type FutureTickerPriceReq

type FutureTickerPriceReq struct {
	Symbol *string `json:"symbol"` //NO	交易对
}

symbol STRING NO 交易对

type FutureTickerPriceRes

type FutureTickerPriceRes []FutureTickerPriceResRow

type FutureTickerPriceResRow

type FutureTickerPriceResRow struct {
	Symbol string `json:"symbol"` // 交易对
	Price  string `json:"price"`  // 价格
	Time   int64  `json:"time"`   // 撮合引擎时间
}

type FutureTimeRes

type FutureTimeRes struct {
	ServerTime int64 `json:"serverTime"`
}

type FutureTradesApi

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

func (*FutureTradesApi) Do

func (api *FutureTradesApi) Do() (*FutureTradesRes, error)

func (*FutureTradesApi) Limit

func (api *FutureTradesApi) Limit(Limit int) *FutureTradesApi

NO 默认:500,最大1000

func (*FutureTradesApi) Symbol

func (api *FutureTradesApi) Symbol(Symbol string) *FutureTradesApi

YES 交易对

type FutureTradesReq

type FutureTradesReq struct {
	Symbol *string `json:"symbol"` //YES	交易对
	Limit  *int    `json:"limit"`  //NO	默认:500,最大1000
}

type FutureTradesRes

type FutureTradesRes []FutureTradesResRow

type FutureTradesResRow

type FutureTradesResRow struct {
	Id           int64  `json:"id"`           // 成交ID
	Price        string `json:"price"`        // 成交价格
	Qty          string `json:"qty"`          // 成交量
	QuoteQty     string `json:"quoteQty"`     // 成交额
	Time         int64  `json:"time"`         // 时间
	IsBuyerMaker bool   `json:"isBuyerMaker"` // 买方是否为挂单方
}

type FutureUserTrade

type FutureUserTrade struct {
	Buyer           bool   `json:"buyer"`           // 是否是买方
	Commission      string `json:"commission"`      // 手续费
	CommissionAsset string `json:"commissionAsset"` // 手续费计价单位
	Id              int64  `json:"id"`              // 交易ID
	Maker           bool   `json:"maker"`           // 是否是挂单方
	OrderId         int64  `json:"orderId"`         // 订单编号
	Price           string `json:"price"`           // 成交价
	Qty             string `json:"qty"`             // 成交量
	QuoteQty        string `json:"quoteQty"`        // 成交额
	RealizedPnl     string `json:"realizedPnl"`     // 实现盈亏
	Side            string `json:"side"`            // 买卖方向
	PositionSide    string `json:"positionSide"`    // 持仓方向
	Symbol          string `json:"symbol"`          // 交易对
	Time            int64  `json:"time"`            // 时间
}

type FutureUserTradesApi

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

func (*FutureUserTradesApi) Do

func (*FutureUserTradesApi) EndTime

func (api *FutureUserTradesApi) EndTime(EndTime int64) *FutureUserTradesApi

func (*FutureUserTradesApi) FromId

func (api *FutureUserTradesApi) FromId(FromId int64) *FutureUserTradesApi

func (*FutureUserTradesApi) Limit

func (api *FutureUserTradesApi) Limit(Limit int64) *FutureUserTradesApi

func (*FutureUserTradesApi) OrderId

func (api *FutureUserTradesApi) OrderId(OrderId int64) *FutureUserTradesApi

func (*FutureUserTradesApi) RecvWindow

func (api *FutureUserTradesApi) RecvWindow(RecvWindow int64) *FutureUserTradesApi

func (*FutureUserTradesApi) StartTime

func (api *FutureUserTradesApi) StartTime(StartTime int64) *FutureUserTradesApi

func (*FutureUserTradesApi) Symbol

func (api *FutureUserTradesApi) Symbol(Symbol string) *FutureUserTradesApi

func (*FutureUserTradesApi) Timestamp

func (api *FutureUserTradesApi) Timestamp(Timestamp int64) *FutureUserTradesApi

type FutureUserTradesReq

type FutureUserTradesReq struct {
	Symbol     *string `json:"symbol"`     //YES	交易对
	OrderId    *int64  `json:"orderId"`    //NO	必须要和参数symbol一起使用
	StartTime  *int64  `json:"startTime"`  //NO	起始时间
	EndTime    *int64  `json:"endTime"`    //NO	结束时间
	FromId     *int64  `json:"fromId"`     //NO	返回该fromId及之后的成交,缺省返回最近的成交
	Limit      *int64  `json:"limit"`      //NO	返回的结果集数量 默认值:500 最大值:1000.
	RecvWindow *int64  `json:"recvWindow"` //NO
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type FutureUserTradesRes

type FutureUserTradesRes []FutureUserTrade

type FutureWsStreamClient

type FutureWsStreamClient struct {
	WsStreamClient
	// contains filtered or unexported fields
}

func (*FutureWsStreamClient) AmendOrder

func (*FutureWsStreamClient) CancelOrder

func (*FutureWsStreamClient) Close

func (ws *FutureWsStreamClient) Close() error

func (*FutureWsStreamClient) ConvertToAccountWs

func (ws *FutureWsStreamClient) ConvertToAccountWs(apiKey string, apiSecret string) (*FutureWsStreamClient, error)

func (*FutureWsStreamClient) ConvertToWsApi

func (ws *FutureWsStreamClient) ConvertToWsApi(apiKey string, apiSecret string) (*FutureWsStreamClient, error)

func (*FutureWsStreamClient) CreateOrder

func (*FutureWsStreamClient) CreatePayload

func (ws *FutureWsStreamClient) CreatePayload() (*WsFuturePayload, error)

func (*FutureWsStreamClient) QueryOrder

type KlinesMiddle

type KlinesMiddle []KlinesMiddleRow

func (*KlinesMiddle) ConvertToRes

func (klinesMiddle *KlinesMiddle) ConvertToRes() KlinesRes

type KlinesMiddleRow

type KlinesMiddleRow [11]interface{}

type KlinesRes

type KlinesRes []KlinesResRow

type KlinesResRow

type KlinesResRow struct {
	StartTime            int64   `json:"start_time" gorm:"primaryKey"` //开盘时间
	Open                 float64 `json:"open"`                         //开盘价
	High                 float64 `json:"high"`                         //最高价
	Low                  float64 `json:"low"`                          //最低价
	Close                float64 `json:"close"`                        //收盘价
	Volume               float64 `json:"volume"`                       //成交量
	CloseTime            int64   `json:"close_time"`                   //收盘时间
	TransactionVolume    float64 `json:"transaction_volume"`           // 成交额
	TransactionNumber    int64   `json:"transaction_number"`           //成交笔数
	BuyTransactionVolume float64 `json:"buy_transaction_volume"`       //主动买入成交量
	BuyTransactionAmount float64 `json:"buy_transaction_amount"`       //主动买入成交额
}

type ManagedSubAccountQueryTransLogRes

type ManagedSubAccountQueryTransLogRes struct {
	ManagerSubTransferHistoryVos []ManagerSubTransferHistoryVos `json:"managerSubTransferHistoryVos"`
}

type ManagerSubTransferHistoryVos

type ManagerSubTransferHistoryVos struct {
	FromEmail       string `json:"fromEmail"`
	FromAccountType string `json:"fromAccountType"`
	ToEmail         string `json:"toEmail"`
	ToAccountType   string `json:"toAccountType"`
	Asset           string `json:"asset"`
	Amount          string `json:"amount"`
	ScheduledData   int64  `json:"scheduledData"`
	CreateTime      int64  `json:"createTime"`
	Status          string `json:"status"`
	TranId          int64  `json:"tranId"`
}

type MarginAccountRes

type MarginAccountRes struct {
	BorrowEnabled       bool          `json:"borrowEnabled"`
	MarginLevel         string        `json:"marginLevel"`
	TotalAssetOfBtc     string        `json:"totalAssetOfBtc"`
	TotalLiabilityOfBtc string        `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBtc  string        `json:"totalNetAssetOfBtc"`
	TradeEnabled        bool          `json:"tradeEnabled"`
	TransferEnabled     bool          `json:"transferEnabled"`
	UserAssets          []MarginAsset `json:"userAssets"`
}

type MarginAllOrdersRes

type MarginAllOrdersRes []MarginOrderOrder

type MarginAllPairsRes

type MarginAllPairsRes []MarginPairs

type MarginAsset

type MarginAsset struct {
	Asset    string `json:"asset"`
	Borrowed string `json:"borrowed"`
	Free     string `json:"free"`
	Interest string `json:"interest"`
	Locked   string `json:"locked"`
	NetAsset string `json:"netAsset"`
}

type MarginInterestHistoryRes

type MarginInterestHistoryRes struct {
	Rows  []MarginInterestHistoryRow `json:"rows"`
	Total int                        `json:"total"`
}

type MarginInterestHistoryRow

type MarginInterestHistoryRow struct {
	TxId                int64  `json:"txId"`
	InterestAccuredTime int64  `json:"interestAccuredTime"`
	Asset               string `json:"asset"`
	RawAsset            string `json:"rawAsset"`
	Principal           string `json:"principal"`
	Interest            string `json:"interest"`
	InterestRate        string `json:"interestRate"`
	Type                string `json:"type"`
	IsolatedSymbol      string `json:"isolatedSymbol"`
}

type MarginIsolatedAccountRes

type MarginIsolatedAccountRes struct {
	Assets              []MarginIsolatedAsset `json:"assets"`
	TotalAssetOfBtc     string                `json:"totalAssetOfBtc"`
	TotalLiabilityOfBtc string                `json:"totalLiabilityOfBtc"`
	TotalNetAssetOfBtc  string                `json:"totalNetAssetOfBtc"`
}

type MarginIsolatedAllPairsRes

type MarginIsolatedAllPairsRes []MarginPairs

type MarginIsolatedAsset

type MarginIsolatedAsset struct {
	BaseAsset         MarginIsolatedInnerAsset `json:"baseAsset"`
	QuoteAsset        MarginIsolatedInnerAsset `json:"quoteAsset"`
	Symbol            string                   `json:"symbol"`
	IsolatedCreated   bool                     `json:"isolatedCreated"`
	Enabled           bool                     `json:"enabled"`
	MarginLevel       string                   `json:"marginLevel"`
	MarginLevelStatus string                   `json:"marginLevelStatus"`
	MarginRatio       string                   `json:"marginRatio"`
	IndexPrice        string                   `json:"indexPrice"`
	LiquidatePrice    string                   `json:"liquidatePrice"`
	LiquidateRate     string                   `json:"liquidateRate"`
	TradeEnabled      bool                     `json:"tradeEnabled"`
}

type MarginIsolatedInnerAsset

type MarginIsolatedInnerAsset struct {
	Asset         string `json:"asset"`
	BorrowEnabled bool   `json:"borrowEnabled"`
	Borrowed      string `json:"borrowed"`
	Free          string `json:"free"`
	Interest      string `json:"interest"`
	Locked        string `json:"locked"`
	NetAsset      string `json:"netAsset"`
	NetAssetOfBtc string `json:"netAssetOfBtc"`
	RepayEnabled  bool   `json:"repayEnabled"`
	TotalAsset    string `json:"totalAsset"`
}

type MarginIsolatedTransferRes

type MarginIsolatedTransferRes TranRes

type MarginLoanRes

type MarginLoanRes TranRes

type MarginMaxBorrowableRes

type MarginMaxBorrowableRes struct {
	Amount      string `json:"amount"`      //系统可借充足情况下用户账户当前最大可借额度
	BorrowLimit string `json:"borrowLimit"` //平台限制的用户当前等级可以借的额度
}

type MarginMaxTransferableRes

type MarginMaxTransferableRes struct {
	Amount string `json:"amount"` //用户账户当前最大可转出额度
}

type MarginOpenOrdersRes

type MarginOpenOrdersRes []MarginOrderOrder

type MarginOrderGetRes

type MarginOrderGetRes MarginOrderOrder

type MarginOrderOrder

type MarginOrderOrder struct {
	ClientOrderId           string `json:"clientOrderId"`
	CummulativeQuoteQty     string `json:"cummulativeQuoteQty"`
	ExecutedQty             string `json:"executedQty"`
	IcebergQty              string `json:"icebergQty"`
	IsWorking               bool   `json:"isWorking"`
	OrderId                 int64  `json:"orderId"`
	OrigQty                 string `json:"origQty"`
	Price                   string `json:"price"`
	Side                    string `json:"side"`
	Status                  string `json:"status"`
	StopPrice               string `json:"stopPrice"`
	Symbol                  string `json:"symbol"`
	IsIsolated              bool   `json:"isIsolated"`
	Time                    int64  `json:"time"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`
	UpdateTime              int64  `json:"updateTime"`
}

type MarginPairs

type MarginPairs struct {
	Base          string `json:"base"`          //基础币种
	Id            uint64 `json:"id"`            //币种id
	IsBuyAllowed  bool   `json:"isBuyAllowed"`  //是否允许买入
	IsMarginTrade bool   `json:"isMarginTrade"` //是否允许杠杆交易
	IsSellAllowed bool   `json:"isSellAllowed"` //是否允许卖出
	Quote         string `json:"quote"`         //计价币种
	Symbol        string `json:"symbol"`        //交易对
}

type MarginRepayRes

type MarginRepayRes TranRes

type MarginTransferRes

type MarginTransferRes TranRes

type MyBinance

type MyBinance struct {
}

func (*MyBinance) NewFutureRestClient

func (*MyBinance) NewFutureRestClient(apiKey string, apiSecret string) *FutureRestClient

func (*MyBinance) NewFutureWsStreamClient

func (*MyBinance) NewFutureWsStreamClient() *FutureWsStreamClient

func (*MyBinance) NewPmCRestClient added in v1.0.1

func (*MyBinance) NewPmCRestClient(apiKey string, apiSecret string) *PmCRestClient

func (*MyBinance) NewPmCWsStreamClient added in v1.0.1

func (*MyBinance) NewPmCWsStreamClient() *PmCWsStreamClient

func (*MyBinance) NewPmMRestClient added in v1.0.1

func (*MyBinance) NewPmMRestClient(apiKey string, apiSecret string) *PmMRestClient

func (*MyBinance) NewPmMWsStreamClient added in v1.0.1

func (*MyBinance) NewPmMWsStreamClient() *PmMWsStreamClient

func (*MyBinance) NewPmURestClient added in v1.0.1

func (*MyBinance) NewPmURestClient(apiKey string, apiSecret string) *PmURestClient

zsk修改

func (*MyBinance) NewPmUWsStreamClient added in v1.0.1

func (*MyBinance) NewPmUWsStreamClient() *PmUWsStreamClient

zsk修改

func (*MyBinance) NewSpotRestClient

func (*MyBinance) NewSpotRestClient(apiKey string, apiSecret string) *SpotRestClient

func (*MyBinance) NewSpotWsStreamClient

func (*MyBinance) NewSpotWsStreamClient() *SpotWsStreamClient

func (*MyBinance) NewSwapRestClient

func (*MyBinance) NewSwapRestClient(apiKey string, apiSecret string) *SwapRestClient

func (*MyBinance) NewSwapWsStreamClient

func (*MyBinance) NewSwapWsStreamClient() *SwapWsStreamClient

type MySyncMap

type MySyncMap[K any, V any] struct {
	// contains filtered or unexported fields
}

func NewMySyncMap

func NewMySyncMap[K any, V any]() MySyncMap[K, V]

func (*MySyncMap[K, V]) Delete

func (m *MySyncMap[K, V]) Delete(k K)

func (*MySyncMap[K, V]) Length

func (m *MySyncMap[K, V]) Length() int

func (*MySyncMap[K, V]) Load

func (m *MySyncMap[K, V]) Load(k K) (V, bool)

func (*MySyncMap[K, V]) MapValues

func (m *MySyncMap[K, V]) MapValues(f func(k K, v V) V) *MySyncMap[K, V]

func (*MySyncMap[K, V]) Range

func (m *MySyncMap[K, V]) Range(f func(k K, v V) bool)

func (*MySyncMap[K, V]) Store

func (m *MySyncMap[K, V]) Store(k K, v V)

type NetType

type NetType int
const (
	MAIN_NET NetType = iota
	TEST_NET
)

type Payload

type Payload[T any] struct {
	// contains filtered or unexported fields
}

func (*Payload[T]) CloseChan

func (p *Payload[T]) CloseChan() chan struct{}

func (*Payload[T]) ErrChan

func (p *Payload[T]) ErrChan() chan error

func (*Payload[T]) ResultChan

func (p *Payload[T]) ResultChan() chan T

type PmCAccountApi added in v1.0.1

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

func (*PmCAccountApi) Do added in v1.0.1

func (api *PmCAccountApi) Do() (*PmCAccountRes, error)

func (*PmCAccountApi) RecvWindow added in v1.0.1

func (api *PmCAccountApi) RecvWindow(RecvWindow int64) *PmCAccountApi

func (*PmCAccountApi) Timestamp added in v1.0.1

func (api *PmCAccountApi) Timestamp(Timestamp int64) *PmCAccountApi

type PmCAccountBalanceApi added in v1.0.1

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

func (*PmCAccountBalanceApi) Asset added in v1.0.1

func (*PmCAccountBalanceApi) Do added in v1.0.1

func (*PmCAccountBalanceApi) RecvWindow added in v1.0.1

func (api *PmCAccountBalanceApi) RecvWindow(RecvWindow int64) *PmCAccountBalanceApi

func (*PmCAccountBalanceApi) Timestamp added in v1.0.1

func (api *PmCAccountBalanceApi) Timestamp(Timestamp int64) *PmCAccountBalanceApi

type PmCAccountBalanceReq added in v1.0.1

type PmCAccountBalanceReq struct {
	Asset      *string `json:"asset"` //NO	资产名称
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmCAccountBalanceRes added in v1.0.1

type PmCAccountBalanceRes []PmCAccountBalanceRow

type PmCAccountBalanceRow added in v1.0.1

type PmCAccountBalanceRow struct {
	Asset               string `json:"asset"`               //资产
	TotalWalletBalance  string `json:"totalWalletBalance"`  // 钱包余额 =  全仓杠杆未锁定 + 全仓杠杆锁定 + u本位合约钱包余额 + 币本位合约钱包余额
	CrossMarginAsset    string `json:"crossMarginAsset"`    // 全仓资产 = 全仓杠杆未锁定 + 全仓杠杆锁定
	CrossMarginBorrowed string `json:"crossMarginBorrowed"` // 全仓杠杆借贷
	CrossMarginFree     string `json:"crossMarginFree"`     // 全仓杠杆未锁定
	CrossMarginInterest string `json:"crossMarginInterest"` // 全仓杠杆利息
	CrossMarginLocked   string `json:"crossMarginLocked"`   //全仓杠杆锁定
	UmWalletBalance     string `json:"umWalletBalance"`     // u本位合约钱包余额
	UmUnrealizedPNL     string `json:"umUnrealizedPNL"`     // u本位未实现盈亏
	CmWalletBalance     string `json:"cmWalletBalance"`     // 币本位合约钱包余额
	CmUnrealizedPNL     string `json:"cmUnrealizedPNL"`     // 币本位未实现盈亏
	UpdateTime          int64  `json:"updateTime"`          // 更新时间
	NegativeBalance     string `json:"negativeBalance"`     // 负资产余额
}

type PmCAccountForCApi added in v1.0.1

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

func (*PmCAccountForCApi) Do added in v1.0.1

func (*PmCAccountForCApi) RecvWindow added in v1.0.1

func (api *PmCAccountForCApi) RecvWindow(RecvWindow int64) *PmCAccountForCApi

func (*PmCAccountForCApi) Timestamp added in v1.0.1

func (api *PmCAccountForCApi) Timestamp(Timestamp int64) *PmCAccountForCApi

type PmCAccountForCReq added in v1.0.1

type PmCAccountForCReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

PmCAccountForU

type PmCAccountForCRes added in v1.0.1

type PmCAccountForCRes struct {
	Assets    []PmCAccountForCResAsset    `json:"assets"`
	Positions []PmCAccountForCResPosition `json:"positions"` // 头寸,将返回所有市场symbol。
}

type PmCAccountForCResAsset added in v1.0.1

type PmCAccountForCResAsset struct {
	Asset                  string `json:"asset"`                  //资产
	CrossWalletBalance     string `json:"crossWalletBalance"`     //全仓账户余额
	CrossUnPnl             string `json:"crossUnPnl"`             // 全仓持仓未实现盈亏
	MaintMargin            string `json:"maintMargin"`            // 维持保证金
	InitialMargin          string `json:"initialMargin"`          // 当前所需起始保证金
	PositionInitialMargin  string `json:"positionInitialMargin"`  // 持仓所需起始保证金(基于最新标记价格)
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // 当前挂单所需起始保证金(基于最新标记价格)
	UpdateTime             int64  `json:"updateTime"`             //更新时间
}

type PmCAccountForCResPosition added in v1.0.1

type PmCAccountForCResPosition struct {
	//根据用户持仓模式展示持仓方向,即单向模式下只返回BOTH持仓情况,双向模式下只返回 LONG 和 SHORT 持仓情况
	Symbol                 string `json:"symbol"`                 // 交易对
	PositionAmt            string `json:"positionAmt"`            // 持仓数量
	InitialMargin          string `json:"initialMargin"`          // 当前所需起始保证金(基于最新标记价格)
	MaintMargin            string `json:"maintMargin"`            //维持保证金
	UnrealizedProfit       string `json:"unrealizedProfit"`       // 持仓未实现盈亏
	PositionInitialMargin  string `json:"positionInitialMargin"`  // 持仓所需起始保证金(基于最新标记价格)
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // 当前挂单所需起始保证金(基于最新标记价格)
	Leverage               string `json:"leverage"`               // 杠杆倍数
	PositionSide           string `json:"positionSide"`           // 持仓方向
	EntryPrice             string `json:"entryPrice"`             // 开仓均价
	MaxQty                 string `json:"maxQty"`                 // 最大下单量
	UpdateTime             int64  `json:"updateTime"`             // 更新时间
}

type PmCAccountReq added in v1.0.1

type PmCAccountReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

PmCAccount

type PmCAccountRes added in v1.0.1

type PmCAccountRes struct {
	UniMMR                   string `json:"uniMMR"`                   // 统一账户维持保证金率
	AccountEquity            string `json:"accountEquity"`            // 以USD计价的账户权益
	ActualEquity             string `json:"actualEquity"`             // 不考虑质押率的以USD计价账户权益
	AccountInitialMargin     string `json:"accountInitialMargin"`     // 当前所需起始保证金(基于最新标记价格)
	AccountMaintMargin       string `json:"accountMaintMargin"`       // 以USD计价统一账户维持保证金
	AccountStatus            string `json:"accountStatus"`            // 统一账户账户状态:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED"
	VirtualMaxWithdrawAmount string `json:"virtualMaxWithdrawAmount"` // 以USD计价的最大可转出
	TotalAvailableBalance    string `json:"totalAvailableBalance"`    // 以USD计价的可用余额
	TotalMarginOpenLoss      string `json:"totalMarginOpenLoss"`      // 以USD计价的总开仓保证金
	UpdateTime               int64  `json:"updateTime"`               // 更新时间
}

type PmCAllConditionnalOrderDeleteApi added in v1.0.1

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

func (*PmCAllConditionnalOrderDeleteApi) Do added in v1.0.1

func (*PmCAllConditionnalOrderDeleteApi) RecvWindow added in v1.0.1

func (*PmCAllConditionnalOrderDeleteApi) Symbol added in v1.0.1

func (*PmCAllConditionnalOrderDeleteApi) Timestamp added in v1.0.1

type PmCAllConditionnalOrderDeleteReq added in v1.0.1

type PmCAllConditionnalOrderDeleteReq struct {
	Symbol     *string `json:"symbol"`               //YES	交易对
	RecvWindow *int64  `json:"recvWindow,omitempty"` //NO
	Timestamp  *int64  `json:"timestamp"`            //YES
}

type PmCAllConditionnalOrderDeleteRes added in v1.0.1

type PmCAllConditionnalOrderDeleteRes BinanceErrorRes

type PmCAllOrderDeleteApi added in v1.0.1

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

func (*PmCAllOrderDeleteApi) Do added in v1.0.1

func (*PmCAllOrderDeleteApi) RecvWindow added in v1.0.1

func (api *PmCAllOrderDeleteApi) RecvWindow(RecvWindow int64) *PmCAllOrderDeleteApi

func (*PmCAllOrderDeleteApi) Symbol added in v1.0.1

func (api *PmCAllOrderDeleteApi) Symbol(Symbol string) *PmCAllOrderDeleteApi

func (*PmCAllOrderDeleteApi) Timestamp added in v1.0.1

func (api *PmCAllOrderDeleteApi) Timestamp(Timestamp int64) *PmCAllOrderDeleteApi

type PmCAllOrderDeleteReq added in v1.0.1

type PmCAllOrderDeleteReq struct {
	Symbol     *string `json:"symbol"`               //YES 交易对
	RecvWindow *int64  `json:"recvWindow,omitempty"` //NO
	Timestamp  *int64  `json:"timestamp"`            //YES
}

type PmCAllOrderDeleteRes added in v1.0.1

type PmCAllOrderDeleteRes BinanceErrorRes

type PmCAllOrdersApi added in v1.0.1

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

func (*PmCAllOrdersApi) Do added in v1.0.1

func (api *PmCAllOrdersApi) Do() (*PmCAllOrdersRes, error)

func (*PmCAllOrdersApi) EndTime added in v1.0.1

func (api *PmCAllOrdersApi) EndTime(EndTime int64) *PmCAllOrdersApi

func (*PmCAllOrdersApi) Limit added in v1.0.1

func (api *PmCAllOrdersApi) Limit(Limit int64) *PmCAllOrdersApi

func (*PmCAllOrdersApi) OrderId added in v1.0.1

func (api *PmCAllOrdersApi) OrderId(OrderId int64) *PmCAllOrdersApi

func (*PmCAllOrdersApi) Pair added in v1.0.1

func (api *PmCAllOrdersApi) Pair(Pair string) *PmCAllOrdersApi

func (*PmCAllOrdersApi) RecvWindow added in v1.0.1

func (api *PmCAllOrdersApi) RecvWindow(RecvWindow int64) *PmCAllOrdersApi

func (*PmCAllOrdersApi) StartTime added in v1.0.1

func (api *PmCAllOrdersApi) StartTime(StartTime int64) *PmCAllOrdersApi

func (*PmCAllOrdersApi) Symbol added in v1.0.1

func (api *PmCAllOrdersApi) Symbol(Symbol string) *PmCAllOrdersApi

func (*PmCAllOrdersApi) Timestamp added in v1.0.1

func (api *PmCAllOrdersApi) Timestamp(Timestamp int64) *PmCAllOrdersApi

type PmCAllOrdersReq added in v1.0.1

type PmCAllOrdersReq struct {
	Symbol     *string `json:"symbol"`    //No	交易对
	Pair       *string `json:"pair"`      //No
	OrderId    *int64  `json:"orderId"`   //No	只返回此orderID及之后的订单,缺省返回最近的订单
	StartTime  *int64  `json:"startTime"` //No	起始时间
	EndTime    *int64  `json:"endTime"`   //No	结束时间
	Limit      *int64  `json:"limit"`     //No	返回的结果集数量 默认值:500 最大值:1000
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmCAllOrdersRes added in v1.0.1

type PmCAllOrdersRes []PmCOrderOrder

type PmCApi added in v1.0.1

type PmCApi int
const (
	//账户接口
	PmCAccount        PmCApi = iota //GET接口 统一账户信息 (USER_DATA)
	PmCAccountBalance               //GET接口 统一账户余额 (USER_DATA)
	PmCAccountForC                  //GET接口 CM账户信息v2 (USER_DATA)
	PmCCommissionRate               //GET接口 (HMAC SHA256)查询用户CM手续费率 (USER_DATA)

	//交易接口
	PmCOpenOrders                 //GET接口 (HMAC SHA256)查看当前全部CM挂单(USER_DATA)
	PmCAllOrders                  //GET接口 (HMAC SHA256)查询所有CM订单(包括历史订单)(USER_DATA)
	PmCOrderPost                  //POST接口 (HMAC SHA256)CM下单(TRADE)
	PmCOrderPut                   //PUT接口 (HMAC SHA256)修改CM订单(TRADE)
	PmCOrderGet                   //GET接口 (HMAC SHA256)查询CM订单(USER_DATA)
	PmCOrderDelete                //DELETE接口 (HMAC SHA256)撤销CM订单 (TRADE)
	PmCAllOrderDelete             //DELETE接口 (HMAC SHA256)撤销全部CM订单 (TRADE)
	PmCConditionalOrderPost       //POST接口 (HMAC SHA256)CM条件单下单(TRADE)
	PmCConditionalOrderDelete     //DELETE接口 (HMAC SHA256)取消CM条件订单(TRADE)
	PmCAllConditionnalOrderDelete //DELETE接口 (HMAC SHA256)撤销全部CM条件订单(TRADE)
	PmCUserTrades                 //GET接口 (HMAC SHA256)CM账户成交历史 (USER_DATA)

	//通用接口
	PmCPing         //GET接口 测试服务器连通性
	PmCServerTime   //GET接口 获取服务器时间
	PmCExchangeInfo //GET接口 交易规则和交易对信息

	//行情接口
	PmCKlines           //K线数据
	PmCDepth            //深度信息
	PmCTrades           //最新成交
	PmCHistoricalTrades //历史成交
	PmCAggTrades        //近期成交(归集)
	PmCPremiumIndex     //最新标记价格和资金费率
	PmCFundingRate      //查询资金费率历史
	PmCFundingInfo      //查询资金费率信息
	PmCTicker24hr       //24hr价格变动情况
	PmCTickerPrice      //最新价格
	PmCTickerBookTicker //当前最优挂单
	PmCDataBasis        //基差数据

	//Ws账户推送相关接口
	PmCListenKeyPost   //生成listenKey (USER_STREAM)
	PmCListenKeyPut    //延长listenKey有效期 (USER_STREAM)
	PmCListenKeyDelete //关闭listenKey (USER_STREAM)
)

type PmCCommissionRateApi added in v1.0.1

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

func (*PmCCommissionRateApi) Do added in v1.0.1

func (*PmCCommissionRateApi) RecvWindow added in v1.0.1

func (api *PmCCommissionRateApi) RecvWindow(RecvWindow int64) *PmCCommissionRateApi

func (*PmCCommissionRateApi) Symbol added in v1.0.1

func (api *PmCCommissionRateApi) Symbol(Symbol string) *PmCCommissionRateApi

func (*PmCCommissionRateApi) Timestamp added in v1.0.1

func (api *PmCCommissionRateApi) Timestamp(Timestamp int64) *PmCCommissionRateApi

type PmCCommissionRateReq added in v1.0.1

type PmCCommissionRateReq struct {
	Symbol     *string `json:"symbol"` //Yses	交易对名称
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmCCommissionRateRes added in v1.0.1

type PmCCommissionRateRes struct {
	Symbol              string `json:"symbol"`
	MakerCommissionRate string `json:"makerCommissionRate"`
	TakerCommissionRate string `json:"takerCommissionRate"`
}

type PmCConditionalOrderDeleteApi added in v1.0.1

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

func (*PmCConditionalOrderDeleteApi) Do added in v1.0.1

func (*PmCConditionalOrderDeleteApi) NewClientStrategyId added in v1.0.1

func (api *PmCConditionalOrderDeleteApi) NewClientStrategyId(NewClientStrategyId string) *PmCConditionalOrderDeleteApi

func (*PmCConditionalOrderDeleteApi) RecvWindow added in v1.0.1

func (*PmCConditionalOrderDeleteApi) StrategyId added in v1.0.1

func (*PmCConditionalOrderDeleteApi) Symbol added in v1.0.1

func (*PmCConditionalOrderDeleteApi) Timestamp added in v1.0.1

type PmCConditionalOrderDeleteReq added in v1.0.1

type PmCConditionalOrderDeleteReq struct {
	Symbol              *string `json:"symbol"`               //YES	交易对
	StrategyId          *string `json:"strategyId"`           //NO strategyId 与 newClientStrategyId 之一必须发送
	NewClientStrategyId *string `json:"newClientStrategyId"`  //NO
	RecvWindow          *int64  `json:"recvWindow,omitempty"` //NO
	Timestamp           *int64  `json:"timestamp"`            //YES
}

type PmCConditionalOrderDeleteRes added in v1.0.1

type PmCConditionalOrderDeleteRes struct {
	NewClientStrategyId string `json:"newClientStrategyId"`
	StrategyId          int64  `json:"strategyId"`
	StrategyStatus      string `json:"strategyStatus"`
	StrategyType        string `json:"strategyType"`
	OrigQty             string `json:"origQty"`
	Price               string `json:"price"`
	ReduceOnly          bool   `json:"reduceOnly"`
	Side                string `json:"side"`
	PositionSide        string `json:"positionSide"`
	StopPrice           string `json:"stopPrice"`
	Symbol              string `json:"symbol"`
	TimeInForce         string `json:"timeInForce"`
	ActivatePrice       string `json:"activatePrice"`
	PriceRate           string `json:"priceRate"`
	UpdateTime          int64  `json:"updateTime"`
	WorkingType         string `json:"workingType"`
	PriceProtect        bool   `json:"priceProtect"`
}

type PmCConditionalOrderPostApi added in v1.0.1

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

func (*PmCConditionalOrderPostApi) ActivationPrice added in v1.0.1

func (api *PmCConditionalOrderPostApi) ActivationPrice(ActivationPrice decimal.Decimal) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) CallbackRate added in v1.0.1

func (api *PmCConditionalOrderPostApi) CallbackRate(CallbackRate decimal.Decimal) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) Do added in v1.0.1

func (*PmCConditionalOrderPostApi) NewClientStrategyId added in v1.0.1

func (api *PmCConditionalOrderPostApi) NewClientStrategyId(NewClientStrategyId string) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) PositionSide added in v1.0.1

func (api *PmCConditionalOrderPostApi) PositionSide(PositionSide string) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) Price added in v1.0.1

func (*PmCConditionalOrderPostApi) PriceProtect added in v1.0.1

func (api *PmCConditionalOrderPostApi) PriceProtect(PriceProtect string) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) Quantity added in v1.0.1

func (*PmCConditionalOrderPostApi) RecvWindow added in v1.0.1

func (api *PmCConditionalOrderPostApi) RecvWindow(RecvWindow int64) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) Side added in v1.0.1

func (*PmCConditionalOrderPostApi) StopPrice added in v1.0.1

func (*PmCConditionalOrderPostApi) StrategyType added in v1.0.1

func (api *PmCConditionalOrderPostApi) StrategyType(StrategyType string) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) Symbol added in v1.0.1

func (*PmCConditionalOrderPostApi) TimeInForce added in v1.0.1

func (api *PmCConditionalOrderPostApi) TimeInForce(TimeInForce string) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) Timestamp added in v1.0.1

func (api *PmCConditionalOrderPostApi) Timestamp(Timestamp int64) *PmCConditionalOrderPostApi

func (*PmCConditionalOrderPostApi) WorkingType added in v1.0.1

func (api *PmCConditionalOrderPostApi) WorkingType(WorkingType string) *PmCConditionalOrderPostApi

type PmCConditionalOrderPostReq added in v1.0.1

type PmCConditionalOrderPostReq struct {
	Symbol              *string          `json:"symbol"`              //YES	交易对
	Side                *string          `json:"side"`                //YES	买卖方向
	PositionSide        *string          `json:"positionSide"`        //NO	持仓方向,单向持仓模式下非必填,默认且仅可填BOTH;在双向持仓模式下必填,且仅可选择 LONG 或 SHORT
	StrategyType        *string          `json:"strategyType"`        //YES	条件单类型"STOP", "STOP_MARKET", "TAKE_PROFIT", "TAKE_PROFIT_MARKET"或"TRAILING_STOP_MARKET"
	TimeInForce         *string          `json:"timeInForce"`         //NO	订单有效期
	Quantity            *decimal.Decimal `json:"quantity"`            //NO	下单数量
	ReduceOnly          *string          `json:"reduceOnly"`          //NO	true或false; 非双开模式下默认false;双开模式下不接受此参数
	Price               *decimal.Decimal `json:"price"`               //NO	下单价格
	WorkingType         *string          `json:"workingType"`         //NO	stopPrice 触发类型: MARK_PRICE(标记价格), CONTRACT_PRICE(合约最新价). 默认 CONTRACT_PRICE
	PriceProtect        *string          `json:"priceProtect"`        //NO	条件单触发保护:"TRUE","FALSE", 默认"FALSE". 仅 STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET 需要此参数
	NewClientStrategyId *string          `json:"newClientStrategyId"` //NO	不可以重复出现在挂单中。如空缺系统会自动赋值。必须满足正则规则: ^[\.A-Z\:/a-z0-9_-]{1,32}$
	StopPrice           *decimal.Decimal `json:"stopPrice"`           //NO	Used with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders.
	ActivationPrice     *decimal.Decimal `json:"activationPrice"`     //NO	TRAILING_STOP_MARKET 单使用,默认标记价格
	CallbackRate        *decimal.Decimal `json:"callbackRate"`        //NO	TRAILING_STOP_MARKET 单使用, 最小0.1, 最大5,1代表1%
	RecvWindow          *int64           `json:"recvWindow"`          //NO
	Timestamp           *int64           `json:"timestamp"`           //YES
}

type PmCConditionalOrderPostRes added in v1.0.1

type PmCConditionalOrderPostRes struct {
	NewClientStrategyId string `json:"newClientStrategyId"`
	StrategyId          int64  `json:"strategyId"`
	StrategyStatus      string `json:"strategyStatus"`
	StrategyType        string `json:"strategyType"`
	OrigQty             string `json:"origQty"`
	Price               string `json:"price"`
	ReduceOnly          bool   `json:"reduceOnly"`
	Side                string `json:"side"`
	PositionSide        string `json:"positionSide"`
	StopPrice           string `json:"stopPrice"`
	Symbol              string `json:"symbol"`
	Pair                string `json:"pair"`
	TimeInForce         string `json:"timeInForce"`
	ActivatePrice       string `json:"activatePrice"`
	PriceRate           string `json:"priceRate"`
	BookTime            int64  `json:"bookTime"` //条件单下单时间
	UpdateTime          int64  `json:"updateTime"`
	WorkingType         string `json:"workingType"`
	PriceProtect        bool   `json:"priceProtect"`
}

type PmCListenKeyDeleteApi added in v1.0.1

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

func (*PmCListenKeyDeleteApi) Do added in v1.0.1

type PmCListenKeyDeleteReq added in v1.0.1

type PmCListenKeyDeleteReq struct{}

type PmCListenKeyDeleteRes added in v1.0.1

type PmCListenKeyDeleteRes struct{}

type PmCListenKeyPostApi added in v1.0.1

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

func (*PmCListenKeyPostApi) Do added in v1.0.1

type PmCListenKeyPostReq added in v1.0.1

type PmCListenKeyPostReq struct{}

listenKey相关

type PmCListenKeyPostRes added in v1.0.1

type PmCListenKeyPostRes struct {
	ListenKey string `json:"listenKey"`
}

type PmCListenKeyPutApi added in v1.0.1

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

func (*PmCListenKeyPutApi) Do added in v1.0.1

type PmCListenKeyPutReq added in v1.0.1

type PmCListenKeyPutReq struct{}

type PmCListenKeyPutRes added in v1.0.1

type PmCListenKeyPutRes struct{}

type PmCOpenOrdersApi added in v1.0.1

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

func (*PmCOpenOrdersApi) Do added in v1.0.1

func (api *PmCOpenOrdersApi) Do() (*PmCOpenOrdersRes, error)

func (*PmCOpenOrdersApi) Pair added in v1.0.1

func (api *PmCOpenOrdersApi) Pair(Pair string) *PmCOpenOrdersApi

func (*PmCOpenOrdersApi) RecvWindow added in v1.0.1

func (api *PmCOpenOrdersApi) RecvWindow(RecvWindow int64) *PmCOpenOrdersApi

func (*PmCOpenOrdersApi) Symbol added in v1.0.1

func (api *PmCOpenOrdersApi) Symbol(Symbol string) *PmCOpenOrdersApi

func (*PmCOpenOrdersApi) Timestamp added in v1.0.1

func (api *PmCOpenOrdersApi) Timestamp(Timestamp int64) *PmCOpenOrdersApi

type PmCOpenOrdersReq added in v1.0.1

type PmCOpenOrdersReq struct {
	Symbol     *string `json:"symbol"` //No	交易对
	Pair       *string `json:"pair"`   //No
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmCOpenOrdersRes added in v1.0.1

type PmCOpenOrdersRes []PmCOrderOrder

type PmCOrderDeleteApi added in v1.0.1

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

func (*PmCOrderDeleteApi) Do added in v1.0.1

func (*PmCOrderDeleteApi) OrderId added in v1.0.1

func (api *PmCOrderDeleteApi) OrderId(OrderId int64) *PmCOrderDeleteApi

func (*PmCOrderDeleteApi) OrigClientOrderId added in v1.0.1

func (api *PmCOrderDeleteApi) OrigClientOrderId(OrigClientOrderId string) *PmCOrderDeleteApi

func (*PmCOrderDeleteApi) RecvWindow added in v1.0.1

func (api *PmCOrderDeleteApi) RecvWindow(RecvWindow int64) *PmCOrderDeleteApi

func (*PmCOrderDeleteApi) Symbol added in v1.0.1

func (api *PmCOrderDeleteApi) Symbol(Symbol string) *PmCOrderDeleteApi

func (*PmCOrderDeleteApi) Timestamp added in v1.0.1

func (api *PmCOrderDeleteApi) Timestamp(Timestamp int64) *PmCOrderDeleteApi

type PmCOrderDeleteReq added in v1.0.1

type PmCOrderDeleteReq struct {
	Symbol            *string `json:"symbol"`                      //YES 交易对
	OrderId           *int64  `json:"orderId,omitempty"`           //NO 系统订单号
	OrigClientOrderId *string `json:"origClientOrderId,omitempty"` //NO 用户自定义的订单号
	RecvWindow        *int64  `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64  `json:"timestamp"`                   //YES
}

type PmCOrderDeleteRes added in v1.0.1

type PmCOrderDeleteRes struct {
	AvgPrice      string `json:"avgPrice"`
	ClientOrderId string `json:"clientOrderId"`
	CumQty        string `json:"cumQty"`
	CumBase       string `json:"cumBase"`
	ExecutedQty   string `json:"executedQty"`
	OrderId       int64  `json:"orderId"`
	OrigQty       string `json:"origQty"`
	Price         string `json:"price"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	Status        string `json:"status"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	UpdateTime    int64  `json:"updateTime"`
}

type PmCOrderGetApi added in v1.0.1

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

func (*PmCOrderGetApi) Do added in v1.0.1

func (api *PmCOrderGetApi) Do() (*PmCOrderGetRes, error)

func (*PmCOrderGetApi) OrderId added in v1.0.1

func (api *PmCOrderGetApi) OrderId(OrderId int64) *PmCOrderGetApi

func (*PmCOrderGetApi) OrigClientOrderId added in v1.0.1

func (api *PmCOrderGetApi) OrigClientOrderId(OrigClientOrderId string) *PmCOrderGetApi

func (*PmCOrderGetApi) RecvWindow added in v1.0.1

func (api *PmCOrderGetApi) RecvWindow(RecvWindow int64) *PmCOrderGetApi

func (*PmCOrderGetApi) Symbol added in v1.0.1

func (api *PmCOrderGetApi) Symbol(Symbol string) *PmCOrderGetApi

func (*PmCOrderGetApi) Timestamp added in v1.0.1

func (api *PmCOrderGetApi) Timestamp(Timestamp int64) *PmCOrderGetApi

type PmCOrderGetReq added in v1.0.1

type PmCOrderGetReq struct {
	Symbol            *string `json:"symbol"`                      //YES 交易对
	OrderId           *int64  `json:"orderId,omitempty"`           //NO 系统订单号
	OrigClientOrderId *string `json:"origClientOrderId,omitempty"` //NO 用户自定义的订单号
	RecvWindow        *int64  `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64  `json:"timestamp"`                   //YES
}

type PmCOrderGetRes added in v1.0.1

type PmCOrderGetRes PmCOrderOrder

type PmCOrderOrder added in v1.0.1

type PmCOrderOrder struct {
	AvgPrice      string `json:"avgPrice"`                  // 平均成交价
	ClientOrderId string `json:"clientOrderId"`             // 用户自定义的订单号
	CumBase       string `json:"cumBase"`                   // 成交数量
	ExecutedQty   string `json:"executedQty"`               // 成交量
	OrderId       int64  `gorm:"primaryKey" json:"orderId"` // 系统订单号
	OrigQty       string `json:"origQty"`                   // 原始委托数量
	OrigType      string `json:"origType"`                  // 触发前订单类型
	Price         string `json:"price"`                     // 委托价格
	ReduceOnly    bool   `json:"reduceOnly"`                // 是否仅减仓
	Side          string `json:"side"`                      // 买卖方向
	PositionSide  string `json:"positionSide"`              // 持仓方向
	Status        string `json:"status"`                    // 订单状态
	Symbol        string `json:"symbol"`                    // 交易对
	Pair          string `json:"pair"`
	Time          int64  `json:"time"`        // 订单时间
	TimeInForce   string `json:"timeInForce"` // 有效方法
	Type          string `json:"type"`        // 订单类型
	UpdateTime    int64  `json:"updateTime"`  // 更新时间
}

type PmCOrderPostApi added in v1.0.1

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

func (*PmCOrderPostApi) Do added in v1.0.1

func (api *PmCOrderPostApi) Do() (*PmCOrderPostRes, error)

func (*PmCOrderPostApi) NewClientOrderId added in v1.0.1

func (api *PmCOrderPostApi) NewClientOrderId(NewClientOrderId string) *PmCOrderPostApi

func (*PmCOrderPostApi) NewOrderRespType added in v1.0.1

func (api *PmCOrderPostApi) NewOrderRespType(NewOrderRespType string) *PmCOrderPostApi

func (*PmCOrderPostApi) PositionSide added in v1.0.1

func (api *PmCOrderPostApi) PositionSide(PositionSide string) *PmCOrderPostApi

func (*PmCOrderPostApi) Price added in v1.0.1

func (api *PmCOrderPostApi) Price(Price decimal.Decimal) *PmCOrderPostApi

func (*PmCOrderPostApi) Quantity added in v1.0.1

func (api *PmCOrderPostApi) Quantity(Quantity decimal.Decimal) *PmCOrderPostApi

func (*PmCOrderPostApi) RecvWindow added in v1.0.1

func (api *PmCOrderPostApi) RecvWindow(RecvWindow int64) *PmCOrderPostApi

func (*PmCOrderPostApi) ReduceOnly added in v1.0.1

func (api *PmCOrderPostApi) ReduceOnly(ReduceOnly string) *PmCOrderPostApi

func (*PmCOrderPostApi) Side added in v1.0.1

func (api *PmCOrderPostApi) Side(Side string) *PmCOrderPostApi

func (*PmCOrderPostApi) Symbol added in v1.0.1

func (api *PmCOrderPostApi) Symbol(Symbol string) *PmCOrderPostApi

func (*PmCOrderPostApi) TimeInForce added in v1.0.1

func (api *PmCOrderPostApi) TimeInForce(TimeInForce string) *PmCOrderPostApi

func (*PmCOrderPostApi) Timestamp added in v1.0.1

func (api *PmCOrderPostApi) Timestamp(Timestamp int64) *PmCOrderPostApi

func (*PmCOrderPostApi) Type added in v1.0.1

func (api *PmCOrderPostApi) Type(Type string) *PmCOrderPostApi

type PmCOrderPostReq added in v1.0.1

type PmCOrderPostReq struct {
	Symbol           *string          `json:"symbol"`                     //Yes	交易对
	Side             *string          `json:"side"`                       //Yes	买卖方向 SELL, BUY
	PositionSide     *string          `json:"positionSide,omitempty"`     //No	持仓方向,单向持仓模式下非必填,默认且仅可填BOTH;在双向持仓模式下必填,且仅可选择 LONG 或 SHORT
	Type             *string          `json:"type"`                       //Yes	订单类型 LIMIT, MARKET, STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET
	TimeInForce      *string          `json:"timeInForce,omitempty"`      //No	有效方法
	Quantity         *decimal.Decimal `json:"quantity,omitempty"`         //No	下单数量,使用closePosition不支持此参数。
	ReduceOnly       *string          `json:"reduceOnly,omitempty"`       //No	true, false; 非双开模式下默认false;双开模式下不接受此参数; 使用closePosition不支持此参数。
	Price            *decimal.Decimal `json:"price,omitempty"`            //No	委托价格
	NewClientOrderId *string          `json:"newClientOrderId,omitempty"` //No	用户自定义的订单号,不可以重复出现在挂单中。如空缺系统会自动赋值。必须满足正则规则 ^[\.A-Z\:/a-z0-9_-]{1,36}$
	NewOrderRespType *string          `json:"newOrderRespType,omitempty"` //No	"ACK", "RESULT", 默认 "ACK"
	RecvWindow       *int64           `json:"recvWindow,omitempty"`       //No
	Timestamp        *int64           `json:"timestamp,omitempty"`        //Yes
}

type PmCOrderPostRes added in v1.0.1

type PmCOrderPostRes struct {
	ClientOrderId string `json:"clientOrderId"` // 用户自定义的订单号
	CumQty        string `json:"cumQty"`
	CumBase       string `json:"cumBase"` // 成交数量
	ExecutedQty   string `json:"executedQty"`
	OrderId       int64  `json:"orderId"` // 系统订单号
	AvgPrice      string `json:"avgPrice"`
	OrigQty       string `json:"origQty"` // 原始委托数量
	Price         string `json:"price"`   // 委托价格
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`         // 买卖方向
	PositionSide  string `json:"positionSide"` // 持仓方向
	Status        string `json:"status"`       // 订单状态
	Symbol        string `json:"symbol"`       // 交易对
	Pair          string `json:"pair"`
	TimeInForce   string `json:"timeInForce"` // 有效方法
	Type          string `json:"type"`        // 订单类型
	UpdateTime    int64  `json:"updateTime"`  // 更新时间
}

type PmCOrderPutApi added in v1.0.1

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

func (*PmCOrderPutApi) Do added in v1.0.1

func (api *PmCOrderPutApi) Do() (*PmCOrderPutRes, error)

func (*PmCOrderPutApi) OrderId added in v1.0.1

func (api *PmCOrderPutApi) OrderId(OrderId int64) *PmCOrderPutApi

func (*PmCOrderPutApi) OrigClientOrderId added in v1.0.1

func (api *PmCOrderPutApi) OrigClientOrderId(OrigClientOrderId string) *PmCOrderPutApi

func (*PmCOrderPutApi) Price added in v1.0.1

func (api *PmCOrderPutApi) Price(Price decimal.Decimal) *PmCOrderPutApi

func (*PmCOrderPutApi) Quantity added in v1.0.1

func (api *PmCOrderPutApi) Quantity(Quantity decimal.Decimal) *PmCOrderPutApi

func (*PmCOrderPutApi) RecvWindow added in v1.0.1

func (api *PmCOrderPutApi) RecvWindow(RecvWindow int64) *PmCOrderPutApi

func (*PmCOrderPutApi) Side added in v1.0.1

func (api *PmCOrderPutApi) Side(Side string) *PmCOrderPutApi

func (*PmCOrderPutApi) Symbol added in v1.0.1

func (api *PmCOrderPutApi) Symbol(Symbol string) *PmCOrderPutApi

func (*PmCOrderPutApi) Timestamp added in v1.0.1

func (api *PmCOrderPutApi) Timestamp(Timestamp int64) *PmCOrderPutApi

type PmCOrderPutReq added in v1.0.1

type PmCOrderPutReq struct {
	OrderId           *string          `json:"orderId,omitempty"`           //NO	系统订单号
	OrigClientOrderId *string          `json:"origClientOrderId,omitempty"` //NO	用户自定义的订单号
	Symbol            *string          `json:"symbol"`                      //YES	交易对
	Side              *string          `json:"side"`                        //YES	买卖方向 SELL, BUY; side需要和原订单相同
	Quantity          *decimal.Decimal `json:"quantity"`                    //YES	下单数量,使用closePosition不支持此参数。
	Price             *decimal.Decimal `json:"price"`                       //YES	委托价格
	RecvWindow        *int64           `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64           `json:"timestamp,omitempty"`         //YES
}

type PmCOrderPutRes added in v1.0.1

type PmCOrderPutRes struct {
	OrderId       int64  `json:"orderId"`
	Symbol        string `json:"symbol"`
	Pair          string `json:"pair"`
	Status        string `json:"status"`
	ClientOrderId string `json:"clientOrderId"`
	Price         string `json:"price"`
	AvgPrice      string `json:"avgPrice"`
	OrigQty       string `json:"origQty"`
	ExecutedQty   string `json:"executedQty"`
	CumQty        string `json:"cumQty"`
	CumBase       string `json:"cumBase"`
	TimeInForce   string `json:"timeInForce"`
	Type          string `json:"type"`
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`
	PositionSide  string `json:"positionSide"`
	OrigType      string `json:"origType"`
	UpdateTime    int64  `json:"updateTime"`
}

type PmCRestClient added in v1.0.1

type PmCRestClient RestClient

func (*PmCRestClient) NewAllOrders added in v1.0.1

func (client *PmCRestClient) NewAllOrders() *PmCAllOrdersApi

binance PMC PmCAllOrders rest查询所有订单 (USER_DATA)

func (*PmCRestClient) NewOpenOrders added in v1.0.1

func (client *PmCRestClient) NewOpenOrders() *PmCOpenOrdersApi

交易接口 binance PMC PmCOpenOrders rest查询当前挂单 (USER_DATA)

func (*PmCRestClient) NewPmCAccount added in v1.0.1

func (client *PmCRestClient) NewPmCAccount() *PmCAccountApi

账户接口 binance PMC PmCAccount 统一账户信息 (USER_DATA)

func (*PmCRestClient) NewPmCAccountBalance added in v1.0.1

func (client *PmCRestClient) NewPmCAccountBalance() *PmCAccountBalanceApi

binance PMC PmCAccountBalance 统一账户余额 (USER_DATA)

func (*PmCRestClient) NewPmCAccountForC added in v1.0.1

func (client *PmCRestClient) NewPmCAccountForC() *PmCAccountForCApi

binance PMC PmCAccountForC UM账户信息v2 (USER_DATA)

func (*PmCRestClient) NewPmCAllConditionnalOrderDelete added in v1.0.1

func (client *PmCRestClient) NewPmCAllConditionnalOrderDelete() *PmCAllConditionnalOrderDeleteApi

func (*PmCRestClient) NewPmCAllOrderDelete added in v1.0.1

func (client *PmCRestClient) NewPmCAllOrderDelete() *PmCAllOrderDeleteApi

binance PMC PmCAllOrderDelete rest撤销全部订单 (TRADE)

func (*PmCRestClient) NewPmCCommissionRate added in v1.0.1

func (client *PmCRestClient) NewPmCCommissionRate() *PmCCommissionRateApi

func (*PmCRestClient) NewPmCConditionalOrderDelete added in v1.0.1

func (client *PmCRestClient) NewPmCConditionalOrderDelete() *PmCConditionalOrderDeleteApi

func (*PmCRestClient) NewPmCConditionalOrderPost added in v1.0.1

func (client *PmCRestClient) NewPmCConditionalOrderPost() *PmCConditionalOrderPostApi

func (*PmCRestClient) NewPmCListenKeyDelete added in v1.0.1

func (client *PmCRestClient) NewPmCListenKeyDelete() *PmCListenKeyDeleteApi

binance PMC PmCListenKeyDelete rest关闭listenKey (USER_STREAM)

func (*PmCRestClient) NewPmCListenKeyPost added in v1.0.1

func (client *PmCRestClient) NewPmCListenKeyPost() *PmCListenKeyPostApi

Ws账户推送相关 binance PMC PmCListenKeyPost rest生成listenKey (USER_STREAM)

func (*PmCRestClient) NewPmCListenKeyPut added in v1.0.1

func (client *PmCRestClient) NewPmCListenKeyPut() *PmCListenKeyPutApi

binance PMC PmCListenKeyPut rest延长listenKey有效期 (USER_STREAM)

func (*PmCRestClient) NewPmCOrderDelete added in v1.0.1

func (client *PmCRestClient) NewPmCOrderDelete() *PmCOrderDeleteApi

binance PMC PmCOrderDelete rest撤销订单 (TRADE)

func (*PmCRestClient) NewPmCOrderGet added in v1.0.1

func (client *PmCRestClient) NewPmCOrderGet() *PmCOrderGetApi

binance PMC PmCOrderGet rest查询订单 (USER_DATA)

func (*PmCRestClient) NewPmCOrderPost added in v1.0.1

func (client *PmCRestClient) NewPmCOrderPost() *PmCOrderPostApi

binance PMC PmCOrderPost rest下单 (TRADE)

func (*PmCRestClient) NewPmCOrderPut added in v1.0.1

func (client *PmCRestClient) NewPmCOrderPut() *PmCOrderPutApi

binance PMC PmCOrderPut rest修改订单 (TRADE)

func (*PmCRestClient) NewPmCUserTrades added in v1.0.1

func (client *PmCRestClient) NewPmCUserTrades() *PmCUserTradesApi

type PmCUserTradesApi added in v1.0.1

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

func (*PmCUserTradesApi) Do added in v1.0.1

func (api *PmCUserTradesApi) Do() (*PmCUserTradesRes, error)

func (*PmCUserTradesApi) EndTime added in v1.0.1

func (api *PmCUserTradesApi) EndTime(EndTime int64) *PmCUserTradesApi

func (*PmCUserTradesApi) FromId added in v1.0.1

func (api *PmCUserTradesApi) FromId(FromId int64) *PmCUserTradesApi

func (*PmCUserTradesApi) Limit added in v1.0.1

func (api *PmCUserTradesApi) Limit(Limit int64) *PmCUserTradesApi

func (*PmCUserTradesApi) Pair added in v1.0.1

func (api *PmCUserTradesApi) Pair(Pair string) *PmCUserTradesApi

func (*PmCUserTradesApi) RecvWindow added in v1.0.1

func (api *PmCUserTradesApi) RecvWindow(RecvWindow int64) *PmCUserTradesApi

func (*PmCUserTradesApi) StartTime added in v1.0.1

func (api *PmCUserTradesApi) StartTime(StartTime int64) *PmCUserTradesApi

func (*PmCUserTradesApi) Symbol added in v1.0.1

func (api *PmCUserTradesApi) Symbol(Symbol string) *PmCUserTradesApi

func (*PmCUserTradesApi) Timestamp added in v1.0.1

func (api *PmCUserTradesApi) Timestamp(Timestamp int64) *PmCUserTradesApi

type PmCUserTradesOrder added in v1.0.1

type PmCUserTradesOrder struct {
	Symbol          string `json:"symbol"`
	Id              int64  `json:"id"`
	OrderId         int64  `json:"orderId"`
	Pair            string `json:"pair"`
	Side            string `json:"side"`
	Price           string `json:"price"`
	Qty             string `json:"qty"`
	RealizedPnl     string `json:"realizedPnl"`
	MarginAsset     string `json:"marginAsset"`
	BaseQty         string `json:"baseQty"`
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
	Time            int64  `json:"time"`
	PositionSide    string `json:"positionSide"`
	Buyer           bool   `json:"buyer"`
	Maker           bool   `json:"maker"`
}

type PmCUserTradesReq added in v1.0.1

type PmCUserTradesReq struct {
	Symbol     *string `json:"symbol"`     //YES	交易对
	Pair       *string `json:"pair"`       //NO
	StartTime  *int64  `json:"startTime"`  //NO
	EndTime    *int64  `json:"endTime"`    //NO
	FromId     *int64  `json:"fromId"`     //NO 返回该fromId及之后的成交,缺省返回最近的成交
	Limit      *int64  `json:"limit"`      //NO 返回的结果集数量 默认值:50 最大值:1000
	RecvWindow *int64  `json:"recvWindow"` //NO
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type PmCUserTradesRes added in v1.0.1

type PmCUserTradesRes []PmCUserTradesOrder

type PmCWsStreamClient added in v1.0.1

type PmCWsStreamClient struct {
	WsStreamClient
	// contains filtered or unexported fields
}

func (*PmCWsStreamClient) Close added in v1.0.1

func (ws *PmCWsStreamClient) Close() error

func (*PmCWsStreamClient) ConvertToAccountWs added in v1.0.1

func (ws *PmCWsStreamClient) ConvertToAccountWs(apiKey string, apiSecret string) (*PmCWsStreamClient, error)

func (*PmCWsStreamClient) CreatePayload added in v1.0.1

func (ws *PmCWsStreamClient) CreatePayload() (*WsPmCPayload, error)

type PmMAccountApi added in v1.0.1

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

func (*PmMAccountApi) Do added in v1.0.1

func (api *PmMAccountApi) Do() (*PmMAccountRes, error)

func (*PmMAccountApi) RecvWindow added in v1.0.1

func (api *PmMAccountApi) RecvWindow(RecvWindow int64) *PmMAccountApi

func (*PmMAccountApi) Timestamp added in v1.0.1

func (api *PmMAccountApi) Timestamp(Timestamp int64) *PmMAccountApi

type PmMAccountBalanceApi added in v1.0.1

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

func (*PmMAccountBalanceApi) Asset added in v1.0.1

func (*PmMAccountBalanceApi) Do added in v1.0.1

func (*PmMAccountBalanceApi) RecvWindow added in v1.0.1

func (api *PmMAccountBalanceApi) RecvWindow(RecvWindow int64) *PmMAccountBalanceApi

func (*PmMAccountBalanceApi) Timestamp added in v1.0.1

func (api *PmMAccountBalanceApi) Timestamp(Timestamp int64) *PmMAccountBalanceApi

type PmMAccountBalanceReq added in v1.0.1

type PmMAccountBalanceReq struct {
	Asset      *string `json:"asset"` //NO	资产名称
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmMAccountBalanceRes added in v1.0.1

type PmMAccountBalanceRes []PmMAccountBalanceRow

type PmMAccountBalanceRow added in v1.0.1

type PmMAccountBalanceRow struct {
	Asset               string `json:"asset"`               //资产
	TotalWalletBalance  string `json:"totalWalletBalance"`  // 钱包余额 =  全仓杠杆未锁定 + 全仓杠杆锁定 + u本位合约钱包余额 + 币本位合约钱包余额
	CrossMarginAsset    string `json:"crossMarginAsset"`    // 全仓资产 = 全仓杠杆未锁定 + 全仓杠杆锁定
	CrossMarginBorrowed string `json:"crossMarginBorrowed"` // 全仓杠杆借贷
	CrossMarginFree     string `json:"crossMarginFree"`     // 全仓杠杆未锁定
	CrossMarginInterest string `json:"crossMarginInterest"` // 全仓杠杆利息
	CrossMarginLocked   string `json:"crossMarginLocked"`   //全仓杠杆锁定
	UmWalletBalance     string `json:"umWalletBalance"`     // u本位合约钱包余额
	UmUnrealizedPNL     string `json:"umUnrealizedPNL"`     // u本位未实现盈亏
	CmWalletBalance     string `json:"cmWalletBalance"`     // 币本位合约钱包余额
	CmUnrealizedPNL     string `json:"cmUnrealizedPNL"`     // 币本位未实现盈亏
	UpdateTime          int64  `json:"updateTime"`          // 更新时间
	NegativeBalance     string `json:"negativeBalance"`     // 负资产余额
}

type PmMAccountReq added in v1.0.1

type PmMAccountReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

PmMAccount

type PmMAccountRes added in v1.0.1

type PmMAccountRes struct {
	UniMMR                   string `json:"uniMMR"`                   // 统一账户维持保证金率
	AccountEquity            string `json:"accountEquity"`            // 以USD计价的账户权益
	ActualEquity             string `json:"actualEquity"`             // 不考虑质押率的以USD计价账户权益
	AccountInitialMargin     string `json:"accountInitialMargin"`     // 当前所需起始保证金(基于最新标记价格)
	AccountMaintMargin       string `json:"accountMaintMargin"`       // 以USD计价统一账户维持保证金
	AccountStatus            string `json:"accountStatus"`            // 统一账户账户状态:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED"
	VirtualMaxWithdrawAmount string `json:"virtualMaxWithdrawAmount"` // 以USD计价的最大可转出
	TotalAvailableBalance    string `json:"totalAvailableBalance"`    // 以USD计价的可用余额
	TotalMarginOpenLoss      string `json:"totalMarginOpenLoss"`      // 以USD计价的总开仓保证金
	UpdateTime               int64  `json:"updateTime"`               // 更新时间
}

type PmMApi added in v1.0.1

type PmMApi int
const (

	//杠杆账户接口
	PmMAccount               PmMApi = iota //GET接口 统一账户信息 (USER_DATA)
	PmMAccountBalance                      //GET接口 统一账户余额 (USER_DATA)	PmMMarginAccount                       //GET接口 查询全仓杠杆账户详情 (USER_DATA)
	PmMMarginMaxBorrowable                 //GET接口 查询账户最大可借贷额度(USER_DATA)
	PmMMarginMaxTransferable               //GET接口 查询最大可转出额 (USER_DATA)
	PmMMarginInterestHistory               //GET接口 获取利息历史 (USER_DATA)
	//杠杆订单接口
	PmMMarginOrderGet    //GET接口 查询杠杆账户订单 (USER_DATA)
	PmMMarginOrderPost   //POST接口 杠杆账户下单 (TRADE)
	PmMMarginOrderDelete //DELETE接口 撤销订单 (TRADE)
	PmMMarginAllOrders   //GET接口 查询杠杆账户所有订单 (USER_DATA)
	PmMMarginOpenOrders  //GET接口 查询杠杆账户挂单记录 (USER_DATA)

	PmMMarginOCOOrderGet    //GET接口 查询杠杆账户OCO订单 (USER_DATA)
	PmMMarginOCOOrderPost   //POST接口 杠杆账户OCO订单 (TRADE)
	PmMMarginOCOOrderDelete //DELETE接口 撤销OCO订单 (TRADE)
	PmMMarginOCOAllOrders   //GET接口 查询特定杠杆账户所有 OCO (USER_DATA)
	PmMMarginOCOOpenOrders  //GET接口 查询杠杆账户 OCO 挂单 (USER_DATA)

	//通用接口
	PmMPing         //GET接口 测试服务器连通性
	PmMServerTime   //GET接口 获取服务器时间
	PmMExchangeInfo //GET接口 获取交易规则和交易对信息。

	//行情接口
	PmMKlines           //GET接口 K线数据
	PmMTickerPrice      //GET接口 获取交易对最新价格
	PmMDepth            //GET接口 获取深度信息
	PmMTrades           //GET接口 近期成交列表
	PmMHistoricalTrades //GET接口 历史成交记录
	PmMAggTrades        //GET接口 近期成交(归集)
	PmMAvgPrice         //GET接口 当前平均价格
	PmMUiKlines         //GET接口 UIK线数据
	PmMTicker24hr       //GET接口 24hr 价格变动情况
	PmMTickerBookTicker //GET接口 当前最优挂单
	PmMTicker           //GET接口 滚动窗口价格变动统计

	PmMListenKeyPost   //POST接口   生成listenKey(USER_STREAM)
	PmMListenKeyPut    //PUT接口    延长listenKey有效期(USER_STREAM)
	PmMListenKeyDelete //DELETE接口 关闭listenKey(USER_STREAM)

)

type PmMListenKeyDeleteApi added in v1.0.1

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

func (*PmMListenKeyDeleteApi) Do added in v1.0.1

type PmMListenKeyDeleteReq added in v1.0.1

type PmMListenKeyDeleteReq struct{}

type PmMListenKeyDeleteRes added in v1.0.1

type PmMListenKeyDeleteRes struct{}

type PmMListenKeyPostApi added in v1.0.1

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

func (*PmMListenKeyPostApi) Do added in v1.0.1

type PmMListenKeyPostReq added in v1.0.1

type PmMListenKeyPostReq struct{}

listenKey相关

type PmMListenKeyPostRes added in v1.0.1

type PmMListenKeyPostRes struct {
	ListenKey string `json:"listenKey"`
}

type PmMListenKeyPutApi added in v1.0.1

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

func (*PmMListenKeyPutApi) Do added in v1.0.1

type PmMListenKeyPutReq added in v1.0.1

type PmMListenKeyPutReq struct{}

type PmMListenKeyPutRes added in v1.0.1

type PmMListenKeyPutRes struct{}

type PmMMarginAllOrdersApi added in v1.0.1

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

func (*PmMMarginAllOrdersApi) Do added in v1.0.1

func (*PmMMarginAllOrdersApi) EndTime added in v1.0.1

func (api *PmMMarginAllOrdersApi) EndTime(EndTime int64) *PmMMarginAllOrdersApi

func (*PmMMarginAllOrdersApi) Limit added in v1.0.1

func (*PmMMarginAllOrdersApi) OrderId added in v1.0.1

func (api *PmMMarginAllOrdersApi) OrderId(OrderId int64) *PmMMarginAllOrdersApi

func (*PmMMarginAllOrdersApi) RecvWindow added in v1.0.1

func (api *PmMMarginAllOrdersApi) RecvWindow(RecvWindow int64) *PmMMarginAllOrdersApi

func (*PmMMarginAllOrdersApi) StartTime added in v1.0.1

func (api *PmMMarginAllOrdersApi) StartTime(StartTime int64) *PmMMarginAllOrdersApi

func (*PmMMarginAllOrdersApi) Symbol added in v1.0.1

func (api *PmMMarginAllOrdersApi) Symbol(Symbol string) *PmMMarginAllOrdersApi

func (*PmMMarginAllOrdersApi) Timestamp added in v1.0.1

func (api *PmMMarginAllOrdersApi) Timestamp(Timestamp int64) *PmMMarginAllOrdersApi

type PmMMarginAllOrdersReq added in v1.0.1

type PmMMarginAllOrdersReq struct {
	Symbol     *string `json:"symbol"`     //YES
	OrderId    *int64  `json:"orderId"`    //NO
	StartTime  *int64  `json:"startTime"`  //NO
	EndTime    *int64  `json:"endTime"`    //NO
	Limit      *int64  `json:"limit"`      //NO	默认 500;最大500.
	RecvWindow *int64  `json:"recvWindow"` //NO	赋值不能大于 60000
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type PmMMarginAllOrdersRes added in v1.0.1

type PmMMarginAllOrdersRes []PmMMarginOrder

type PmMMarginInterestHistoryApi added in v1.0.1

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

func (*PmMMarginInterestHistoryApi) Archived added in v1.0.1

func (*PmMMarginInterestHistoryApi) Asset added in v1.0.1

func (*PmMMarginInterestHistoryApi) Current added in v1.0.1

func (*PmMMarginInterestHistoryApi) Do added in v1.0.1

func (*PmMMarginInterestHistoryApi) EndTime added in v1.0.1

func (*PmMMarginInterestHistoryApi) RecvWindow added in v1.0.1

func (api *PmMMarginInterestHistoryApi) RecvWindow(RecvWindow int64) *PmMMarginInterestHistoryApi

func (*PmMMarginInterestHistoryApi) Size added in v1.0.1

func (*PmMMarginInterestHistoryApi) StartTime added in v1.0.1

func (*PmMMarginInterestHistoryApi) Timestamp added in v1.0.1

type PmMMarginInterestHistoryReq added in v1.0.1

type PmMMarginInterestHistoryReq struct {
	Asset      *string `json:"asset"` //NO
	StartTime  *int64  `json:"startTime"`
	EndTime    *int64  `json:"endTime"`
	Current    *int64  `json:"current"`  //当前查询页。 开始值 1. 默认:1
	Size       *int64  `json:"size"`     //默认:10 最大:100
	Archived   *string `json:"archived"` //默认: false. 查询6个月以前的数据,需要设为 true
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmMMarginInterestHistoryRes added in v1.0.1

type PmMMarginInterestHistoryRes struct {
	Rows  []PmMMarginInterestHistoryRow `json:"rows"`
	Total int                           `json:"total"`
}

type PmMMarginInterestHistoryRow added in v1.0.1

type PmMMarginInterestHistoryRow struct {
	TxId                int64  `json:"txId"`
	InterestAccuredTime int64  `json:"interestAccuredTime"`
	RawAsset            string `json:"rawAsset"`
	Principal           string `json:"principal"`
	Interest            string `json:"interest"`
	InterestRate        string `json:"interestRate"`
	Type                string `json:"type"`
}

type PmMMarginMaxBorrowableApi added in v1.0.1

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

func (*PmMMarginMaxBorrowableApi) Asset added in v1.0.1

func (*PmMMarginMaxBorrowableApi) Do added in v1.0.1

func (*PmMMarginMaxBorrowableApi) RecvWindow added in v1.0.1

func (api *PmMMarginMaxBorrowableApi) RecvWindow(RecvWindow int64) *PmMMarginMaxBorrowableApi

func (*PmMMarginMaxBorrowableApi) Timestamp added in v1.0.1

func (api *PmMMarginMaxBorrowableApi) Timestamp(Timestamp int64) *PmMMarginMaxBorrowableApi

type PmMMarginMaxBorrowableReq added in v1.0.1

type PmMMarginMaxBorrowableReq struct {
	Asset      *string `json:"asset"` //YES
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmMMarginMaxBorrowableRes added in v1.0.1

type PmMMarginMaxBorrowableRes struct {
	Amount      string `json:"amount"`      //系统可借充足情况下用户账户当前最大可借额度
	BorrowLimit string `json:"borrowLimit"` //平台限制的用户当前等级可以借的额度
}

type PmMMarginMaxTransferableApi added in v1.0.1

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

func (*PmMMarginMaxTransferableApi) Asset added in v1.0.1

func (*PmMMarginMaxTransferableApi) Do added in v1.0.1

func (*PmMMarginMaxTransferableApi) RecvWindow added in v1.0.1

func (api *PmMMarginMaxTransferableApi) RecvWindow(RecvWindow int64) *PmMMarginMaxTransferableApi

func (*PmMMarginMaxTransferableApi) Timestamp added in v1.0.1

type PmMMarginMaxTransferableReq added in v1.0.1

type PmMMarginMaxTransferableReq struct {
	Asset      *string `json:"asset"` //YES
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmMMarginMaxTransferableRes added in v1.0.1

type PmMMarginMaxTransferableRes struct {
	Anount string `json:"anount"`
}

type PmMMarginOCOAllOrdersApi added in v1.0.1

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

func (*PmMMarginOCOAllOrdersApi) Do added in v1.0.1

func (*PmMMarginOCOAllOrdersApi) EndTime added in v1.0.1

func (*PmMMarginOCOAllOrdersApi) FromId added in v1.0.1

func (*PmMMarginOCOAllOrdersApi) Limit added in v1.0.1

func (*PmMMarginOCOAllOrdersApi) RecvWindow added in v1.0.1

func (api *PmMMarginOCOAllOrdersApi) RecvWindow(RecvWindow int64) *PmMMarginOCOAllOrdersApi

func (*PmMMarginOCOAllOrdersApi) StartTime added in v1.0.1

func (api *PmMMarginOCOAllOrdersApi) StartTime(StartTime int64) *PmMMarginOCOAllOrdersApi

func (*PmMMarginOCOAllOrdersApi) Timestamp added in v1.0.1

func (api *PmMMarginOCOAllOrdersApi) Timestamp(Timestamp int64) *PmMMarginOCOAllOrdersApi

type PmMMarginOCOAllOrdersReq added in v1.0.1

type PmMMarginOCOAllOrdersReq struct {
	FromId     *int64 `json:"fromId"`     //NO	提供该项后, startTime 和 endTime 都不可提供
	StartTime  *int64 `json:"startTime"`  //NO
	EndTime    *int64 `json:"endTime"`    //NO
	Limit      *int64 `json:"limit"`      //NO	默认 500;最大500.
	RecvWindow *int64 `json:"recvWindow"` //NO	赋值不能大于 60000
	Timestamp  *int64 `json:"timestamp"`  //YES
}

type PmMMarginOCOAllOrdersRes added in v1.0.1

type PmMMarginOCOAllOrdersRes []PmMMarginOCOOrderGetRes

type PmMMarginOCOOpenOrdersApi added in v1.0.1

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

func (*PmMMarginOCOOpenOrdersApi) Do added in v1.0.1

func (*PmMMarginOCOOpenOrdersApi) RecvWindow added in v1.0.1

func (api *PmMMarginOCOOpenOrdersApi) RecvWindow(RecvWindow int64) *PmMMarginOCOOpenOrdersApi

func (*PmMMarginOCOOpenOrdersApi) Timestamp added in v1.0.1

func (api *PmMMarginOCOOpenOrdersApi) Timestamp(Timestamp int64) *PmMMarginOCOOpenOrdersApi

type PmMMarginOCOOpenOrdersReq added in v1.0.1

type PmMMarginOCOOpenOrdersReq struct {
	RecvWindow *int64 `json:"recvWindow"` //NO	赋值不能大于 60000
	Timestamp  *int64 `json:"timestamp"`  //YES
}

type PmMMarginOCOOpenOrdersRes added in v1.0.1

type PmMMarginOCOOpenOrdersRes []PmMMarginOCOOrderGetRes

type PmMMarginOCOOrderDeleteApi added in v1.0.1

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

func (*PmMMarginOCOOrderDeleteApi) Do added in v1.0.1

func (*PmMMarginOCOOrderDeleteApi) ListClientOrderId added in v1.0.1

func (api *PmMMarginOCOOrderDeleteApi) ListClientOrderId(ListClientOrderId string) *PmMMarginOCOOrderDeleteApi

func (*PmMMarginOCOOrderDeleteApi) NewClientOrderId added in v1.0.1

func (api *PmMMarginOCOOrderDeleteApi) NewClientOrderId(NewClientOrderId string) *PmMMarginOCOOrderDeleteApi

func (*PmMMarginOCOOrderDeleteApi) OrderListId added in v1.0.1

func (api *PmMMarginOCOOrderDeleteApi) OrderListId(OrderListId int64) *PmMMarginOCOOrderDeleteApi

func (*PmMMarginOCOOrderDeleteApi) RecvWindow added in v1.0.1

func (api *PmMMarginOCOOrderDeleteApi) RecvWindow(RecvWindow int64) *PmMMarginOCOOrderDeleteApi

func (*PmMMarginOCOOrderDeleteApi) Symbol added in v1.0.1

func (*PmMMarginOCOOrderDeleteApi) Timestamp added in v1.0.1

func (api *PmMMarginOCOOrderDeleteApi) Timestamp(Timestamp int64) *PmMMarginOCOOrderDeleteApi

type PmMMarginOCOOrderDeleteReq added in v1.0.1

type PmMMarginOCOOrderDeleteReq struct {
	Symbol            *string `json:"symbol"`            //YES
	OrderListId       *int64  `json:"orderListId"`       //NO	orderListId 或 listClientOrderId 必须被提供
	ListClientOrderId *string `json:"listClientOrderId"` //NO	orderListId 或 listClientOrderId 必须被提供
	NewClientOrderId  *string `json:"newClientOrderId"`  //NO	用户自定义的本次撤销操作的ID(注意不是被撤销的订单的自定义ID)。如无指定会自动赋值
	RecvWindow        *int64  `json:"recvWindow"`        //NO	赋值不能超过 60000
	Timestamp         *int64  `json:"timestamp"`         //YES
}

type PmMMarginOCOOrderDeleteRes added in v1.0.1

type PmMMarginOCOOrderDeleteRes struct {
	OrderListId       int64                     `json:"orderListId"`
	ContingencyType   string                    `json:"contingencyType"`
	ListStatusType    string                    `json:"listStatusType"`
	ListOrderStatus   string                    `json:"listOrderStatus"`
	ListClientOrderId string                    `json:"listClientOrderId"`
	TransactionTime   int64                     `json:"transactionTime"`
	Symbol            string                    `json:"symbol"`
	Orders            []PmPOCOOrder             `json:"orders"`
	OrderReports      []PmPOCODeleteOrderReport `json:"orderReports"`
}

type PmMMarginOCOOrderGetApi added in v1.0.1

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

func (*PmMMarginOCOOrderGetApi) Do added in v1.0.1

func (*PmMMarginOCOOrderGetApi) OrderListId added in v1.0.1

func (api *PmMMarginOCOOrderGetApi) OrderListId(OrderListId int64) *PmMMarginOCOOrderGetApi

func (*PmMMarginOCOOrderGetApi) OrigClientOrderId added in v1.0.1

func (api *PmMMarginOCOOrderGetApi) OrigClientOrderId(OrigClientOrderId string) *PmMMarginOCOOrderGetApi

func (*PmMMarginOCOOrderGetApi) RecvWindow added in v1.0.1

func (api *PmMMarginOCOOrderGetApi) RecvWindow(RecvWindow int64) *PmMMarginOCOOrderGetApi

func (*PmMMarginOCOOrderGetApi) Timestamp added in v1.0.1

func (api *PmMMarginOCOOrderGetApi) Timestamp(Timestamp int64) *PmMMarginOCOOrderGetApi

type PmMMarginOCOOrderGetReq added in v1.0.1

type PmMMarginOCOOrderGetReq struct {
	OrderListId       *int64  `json:"orderListId"`       //NO	orderListId 或 listClientOrderId 必须被提供
	OrigClientOrderId *string `json:"origClientOrderId"` //NO	orderListId 或 listClientOrderId 必须被提供
	RecvWindow        *int64  `json:"recvWindow"`        //NO	赋值不能大于 60000
	Timestamp         *int64  `json:"timestamp"`         //YES
}

type PmMMarginOCOOrderGetRes added in v1.0.1

type PmMMarginOCOOrderGetRes struct {
	OrderListId       int64         `json:"orderListId"`
	ContingencyType   string        `json:"contingencyType"`
	ListStatusType    string        `json:"listStatusType"`
	ListOrderStatus   string        `json:"listOrderStatus"`
	ListClientOrderId string        `json:"listClientOrderId"`
	TransactionTime   int64         `json:"transactionTime"`
	Symbol            string        `json:"symbol"`
	Orders            []PmPOCOOrder `json:"orders"`
}

type PmMMarginOCOOrderPostApi added in v1.0.1

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

func (*PmMMarginOCOOrderPostApi) Do added in v1.0.1

func (*PmMMarginOCOOrderPostApi) LimitClientOrderId added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) LimitClientOrderId(LimitClientOrderId string) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) LimitIcebergQty added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) LimitIcebergQty(LimitIcebergQty decimal.Decimal) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) ListClientOrderId added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) ListClientOrderId(ListClientOrderId string) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) NewOrderRespType added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) NewOrderRespType(NewOrderRespType string) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) Price added in v1.0.1

func (*PmMMarginOCOOrderPostApi) Quantity added in v1.0.1

func (*PmMMarginOCOOrderPostApi) RecvWindow added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) RecvWindow(RecvWindow int64) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) Side added in v1.0.1

func (*PmMMarginOCOOrderPostApi) SideEffectType added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) SideEffectType(SideEffectType string) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) StopClientOrderId added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) StopClientOrderId(StopClientOrderId string) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) StopIcebergQty added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) StopIcebergQty(StopIcebergQty decimal.Decimal) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) StopLimitPrice added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) StopLimitPrice(StopLimitPrice decimal.Decimal) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) StopLimitTimeInForce added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) StopLimitTimeInForce(StopLimitTimeInForce string) *PmMMarginOCOOrderPostApi

func (*PmMMarginOCOOrderPostApi) StopPrice added in v1.0.1

func (*PmMMarginOCOOrderPostApi) Symbol added in v1.0.1

func (*PmMMarginOCOOrderPostApi) Timestamp added in v1.0.1

func (api *PmMMarginOCOOrderPostApi) Timestamp(Timestamp int64) *PmMMarginOCOOrderPostApi

type PmMMarginOCOOrderPostReq added in v1.0.1

type PmMMarginOCOOrderPostReq struct {
	Symbol               *string          `json:"symbol"`               //YES	交易对
	ListClientOrderId    *string          `json:"listClientOrderId"`    //NO	整个 orderList 的唯一 ID
	Side                 *string          `json:"side"`                 //YES	详见枚举定义:订单方向
	Quantity             *decimal.Decimal `json:"quantity"`             //YES
	LimitClientOrderId   *string          `json:"limitClientOrderId"`   //NO	限价单的唯一 ID
	Price                *decimal.Decimal `json:"price"`                //YES
	LimitIcebergQty      *decimal.Decimal `json:"limitIcebergQty"`      //NO
	StopClientOrderId    *string          `json:"stopClientOrderId"`    //NO	止损/止损限价单的唯一 ID
	StopPrice            *decimal.Decimal `json:"stopPrice"`            //YES
	StopLimitPrice       *decimal.Decimal `json:"stopLimitPrice"`       //NO	如果提供,须配合提交stopLimitTimeInForce
	StopIcebergQty       *decimal.Decimal `json:"stopIcebergQty"`       //NO
	StopLimitTimeInForce *string          `json:"stopLimitTimeInForce"` //NO	有效值 GTC/FOK/IOC
	NewOrderRespType     *string          `json:"newOrderRespType"`     //NO	详见枚举定义:订单返回类型
	SideEffectType       *string          `json:"sideEffectType"`       //NO	NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY; 默认为 NO_SIDE_EFFECT
	RecvWindow           *int64           `json:"recvWindow"`           //NO	不能大于 60000
	Timestamp            *int64           `json:"timestamp"`            //YES
}

type PmMMarginOCOOrderPostRes added in v1.0.1

type PmMMarginOCOOrderPostRes struct {
	OrderListId           int64               `json:"orderListId"`
	ContingencyType       string              `json:"contingencyType"`
	ListStatusType        string              `json:"listStatusType"`
	ListOrderStatus       string              `json:"listOrderStatus"`
	ListClientOrderId     string              `json:"listClientOrderId"`
	TransactionTime       int64               `json:"transactionTime"`
	Symbol                string              `json:"symbol"`
	MarginBuyBorrowAmount string              `json:"marginBuyBorrowAmount"` // 下单后没有发生借款则不返回该字段
	MarginBuyBorrowAsset  string              `json:"marginBuyBorrowAsset"`  // 下单后没有发生借款则不返回该字段
	Orders                []PmPOCOOrder       `json:"orders"`
	OrderReports          []PmPOCOOrderReport `json:"orderReports"`
}

type PmMMarginOpenOrdersApi added in v1.0.1

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

func (*PmMMarginOpenOrdersApi) Do added in v1.0.1

func (*PmMMarginOpenOrdersApi) RecvWindow added in v1.0.1

func (api *PmMMarginOpenOrdersApi) RecvWindow(RecvWindow int64) *PmMMarginOpenOrdersApi

func (*PmMMarginOpenOrdersApi) Symbol added in v1.0.1

func (*PmMMarginOpenOrdersApi) Timestamp added in v1.0.1

func (api *PmMMarginOpenOrdersApi) Timestamp(Timestamp int64) *PmMMarginOpenOrdersApi

type PmMMarginOpenOrdersReq added in v1.0.1

type PmMMarginOpenOrdersReq struct {
	Symbol     *string `json:"symbol"`     //YES
	RecvWindow *int64  `json:"recvWindow"` //NO	赋值不能大于 60000
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type PmMMarginOpenOrdersRes added in v1.0.1

type PmMMarginOpenOrdersRes []PmMMarginOrder

type PmMMarginOrder added in v1.0.1

type PmMMarginOrder struct {
	ClientOrderId           string `json:"clientOrderId"`             // 用户自定义的订单号
	CummulativeQuoteQty     string `json:"cummulativeQuoteQty"`       // 成交金额
	ExecutedQty             string `json:"executedQty"`               // 成交量
	IcebergQty              string `json:"icebergQty"`                // 冰山数量
	IsWorking               bool   `json:"isWorking"`                 // 是否生效
	OrderId                 int64  `gorm:"primaryKey" json:"orderId"` // 系统订单号
	OrigQty                 string `json:"origQty"`                   // 原始委托数量
	Price                   string `json:"price"`                     // 委托价格
	Side                    string `json:"side"`                      // 买卖方向
	Status                  string `json:"status"`                    // 订单状态
	StopPrice               string `json:"stopPrice"`                 // 触发价格
	Symbol                  string `json:"symbol"`                    // 交易对
	Time                    int64  `json:"time"`                      // 订单时间
	TimeInForce             string `json:"timeInForce"`               // 有效方法
	Type                    string `json:"type"`                      // 订单类型
	UpdateTime              int64  `json:"updateTime"`                // 更新时间
	AccountId               int64  `json:"accountId"`                 // 账户ID
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`   // 是否开启条件单触发保护
	PreventedMatchId        string `json:"preventedMatchId"`          // 触发条件单的订单号
	PreventedQuantity       string `json:"preventedQuantity"`         // 触发条件单的成交量
}

type PmMMarginOrderDeleteApi added in v1.0.1

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

func (*PmMMarginOrderDeleteApi) Do added in v1.0.1

func (*PmMMarginOrderDeleteApi) NewClientOrderId added in v1.0.1

func (api *PmMMarginOrderDeleteApi) NewClientOrderId(NewClientOrderId string) *PmMMarginOrderDeleteApi

func (*PmMMarginOrderDeleteApi) OrderId added in v1.0.1

func (api *PmMMarginOrderDeleteApi) OrderId(OrderId int64) *PmMMarginOrderDeleteApi

func (*PmMMarginOrderDeleteApi) OrigClientOrderId added in v1.0.1

func (api *PmMMarginOrderDeleteApi) OrigClientOrderId(OrigClientOrderId int64) *PmMMarginOrderDeleteApi

func (*PmMMarginOrderDeleteApi) RecvWindow added in v1.0.1

func (api *PmMMarginOrderDeleteApi) RecvWindow(RecvWindow int64) *PmMMarginOrderDeleteApi

func (*PmMMarginOrderDeleteApi) Symbol added in v1.0.1

func (*PmMMarginOrderDeleteApi) Timestamp added in v1.0.1

func (api *PmMMarginOrderDeleteApi) Timestamp(Timestamp int64) *PmMMarginOrderDeleteApi

type PmMMarginOrderDeleteReq added in v1.0.1

type PmMMarginOrderDeleteReq struct {
	Symbol            *string `json:"symbol"`            //YES	交易对
	OrderId           *int64  `json:"orderId"`           //NO	订单ID
	OrigClientOrderId *int64  `json:"origClientOrderId"` //NO  必须发送 orderId 或 origClientOrderId 其中一个
	NewClientOrderId  *string `json:"newClientOrderId"`  //NO		用于唯一识别此撤销订单,默认自动生成。
	RecvWindow        *int64  `json:"recvWindow"`        //NO	赋值不能超过 60000
	Timestamp         *int64  `json:"timestamp"`         //YES
}

type PmMMarginOrderDeleteRes added in v1.0.1

type PmMMarginOrderDeleteRes struct {
	Symbol              string `json:"symbol"`
	OrderId             int64  `json:"orderId"`
	OrigClientOrderId   string `json:"origClientOrderId"`
	ClientOrderId       string `json:"clientOrderId"`
	Price               string `json:"price"`
	OrigQty             string `json:"origQty"`
	ExecutedQty         string `json:"executedQty"`
	CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
	Status              string `json:"status"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	Side                string `json:"side"`
}

type PmMMarginOrderGetApi added in v1.0.1

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

func (*PmMMarginOrderGetApi) Do added in v1.0.1

func (*PmMMarginOrderGetApi) OrderId added in v1.0.1

func (api *PmMMarginOrderGetApi) OrderId(OrderId int64) *PmMMarginOrderGetApi

func (*PmMMarginOrderGetApi) OrigClientOrderId added in v1.0.1

func (api *PmMMarginOrderGetApi) OrigClientOrderId(OrigClientOrderId int64) *PmMMarginOrderGetApi

func (*PmMMarginOrderGetApi) RecvWindow added in v1.0.1

func (api *PmMMarginOrderGetApi) RecvWindow(RecvWindow int64) *PmMMarginOrderGetApi

func (*PmMMarginOrderGetApi) Symbol added in v1.0.1

func (api *PmMMarginOrderGetApi) Symbol(Symbol string) *PmMMarginOrderGetApi

func (*PmMMarginOrderGetApi) Timestamp added in v1.0.1

func (api *PmMMarginOrderGetApi) Timestamp(Timestamp int64) *PmMMarginOrderGetApi

type PmMMarginOrderGetReq added in v1.0.1

type PmMMarginOrderGetReq struct {
	Symbol            *string `json:"symbol"`            //YES	交易对
	OrderId           *int64  `json:"orderId"`           //No	订单ID
	OrigClientOrderId *int64  `json:"origClientOrderId"` //NO  必须发送 orderId 或 origClientOrderId 其中一个
	RecvWindow        *int64  `json:"recvWindow"`
	Timestamp         *int64  `json:"timestamp"`
}

type PmMMarginOrderGetRes added in v1.0.1

type PmMMarginOrderGetRes PmMMarginOrder

type PmMMarginOrderPostApi added in v1.0.1

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

func (*PmMMarginOrderPostApi) AutoRepayAtCancel added in v1.0.1

func (api *PmMMarginOrderPostApi) AutoRepayAtCancel(AutoRepayAtCancel bool) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) Do added in v1.0.1

func (*PmMMarginOrderPostApi) IcebergQty added in v1.0.1

func (api *PmMMarginOrderPostApi) IcebergQty(IcebergQty decimal.Decimal) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) NewClientOrderId added in v1.0.1

func (api *PmMMarginOrderPostApi) NewClientOrderId(NewClientOrderId string) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) NewOrderRespType added in v1.0.1

func (api *PmMMarginOrderPostApi) NewOrderRespType(NewOrderRespType string) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) Price added in v1.0.1

func (*PmMMarginOrderPostApi) Quantity added in v1.0.1

func (*PmMMarginOrderPostApi) QuoteOrderQty added in v1.0.1

func (api *PmMMarginOrderPostApi) QuoteOrderQty(QuoteOrderQty decimal.Decimal) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) RecvWindow added in v1.0.1

func (api *PmMMarginOrderPostApi) RecvWindow(RecvWindow int64) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) SelfTradePreventionMode added in v1.0.1

func (api *PmMMarginOrderPostApi) SelfTradePreventionMode(SelfTradePreventionMode string) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) Side added in v1.0.1

func (*PmMMarginOrderPostApi) SideEffectType added in v1.0.1

func (api *PmMMarginOrderPostApi) SideEffectType(SideEffectType string) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) StopPrice added in v1.0.1

func (api *PmMMarginOrderPostApi) StopPrice(StopPrice decimal.Decimal) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) Symbol added in v1.0.1

func (api *PmMMarginOrderPostApi) Symbol(Symbol string) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) TimeInForce added in v1.0.1

func (api *PmMMarginOrderPostApi) TimeInForce(TimeInForce string) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) Timestamp added in v1.0.1

func (api *PmMMarginOrderPostApi) Timestamp(Timestamp int64) *PmMMarginOrderPostApi

func (*PmMMarginOrderPostApi) Type added in v1.0.1

type PmMMarginOrderPostReq added in v1.0.1

type PmMMarginOrderPostReq struct {
	Symbol                  *string          `json:"symbol"`                  //YES	交易对
	Side                    *string          `json:"side"`                    //YES	BUY ; SELL
	Type                    *string          `json:"type"`                    //YES	详见枚举定义:订单类型
	Quantity                *decimal.Decimal `json:"quantity"`                //NO
	QuoteOrderQty           *decimal.Decimal `json:"quoteOrderQty"`           //NO
	Price                   *decimal.Decimal `json:"price"`                   //NO
	StopPrice               *decimal.Decimal `json:"stopPrice"`               //NO	与 STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT,和 TAKE_PROFIT_LIMIT 订单一起使用
	NewClientOrderId        *string          `json:"newClientOrderId"`        //NO	客户自定义的唯一订单ID。若未发送自动生成。
	NewOrderRespType        *string          `json:"newOrderRespType"`        //NO	设置响应: JSON。 ACK, RESULT, 或 FULL; MARKET 和 LIMIT 订单类型默认为 FULL, 所有其他订单默认为 ACK
	IcebergQty              *decimal.Decimal `json:"icebergQty"`              //NO	与 LIMIT, STOP_LOSS_LIMIT,和 TAKE_PROFIT_LIMIT 一起使用创建 iceberg 订单
	SideEffectType          *string          `json:"sideEffectType"`          //NO	NO_SIDE_EFFECT, MARGIN_BUY,AUTO_REPAY,AUTO_BORROW_REPAY;默认为 NO_SIDE_EFFECT
	TimeInForce             *string          `json:"timeInForce"`             //NO	GTC,IOC,FOK
	SelfTradePreventionMode *string          `json:"selfTradePreventionMode"` //NO	允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKER,EXPIRE_MAKER,EXPIRE_BOTH,NONE
	AutoRepayAtCancel       *bool            `json:"autoRepayAtCancel"`       //NO	Only when MARGIN_BUY or AUTO_BORROW_REPAY order takes effect, true means that the debt generated by the order needs to be repay after the order is cancelled. The default is true
	RecvWindow              *int64           `json:"recvWindow"`              //NO	赋值不能超过 60000
	Timestamp               *int64           `json:"timestamp"`               //YES
}

type PmMMarginOrderPostRes added in v1.0.1

type PmMMarginOrderPostRes struct {
	Symbol                string                  `json:"symbol"`
	OrderId               int64                   `json:"orderId"`
	ClientOrderId         string                  `json:"clientOrderId"`
	TransactTime          int64                   `json:"transactTime"`
	Price                 string                  `json:"price"`
	OrigQty               string                  `json:"origQty"`
	ExecutedQty           string                  `json:"executedQty"`
	CummulativeQuoteQty   string                  `json:"cummulativeQuoteQty"`
	Status                string                  `json:"status"`
	TimeInForce           string                  `json:"timeInForce"`
	Type                  string                  `json:"type"`
	Side                  string                  `json:"side"`
	MarginBuyBorrowAmount string                  `json:"marginBuyBorrowAmount"`
	MarginBuyBorrowAsset  string                  `json:"marginBuyBorrowAsset"`
	PmMMarginOrderPostRow []PmMMarginOrderPostRow `json:"fills"`
}

type PmMMarginOrderPostRow added in v1.0.1

type PmMMarginOrderPostRow struct {
	Price           string `json:"price"`
	Qty             string `json:"qty"`
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
}

type PmMRestClient added in v1.0.1

type PmMRestClient RestClient

func (*PmMRestClient) NewPmMAccount added in v1.0.1

func (client *PmMRestClient) NewPmMAccount() *PmMAccountApi

账户接口 binance PMM PmMAccount 统一账户信息 (USER_DATA)

func (*PmMRestClient) NewPmMAccountBalance added in v1.0.1

func (client *PmMRestClient) NewPmMAccountBalance() *PmMAccountBalanceApi

binance PMM PmMAccountBalance 统一账户余额 (USER_DATA)

func (*PmMRestClient) NewPmMListenKeyDelete added in v1.0.1

func (client *PmMRestClient) NewPmMListenKeyDelete() *PmMListenKeyDeleteApi

binance PMM PmMListenKeyDelete rest关闭listenKey (USER_STREAM)

func (*PmMRestClient) NewPmMListenKeyPost added in v1.0.1

func (client *PmMRestClient) NewPmMListenKeyPost() *PmMListenKeyPostApi

Ws账户推送相关 binance PMM PmMListenKeyPost rest生成listenKey (USER_STREAM)

func (*PmMRestClient) NewPmMListenKeyPut added in v1.0.1

func (client *PmMRestClient) NewPmMListenKeyPut() *PmMListenKeyPutApi

binance PMM PmMListenKeyPut rest延长listenKey有效期 (USER_STREAM)

func (*PmMRestClient) NewPmMMarginAllOrders added in v1.0.1

func (client *PmMRestClient) NewPmMMarginAllOrders() *PmMMarginAllOrdersApi

func (*PmMRestClient) NewPmMMarginInterestHistory added in v1.0.1

func (client *PmMRestClient) NewPmMMarginInterestHistory() *PmMMarginInterestHistoryApi

func (*PmMRestClient) NewPmMMarginMaxBorrowable added in v1.0.1

func (client *PmMRestClient) NewPmMMarginMaxBorrowable() *PmMMarginMaxBorrowableApi

func (*PmMRestClient) NewPmMMarginMaxTransferable added in v1.0.1

func (client *PmMRestClient) NewPmMMarginMaxTransferable() *PmMMarginMaxTransferableApi

func (*PmMRestClient) NewPmMMarginOCOAllOrders added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOCOAllOrders() *PmMMarginOCOAllOrdersApi

func (*PmMRestClient) NewPmMMarginOCOOpenOrders added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOCOOpenOrders() *PmMMarginOCOOpenOrdersApi

func (*PmMRestClient) NewPmMMarginOCOOrderDelete added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOCOOrderDelete() *PmMMarginOCOOrderDeleteApi

func (*PmMRestClient) NewPmMMarginOCOOrderGet added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOCOOrderGet() *PmMMarginOCOOrderGetApi

func (*PmMRestClient) NewPmMMarginOCOOrderPost added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOCOOrderPost() *PmMMarginOCOOrderPostApi

func (*PmMRestClient) NewPmMMarginOpenOrders added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOpenOrders() *PmMMarginOpenOrdersApi

func (*PmMRestClient) NewPmMMarginOrderDelete added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOrderDelete() *PmMMarginOrderDeleteApi

func (*PmMRestClient) NewPmMMarginOrderGet added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOrderGet() *PmMMarginOrderGetApi

交易接口 binance PMM PmMOpenOrders rest查询当前挂单 (USER_DATA)

func (*PmMRestClient) NewPmMMarginOrderPost added in v1.0.1

func (client *PmMRestClient) NewPmMMarginOrderPost() *PmMMarginOrderPostApi

type PmMWsStreamClient added in v1.0.1

type PmMWsStreamClient struct {
	WsStreamClient
	// contains filtered or unexported fields
}

func (*PmMWsStreamClient) Close added in v1.0.1

func (ws *PmMWsStreamClient) Close() error

func (*PmMWsStreamClient) ConvertToAccountWs added in v1.0.1

func (ws *PmMWsStreamClient) ConvertToAccountWs(apiKey string, apiSecret string) (*PmMWsStreamClient, error)

func (*PmMWsStreamClient) CreatePayload added in v1.0.1

func (ws *PmMWsStreamClient) CreatePayload() (*WsPmMPayload, error)

type PmPOCODeleteOrderReport added in v1.0.1

type PmPOCODeleteOrderReport struct {
	Symbol              string `json:"symbol"`
	OrigClientOrderId   string `json:"origClientOrderId"`
	OrderId             int64  `json:"orderId"`
	OrderListId         int64  `json:"orderListId"`
	ClientOrderId       string `json:"clientOrderId"`
	Price               string `json:"price"`
	OrigQty             string `json:"origQty"`
	ExecutedQty         string `json:"executedQty"`
	CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
	Status              string `json:"status"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	Side                string `json:"side"`
	StopPrice           string `json:"stopPrice"`
}

type PmPOCOOrder added in v1.0.1

type PmPOCOOrder struct {
	Symbol        string `json:"symbol"`
	OrderId       int64  `json:"orderId"`
	ClientOrderId string `json:"clientOrderId"`
}

type PmPOCOOrderReport added in v1.0.1

type PmPOCOOrderReport struct {
	Symbol              string `json:"symbol"`
	OrderId             int64  `json:"orderId"`
	OrderListId         int64  `json:"orderListId"`
	ClientOrderId       string `json:"clientOrderId"`
	TransactTime        int64  `json:"transactTime"`
	Price               string `json:"price"`
	OrigQty             string `json:"origQty"`
	ExecutedQty         string `json:"executedQty"`
	CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
	Status              string `json:"status"`
	TimeInForce         string `json:"timeInForce"`
	Type                string `json:"type"`
	Side                string `json:"side"`
}

type PmUAccountApi added in v1.0.1

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

func (*PmUAccountApi) Do added in v1.0.1

func (api *PmUAccountApi) Do() (*PmUAccountRes, error)

func (*PmUAccountApi) RecvWindow added in v1.0.1

func (api *PmUAccountApi) RecvWindow(RecvWindow int64) *PmUAccountApi

func (*PmUAccountApi) Timestamp added in v1.0.1

func (api *PmUAccountApi) Timestamp(Timestamp int64) *PmUAccountApi

type PmUAccountBalanceApi added in v1.0.1

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

func (*PmUAccountBalanceApi) Asset added in v1.0.1

func (*PmUAccountBalanceApi) Do added in v1.0.1

func (*PmUAccountBalanceApi) RecvWindow added in v1.0.1

func (api *PmUAccountBalanceApi) RecvWindow(RecvWindow int64) *PmUAccountBalanceApi

func (*PmUAccountBalanceApi) Timestamp added in v1.0.1

func (api *PmUAccountBalanceApi) Timestamp(Timestamp int64) *PmUAccountBalanceApi

type PmUAccountBalanceReq added in v1.0.1

type PmUAccountBalanceReq struct {
	Asset      *string `json:"asset"` //NO	资产名称
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmUAccountBalanceRes added in v1.0.1

type PmUAccountBalanceRes []PmUAccountBalanceRow

type PmUAccountBalanceRow added in v1.0.1

type PmUAccountBalanceRow struct {
	Asset               string `json:"asset"`               //资产
	TotalWalletBalance  string `json:"totalWalletBalance"`  // 钱包余额 =  全仓杠杆未锁定 + 全仓杠杆锁定 + u本位合约钱包余额 + 币本位合约钱包余额
	CrossMarginAsset    string `json:"crossMarginAsset"`    // 全仓资产 = 全仓杠杆未锁定 + 全仓杠杆锁定
	CrossMarginBorrowed string `json:"crossMarginBorrowed"` // 全仓杠杆借贷
	CrossMarginFree     string `json:"crossMarginFree"`     // 全仓杠杆未锁定
	CrossMarginInterest string `json:"crossMarginInterest"` // 全仓杠杆利息
	CrossMarginLocked   string `json:"crossMarginLocked"`   //全仓杠杆锁定
	UmWalletBalance     string `json:"umWalletBalance"`     // u本位合约钱包余额
	UmUnrealizedPNL     string `json:"umUnrealizedPNL"`     // u本位未实现盈亏
	CmWalletBalance     string `json:"cmWalletBalance"`     // 币本位合约钱包余额
	CmUnrealizedPNL     string `json:"cmUnrealizedPNL"`     // 币本位未实现盈亏
	UpdateTime          int64  `json:"updateTime"`          // 更新时间
	NegativeBalance     string `json:"negativeBalance"`     // 负资产余额
}

type PmUAccountForUApi added in v1.0.1

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

func (*PmUAccountForUApi) Do added in v1.0.1

func (*PmUAccountForUApi) RecvWindow added in v1.0.1

func (api *PmUAccountForUApi) RecvWindow(RecvWindow int64) *PmUAccountForUApi

func (*PmUAccountForUApi) Timestamp added in v1.0.1

func (api *PmUAccountForUApi) Timestamp(Timestamp int64) *PmUAccountForUApi

type PmUAccountForUReq added in v1.0.1

type PmUAccountForUReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

PmUAccountForU

type PmUAccountForURes added in v1.0.1

type PmUAccountForURes struct {
	Assets    []PmUAccountForUResAsset    `json:"assets"`
	Positions []PmUAccountForUResPosition `json:"positions"` // 头寸,将返回所有市场symbol。
}

type PmUAccountForUResAsset added in v1.0.1

type PmUAccountForUResAsset struct {
	Asset                  string `json:"asset"`                  //资产
	CrossWalletBalance     string `json:"crossWalletBalance"`     //全仓账户余额
	CrossUnPnl             string `json:"crossUnPnl"`             // 全仓持仓未实现盈亏
	MaintMargin            string `json:"maintMargin"`            // 维持保证金
	InitialMargin          string `json:"initialMargin"`          // 当前所需起始保证金
	PositionInitialMargin  string `json:"positionInitialMargin"`  // 持仓所需起始保证金(基于最新标记价格)
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // 当前挂单所需起始保证金(基于最新标记价格)
	UpdateTime             int64  `json:"updateTime"`             //更新时间
}

type PmUAccountForUResPosition added in v1.0.1

type PmUAccountForUResPosition struct {
	//根据用户持仓模式展示持仓方向,即单向模式下只返回BOTH持仓情况,双向模式下只返回 LONG 和 SHORT 持仓情况
	Symbol           string `json:"symbol"`           // 交易对
	InitialMargin    string `json:"initialMargin"`    // 当前所需起始保证金(基于最新标记价格)
	MaintMargin      string `json:"maintMargin"`      //维持保证金
	UnrealizedProfit string `json:"unrealizedProfit"` // 持仓未实现盈亏
	PositionSide     string `json:"positionSide"`     // 持仓方向
	PositionAmt      string `json:"positionAmt"`      // 持仓数量
	UpdateTime       int64  `json:"updateTime"`       // 更新时间
	NotionalValue    string `json:"notional"`         // 净值
}

type PmUAccountReq added in v1.0.1

type PmUAccountReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

PmUAccount

type PmUAccountRes added in v1.0.1

type PmUAccountRes struct {
	UniMMR                   string `json:"uniMMR"`                   // 统一账户维持保证金率
	AccountEquity            string `json:"accountEquity"`            // 以USD计价的账户权益
	ActualEquity             string `json:"actualEquity"`             // 不考虑质押率的以USD计价账户权益
	AccountInitialMargin     string `json:"accountInitialMargin"`     // 当前所需起始保证金(基于最新标记价格)
	AccountMaintMargin       string `json:"accountMaintMargin"`       // 以USD计价统一账户维持保证金
	AccountStatus            string `json:"accountStatus"`            // 统一账户账户状态:"NORMAL", "MARGIN_CALL", "SUPPLY_MARGIN", "REDUCE_ONLY", "ACTIVE_LIQUIDATION", "FORCE_LIQUIDATION", "BANKRUPTED"
	VirtualMaxWithdrawAmount string `json:"virtualMaxWithdrawAmount"` // 以USD计价的最大可转出
	TotalAvailableBalance    string `json:"totalAvailableBalance"`    // 以USD计价的可用余额
	TotalMarginOpenLoss      string `json:"totalMarginOpenLoss"`      // 以USD计价的总开仓保证金
	UpdateTime               int64  `json:"updateTime"`               // 更新时间
}

type PmUAllConditionnalOrderDeleteApi added in v1.0.1

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

func (*PmUAllConditionnalOrderDeleteApi) Do added in v1.0.1

func (*PmUAllConditionnalOrderDeleteApi) RecvWindow added in v1.0.1

func (*PmUAllConditionnalOrderDeleteApi) Symbol added in v1.0.1

func (*PmUAllConditionnalOrderDeleteApi) Timestamp added in v1.0.1

type PmUAllConditionnalOrderDeleteReq added in v1.0.1

type PmUAllConditionnalOrderDeleteReq struct {
	Symbol     *string `json:"symbol"`               //YES	交易对
	RecvWindow *int64  `json:"recvWindow,omitempty"` //NO
	Timestamp  *int64  `json:"timestamp"`            //YES
}

type PmUAllConditionnalOrderDeleteRes added in v1.0.1

type PmUAllConditionnalOrderDeleteRes BinanceErrorRes

type PmUAllOrderDeleteApi added in v1.0.1

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

func (*PmUAllOrderDeleteApi) Do added in v1.0.1

func (*PmUAllOrderDeleteApi) RecvWindow added in v1.0.1

func (api *PmUAllOrderDeleteApi) RecvWindow(RecvWindow int64) *PmUAllOrderDeleteApi

func (*PmUAllOrderDeleteApi) Symbol added in v1.0.1

func (api *PmUAllOrderDeleteApi) Symbol(Symbol string) *PmUAllOrderDeleteApi

func (*PmUAllOrderDeleteApi) Timestamp added in v1.0.1

func (api *PmUAllOrderDeleteApi) Timestamp(Timestamp int64) *PmUAllOrderDeleteApi

type PmUAllOrderDeleteReq added in v1.0.1

type PmUAllOrderDeleteReq struct {
	Symbol     *string `json:"symbol"`               //YES 交易对
	RecvWindow *int64  `json:"recvWindow,omitempty"` //NO
	Timestamp  *int64  `json:"timestamp"`            //YES
}

type PmUAllOrderDeleteRes added in v1.0.1

type PmUAllOrderDeleteRes BinanceErrorRes

type PmUAllOrdersApi added in v1.0.1

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

func (*PmUAllOrdersApi) Do added in v1.0.1

func (api *PmUAllOrdersApi) Do() (*PmUAllOrdersRes, error)

func (*PmUAllOrdersApi) EndTime added in v1.0.1

func (api *PmUAllOrdersApi) EndTime(EndTime int64) *PmUAllOrdersApi

func (*PmUAllOrdersApi) Limit added in v1.0.1

func (api *PmUAllOrdersApi) Limit(Limit int64) *PmUAllOrdersApi

func (*PmUAllOrdersApi) OrderId added in v1.0.1

func (api *PmUAllOrdersApi) OrderId(OrderId int64) *PmUAllOrdersApi

func (*PmUAllOrdersApi) RecvWindow added in v1.0.1

func (api *PmUAllOrdersApi) RecvWindow(RecvWindow int64) *PmUAllOrdersApi

func (*PmUAllOrdersApi) StartTime added in v1.0.1

func (api *PmUAllOrdersApi) StartTime(StartTime int64) *PmUAllOrdersApi

func (*PmUAllOrdersApi) Symbol added in v1.0.1

func (api *PmUAllOrdersApi) Symbol(Symbol string) *PmUAllOrdersApi

func (*PmUAllOrdersApi) Timestamp added in v1.0.1

func (api *PmUAllOrdersApi) Timestamp(Timestamp int64) *PmUAllOrdersApi

type PmUAllOrdersReq added in v1.0.1

type PmUAllOrdersReq struct {
	Symbol     *string `json:"symbol"`    //No	交易对
	OrderId    *int64  `json:"orderId"`   //No	只返回此orderID及之后的订单,缺省返回最近的订单
	StartTime  *int64  `json:"startTime"` //No	起始时间
	EndTime    *int64  `json:"endTime"`   //No	结束时间
	Limit      *int64  `json:"limit"`     //No	返回的结果集数量 默认值:500 最大值:1000
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmUAllOrdersRes added in v1.0.1

type PmUAllOrdersRes []PmUOrderOrder

type PmUApi added in v1.0.1

type PmUApi int
const (
	//账户接口
	PmUAccount        PmUApi = iota //GET接口 统一账户信息 (USER_DATA)
	PmUAccountBalance               //GET接口 统一账户余额 (USER_DATA)
	PmUAccountForU                  //GET接口 UM账户信息v2 (USER_DATA)
	PmUCommissionRate               //GET接口 (HMAC SHA256)查询用户UM手续费率 (USER_DATA)

	//交易接口
	PmUOpenOrders                 //GET接口 (HMAC SHA256)查看当前全部UM挂单(USER_DATA)
	PmUAllOrders                  //GET接口 (HMAC SHA256)查询所有UM订单(包括历史订单)(USER_DATA)
	PmUOrderPost                  //POST接口 (HMAC SHA256)UM下单(TRADE)
	PmUOrderPut                   //PUT接口 (HMAC SHA256)修改UM订单(TRADE)
	PmUOrderGet                   //GET接口 (HMAC SHA256)查询UM订单(USER_DATA)
	PmUOrderDelete                //DELETE接口 (HMAC SHA256)撤销UM订单 (TRADE)
	PmUAllOrderDelete             //DELETE接口 (HMAC SHA256)撤销全部UM订单 (TRADE)
	PmUConditionalOrderPost       //POST接口 (HMAC SHA256)UM条件单下单(TRADE)
	PmUConditionalOrderDelete     //DELETE接口 (HMAC SHA256)取消UM条件订单(TRADE)
	PmUAllConditionnalOrderDelete //DELETE接口 (HMAC SHA256)撤销全部UM条件订单(TRADE)
	PmUUserTrades                 //GET接口 (HMAC SHA256)UM账户成交历史 (USER_DATA)

	//通用接口
	PmUPing         //GET接口 测试服务器连通性
	PmUServerTime   //GET接口 获取服务器时间
	PmUExchangeInfo //GET接口 交易规则和交易对信息

	//行情接口
	PmUKlines           //K线数据
	PmUDepth            //深度信息
	PmUTrades           //最新成交
	PmUHistoricalTrades //历史成交
	PmUAggTrades        //近期成交(归集)
	PmUPremiumIndex     //最新标记价格和资金费率
	PmUFundingRate      //查询资金费率历史
	PmUFundingInfo      //查询资金费率信息
	PmUTicker24hr       //24hr价格变动情况
	PmUTickerPrice      //最新价格
	PmUTickerBookTicker //当前最优挂单
	PmUDataBasis        //基差数据

	//Ws账户推送相关接口
	PmUListenKeyPost   //生成listenKey (USER_STREAM)
	PmUListenKeyPut    //延长listenKey有效期 (USER_STREAM)
	PmUListenKeyDelete //关闭listenKey (USER_STREAM)
)

type PmUCommissionRateApi added in v1.0.1

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

func (*PmUCommissionRateApi) Do added in v1.0.1

func (*PmUCommissionRateApi) RecvWindow added in v1.0.1

func (api *PmUCommissionRateApi) RecvWindow(RecvWindow int64) *PmUCommissionRateApi

func (*PmUCommissionRateApi) Symbol added in v1.0.1

func (api *PmUCommissionRateApi) Symbol(Symbol string) *PmUCommissionRateApi

func (*PmUCommissionRateApi) Timestamp added in v1.0.1

func (api *PmUCommissionRateApi) Timestamp(Timestamp int64) *PmUCommissionRateApi

type PmUCommissionRateReq added in v1.0.1

type PmUCommissionRateReq struct {
	Symbol     *string `json:"symbol"` //Yses	交易对名称
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmUCommissionRateRes added in v1.0.1

type PmUCommissionRateRes struct {
	Symbol              string `json:"symbol"`
	MakerCommissionRate string `json:"makerCommissionRate"`
	TakerCommissionRate string `json:"takerCommissionRate"`
}

type PmUConditionalOrderDeleteApi added in v1.0.1

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

func (*PmUConditionalOrderDeleteApi) Do added in v1.0.1

func (*PmUConditionalOrderDeleteApi) NewClientStrategyId added in v1.0.1

func (api *PmUConditionalOrderDeleteApi) NewClientStrategyId(NewClientStrategyId string) *PmUConditionalOrderDeleteApi

func (*PmUConditionalOrderDeleteApi) RecvWindow added in v1.0.1

func (*PmUConditionalOrderDeleteApi) StrategyId added in v1.0.1

func (*PmUConditionalOrderDeleteApi) Symbol added in v1.0.1

func (*PmUConditionalOrderDeleteApi) Timestamp added in v1.0.1

type PmUConditionalOrderDeleteReq added in v1.0.1

type PmUConditionalOrderDeleteReq struct {
	Symbol              *string `json:"symbol"`               //YES	交易对
	StrategyId          *string `json:"strategyId"`           //NO strategyId 与 newClientStrategyId 之一必须发送
	NewClientStrategyId *string `json:"newClientStrategyId"`  //NO
	RecvWindow          *int64  `json:"recvWindow,omitempty"` //NO
	Timestamp           *int64  `json:"timestamp"`            //YES
}

type PmUConditionalOrderDeleteRes added in v1.0.1

type PmUConditionalOrderDeleteRes struct {
	NewClientStrategyId     string `json:"newClientStrategyId"`
	StrategyId              int64  `json:"strategyId"`
	StrategyStatus          string `json:"strategyStatus"`
	StrategyType            string `json:"strategyType"`
	OrigQty                 string `json:"origQty"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	StopPrice               string `json:"stopPrice"`
	Symbol                  string `json:"symbol"`
	TimeInForce             string `json:"timeInForce"`
	ActivatePrice           string `json:"activatePrice"`
	PriceRate               string `json:"priceRate"`
	BookTime                int64  `json:"bookTime"` //条件单下单时间
	UpdateTime              int64  `json:"updateTime"`
	WorkingType             string `json:"workingType"`
	PriceProtect            bool   `json:"priceProtect"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"` ////订单自成交保护模式
	GoodTillDate            int64  `json:"goodTillDate"`            //订单TIF为GTD时的自动取消时间
	PriceMatch              string `json:"priceMatch"`
}

type PmUConditionalOrderPostApi added in v1.0.1

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

func (*PmUConditionalOrderPostApi) ActivationPrice added in v1.0.1

func (api *PmUConditionalOrderPostApi) ActivationPrice(ActivationPrice decimal.Decimal) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) CallbackRate added in v1.0.1

func (api *PmUConditionalOrderPostApi) CallbackRate(CallbackRate decimal.Decimal) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) Do added in v1.0.1

func (*PmUConditionalOrderPostApi) GoodTillDate added in v1.0.1

func (api *PmUConditionalOrderPostApi) GoodTillDate(GoodTillDate int64) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) NewClientStrategyId added in v1.0.1

func (api *PmUConditionalOrderPostApi) NewClientStrategyId(NewClientStrategyId string) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) PositionSide added in v1.0.1

func (api *PmUConditionalOrderPostApi) PositionSide(PositionSide string) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) Price added in v1.0.1

func (*PmUConditionalOrderPostApi) PriceMatch added in v1.0.1

func (api *PmUConditionalOrderPostApi) PriceMatch(PriceMatch string) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) PriceProtect added in v1.0.1

func (api *PmUConditionalOrderPostApi) PriceProtect(PriceProtect string) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) Quantity added in v1.0.1

func (*PmUConditionalOrderPostApi) RecvWindow added in v1.0.1

func (api *PmUConditionalOrderPostApi) RecvWindow(RecvWindow int64) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) SelfTradePreventionMode added in v1.0.1

func (api *PmUConditionalOrderPostApi) SelfTradePreventionMode(SelfTradePreventionMode string) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) Side added in v1.0.1

func (*PmUConditionalOrderPostApi) StopPrice added in v1.0.1

func (*PmUConditionalOrderPostApi) StrategyType added in v1.0.1

func (api *PmUConditionalOrderPostApi) StrategyType(StrategyType string) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) Symbol added in v1.0.1

func (*PmUConditionalOrderPostApi) TimeInForce added in v1.0.1

func (api *PmUConditionalOrderPostApi) TimeInForce(TimeInForce string) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) Timestamp added in v1.0.1

func (api *PmUConditionalOrderPostApi) Timestamp(Timestamp int64) *PmUConditionalOrderPostApi

func (*PmUConditionalOrderPostApi) WorkingType added in v1.0.1

func (api *PmUConditionalOrderPostApi) WorkingType(WorkingType string) *PmUConditionalOrderPostApi

type PmUConditionalOrderPostReq added in v1.0.1

type PmUConditionalOrderPostReq struct {
	Symbol                  *string          `json:"symbol"`                  //YES	交易对
	Side                    *string          `json:"side"`                    //YES	买卖方向
	PositionSide            *string          `json:"positionSide"`            //NO	持仓方向,单向持仓模式下非必填,默认且仅可填BOTH;在双向持仓模式下必填,且仅可选择 LONG 或 SHORT
	StrategyType            *string          `json:"strategyType"`            //YES	条件单类型"STOP", "STOP_MARKET", "TAKE_PROFIT", "TAKE_PROFIT_MARKET"或"TRAILING_STOP_MARKET"
	TimeInForce             *string          `json:"timeInForce"`             //NO	订单有效期
	Quantity                *decimal.Decimal `json:"quantity"`                //NO	下单数量
	ReduceOnly              *string          `json:"reduceOnly"`              //NO	true或false; 非双开模式下默认false;双开模式下不接受此参数
	Price                   *decimal.Decimal `json:"price"`                   //NO	下单价格
	WorkingType             *string          `json:"workingType"`             //NO	stopPrice 触发类型: MARK_PRICE(标记价格), CONTRACT_PRICE(合约最新价). 默认 CONTRACT_PRICE
	PriceProtect            *string          `json:"priceProtect"`            //NO	条件单触发保护:"TRUE","FALSE", 默认"FALSE". 仅 STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET 需要此参数
	NewClientStrategyId     *string          `json:"newClientStrategyId"`     //NO	不可以重复出现在挂单中。如空缺系统会自动赋值。必须满足正则规则: ^[\.A-Z\:/a-z0-9_-]{1,32}$
	StopPrice               *decimal.Decimal `json:"stopPrice"`               //NO	Used with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders.
	ActivationPrice         *decimal.Decimal `json:"activationPrice"`         //NO	TRAILING_STOP_MARKET 单使用,默认标记价格
	CallbackRate            *decimal.Decimal `json:"callbackRate"`            //NO	TRAILING_STOP_MARKET 单使用, 最小0.1, 最大5,1代表1%
	PriceMatch              *string          `json:"priceMatch"`              //NO	OPPONENT/ OPPONENT_5/ OPPONENT_10/ OPPONENT_20/QUEUE/ QUEUE_5/ QUEUE_10/ QUEUE_20;不能与price同时传
	SelfTradePreventionMode *string          `json:"selfTradePreventionMode"` //NO	NONE / EXPIRE_TAKER/ EXPIRE_MAKER/ EXPIRE_BOTH; 默认NONE
	GoodTillDate            *int64           `json:"goodTillDate"`            //NO	TIF为GTD时订单的自动取消时间, 当timeInforce为GTD时必传;传入的时间戳仅保留秒级精度,毫秒级部分会被自动忽略,时间戳需大于当前时间+600s且小于253402300799000
	RecvWindow              *int64           `json:"recvWindow"`              //NO
	Timestamp               *int64           `json:"timestamp"`               //YES
}

type PmUConditionalOrderPostRes added in v1.0.1

type PmUConditionalOrderPostRes struct {
	NewClientStrategyId     string `json:"newClientStrategyId"`
	StrategyId              int64  `json:"strategyId"`
	StrategyStatus          string `json:"strategyStatus"`
	StrategyType            string `json:"strategyType"`
	OrigQty                 string `json:"origQty"`
	Price                   string `json:"price"`
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	StopPrice               string `json:"stopPrice"`
	Symbol                  string `json:"symbol"`
	TimeInForce             string `json:"timeInForce"`
	ActivatePrice           string `json:"activatePrice"`
	PriceRate               string `json:"priceRate"`
	BookTime                int64  `json:"bookTime"` //条件单下单时间
	UpdateTime              int64  `json:"updateTime"`
	WorkingType             string `json:"workingType"`
	PriceProtect            bool   `json:"priceProtect"`
	SelfTradePreventionMode string `json:"selfTradePreventionMode"` ////订单自成交保护模式
	GoodTillDate            int64  `json:"goodTillDate"`            //订单TIF为GTD时的自动取消时间
	PriceMatch              string `json:"priceMatch"`
}

type PmUListenKeyDeleteApi added in v1.0.1

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

func (*PmUListenKeyDeleteApi) Do added in v1.0.1

type PmUListenKeyDeleteReq added in v1.0.1

type PmUListenKeyDeleteReq struct{}

type PmUListenKeyDeleteRes added in v1.0.1

type PmUListenKeyDeleteRes struct{}

type PmUListenKeyPostApi added in v1.0.1

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

func (*PmUListenKeyPostApi) Do added in v1.0.1

type PmUListenKeyPostReq added in v1.0.1

type PmUListenKeyPostReq struct{}

listenKey相关

type PmUListenKeyPostRes added in v1.0.1

type PmUListenKeyPostRes struct {
	ListenKey string `json:"listenKey"`
}

type PmUListenKeyPutApi added in v1.0.1

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

func (*PmUListenKeyPutApi) Do added in v1.0.1

type PmUListenKeyPutReq added in v1.0.1

type PmUListenKeyPutReq struct{}

type PmUListenKeyPutRes added in v1.0.1

type PmUListenKeyPutRes struct{}

type PmUOpenOrdersApi added in v1.0.1

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

func (*PmUOpenOrdersApi) Do added in v1.0.1

func (api *PmUOpenOrdersApi) Do() (*PmUOpenOrdersRes, error)

func (*PmUOpenOrdersApi) RecvWindow added in v1.0.1

func (api *PmUOpenOrdersApi) RecvWindow(RecvWindow int64) *PmUOpenOrdersApi

func (*PmUOpenOrdersApi) Symbol added in v1.0.1

func (api *PmUOpenOrdersApi) Symbol(Symbol string) *PmUOpenOrdersApi

func (*PmUOpenOrdersApi) Timestamp added in v1.0.1

func (api *PmUOpenOrdersApi) Timestamp(Timestamp int64) *PmUOpenOrdersApi

type PmUOpenOrdersReq added in v1.0.1

type PmUOpenOrdersReq struct {
	Symbol     *string `json:"symbol"` //No	交易对
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type PmUOpenOrdersRes added in v1.0.1

type PmUOpenOrdersRes []PmUOrderOrder

type PmUOrderDeleteApi added in v1.0.1

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

func (*PmUOrderDeleteApi) Do added in v1.0.1

func (*PmUOrderDeleteApi) OrderId added in v1.0.1

func (api *PmUOrderDeleteApi) OrderId(OrderId int64) *PmUOrderDeleteApi

func (*PmUOrderDeleteApi) OrigClientOrderId added in v1.0.1

func (api *PmUOrderDeleteApi) OrigClientOrderId(OrigClientOrderId string) *PmUOrderDeleteApi

func (*PmUOrderDeleteApi) RecvWindow added in v1.0.1

func (api *PmUOrderDeleteApi) RecvWindow(RecvWindow int64) *PmUOrderDeleteApi

func (*PmUOrderDeleteApi) Symbol added in v1.0.1

func (api *PmUOrderDeleteApi) Symbol(Symbol string) *PmUOrderDeleteApi

func (*PmUOrderDeleteApi) Timestamp added in v1.0.1

func (api *PmUOrderDeleteApi) Timestamp(Timestamp int64) *PmUOrderDeleteApi

type PmUOrderDeleteReq added in v1.0.1

type PmUOrderDeleteReq struct {
	Symbol            *string `json:"symbol"`                      //YES 交易对
	OrderId           *int64  `json:"orderId,omitempty"`           //NO 系统订单号
	OrigClientOrderId *string `json:"origClientOrderId,omitempty"` //NO 用户自定义的订单号
	RecvWindow        *int64  `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64  `json:"timestamp"`                   //YES
}

type PmUOrderDeleteRes added in v1.0.1

type PmUOrderDeleteRes PmUOrderOrder

type PmUOrderGetApi added in v1.0.1

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

func (*PmUOrderGetApi) Do added in v1.0.1

func (api *PmUOrderGetApi) Do() (*PmUOrderGetRes, error)

func (*PmUOrderGetApi) OrderId added in v1.0.1

func (api *PmUOrderGetApi) OrderId(OrderId int64) *PmUOrderGetApi

func (*PmUOrderGetApi) OrigClientOrderId added in v1.0.1

func (api *PmUOrderGetApi) OrigClientOrderId(OrigClientOrderId string) *PmUOrderGetApi

func (*PmUOrderGetApi) RecvWindow added in v1.0.1

func (api *PmUOrderGetApi) RecvWindow(RecvWindow int64) *PmUOrderGetApi

func (*PmUOrderGetApi) Symbol added in v1.0.1

func (api *PmUOrderGetApi) Symbol(Symbol string) *PmUOrderGetApi

func (*PmUOrderGetApi) Timestamp added in v1.0.1

func (api *PmUOrderGetApi) Timestamp(Timestamp int64) *PmUOrderGetApi

type PmUOrderGetReq added in v1.0.1

type PmUOrderGetReq struct {
	Symbol            *string `json:"symbol"`                      //YES 交易对
	OrderId           *int64  `json:"orderId,omitempty"`           //NO 系统订单号
	OrigClientOrderId *string `json:"origClientOrderId,omitempty"` //NO 用户自定义的订单号
	RecvWindow        *int64  `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64  `json:"timestamp"`                   //YES
}

type PmUOrderGetRes added in v1.0.1

type PmUOrderGetRes PmUOrderOrder

type PmUOrderOrder added in v1.0.1

type PmUOrderOrder struct {
	AvgPrice                string `json:"avgPrice"`                  // 平均成交价
	ClientOrderId           string `json:"clientOrderId"`             // 用户自定义的订单号
	CumQuote                string `json:"cumQuote"`                  // 成交金额
	ExecutedQty             string `json:"executedQty"`               // 成交量
	OrderId                 int64  `gorm:"primaryKey" json:"orderId"` // 系统订单号
	OrigQty                 string `json:"origQty"`                   // 原始委托数量
	OrigType                string `json:"origType"`                  // 触发前订单类型
	Price                   string `json:"price"`                     // 委托价格
	ReduceOnly              bool   `json:"reduceOnly"`                // 是否仅减仓
	Side                    string `json:"side"`                      // 买卖方向
	PositionSide            string `json:"positionSide"`              // 持仓方向
	Status                  string `json:"status"`                    // 订单状态
	Symbol                  string `json:"symbol"`                    // 交易对
	Time                    int64  `json:"time"`                      // 订单时间
	TimeInForce             string `json:"timeInForce"`               // 有效方法
	Type                    string `json:"type"`                      // 订单类型
	UpdateTime              int64  `json:"updateTime"`                // 更新时间
	SelfTradePreventionMode string `json:"selfTradePreventionMode"`   // 是否开启条件单触发保护
	GoodTillDate            int64  `json:"goodTillDate"`              // 订单TIF为GTD时的自动取消时间
	PriceMatch              string `json:"priceMatch"`                // 触发条件
}

type PmUOrderPostApi added in v1.0.1

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

func (*PmUOrderPostApi) Do added in v1.0.1

func (api *PmUOrderPostApi) Do() (*PmUOrderPostRes, error)

func (*PmUOrderPostApi) GoodTillDate added in v1.0.1

func (api *PmUOrderPostApi) GoodTillDate(GoodTillDate int64) *PmUOrderPostApi

func (*PmUOrderPostApi) NewClientOrderId added in v1.0.1

func (api *PmUOrderPostApi) NewClientOrderId(NewClientOrderId string) *PmUOrderPostApi

func (*PmUOrderPostApi) NewOrderRespType added in v1.0.1

func (api *PmUOrderPostApi) NewOrderRespType(NewOrderRespType string) *PmUOrderPostApi

func (*PmUOrderPostApi) PositionSide added in v1.0.1

func (api *PmUOrderPostApi) PositionSide(PositionSide string) *PmUOrderPostApi

func (*PmUOrderPostApi) Price added in v1.0.1

func (api *PmUOrderPostApi) Price(Price decimal.Decimal) *PmUOrderPostApi

func (*PmUOrderPostApi) PriceMatch added in v1.0.1

func (api *PmUOrderPostApi) PriceMatch(PriceMatch string) *PmUOrderPostApi

func (*PmUOrderPostApi) Quantity added in v1.0.1

func (api *PmUOrderPostApi) Quantity(Quantity decimal.Decimal) *PmUOrderPostApi

func (*PmUOrderPostApi) RecvWindow added in v1.0.1

func (api *PmUOrderPostApi) RecvWindow(RecvWindow int64) *PmUOrderPostApi

func (*PmUOrderPostApi) ReduceOnly added in v1.0.1

func (api *PmUOrderPostApi) ReduceOnly(ReduceOnly string) *PmUOrderPostApi

func (*PmUOrderPostApi) SelfTradePreventionMode added in v1.0.1

func (api *PmUOrderPostApi) SelfTradePreventionMode(SelfTradePreventionMode string) *PmUOrderPostApi

func (*PmUOrderPostApi) Side added in v1.0.1

func (api *PmUOrderPostApi) Side(Side string) *PmUOrderPostApi

func (*PmUOrderPostApi) Symbol added in v1.0.1

func (api *PmUOrderPostApi) Symbol(Symbol string) *PmUOrderPostApi

func (*PmUOrderPostApi) TimeInForce added in v1.0.1

func (api *PmUOrderPostApi) TimeInForce(TimeInForce string) *PmUOrderPostApi

func (*PmUOrderPostApi) Timestamp added in v1.0.1

func (api *PmUOrderPostApi) Timestamp(Timestamp int64) *PmUOrderPostApi

func (*PmUOrderPostApi) Type added in v1.0.1

func (api *PmUOrderPostApi) Type(Type string) *PmUOrderPostApi

type PmUOrderPostReq added in v1.0.1

type PmUOrderPostReq struct {
	Symbol                  *string          `json:"symbol"`                            //Yes	交易对
	Side                    *string          `json:"side"`                              //Yes	买卖方向 SELL, BUY
	PositionSide            *string          `json:"positionSide,omitempty"`            //No	持仓方向,单向持仓模式下非必填,默认且仅可填BOTH;在双向持仓模式下必填,且仅可选择 LONG 或 SHORT
	Type                    *string          `json:"type"`                              //Yes	订单类型 LIMIT, MARKET, STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET
	TimeInForce             *string          `json:"timeInForce,omitempty"`             //No	有效方法
	Quantity                *decimal.Decimal `json:"quantity,omitempty"`                //No	下单数量,使用closePosition不支持此参数。
	ReduceOnly              *string          `json:"reduceOnly,omitempty"`              //No	true, false; 非双开模式下默认false;双开模式下不接受此参数; 使用closePosition不支持此参数。
	Price                   *decimal.Decimal `json:"price,omitempty"`                   //No	委托价格
	NewClientOrderId        *string          `json:"newClientOrderId,omitempty"`        //No	用户自定义的订单号,不可以重复出现在挂单中。如空缺系统会自动赋值。必须满足正则规则 ^[\.A-Z\:/a-z0-9_-]{1,36}$
	NewOrderRespType        *string          `json:"newOrderRespType,omitempty"`        //No	"ACK", "RESULT", 默认 "ACK"
	PriceMatch              *string          `json:"priceMatch,omitempty"`              //No	条件单触发保护:"TRUE","FALSE", 默认"FALSE". 仅 STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET 需要此参数
	SelfTradePreventionMode *string          `json:"selfTradePreventionMode,omitempty"` //No	"GTC", "IOC", "FOK", "GTX"
	GoodTillDate            *int64           `json:"goodTillDate,omitempty"`            //No	订单有效期时间戳,单位毫秒
	RecvWindow              *int64           `json:"recvWindow,omitempty"`              //No
	Timestamp               *int64           `json:"timestamp,omitempty"`               //Yes
}

type PmUOrderPostRes added in v1.0.1

type PmUOrderPostRes struct {
	ClientOrderId           string `json:"clientOrderId"` // 用户自定义的订单号
	CumQty                  string `json:"cumQty"`
	CumQuote                string `json:"cumQuote"` // 成交金额
	ExecutedQty             string `json:"executedQty"`
	OrderId                 int64  `json:"orderId"` // 系统订单号
	AvgPrice                string `json:"avgPrice"`
	OrigQty                 string `json:"origQty"` // 原始委托数量
	Price                   string `json:"price"`   // 委托价格
	ReduceOnly              bool   `json:"reduceOnly"`
	Side                    string `json:"side"`                    // 买卖方向
	PositionSide            string `json:"positionSide"`            // 持仓方向
	Status                  string `json:"status"`                  // 订单状态
	Symbol                  string `json:"symbol"`                  // 交易对
	TimeInForce             string `json:"timeInForce"`             // 有效方法
	Type                    string `json:"type"`                    // 订单类型
	SelfTradePreventionMode string `json:"selfTradePreventionMode"` // 订单自成交保护模式
	GoodTillDate            int64  `json:"goodTillDate"`            // 订单TIF为GTD时的自动取消时间
	UpdateTime              int64  `json:"updateTime"`              // 更新时间
	PriceMatch              string `json:"priceMatch"`              // 触发条件
}

type PmUOrderPutApi added in v1.0.1

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

func (*PmUOrderPutApi) Do added in v1.0.1

func (api *PmUOrderPutApi) Do() (*PmUOrderPutRes, error)

func (*PmUOrderPutApi) OrderId added in v1.0.1

func (api *PmUOrderPutApi) OrderId(OrderId int64) *PmUOrderPutApi

func (*PmUOrderPutApi) OrigClientOrderId added in v1.0.1

func (api *PmUOrderPutApi) OrigClientOrderId(OrigClientOrderId string) *PmUOrderPutApi

func (*PmUOrderPutApi) Price added in v1.0.1

func (api *PmUOrderPutApi) Price(Price decimal.Decimal) *PmUOrderPutApi

func (*PmUOrderPutApi) PriceMatch added in v1.0.1

func (api *PmUOrderPutApi) PriceMatch(PriceMatch string) *PmUOrderPutApi

func (*PmUOrderPutApi) Quantity added in v1.0.1

func (api *PmUOrderPutApi) Quantity(Quantity decimal.Decimal) *PmUOrderPutApi

func (*PmUOrderPutApi) RecvWindow added in v1.0.1

func (api *PmUOrderPutApi) RecvWindow(RecvWindow int64) *PmUOrderPutApi

func (*PmUOrderPutApi) Side added in v1.0.1

func (api *PmUOrderPutApi) Side(Side string) *PmUOrderPutApi

func (*PmUOrderPutApi) Symbol added in v1.0.1

func (api *PmUOrderPutApi) Symbol(Symbol string) *PmUOrderPutApi

func (*PmUOrderPutApi) Timestamp added in v1.0.1

func (api *PmUOrderPutApi) Timestamp(Timestamp int64) *PmUOrderPutApi

type PmUOrderPutReq added in v1.0.1

type PmUOrderPutReq struct {
	OrderId           *string          `json:"orderId,omitempty"`           //NO	系统订单号
	OrigClientOrderId *string          `json:"origClientOrderId,omitempty"` //NO	用户自定义的订单号
	Symbol            *string          `json:"symbol"`                      //YES	交易对
	Side              *string          `json:"side"`                        //YES	买卖方向 SELL, BUY; side需要和原订单相同
	Quantity          *decimal.Decimal `json:"quantity"`                    //YES	下单数量,使用closePosition不支持此参数。
	Price             *decimal.Decimal `json:"price"`                       //YES	委托价格
	PriceMatch        *string          `json:"priceMatch,omitempty"`        //NO	OPPONENT/ OPPONENT_5/ OPPONENT_10/ OPPONENT_20/QUEUE/ QUEUE_5/ QUEUE_10/ QUEUE_20;不能与price同时传
	RecvWindow        *int64           `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64           `json:"timestamp,omitempty"`         //YES
}

type PmUOrderPutRes added in v1.0.1

type PmUOrderPutRes struct {
	OrderId                 int64  `json:"orderId"`
	Symbol                  string `json:"symbol"`
	Pair                    string `json:"pair"`
	Status                  string `json:"status"`
	ClientOrderId           string `json:"clientOrderId"`
	Price                   string `json:"price"`
	AvgPrice                string `json:"avgPrice"`
	OrigQty                 string `json:"origQty"`
	ExecutedQty             string `json:"executedQty"`
	CumQty                  string `json:"cumQty"`
	CumBase                 string `json:"cumBase"`
	TimeInForce             string `json:"timeInForce"`
	Type                    string `json:"type"`
	ReduceOnly              bool   `json:"reduceOnly"`
	ClosePosition           bool   `json:"closePosition"`
	Side                    string `json:"side"`
	PositionSide            string `json:"positionSide"`
	StopPrice               string `json:"stopPrice"`
	WorkingType             string `json:"workingType"`
	PriceProtect            bool   `json:"priceProtect"`
	OrigType                string `json:"origType"`
	PriceMatch              string `json:"priceMatch"`              //盘口价格下单模式 与price只可同时传一个
	SelfTradePreventionMode string `json:"selfTradePreventionMode"` //订单自成交保护模式
	GoodTillDate            int64  `json:"goodTillDate"`            //订单TIF为GTD时的自动取消时间
	UpdateTime              int64  `json:"updateTime"`
}

type PmURestClient added in v1.0.1

type PmURestClient RestClient //zsk修改

func (*PmURestClient) NewAllOrders added in v1.0.1

func (client *PmURestClient) NewAllOrders() *PmUAllOrdersApi

binance PMU PmUAllOrders rest查询所有订单 (USER_DATA)

func (*PmURestClient) NewOpenOrders added in v1.0.1

func (client *PmURestClient) NewOpenOrders() *PmUOpenOrdersApi

交易接口 binance PMU PmUOpenOrders rest查询当前挂单 (USER_DATA)

func (*PmURestClient) NewPmUAccount added in v1.0.1

func (client *PmURestClient) NewPmUAccount() *PmUAccountApi

账户接口 binance PMU PmUAccount 统一账户信息 (USER_DATA)

func (*PmURestClient) NewPmUAccountBalance added in v1.0.1

func (client *PmURestClient) NewPmUAccountBalance() *PmUAccountBalanceApi

binance PMU PmUAccountBalance 统一账户余额 (USER_DATA)

func (*PmURestClient) NewPmUAccountForU added in v1.0.1

func (client *PmURestClient) NewPmUAccountForU() *PmUAccountForUApi

binance PMU PmUAccountForU UM账户信息v2 (USER_DATA)

func (*PmURestClient) NewPmUAllConditionnalOrderDelete added in v1.0.1

func (client *PmURestClient) NewPmUAllConditionnalOrderDelete() *PmUAllConditionnalOrderDeleteApi

func (*PmURestClient) NewPmUAllOrderDelete added in v1.0.1

func (client *PmURestClient) NewPmUAllOrderDelete() *PmUAllOrderDeleteApi

binance PMU PmUAllOrderDelete rest撤销全部订单 (TRADE)

func (*PmURestClient) NewPmUCommissionRate added in v1.0.1

func (client *PmURestClient) NewPmUCommissionRate() *PmUCommissionRateApi

func (*PmURestClient) NewPmUConditionalOrderDelete added in v1.0.1

func (client *PmURestClient) NewPmUConditionalOrderDelete() *PmUConditionalOrderDeleteApi

func (*PmURestClient) NewPmUConditionalOrderPost added in v1.0.1

func (client *PmURestClient) NewPmUConditionalOrderPost() *PmUConditionalOrderPostApi

func (*PmURestClient) NewPmUListenKeyDelete added in v1.0.1

func (client *PmURestClient) NewPmUListenKeyDelete() *PmUListenKeyDeleteApi

binance PMU PmUListenKeyDelete rest关闭listenKey (USER_STREAM)

func (*PmURestClient) NewPmUListenKeyPost added in v1.0.1

func (client *PmURestClient) NewPmUListenKeyPost() *PmUListenKeyPostApi

Ws账户推送相关 binance PMU PmUListenKeyPost rest生成listenKey (USER_STREAM)

func (*PmURestClient) NewPmUListenKeyPut added in v1.0.1

func (client *PmURestClient) NewPmUListenKeyPut() *PmUListenKeyPutApi

binance PMU PmUListenKeyPut rest延长listenKey有效期 (USER_STREAM)

func (*PmURestClient) NewPmUOrderDelete added in v1.0.1

func (client *PmURestClient) NewPmUOrderDelete() *PmUOrderDeleteApi

binance PMU PmUOrderDelete rest撤销订单 (TRADE)

func (*PmURestClient) NewPmUOrderGet added in v1.0.1

func (client *PmURestClient) NewPmUOrderGet() *PmUOrderGetApi

binance PMU PmUOrderGet rest查询订单 (USER_DATA)

func (*PmURestClient) NewPmUOrderPost added in v1.0.1

func (client *PmURestClient) NewPmUOrderPost() *PmUOrderPostApi

binance PMU PmUOrderPost rest下单 (TRADE)

func (*PmURestClient) NewPmUOrderPut added in v1.0.1

func (client *PmURestClient) NewPmUOrderPut() *PmUOrderPutApi

binance PMU PmUOrderPut rest修改订单 (TRADE)

func (*PmURestClient) NewPmUUserTrades added in v1.0.1

func (client *PmURestClient) NewPmUUserTrades() *PmUUserTradesApi

type PmUUserTradesApi added in v1.0.1

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

func (*PmUUserTradesApi) Do added in v1.0.1

func (api *PmUUserTradesApi) Do() (*PmUUserTradesRes, error)

func (*PmUUserTradesApi) EndTime added in v1.0.1

func (api *PmUUserTradesApi) EndTime(EndTime int64) *PmUUserTradesApi

func (*PmUUserTradesApi) FromId added in v1.0.1

func (api *PmUUserTradesApi) FromId(FromId int64) *PmUUserTradesApi

func (*PmUUserTradesApi) Limit added in v1.0.1

func (api *PmUUserTradesApi) Limit(Limit int64) *PmUUserTradesApi

func (*PmUUserTradesApi) RecvWindow added in v1.0.1

func (api *PmUUserTradesApi) RecvWindow(RecvWindow int64) *PmUUserTradesApi

func (*PmUUserTradesApi) StartTime added in v1.0.1

func (api *PmUUserTradesApi) StartTime(StartTime int64) *PmUUserTradesApi

func (*PmUUserTradesApi) Symbol added in v1.0.1

func (api *PmUUserTradesApi) Symbol(Symbol string) *PmUUserTradesApi

func (*PmUUserTradesApi) Timestamp added in v1.0.1

func (api *PmUUserTradesApi) Timestamp(Timestamp int64) *PmUUserTradesApi

type PmUUserTradesOrder added in v1.0.1

type PmUUserTradesOrder struct {
	Symbol          string `json:"symbol"`
	Id              int64  `json:"id"`
	OrderId         int64  `json:"orderId"`
	Side            string `json:"side"`
	Price           string `json:"price"`
	Qty             string `json:"qty"`
	RealizedPnl     string `json:"realizedPnl"`
	QuoteQty        string `json:"quoteQty"`
	Commission      string `json:"commission"`
	CommissionAsset string `json:"commissionAsset"`
	Time            int64  `json:"time"`
	Buyer           bool   `json:"buyer"`
	Maker           bool   `json:"maker"`
	PositionSide    string `json:"positionSide"`
}

type PmUUserTradesReq added in v1.0.1

type PmUUserTradesReq struct {
	Symbol     *string `json:"symbol"`     //YES	交易对
	StartTime  *int64  `json:"startTime"`  //NO
	EndTime    *int64  `json:"endTime"`    //NO
	FromId     *int64  `json:"fromId"`     //NO 返回该fromId及之后的成交,缺省返回最近的成交
	Limit      *int64  `json:"limit"`      //NO 返回的结果集数量 默认值:50 最大值:1000
	RecvWindow *int64  `json:"recvWindow"` //NO
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type PmUUserTradesRes added in v1.0.1

type PmUUserTradesRes []PmUUserTradesOrder

type PmUWsStreamClient added in v1.0.1

type PmUWsStreamClient struct {
	WsStreamClient
	// contains filtered or unexported fields
}

zsk修改

func (*PmUWsStreamClient) Close added in v1.0.1

func (ws *PmUWsStreamClient) Close() error

zsk修改

func (*PmUWsStreamClient) ConvertToAccountWs added in v1.0.1

func (ws *PmUWsStreamClient) ConvertToAccountWs(apiKey string, apiSecret string) (*PmUWsStreamClient, error)

zsk修改

func (*PmUWsStreamClient) CreatePayload added in v1.0.1

func (ws *PmUWsStreamClient) CreatePayload() (*WsPmUPayload, error)

zsk修改

type PriceLevel

type PriceLevel struct {
	Price    float64 `json:"price"`
	Quantity float64 `json:"quantity"`
}

type ProxyWeight

type ProxyWeight struct {
	UsedWeight   int  //已用权重
	Is429Limited bool //是否被限制
}

type RateLimit

type RateLimit struct {
	RateLimitType string `json:"rateLimitType"`
	Interval      string `json:"interval"`
	IntervalNum   int    `json:"intervalNum"`
	Limit         int    `json:"limit"`
	Count         int    `json:"count"`
}

type RequestType

type RequestType string

type RestClient

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

type RestProxy

type RestProxy struct {
	ProxyUrl string //代理的协议IP端口URL

	SpotWeight   ProxyWeight
	FutureWeight ProxyWeight
	SwapWeight   ProxyWeight
	PmWeight     ProxyWeight //zsk修改
}

func GetCurrentProxyList

func GetCurrentProxyList() []*RestProxy

type SpotAccountApi

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

func (*SpotAccountApi) Do

func (api *SpotAccountApi) Do() (*SpotAccountRes, error)

func (*SpotAccountApi) OmitZeroBalances

func (api *SpotAccountApi) OmitZeroBalances(OmitZeroBalances bool) *SpotAccountApi

func (*SpotAccountApi) RecvWindow

func (api *SpotAccountApi) RecvWindow(RecvWindow int64) *SpotAccountApi

func (*SpotAccountApi) Timestamp

func (api *SpotAccountApi) Timestamp(Timestamp int64) *SpotAccountApi

type SpotAccountApiTradingStatusApi

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

func (*SpotAccountApiTradingStatusApi) Do

func (*SpotAccountApiTradingStatusApi) RecvWindow

func (*SpotAccountApiTradingStatusApi) Timestamp

type SpotAccountApiTradingStatusData

type SpotAccountApiTradingStatusData struct {
	IsLocked           bool                                        `json:"isLocked"`
	PlannedRecoverTime int64                                       `json:"plannedRecoverTime"`
	TriggerCondition   SpotAccountApiTradingStatusTriggerCondition `json:"triggerCondition"`
	UpdateTime         int64                                       `json:"updateTime"`
}

type SpotAccountApiTradingStatusReq

type SpotAccountApiTradingStatusReq struct {
	RecvWindow *int64 `json:"recvWindow"` //NO 	赋值不能大于 60000
	Timestamp  *int64 `json:"timestamp"`  //YES
}

type SpotAccountApiTradingStatusRes

type SpotAccountApiTradingStatusRes struct {
	Data SpotAccountApiTradingStatusData `json:"data"`
}

type SpotAccountApiTradingStatusTriggerCondition

type SpotAccountApiTradingStatusTriggerCondition struct {
	GCR  int64 `json:"GCR"`
	IFER int64 `json:"IFER"`
	UFR  int64 `json:"UFR"`
}

type SpotAccountCommissionRates

type SpotAccountCommissionRates struct {
	Maker  string `json:"maker"`
	Taker  string `json:"taker"`
	Buyer  string `json:"buyer"`
	Seller string `json:"seller"`
}

type SpotAccountReq

type SpotAccountReq struct {
	OmitZeroBalances *bool  `json:"omitZeroBalances"` //NO	默认 false, 设为 true 时,返回结果不包含为 0 的资产
	RecvWindow       *int64 `json:"recvWindow"`
	Timestamp        *int64 `json:"timestamp"`
}

type SpotAccountRes

type SpotAccountRes struct {
	MakerCommission            int                        `json:"makerCommission"`
	TakerCommission            int                        `json:"takerCommission"`
	BuyerCommission            int                        `json:"buyerCommission"`
	SellerCommission           int                        `json:"sellerCommission"`
	CommissionRates            SpotAccountCommissionRates `json:"commissionRates"`
	CanTrade                   bool                       `json:"canTrade"`
	CanWithdraw                bool                       `json:"canWithdraw"`
	CanDeposit                 bool                       `json:"canDeposit"`
	Brokered                   bool                       `json:"brokered"`
	RequireSelfTradePrevention bool                       `json:"requireSelfTradePrevention"`
	PreventSor                 bool                       `json:"preventSor"`
	UpdateTime                 int64                      `json:"updateTime"`
	AccountType                string                     `json:"accountType"`
	Balance                    []SpotBalance              `json:"balances"`
	Permissions                []string                   `json:"permissions"`
	Uid                        int64                      `json:"uid"`
}

type SpotAggTradesApi

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

func (*SpotAggTradesApi) Do

func (api *SpotAggTradesApi) Do() (*SpotAggTradesRes, error)

func (*SpotAggTradesApi) EndTime

func (api *SpotAggTradesApi) EndTime(EndTime int64) *SpotAggTradesApi

func (*SpotAggTradesApi) FromId

func (api *SpotAggTradesApi) FromId(FromId int64) *SpotAggTradesApi

func (*SpotAggTradesApi) Limit

func (api *SpotAggTradesApi) Limit(Limit int) *SpotAggTradesApi

func (*SpotAggTradesApi) StartTime

func (api *SpotAggTradesApi) StartTime(StartTime int64) *SpotAggTradesApi

func (*SpotAggTradesApi) Symbol

func (api *SpotAggTradesApi) Symbol(Symbol string) *SpotAggTradesApi

type SpotAggTradesReq

type SpotAggTradesReq struct {
	Symbol    *string `json:"symbol"`    //YES
	FromId    *int64  `json:"fromId"`    //NO	从包含fromId的成交id开始返回结果
	StartTime *int64  `json:"startTime"` //NO	从该时刻之后的成交记录开始返回结果
	EndTime   *int64  `json:"endTime"`   //NO	返回该时刻为止的成交记录
	Limit     *int    `json:"limit"`     //NO	默认 500; 最大 1000.
}

type SpotAggTradesRes

type SpotAggTradesRes []SpotAggTradesResRow

type SpotAggTradesResRow

type SpotAggTradesResRow struct {
	Id           int64  `json:"a"` // 归集成交ID
	Price        string `json:"p"` // 成交价格
	Qty          string `json:"q"` // 成交数量
	FirstTradeId int64  `json:"f"` // 被归集的首个成交ID
	LastTradeId  int64  `json:"l"` // 被归集的末个成交ID
	Time         int64  `json:"T"` // 成交时间
	IsBuyerMaker bool   `json:"m"` // 是否为主动卖出单
	IsBestMatch  bool   `json:"M"` // 是否为最优撮合单(可忽略,目前总为最优撮合)
}

type SpotAllOrdersApi

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

func (*SpotAllOrdersApi) Do

func (api *SpotAllOrdersApi) Do() (*SpotAllOrdersRes, error)

func (*SpotAllOrdersApi) EndTime

func (api *SpotAllOrdersApi) EndTime(EndTime int64) *SpotAllOrdersApi

func (*SpotAllOrdersApi) Limit

func (api *SpotAllOrdersApi) Limit(Limit int) *SpotAllOrdersApi

func (*SpotAllOrdersApi) OrderId

func (api *SpotAllOrdersApi) OrderId(OrderId int64) *SpotAllOrdersApi

func (*SpotAllOrdersApi) RecvWindow

func (api *SpotAllOrdersApi) RecvWindow(RecvWindow int64) *SpotAllOrdersApi

func (*SpotAllOrdersApi) StartTime

func (api *SpotAllOrdersApi) StartTime(StartTime int64) *SpotAllOrdersApi

func (*SpotAllOrdersApi) Symbol

func (api *SpotAllOrdersApi) Symbol(Symbol string) *SpotAllOrdersApi

func (*SpotAllOrdersApi) Timestamp

func (api *SpotAllOrdersApi) Timestamp(Timestamp int64) *SpotAllOrdersApi

type SpotAllOrdersReq

type SpotAllOrdersReq struct {
	Symbol     *string `json:"symbol"`     //YES
	OrderId    *int64  `json:"orderId"`    //NO
	StartTime  *int64  `json:"startTime"`  //NO
	EndTime    *int64  `json:"endTime"`    //NO
	Limit      *int    `json:"limit"`      //NO 默认 500; 最大 1000.
	RecvWindow *int64  `json:"recvWindow"` //NO 	赋值不能大于 60000
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type SpotAllOrdersRes

type SpotAllOrdersRes []SpotOrderOrder

type SpotApi

type SpotApi int
const (

	//子母账户接口
	SpotSubAccountList                     SpotApi = iota //GET接口 查询子账户列表(适用主账户)
	SpotSubAccountUniversalTransferHistory                //GET接口 查询子母账户万能划转历史查询
	SpotSubAccountAssets                                  //GET接口 查询子账户资产 (适用主账户)(USER_DATA)
	SpotSubAccountFuturesAccount                          //GET接口 查询子账户Futures账户详情V2 (适用主账户)
	SpotSubAccountApiIpRestriction                        //GET接口 查询子账户API Key IP白名单 (适用母账户)
	SpotSubAccountTransferSubUserHistory                  //GET接口 查询子账户划转历史 (仅适用子账户)
	SpotManagedSubAccountQueryTransLog                    //GET接口 查询托管子账户的划转记录(适用交易团队子账户)(USER_DATA)
	SpotSubAccountVirtualSubAccount                       //POST接口 创建虚拟子账户(适用主账户)
	SpotSubAccountUniversalTransfer                       //POST接口 子母账户万能划转 (适用主账户)
	SpotSubAccountFuturesEnable                           //POST接口 为子账户开通Futures (适用主账户)

	//杠杆账户接口
	SpotMarginAllPairs         //GET接口 获取所有全仓杠杆交易对(MARKET_DATA)
	SpotMarginIsolatedAllPairs //GET接口 获取所有逐仓杠杆交易对(USER_DATA)
	SpotMarginAccount          //GET接口 查询全仓杠杆账户详情 (USER_DATA)
	SpotMarginIsolatedAccount  //GET接口 查询逐仓杠杆账户详情 (USER_DATA)
	SpotMarginMaxBorrowable    //GET接口 查询账户最大可借贷额度(USER_DATA)
	SpotMarginMaxTransferable  //GET接口 查询最大可转出额 (USER_DATA)
	SpotMarginInterestHistory  //GET接口 获取利息历史 (USER_DATA)

	SpotMarginOrderGet    //GET接口 查询杠杆账户订单 (USER_DATA)
	SpotMarginOrderPost   //POST接口 杠杆账户下单 (TRADE)
	SpotMarginOrderDelete //DELETE接口 撤销订单 (TRADE)
	SpotMarginAllOrders   //GET接口 查询杠杆账户所有订单 (USER_DATA)
	SpotMarginOpenOrders  //GET接口 查询杠杆账户挂单记录 (USER_DATA)

	SpotMarginTransfer         //POST接口 全仓杠杆账户划转 (MARGIN)
	SpotMarginIsolatedTransfer //POST接口 逐仓杠杆账户划转 (MARGIN)
	SpotMarginLoan             //POST接口 杠杆账户借贷 (MARGIN) 支持逐仓和全仓
	SpotMarginRepay            //POST接口 杠杆账户归还借贷 (MARGIN) 支持逐仓和全仓

	//现货账户接口
	SpotAccountApiTradingStatus //GET接口 账户API交易状态(USER_DATA)
	SpotAccount                 //GET接口 账户信息 (USER_DATA)
	SpotAssetGetFundingAsset    //POST接口 资金账户 (USER_DATA)
	SpotAssetTransferPost       //POST接口 用户万向划转 (USER_DATA)
	SpotAssetTransferGet        //GET接口 查询用户万向划转历史 (USER_DATA)
	SpotAssetTradeFee           //GET接口 查询用户交易手续费率 (USER_DATA)

	//现货订单接口
	SpotOpenOrders         //GET接口 查询当前挂单 (USER_DATA)
	SpotAllOrders          //GET接口 查询所有订单 (USER_DATA)
	SpotOrderGet           //GET接口 查询订单 (USER_DATA)
	SpotOrderPost          //POST接口 下单 (TRADE)
	SpotOrderDelete        //DELETE接口 撤销订单 (TRADE)
	SpotOrderCancelReplace //POST接口 撤消挂单再下单 (TRADE)
	SpotMyTrades           //GET接口 账户成交历史 (USER_DATA)

	//通用接口
	SpotPing         //GET接口 测试服务器连通性
	SpotServerTime   //GET接口 获取服务器时间
	SpotExchangeInfo //GET接口 获取交易规则和交易对信息。

	//行情接口
	SpotKlines           //GET接口 K线数据
	SpotTickerPrice      //GET接口 获取交易对最新价格
	SpotDepth            //GET接口 获取深度信息
	SpotTrades           //GET接口 近期成交列表
	SpotHistoricalTrades //GET接口 历史成交记录
	SpotAggTrades        //GET接口 近期成交(归集)
	SpotAvgPrice         //GET接口 当前平均价格
	SpotUiKlines         //GET接口 UIK线数据
	SpotTicker24hr       //GET接口 24hr 价格变动情况
	SpotTickerBookTicker //GET接口 当前最优挂单
	SpotTicker           //GET接口 滚动窗口价格变动统计

	//Ws账户推送相关
	SpotUserDataStreamPost   //POST接口    (现货账户)生成 Listen Key (USER_STREAM)
	SpotUserDataStreamPut    //PUT接口    (现货账户)延长 Listen Key 有效期 (USER_STREAM)
	SpotUserDataStreamDelete //DELETE接口 (现货账户)关闭 Listen Key (USER_STREAM)

	SpotMarginUserDataStreamPost   //POST接口   (杠杆账户)生成 Listen Key (USER_STREAM)
	SpotMarginUserDataStreamPut    //PUT接口    (杠杆账户)延长 Listen Key 有效期 (USER_STREAM)
	SpotMarginUserDataStreamDelete //DELETE接口 (杠杆账户)关闭 Listen Key (USER_STREAM)

	SpotMarginIsolatedUserDataStreamPost   //POST接口   (逐仓杠杆账户)生成 Listen Key (USER_STREAM)
	SpotMarginIsolatedUserDataStreamPut    //PUT接口    (逐仓杠杆账户)延长 Listen Key 有效期 (USER_STREAM)
	SpotMarginIsolatedUserDataStreamDelete //DELETE接口 (逐仓杠杆账户)关闭 Listen Key (USER_STREAM)
)

type SpotAssetGetFundingAssetApi

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

func (*SpotAssetGetFundingAssetApi) Asset

func (*SpotAssetGetFundingAssetApi) Do

func (*SpotAssetGetFundingAssetApi) NeedBtcValuation

func (api *SpotAssetGetFundingAssetApi) NeedBtcValuation(NeedBtcValuation string) *SpotAssetGetFundingAssetApi

func (*SpotAssetGetFundingAssetApi) RecvWindow

func (api *SpotAssetGetFundingAssetApi) RecvWindow(RecvWindow int64) *SpotAssetGetFundingAssetApi

func (*SpotAssetGetFundingAssetApi) Timestamp

type SpotAssetGetFundingAssetReq

type SpotAssetGetFundingAssetReq struct {
	Asset            *string `json:"asset"`            //NO
	NeedBtcValuation *string `json:"needBtcValuation"` //NO	true or false
	RecvWindow       *int64  `json:"recvWindow"`       //NO
	Timestamp        *int64  `json:"timestamp"`        //YES
}

type SpotAssetGetFundingAssetRes

type SpotAssetGetFundingAssetRes []SpotAssetGetFundingAssetResRow

type SpotAssetGetFundingAssetResRow

type SpotAssetGetFundingAssetResRow struct {
	Asset        string `json:"asset"`
	Free         string `json:"free"`         // 可用余额
	Locked       string `json:"locked"`       // 锁定资金
	Freeze       string `json:"freeze"`       //冻结资金
	Withdrawing  string `json:"withdrawing"`  // 提币
	BtcValuation string `json:"btcValuation"` // btc估值
}

type SpotAssetTradeFeeApi

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

func (*SpotAssetTradeFeeApi) Do

func (*SpotAssetTradeFeeApi) RecvWindow

func (api *SpotAssetTradeFeeApi) RecvWindow(RecvWindow int64) *SpotAssetTradeFeeApi

func (*SpotAssetTradeFeeApi) Symbol

func (api *SpotAssetTradeFeeApi) Symbol(Symbol string) *SpotAssetTradeFeeApi

func (*SpotAssetTradeFeeApi) Timestamp

func (api *SpotAssetTradeFeeApi) Timestamp(Timestamp int64) *SpotAssetTradeFeeApi

type SpotAssetTradeFeeReq

type SpotAssetTradeFeeReq struct {
	Symbol     *string `json:"symbol"`     //NO
	RecvWindow *int64  `json:"recvWindow"` //NO
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type SpotAssetTradeFeeRes

type SpotAssetTradeFeeRes []SpotAssetTradeFeeResRow

type SpotAssetTradeFeeResRow

type SpotAssetTradeFeeResRow struct {
	Symbol          string `json:"symbol"`
	MakerCommission string `json:"makerCommission"`
	TakerCommission string `json:"takerCommission"`
}

type SpotAssetTransferGetApi

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

func (*SpotAssetTransferGetApi) Current

func (api *SpotAssetTransferGetApi) Current(Current int64) *SpotAssetTransferGetApi

func (*SpotAssetTransferGetApi) Do

func (*SpotAssetTransferGetApi) EndTime

func (api *SpotAssetTransferGetApi) EndTime(EndTime int64) *SpotAssetTransferGetApi

func (*SpotAssetTransferGetApi) FromSymbol

func (api *SpotAssetTransferGetApi) FromSymbol(FromSymbol string) *SpotAssetTransferGetApi

func (*SpotAssetTransferGetApi) RecvWindow

func (api *SpotAssetTransferGetApi) RecvWindow(RecvWindow int64) *SpotAssetTransferGetApi

func (*SpotAssetTransferGetApi) Size

func (*SpotAssetTransferGetApi) StartTime

func (api *SpotAssetTransferGetApi) StartTime(StartTime int64) *SpotAssetTransferGetApi

func (*SpotAssetTransferGetApi) Timestamp

func (api *SpotAssetTransferGetApi) Timestamp(Timestamp int64) *SpotAssetTransferGetApi

func (*SpotAssetTransferGetApi) ToSymbol

func (api *SpotAssetTransferGetApi) ToSymbol(ToSymbol string) *SpotAssetTransferGetApi

func (*SpotAssetTransferGetApi) Type

type SpotAssetTransferGetReq

type SpotAssetTransferGetReq struct {
	Type       *AssertTransferType `json:"type"`       //YES
	StartTime  *int64              `json:"startTime"`  //NO
	EndTime    *int64              `json:"endTime"`    //NO
	Current    *int64              `json:"current"`    //NO	默认 1
	Size       *int64              `json:"size"`       //NO	默认 10, 最大 100
	FromSymbol *string             `json:"fromSymbol"` //NO
	ToSymbol   *string             `json:"toSymbol"`   //NO
	RecvWindow *int64              `json:"recvWindow"` //NO
	Timestamp  *int64              `json:"timestamp"`  //YES
}

type SpotAssetTransferGetRes

type SpotAssetTransferGetRes struct {
	Total int                       `json:"total"`
	Rows  []SpotAssetTransferGetRow `json:"rows"`
}

type SpotAssetTransferGetRow

type SpotAssetTransferGetRow struct {
	Asset     string `json:"asset"`
	Amount    string `json:"amount"`
	Type      string `json:"type"`
	Status    string `json:"status"`
	TranId    int64  `json:"tranId"`
	Timestamp int64  `json:"timestamp"`
}

type SpotAssetTransferPostApi

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

func (*SpotAssetTransferPostApi) Amount

func (*SpotAssetTransferPostApi) Asset

func (*SpotAssetTransferPostApi) Do

func (*SpotAssetTransferPostApi) FromSymbol

func (api *SpotAssetTransferPostApi) FromSymbol(FromSymbol string) *SpotAssetTransferPostApi

func (*SpotAssetTransferPostApi) RecvWindow

func (api *SpotAssetTransferPostApi) RecvWindow(RecvWindow int64) *SpotAssetTransferPostApi

func (*SpotAssetTransferPostApi) Timestamp

func (api *SpotAssetTransferPostApi) Timestamp(Timestamp int64) *SpotAssetTransferPostApi

func (*SpotAssetTransferPostApi) ToSymbol

func (api *SpotAssetTransferPostApi) ToSymbol(ToSymbol string) *SpotAssetTransferPostApi

func (*SpotAssetTransferPostApi) Type

type SpotAssetTransferPostReq

type SpotAssetTransferPostReq struct {
	Type       *AssertTransferType `json:"type"`       //YES
	Asset      *string             `json:"asset"`      //YES
	Amount     *decimal.Decimal    `json:"amount"`     //YES
	FromSymbol *string             `json:"fromSymbol"` //NO
	ToSymbol   *string             `json:"toSymbol"`   //NO
	RecvWindow *int64              `json:"recvWindow"` //NO
	Timestamp  *int64              `json:"timestamp"`  //YES
}

type SpotAssetTransferPostRes

type SpotAssetTransferPostRes struct {
	TranId int64 `json:"tranId"`
}

type SpotAvgPriceApi

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

func (*SpotAvgPriceApi) Do

func (api *SpotAvgPriceApi) Do() (*SpotAvgPriceRes, error)

func (*SpotAvgPriceApi) Symbol

func (api *SpotAvgPriceApi) Symbol(Symbol string) *SpotAvgPriceApi

type SpotAvgPriceReq

type SpotAvgPriceReq struct {
	Symbol *string `json:"symbol"` //YES
}

type SpotAvgPriceRes

type SpotAvgPriceRes struct {
	Mins  int64  `json:"mins"`  // 价格平均值计算时间
	Price string `json:"price"` // 价格平均值
}

type SpotBalance

type SpotBalance struct {
	Asset  string `json:"asset"`
	Free   string `json:"free"`
	Locked string `json:"locked"`
}

type SpotDepthApi

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

func (*SpotDepthApi) Do

func (api *SpotDepthApi) Do() (*SpotDepthRes, error)

func (*SpotDepthApi) Limit

func (api *SpotDepthApi) Limit(Limit int) *SpotDepthApi

func (*SpotDepthApi) Symbol

func (api *SpotDepthApi) Symbol(Symbol string) *SpotDepthApi

type SpotDepthReq

type SpotDepthReq struct {
	Symbol *string `json:"symbol"` //YES
	Limit  *int    `json:"limit"`  //NO	默认 100; 最大 5000. 可选值:[5, 10, 20, 50, 100, 500, 1000, 5000]
}

type SpotDepthRes

type SpotDepthRes struct {
	LastUpdateId int64       `json:"lastUpdateId"`
	Bids         []DepthGear `json:"bids"`
	Asks         []DepthGear `json:"asks"`
}

type SpotDepthResMiddle

type SpotDepthResMiddle struct {
	LastUpdateId int64           `json:"lastUpdateId"`
	Bids         [][]interface{} `json:"bids"`
	Asks         [][]interface{} `json:"asks"`
}

func (*SpotDepthResMiddle) ConvertToRes

func (middle *SpotDepthResMiddle) ConvertToRes() *SpotDepthRes

type SpotExchangeInfoApi

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

func (*SpotExchangeInfoApi) Do

type SpotExchangeInfoReq

type SpotExchangeInfoReq struct {
}

type SpotExchangeInfoRes

type SpotExchangeInfoRes struct {
	Timezone        string                         `json:"timezone"`
	ServerTime      int64                          `json:"serverTime"`
	RateLimits      []SpotExchangeInfoResRateLimit `json:"rateLimits"`
	ExchangeFilters []map[string]interface{}       `json:"exchangeFilters"`
	Symbols         []SpotExchangeInfoResSymbol    `json:"symbols"`
}

type SpotExchangeInfoResRateLimit

type SpotExchangeInfoResRateLimit struct {
	Interval      string `json:"interval"`      // 限制的时间间隔
	IntervalNum   int64  `json:"intervalNum"`   // 限制的时间间隔数量
	Limit         int64  `json:"limit"`         // 限制的请求数量
	RateLimitType string `json:"rateLimitType"` // 限制的请求数量的类型
}

type SpotExchangeInfoResSymbol

type SpotExchangeInfoResSymbol struct {
	Symbol                          string                   `json:"symbol"`
	Status                          string                   `json:"status"`
	BaseAsset                       string                   `json:"baseAsset"`
	BaseAssetPrecision              int64                    `json:"baseAssetPrecision"`
	QuoteAsset                      string                   `json:"quoteAsset"`
	QuotePrecision                  int64                    `json:"quotePrecision"`
	QuoteAssetPrecision             int64                    `json:"quoteAssetPrecision"`
	OrderTypes                      []string                 `json:"orderTypes"`
	IcebergAllowed                  bool                     `json:"icebergAllowed"`
	OcoAllowed                      bool                     `json:"ocoAllowed"`
	QuoteOrderQtyMarketAllowed      bool                     `json:"quoteOrderQtyMarketAllowed"`
	AllowTrailingStop               bool                     `json:"allowTrailingStop"`
	IsSpotTradingAllowed            bool                     `json:"isSpotTradingAllowed"`
	IsMarginTradingAllowed          bool                     `json:"isMarginTradingAllowed"`
	CancelReplaceAllowed            bool                     `json:"cancelReplaceAllowed"`
	Filters                         []map[string]interface{} `json:"filters"`
	Permissions                     []string                 `json:"permissions"`
	DefaultSelfTradePreventionMode  string                   `json:"defaultSelfTradePreventionMode"`
	AllowedSelfTradePreventionModes []string                 `json:"allowedSelfTradePreventionModes"`
}

type SpotHistoricalTradesApi

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

func (*SpotHistoricalTradesApi) Do

func (*SpotHistoricalTradesApi) FromId

func (*SpotHistoricalTradesApi) Limit

func (*SpotHistoricalTradesApi) Symbol

type SpotHistoricalTradesReq

type SpotHistoricalTradesReq struct {
	Symbol *string `json:"symbol"` //YES
	Limit  *int    `json:"limit"`  //NO	默认 500; 最大值 1000.
	FromId *int64  `json:"fromId"` //NO	从哪一条成交id开始返回. 缺省返回最近的成交记录。
}

type SpotHistoricalTradesRes

type SpotHistoricalTradesRes []SpotTradesResRow

type SpotKlinesApi

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

func (*SpotKlinesApi) Do

func (api *SpotKlinesApi) Do() (*KlinesRes, error)

func (*SpotKlinesApi) EndTime

func (api *SpotKlinesApi) EndTime(EndTime int64) *SpotKlinesApi

func (*SpotKlinesApi) Interval

func (api *SpotKlinesApi) Interval(Interval string) *SpotKlinesApi

func (*SpotKlinesApi) Limit

func (api *SpotKlinesApi) Limit(Limit int) *SpotKlinesApi

func (*SpotKlinesApi) StartTime

func (api *SpotKlinesApi) StartTime(StartTime int64) *SpotKlinesApi

func (*SpotKlinesApi) Symbol

func (api *SpotKlinesApi) Symbol(Symbol string) *SpotKlinesApi

type SpotKlinesReq

type SpotKlinesReq struct {
	Symbol    *string `json:"symbol"`    //YES
	Interval  *string `json:"interval"`  //YES	详见枚举定义:K线间隔
	StartTime *int64  `json:"startTime"` //NO
	EndTime   *int64  `json:"endTime"`   //NO
	Limit     *int    `json:"limit"`     //NO	默认 500; 最大 1000.
}

type SpotManagedSubAccountQueryTransLogApi

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

func (*SpotManagedSubAccountQueryTransLogApi) Do

func (*SpotManagedSubAccountQueryTransLogApi) EndTime

func (*SpotManagedSubAccountQueryTransLogApi) Limit

func (*SpotManagedSubAccountQueryTransLogApi) Page

func (*SpotManagedSubAccountQueryTransLogApi) RecvWindow

func (*SpotManagedSubAccountQueryTransLogApi) StartTime

func (*SpotManagedSubAccountQueryTransLogApi) Timestamp

func (*SpotManagedSubAccountQueryTransLogApi) TransferFunctionAccountType

func (api *SpotManagedSubAccountQueryTransLogApi) TransferFunctionAccountType(TransferFunctionAccountType string) *SpotManagedSubAccountQueryTransLogApi

func (*SpotManagedSubAccountQueryTransLogApi) Transfers

type SpotManagedSubAccountQueryTransLogReq

type SpotManagedSubAccountQueryTransLogReq struct {
	StartTime                   *int64  `json:"startTime"`                   //YES	开始时间
	EndTime                     *int64  `json:"endTime"`                     //YES	结束时间(开始时间结束时间间隔不能超过半年)
	Page                        *int    `json:"page"`                        //YES	页数
	Limit                       *int    `json:"limit"`                       //YES	每页数量 (最大值: 500)
	Transfers                   *string `json:"transfers"`                   //NO	划转方向 (FROM/TO)
	TransferFunctionAccountType *string `json:"transferFunctionAccountType"` //NO	划转账户类型 (SPOT/MARGIN/ISOLATED_MARGIN/USDT_FUTURE/COIN_FUTURE)
	RecvWindow                  *int64  `json:"recvWindow"`                  //NO
	Timestamp                   *int64  `json:"timestamp"`                   //YES
}

type SpotMarginAccountApi

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

func (*SpotMarginAccountApi) Do

func (*SpotMarginAccountApi) RecvWindow

func (api *SpotMarginAccountApi) RecvWindow(RecvWindow int64) *SpotMarginAccountApi

func (*SpotMarginAccountApi) Timestamp

func (api *SpotMarginAccountApi) Timestamp(Timestamp int64) *SpotMarginAccountApi

type SpotMarginAccountReq

type SpotMarginAccountReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

type SpotMarginAllOrdersApi

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

func (*SpotMarginAllOrdersApi) Do

func (*SpotMarginAllOrdersApi) EndTime

func (api *SpotMarginAllOrdersApi) EndTime(EndTime int64) *SpotMarginAllOrdersApi

func (*SpotMarginAllOrdersApi) IsIsolated

func (api *SpotMarginAllOrdersApi) IsIsolated(IsIsolated string) *SpotMarginAllOrdersApi

func (*SpotMarginAllOrdersApi) Limit

func (*SpotMarginAllOrdersApi) OrderId

func (api *SpotMarginAllOrdersApi) OrderId(OrderId int64) *SpotMarginAllOrdersApi

func (*SpotMarginAllOrdersApi) RecvWindow

func (api *SpotMarginAllOrdersApi) RecvWindow(RecvWindow int64) *SpotMarginAllOrdersApi

func (*SpotMarginAllOrdersApi) StartTime

func (api *SpotMarginAllOrdersApi) StartTime(StartTime int64) *SpotMarginAllOrdersApi

func (*SpotMarginAllOrdersApi) Symbol

func (*SpotMarginAllOrdersApi) Timestamp

func (api *SpotMarginAllOrdersApi) Timestamp(Timestamp int64) *SpotMarginAllOrdersApi

type SpotMarginAllOrdersReq

type SpotMarginAllOrdersReq struct {
	Symbol     *string `json:"symbol"`     //YES
	IsIsolated *string `json:"isIsolated"` //NO 	是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
	OrderId    *int64  `json:"orderId"`    //NO
	StartTime  *int64  `json:"startTime"`  //NO
	EndTime    *int64  `json:"endTime"`    //NO
	Limit      *int64  `json:"limit"`      //NO	默认 500;最大500.
	RecvWindow *int64  `json:"recvWindow"` //NO 赋值不能大于 60000
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type SpotMarginAllPairsApi

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

func (*SpotMarginAllPairsApi) Do

func (*SpotMarginAllPairsApi) RecvWindow

func (api *SpotMarginAllPairsApi) RecvWindow(RecvWindow int64) *SpotMarginAllPairsApi

func (*SpotMarginAllPairsApi) Timestamp

func (api *SpotMarginAllPairsApi) Timestamp(Timestamp int64) *SpotMarginAllPairsApi

type SpotMarginAllPairsReq

type SpotMarginAllPairsReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

type SpotMarginInterestHistoryApi

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

func (*SpotMarginInterestHistoryApi) Archived

func (*SpotMarginInterestHistoryApi) Asset

func (*SpotMarginInterestHistoryApi) Current

func (*SpotMarginInterestHistoryApi) Do

func (*SpotMarginInterestHistoryApi) EndTime

func (*SpotMarginInterestHistoryApi) IsolatedSymbol

func (api *SpotMarginInterestHistoryApi) IsolatedSymbol(IsolatedSymbol string) *SpotMarginInterestHistoryApi

func (*SpotMarginInterestHistoryApi) RecvWindow

func (*SpotMarginInterestHistoryApi) Size

func (*SpotMarginInterestHistoryApi) StartTime

func (*SpotMarginInterestHistoryApi) Timestamp

type SpotMarginInterestHistoryReq

type SpotMarginInterestHistoryReq struct {
	Asset          *string `json:"asset"`          //NO 币种, 比如, BTC
	IsolatedSymbol *string `json:"isolatedSymbol"` //NO 逐仓交易对,适用于逐仓查询
	StartTime      *int64  `json:"startTime"`      //NO
	EndTime        *int64  `json:"endTime"`        //NO
	Current        *int64  `json:"current"`        //NO	当前查询页。 开始值 1. 默认:1
	Size           *int64  `json:"size"`           //NO	默认:10 最大:100
	Archived       *string `json:"archived"`       //NO	默认: false. 查询6个月以前的数据,需要设为 true
	RecvWindow     *int64  `json:"recvWindow"`     //NO 赋值不能大于 60000
	Timestamp      *int64  `json:"timestamp"`      //YES
}

type SpotMarginIsolatedAccountApi

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

func (*SpotMarginIsolatedAccountApi) Do

func (*SpotMarginIsolatedAccountApi) RecvWindow

func (*SpotMarginIsolatedAccountApi) Symbols

func (*SpotMarginIsolatedAccountApi) Timestamp

type SpotMarginIsolatedAccountReq

type SpotMarginIsolatedAccountReq struct {
	Symbols    *string `json:"symbols"` //NO	最多可以传5个symbol; 由","分隔的字符串表示. e.g. "BTCUSDT,BNBUSDT,ADAUSDT"
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SpotMarginIsolatedAllPairsApi

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

func (*SpotMarginIsolatedAllPairsApi) Do

func (*SpotMarginIsolatedAllPairsApi) RecvWindow

func (*SpotMarginIsolatedAllPairsApi) Timestamp

type SpotMarginIsolatedAllPairsReq

type SpotMarginIsolatedAllPairsReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

type SpotMarginIsolatedTransferApi

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

func (*SpotMarginIsolatedTransferApi) Amount

func (*SpotMarginIsolatedTransferApi) Asset

func (*SpotMarginIsolatedTransferApi) Do

func (*SpotMarginIsolatedTransferApi) RecvWindow

func (*SpotMarginIsolatedTransferApi) Symbol

func (*SpotMarginIsolatedTransferApi) Timestamp

func (*SpotMarginIsolatedTransferApi) TransFrom

func (*SpotMarginIsolatedTransferApi) TransTo

type SpotMarginIsolatedTransferReq

type SpotMarginIsolatedTransferReq struct {
	Asset      *string          `json:"asset"`      //YES 被划转的资产, 比如, BTC
	Symbol     *string          `json:"symbol"`     //YES 逐仓 symbol
	TransFrom  *string          `json:"transFrom"`  //YES "SPOT", "ISOLATED_MARGIN"
	TransTo    *string          `json:"transTo"`    //YES "SPOT", "ISOLATED_MARGIN"
	Amount     *decimal.Decimal `json:"amount"`     //YES 划转数量
	RecvWindow *int64           `json:"recvWindow"` //NO 赋值不能大于 60000
	Timestamp  *int64           `json:"timestamp"`  //YES
}

type SpotMarginIsolatedUserDataStreamDeleteApi

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

func (*SpotMarginIsolatedUserDataStreamDeleteApi) Do

func (*SpotMarginIsolatedUserDataStreamDeleteApi) ListenKey

func (*SpotMarginIsolatedUserDataStreamDeleteApi) Symbol

type SpotMarginIsolatedUserDataStreamDeleteReq

type SpotMarginIsolatedUserDataStreamDeleteReq struct {
	Symbol    *string `json:"symbol"`    //YES
	ListenKey *string `json:"listenKey"` //YES
}

type SpotMarginIsolatedUserDataStreamDeleteRes

type SpotMarginIsolatedUserDataStreamDeleteRes struct{}

type SpotMarginIsolatedUserDataStreamPostApi

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

func (*SpotMarginIsolatedUserDataStreamPostApi) Do

func (*SpotMarginIsolatedUserDataStreamPostApi) Symbol

type SpotMarginIsolatedUserDataStreamPostReq

type SpotMarginIsolatedUserDataStreamPostReq struct {
	Symbol *string `json:"symbol"` //YES
}

type SpotMarginIsolatedUserDataStreamPostRes

type SpotMarginIsolatedUserDataStreamPostRes struct {
	ListenKey string `json:"listenKey"`
}

type SpotMarginIsolatedUserDataStreamPutApi

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

func (*SpotMarginIsolatedUserDataStreamPutApi) Do

func (*SpotMarginIsolatedUserDataStreamPutApi) ListenKey

func (*SpotMarginIsolatedUserDataStreamPutApi) Symbol

type SpotMarginIsolatedUserDataStreamPutReq

type SpotMarginIsolatedUserDataStreamPutReq struct {
	Symbol    *string `json:"symbol"`    //YES
	ListenKey *string `json:"listenKey"` //YES
}

type SpotMarginIsolatedUserDataStreamPutRes

type SpotMarginIsolatedUserDataStreamPutRes struct{}

type SpotMarginLoanApi

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

func (*SpotMarginLoanApi) Amount

func (api *SpotMarginLoanApi) Amount(Amount decimal.Decimal) *SpotMarginLoanApi

func (*SpotMarginLoanApi) Asset

func (api *SpotMarginLoanApi) Asset(Asset string) *SpotMarginLoanApi

func (*SpotMarginLoanApi) Do

func (api *SpotMarginLoanApi) Do() (*MarginLoanRes, error)

func (*SpotMarginLoanApi) IsIsolated

func (api *SpotMarginLoanApi) IsIsolated(IsIsolated string) *SpotMarginLoanApi

func (*SpotMarginLoanApi) RecvWindow

func (api *SpotMarginLoanApi) RecvWindow(RecvWindow int64) *SpotMarginLoanApi

func (*SpotMarginLoanApi) Symbol

func (api *SpotMarginLoanApi) Symbol(Symbol string) *SpotMarginLoanApi

func (*SpotMarginLoanApi) Timestamp

func (api *SpotMarginLoanApi) Timestamp(Timestamp int64) *SpotMarginLoanApi

type SpotMarginLoanReq

type SpotMarginLoanReq struct {
	Asset      *string          `json:"asset"`      //YES 被划转的资产, 比如, BTC
	IsIsolated *string          `json:"isIsolated"` //NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
	Symbol     *string          `json:"symbol"`     //NO 逐仓交易对,配合逐仓使用
	Amount     *decimal.Decimal `json:"amount"`     //YES 划转数量
	RecvWindow *int64           `json:"recvWindow"` //NO 赋值不能大于 60000
	Timestamp  *int64           `json:"timestamp"`  //YES
}

type SpotMarginMaxBorrowableApi

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

func (*SpotMarginMaxBorrowableApi) Asset

func (*SpotMarginMaxBorrowableApi) Do

func (*SpotMarginMaxBorrowableApi) IsolatedSymbol

func (api *SpotMarginMaxBorrowableApi) IsolatedSymbol(IsolatedSymbol string) *SpotMarginMaxBorrowableApi

func (*SpotMarginMaxBorrowableApi) RecvWindow

func (api *SpotMarginMaxBorrowableApi) RecvWindow(RecvWindow int64) *SpotMarginMaxBorrowableApi

func (*SpotMarginMaxBorrowableApi) Timestamp

func (api *SpotMarginMaxBorrowableApi) Timestamp(Timestamp int64) *SpotMarginMaxBorrowableApi

type SpotMarginMaxBorrowableReq

type SpotMarginMaxBorrowableReq struct {
	Asset          *string `json:"asset"`          //YES 币种, 比如, BTC
	IsolatedSymbol *string `json:"isolatedSymbol"` //NO 逐仓交易对,适用于逐仓查询
	RecvWindow     *int64  `json:"recvWindow"`     //NO 赋值不能大于 60000
	Timestamp      *int64  `json:"timestamp"`      //YES
}

type SpotMarginMaxTransferableApi

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

func (*SpotMarginMaxTransferableApi) Asset

func (*SpotMarginMaxTransferableApi) Do

func (*SpotMarginMaxTransferableApi) IsolatedSymbol

func (api *SpotMarginMaxTransferableApi) IsolatedSymbol(IsolatedSymbol string) *SpotMarginMaxTransferableApi

func (*SpotMarginMaxTransferableApi) RecvWindow

func (*SpotMarginMaxTransferableApi) Timestamp

type SpotMarginMaxTransferableReq

type SpotMarginMaxTransferableReq struct {
	Asset          *string `json:"asset"`          //YES 币种, 比如, BTC
	IsolatedSymbol *string `json:"isolatedSymbol"` //NO 逐仓交易对,适用于逐仓查询
	RecvWindow     *int64  `json:"recvWindow"`     //NO 赋值不能大于 60000
	Timestamp      *int64  `json:"timestamp"`      //YES
}

type SpotMarginOpenOrdersApi

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

func (*SpotMarginOpenOrdersApi) Do

func (*SpotMarginOpenOrdersApi) IsIsolated

func (api *SpotMarginOpenOrdersApi) IsIsolated(IsIsolated string) *SpotMarginOpenOrdersApi

func (*SpotMarginOpenOrdersApi) RecvWindow

func (api *SpotMarginOpenOrdersApi) RecvWindow(RecvWindow int64) *SpotMarginOpenOrdersApi

func (*SpotMarginOpenOrdersApi) Symbol

func (*SpotMarginOpenOrdersApi) Timestamp

func (api *SpotMarginOpenOrdersApi) Timestamp(Timestamp int64) *SpotMarginOpenOrdersApi

type SpotMarginOpenOrdersReq

type SpotMarginOpenOrdersReq struct {
	Symbol     *string `json:"symbol"`     //NO
	IsIsolated *string `json:"isIsolated"` //NO 	是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
	RecvWindow *int64  `json:"recvWindow"` //NO 赋值不能大于 60000
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type SpotMarginOrderDeleteApi

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

func (*SpotMarginOrderDeleteApi) Do

func (*SpotMarginOrderDeleteApi) IsIsolated

func (api *SpotMarginOrderDeleteApi) IsIsolated(IsIsolated string) *SpotMarginOrderDeleteApi

func (*SpotMarginOrderDeleteApi) NewClientOrderId

func (api *SpotMarginOrderDeleteApi) NewClientOrderId(NewClientOrderId string) *SpotMarginOrderDeleteApi

func (*SpotMarginOrderDeleteApi) OrderId

func (*SpotMarginOrderDeleteApi) OrigClientOrderId

func (api *SpotMarginOrderDeleteApi) OrigClientOrderId(OrigClientOrderId string) *SpotMarginOrderDeleteApi

func (*SpotMarginOrderDeleteApi) RecvWindow

func (api *SpotMarginOrderDeleteApi) RecvWindow(RecvWindow int64) *SpotMarginOrderDeleteApi

func (*SpotMarginOrderDeleteApi) Symbol

func (*SpotMarginOrderDeleteApi) Timestamp

func (api *SpotMarginOrderDeleteApi) Timestamp(Timestamp int64) *SpotMarginOrderDeleteApi

type SpotMarginOrderDeleteReq

type SpotMarginOrderDeleteReq struct {
	Symbol            *string `json:"symbol"`            //YES
	IsIsolated        *string `json:"isIsolated"`        //NO	是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
	OrderId           *int64  `json:"orderId"`           //NO
	OrigClientOrderId *string `json:"origClientOrderId"` //NO
	NewClientOrderId  *string `json:"newClientOrderId"`  //NO	用于唯一识别此撤销订单,默认自动生成。
	RecvWindow        *int64  `json:"recvWindow"`        //NO	T赋值不能大于 60000
	Timestamp         *int64  `json:"timestamp"`         //YES
}

type SpotMarginOrderDeleteRes

type SpotMarginOrderDeleteRes struct {
	Symbol                  string `json:"symbol"`                  // 交易对
	OrderId                 string `json:"orderId"`                 // 系统的订单ID
	OrigClientOrderId       string `json:"origClientOrderId"`       // 原始的客户端订单ID
	ClientOrderId           string `json:"clientOrderId"`           // 客户自己设置的ID
	Price                   string `json:"price"`                   // 订单价格
	OrigQty                 string `json:"origQty"`                 // 用户设置的原始订单数量
	ExecutedQty             string `json:"executedQty"`             // 交易的订单数量
	CummulativeQuoteQty     string `json:"cummulativeQuoteQty"`     // 累计交易的金额
	Status                  string `json:"status"`                  // 订单状态
	TimeInForce             string `json:"timeInForce"`             // 订单的时效方式
	Type                    string `json:"type"`                    // 订单类型, 比如市价单,现价单等
	Side                    string `json:"side"`                    // 订单方向,买还是卖
	IsIsolated              bool   `json:"isIsolated"`              // 是否是逐仓symbol交易
	SelfTradePreventionMode string `json:"selfTradePreventionMode"` // 自我交易预防模式
}

type SpotMarginOrderGetApi

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

func (*SpotMarginOrderGetApi) Do

func (*SpotMarginOrderGetApi) IsIsolated

func (api *SpotMarginOrderGetApi) IsIsolated(IsIsolated string) *SpotMarginOrderGetApi

func (*SpotMarginOrderGetApi) OrderId

func (api *SpotMarginOrderGetApi) OrderId(OrderId int64) *SpotMarginOrderGetApi

func (*SpotMarginOrderGetApi) OrigClientOrderId

func (api *SpotMarginOrderGetApi) OrigClientOrderId(OrigClientOrderId string) *SpotMarginOrderGetApi

func (*SpotMarginOrderGetApi) RecvWindow

func (api *SpotMarginOrderGetApi) RecvWindow(RecvWindow int64) *SpotMarginOrderGetApi

func (*SpotMarginOrderGetApi) Symbol

func (api *SpotMarginOrderGetApi) Symbol(Symbol string) *SpotMarginOrderGetApi

func (*SpotMarginOrderGetApi) Timestamp

func (api *SpotMarginOrderGetApi) Timestamp(Timestamp int64) *SpotMarginOrderGetApi

type SpotMarginOrderGetReq

type SpotMarginOrderGetReq struct {
	Symbol            *string `json:"symbol"`            //NO
	IsIsolated        *string `json:"isIsolated"`        //NO 	是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
	OrderId           *int64  `json:"orderId"`           //NO
	OrigClientOrderId *string `json:"origClientOrderId"` //NO
	RecvWindow        *int64  `json:"recvWindow"`        //NO 赋值不能大于 60000
	Timestamp         *int64  `json:"timestamp"`         //YES
}

type SpotMarginOrderPostApi

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

func (*SpotMarginOrderPostApi) AutoRepayAtCancel

func (api *SpotMarginOrderPostApi) AutoRepayAtCancel(AutoRepayAtCancel bool) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) Do

func (*SpotMarginOrderPostApi) IcebergQty

func (api *SpotMarginOrderPostApi) IcebergQty(IcebergQty decimal.Decimal) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) IsIsolated

func (api *SpotMarginOrderPostApi) IsIsolated(IsIsolated string) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) NewClientOrderId

func (api *SpotMarginOrderPostApi) NewClientOrderId(NewClientOrderId string) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) NewOrderRespType

func (api *SpotMarginOrderPostApi) NewOrderRespType(NewOrderRespType string) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) Price

func (*SpotMarginOrderPostApi) Quantity

func (*SpotMarginOrderPostApi) QuoteOrderQty

func (api *SpotMarginOrderPostApi) QuoteOrderQty(QuoteOrderQty decimal.Decimal) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) RecvWindow

func (api *SpotMarginOrderPostApi) RecvWindow(RecvWindow int64) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) SelfTradePreventionMode

func (api *SpotMarginOrderPostApi) SelfTradePreventionMode(SelfTradePreventionMode string) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) Side

func (*SpotMarginOrderPostApi) SideEffectType

func (api *SpotMarginOrderPostApi) SideEffectType(SideEffectType string) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) StopPrice

func (api *SpotMarginOrderPostApi) StopPrice(StopPrice decimal.Decimal) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) Symbol

func (*SpotMarginOrderPostApi) TimeInForce

func (api *SpotMarginOrderPostApi) TimeInForce(TimeInForce string) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) Timestamp

func (api *SpotMarginOrderPostApi) Timestamp(Timestamp int64) *SpotMarginOrderPostApi

func (*SpotMarginOrderPostApi) Type

type SpotMarginOrderPostReq

type SpotMarginOrderPostReq struct {
	Symbol                  *string          `json:"symbol"`                  //YES
	IsIsolated              *string          `json:"isIsolated"`              //NO	是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
	Side                    *string          `json:"side"`                    //YES	BUY SELL
	Type                    *string          `json:"type"`                    //YES	详见枚举定义:订单类型
	Quantity                *decimal.Decimal `json:"quantity"`                //NO
	QuoteOrderQty           *decimal.Decimal `json:"quoteOrderQty"`           //NO
	Price                   *decimal.Decimal `json:"price"`                   //NO
	StopPrice               *decimal.Decimal `json:"stopPrice"`               //NO	与STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, 和 TAKE_PROFIT_LIMIT 订单一起使用.
	NewClientOrderId        *string          `json:"newClientOrderId"`        //NO	客户自定义的唯一订单ID。若未发送自动生成。
	IcebergQty              *decimal.Decimal `json:"icebergQty"`              //NO	与 LIMIT, STOP_LOSS_LIMIT, 和 TAKE_PROFIT_LIMIT 一起使用创建 iceberg 订单.
	NewOrderRespType        *string          `json:"newOrderRespType"`        //NO	设置响应: JSON. ACK, RESULT, 或 FULL; MARKET 和 LIMIT 订单类型默认为 FULL, 所有其他订单默认为 ACK.
	SideEffectType          *string          `json:"sideEffectType"`          //NO	NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY;默认为 NO_SIDE_EFFECT.
	TimeInForce             *string          `json:"timeInForce"`             //NO	GTC,IOC,FOK
	SelfTradePreventionMode *string          `json:"selfTradePreventionMode"` //NO	允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKER,EXPIRE_MAKER,EXPIRE_BOTH,NONE
	AutoRepayAtCancel       *bool            `json:"autoRepayAtCancel"`       //NO	只有在自动借款单或者自动借还单生效,true表示的是撤单后需要把订单产生的借款归还,默认为true
	RecvWindow              *int64           `json:"recvWindow"`              //NO	赋值不能大于 60000
	Timestamp               *int64           `json:"timestamp"`               //YES
}

type SpotMarginOrderPostRes

type SpotMarginOrderPostRes struct {
	Symbol                  string          `json:"symbol"`                  // 交易对
	OrderId                 int64           `json:"orderId"`                 // 系统的订单ID
	ClientOrderId           string          `json:"clientOrderId"`           // 客户自己设置的ID
	TransactTime            int64           `json:"transactTime"`            // 交易的时间戳
	Price                   string          `json:"price"`                   // 订单价格
	OrigQty                 string          `json:"origQty"`                 // 用户设置的原始订单数量
	ExecutedQty             string          `json:"executedQty"`             // 交易的订单数量
	CummulativeQuoteQty     string          `json:"cummulativeQuoteQty"`     // 累计交易的金额
	Status                  string          `json:"status"`                  // 订单状态
	TimeInForce             string          `json:"timeInForce"`             // 订单的时效方式
	Type                    string          `json:"type"`                    // 订单类型, 比如市价单,现价单等
	Side                    string          `json:"side"`                    // 订单方向,买还是卖
	MarginBuyBorrowAmount   string          `json:"marginBuyBorrowAmount"`   // 下单后没有发生借款则不返回该字段
	MarginBuyBorrowAsset    string          `json:"marginBuyBorrowAsset"`    // 下单后没有发生借款则不返回该字段
	IsIsolated              bool            `json:"isIsolated"`              // 是否是逐仓symbol交易
	SelfTradePreventionMode string          `json:"selfTradePreventionMode"` // 自我交易预防模式
	Fills                   []SpotOrderFill `json:"fills"`                   // 订单中交易的信息
}

type SpotMarginRepayApi

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

func (*SpotMarginRepayApi) Amount

func (*SpotMarginRepayApi) Asset

func (api *SpotMarginRepayApi) Asset(Asset string) *SpotMarginRepayApi

func (*SpotMarginRepayApi) Do

func (api *SpotMarginRepayApi) Do() (*MarginRepayRes, error)

func (*SpotMarginRepayApi) IsIsolated

func (api *SpotMarginRepayApi) IsIsolated(IsIsolated string) *SpotMarginRepayApi

func (*SpotMarginRepayApi) RecvWindow

func (api *SpotMarginRepayApi) RecvWindow(RecvWindow int64) *SpotMarginRepayApi

func (*SpotMarginRepayApi) Symbol

func (api *SpotMarginRepayApi) Symbol(Symbol string) *SpotMarginRepayApi

func (*SpotMarginRepayApi) Timestamp

func (api *SpotMarginRepayApi) Timestamp(Timestamp int64) *SpotMarginRepayApi

type SpotMarginRepayReq

type SpotMarginRepayReq struct {
	Asset      *string          `json:"asset"`      //YES 被划转的资产, 比如, BTC
	IsIsolated *string          `json:"isIsolated"` //NO 是否逐仓杠杆,"TRUE", "FALSE", 默认 "FALSE"
	Symbol     *string          `json:"symbol"`     //NO 逐仓交易对,配合逐仓使用
	Amount     *decimal.Decimal `json:"amount"`     //YES 划转数量
	RecvWindow *int64           `json:"recvWindow"` //NO 赋值不能大于 60000
	Timestamp  *int64           `json:"timestamp"`  //YES
}

type SpotMarginTransferApi

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

func (*SpotMarginTransferApi) Amount

func (*SpotMarginTransferApi) Asset

func (*SpotMarginTransferApi) Do

func (*SpotMarginTransferApi) RecvWindow

func (api *SpotMarginTransferApi) RecvWindow(RecvWindow int64) *SpotMarginTransferApi

func (*SpotMarginTransferApi) Timestamp

func (api *SpotMarginTransferApi) Timestamp(Timestamp int64) *SpotMarginTransferApi

func (*SpotMarginTransferApi) Type

type SpotMarginTransferReq

type SpotMarginTransferReq struct {
	Asset      *string          `json:"asset"`      //YES 被划转的资产, 比如, BTC
	Amount     *decimal.Decimal `json:"amount"`     //YES 划转数量
	Type       *int             `json:"type"`       //YES 1: 主账户向全仓杠杆账户划转 2: 全仓杠杆账户向主账户划转
	RecvWindow *int64           `json:"recvWindow"` //NO 赋值不能大于 60000
	Timestamp  *int64           `json:"timestamp"`  //YES
}

type SpotMarginUserDataStreamDeleteApi

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

func (*SpotMarginUserDataStreamDeleteApi) Do

func (*SpotMarginUserDataStreamDeleteApi) ListenKey

type SpotMarginUserDataStreamDeleteReq

type SpotMarginUserDataStreamDeleteReq struct {
	ListenKey *string `json:"listenKey"` //YES
}

type SpotMarginUserDataStreamDeleteRes

type SpotMarginUserDataStreamDeleteRes struct{}

type SpotMarginUserDataStreamPostApi

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

func (*SpotMarginUserDataStreamPostApi) Do

type SpotMarginUserDataStreamPostReq

type SpotMarginUserDataStreamPostReq struct{}

type SpotMarginUserDataStreamPostRes

type SpotMarginUserDataStreamPostRes struct {
	ListenKey string `json:"listenKey"`
}

type SpotMarginUserDataStreamPutApi

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

func (*SpotMarginUserDataStreamPutApi) Do

func (*SpotMarginUserDataStreamPutApi) ListenKey

type SpotMarginUserDataStreamPutReq

type SpotMarginUserDataStreamPutReq struct {
	ListenKey *string `json:"listenKey"` //YES
}

type SpotMarginUserDataStreamPutRes

type SpotMarginUserDataStreamPutRes struct{}

type SpotMyTradesApi

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

func (*SpotMyTradesApi) Do

func (api *SpotMyTradesApi) Do() (*SpotMyTradesRes, error)

func (*SpotMyTradesApi) EndTime

func (api *SpotMyTradesApi) EndTime(EndTime int64) *SpotMyTradesApi

func (*SpotMyTradesApi) FromId

func (api *SpotMyTradesApi) FromId(FromId int64) *SpotMyTradesApi

func (*SpotMyTradesApi) Limit

func (api *SpotMyTradesApi) Limit(Limit int) *SpotMyTradesApi

func (*SpotMyTradesApi) OrderId

func (api *SpotMyTradesApi) OrderId(OrderId int64) *SpotMyTradesApi

func (*SpotMyTradesApi) RecvWindow

func (api *SpotMyTradesApi) RecvWindow(RecvWindow int64) *SpotMyTradesApi

func (*SpotMyTradesApi) StartTime

func (api *SpotMyTradesApi) StartTime(StartTime int64) *SpotMyTradesApi

func (*SpotMyTradesApi) Symbol

func (api *SpotMyTradesApi) Symbol(Symbol string) *SpotMyTradesApi

func (*SpotMyTradesApi) Timestamp

func (api *SpotMyTradesApi) Timestamp(Timestamp int64) *SpotMyTradesApi

type SpotMyTradesReq

type SpotMyTradesReq struct {
	Symbol     *string `json:"symbol"`     //YES
	OrderId    *int64  `json:"orderId"`    //NO
	StartTime  *int64  `json:"startTime"`  //NO
	EndTime    *int64  `json:"endTime"`    //NO
	FromId     *int64  `json:"fromId"`     //NO
	Limit      *int    `json:"limit"`      //NO	默认 500; 最大 1000.
	RecvWindow *int64  `json:"recvWindow"` //NO	赋值不能超过 60000
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type SpotMyTradesRes

type SpotMyTradesRes []SpotMyTradesResRow

type SpotMyTradesResRow

type SpotMyTradesResRow struct {
	Symbol          string `json:"symbol"`          // 交易对
	Id              int64  `json:"id"`              // trade ID
	OrderId         int64  `json:"orderId"`         // 订单ID
	OrderListId     int64  `json:"orderListId"`     // OCO订单的ID,不然就是-1
	Price           string `json:"price"`           // 成交价格
	Qty             string `json:"qty"`             // 成交量
	QuoteQty        string `json:"quoteQty"`        // 成交金额
	Commission      string `json:"commission"`      // 交易费金额
	CommissionAsset string `json:"commissionAsset"` // 交易费资产类型
	Time            int64  `json:"time"`            // 交易时间
	IsBuyer         bool   `json:"isBuyer"`         // 是否是买家
	IsMaker         bool   `json:"isMaker"`         // 是否是挂单方
	IsBestMatch     bool   `json:"isBestMatch"`
}

type SpotOpenOrdersApi

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

func (*SpotOpenOrdersApi) Do

func (*SpotOpenOrdersApi) RecvWindow

func (api *SpotOpenOrdersApi) RecvWindow(RecvWindow int64) *SpotOpenOrdersApi

func (*SpotOpenOrdersApi) Symbol

func (api *SpotOpenOrdersApi) Symbol(Symbol string) *SpotOpenOrdersApi

func (*SpotOpenOrdersApi) Timestamp

func (api *SpotOpenOrdersApi) Timestamp(Timestamp int64) *SpotOpenOrdersApi

type SpotOpenOrdersReq

type SpotOpenOrdersReq struct {
	Symbol     *string `json:"symbol"`     //NO
	RecvWindow *int64  `json:"recvWindow"` //NO 	赋值不能大于 60000
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type SpotOpenOrdersRes

type SpotOpenOrdersRes []SpotOrderOrder

type SpotOrderCancelReplaceApi

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

func (*SpotOrderCancelReplaceApi) CancelNewClientOrderId

func (api *SpotOrderCancelReplaceApi) CancelNewClientOrderId(CancelNewClientOrderId string) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) CancelOrderId

func (api *SpotOrderCancelReplaceApi) CancelOrderId(CancelOrderId int64) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) CancelOrigClientOrderId

func (api *SpotOrderCancelReplaceApi) CancelOrigClientOrderId(CancelOrigClientOrderId string) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) CancelReplaceMode

func (api *SpotOrderCancelReplaceApi) CancelReplaceMode(CancelReplaceMode string) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) CancelRestrictions

func (api *SpotOrderCancelReplaceApi) CancelRestrictions(CancelRestrictions string) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) Do

func (*SpotOrderCancelReplaceApi) IcebergQty

func (*SpotOrderCancelReplaceApi) NewClientOrderId

func (api *SpotOrderCancelReplaceApi) NewClientOrderId(NewClientOrderId string) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) NewOrderRespType

func (api *SpotOrderCancelReplaceApi) NewOrderRespType(NewOrderRespType string) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) Price

func (*SpotOrderCancelReplaceApi) Quantity

func (*SpotOrderCancelReplaceApi) QuoteOrderQty

func (api *SpotOrderCancelReplaceApi) QuoteOrderQty(QuoteOrderQty decimal.Decimal) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) RecvWindow

func (api *SpotOrderCancelReplaceApi) RecvWindow(RecvWindow int64) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) SelfTradePreventionMode

func (api *SpotOrderCancelReplaceApi) SelfTradePreventionMode(SelfTradePreventionMode string) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) Side

func (*SpotOrderCancelReplaceApi) StopPrice

func (*SpotOrderCancelReplaceApi) StrategyId

func (api *SpotOrderCancelReplaceApi) StrategyId(StrategyId int) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) StrategyType

func (api *SpotOrderCancelReplaceApi) StrategyType(StrategyType int) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) Symbol

func (*SpotOrderCancelReplaceApi) TimeInForce

func (api *SpotOrderCancelReplaceApi) TimeInForce(TimeInForce string) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) Timestamp

func (api *SpotOrderCancelReplaceApi) Timestamp(Timestamp int64) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) TrailingDelta

func (api *SpotOrderCancelReplaceApi) TrailingDelta(TrailingDelta int64) *SpotOrderCancelReplaceApi

func (*SpotOrderCancelReplaceApi) Type

type SpotOrderCancelReplaceReq

type SpotOrderCancelReplaceReq struct {
	Symbol                  *string          `json:"symbol"`                            //YES
	Side                    *string          `json:"side"`                              //YES
	Type                    *string          `json:"type"`                              //YES
	CancelReplaceMode       *string          `json:"cancelReplaceMode"`                 //YES	指定类型:STOP_ON_FAILURE - 如果撤消订单失败将不会继续重新下单。 ALLOW_FAILURE - 不管撤消订单是否成功都会继续重新下单。
	TimeInForce             *string          `json:"timeInForce,omitempty"`             //NO
	Quantity                *decimal.Decimal `json:"quantity,omitempty"`                //NO
	QuoteOrderQty           *decimal.Decimal `json:"quoteOrderQty,omitempty"`           //NO
	Price                   *decimal.Decimal `json:"price,omitempty"`                   //NO
	CancelNewClientOrderId  *string          `json:"cancelNewClientOrderId,omitempty"`  //NO	用户自定义的id,如空缺系统会自动赋值
	CancelOrigClientOrderId *string          `json:"cancelOrigClientOrderId,omitempty"` //NO	必须提供cancelOrigClientOrderId 或者 cancelOrderId。 如果两个参数都提供, cancelOrderId 会占优先。
	CancelOrderId           *int64           `json:"cancelOrderId,omitempty"`           //NO	必须提供cancelOrigClientOrderId 或者 cancelOrderId。 如果两个参数都提供, cancelOrderId 会占优先。
	NewClientOrderId        *string          `json:"newClientOrderId,omitempty"`        //NO	用于辨识新订单。
	StrategyId              *int             `json:"strategyId,omitempty"`              //NO
	StrategyType            *int             `json:"strategyType,omitempty"`            //NO	不能低于 1000000
	StopPrice               *decimal.Decimal `json:"stopPrice,omitempty"`               //NO
	TrailingDelta           *int64           `json:"trailingDelta,omitempty"`           //NO
	IcebergQty              *decimal.Decimal `json:"icebergQty,omitempty"`              //NO
	NewOrderRespType        *string          `json:"newOrderRespType,omitempty"`        //NO	指定响应类型: 指定响应类型 ACK, RESULT, 或者 FULL; MARKET 与 LIMIT 订单默认为FULL, 其他默认为ACK.
	SelfTradePreventionMode *string          `json:"selfTradePreventionMode,omitempty"` //NO	允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKER,EXPIRE_MAKER,EXPIRE_BOTH,NONE。
	CancelRestrictions      *string          `json:"cancelRestrictions,omitempty"`      //NO	支持的值: ONLY_NEW - 如果订单状态为 NEW,撤销将成功。 ONLY_PARTIALLY_FILLED - 如果订单状态为 PARTIALLY_FILLED,撤销将成功。
	RecvWindow              *int64           `json:"recvWindow,omitempty"`              //NO	不能大于 60000
	Timestamp               *int64           `json:"timestamp"`                         //YES
}

symbol STRING YES side ENUM YES type ENUM YES cancelReplaceMode ENUM YES 指定类型:STOP_ON_FAILURE - 如果撤消订单失败将不会继续重新下单。 ALLOW_FAILURE - 不管撤消订单是否成功都会继续重新下单。 timeInForce ENUM NO quantity DECIMAL NO quoteOrderQty DECIMAL NO price DECIMAL NO cancelNewClientOrderId STRING NO 用户自定义的id,如空缺系统会自动赋值 cancelOrigClientOrderId STRING NO 必须提供cancelOrigClientOrderId 或者 cancelOrderId。 如果两个参数都提供, cancelOrderId 会占优先。 cancelOrderId LONG NO 必须提供cancelOrigClientOrderId 或者 cancelOrderId。 如果两个参数都提供, cancelOrderId 会占优先。 newClientOrderId STRING NO 用于辨识新订单。 strategyId INT NO strategyType INT NO 不能低于 1000000 stopPrice DECIMAL NO trailingDelta LONG NO icebergQty DECIMAL NO newOrderRespType ENUM NO 指定响应类型: 指定响应类型 ACK, RESULT, 或者 FULL; MARKET 与 LIMIT 订单默认为FULL, 其他默认为ACK. selfTradePreventionMode ENUM NO 允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKER,EXPIRE_MAKER,EXPIRE_BOTH,NONE。 cancelRestrictions ENUM NO 支持的值: ONLY_NEW - 如果订单状态为 NEW,撤销将成功。 ONLY_PARTIALLY_FILLED - 如果订单状态为 PARTIALLY_FILLED,撤销将成功。 recvWindow LONG NO 不能大于 60000 timestamp LONG YES

type SpotOrderCancelReplaceRes

type SpotOrderCancelReplaceRes struct {
	CancelResult     string             `json:"cancelResult"`
	NewOrderResult   string             `json:"newOrderResult"`
	CancelResponse   SpotOrderDeleteRes `json:"cancelResponse"`
	NewOrderResponse SpotOrderPostRes   `json:"newOrderResponse"`
}

type SpotOrderDeleteApi

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

func (*SpotOrderDeleteApi) CancelRestrictions

func (api *SpotOrderDeleteApi) CancelRestrictions(CancelRestrictions string) *SpotOrderDeleteApi

func (*SpotOrderDeleteApi) Do

func (*SpotOrderDeleteApi) NewClientOrderId

func (api *SpotOrderDeleteApi) NewClientOrderId(NewClientOrderId string) *SpotOrderDeleteApi

func (*SpotOrderDeleteApi) OrderId

func (api *SpotOrderDeleteApi) OrderId(OrderId int64) *SpotOrderDeleteApi

func (*SpotOrderDeleteApi) OrigClientOrderId

func (api *SpotOrderDeleteApi) OrigClientOrderId(OrigClientOrderId string) *SpotOrderDeleteApi

func (*SpotOrderDeleteApi) RecvWindow

func (api *SpotOrderDeleteApi) RecvWindow(RecvWindow int64) *SpotOrderDeleteApi

func (*SpotOrderDeleteApi) Symbol

func (api *SpotOrderDeleteApi) Symbol(Symbol string) *SpotOrderDeleteApi

func (*SpotOrderDeleteApi) Timestamp

func (api *SpotOrderDeleteApi) Timestamp(Timestamp int64) *SpotOrderDeleteApi

type SpotOrderDeleteReq

type SpotOrderDeleteReq struct {
	Symbol             *string `json:"symbol"`                       //YES
	OrderId            *int64  `json:"orderId,omitempty"`            //NO
	OrigClientOrderId  *string `json:"origClientOrderId,omitempty"`  //NO
	NewClientOrderId   *string `json:"newClientOrderId,omitempty"`   //NO	用户自定义的本次撤销操作的ID(注意不是被撤销的订单的自定义ID)。如无指定会自动赋值。
	CancelRestrictions *string `json:"cancelRestrictions,omitempty"` //NO	支持的值: ONLY_NEW - 如果订单状态为 NEW,订单取消将成功。 ONLY_PARTIALLY_FILLED - 如果订单状态为 PARTIALLY_FILLED,订单取消将成功。
	RecvWindow         *int64  `json:"recvWindow,omitempty"`         //NO	赋值不得大于 60000
	Timestamp          *int64  `json:"timestamp"`                    //YES
}

type SpotOrderDeleteRes

type SpotOrderDeleteRes struct {
	Symbol                  string `json:"symbol"`                  // 交易对
	OrigClientOrderId       string `json:"origClientOrderId"`       // 原始的客户端订单ID
	OrderId                 int64  `json:"orderId"`                 // 系统的订单ID
	OrderListId             int64  `json:"orderListId"`             // OCO订单ID,否则为 -1
	ClientOrderId           string `json:"clientOrderId"`           // 客户自己设置的ID
	TransactTime            int64  `json:"transactTime"`            // 交易的时间戳
	Price                   string `json:"price"`                   // 订单价格
	OrigQty                 string `json:"origQty"`                 // 用户设置的原始订单数量
	ExecutedQty             string `json:"executedQty"`             // 交易的订单数量
	CummulativeQuoteQty     string `json:"cummulativeQuoteQty"`     // 累计交易的金额
	Status                  string `json:"status"`                  // 订单状态
	TimeInForce             string `json:"timeInForce"`             // 订单的时效方式
	Type                    string `json:"type"`                    // 订单类型, 比如市价单,现价单等
	Side                    string `json:"side"`                    // 订单方向,买还是卖
	SelfTradePreventionMode string `json:"selfTradePreventionMode"` // 自我交易预防模式
}

type SpotOrderFill

type SpotOrderFill struct {
	Price           string `json:"price"`           // 交易的价格
	Qty             string `json:"qty"`             // 交易的数量
	Commission      string `json:"commission"`      // 手续费金额
	CommissionAsset string `json:"commissionAsset"` // 手续费的币种
	TradeId         int64  `json:"tradeId"`         // 交易ID
}

type SpotOrderGetApi

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

func (*SpotOrderGetApi) Do

func (api *SpotOrderGetApi) Do() (*SpotOrderGetRes, error)

func (*SpotOrderGetApi) OrderId

func (api *SpotOrderGetApi) OrderId(OrderId int64) *SpotOrderGetApi

func (*SpotOrderGetApi) OrigClientOrderId

func (api *SpotOrderGetApi) OrigClientOrderId(OrigClientOrderId string) *SpotOrderGetApi

func (*SpotOrderGetApi) RecvWindow

func (api *SpotOrderGetApi) RecvWindow(RecvWindow int64) *SpotOrderGetApi

func (*SpotOrderGetApi) Symbol

func (api *SpotOrderGetApi) Symbol(Symbol string) *SpotOrderGetApi

func (*SpotOrderGetApi) Timestamp

func (api *SpotOrderGetApi) Timestamp(Timestamp int64) *SpotOrderGetApi

type SpotOrderGetReq

type SpotOrderGetReq struct {
	Symbol            *string `json:"symbol"`                      //YES
	OrderId           *int64  `json:"orderId,omitempty"`           //NO
	OrigClientOrderId *string `json:"origClientOrderId,omitempty"` //NO
	RecvWindow        *int64  `json:"recvWindow,omitempty"`        //NO 	赋值不能大于 60000
	Timestamp         *int64  `json:"timestamp"`                   //YES
}

type SpotOrderGetRes

type SpotOrderGetRes SpotOrderOrder

type SpotOrderOrder

type SpotOrderOrder struct {
	Symbol                  string `json:"symbol"`                  // 交易对
	OrderId                 int64  `json:"orderId"`                 // 系统的订单ID
	OrderListId             int64  `json:"orderListId"`             // OCO订单ID,否则为 -1
	ClientOrderId           string `json:"clientOrderId"`           // 客户自己设置的ID
	Price                   string `json:"price"`                   // 订单价格
	OrigQty                 string `json:"origQty"`                 // 用户设置的原始订单数量
	ExecutedQty             string `json:"executedQty"`             // 交易的订单数量
	CummulativeQuoteQty     string `json:"cummulativeQuoteQty"`     // 累计交易的金额
	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                    int64  `json:"time"`                    // 订单添加到 order book 的时间
	UpdateTime              int64  `json:"updateTime"`              // 订单最后一次成交的时间
	IsWorking               bool   `json:"isWorking"`               // 订单是否在 order book 中被激活
	WorkingTime             int64  `json:"workingTime"`             // 订单添加到 order book 的时间
	OrigQuoteOrderQty       string `json:"origQuoteOrderQty"`       // 原始的报价订单数量
	SelfTradePreventionMode string `json:"selfTradePreventionMode"` // 自成交防范模式
}

type SpotOrderPostApi

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

func (*SpotOrderPostApi) Do

func (api *SpotOrderPostApi) Do() (*SpotOrderPostRes, error)

func (*SpotOrderPostApi) IcebergQty

func (api *SpotOrderPostApi) IcebergQty(IcebergQty decimal.Decimal) *SpotOrderPostApi

func (*SpotOrderPostApi) NewClientOrderId

func (api *SpotOrderPostApi) NewClientOrderId(NewClientOrderId string) *SpotOrderPostApi

func (*SpotOrderPostApi) NewOrderRespType

func (api *SpotOrderPostApi) NewOrderRespType(NewOrderRespType string) *SpotOrderPostApi

func (*SpotOrderPostApi) Price

func (api *SpotOrderPostApi) Price(Price decimal.Decimal) *SpotOrderPostApi

func (*SpotOrderPostApi) Quantity

func (api *SpotOrderPostApi) Quantity(Quantity decimal.Decimal) *SpotOrderPostApi

func (*SpotOrderPostApi) QuoteOrderQty

func (api *SpotOrderPostApi) QuoteOrderQty(QuoteOrderQty decimal.Decimal) *SpotOrderPostApi

func (*SpotOrderPostApi) RecvWindow

func (api *SpotOrderPostApi) RecvWindow(RecvWindow int64) *SpotOrderPostApi

func (*SpotOrderPostApi) SelfTradePreventionMode

func (api *SpotOrderPostApi) SelfTradePreventionMode(SelfTradePreventionMode string) *SpotOrderPostApi

func (*SpotOrderPostApi) Side

func (api *SpotOrderPostApi) Side(Side string) *SpotOrderPostApi

func (*SpotOrderPostApi) StopPrice

func (api *SpotOrderPostApi) StopPrice(StopPrice decimal.Decimal) *SpotOrderPostApi

func (*SpotOrderPostApi) StrategyId

func (api *SpotOrderPostApi) StrategyId(StrategyId int) *SpotOrderPostApi

func (*SpotOrderPostApi) StrategyType

func (api *SpotOrderPostApi) StrategyType(StrategyType int) *SpotOrderPostApi

func (*SpotOrderPostApi) Symbol

func (api *SpotOrderPostApi) Symbol(Symbol string) *SpotOrderPostApi

func (*SpotOrderPostApi) TimeInForce

func (api *SpotOrderPostApi) TimeInForce(TimeInForce string) *SpotOrderPostApi

func (*SpotOrderPostApi) Timestamp

func (api *SpotOrderPostApi) Timestamp(Timestamp int64) *SpotOrderPostApi

func (*SpotOrderPostApi) TrailingDelta

func (api *SpotOrderPostApi) TrailingDelta(TrailingDelta int64) *SpotOrderPostApi

func (*SpotOrderPostApi) Type

func (api *SpotOrderPostApi) Type(Type string) *SpotOrderPostApi

type SpotOrderPostReq

type SpotOrderPostReq struct {
	Symbol                  *string          `json:"symbol"`                            //YES
	Side                    *string          `json:"side"`                              //YES
	Type                    *string          `json:"type"`                              //YES
	TimeInForce             *string          `json:"timeInForce,omitempty"`             //NO 	详见枚举定义:有效方式
	Quantity                *decimal.Decimal `json:"quantity,omitempty"`                //NO
	QuoteOrderQty           *decimal.Decimal `json:"quoteOrderQty,omitempty"`           //NO
	Price                   *decimal.Decimal `json:"price,omitempty"`                   //NO
	NewClientOrderId        *string          `json:"newClientOrderId,omitempty"`        //NO 	客户自定义的唯一订单ID。 如果未发送,则自动生成。
	StopPrice               *decimal.Decimal `json:"stopPrice,omitempty"`               //NO 	仅 STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT 和 TAKE_PROFIT_LIMIT 需要此参数。
	TrailingDelta           *int64           `json:"trailingDelta,omitempty"`           //NO 	用于 STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT 和 TAKE_PROFIT_LIMIT 类型的订单。更多追踪止盈止损订单细节, 请参考 追踪止盈止损(Trailing Stop)订单常见问题。
	IcebergQty              *decimal.Decimal `json:"icebergQty,omitempty"`              //NO 	仅使用 LIMIT, STOP_LOSS_LIMIT, 和 TAKE_PROFIT_LIMIT 创建新的 iceberg 订单时需要此参数。
	NewOrderRespType        *string          `json:"newOrderRespType,omitempty"`        //NO 	设置响应JSON。ACK,RESULT 或 FULL;MARKET 和 LIMIT 订单类型默认为 FULL,所有其他订单默认为 ACK。
	SelfTradePreventionMode *string          `json:"selfTradePreventionMode,omitempty"` //NO 	允许的 ENUM 取决于交易对的配置。支持的值有 EXPIRE_TAKER,EXPIRE_MAKER,EXPIRE_BOTH,NONE。
	StrategyId              *int             `json:"strategyId,omitempty"`              //NO
	StrategyType            *int             `json:"strategyType,omitempty"`            //NO 	不能低于 1000000
	RecvWindow              *int64           `json:"recvWindow,omitempty"`              //NO 	赋值不能大于 60000
	Timestamp               *int64           `json:"timestamp"`                         //YES
}

type SpotOrderPostRes

type SpotOrderPostRes struct {
	Symbol                  string          `json:"symbol"`                  // 交易对
	OrderId                 int64           `json:"orderId"`                 // 系统的订单ID
	OrderListId             int64           `json:"orderListId"`             // OCO订单ID,否则为 -1
	ClientOrderId           string          `json:"clientOrderId"`           // 客户自己设置的ID
	TransactTime            int64           `json:"transactTime"`            // 交易的时间戳
	Price                   string          `json:"price"`                   // 订单价格
	OrigQty                 string          `json:"origQty"`                 // 用户设置的原始订单数量
	ExecutedQty             string          `json:"executedQty"`             // 交易的订单数量
	CummulativeQuoteQty     string          `json:"cummulativeQuoteQty"`     // 累计交易的金额
	Status                  string          `json:"status"`                  // 订单状态
	TimeInForce             string          `json:"timeInForce"`             // 订单的时效方式
	Type                    string          `json:"type"`                    // 订单类型, 比如市价单,现价单等
	Side                    string          `json:"side"`                    // 订单方向,买还是卖
	WorkingTime             int64           `json:"workingTime"`             // 订单添加到 order book 的时间
	SelfTradePreventionMode string          `json:"selfTradePreventionMode"` // 自我交易预防模式
	Fills                   []SpotOrderFill `json:"fills"`                   // 订单中交易的信息
}

type SpotPingApi

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

func (*SpotPingApi) Do

func (api *SpotPingApi) Do() (*SpotPingRes, error)

type SpotPingReq

type SpotPingReq struct {
}

type SpotPingRes

type SpotPingRes struct {
}

type SpotRestClient

type SpotRestClient RestClient

func (*SpotRestClient) NewAccountApiTradingStatus

func (client *SpotRestClient) NewAccountApiTradingStatus() *SpotAccountApiTradingStatusApi

现货账户接口 binance SPOT钱包接口 账户API交易状态(USER_DATA)

func (*SpotRestClient) NewAllOrders

func (client *SpotRestClient) NewAllOrders() *SpotAllOrdersApi

binance SPOT allOrders rest所有订单 (USER_DATA)

func (*SpotRestClient) NewExchangeInfo

func (client *SpotRestClient) NewExchangeInfo() *SpotExchangeInfoApi

binance SPOT exchangeInfo rest交易规范

func (*SpotRestClient) NewManagedSubAccountQueryTransLog

func (client *SpotRestClient) NewManagedSubAccountQueryTransLog() *SpotManagedSubAccountQueryTransLogApi

binance SPOT子母账户接口 ManagedSubAccountQueryTransLog rest查询托管子账户的划转记录(适用交易团队子账户)(USER_DATA)

func (*SpotRestClient) NewOpenOrders

func (client *SpotRestClient) NewOpenOrders() *SpotOpenOrdersApi

现货订单接口 binance SPOT openOrders rest当前挂单 (USER_DATA)

func (*SpotRestClient) NewPing

func (client *SpotRestClient) NewPing() *SpotPingApi

通用接口 binance SPOT ping rest测试连通性 (NONE)

func (*SpotRestClient) NewServerTime

func (client *SpotRestClient) NewServerTime() *SpotServerTimeApi

binance SPOT serverTime rest服务器时间 (NONE)

func (*SpotRestClient) NewSpotAccount

func (client *SpotRestClient) NewSpotAccount() *SpotAccountApi

binance SPOT现货账户和交易接口 SpotAccount rest账户信息 (USER_DATA)

func (*SpotRestClient) NewSpotAggTrades

func (client *SpotRestClient) NewSpotAggTrades() *SpotAggTradesApi

binance SPOT spotAggTrades rest近期成交(归集)(NONE)

func (*SpotRestClient) NewSpotAssetGetFundingAsset

func (client *SpotRestClient) NewSpotAssetGetFundingAsset() *SpotAssetGetFundingAssetApi

binance SPOT spotAssetGetFundingAsset rest资金账户 (USER_DATA)

func (*SpotRestClient) NewSpotAssetTradeFee

func (client *SpotRestClient) NewSpotAssetTradeFee() *SpotAssetTradeFeeApi

binance SPOT spotAssetTradeFee rest查询用户交易手续费率 (USER_DATA)

func (*SpotRestClient) NewSpotAssetTransferGet

func (client *SpotRestClient) NewSpotAssetTransferGet() *SpotAssetTransferGetApi

binance SPOT spotAssetTransferGet rest查询用户万向划转历史 (USER_DATA)

func (*SpotRestClient) NewSpotAssetTransferPost

func (client *SpotRestClient) NewSpotAssetTransferPost() *SpotAssetTransferPostApi

binance SPOT spotAssetTransferPost rest用户万向划转 (USER_DATA)

func (*SpotRestClient) NewSpotAvgPrice

func (client *SpotRestClient) NewSpotAvgPrice() *SpotAvgPriceApi

binance SPOT spotAvgPrice rest当前平均价格 (NONE)

func (*SpotRestClient) NewSpotDepth

func (client *SpotRestClient) NewSpotDepth() *SpotDepthApi

binance SPOT spotDepth rest深度信息 (NONE)

func (*SpotRestClient) NewSpotHistoricalTrades

func (client *SpotRestClient) NewSpotHistoricalTrades() *SpotHistoricalTradesApi

binance SPOT spotHistoricalTrades rest历史成交 (NONE)

func (*SpotRestClient) NewSpotKlines

func (client *SpotRestClient) NewSpotKlines() *SpotKlinesApi

binance SPOT spotKlines restK线数据 (NONE)

func (*SpotRestClient) NewSpotMarginAccount

func (client *SpotRestClient) NewSpotMarginAccount() *SpotMarginAccountApi

binance SPOT杠杆接口 MarginAccount rest查询全仓杠杆账户详情 (USER_DATA)

func (*SpotRestClient) NewSpotMarginAllOrders

func (client *SpotRestClient) NewSpotMarginAllOrders() *SpotMarginAllOrdersApi

binance SPOT杠杆接口 MarginAllOrders rest查询杠杆账户全部订单 (USER_DATA)

func (*SpotRestClient) NewSpotMarginAllPairs

func (client *SpotRestClient) NewSpotMarginAllPairs() *SpotMarginAllPairsApi

杠杆账户接口 binance SPOT杠杆接口 MarginAllPairs rest获取所有全仓杠杆交易对(MARKET_DATA)

func (*SpotRestClient) NewSpotMarginInterestHistory

func (client *SpotRestClient) NewSpotMarginInterestHistory() *SpotMarginInterestHistoryApi

binance SPOT杠杆接口 MarginInterestHistory rest获取杠杆账户借息历史 (USER_DATA)

func (*SpotRestClient) NewSpotMarginIsolatedAccount

func (client *SpotRestClient) NewSpotMarginIsolatedAccount() *SpotMarginIsolatedAccountApi

binance SPOT杠杆接口 MarginIsolatedAccount rest查询逐仓杠杆账户详情 (USER_DATA)

func (*SpotRestClient) NewSpotMarginIsolatedAllPairs

func (client *SpotRestClient) NewSpotMarginIsolatedAllPairs() *SpotMarginIsolatedAllPairsApi

binance SPOT杠杆接口 MarginIsolatedAllPairs rest获取所有逐仓杠杆交易对(MARKET_DATA)

func (*SpotRestClient) NewSpotMarginIsolatedTransfer

func (client *SpotRestClient) NewSpotMarginIsolatedTransfer() *SpotMarginIsolatedTransferApi

binance SPOT杠杆接口 MarginIsolatedTransfer rest逐仓杠杆账户划转 (MARGIN)

func (*SpotRestClient) NewSpotMarginIsolatedUserDataStreamDelete

func (client *SpotRestClient) NewSpotMarginIsolatedUserDataStreamDelete() *SpotMarginIsolatedUserDataStreamDeleteApi

binance SPOT ws账户推送 SpotMarginIsolatedUserDataStreamDelete rest现货杠杆逐仓关闭listenKey (USER_STREAM)

func (*SpotRestClient) NewSpotMarginIsolatedUserDataStreamPost

func (client *SpotRestClient) NewSpotMarginIsolatedUserDataStreamPost() *SpotMarginIsolatedUserDataStreamPostApi

binance SPOT ws账户推送 SpotMarginIsolatedUserDataStreamPost rest现货杠杆逐仓创建一个listenKey (USER_STREAM)

func (*SpotRestClient) NewSpotMarginIsolatedUserDataStreamPut

func (client *SpotRestClient) NewSpotMarginIsolatedUserDataStreamPut() *SpotMarginIsolatedUserDataStreamPutApi

binance SPOT ws账户推送 SpotMarginIsolatedUserDataStreamPut rest现货杠杆逐仓延长listenKey有效期 (USER_STREAM)

func (*SpotRestClient) NewSpotMarginLoan

func (client *SpotRestClient) NewSpotMarginLoan() *SpotMarginLoanApi

binance SPOT杠杆接口 MarginLoan rest 杠杆账户借贷 (MARGIN) 支持逐仓和全仓

func (*SpotRestClient) NewSpotMarginMaxBorrowable

func (client *SpotRestClient) NewSpotMarginMaxBorrowable() *SpotMarginMaxBorrowableApi

binance SPOT杠杆接口 MarginMaxBorrowable rest查询最大可借 (MARKET_DATA)

func (*SpotRestClient) NewSpotMarginMaxTransferable

func (client *SpotRestClient) NewSpotMarginMaxTransferable() *SpotMarginMaxTransferableApi

binance SPOT杠杆接口 MarginMaxTransferable rest查询最大可转 (MARKET_DATA)

func (*SpotRestClient) NewSpotMarginOpenOrders

func (client *SpotRestClient) NewSpotMarginOpenOrders() *SpotMarginOpenOrdersApi

binance SPOT杠杆接口 MarginOpenOrders rest查询杠杆账户挂单记录 (USER_DATA)

func (*SpotRestClient) NewSpotMarginOrderDelete

func (client *SpotRestClient) NewSpotMarginOrderDelete() *SpotMarginOrderDeleteApi

binance SPOT杠杆接口 MarginOrderDelete rest撤销杠杆账户订单 (TRADE)

func (*SpotRestClient) NewSpotMarginOrderGet

func (client *SpotRestClient) NewSpotMarginOrderGet() *SpotMarginOrderGetApi

binance SPOT杠杆接口 MarginOrderGet rest查询杠杆账户订单 (USER_DATA)

func (*SpotRestClient) NewSpotMarginOrderPost

func (client *SpotRestClient) NewSpotMarginOrderPost() *SpotMarginOrderPostApi

binance SPOT杠杆下单接口 SpotMarginOrderPost rest 杠杆下单 (TRADE)

func (*SpotRestClient) NewSpotMarginRepay

func (client *SpotRestClient) NewSpotMarginRepay() *SpotMarginRepayApi

binance SPOT杠杆接口 MarginRepay rest 杠杆账户还贷 (MARGIN) 支持逐仓和全仓

func (*SpotRestClient) NewSpotMarginTransfer

func (client *SpotRestClient) NewSpotMarginTransfer() *SpotMarginTransferApi

binance SPOT杠杆接口 MarginTransfer rest全仓杠杆账户划转 (MARGIN)

func (*SpotRestClient) NewSpotMarginUserDataStreamDelete

func (client *SpotRestClient) NewSpotMarginUserDataStreamDelete() *SpotMarginUserDataStreamDeleteApi

binance SPOT ws账户推送 SpotMarginUserDataStreamDelete rest现货杠杆关闭listenKey (USER_STREAM)

func (*SpotRestClient) NewSpotMarginUserDataStreamPost

func (client *SpotRestClient) NewSpotMarginUserDataStreamPost() *SpotMarginUserDataStreamPostApi

binance SPOT ws账户推送 SpotMarginUserDataStreamPost rest现货杠杆创建一个listenKey (USER_STREAM)

func (*SpotRestClient) NewSpotMarginUserDataStreamPut

func (client *SpotRestClient) NewSpotMarginUserDataStreamPut() *SpotMarginUserDataStreamPutApi

binance SPOT ws账户推送 SpotMarginUserDataStreamPut rest现货杠杆延长listenKey有效期 (USER_STREAM)

func (*SpotRestClient) NewSpotMyTrades

func (client *SpotRestClient) NewSpotMyTrades() *SpotMyTradesApi

binance SPOT spotMyTrades rest账户成交历史 (USER_DATA)

func (*SpotRestClient) NewSpotOrderCancelReplace

func (client *SpotRestClient) NewSpotOrderCancelReplace() *SpotOrderCancelReplaceApi

binance SPOT orderCancelReplace rest撤消挂单再下单 (TRADE)

func (*SpotRestClient) NewSpotOrderDelete

func (client *SpotRestClient) NewSpotOrderDelete() *SpotOrderDeleteApi

binance SPOT orderDelete rest撤销订单 (TRADE)

func (*SpotRestClient) NewSpotOrderGet

func (client *SpotRestClient) NewSpotOrderGet() *SpotOrderGetApi

binance SPOT orderGet rest订单查询 (USER_DATA)

func (*SpotRestClient) NewSpotOrderPost

func (client *SpotRestClient) NewSpotOrderPost() *SpotOrderPostApi

binance SPOT下单接口 SpotOrderPost rest 下单 (TRADE)

func (*SpotRestClient) NewSpotSubAccountApiIpRestriction

func (client *SpotRestClient) NewSpotSubAccountApiIpRestriction() *SpotSubAccountApiIpRestrictionApi

binance 查询子账户API Key IP白名单 (适用母账户) SpotSubAccountApiIpRestriction rest查询子账户API Key IP白名单 (适用母账户)

func (*SpotRestClient) NewSpotTicker

func (client *SpotRestClient) NewSpotTicker() *SpotTickerApi

binance SPOT spotTicker rest滚动窗口价格变动统计

func (*SpotRestClient) NewSpotTicker24hr

func (client *SpotRestClient) NewSpotTicker24hr() *SpotTicker24hrApi

binance SPOT spotTicker24hr rest24hr价格变动情况 (NONE)

func (*SpotRestClient) NewSpotTickerBookTicker

func (client *SpotRestClient) NewSpotTickerBookTicker() *SpotTickerBookTickerApi

binance SPOT spotTickerBookTicker rest当前最优挂单 (NONE)

func (*SpotRestClient) NewSpotTickerPrice

func (client *SpotRestClient) NewSpotTickerPrice() *SpotTickerPriceApi

行情接口 binance SPOT spotTickerPrice rest价格 (NONE)

func (*SpotRestClient) NewSpotTrades

func (client *SpotRestClient) NewSpotTrades() *SpotTradesApi

binance SPOT SpotTrades rest最近成交 (NONE)

func (*SpotRestClient) NewSpotUiKlines

func (client *SpotRestClient) NewSpotUiKlines() *SpotUiKlinesApi

binance SPOT spotUiKlines restUI K线数据 (NONE)

func (*SpotRestClient) NewSpotUserDataStreamDelete

func (client *SpotRestClient) NewSpotUserDataStreamDelete() *SpotUserDataStreamDeleteApi

binance SPOT ws账户推送 SpotUserDataStreamDelete rest现货关闭listenKey (USER_STREAM)

func (*SpotRestClient) NewSpotUserDataStreamPost

func (client *SpotRestClient) NewSpotUserDataStreamPost() *SpotUserDataStreamPostApi

binance SPOT ws账户推送 SpotUserDataStreamPost rest现货创建一个listenKey (USER_STREAM)

func (*SpotRestClient) NewSpotUserDataStreamPut

func (client *SpotRestClient) NewSpotUserDataStreamPut() *SpotUserDataStreamPutApi

binance SPOT ws账户推送 SpotUserDataStreamPut rest现货延长listenKey有效期 (USER_STREAM)

func (*SpotRestClient) NewSubAccountAssets

func (client *SpotRestClient) NewSubAccountAssets() *SpotSubAccountAssetsApi

binance SPOT子母账户接口 SubAccountAssets rest查询子账户资产 (适用主账户)

func (*SpotRestClient) NewSubAccountFuturesAccount

func (client *SpotRestClient) NewSubAccountFuturesAccount() *SpotSubAccountFuturesAccountApi

binance SPOT子母账户接口 SubAccountAssets rest查询子账户Futures账户详情V2 (适用主账户)

func (*SpotRestClient) NewSubAccountFuturesEnable

func (client *SpotRestClient) NewSubAccountFuturesEnable() *SpotSubAccountFuturesEnableApi

binance SPOT子母账户接口 SubAccountFuturesEnable rest为子账户开通Futures (适用主账户)

func (*SpotRestClient) NewSubAccountList

func (client *SpotRestClient) NewSubAccountList() *SpotSubAccountListApi

子母账户接口 binance SPOT子母账户接口 SubAccountList rest查询子账户列表

func (*SpotRestClient) NewSubAccountTransferSubUserHistory

func (client *SpotRestClient) NewSubAccountTransferSubUserHistory() *SpotSubAccountTransferSubUserHistoryApi

binance SPOT子母账户接口 SubAccountTransferSubUserHistory rest查询子账户划转历史 (仅适用子账户)

func (*SpotRestClient) NewSubAccountUniversalTransfer

func (client *SpotRestClient) NewSubAccountUniversalTransfer() *SpotSubAccountUniversalTransferApi

binance SPOT子母账户接口 SubAccountUniversalTransfer rest子母账户万能划转

func (*SpotRestClient) NewSubAccountUniversalTransferHistory

func (client *SpotRestClient) NewSubAccountUniversalTransferHistory() *SpotSubAccountUniversalTransferHistoryApi

binance SPOT子母账户接口 SubAccountUniversalTransferHistory rest查询子母账户万能划转历史查询

func (*SpotRestClient) NewSubAccountVirtualSubAccount

func (client *SpotRestClient) NewSubAccountVirtualSubAccount() *SpotSubAccountVirtualSubAccountApi

binance SPOT子母账户接口 SubAccountVirtualSubAccount rest创建虚拟子账户

type SpotServerTimeApi

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

func (*SpotServerTimeApi) Do

type SpotServerTimeReq

type SpotServerTimeReq struct {
}

type SpotServerTimeRes

type SpotServerTimeRes struct {
	ServerTime int64 `json:"serverTime"`
}

type SpotSubAccountApiIpRestrictionApi

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

func (*SpotSubAccountApiIpRestrictionApi) Do

func (*SpotSubAccountApiIpRestrictionApi) Email

func (*SpotSubAccountApiIpRestrictionApi) RecvWindow

func (*SpotSubAccountApiIpRestrictionApi) SubAccountApiKey

func (api *SpotSubAccountApiIpRestrictionApi) SubAccountApiKey(SubAccountApiKey string) *SpotSubAccountApiIpRestrictionApi

func (*SpotSubAccountApiIpRestrictionApi) Timestamp

type SpotSubAccountApiIpRestrictionReq

type SpotSubAccountApiIpRestrictionReq struct {
	Email            *string `json:"email"`            //YES	Sub-account email
	SubAccountApiKey *string `json:"subAccountApiKey"` //YES
	RecvWindow       *int64  `json:"recvWindow"`
	Timestamp        *int64  `json:"timestamp"`
}

type SpotSubAccountApiIpRestrictionRes

type SpotSubAccountApiIpRestrictionRes struct {
	IpRestrict string   `json:"ipRestrict"`
	IpList     []string `json:"ipList"`
	UpdateTime int64    `json:"updateTime"`
	ApiKey     string   `json:"apiKey"`
}

type SpotSubAccountAssetsApi

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

func (*SpotSubAccountAssetsApi) Do

func (*SpotSubAccountAssetsApi) Email

func (*SpotSubAccountAssetsApi) RecvWindow

func (api *SpotSubAccountAssetsApi) RecvWindow(RecvWindow int64) *SpotSubAccountAssetsApi

func (*SpotSubAccountAssetsApi) Timestamp

func (api *SpotSubAccountAssetsApi) Timestamp(Timestamp int64) *SpotSubAccountAssetsApi

type SpotSubAccountAssetsReq

type SpotSubAccountAssetsReq struct {
	Email      *string `json:"email"` //YES	子账户邮箱 备注
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SpotSubAccountFuturesAccountApi

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

func (*SpotSubAccountFuturesAccountApi) Do

func (*SpotSubAccountFuturesAccountApi) Email

func (*SpotSubAccountFuturesAccountApi) FuturesType

func (*SpotSubAccountFuturesAccountApi) RecvWindow

func (*SpotSubAccountFuturesAccountApi) Timestamp

type SpotSubAccountFuturesAccountReq

type SpotSubAccountFuturesAccountReq struct {
	Email       *string `json:"email"`       //YES	子账户邮箱 备注
	FuturesType *int    `json:"futuresType"` //YES	1:USDT Margined Futures, 2:COIN Margined Futures
	RecvWindow  *int64  `json:"recvWindow"`  //NO
	Timestamp   *int64  `json:"timestamp"`   //YES
}

type SpotSubAccountFuturesEnableApi

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

func (*SpotSubAccountFuturesEnableApi) Do

func (*SpotSubAccountFuturesEnableApi) Email

func (*SpotSubAccountFuturesEnableApi) RecvWindow

func (*SpotSubAccountFuturesEnableApi) Timestamp

type SpotSubAccountFuturesEnableReq

type SpotSubAccountFuturesEnableReq struct {
	Email      *string `json:"email"` //YES	子账户邮箱 备注
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SpotSubAccountListApi

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

func (*SpotSubAccountListApi) Do

func (*SpotSubAccountListApi) Email

func (*SpotSubAccountListApi) Isfreeze

func (api *SpotSubAccountListApi) Isfreeze(Isfreeze bool) *SpotSubAccountListApi

func (*SpotSubAccountListApi) Limit

func (api *SpotSubAccountListApi) Limit(Limit int) *SpotSubAccountListApi

func (*SpotSubAccountListApi) Page

func (*SpotSubAccountListApi) RecvWindow

func (api *SpotSubAccountListApi) RecvWindow(RecvWindow int64) *SpotSubAccountListApi

func (*SpotSubAccountListApi) Timestamp

func (api *SpotSubAccountListApi) Timestamp(Timestamp int64) *SpotSubAccountListApi

type SpotSubAccountListReq

type SpotSubAccountListReq struct {
	Email      *string `json:"email"`
	Isfreeze   *string `json:"isFreeze"`
	Page       *int    `json:"page"`
	Limit      *int    `json:"limit"`
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SpotSubAccountTransferSubUserHistoryApi

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

func (*SpotSubAccountTransferSubUserHistoryApi) Asset

func (*SpotSubAccountTransferSubUserHistoryApi) Do

func (*SpotSubAccountTransferSubUserHistoryApi) EndTime

func (*SpotSubAccountTransferSubUserHistoryApi) Limit

func (*SpotSubAccountTransferSubUserHistoryApi) RecvWindow

func (*SpotSubAccountTransferSubUserHistoryApi) ReturnFailHistory

func (*SpotSubAccountTransferSubUserHistoryApi) StartTime

func (*SpotSubAccountTransferSubUserHistoryApi) Timestamp

func (*SpotSubAccountTransferSubUserHistoryApi) Type

type SpotSubAccountTransferSubUserHistoryReq

type SpotSubAccountTransferSubUserHistoryReq struct {
	Asset             *string `json:"asset"`             //NO	如不提供,返回所有asset 划转记录
	Type              *int64  `json:"type"`              //NO	1: transfer in, 2: transfer out; 如不提供,返回transfer out方向划转记录
	StartTime         *int64  `json:"startTime"`         //NO
	EndTime           *int64  `json:"endTime"`           //NO
	Limit             *int64  `json:"limit"`             //NO	默认值: 500
	ReturnFailHistory *bool   `json:"returnFailHistory"` //NO	默认False,返回PROCESS和SUCCESS状态的数据;如果传True返回PROCESS、SUCCESS、FAILURE状态的数据
	RecvWindow        *int64  `json:"recvWindow"`        //NO
	Timestamp         *int64  `json:"timestamp"`         //YES
}

type SpotSubAccountTransferSubUserHistoryRes

type SpotSubAccountTransferSubUserHistoryRes []SpotSubAccountTransferSubUserHistoryResRow

type SpotSubAccountTransferSubUserHistoryResRow

type SpotSubAccountTransferSubUserHistoryResRow struct {
	CounterParty    string `json:"counterParty"`
	Email           string `json:"email"`
	Type            int64  `json:"type"` // 1 for transfer in , 2 for transfer out
	Asset           string `json:"asset"`
	Qty             string `json:"qty"`
	FromAccountType string `json:"fromAccountType"`
	ToAccountType   string `json:"toAccountType"`
	Status          string `json:"status"` // status: PROCESS / SUCCESS / FAILURE
	TranId          int64  `json:"tranId"`
	Time            int64  `json:"time"`
}

type SpotSubAccountUniversalTransferApi

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

func (*SpotSubAccountUniversalTransferApi) Amount

func (*SpotSubAccountUniversalTransferApi) Asset

func (*SpotSubAccountUniversalTransferApi) ClientTranId

func (*SpotSubAccountUniversalTransferApi) Do

func (*SpotSubAccountUniversalTransferApi) FromAccountType

func (api *SpotSubAccountUniversalTransferApi) FromAccountType(FromAccountType string) *SpotSubAccountUniversalTransferApi

func (*SpotSubAccountUniversalTransferApi) FromEmail

func (*SpotSubAccountUniversalTransferApi) RecvWindow

func (*SpotSubAccountUniversalTransferApi) Symbol

func (*SpotSubAccountUniversalTransferApi) Timestamp

func (*SpotSubAccountUniversalTransferApi) ToAccountType

func (*SpotSubAccountUniversalTransferApi) ToEmail

type SpotSubAccountUniversalTransferHistoryApi

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

func (*SpotSubAccountUniversalTransferHistoryApi) ClientTranId

func (*SpotSubAccountUniversalTransferHistoryApi) Do

func (*SpotSubAccountUniversalTransferHistoryApi) EndTime

func (*SpotSubAccountUniversalTransferHistoryApi) FromEmail

func (*SpotSubAccountUniversalTransferHistoryApi) Limit

func (*SpotSubAccountUniversalTransferHistoryApi) Page

func (*SpotSubAccountUniversalTransferHistoryApi) RecvWindow

func (*SpotSubAccountUniversalTransferHistoryApi) StartTime

func (*SpotSubAccountUniversalTransferHistoryApi) Timestamp

func (*SpotSubAccountUniversalTransferHistoryApi) ToEmail

type SpotSubAccountUniversalTransferHistoryReq

type SpotSubAccountUniversalTransferHistoryReq struct {
	FromEmail    *string `json:"fromEmail"`    //NO
	ToEmail      *string `json:"toEmail"`      //NO
	ClientTranId *string `json:"clientTranId"` //NO
	StartTime    *int64  `json:"startTime"`    //NO
	EndTime      *int64  `json:"endTime"`      //NO
	Page         *int    `json:"page"`         //NO	默认 1
	Limit        *int    `json:"limit"`        //NO	默认 500, 最大 500
	RecvWindow   *int64  `json:"recvWindow"`
	Timestamp    *int64  `json:"timestamp"`
}

type SpotSubAccountUniversalTransferReq

type SpotSubAccountUniversalTransferReq struct {
	FromEmail       *string          `json:"fromEmail"`       //NO
	ToEmail         *string          `json:"toEmail"`         //NO
	FromAccountType *string          `json:"fromAccountType"` //YES	"SPOT","USDT_FUTURE","COIN_FUTURE","MARGIN"(Cross),"ISOLATED_MARGIN"
	ToAccountType   *string          `json:"toAccountType"`   //YES	"SPOT","USDT_FUTURE","COIN_FUTURE","MARGIN"(Cross),"ISOLATED_MARGIN"
	ClientTranId    *string          `json:"clientTranId"`    //NO	不可重复
	Symbol          *string          `json:"symbol"`          //NO	仅在ISOLATED_MARGIN类型下使用
	Asset           *string          `json:"asset"`           //YES
	Amount          *decimal.Decimal `json:"amount"`          //YES
	RecvWindow      *int64           `json:"recvWindow"`
	Timestamp       *int64           `json:"timestamp"`
}

type SpotSubAccountVirtualSubAccountApi

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

func (*SpotSubAccountVirtualSubAccountApi) Do

func (*SpotSubAccountVirtualSubAccountApi) RecvWindow

func (*SpotSubAccountVirtualSubAccountApi) SubAccountString

func (api *SpotSubAccountVirtualSubAccountApi) SubAccountString(SubAccountString string) *SpotSubAccountVirtualSubAccountApi

func (*SpotSubAccountVirtualSubAccountApi) Timestamp

type SpotSubAccountVirtualSubAccountReq

type SpotSubAccountVirtualSubAccountReq struct {
	SubAccountString *string `json:"subAccountString"`
	RecvWindow       *int64  `json:"recvWindow"`
	Timestamp        *int64  `json:"timestamp"`
}

type SpotTicker24hrApi

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

func (*SpotTicker24hrApi) Do

func (*SpotTicker24hrApi) Symbol

func (api *SpotTicker24hrApi) Symbol(Symbol string) *SpotTicker24hrApi

func (*SpotTicker24hrApi) Symbols

func (api *SpotTicker24hrApi) Symbols(Symbols []string) *SpotTicker24hrApi

func (*SpotTicker24hrApi) Type

func (api *SpotTicker24hrApi) Type(Type string) *SpotTicker24hrApi

type SpotTicker24hrReq

type SpotTicker24hrReq struct {
	Symbol  *string   `json:"symbol"`  //NO
	Symbols *[]string `json:"symbols"` //NO
	Type    *string   `json:"type"`    //NO	可接受的参数: FULL or MINI. 如果不提供, 默认值为 FULL
}

type SpotTicker24hrRes

type SpotTicker24hrRes []SpotTicker24hrResRow

type SpotTicker24hrResRow

type SpotTicker24hrResRow struct {
	Symbol             string `json:"symbol"`             // 交易对
	PriceChange        string `json:"priceChange"`        // 价格变动
	PriceChangePercent string `json:"priceChangePercent"` // 价格变动百分比
	WeightedAvgPrice   string `json:"weightedAvgPrice"`   // 平均价格
	PrevClosePrice     string `json:"prevClosePrice"`     // 前一日收盘价
	LastPrice          string `json:"lastPrice"`          // 最新成交价
	LastQty            string `json:"lastQty"`            // 最新成交量
	BidPrice           string `json:"bidPrice"`           // 当前最高买价
	BidQty             string `json:"bidQty"`             // 当前最高买价对应的量
	AskPrice           string `json:"askPrice"`           // 当前最低卖价
	AskQty             string `json:"askQty"`             // 当前最低卖价对应的量
	OpenPrice          string `json:"openPrice"`          // 24小时内第一次交易的价格
	HighPrice          string `json:"highPrice"`          // 24小时内最高成交价
	LowPrice           string `json:"lowPrice"`           // 24小时内最低成交加
	Volume             string `json:"volume"`             // 24小时内成交量
	QuoteVolume        string `json:"quoteVolume"`        // 24小时内成交额
	OpenTime           int64  `json:"openTime"`           // 统计开始时间
	CloseTime          int64  `json:"closeTime"`          // 统计结束时间
	FirstId            int64  `json:"firstId"`            // 首笔成交id
	LastId             int64  `json:"lastId"`             // 末笔成交id
	Count              int64  `json:"count"`              // 成交笔数
}

type SpotTickerApi

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

func (*SpotTickerApi) Do

func (api *SpotTickerApi) Do() (*SpotTickerRes, error)

func (*SpotTickerApi) Symbol

func (api *SpotTickerApi) Symbol(Symbol string) *SpotTickerApi

func (*SpotTickerApi) Symbols

func (api *SpotTickerApi) Symbols(Symbols []string) *SpotTickerApi

func (*SpotTickerApi) Type

func (api *SpotTickerApi) Type(Type string) *SpotTickerApi

func (*SpotTickerApi) WindowSize

func (api *SpotTickerApi) WindowSize(WindowSize string) *SpotTickerApi

type SpotTickerBookTickerApi

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

func (*SpotTickerBookTickerApi) Do

func (*SpotTickerBookTickerApi) Symbol

func (*SpotTickerBookTickerApi) Symbols

func (api *SpotTickerBookTickerApi) Symbols(Symbols []string) *SpotTickerBookTickerApi

type SpotTickerBookTickerReq

type SpotTickerBookTickerReq struct {
	Symbol  *string   `json:"symbol"`  //NO
	Symbols *[]string `json:"symbols"` //NO
}

type SpotTickerBookTickerRes

type SpotTickerBookTickerRes []SpotTickerBookTickerResRow

type SpotTickerBookTickerResRow

type SpotTickerBookTickerResRow struct {
	Symbol   string `json:"symbol"`   // 交易对
	BidPrice string `json:"bidPrice"` // 当前最高买价
	BidQty   string `json:"bidQty"`   // 当前最高买价对应的量
	AskPrice string `json:"askPrice"` // 当前最低卖价
	AskQty   string `json:"askQty"`   // 当前最低卖价对应的量
}

type SpotTickerPriceApi

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

func (*SpotTickerPriceApi) Do

func (*SpotTickerPriceApi) Symbol

func (api *SpotTickerPriceApi) Symbol(Symbol string) *SpotTickerPriceApi

type SpotTickerPriceReq

type SpotTickerPriceReq struct {
	Symbol *string `json:"symbol"` //YES
}

type SpotTickerPriceRes

type SpotTickerPriceRes []SpotTickerPriceResRow

type SpotTickerPriceResRow

type SpotTickerPriceResRow struct {
	Symbol string `json:"symbol"` // 交易对
	Price  string `json:"price"`  // 价格
}

type SpotTickerReq

type SpotTickerReq struct {
	Symbol     *string   `json:"symbol"`     //NO	提供 symbol或者symbols 其中之一
	Symbols    *[]string `json:"symbols"`    //NO
	WindowSize *string   `json:"windowSize"` //NO	默认为 1d
	Type       *string   `json:"type"`       //NO	可接受的参数: FULL or MINI. 如果不提供, 默认值为 FULL
}

type SpotTickerRes

type SpotTickerRes []SpotTickerResRow

type SpotTickerResRow

type SpotTickerResRow struct {
	Symbol             string `json:"symbol"`             // 交易对
	PriceChange        string `json:"priceChange"`        // 价格变动
	PriceChangePercent string `json:"priceChangePercent"` // 价格变动百分比
	WeightedAvgPrice   string `json:"weightedAvgPrice"`   // 平均价格
	OpenPrice          string `json:"openPrice"`          // 24小时内第一次交易的价格
	HighPrice          string `json:"highPrice"`          // 24小时内最高成交价
	LowPrice           string `json:"lowPrice"`           // 24小时内最低成交加
	LastPrice          string `json:"lastPrice"`          // 最新成交价
	Volume             string `json:"volume"`             // 24小时内成交量
	QuoteVolume        string `json:"quoteVolume"`        // 24小时内成交额
	OpenTime           int64  `json:"openTime"`           // 统计开始时间
	CloseTime          int64  `json:"closeTime"`          // 统计结束时间
	FirstId            int64  `json:"firstId"`            // 首笔成交id
	LastId             int64  `json:"lastId"`             // 末笔成交id
	Count              int64  `json:"count"`              // 成交笔数
}

type SpotTradesApi

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

func (*SpotTradesApi) Do

func (api *SpotTradesApi) Do() (*SpotTradesRes, error)

func (*SpotTradesApi) Limit

func (api *SpotTradesApi) Limit(Limit int) *SpotTradesApi

func (*SpotTradesApi) Symbol

func (api *SpotTradesApi) Symbol(Symbol string) *SpotTradesApi

type SpotTradesReq

type SpotTradesReq struct {
	Symbol *string `json:"symbol"` //YES
	Limit  *int    `json:"limit"`  //NO	默认 500; 最大值 1000.
}

type SpotTradesRes

type SpotTradesRes []SpotTradesResRow

type SpotTradesResRow

type SpotTradesResRow struct {
	Id           int64  `json:"id"`           // 交易ID
	Price        string `json:"price"`        // 交易价格
	Qty          string `json:"qty"`          // 交易数量
	Time         int64  `json:"time"`         // 交易成交时间, 和websocket中的T一致.
	IsBuyerMaker bool   `json:"isBuyerMaker"` // 是否是买方成交
	IsBestMatch  bool   `json:"isBestMatch"`  // 是否是最优成交
}

type SpotUiKlinesApi

type SpotUiKlinesApi SpotKlinesApi

func (*SpotUiKlinesApi) Do

func (api *SpotUiKlinesApi) Do() (*KlinesRes, error)

func (*SpotUiKlinesApi) EndTime

func (api *SpotUiKlinesApi) EndTime(EndTime int64) *SpotUiKlinesApi

func (*SpotUiKlinesApi) Interval

func (api *SpotUiKlinesApi) Interval(Interval string) *SpotUiKlinesApi

func (*SpotUiKlinesApi) Limit

func (api *SpotUiKlinesApi) Limit(Limit int) *SpotUiKlinesApi

func (*SpotUiKlinesApi) StartTime

func (api *SpotUiKlinesApi) StartTime(StartTime int64) *SpotUiKlinesApi

func (*SpotUiKlinesApi) Symbol

func (api *SpotUiKlinesApi) Symbol(Symbol string) *SpotUiKlinesApi

type SpotUserDataStreamDeleteApi

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

func (*SpotUserDataStreamDeleteApi) Do

func (*SpotUserDataStreamDeleteApi) ListenKey

type SpotUserDataStreamDeleteReq

type SpotUserDataStreamDeleteReq struct {
	ListenKey *string `json:"listenKey"` //YES
}

type SpotUserDataStreamDeleteRes

type SpotUserDataStreamDeleteRes struct{}

type SpotUserDataStreamPostApi

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

func (*SpotUserDataStreamPostApi) Do

type SpotUserDataStreamPostReq

type SpotUserDataStreamPostReq struct{}

type SpotUserDataStreamPostRes

type SpotUserDataStreamPostRes struct {
	ListenKey string `json:"listenKey"`
}

type SpotUserDataStreamPutApi

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

func (*SpotUserDataStreamPutApi) Do

func (*SpotUserDataStreamPutApi) ListenKey

func (api *SpotUserDataStreamPutApi) ListenKey(ListenKey string) *SpotUserDataStreamPutApi

type SpotUserDataStreamPutReq

type SpotUserDataStreamPutReq struct {
	ListenKey *string `json:"listenKey"` //YES
}

type SpotUserDataStreamPutRes

type SpotUserDataStreamPutRes struct{}

type SpotWsStreamClient

type SpotWsStreamClient struct {
	WsStreamClient
	// contains filtered or unexported fields
}

func (*SpotWsStreamClient) CancelOrder

func (*SpotWsStreamClient) CancelReplaceOrder

func (*SpotWsStreamClient) Close

func (ws *SpotWsStreamClient) Close() error

func (*SpotWsStreamClient) ConvertToAccountWs

func (ws *SpotWsStreamClient) ConvertToAccountWs(apiKey string, apiSecret string, spotWsType SpotWsType, isolatedSymbol ...string) (*SpotWsStreamClient, error)

func (*SpotWsStreamClient) ConvertToWsApi

func (ws *SpotWsStreamClient) ConvertToWsApi(apiKey string, apiSecret string) (*SpotWsStreamClient, error)

转换为Ws API 可以进行ws下单等操作

func (*SpotWsStreamClient) CreateOrder

func (*SpotWsStreamClient) CreatePayload

func (ws *SpotWsStreamClient) CreatePayload() (*WsSpotPayload, error)

func (*SpotWsStreamClient) QueryOrder

type SpotWsType

type SpotWsType int
const (
	SPOT_WS_TYPE SpotWsType = iota
	SPOT_MARGIN_WS_TYPE
	SPOT_ISOLATED_MARGIN_WS_TYPE
)

type SubAccountAssetsRes

type SubAccountAssetsRes struct {
	Balance []SpotBalance `json:"balances"`
}

type SubAccountFuturesAccountAccountResp

type SubAccountFuturesAccountAccountResp struct {
	Email                       string                           `json:"email"`
	Assets                      []SubAccountFuturesAccountAssets `json:"assets"`
	CanDeposit                  bool                             `json:"canDeposit"`
	CanTrade                    bool                             `json:"canTrade"`
	CanWithdraw                 bool                             `json:"canWithdraw"`
	FeeTier                     int                              `json:"feeTier"`
	UpdateTime                  int64                            `json:"updateTime"`
	MaxWithdrawAmount           string                           `json:"maxWithdrawAmount"`
	TotalInitialMargin          string                           `json:"totalInitialMargin"`
	TotalMaintenanceMargin      string                           `json:"totalMaintenanceMargin"`
	TotalMarginBalance          string                           `json:"totalMarginBalance"`
	TotalOpenOrderInitialMargin string                           `json:"totalOpenOrderInitialMargin"`
	TotalPositionInitialMargin  string                           `json:"totalPositionInitialMargin"`
	TotalUnrealizedProfit       string                           `json:"totalUnrealizedProfit"`
	TotalWalletBalance          string                           `json:"totalWalletBalance"`
}

type SubAccountFuturesAccountAssets

type SubAccountFuturesAccountAssets struct {
	Asset                  string `json:"asset"`
	InitialMargin          string `json:"initialMargin"`
	MaintenanceMargin      string `json:"maintenanceMargin"`
	MarginBalance          string `json:"marginBalance"`
	MaxWithdrawAmount      string `json:"maxWithdrawAmount"`
	OpenOrderInitialMargin string `json:"openOrderInitialMargin"`
	PositionInitialMargin  string `json:"positionInitialMargin"`
	UnrealizedProfit       string `json:"unrealizedProfit"`
	WalletBalance          string `json:"walletBalance"`
}

type SubAccountFuturesAccountRes

type SubAccountFuturesAccountRes struct {
	FutureAccountResp   SubAccountFuturesAccountAccountResp `json:"futureAccountResp"`
	DeliveryAccountResp SubAccountFuturesAccountAccountResp `json:"deliveryAccountResp"`
}

type SubAccountFuturesEnableRes

type SubAccountFuturesEnableRes struct {
	Email            string `json:"email"`
	IsFuturesEnabled bool   `json:"isFuturesEnabled"`
}

type SubAccountListRes

type SubAccountListRes struct {
	SubAccounts []SubAccountResSubAccount `json:"subAccounts"`
}

type SubAccountResSubAccount

type SubAccountResSubAccount struct {
	Email                       string `json:"email"`
	IsFreeze                    bool   `json:"isFreeze"`
	CreateTime                  int64  `json:"createTime"`
	IsManagedSubAccount         bool   `json:"isManagedSubAccount"`
	IsAssetManagementSubAccount bool   `json:"isAssetManagementSubAccount"`
}

type SubAccountUniversalTransferHistoryRes

type SubAccountUniversalTransferHistoryRes struct {
	Result     []SubAccountUniversalTransferHistoryResResult `json:"result"`
	TotalCount int                                           `json:"totalCount"`
}

type SubAccountUniversalTransferHistoryResResult

type SubAccountUniversalTransferHistoryResResult struct {
	TranId          int64  `json:"tranId"`
	FromEmail       string `json:"fromEmail"`
	ToEmail         string `json:"toEmail"`
	Asset           string `json:"asset"`
	Amount          string `json:"amount"`
	CreateTimeStamp int64  `json:"createTimeStamp"`
	FromAccountType string `json:"fromAccountType"`
	ToAccountType   string `json:"toAccountType"`
	Status          string `json:"status"`
	ClientTranId    string `json:"clientTranId"`
}

type SubAccountUniversalTransferRes

type SubAccountUniversalTransferRes struct {
	TranId       int64  `json:"tranId"`
	ClientTranId string `json:"clientTranId"`
}

type SubAccountVirtualSubAccountRes

type SubAccountVirtualSubAccountRes struct {
	Email string `json:"email"`
}

type SubscribeParams

type SubscribeParams []string

数据流订阅参数

type SubscribeReq

type SubscribeReq struct {
	Method string   `json:"method"`
	Params []string `json:"params,omitempty"`
	Id     int64    `json:"id"`
}

订阅请求结构体

type SubscribeResult

type SubscribeResult struct {
	Result []string `json:"result"`
	Id     int64    `json:"id"`
	Error  string   `json:"error"`
}

订阅结果结构体

type Subscription

type Subscription[T any] struct {
	ID     int64           //此次订阅ID
	Method string          //订阅方法
	Params SubscribeParams //订阅参数
	// contains filtered or unexported fields
}

数据流订阅返回标准结构体

func (*Subscription[T]) CloseChan

func (sub *Subscription[T]) CloseChan() chan struct{}

获取关闭订阅信号

func (*Subscription[T]) ErrChan

func (sub *Subscription[T]) ErrChan() chan error

获取错误订阅

func (*Subscription[T]) ResultChan

func (sub *Subscription[T]) ResultChan() chan T

获取订阅结果

func (*Subscription[T]) Unsubscribe

func (sub *Subscription[T]) Unsubscribe() error

取消订阅

type SwapAccountApi

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

func (*SwapAccountApi) Do

func (api *SwapAccountApi) Do() (*SwapAccountRes, error)

func (*SwapAccountApi) RecvWindow

func (api *SwapAccountApi) RecvWindow(RecvWindow int64) *SwapAccountApi

func (*SwapAccountApi) Timestamp

func (api *SwapAccountApi) Timestamp(Timestamp int64) *SwapAccountApi

type SwapAccountReq

type SwapAccountReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

type SwapAccountRes

type SwapAccountRes struct {
	Assets []struct {
		Asset                  string `json:"asset"`                  // 资产名
		WalletBalance          string `json:"walletBalance"`          // 账户余额
		UnrealizedProfit       string `json:"unrealizedProfit"`       // 全部持仓未实现盈亏
		MarginBalance          string `json:"marginBalance"`          // 保证金余额
		MaintMargin            string `json:"maintMargin"`            // 维持保证金
		InitialMargin          string `json:"initialMargin"`          // 当前所需起始保证金(按最新标标记价格)
		PositionInitialMargin  string `json:"positionInitialMargin"`  // 当前所需持仓起始保证金(按最新标标记价格)
		OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // 当前所需挂单起始保证金(按最新标标记价格)
		MaxWithdrawAmount      string `json:"maxWithdrawAmount"`      // 最大可提款金额
		CrossWalletBalance     string `json:"crossWalletBalance"`     // 可用于全仓的账户余额
		CrossUnPnl             string `json:"crossUnPnl"`             // 所有全仓持仓的未实现盈亏
		AvailableBalance       string `json:"availableBalance"`       // 可用下单余额
	} `json:"assets"` // 资产内容

	Positions []struct {
		Symbol                 string `json:"symbol"`                 // 交易对
		PositionAmt            string `json:"positionAmt"`            // 持仓数量
		InitialMargin          string `json:"initialMargin"`          // 当前所需起始保证金(按最新标标记价格)
		MaintMargin            string `json:"maintMargin"`            // 持仓维持保证金
		UnrealizedProfit       string `json:"unrealizedProfit"`       // 持仓未实现盈亏
		PositionInitialMargin  string `json:"positionInitialMargin"`  // 当前所需持仓起始保证金(按最新标标记价格)
		OpenOrderInitialMargin string `json:"openOrderInitialMargin"` // 当前所需挂单起始保证金(按最新标标记价格)
		Leverage               string `json:"leverage"`               // 杠杆倍率
		Isolated               bool   `json:"isolated"`               // 是否是逐仓模式
		PositionSide           string `json:"positionSide"`           // 持仓方向
		EntryPrice             string `json:"entryPrice"`             // 平均持仓成本
		UpdateTime             int64  `json:"updateTime"`             // 最新更新时间
		MaxQty                 string `json:"maxQty"`                 // 当前杠杆下最大可开仓数(标的数量)
	} `json:"positions"` // 头寸
	CanDeposit  bool  `json:"canDeposit"`  // 是否可以入金
	CanTrade    bool  `json:"canTrade"`    // 是否可以交易
	CanWithdraw bool  `json:"canWithdraw"` // 是否可以出金
	FeeTier     int64 `json:"feeTier"`     // 手续费等级
	UpdateTime  int64 `json:"updateTime"`
}

type SwapAllOrdersApi

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

func (*SwapAllOrdersApi) Do

func (api *SwapAllOrdersApi) Do() (*SwapAllOrdersRes, error)

func (*SwapAllOrdersApi) EndTime

func (api *SwapAllOrdersApi) EndTime(EndTime int64) *SwapAllOrdersApi

func (*SwapAllOrdersApi) Limit

func (api *SwapAllOrdersApi) Limit(Limit int64) *SwapAllOrdersApi

func (*SwapAllOrdersApi) OrderId

func (api *SwapAllOrdersApi) OrderId(OrderId int64) *SwapAllOrdersApi

func (*SwapAllOrdersApi) RecvWindow

func (api *SwapAllOrdersApi) RecvWindow(RecvWindow int64) *SwapAllOrdersApi

func (*SwapAllOrdersApi) StartTime

func (api *SwapAllOrdersApi) StartTime(StartTime int64) *SwapAllOrdersApi

func (*SwapAllOrdersApi) Symbol

func (api *SwapAllOrdersApi) Symbol(Symbol string) *SwapAllOrdersApi

func (*SwapAllOrdersApi) Timestamp

func (api *SwapAllOrdersApi) Timestamp(Timestamp int64) *SwapAllOrdersApi

type SwapAllOrdersReq

type SwapAllOrdersReq struct {
	Symbol     *string `json:"symbol"`    //YES	交易对
	OrderId    *int64  `json:"orderId"`   //NO	只返回此orderID及之后的订单,缺省返回最近的订单
	StartTime  *int64  `json:"startTime"` //NO	起始时间
	EndTime    *int64  `json:"endTime"`   //NO	结束时间
	Limit      *int64  `json:"limit"`     //NO	返回的结果集数量 默认值:500 最大值:1000
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SwapAllOrdersRes

type SwapAllOrdersRes []SwapOrderOrder

type SwapApi

type SwapApi int
const (
	//币合约账户接口
	SwapAccount              SwapApi = iota //账户信息 (USER_DATA)
	SwapPositionSideDualGet                 //查询持仓模式 (USER_DATA)
	SwapLeverageBracket                     //杠杆分层标准 (USER_DATA)
	SwapPositionSideDualPost                //更改持仓模式 (TRADE)
	SwapLeverage                            //调整开仓杠杆 (TRADE)
	SwapMarginType                          //变换逐全仓模式 (TRADE)
	SwapPositionRisk                        //用户持仓风险 (USER_DATA)

	//币合约订单接口
	SwapOpenOrders     //查询当前挂单 (USER_DATA)
	SwapAllOrders      //查询所有订单 (USER_DATA)
	SwapOrderPost      //下单 (TRADE)
	SwapOrderPut       //修改订单 (TRADE)
	SwapOrderGet       //查询订单 (USER_DATA)
	SwapOrderDelete    //撤销订单 (TRADE)
	SwapUserTrades     //查询账户成交记录 (USER_DATA)
	SwapCommissionRate //GET接口 (HMAC SHA256)查询用户当前的手续费率

	SwapBatchOrdersPost   //批量下单 (TRADE)
	SwapBatchOrdersPut    //批量修改订单 (TRADE)
	SwapBatchOrdersDelete //批量撤销订单 (TRADE)

	//通用接口
	SwapPing         //测试连接
	SwapServerTime   //获取服务器时间
	SwapExchangeInfo //交易规则和交易对信息

	//行情接口
	SwapKlines      //获取K线数据
	SwapTickerPrice //获取交易对最新价格
	SwapDepth       //获取深度信息

	//Ws账户推送相关
	SwapListenKeyPost //生成listenKey (USER_STREAM)
	SwapListenKeyPut  //延长listenKey有效期 (USER_STREAM)
	SwapListenKeyDel  //关闭listenKey (USER_STREAM)
)

type SwapBatchOrdersDeleteApi

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

func (*SwapBatchOrdersDeleteApi) Do

func (*SwapBatchOrdersDeleteApi) OrderIdList

func (api *SwapBatchOrdersDeleteApi) OrderIdList(OrderIdList []int64) *SwapBatchOrdersDeleteApi

func (*SwapBatchOrdersDeleteApi) OrigClientOrderIdList

func (api *SwapBatchOrdersDeleteApi) OrigClientOrderIdList(OrigClientOrderIdList []string) *SwapBatchOrdersDeleteApi

func (*SwapBatchOrdersDeleteApi) RecvWindow

func (api *SwapBatchOrdersDeleteApi) RecvWindow(RecvWindow int64) *SwapBatchOrdersDeleteApi

func (*SwapBatchOrdersDeleteApi) Symbol

func (*SwapBatchOrdersDeleteApi) Timestamp

func (api *SwapBatchOrdersDeleteApi) Timestamp(Timestamp int64) *SwapBatchOrdersDeleteApi

type SwapBatchOrdersDeleteReq

type SwapBatchOrdersDeleteReq struct {
	Symbol                *string   `json:"symbol"`                //YES 交易对
	OrderIdList           *[]int64  `json:"orderIdList"`           //NO 系统订单号, 最多支持10个订单
	OrigClientOrderIdList *[]string `json:"origClientOrderIdList"` //NO 用户自定义的订单号, 最多支持10个订单
	RecvWindow            *int64    `json:"recvWindow"`            //NO
	Timestamp             *int64    `json:"timestamp"`             //YES
}

type SwapBatchOrdersDeleteRes

type SwapBatchOrdersDeleteRes []SwapOrderDeleteRes

type SwapBatchOrdersPostApi

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

func (*SwapBatchOrdersPostApi) AddOrders

func (api *SwapBatchOrdersPostApi) AddOrders(orderApis ...*SwapOrderPostApi) *SwapBatchOrdersPostApi

func (*SwapBatchOrdersPostApi) Do

func (*SwapBatchOrdersPostApi) RecvWindow

func (api *SwapBatchOrdersPostApi) RecvWindow(RecvWindow int64) *SwapBatchOrdersPostApi

func (*SwapBatchOrdersPostApi) SetOrders

func (api *SwapBatchOrdersPostApi) SetOrders(orderApi []*SwapOrderPostApi) *SwapBatchOrdersPostApi

func (*SwapBatchOrdersPostApi) Timestamp

func (api *SwapBatchOrdersPostApi) Timestamp(Timestamp int64) *SwapBatchOrdersPostApi

type SwapBatchOrdersPostReq

type SwapBatchOrdersPostReq struct {
	BatchOrders *[]SwapOrderPostReq `json:"batchOrders"` //YES	批量下单 最多支持5个
	RecvWindow  *int64              `json:"recvWindow"`  //NO
	Timestamp   *int64              `json:"timestamp"`   //YES
}

type SwapBatchOrdersPostRes

type SwapBatchOrdersPostRes []SwapOrderPostResRow

type SwapBatchOrdersPutApi

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

func (*SwapBatchOrdersPutApi) AddOrders

func (api *SwapBatchOrdersPutApi) AddOrders(orderApi ...*SwapOrderPutApi) *SwapBatchOrdersPutApi

func (*SwapBatchOrdersPutApi) Do

func (*SwapBatchOrdersPutApi) RecvWindow

func (api *SwapBatchOrdersPutApi) RecvWindow(RecvWindow int64) *SwapBatchOrdersPutApi

func (*SwapBatchOrdersPutApi) SetOrders

func (api *SwapBatchOrdersPutApi) SetOrders(orderApi []*SwapOrderPutApi) *SwapBatchOrdersPutApi

func (*SwapBatchOrdersPutApi) Timestamp

func (api *SwapBatchOrdersPutApi) Timestamp(Timestamp int64) *SwapBatchOrdersPutApi

type SwapBatchOrdersPutReq

type SwapBatchOrdersPutReq struct {
	BatchOrders *[]SwapOrderPutReq `json:"batchOrders"` //YES	批量下单 最多支持5个
	RecvWindow  *int64             `json:"recvWindow"`  //NO
	Timestamp   *int64             `json:"timestamp"`   //YES
}

type SwapBatchOrdersPutRes

type SwapBatchOrdersPutRes []SwapBatchOrdersPutResRow

type SwapBatchOrdersPutResRow

type SwapBatchOrdersPutResRow struct {
	BinanceErrorRes
	SwapOrderPutRes
}

type SwapCommissionRateApi

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

func (*SwapCommissionRateApi) Do

func (*SwapCommissionRateApi) RecvWindow

func (api *SwapCommissionRateApi) RecvWindow(RecvWindow int64) *SwapCommissionRateApi

func (*SwapCommissionRateApi) Symbol

func (api *SwapCommissionRateApi) Symbol(Symbol string) *SwapCommissionRateApi

func (*SwapCommissionRateApi) Timestamp

func (api *SwapCommissionRateApi) Timestamp(Timestamp int64) *SwapCommissionRateApi

type SwapCommissionRateReq

type SwapCommissionRateReq struct {
	Symbol     *string `json:"symbol"`     //YES	交易对
	RecvWindow *int64  `json:"recvWindow"` //NO
	Timestamp  *int64  `json:"timestamp"`  //YES\
}

symbol STRING YES recvWindow LONG NO timestamp LONG YES

type SwapCommissionRateRes

type SwapCommissionRateRes struct {
	Symbol              string `json:"symbol"`
	MakerCommissionRate string `json:"makerCommissionRate"`
	TakerCommissionRate string `json:"takerCommissionRate"`
}

type SwapCommonPostRes

type SwapCommonPostRes struct {
	Code int64  `json:"code"`
	Msg  string `json:"msg"`
}

type SwapDepthApi

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

func (*SwapDepthApi) Do

func (api *SwapDepthApi) Do() (*SwapDepthRes, error)

func (*SwapDepthApi) Limit

func (api *SwapDepthApi) Limit(Limit int) *SwapDepthApi

func (*SwapDepthApi) Symbol

func (api *SwapDepthApi) Symbol(Symbol string) *SwapDepthApi

type SwapDepthReq

type SwapDepthReq struct {
	Symbol *string `json:"symbol"` //YES	交易对
	Limit  *int    `json:"limit"`  //NO	默认 500; 可选值:[5, 10, 20, 50, 100, 500, 1000]
}

type SwapDepthRes

type SwapDepthRes struct {
	LastUpdateId int64       `json:"lastUpdateId"`
	Symbol       string      `json:"symbol"` // 交易对
	Pair         string      `json:"pair"`   // 标的交易对
	E            int64       `json:"E"`      // 消息时间
	T            int64       `json:"T"`      // 撮合时间
	Bids         []DepthGear `json:"bids"`
	Asks         []DepthGear `json:"asks"`
}

type SwapDepthResMiddle

type SwapDepthResMiddle struct {
	LastUpdateId int64           `json:"lastUpdateId"`
	Symbol       string          `json:"symbol"` // 交易对
	Pair         string          `json:"pair"`   // 标的交易对
	E            int64           `json:"E"`      // 消息时间
	T            int64           `json:"T"`      // 撮合时间
	Bids         [][]interface{} `json:"bids"`
	Asks         [][]interface{} `json:"asks"`
}

func (*SwapDepthResMiddle) ConvertToRes

func (middle *SwapDepthResMiddle) ConvertToRes() *SwapDepthRes

type SwapExchangeInfoApi

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

func (*SwapExchangeInfoApi) Do

type SwapExchangeInfoReq

type SwapExchangeInfoReq struct {
}

type SwapExchangeInfoRes

type SwapExchangeInfoRes struct {
	ExchangeFilters []map[string]interface{}       `json:"exchangeFilters"`
	RateLimits      []SwapExchangeInfoResRateLimit `json:"rateLimits"`
	Symbols         []SwapExchangeInfoResSymbol    `json:"symbols"`
	Timezone        string                         `json:"timezone"` // 服务器所用的时间区域
}

type SwapExchangeInfoResRateLimit

type SwapExchangeInfoResRateLimit struct {
	Interval      string `json:"interval"`      // 按照分钟计算
	IntervalNum   int64  `json:"intervalNum"`   // 按照1分钟计算
	Limit         int64  `json:"limit"`         // 上限次数
	RateLimitType string `json:"rateLimitType"` // 按照访问权重来计算
}

type SwapExchangeInfoResSymbol

type SwapExchangeInfoResSymbol struct {
	Filters            []map[string]interface{} `json:"filters"`         // 交易对限制
	OrderType          []string                 `json:"orderType"`       // 订单类型
	TimeInForce        []string                 `json:"timeInForce"`     // 有效方式
	LiquidationFee     string                   `json:"liquidationFee"`  // 强平费率
	MarketTakeBound    string                   `json:"marketTakeBound"` // 市价吃单(相对于标记价格)允许可造成的最大价格偏离比例
	Symbol             string                   `json:"symbol"`          // 交易对
	Pair               string                   `json:"pair"`            // 标的交易对
	ContractType       string                   `json:"contractType"`    // 合约类型
	DeliveryDate       int64                    `json:"deliveryDate"`
	OnboardDate        int64                    `json:"onboardDate"`
	ContractStatus     string                   `json:"contractStatus"` // 交易对状态
	ContractSize       int64                    `json:"contractSize"`
	QuoteAsset         string                   `json:"quoteAsset"`        // 报价币种
	BaseAsset          string                   `json:"baseAsset"`         // 标的物
	MarginAsset        string                   `json:"marginAsset"`       // 保证金币种
	PricePrecision     int64                    `json:"pricePrecision"`    // 价格小数点位数(仅作为系统精度使用,注意同tickSize 区分)
	QuantityPrecision  int64                    `json:"quantityPrecision"` // 数量小数点位数(仅作为系统精度使用,注意同stepSize 区分)
	BaseAssetPrecision int64                    `json:"baseAssetPrecision"`
	QuotePrecision     int64                    `json:"quotePrecision"`
	TriggerProtect     string                   `json:"triggerProtect"`    // 开启"priceProtect"的条件订单的触发阈值
	UnderlyingType     string                   `json:"underlyingType"`    // 标的类型
	UnderlyingSubType  []string                 `json:"underlyingSubType"` // 标的物子类型
}

type SwapKlinesApi

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

func (*SwapKlinesApi) Do

func (api *SwapKlinesApi) Do() (*KlinesRes, error)

func (*SwapKlinesApi) EndTime

func (api *SwapKlinesApi) EndTime(EndTime int64) *SwapKlinesApi

func (*SwapKlinesApi) Interval

func (api *SwapKlinesApi) Interval(Interval string) *SwapKlinesApi

func (*SwapKlinesApi) Limit

func (api *SwapKlinesApi) Limit(Limit int) *SwapKlinesApi

func (*SwapKlinesApi) StartTime

func (api *SwapKlinesApi) StartTime(StartTime int64) *SwapKlinesApi

func (*SwapKlinesApi) Symbol

func (api *SwapKlinesApi) Symbol(Symbol string) *SwapKlinesApi

type SwapKlinesReq

type SwapKlinesReq struct {
	Symbol    *string `json:"symbol"`    //YES
	Interval  *string `json:"interval"`  //YES	详见枚举定义:K线间隔
	StartTime *int64  `json:"startTime"` //NO
	EndTime   *int64  `json:"endTime"`   //NO
	Limit     *int    `json:"limit"`     //NO	默认 500; 最大 1000.
}

type SwapLeverageApi

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

func (*SwapLeverageApi) Do

func (api *SwapLeverageApi) Do() (*SwapLeverageRes, error)

func (*SwapLeverageApi) Leverage

func (api *SwapLeverageApi) Leverage(Leverage int64) *SwapLeverageApi

func (*SwapLeverageApi) RecvWindow

func (api *SwapLeverageApi) RecvWindow(RecvWindow int64) *SwapLeverageApi

func (*SwapLeverageApi) Symbol

func (api *SwapLeverageApi) Symbol(Symbol string) *SwapLeverageApi

func (*SwapLeverageApi) Timestamp

func (api *SwapLeverageApi) Timestamp(Timestamp int64) *SwapLeverageApi

type SwapLeverageBracketApi

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

func (*SwapLeverageBracketApi) Do

func (*SwapLeverageBracketApi) RecvWindow

func (api *SwapLeverageBracketApi) RecvWindow(RecvWindow int64) *SwapLeverageBracketApi

func (*SwapLeverageBracketApi) Symbol

func (*SwapLeverageBracketApi) Timestamp

func (api *SwapLeverageBracketApi) Timestamp(Timestamp int64) *SwapLeverageBracketApi

type SwapLeverageBracketReq

type SwapLeverageBracketReq struct {
	Symbol     *string `json:"symbol"` //No	交易对
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SwapLeverageBracketRes

type SwapLeverageBracketRes []SwapLeverageBracketResResult

type SwapLeverageBracketResResult

type SwapLeverageBracketResResult struct {
	Symbol   string                                 `json:"symbol"`   // 交易对
	Brackets []SwapLeverageBracketResResultBrackets `json:"brackets"` // 杠杆档位
}

type SwapLeverageBracketResResultBrackets

type SwapLeverageBracketResResultBrackets struct {
	Bracket          int64           `json:"bracket"`          // 层级
	InitialLeverage  int64           `json:"initialLeverage"`  // 该层允许的最高初始杠杆倍数
	QtyCap           int64           `json:"qtyCap"`           // 该层对应的数量上限
	QtyFloor         int64           `json:"qtyFloor"`         // 该层对应的数量下限
	MaintMarginRatio decimal.Decimal `json:"maintMarginRatio"` // 该层对应的维持保证金率
	Cum              decimal.Decimal `json:"cum"`              // 速算数
}

type SwapLeverageReq

type SwapLeverageReq struct {
	Symbol     *string `json:"symbol"`   //YES	交易对
	Leverage   *int64  `json:"leverage"` //YES	目标杠杆倍数:1 到 125 整数
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SwapLeverageRes

type SwapLeverageRes struct {
	Leverage         int64  `json:"leverage"`         // 杠杆倍数
	MaxNotionalValue string `json:"maxNotionalValue"` // 当前杠杆倍数下允许的最大名义价值
	Symbol           string `json:"symbol"`           // 交易对
}

type SwapListenKeyDeleteApi

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

func (*SwapListenKeyDeleteApi) Do

type SwapListenKeyDeleteReq

type SwapListenKeyDeleteReq struct{}

type SwapListenKeyDeleteRes

type SwapListenKeyDeleteRes struct{}

type SwapListenKeyPostApi

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

func (*SwapListenKeyPostApi) Do

type SwapListenKeyPostReq

type SwapListenKeyPostReq struct{}

type SwapListenKeyPostRes

type SwapListenKeyPostRes struct {
	ListenKey string `json:"listenKey"`
}

type SwapListenKeyPutApi

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

func (*SwapListenKeyPutApi) Do

type SwapListenKeyPutReq

type SwapListenKeyPutReq struct{}

type SwapListenKeyPutRes

type SwapListenKeyPutRes struct{}

type SwapMarginTypeApi

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

func (*SwapMarginTypeApi) Do

func (*SwapMarginTypeApi) MarginType

func (api *SwapMarginTypeApi) MarginType(MarginType string) *SwapMarginTypeApi

func (*SwapMarginTypeApi) RecvWindow

func (api *SwapMarginTypeApi) RecvWindow(RecvWindow int64) *SwapMarginTypeApi

func (*SwapMarginTypeApi) Symbol

func (api *SwapMarginTypeApi) Symbol(Symbol string) *SwapMarginTypeApi

func (*SwapMarginTypeApi) Timestamp

func (api *SwapMarginTypeApi) Timestamp(Timestamp int64) *SwapMarginTypeApi

type SwapMarginTypeReq

type SwapMarginTypeReq struct {
	Symbol     *string `json:"symbol"`     //YES	交易对
	MarginType *string `json:"marginType"` //YES	保证金模式 ISOLATED(逐仓), CROSSED(全仓)
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SwapMarginTypeRes

type SwapMarginTypeRes SwapCommonPostRes

type SwapOpenOrdersApi

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

func (*SwapOpenOrdersApi) Do

func (*SwapOpenOrdersApi) RecvWindow

func (api *SwapOpenOrdersApi) RecvWindow(RecvWindow int64) *SwapOpenOrdersApi

func (*SwapOpenOrdersApi) Symbol

func (api *SwapOpenOrdersApi) Symbol(Symbol string) *SwapOpenOrdersApi

func (*SwapOpenOrdersApi) Timestamp

func (api *SwapOpenOrdersApi) Timestamp(Timestamp int64) *SwapOpenOrdersApi

type SwapOpenOrdersReq

type SwapOpenOrdersReq struct {
	Symbol     *string `json:"symbol"` //No	交易对
	RecvWindow *int64  `json:"recvWindow"`
	Timestamp  *int64  `json:"timestamp"`
}

type SwapOpenOrdersRes

type SwapOpenOrdersRes []SwapOrderOrder

type SwapOrderDeleteApi

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

func (*SwapOrderDeleteApi) Do

func (*SwapOrderDeleteApi) OrderId

func (api *SwapOrderDeleteApi) OrderId(OrderId int64) *SwapOrderDeleteApi

func (*SwapOrderDeleteApi) OrigClientOrderId

func (api *SwapOrderDeleteApi) OrigClientOrderId(OrigClientOrderId string) *SwapOrderDeleteApi

func (*SwapOrderDeleteApi) RecvWindow

func (api *SwapOrderDeleteApi) RecvWindow(RecvWindow int64) *SwapOrderDeleteApi

func (*SwapOrderDeleteApi) Symbol

func (api *SwapOrderDeleteApi) Symbol(Symbol string) *SwapOrderDeleteApi

func (*SwapOrderDeleteApi) Timestamp

func (api *SwapOrderDeleteApi) Timestamp(Timestamp int64) *SwapOrderDeleteApi

type SwapOrderDeleteReq

type SwapOrderDeleteReq struct {
	Symbol            *string `json:"symbol"`            //YES 交易对
	OrderId           *int64  `json:"orderId"`           //NO 系统订单号
	OrigClientOrderId *string `json:"origClientOrderId"` //NO 用户自定义的订单号
	RecvWindow        *int64  `json:"recvWindow"`        //NO
	Timestamp         *int64  `json:"timestamp"`         //YES
}

type SwapOrderDeleteRes

type SwapOrderDeleteRes struct {
	BinanceErrorRes
	SwapOrderOrder
}

type SwapOrderGetApi

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

func (*SwapOrderGetApi) Do

func (api *SwapOrderGetApi) Do() (*SwapOrderGetRes, error)

func (*SwapOrderGetApi) OrderId

func (api *SwapOrderGetApi) OrderId(OrderId int64) *SwapOrderGetApi

func (*SwapOrderGetApi) OrigClientOrderId

func (api *SwapOrderGetApi) OrigClientOrderId(OrigClientOrderId string) *SwapOrderGetApi

func (*SwapOrderGetApi) RecvWindow

func (api *SwapOrderGetApi) RecvWindow(RecvWindow int64) *SwapOrderGetApi

func (*SwapOrderGetApi) Symbol

func (api *SwapOrderGetApi) Symbol(Symbol string) *SwapOrderGetApi

func (*SwapOrderGetApi) Timestamp

func (api *SwapOrderGetApi) Timestamp(Timestamp int64) *SwapOrderGetApi

type SwapOrderGetReq

type SwapOrderGetReq struct {
	Symbol            *string `json:"symbol"`            //YES 交易对
	OrderId           *int64  `json:"orderId"`           //NO 系统订单号
	OrigClientOrderId *string `json:"origClientOrderId"` //NO 用户自定义的订单号
	RecvWindow        *int64  `json:"recvWindow"`        //NO
	Timestamp         *int64  `json:"timestamp"`         //YES
}

type SwapOrderGetRes

type SwapOrderGetRes SwapOrderOrder

type SwapOrderOrder

type SwapOrderOrder struct {
	AvgPrice      string `json:"avgPrice"`      // 平均成交价
	ClientOrderId string `json:"clientOrderId"` // 用户自定义的订单号
	CumQuote      string `json:"cumQuote"`      // 成交金额
	ExecutedQty   string `json:"executedQty"`   // 成交量
	OrderId       int64  `json:"orderId"`       // 系统订单号
	OrigQty       string `json:"origQty"`       // 原始委托数量
	OrigType      string `json:"origType"`      // 触发前订单类型
	Price         string `json:"price"`         // 委托价格
	ReduceOnly    bool   `json:"reduceOnly"`    // 是否仅减仓
	Side          string `json:"side"`          // 买卖方向
	PositionSide  string `json:"positionSide"`  // 持仓方向
	Status        string `json:"status"`        // 订单状态
	StopPrice     string `json:"stopPrice"`     // 触发价,对`TRAILING_STOP_MARKET`无效
	ClosePosition bool   `json:"closePosition"` // 是否条件全平仓
	Symbol        string `json:"symbol"`        // 交易对
	Time          int64  `json:"time"`          // 订单时间
	TimeInForce   string `json:"timeInForce"`   // 有效方法
	Type          string `json:"type"`          // 订单类型
	ActivatePrice string `json:"activatePrice"` // 跟踪止损激活价格, 仅`TRAILING_STOP_MARKET` 订单返回此字段
	PriceRate     string `json:"priceRate"`     // 跟踪止损回调比例, 仅`TRAILING_STOP_MARKET` 订单返回此字段
	UpdateTime    int64  `json:"updateTime"`    // 更新时间
	WorkingType   string `json:"workingType"`   // 条件价格触发类型
	PriceProtect  bool   `json:"priceProtect"`  // 是否开启条件单触发保护
}

type SwapOrderPostApi

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

func (*SwapOrderPostApi) ActivationPrice

func (api *SwapOrderPostApi) ActivationPrice(ActivationPrice decimal.Decimal) *SwapOrderPostApi

func (*SwapOrderPostApi) CallbackRate

func (api *SwapOrderPostApi) CallbackRate(CallbackRate decimal.Decimal) *SwapOrderPostApi

func (*SwapOrderPostApi) ClosePosition

func (api *SwapOrderPostApi) ClosePosition(ClosePosition string) *SwapOrderPostApi

func (*SwapOrderPostApi) Do

func (api *SwapOrderPostApi) Do() (*SwapOrderPostRes, error)

func (*SwapOrderPostApi) NewClientOrderId

func (api *SwapOrderPostApi) NewClientOrderId(NewClientOrderId string) *SwapOrderPostApi

func (*SwapOrderPostApi) NewOrderRespType

func (api *SwapOrderPostApi) NewOrderRespType(NewOrderRespType string) *SwapOrderPostApi

func (*SwapOrderPostApi) PositionSide

func (api *SwapOrderPostApi) PositionSide(PositionSide string) *SwapOrderPostApi

func (*SwapOrderPostApi) Price

func (api *SwapOrderPostApi) Price(Price decimal.Decimal) *SwapOrderPostApi

func (*SwapOrderPostApi) PriceProtect

func (api *SwapOrderPostApi) PriceProtect(PriceProtect string) *SwapOrderPostApi

func (*SwapOrderPostApi) Quantity

func (api *SwapOrderPostApi) Quantity(Quantity decimal.Decimal) *SwapOrderPostApi

func (*SwapOrderPostApi) RecvWindow

func (api *SwapOrderPostApi) RecvWindow(RecvWindow int64) *SwapOrderPostApi

func (*SwapOrderPostApi) ReduceOnly

func (api *SwapOrderPostApi) ReduceOnly(ReduceOnly string) *SwapOrderPostApi

func (*SwapOrderPostApi) Side

func (api *SwapOrderPostApi) Side(Side string) *SwapOrderPostApi

func (*SwapOrderPostApi) StopPrice

func (api *SwapOrderPostApi) StopPrice(StopPrice decimal.Decimal) *SwapOrderPostApi

func (*SwapOrderPostApi) Symbol

func (api *SwapOrderPostApi) Symbol(Symbol string) *SwapOrderPostApi

func (*SwapOrderPostApi) TimeInForce

func (api *SwapOrderPostApi) TimeInForce(TimeInForce string) *SwapOrderPostApi

func (*SwapOrderPostApi) Timestamp

func (api *SwapOrderPostApi) Timestamp(Timestamp int64) *SwapOrderPostApi

func (*SwapOrderPostApi) Type

func (api *SwapOrderPostApi) Type(Type string) *SwapOrderPostApi

func (*SwapOrderPostApi) WorkingType

func (api *SwapOrderPostApi) WorkingType(WorkingType string) *SwapOrderPostApi

type SwapOrderPostReq

type SwapOrderPostReq struct {
	Symbol           *string          `json:"symbol"`                     //Yes	交易对
	Side             *string          `json:"side"`                       //Yes	买卖方向 SELL, BUY
	PositionSide     *string          `json:"positionSide,omitempty"`     //No	持仓方向,单向持仓模式下非必填,默认且仅可填BOTH;在双向持仓模式下必填,且仅可选择 LONG 或 SHORT
	Type             *string          `json:"type"`                       //Yes	订单类型 LIMIT, MARKET, STOP, TAKE_PROFIT, STOP_MARKET, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET
	ReduceOnly       *string          `json:"reduceOnly,omitempty"`       //No	true, false; 非双开模式下默认false;双开模式下不接受此参数; 使用closePosition不支持此参数。
	Quantity         *decimal.Decimal `json:"quantity,omitempty"`         //No	下单数量,使用closePosition不支持此参数。
	Price            *decimal.Decimal `json:"price,omitempty"`            //No	委托价格
	NewClientOrderId *string          `json:"newClientOrderId,omitempty"` //No	用户自定义的订单号,不可以重复出现在挂单中。如空缺系统会自动赋值。必须满足正则规则 ^[\.A-Z\:/a-z0-9_-]{1,36}$
	StopPrice        *decimal.Decimal `json:"stopPrice,omitempty"`        //No	触发价, 仅 STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET 需要此参数
	ClosePosition    *string          `json:"closePosition,omitempty"`    //No	true, false;触发后全部平仓,仅支持STOP_MARKET和TAKE_PROFIT_MARKET;不与quantity合用;自带只平仓效果,不与reduceOnly 合用
	ActivationPrice  *decimal.Decimal `json:"activationPrice,omitempty"`  //No	追踪止损激活价格,仅TRAILING_STOP_MARKET 需要此参数, 默认为下单当前市场价格(支持不同workingType)
	CallbackRate     *decimal.Decimal `json:"callbackRate,omitempty"`     //No	追踪止损回调比例,可取值范围[0.1, 5],其中 1代表1% ,仅TRAILING_STOP_MARKET 需要此参数
	TimeInForce      *string          `json:"timeInForce,omitempty"`      //No	有效方法
	WorkingType      *string          `json:"workingType,omitempty"`      //No	stopPrice 触发类型: MARK_PRICE(标记价格), CONTRACT_PRICE(合约最新价). 默认 CONTRACT_PRICE
	PriceProtect     *string          `json:"priceProtect,omitempty"`     //No	条件单触发保护:"TRUE","FALSE", 默认"FALSE". 仅 STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET 需要此参数
	NewOrderRespType *string          `json:"newOrderRespType,omitempty"` //No	"ACK", "RESULT", 默认 "ACK"
	RecvWindow       *int64           `json:"recvWindow,omitempty"`       //No
	Timestamp        *int64           `json:"timestamp,omitempty"`        //Yes
}

type SwapOrderPostRes

type SwapOrderPostRes struct {
	ClientOrderId string `json:"clientOrderId"` // 用户自定义的订单号
	CumQty        string `json:"cumQty"`
	CumQuote      string `json:"cumQuote"` // 成交金额
	ExecutedQty   string `json:"executedQty"`
	OrderId       int64  `json:"orderId"` // 系统订单号
	AvgPrice      string `json:"avgPrice"`
	OrigQty       string `json:"origQty"` // 原始委托数量
	Price         string `json:"price"`   // 委托价格
	ReduceOnly    bool   `json:"reduceOnly"`
	Side          string `json:"side"`         // 买卖方向
	PositionSide  string `json:"positionSide"` // 持仓方向
	Status        string `json:"status"`       // 订单状态
	StopPrice     string `json:"stopPrice"`    // 触发价,对`TRAILING_STOP_MARKET`无效
	ClosePosition bool   `json:"closePosition"`
	Symbol        string `json:"symbol"`      // 交易对
	TimeInForce   string `json:"timeInForce"` // 有效方法
	Type          string `json:"type"`        // 订单类型
	OrigType      string `json:"origType"`    // 触发前订单类型
}

type SwapOrderPostResRow

type SwapOrderPostResRow struct {
	BinanceErrorRes
	SwapOrderPostRes
}

type SwapOrderPutApi

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

func (*SwapOrderPutApi) Do

func (api *SwapOrderPutApi) Do() (*SwapOrderPutRes, error)

func (*SwapOrderPutApi) OrderId

func (api *SwapOrderPutApi) OrderId(OrderId string) *SwapOrderPutApi

func (*SwapOrderPutApi) OrigClientOrderId

func (api *SwapOrderPutApi) OrigClientOrderId(OrigClientOrderId string) *SwapOrderPutApi

func (*SwapOrderPutApi) Price

func (api *SwapOrderPutApi) Price(Price decimal.Decimal) *SwapOrderPutApi

func (*SwapOrderPutApi) Quantity

func (api *SwapOrderPutApi) Quantity(Quantity decimal.Decimal) *SwapOrderPutApi

func (*SwapOrderPutApi) RecvWindow

func (api *SwapOrderPutApi) RecvWindow(RecvWindow int64) *SwapOrderPutApi

func (*SwapOrderPutApi) Side

func (api *SwapOrderPutApi) Side(Side string) *SwapOrderPutApi

func (*SwapOrderPutApi) Symbol

func (api *SwapOrderPutApi) Symbol(Symbol string) *SwapOrderPutApi

func (*SwapOrderPutApi) Timestamp

func (api *SwapOrderPutApi) Timestamp(Timestamp int64) *SwapOrderPutApi

type SwapOrderPutReq

type SwapOrderPutReq struct {
	Symbol            *string          `json:"symbol"`                      //YES 交易对
	OrderId           *string          `json:"orderId,omitempty"`           //NO 系统订单号
	OrigClientOrderId *string          `json:"origClientOrderId,omitempty"` //NO 用户自定义的订单号
	Side              *string          `json:"side"`                        //YES 买卖方向 SELL, BUY
	Quantity          *decimal.Decimal `json:"quantity,omitempty"`          //NO 下单数量,使用closePosition不支持此参数。
	Price             *decimal.Decimal `json:"price,omitempty"`             //NO 委托价格
	RecvWindow        *int64           `json:"recvWindow,omitempty"`        //NO
	Timestamp         *int64           `json:"timestamp,omitempty"`         //YES
}

type SwapOrderPutRes

type SwapOrderPutRes SwapOrderPostRes

type SwapPingApi

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

func (*SwapPingApi) Do

func (api *SwapPingApi) Do() (*SwapPingRes, error)

type SwapPingReq

type SwapPingReq struct {
}

type SwapPingRes

type SwapPingRes struct {
}

type SwapPositionRiskApi

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

func (*SwapPositionRiskApi) Do

func (*SwapPositionRiskApi) MarginAsset

func (api *SwapPositionRiskApi) MarginAsset(MarginAsset string) *SwapPositionRiskApi

func (*SwapPositionRiskApi) Pair

func (*SwapPositionRiskApi) RecvWindow

func (api *SwapPositionRiskApi) RecvWindow(RecvWindow int64) *SwapPositionRiskApi

func (*SwapPositionRiskApi) Timestamp

func (api *SwapPositionRiskApi) Timestamp(Timestamp int64) *SwapPositionRiskApi

type SwapPositionRiskReq

type SwapPositionRiskReq struct {
	MarginAsset *string `json:"marginAsset"`
	Pair        *string `json:"pair"`
	RecvWindow  *int64  `json:"recvWindow"`
	Timestamp   *int64  `json:"timestamp"`
}

type SwapPositionRiskRes

type SwapPositionRiskRes []SwapPositionRiskResRow

type SwapPositionRiskResRow

type SwapPositionRiskResRow struct {
	Symbol           string `json:"symbol"`           // 交易对
	PositionAmt      string `json:"positionAmt"`      // 头寸数量, 符号代表多空方向, 正数为多, 负数为空
	EntryPrice       string `json:"entryPrice"`       // 开仓均价
	BreakEvenPrice   string `json:"breakEvenPrice"`   // 盈亏平衡价
	MarkPrice        string `json:"markPrice"`        // 当前标记价格
	UnRealizedProfit string `json:"unRealizedProfit"` // 持仓未实现盈亏
	LiquidationPrice string `json:"liquidationPrice"` // 参考强平价格
	Leverage         string `json:"leverage"`         // 当前杠杆倍数
	MaxQty           string `json:"maxQty"`           // 当前杠杆倍数允许的数量上限(标的数量)
	MarginType       string `json:"marginType"`       // 逐仓模式或全仓模式
	IsolatedMargin   string `json:"isolatedMargin"`   // 逐仓保证金
	IsAutoAddMargin  string `json:"isAutoAddMargin"`  // 是否自动追加保证金
	PositionSide     string `json:"positionSide"`     // 持仓方向
	NotionalValue    string `json:"notionalValue"`    // 名义价值
	UpdateTime       int64  `json:"updateTime"`       // 最新更新时间
}

type SwapPositionSideDualGetApi

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

func (*SwapPositionSideDualGetApi) Do

func (*SwapPositionSideDualGetApi) RecvWindow

func (api *SwapPositionSideDualGetApi) RecvWindow(RecvWindow int64) *SwapPositionSideDualGetApi

func (*SwapPositionSideDualGetApi) Timestamp

func (api *SwapPositionSideDualGetApi) Timestamp(Timestamp int64) *SwapPositionSideDualGetApi

type SwapPositionSideDualGetReq

type SwapPositionSideDualGetReq struct {
	RecvWindow *int64 `json:"recvWindow"`
	Timestamp  *int64 `json:"timestamp"`
}

type SwapPositionSideDualGetRes

type SwapPositionSideDualGetRes struct {
	DualSidePosition bool `json:"dualSidePosition"` // "true": 双向持仓模式;"false": 单向持仓模式
}

type SwapPositionSideDualPostApi

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

func (*SwapPositionSideDualPostApi) Do

func (*SwapPositionSideDualPostApi) DualSidePosition

func (api *SwapPositionSideDualPostApi) DualSidePosition(DualSidePosition string) *SwapPositionSideDualPostApi

func (*SwapPositionSideDualPostApi) RecvWindow

func (api *SwapPositionSideDualPostApi) RecvWindow(RecvWindow int64) *SwapPositionSideDualPostApi

func (*SwapPositionSideDualPostApi) Timestamp

type SwapPositionSideDualPostReq

type SwapPositionSideDualPostReq struct {
	DualSidePosition *string `json:"dualSidePosition"` //YES "true": 双向持仓模式;"false": 单向持仓模式
	RecvWindow       *int64  `json:"recvWindow"`
	Timestamp        *int64  `json:"timestamp"`
}

type SwapPositionSideDualPostRes

type SwapPositionSideDualPostRes SwapCommonPostRes

type SwapRestClient

type SwapRestClient RestClient

func (*SwapRestClient) NewAllOrders

func (client *SwapRestClient) NewAllOrders() *SwapAllOrdersApi

binance SWAP SwapAllOrders rest查询所有订单 (USER_DATA)

func (*SwapRestClient) NewExchangeInfo

func (client *SwapRestClient) NewExchangeInfo() *SwapExchangeInfoApi

binance SWAP SwapExchangeInfo rest交易规则和交易对信息

func (*SwapRestClient) NewOpenOrders

func (client *SwapRestClient) NewOpenOrders() *SwapOpenOrdersApi

币合约订单接口 binance SWAP SwapOpenOrders rest查询当前挂单 (USER_DATA)

func (*SwapRestClient) NewPing

func (client *SwapRestClient) NewPing() *SwapPingApi

通用接口 binance SWAP SwapPing rest测试连接

func (*SwapRestClient) NewServerTime

func (client *SwapRestClient) NewServerTime() *SwapServerTimeApi

binance SWAP SwapServerTime rest获取服务器时间

func (*SwapRestClient) NewSwapAccount

func (client *SwapRestClient) NewSwapAccount() *SwapAccountApi

币合约账户接口 binance SWAP SwapAccount rest账户信息 (USER_DATA)

func (*SwapRestClient) NewSwapBatchOrdersDelete

func (client *SwapRestClient) NewSwapBatchOrdersDelete() *SwapBatchOrdersDeleteApi

binance SWAP SwapBatchOrdersDelete rest批量撤销订单 (TRADE)

func (*SwapRestClient) NewSwapBatchOrdersPost

func (client *SwapRestClient) NewSwapBatchOrdersPost() *SwapBatchOrdersPostApi

binance SWAP SwapBatchOrdersPost rest批量下单 (TRADE)

func (*SwapRestClient) NewSwapBatchOrdersPut

func (client *SwapRestClient) NewSwapBatchOrdersPut() *SwapBatchOrdersPutApi

binance SWAP SwapBatchOrdersPut rest批量修改订单 (TRADE)

func (*SwapRestClient) NewSwapCommissionRate

func (client *SwapRestClient) NewSwapCommissionRate() *SwapCommissionRateApi

binance SWAP SwapCommissionRate rest查询用户当前的手续费率

func (*SwapRestClient) NewSwapDepth

func (client *SwapRestClient) NewSwapDepth() *SwapDepthApi

binance SWAP SwapDepth rest获取深度信息

func (*SwapRestClient) NewSwapKlines

func (client *SwapRestClient) NewSwapKlines() *SwapKlinesApi

行情接口 binance SWAP SwapKlines rest获取K线数据

func (*SwapRestClient) NewSwapLeverage

func (client *SwapRestClient) NewSwapLeverage() *SwapLeverageApi

binance SWAP SwapLeverage rest调整开仓杠杆 (TRADE)

func (*SwapRestClient) NewSwapLeverageBracket

func (client *SwapRestClient) NewSwapLeverageBracket() *SwapLeverageBracketApi

binance SWAP SwapLeverageBracket rest杠杆分层标准 (USER_DATA)

func (*SwapRestClient) NewSwapListenKeyDelete

func (client *SwapRestClient) NewSwapListenKeyDelete() *SwapListenKeyDeleteApi

binance SWAP SwapListenKeyDelete rest关闭listenKey (USER_STREAM)

func (*SwapRestClient) NewSwapListenKeyPost

func (client *SwapRestClient) NewSwapListenKeyPost() *SwapListenKeyPostApi

Ws账户推送相关 binance SWAP SwapListenKeyPost rest创建listenKey (USER_STREAM)

func (*SwapRestClient) NewSwapListenKeyPut

func (client *SwapRestClient) NewSwapListenKeyPut() *SwapListenKeyPutApi

binance SWAP SwapListenKeyPut rest延长listenKey有效期 (USER_STREAM)

func (*SwapRestClient) NewSwapMarginType

func (client *SwapRestClient) NewSwapMarginType() *SwapMarginTypeApi

binance SWAP SwapMarginType rest变换逐全仓模式 (TRADE)

func (*SwapRestClient) NewSwapOrderDelete

func (client *SwapRestClient) NewSwapOrderDelete() *SwapOrderDeleteApi

binance SWAP SwapOrderDelete rest撤销订单 (TRADE)

func (*SwapRestClient) NewSwapOrderGet

func (client *SwapRestClient) NewSwapOrderGet() *SwapOrderGetApi

binance SWAP SwapOrderGet rest查询订单 (USER_DATA)

func (*SwapRestClient) NewSwapOrderPost

func (client *SwapRestClient) NewSwapOrderPost() *SwapOrderPostApi

binance SWAP SwapOrderPost rest下单 (TRADE)

func (*SwapRestClient) NewSwapOrderPut

func (client *SwapRestClient) NewSwapOrderPut() *SwapOrderPutApi

binance SWAP SwapOrderPut rest修改订单 (TRADE)

func (*SwapRestClient) NewSwapPositionRisk

func (client *SwapRestClient) NewSwapPositionRisk() *SwapPositionRiskApi

binance SWAP SwapPositionRisk rest用户持仓风险V2 (USER_DATA)

func (*SwapRestClient) NewSwapPositionSideDualGet

func (client *SwapRestClient) NewSwapPositionSideDualGet() *SwapPositionSideDualGetApi

binance SWAP SwapPositionSideDualGet rest查询持仓模式 (USER_DATA)

func (*SwapRestClient) NewSwapPositionSideDualPost

func (client *SwapRestClient) NewSwapPositionSideDualPost() *SwapPositionSideDualPostApi

binance SWAP SwapPositionSideDualPost rest更改持仓模式 (TRADE)

func (*SwapRestClient) NewSwapTickerPrice

func (client *SwapRestClient) NewSwapTickerPrice() *SwapTickerPriceApi

binance SWAP SwapTickerPrice rest获取交易对最新价格

func (*SwapRestClient) NewSwapUserTrades

func (client *SwapRestClient) NewSwapUserTrades() *SwapUserTradesApi

binance SWAP SwapUserTrades rest查询账户成交记录 (USER_DATA)

type SwapServerTimeApi

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

func (*SwapServerTimeApi) Do

type SwapServerTimeReq

type SwapServerTimeReq struct {
}

type SwapServerTimeRes

type SwapServerTimeRes struct {
	ServerTime int64 `json:"serverTime"`
}

type SwapTickerPriceApi

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

func (*SwapTickerPriceApi) Do

func (*SwapTickerPriceApi) Pair

func (api *SwapTickerPriceApi) Pair(Pair string) *SwapTickerPriceApi

func (*SwapTickerPriceApi) Symbol

func (api *SwapTickerPriceApi) Symbol(Symbol string) *SwapTickerPriceApi

type SwapTickerPriceReq

type SwapTickerPriceReq struct {
	Symbol *string `json:"symbol"` //NO	交易对
	Pair   *string `json:"pair"`   //NO	标的交易对
}

type SwapTickerPriceRes

type SwapTickerPriceRes []SwapTickerPriceResRow

type SwapTickerPriceResRow

type SwapTickerPriceResRow struct {
	Symbol string `json:"symbol"` // 交易对
	Ps     string `json:"ps"`     // 标的交易对
	Price  string `json:"price"`  // 价格
	Time   int64  `json:"time"`   // 时间
}

type SwapUserTrade

type SwapUserTrade struct {
	Symbol          string `json:"symbol"`          // 交易对
	Id              int64  `json:"id"`              // 交易ID
	OrderId         int64  `json:"orderId"`         // 订单ID
	Pair            string `json:"pair"`            // 标的交易对
	Side            string `json:"side"`            // 买卖方向
	Price           string `json:"price"`           // 成交价
	Qty             string `json:"qty"`             // 成交量(张数)
	RealizedPnl     string `json:"realizedPnl"`     // 实现盈亏
	MarginAsset     string `json:"marginAsset"`     // 保证金币种
	BaseQty         string `json:"baseQty"`         // 成交额(标的数量)
	Commission      string `json:"commission"`      // 手续费
	CommissionAsset string `json:"commissionAsset"` // 手续费单位
	Time            int64  `json:"time"`            // 时间
	PositionSide    string `json:"positionSide"`    // 持仓方向
	Buyer           bool   `json:"buyer"`           // 是否是买方
	Maker           bool   `json:"maker"`           // 是否是挂单方
}

type SwapUserTradesApi

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

func (*SwapUserTradesApi) Do

func (*SwapUserTradesApi) EndTime

func (api *SwapUserTradesApi) EndTime(EndTime int64) *SwapUserTradesApi

func (*SwapUserTradesApi) FromId

func (api *SwapUserTradesApi) FromId(FromId int64) *SwapUserTradesApi

func (*SwapUserTradesApi) Limit

func (api *SwapUserTradesApi) Limit(Limit int64) *SwapUserTradesApi

func (*SwapUserTradesApi) OrderId

func (api *SwapUserTradesApi) OrderId(OrderId int64) *SwapUserTradesApi

func (*SwapUserTradesApi) Pair

func (api *SwapUserTradesApi) Pair(Pair string) *SwapUserTradesApi

func (*SwapUserTradesApi) RecvWindow

func (api *SwapUserTradesApi) RecvWindow(RecvWindow int64) *SwapUserTradesApi

func (*SwapUserTradesApi) StartTime

func (api *SwapUserTradesApi) StartTime(StartTime int64) *SwapUserTradesApi

func (*SwapUserTradesApi) Symbol

func (api *SwapUserTradesApi) Symbol(Symbol string) *SwapUserTradesApi

func (*SwapUserTradesApi) Timestamp

func (api *SwapUserTradesApi) Timestamp(Timestamp int64) *SwapUserTradesApi

type SwapUserTradesReq

type SwapUserTradesReq struct {
	Symbol     *string `json:"symbol"`     //NO	交易对
	Pair       *string `json:"pair"`       //NO	标的交易对
	OrderId    *int64  `json:"orderId"`    //NO	订单号
	StartTime  *int64  `json:"startTime"`  //NO	起始时间
	EndTime    *int64  `json:"endTime"`    //NO	结束时间
	FromId     *int64  `json:"fromId"`     //NO	返回该fromId及之后的成交,缺省返回最近的成交,仅支持配合symbol使用
	Limit      *int64  `json:"limit"`      //NO	返回的结果集数量 默认值:50 最大值:1000
	RecvWindow *int64  `json:"recvWindow"` //NO
	Timestamp  *int64  `json:"timestamp"`  //YES
}

type SwapUserTradesRes

type SwapUserTradesRes []SwapUserTrade

type SwapWsStreamClient

type SwapWsStreamClient struct {
	WsStreamClient
	// contains filtered or unexported fields
}

func (*SwapWsStreamClient) Close

func (ws *SwapWsStreamClient) Close() error

func (*SwapWsStreamClient) ConvertToAccountWs

func (ws *SwapWsStreamClient) ConvertToAccountWs(apiKey string, apiSecret string) (*SwapWsStreamClient, error)

func (*SwapWsStreamClient) CreatePayload

func (ws *SwapWsStreamClient) CreatePayload() (*WsSwapPayload, error)

type TranRes

type TranRes struct {
	TranId int64 `json:"tranId"` //transaction id
}

type WsAggTrade

type WsAggTrade struct {
	Timestamp   int64   `json:"timestamp"`                //事件时间
	Symbol      string  `json:"symbol"`                   //交易对
	AccountType string  `json:"account_type"`             //账户类型 SPOT 现货 FUTURE U合约 SWAP 币本位合约
	AId         int64   `gorm:"primaryKey " json:"a_id" ` // 归集交易ID
	Price       float64 `json:"price"`                    //成交价
	Quantity    float64 `json:"quantity"`                 //成交量
	First       int64   `json:"first"`                    //被归集的首个交易ID
	Last        int64   `json:"last"`                     //被归集的末次交易ID
	TradeTime   int64   `json:"trade_time"`               //成交时间
	IsMarket    bool    `json:"is_market"`                //买方是否做市
}

func HandleWsAggTrade

func HandleWsAggTrade(apiType ApiType, data []byte) (*WsAggTrade, error)

func HandleWsAggTradeMap

func HandleWsAggTradeMap(apiType ApiType, m map[string]interface{}) *WsAggTrade

func HandleWsCombinedAggTrade

func HandleWsCombinedAggTrade(apiType ApiType, data []byte) (*WsAggTrade, error)

type WsApiReq

type WsApiReq[T any] struct {
	Id     string `json:"id"`     //YES	任意的 ID 用于匹配对请求的响应
	Method string `json:"method"` //YES	请求函数名称
	Params T      `json:"params"` //YES	请求参数
}

type WsApiReqExtend

type WsApiReqExtend struct {
	ApiKey    string `json:"apiKey"`
	Signature string `json:"signature"`
}

type WsApiResult

type WsApiResult[T any] struct {
	Id         string          `json:"id"`     // YES	与原来请求的ID一样
	Status     int             `json:"status"` // YES	响应状态。请看 状态代码
	Result     T               `json:"result"` // YES	响应内容。请求成功则显示
	Error      BinanceErrorRes `json:"error"`  // 请求失败则显示
	RateLimits []RateLimit     `json:"rateLimits"`
}

type WsApiResultChan

type WsApiResultChan interface {
	ResultChan() chan []byte
	ErrChan() chan error
	CloseChan() chan struct{}
}

type WsApiResultChanImpl

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

func (*WsApiResultChanImpl) CloseChan

func (w *WsApiResultChanImpl) CloseChan() chan struct{}

func (*WsApiResultChanImpl) ErrChan

func (w *WsApiResultChanImpl) ErrChan() chan error

func (*WsApiResultChanImpl) ResultChan

func (w *WsApiResultChanImpl) ResultChan() chan []byte

type WsDepth

type WsDepth struct {
	Timestamp    int64        `json:"timestamp"`
	Level        string       `json:"level"`
	USpeed       string       `json:"u_speed"`
	AccountType  string       `json:"account_type"`
	Symbol       string       `json:"symbol"`
	UpperU       int64        `json:"upper_u"`
	LowerU       int64        `json:"lower_u"`
	PreU         int64        `json:"pre_u"`
	LastUpdateID int64        `json:"last_update_id"`
	Bids         []PriceLevel `json:"bids"`
	Asks         []PriceLevel `json:"asks"`
}

func HandleDepth

func HandleDepth(apiType ApiType, symbol string, data []byte, isLeveDepth bool) (*WsDepth, error)

func HandleWsCombinedDepth

func HandleWsCombinedDepth(apiType ApiType, data []byte) (*WsDepth, error)

type WsFutureAction

type WsFutureAction struct {
	Reason   string             `json:"m"` //事件推出原因
	Balance  []WsFutureBalance  `json:"B"` //余额信息
	Position []WsFuturePosition `json:"P"` //持仓信息
}

type WsFutureBalance

type WsFutureBalance struct {
	Asset              string `json:"a"`  //资产名称
	WalletBalance      string `json:"wb"` //钱包余额
	CrossWalletBalance string `json:"cw"` //除去逐仓仓位保证金的钱包余额
	BalanceChange      string `json:"bc"` //除去盈亏与交易手续费以外的钱包余额改变量
}

type WsFutureOrder

type WsFutureOrder struct {
	Symbol         string `json:"s"`   //交易对
	ClientOrderId  string `json:"c"`   //clientOrderId
	Side           string `json:"S"`   //订单方向
	Type           string `json:"o"`   //订单类型
	TimeInForce    string `json:"f"`   //有效方式
	OrigQty        string `json:"q"`   //订单原始数量
	Price          string `json:"p"`   //订单原始价格
	AvgPrice       string `json:"ap"`  //订单平均价格
	StopPrice      string `json:"sp"`  //止盈止损单触发价格
	ExecutionType  string `json:"x"`   //本次事件的具体执行类型
	Status         string `json:"X"`   //订单的当前状态
	OrderId        int64  `json:"i"`   //orderId
	LastQty        string `json:"l"`   //订单末次成交量
	ExecutedQty    string `json:"z"`   //订单累计已成交量
	LastPrice      string `json:"L"`   //订单末次成交价格
	FeeAsset       string `json:"N"`   //手续费资产类别
	FeeQty         string `json:"n"`   //手续费数量
	TradeTime      int64  `json:"T"`   //成交时间
	TradeId        int64  `json:"t"`   //成交ID
	BuyNetValue    string `json:"b"`   //买单净值
	SellNetValue   string `json:"a"`   //卖单净值
	IsMaker        bool   `json:"m"`   //该成交是作为挂单成交吗?
	IsReduceOnly   bool   `json:"R"`   //是否是只减仓单
	TriggerType    string `json:"wt"`  //触发价类型
	OrigType       string `json:"ot"`  //原始订单类型
	PositionSide   string `json:"ps"`  //持仓方向
	IsClose        bool   `json:"cp"`  //是否为触发平仓单; 仅在条件订单情况下会推送此字段
	ActivePrice    string `json:"AP"`  //追踪止损激活价格, 仅在追踪止损单时会推送此字段
	CallbackRate   string `json:"cr"`  //追踪止损回调比例, 仅在追踪止损单时会推送此字段
	PriceProtect   bool   `json:"pP"`  //是否开启条件单触发保护
	RealizedProfit string `json:"rp"`  //该交易实现盈亏
	PreventMode    string `json:"V"`   //自成交防止模式
	PriceMatch     string `json:"pm"`  //价格匹配模式
	GoodTillDate   int64  `json:"gtd"` //TIF为GTD的订单自动取消时间
}

type WsFuturePayload

type WsFuturePayload struct {
	Ws                      *FutureWsStreamClient
	Id                      int64
	AccountUpdatePayload    *Payload[WsFuturePayloadAccountUpdate]
	OrderTradeUpdatePayload *Payload[WsFuturePayloadOrderTradeUpdate]
}

func (*WsFuturePayload) Close

func (payload *WsFuturePayload) Close()

type WsFuturePayloadAccountUpdate

type WsFuturePayloadAccountUpdate struct {
	Event     string         `json:"e"` //事件类型
	Timestamp int64          `json:"E"` //事件时间
	TradeTime int64          `json:"T"` //撮合时间
	Action    WsFutureAction `json:"a"` // 账户更新事件
}

U本位合约余额和仓位推送

type WsFuturePayloadOrderTradeUpdate

type WsFuturePayloadOrderTradeUpdate struct {
	Event     string        `json:"e"` //事件类型
	Timestamp int64         `json:"E"` //事件时间
	TradeTime int64         `json:"T"` //撮合时间
	Order     WsFutureOrder `json:"o"` //订单信息
}

U本位合约订单/交易 更新推送

type WsFuturePosition

type WsFuturePosition struct {
	Symbol             string `json:"s"`   //交易对
	PositionAmount     string `json:"pa"`  //仓位
	EntryPrice         string `json:"ep"`  //入仓价格
	BreakEvenPrice     string `json:"bep"` //盈亏平衡价
	CumulativeRealized string `json:"cr"`  //(费前)累计实现损益
	UnrealizedProfit   string `json:"up"`  //持仓未实现盈亏
	MarginType         string `json:"mt"`  //保证金模式
	InitialMargin      string `json:"iw"`  //若为逐仓,仓位保证金
	PositionSide       string `json:"ps"`  //持仓方向
}

type WsKline

type WsKline struct {
	Timestamp            int64   `json:"timestamp"`
	AccountType          string  `json:"account_type"`                 //K线类型 现货:spot 币合约:swap u合约:future
	Symbol               string  `json:"symbol"`                       //交易对
	Interval             string  `json:"interval"`                     //K线间隔
	StartTime            int64   `json:"start_time" gorm:"primaryKey"` //开盘时间
	Open                 float64 `json:"open"`                         //开盘价
	High                 float64 `json:"high"`                         //最高价
	Low                  float64 `json:"low"`                          //最低价
	Close                float64 `json:"close"`                        //收盘价
	Volume               float64 `json:"volume"`                       //成交量
	CloseTime            int64   `json:"close_time"`                   //收盘时间
	TransactionVolume    float64 `json:"transaction_volume"`           //成交额
	TransactionNumber    int64   `json:"transaction_number"`           //成交笔数
	BuyTransactionVolume float64 `json:"buy_transaction_volume"`       //主动买入成交量
	BuyTransactionAmount float64 `json:"buy_transaction_amount"`       //主动买入成交额
	Confirm              bool    `json:"confirm"`                      //这根K线是否完结
}

func HandleWsCombinedKline

func HandleWsCombinedKline(apiType ApiType, data []byte) (*WsKline, error)

func HandleWsKline

func HandleWsKline(apiType ApiType, data []byte) (*WsKline, error)

func HandleWsKlineMap

func HandleWsKlineMap(apiType ApiType, m map[string]interface{}) *WsKline

type WsPmCAction added in v1.0.1

type WsPmCAction struct {
	Reason   string          `json:"m"` //事件推出原因
	Balance  []WsPmCBalance  `json:"B"` //余额信息
	Position []WsPmCPosition `json:"P"` //持仓信息
}

type WsPmCBalance added in v1.0.1

type WsPmCBalance struct {
	Asset              string `json:"a"`  //资产名称
	WalletBalance      string `json:"wb"` //钱包余额
	CrossWalletBalance string `json:"cw"` //除去逐仓仓位保证金的钱包余额
	BalanceChange      string `json:"bc"` //除去盈亏与交易手续费以外的钱包余额改变量
}

type WsPmCOrder added in v1.0.1

type WsPmCOrder struct {
	Symbol         string `json:"s"`   //交易对
	ClientOrderId  string `json:"c"`   //clientOrderId
	Side           string `json:"S"`   //订单方向
	Type           string `json:"o"`   //订单类型
	TimeInForce    string `json:"f"`   //有效方式
	OrigQty        string `json:"q"`   //订单原始数量
	Price          string `json:"p"`   //订单原始价格
	AvgPrice       string `json:"ap"`  //订单平均价格
	StopPrice      string `json:"sp"`  //止盈止损单触发价格
	ExecutionType  string `json:"x"`   //本次事件的具体执行类型
	Status         string `json:"X"`   //订单的当前状态
	OrderId        int64  `json:"i"`   //orderId
	LastQty        string `json:"l"`   //订单末次成交量
	ExecutedQty    string `json:"z"`   //订单累计已成交量
	LastPrice      string `json:"L"`   //订单末次成交价格
	FeeAsset       string `json:"N"`   //手续费资产类别
	FeeQty         string `json:"n"`   //手续费数量
	TradeTime      int64  `json:"T"`   //成交时间
	TradeId        int64  `json:"t"`   //成交ID
	BuyNetValue    string `json:"b"`   //买单净值
	SellNetValue   string `json:"a"`   //卖单净值
	IsMaker        bool   `json:"m"`   //该成交是作为挂单成交吗?
	IsReduceOnly   bool   `json:"R"`   //是否是只减仓单
	PositionSide   string `json:"ps"`  //持仓方向
	RealizedProfit string `json:"rp"`  //该交易实现盈亏
	StrategyType   string `json:"st"`  //策略类型
	StrategyId     int64  `json:"si"`  //策略ID
	PreventMode    string `json:"V"`   //自成交防止模式
	GoodTillDate   int64  `json:"gtd"` //TIF为GTD的订单自动取消时间
}

type WsPmCPayload added in v1.0.1

type WsPmCPayload struct {
	Ws                      *PmCWsStreamClient
	Id                      int64
	AccountUpdatePayload    *Payload[WsPmCPayloadAccountUpdate]
	OrderTradeUpdatePayload *Payload[WsPmCPayloadOrderTradeUpdate]
}

func (*WsPmCPayload) Close added in v1.0.1

func (payload *WsPmCPayload) Close()

type WsPmCPayloadAccountUpdate added in v1.0.1

type WsPmCPayloadAccountUpdate struct {
	Event      string      `json:"e"`  //事件类型
	FutureType string      `json:"fs"` //合约类型 'UM' for USDS-M futures and 'CM' for COIN-M futures
	Timestamp  int64       `json:"E"`  //事件时间
	TradeTime  int64       `json:"T"`  //撮合时间
	AccountId  string      `json:"i"`  //账户唯一识别码 accountAlias
	Action     WsPmCAction `json:"a"`  // 账户更新事件
}

统一账户币本位合约余额和仓位推送 //zsk修改

type WsPmCPayloadOrderTradeUpdate added in v1.0.1

type WsPmCPayloadOrderTradeUpdate struct {
	Event      string     `json:"e"`  //事件类型
	Timestamp  int64      `json:"E"`  //事件时间
	TradeTime  int64      `json:"T"`  //撮合时间
	FutureType string     `json:"fs"` //合约类型 'UM' for USDS-M futures and 'CM' for COIN-M futures
	Order      WsPmCOrder `json:"o"`  //订单信息
}

统一账户币本位合约订单/交易 更新推送 //zsk修改

type WsPmCPosition added in v1.0.1

type WsPmCPosition struct {
	Symbol             string `json:"s"`   //交易对
	PositionAmount     string `json:"pa"`  //仓位
	EntryPrice         string `json:"ep"`  //入仓价格
	CumulativeRealized string `json:"cr"`  //(费前)累计实现损益
	UnrealizedProfit   string `json:"up"`  //持仓未实现盈亏
	PositionSide       string `json:"ps"`  //持仓方向
	BreakEvenPrice     string `json:"bep"` //盈亏平衡价
}

type WsPmMBalance added in v1.0.1

type WsPmMBalance struct {
	Asset  string `json:"a"` //资产名称
	Free   string `json:"f"` //可用余额
	Locked string `json:"l"` //冻结余额
}

type WsPmMPayload added in v1.0.1

type WsPmMPayload struct {
	Ws                             *PmMWsStreamClient
	Id                             int64
	OutboundAccountPositionPayload *Payload[WsPmMPayloadOutboundAccountPosition]
	BalanceUpdatePayload           *Payload[WsPmMPayloadBalanceUpdate]
	ExecutionReportPayload         *Payload[WsPmMPayloadExecutionReport]
}

func (*WsPmMPayload) Close added in v1.0.1

func (payload *WsPmMPayload) Close()

type WsPmMPayloadBalanceUpdate added in v1.0.1

type WsPmMPayloadBalanceUpdate struct {
	Event     string `json:"e"` //事件类型
	Timestamp int64  `json:"E"` //事件时间
	Asset     string `json:"a"` //资产名称
	Delta     string `json:"d"` //余额变化
	UpdateId  int64  `json:"U"` //时间更新ID
	ClearTime int64  `json:"T"` //清算时间
}

现货余额更新推送

type WsPmMPayloadExecutionReport added in v1.0.1

type WsPmMPayloadExecutionReport struct {
	//标准字段
	Event               string `json:"e"` //事件类型
	Timestamp           int64  `json:"E"` //事件时间
	Symbol              string `json:"s"` //交易对
	ClientOrderId       string `json:"c"` //clientOrderId
	Side                string `json:"S"` //订单方向
	Type                string `json:"o"` //订单类型
	TimeInForce         string `json:"f"` //有效方式
	OrigQty             string `json:"q"` //订单原始数量
	Price               string `json:"p"` //订单原始价格
	StopPrice           string `json:"P"` //止盈止损单触发价格
	IcebergQty          string `json:"F"` //冰山订单数量
	OrderListId         int64  `json:"g"` //OCO订单 OrderListId
	OrigClientOrderId   string `json:"C"` //原始订单自定义ID(原始订单,指撤单操作的对象。撤单本身被视为另一个订单)
	ExecutionType       string `json:"x"` //本次事件的具体执行类型
	Status              string `json:"X"` //订单的当前状态
	RejectReason        string `json:"r"` //订单被拒绝的原因
	OrderId             int64  `json:"i"` //orderId
	LastQty             string `json:"l"` //订单末次成交量
	ExecutedQty         string `json:"z"` //订单累计已成交量
	LastPrice           string `json:"L"` //订单末次成交价格
	FeeQty              string `json:"n"` //手续费数量
	FeeAsset            string `json:"N"` //手续费资产类别
	TradeTime           int64  `json:"T"` //成交时间
	TradeId             int64  `json:"t"` //成交ID
	PreventMatchId      int64  `json:"v"` //被阻止撮合交易的ID; 这仅在订单因 STP 触发而过期时可见
	I                   int64  `json:"I"` //请忽略
	IsWorking           bool   `json:"w"` //订单是否在订单簿上?
	IsMaker             bool   `json:"m"` //该成交是作为挂单成交吗?
	M                   bool   `json:"M"` //请忽略
	OrderCreateTime     int64  `json:"O"` //订单创建时间
	CummulativeQuoteQty string `json:"Z"` //订单累计已成交金额
	LastQuoteQty        string `json:"Y"` //订单末次成交金额
	QuoteOrderQty       string `json:"Q"` //Quote Order Quantity
	WorkingTime         int64  `json:"W"` //订单被添加到 order book 的时间; 只有在订单在订单簿上时可见
	SelfTradePrevention string `json:"V"` //SelfTradePreventionMode
}

现货订单推送

type WsPmMPayloadOutboundAccountPosition added in v1.0.1

type WsPmMPayloadOutboundAccountPosition struct {
	Event          string         `json:"e"` //事件类型
	Timestamp      int64          `json:"E"` //事件时间
	LastUpdateTime int64          `json:"u"` //账户末次更新时间戳
	UpdateId       int64          `json:"U"` //时间更新ID
	Balances       []WsPmMBalance `json:"B"` //余额
}

统一账户杠杆账户更新推送 //zsk修改

type WsPmUAction added in v1.0.1

type WsPmUAction struct {
	Reason   string          `json:"m"` //事件推出原因
	Balance  []WsPmUBalance  `json:"B"` //余额信息
	Position []WsPmUPosition `json:"P"` //持仓信息
}

type WsPmUBalance added in v1.0.1

type WsPmUBalance struct {
	Asset              string `json:"a"`  //资产名称
	WalletBalance      string `json:"wb"` //钱包余额
	CrossWalletBalance string `json:"cw"` //除去逐仓仓位保证金的钱包余额
	BalanceChange      string `json:"bc"` //除去盈亏与交易手续费以外的钱包余额改变量
}

type WsPmUOrder added in v1.0.1

type WsPmUOrder struct {
	Symbol         string `json:"s"`   //交易对
	ClientOrderId  string `json:"c"`   //clientOrderId
	Side           string `json:"S"`   //订单方向
	Type           string `json:"o"`   //订单类型
	TimeInForce    string `json:"f"`   //有效方式
	OrigQty        string `json:"q"`   //订单原始数量
	Price          string `json:"p"`   //订单原始价格
	AvgPrice       string `json:"ap"`  //订单平均价格
	StopPrice      string `json:"sp"`  //止盈止损单触发价格
	ExecutionType  string `json:"x"`   //本次事件的具体执行类型
	Status         string `json:"X"`   //订单的当前状态
	OrderId        int64  `json:"i"`   //orderId
	LastQty        string `json:"l"`   //订单末次成交量
	ExecutedQty    string `json:"z"`   //订单累计已成交量
	LastPrice      string `json:"L"`   //订单末次成交价格
	FeeAsset       string `json:"N"`   //手续费资产类别
	FeeQty         string `json:"n"`   //手续费数量
	TradeTime      int64  `json:"T"`   //成交时间
	TradeId        int64  `json:"t"`   //成交ID
	BuyNetValue    string `json:"b"`   //买单净值
	SellNetValue   string `json:"a"`   //卖单净值
	IsMaker        bool   `json:"m"`   //该成交是作为挂单成交吗?
	IsReduceOnly   bool   `json:"R"`   //是否是只减仓单
	PositionSide   string `json:"ps"`  //持仓方向
	RealizedProfit string `json:"rp"`  //该交易实现盈亏
	StrategyType   string `json:"st"`  //策略类型
	StrategyId     int64  `json:"si"`  //策略ID
	PreventMode    string `json:"V"`   //自成交防止模式
	GoodTillDate   int64  `json:"gtd"` //TIF为GTD的订单自动取消时间
}

type WsPmUPayload added in v1.0.1

type WsPmUPayload struct {
	Ws                      *PmUWsStreamClient
	Id                      int64
	AccountUpdatePayload    *Payload[WsPmUPayloadAccountUpdate]
	OrderTradeUpdatePayload *Payload[WsPmUPayloadOrderTradeUpdate]
}

zsk修改

func (*WsPmUPayload) Close added in v1.0.1

func (payload *WsPmUPayload) Close()

zsk修改

type WsPmUPayloadAccountUpdate added in v1.0.1

type WsPmUPayloadAccountUpdate struct {
	Event      string      `json:"e"`  //事件类型
	FutureType string      `json:"fs"` //合约类型 'UM' for USDS-M futures and 'CM' for COIN-M futures
	Timestamp  int64       `json:"E"`  //事件时间
	TradeTime  int64       `json:"T"`  //撮合时间
	AccountId  string      `json:"i"`  //账户唯一识别码 accountAlias
	Action     WsPmUAction `json:"a"`  // 账户更新事件
}

统一账户U本位合约余额和仓位推送 //zsk修改

type WsPmUPayloadOrderTradeUpdate added in v1.0.1

type WsPmUPayloadOrderTradeUpdate struct {
	Event      string     `json:"e"`  //事件类型
	Timestamp  int64      `json:"E"`  //事件时间
	TradeTime  int64      `json:"T"`  //撮合时间
	FutureType string     `json:"fs"` //合约类型 'UM' for USDS-M futures and 'CM' for COIN-M futures
	Order      WsPmUOrder `json:"o"`  //订单信息
}

统一账户U本位合约订单/交易 更新推送 //zsk修改

type WsPmUPosition added in v1.0.1

type WsPmUPosition struct {
	Symbol             string `json:"s"`   //交易对
	PositionAmount     string `json:"pa"`  //仓位
	EntryPrice         string `json:"ep"`  //入仓价格
	CumulativeRealized string `json:"cr"`  //(费前)累计实现损益
	UnrealizedProfit   string `json:"up"`  //持仓未实现盈亏
	PositionSide       string `json:"ps"`  //持仓方向
	BreakEvenPrice     string `json:"bep"` //盈亏平衡价
}

type WsSpotBalance

type WsSpotBalance struct {
	Asset  string `json:"a"` //资产名称
	Free   string `json:"f"` //可用余额
	Locked string `json:"l"` //冻结余额
}

type WsSpotPayload

type WsSpotPayload struct {
	Ws                             *SpotWsStreamClient
	Id                             int64
	OutboundAccountPositionPayload *Payload[WsSpotPayloadOutboundAccountPosition]
	BalanceUpdatePayload           *Payload[WsSpotPayloadBalanceUpdate]
	ExecutionReportPayload         *Payload[WsSpotPayloadExecutionReport]
}

func (*WsSpotPayload) Close

func (payload *WsSpotPayload) Close()

type WsSpotPayloadBalanceUpdate

type WsSpotPayloadBalanceUpdate struct {
	Event     string `json:"e"` //事件类型
	Timestamp int64  `json:"E"` //事件时间
	Asset     string `json:"a"` //资产名称
	Delta     string `json:"d"` //余额变化
	ClearTime int64  `json:"T"` //清算时间
}

现货余额更新推送

type WsSpotPayloadExecutionReport

type WsSpotPayloadExecutionReport struct {
	//标准字段
	Event               string `json:"e"` //事件类型
	Timestamp           int64  `json:"E"` //事件时间
	Symbol              string `json:"s"` //交易对
	ClientOrderId       string `json:"c"` //clientOrderId
	Side                string `json:"S"` //订单方向
	Type                string `json:"o"` //订单类型
	TimeInForce         string `json:"f"` //有效方式
	OrigQty             string `json:"q"` //订单原始数量
	Price               string `json:"p"` //订单原始价格
	StopPrice           string `json:"P"` //止盈止损单触发价格
	IcebergQty          string `json:"F"` //冰山订单数量
	OrderListId         int64  `json:"g"` //OCO订单 OrderListId
	OrigClientOrderId   string `json:"C"` //原始订单自定义ID(原始订单,指撤单操作的对象。撤单本身被视为另一个订单)
	ExecutionType       string `json:"x"` //本次事件的具体执行类型
	Status              string `json:"X"` //订单的当前状态
	RejectReason        string `json:"r"` //订单被拒绝的原因
	OrderId             int64  `json:"i"` //orderId
	LastQty             string `json:"l"` //订单末次成交量
	ExecutedQty         string `json:"z"` //订单累计已成交量
	LastPrice           string `json:"L"` //订单末次成交价格
	FeeQty              string `json:"n"` //手续费数量
	FeeAsset            string `json:"N"` //手续费资产类别
	TradeTime           int64  `json:"T"` //成交时间
	TradeId             int64  `json:"t"` //成交ID
	IsWorking           bool   `json:"w"` //订单是否在订单簿上?
	IsMaker             bool   `json:"m"` //该成交是作为挂单成交吗?
	OrderCreateTime     int64  `json:"O"` //订单创建时间
	CummulativeQuoteQty string `json:"Z"` //订单累计已成交金额
	LastQuoteQty        string `json:"Y"` //订单末次成交金额
	QuoteOrderQty       string `json:"Q"` //Quote Order Quantity
	SelfTradePrevention string `json:"V"` //SelfTradePreventionMode

	//特殊字段
	TrailingDelta              int64  `json:"d"`  //只出现在追踪止损订单中。
	TrailingTime               int64  `json:"D"`  //Trailing Time
	StrategyId                 int64  `json:"j"`  //如果在请求中添加了strategyId参数,则会出现。
	StrategyType               int64  `json:"J"`  //如果在请求中添加了strategyType参数,则会出现。
	PreventMatchId             int64  `json:"v"`  //被阻止撮合交易的ID; 这仅在订单因 STP 触发而过期时可见
	PreventedQuantity          string `json:"A"`  //只有在因为 STP 导致订单失效时可见。
	LastPreventedQuantity      string `json:"B"`  //Last Prevented Quantity
	TradeGroupId               int64  `json:"u"`  //Trade Group Id
	CounterOrderId             int64  `json:"U"`  //Counter Order Id
	CounterSymbol              string `json:"Cs"` //Counter Symbol
	PreventedExecutionQuantity string `json:"pl"` //Prevented Execution Quantity
	PreventedExecutionPrice    string `json:"pL"` //Prevented Execution Price
	PreventedExecutionQuoteQty string `json:"pY"` //Prevented Execution Quote Qty
	WorkingTime                int64  `json:"W"`  //Working Time; 订单被添加到 order book 的时间; 只有在订单在订单簿上时可见
	MatchType                  string `json:"b"`  //Match Type
	AllocationId               int64  `json:"a"`  //Allocation ID
	WorkingFloor               string `json:"k"`  //Working Floor; 只有在订单可能有分配时可见
	UsedSor                    bool   `json:"uS"` //UsedSor; 只有在订单使用 SOR 时可见
}

现货订单推送

type WsSpotPayloadOutboundAccountPosition

type WsSpotPayloadOutboundAccountPosition struct {
	Event          string          `json:"e"` //事件类型
	Timestamp      int64           `json:"E"` //事件时间
	LastUpdateTime int64           `json:"u"` //账户末次更新时间戳
	Balances       []WsSpotBalance `json:"B"` //余额
}

现货账户更新推送

type WsStreamClient

type WsStreamClient struct {
	AutoReConnectTimes int //自动重连次数
	// contains filtered or unexported fields
}

数据流订阅基础客户端

func (*WsStreamClient) Close

func (ws *WsStreamClient) Close() error

func (*WsStreamClient) CurrentSubscribeList

func (ws *WsStreamClient) CurrentSubscribeList() ([]string, error)

获取当前所有订阅

func (*WsStreamClient) GetConn

func (ws *WsStreamClient) GetConn() *websocket.Conn

func (*WsStreamClient) OpenConn

func (ws *WsStreamClient) OpenConn() error

func (*WsStreamClient) SubscribeAggTrade

func (ws *WsStreamClient) SubscribeAggTrade(symbol string) (*Subscription[WsAggTrade], error)

订阅归集交易流 如: "BTCUSDT"

func (*WsStreamClient) SubscribeAggTradeMultiple

func (ws *WsStreamClient) SubscribeAggTradeMultiple(symbols []string) (*Subscription[WsAggTrade], error)

批量订阅归集交易流 如: []string{"BTCUSDT","ETHUSDT"}

func (*WsStreamClient) SubscribeIncrementDepth

func (ws *WsStreamClient) SubscribeIncrementDepth(symbol string, USpeed string) (*Subscription[WsDepth], error)

订阅增量深度 如: "BTCUSDT","100ms"

func (*WsStreamClient) SubscribeIncrementDepthMultiple

func (ws *WsStreamClient) SubscribeIncrementDepthMultiple(symbols []string, USpeed string) (*Subscription[WsDepth], error)

批量订阅增量深度 如: []string{"BTCUSDT","ETHUSDT"},"100ms"

func (*WsStreamClient) SubscribeKline

func (ws *WsStreamClient) SubscribeKline(symbol string, interval string) (*Subscription[WsKline], error)

订阅K线 如: "BTCUSDT","1m"

func (*WsStreamClient) SubscribeKlineMultiple

func (ws *WsStreamClient) SubscribeKlineMultiple(symbols []string, intervals []string) (*Subscription[WsKline], error)

批量订阅K线 如: []string{"BTCUSDT","ETHUSDT"},[]string{"1m","5m"}

func (*WsStreamClient) SubscribeLevelDepth

func (ws *WsStreamClient) SubscribeLevelDepth(symbol string, level string, USpeed string) (*Subscription[WsDepth], error)

订阅有限档深度 如: "BTCUSDT","20","100ms"

func (*WsStreamClient) SubscribeLevelDepthMultiple

func (ws *WsStreamClient) SubscribeLevelDepthMultiple(symbols []string, level string, USpeed string) (*Subscription[WsDepth], error)

批量订阅有限档深度 如: []string{"BTCUSDT","ETHUSDT"},"20","100ms"

type WsStreamPath

type WsStreamPath int
const (
	WS_STREAM_PATH WsStreamPath = iota
	WS_ACCOUNT_PATH
	WS_SPOT_API_PATH
	WS_FUTURE_API_PATH
)

type WsSwapAction

type WsSwapAction struct {
	Reason   string           `json:"m"` //事件推出原因
	Balance  []WsSwapBalance  `json:"B"` //余额信息
	Position []WsSwapPosition `json:"P"` //持仓信息
}

type WsSwapBalance

type WsSwapBalance struct {
	Asset              string `json:"a"`  //资产名称
	WalletBalance      string `json:"wb"` //钱包余额
	CrossWalletBalance string `json:"cw"` //除去逐仓仓位保证金的钱包余额
	BalanceChange      string `json:"bc"` //除去盈亏与交易手续费以外的钱包余额改变量
}

type WsSwapOrder

type WsSwapOrder struct {
	Symbol         string `json:"s"`  //交易对
	ClientOrderId  string `json:"c"`  //clientOrderId
	Side           string `json:"S"`  //订单方向
	Type           string `json:"o"`  //订单类型
	TimeInForce    string `json:"f"`  //有效方式
	OrigQty        string `json:"q"`  //订单原始数量
	Price          string `json:"p"`  //订单原始价格
	AvgPrice       string `json:"ap"` //订单平均价格
	StopPrice      string `json:"sp"` //止盈止损单触发价格
	ExecutionType  string `json:"x"`  //本次事件的具体执行类型
	Status         string `json:"X"`  //订单的当前状态
	OrderId        int64  `json:"i"`  //orderId
	LastQty        string `json:"l"`  //订单末次成交量
	ExecutedQty    string `json:"z"`  //订单累计已成交量
	LastPrice      string `json:"L"`  //订单末次成交价格
	MarginAsset    string `json:"ma"` //保证金资产类型
	FeeAsset       string `json:"N"`  //手续费资产类别
	FeeQty         string `json:"n"`  //手续费数量
	TradeTime      int64  `json:"T"`  //成交时间
	TradeId        int64  `json:"t"`  //成交ID
	RealizedProfit string `json:"rp"` //该交易实现盈亏
	BuyNetValue    string `json:"b"`  //买单净值
	SellNetValue   string `json:"a"`  //卖单净值
	IsMaker        bool   `json:"m"`  //该成交是作为挂单成交吗?
	IsReduceOnly   bool   `json:"R"`  //是否是只减仓单
	TriggerType    string `json:"wt"` //触发价类型
	OrigType       string `json:"ot"` //原始订单类型
	PositionSide   string `json:"ps"` //持仓方向
	IsClose        bool   `json:"cp"` //是否为触发平仓单
	ActivePrice    string `json:"AP"` //追踪止损激活价格
	CallbackRate   string `json:"cr"` //追踪止损回调比例
	PriceProtect   bool   `json:"pP"` //是否开启条件单触发保护
}

type WsSwapPayload

type WsSwapPayload struct {
	Ws                      *SwapWsStreamClient
	Id                      int64
	AccountUpdatePayload    *Payload[WsSwapPayloadAccountUpdate]
	OrderTradeUpdatePayload *Payload[WsSwapPayloadOrderTradeUpdate]
}

func (*WsSwapPayload) Close

func (payload *WsSwapPayload) Close()

type WsSwapPayloadAccountUpdate

type WsSwapPayloadAccountUpdate struct {
	Event        string       `json:"e"` //事件类型
	Timestamp    int64        `json:"E"` //事件时间
	TradeTime    int64        `json:"T"` //撮合时间
	AccountAlias string       `json:"i"` //账户唯一识别码 accountAlias
	Action       WsSwapAction `json:"a"` // 账户更新事件
}

币本位合约账户更新推送

type WsSwapPayloadOrderTradeUpdate

type WsSwapPayloadOrderTradeUpdate struct {
	Event        string      `json:"e"` //事件类型
	Timestamp    int64       `json:"E"` //事件时间
	TradeTime    int64       `json:"T"` //撮合时间
	AccountAlias string      `json:"i"` //账户唯一识别码 accountAlias
	Order        WsSwapOrder `json:"o"` //订单信息
}

币本位合约订单/交易 更新推送

type WsSwapPosition

type WsSwapPosition struct {
	Symbol             string `json:"s"`   //交易对
	PositionAmount     string `json:"pa"`  //仓位
	EntryPrice         string `json:"ep"`  //入仓价格
	BreakEvenPrice     string `json:"bep"` //盈亏平衡价
	CumulativeRealized string `json:"cr"`  //(费前)累计实现损益
	UnrealizedProfit   string `json:"up"`  //持仓未实现盈亏
	MarginType         string `json:"mt"`  //保证金模式
	InitialMargin      string `json:"iw"`  //若为逐仓,仓位保证金
	PositionSide       string `json:"ps"`  //持仓方向
}

Source Files

Jump to

Keyboard shortcuts

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