Documentation
¶
Index ¶
- Constants
- func AddParams(params map[string]interface{}, options ...map[string]interface{}) map[string]interface{}
- func AddToParams(key string, value interface{}, params map[string]interface{})
- func CreateChannel(channel string, symbol string) string
- func CreateParams(options ...map[string]interface{}) map[string]interface{}
- func CreateQueryString(params map[string]interface{}) string
- func CreateSubscribeParam(channels []string) ([]byte, error)
- func GetHttpStatus(response *CloudResponse) intdeprecated
- func GetResponse(response *CloudResponse) stringdeprecated
- func Headers(request *http.Request, apiKey string, timestamp string, sign string, ...)
- func HmacSha256Base64Signer(message string, secretKey string) (string, error)
- func Int64ToString(arg int64) string
- func IntToString(arg int) string
- func InterfaceToString(inter interface{}) string
- func JsonBytesToStrut(jsonBytes []byte, result interface{}) error
- func NewParams() map[string]interface{}
- func ParseRequestParams(params interface{}) (string, *bytes.Reader, error)
- func PreHashString(timestamp string, memo string, body string) string
- func PrintRequest(request *http.Request, body string)
- func PrintResponse(response *CloudResponse)
- func StringToInt(arg string) int
- func UTCTime() string
- type ApiMessage
- type Auth
- type BatchOrder
- type Callback
- type CloudClient
- func (cloudClient *CloudClient) GetAccountCurrencies() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetAccountDepositAddress(currency string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetAccountWithdrawCharge(currency string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetActualTradeFeeRate(symbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetBasicFeeRate() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetBorrowRecordIsolated(symbol string, borrowId string, startTime int64, endTime int64, N int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetBrokerRebate() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetBrokerRebateByTimestamp(startTime int64, endTime int64) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractAssetsDetail() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractCurrentPlanOrders(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractDepth(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractDetails(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractFundingRate(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractFundingRateHistory(contractSymbol string, limit int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractKline(contractSymbol string, startTime, endTime, step int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractMarkPriceKline(contractSymbol string, startTime, endTime, step int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractOpenInterest(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractOpenOrders(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractOrder(contractSymbol string, orderId string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractOrderHistory(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractPosition(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractPositionRisk(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractTradeFeeRate(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractTrades(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractTransactionHistory(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractTransferList(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetDepositWithdrawDetail(id string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetDepositWithdrawHistory(operationType string, n int, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetMarginAccountDetailsIsolated(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetRepaymentRecordIsolated(symbol string, repayId string, currency string, startTime int64, endTime int64, ...) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotAccountOrders(symbol string, orderMode string, startTime int64, endTime int64, limit int, ...) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotAccountTradeList(symbol string, orderMode string, startTime int64, endTime int64, limit int, ...) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotAccountWallet(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotCurrencies() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotOpenOrders(symbol string, orderMode string, startTime int64, endTime int64, limit int, ...) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotOrderByClientOrderId(clientOrderId string, queryState string, recvWindow int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotOrderByOrderId(orderId string, queryState string, recvWindow int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotOrderTradeList(orderId string, recvWindow int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotSymbol() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotSymbolDetail() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3Book(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3HistoryKline(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3LatestKline(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3Ticker(symbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3Tickers() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3Trade(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotWallet() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSystemService() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSystemTime() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetTradingPairBorrowingRateAndAmount(symbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) MarginAssetTransfer(transfer MarginAssetTransfer) (*CloudResponse, error)
- func (cloudClient *CloudClient) MarginBorrowIsolated(symbol string, currency string, amount string) (*CloudResponse, error)
- func (cloudClient *CloudClient) MarginRepayIsolated(symbol string, currency string, amount string) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostAccountWithdrawApply(apply WithdrawApply) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractCancelOrder(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractCancelOrders(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractCancelPlanOrder(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractCancelTrailOrder(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractModifyPlanOrder(contractSymbol string, orderType string, triggerPrice string, priceType int, ...) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractModifyPresetPlanOrder(contractSymbol string, orderId string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractModifyTpSlOrder(contractSymbol string, triggerPrice string, priceType int, ...) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractPlanOrder(planOrder ContractPlanOrder) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractSubmitLeverage(contractSymbol string, leverage string, openType string) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractSubmitOrder(order ContractOrder) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractSubmitTpSlOrder(contractSymbol string, orderType string, side int, triggerPrice string, ...) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractTrailOrder(trailOrder ContractTrailOrder) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractTransfer(currency string, amount string, transferType string, recvWindow int) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostMarginSubmitOrder(order MarginOrder) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostSpotBatchOrders(symbol string, orderParams []BatchOrder, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostSpotCancelAllOrder(options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostSpotCancelOrder(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostSpotCancelOrders(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostSpotSubmitOrder(order Order) (*CloudResponse, error)
- func (cloudClient *CloudClient) Request(method string, requestPath string, params map[string]interface{}, auth Auth, ...) (response *http.Response, err error)
- type CloudFuturesWSClient
- type CloudResponse
- type CloudSpotWSClient
- type CloudWsClient
- func (ws *CloudWsClient) FuturesCheckLogin(message []byte) bool
- func (ws *CloudWsClient) FuturesLogin() error
- func (ws *CloudWsClient) FuturesPing()
- func (ws *CloudWsClient) Init(isSpot bool, config Config, callback Callback)
- func (ws *CloudWsClient) Login() error
- func (ws *CloudWsClient) Send(message string) error
- func (ws *CloudWsClient) SpotCheckLogin(message []byte) bool
- func (ws *CloudWsClient) SpotLogin() error
- func (ws *CloudWsClient) SpotPing()
- func (ws *CloudWsClient) Stop()
- type Config
- type ContractOrder
- type ContractPlanOrder
- type ContractTrailOrder
- type CustomLogger
- type FuturesWsRespMsg
- type MarginAssetTransfer
- type MarginOrder
- type Msg
- type OpParam
- type Order
- type RateLimit
- type SpotWsRespMsg
- type WithdrawApply
Constants ¶
const ( API_URL_PRO = "https://api-cloud.bitmart.com" // rest api url API_URL_V2_PRO = "https://api-cloud-v2.bitmart.com" // rest api url SPOT_WS_URL = "wss://ws-manager-compress.bitmart.com/api?protocol=1.1" // spot-ws-public SPOT_WS_USER = "wss://ws-manager-compress.bitmart.com/user?protocol=1.1" // spot-ws-private FUTURES_WS_URL = "wss://openapi-ws-v2.bitmart.com/api?protocol=1.1" // contract-ws-public FUTURES_WS_USER = "wss://openapi-ws-v2.bitmart.com/user?protocol=1.1" // contract-ws-private X_BM_KEY = "X-BM-KEY" X_BM_SIGN = "X-BM-SIGN" X_BM_TIMESTAMP = "X-BM-TIMESTAMP" CONTENT_TYPE = "Content-Type" ACCEPT = "Accept" USER_AGENT = "User-Agent" VERSION = "bitmart-go-sdk-api/1.3.0" APPLICATION_JSON = "application/json" APPLICATION_JSON_UTF8 = "application/json; charset=UTF-8" GET = "GET" POST = "POST" DELETE = "DELETE" // API_SYSTEM_TIME_URL System Status Endpoints: https://developer-pro.bitmart.com/en/spot/#system-status API_SYSTEM_TIME_URL = "/system/time" API_SYSTEM_SERVICE_URL = "/system/service" // API_ACCOUNT_CURRENCIES_URL Funding Account Endpoints: https://developer-pro.bitmart.com/en/spot/#funding-account API_ACCOUNT_CURRENCIES_URL = "/account/v1/currencies" API_ACCOUNT_WALLET_URL = "/account/v1/wallet" API_ACCOUNT_DEPOSIT_ADDRESS_URL = "/account/v1/deposit/address" API_ACCOUNT_WITHDRAW_CHARGE_URL = "/account/v1/withdraw/charge" API_ACCOUNT_WITHDRAW_APPLY_URL = "/account/v1/withdraw/apply" API_ACCOUNT_DEPOSIT_WITHDRAW_HISTORY_URL = "/account/v2/deposit-withdraw/history" API_ACCOUNT_DEPOSIT_WITHDRAW_DETAIL_URL = "/account/v1/deposit-withdraw/detail" API_SPOT_MARGIN_ACCOUNT_ISOLATED_URL = "/spot/v1/margin/isolated/account" API_SPOT_MARGIN_ASSET_TRANSFER_URL = "/spot/v1/margin/isolated/transfer" API_SPOT_USER_FEE_URL = "/spot/v1/user_fee" API_SPOT_TRADE_FEE_URL = "/spot/v1/trade_fee" // API_SPOT_CURRENCIES_URL Public Market Data Endpoints: https://developer-pro.bitmart.com/en/spot/#public-market-data API_SPOT_CURRENCIES_URL = "/spot/v1/currencies" API_SPOT_SYMBOLS_URL = "/spot/v1/symbols" API_SPOT_SYMBOLS_DETAILS_URL = "/spot/v1/symbols/details" API_SPOT_V3_TICKERS_URL = "/spot/quotation/v3/tickers" API_SPOT_V3_TICKER_URL = "/spot/quotation/v3/ticker" API_SPOT_V3_LATEST_KLINE_URL = "/spot/quotation/v3/lite-klines" API_SPOT_V3_HISTORY_KLINE_URL = "/spot/quotation/v3/klines" API_SPOT_V3_BOOKS_URL = "/spot/quotation/v3/books" API_SPOT_V3_TRADES_URL = "/spot/quotation/v3/trades" // API_SPOT_WALLET_URL Spot / Margin Trading Endpoints: https://developer-pro.bitmart.com/en/spot/#spot-margin-trading API_SPOT_WALLET_URL = "/spot/v1/wallet" API_SPOT_SUBMIT_ORDER_URL = "/spot/v2/submit_order" API_SPOT_SUBMIT_MARGIN_ORDER_URL = "/spot/v1/margin/submit_order" API_SPOT_BATCH_ORDERS_URL = "/spot/v4/batch_orders" API_SPOT_CANCEL_ORDER_URL = "/spot/v3/cancel_order" API_SPOT_CANCEL_ORDERS_URL = "/spot/v4/cancel_orders" API_SPOT_CANCEL_ALL_URL = "/spot/v4/cancel_all" API_SPOT_V4_QUERY_ORDER_BY_ID_URL = "/spot/v4/query/order" API_SPOT_V4_QUERY_ORDER_BY_CLIENT_URL = "/spot/v4/query/client-order" API_SPOT_V4_QUERY_OPEN_ORDERS_URL = "/spot/v4/query/open-orders" API_SPOT_V4_QUERY_HISTORY_ORDERS_URL = "/spot/v4/query/history-orders" API_SPOT_V4_QUERY_TRADES_URL = "/spot/v4/query/trades" API_SPOT_V4_QUERY_ORDER_TRADES_URL = "/spot/v4/query/order-trades" // Margin Loan Endpoints: https://developer-pro.bitmart.com/en/spot/#margin-loan API_MARGIN_BORROW_ISOLATED_URL = "/spot/v1/margin/isolated/borrow" API_MARGIN_REPAY_ISOLATED_URL = "/spot/v1/margin/isolated/repay" API_BORROW_ROCORD_ISOLATED_URL = "/spot/v1/margin/isolated/borrow_record" API_REPAYMENT_ROCORD_ISOLATED_URL = "/spot/v1/margin/isolated/repay_record" API_TRADING_PAIR_BORROWING_RATE_AND_AMOUNT = "/spot/v1/margin/isolated/pairs" // broker url API_BROKER_REBATE_URL = "/spot/v1/broker/rebate" // Futures Market Data Endpoints: https://developer-pro.bitmart.com/en/futures/#futures-market-data API_CONTRACT_DETAILS_URL = "/contract/public/details" API_CONTRACT_DEPTH_URL = "/contract/public/depth" API_CONTRACT_OPEN_INTEREST_URL = "/contract/public/open-interest" API_CONTRACT_FUNDING_RATE_URL = "/contract/public/funding-rate" API_CONTRACT_FUNDING_RATE_HISTORY_URL = "/contract/public/funding-rate-history" API_CONTRACT_KLINE_URL = "/contract/public/kline" API_CONTRACT_MARK_PRICE_KLINE_URL = "/contract/public/markprice-kline" // Futures Account Data Endpoints: https://developer-pro.bitmart.com/en/futures/#futures-account-data API_CONTRACT_ASSETS_DETAIL_URL = "/contract/private/assets-detail" // Futures Trading Endpoints: https://developer-pro.bitmart.com/en/futures/#futures-trading API_CONTRACT_TRADE_FEE_RATE_URL = "/contract/private/trade-fee-rate" API_CONTRACT_ORDER_URL = "/contract/private/order" API_CONTRACT_ORDER_HISTORY_URL = "/contract/private/order-history" API_CONTRACT_OPEN_ORDERS_URL = "/contract/private/get-open-orders" API_CONTRACT_CURRENT_PLAN_ORDER_URL = "/contract/private/current-plan-order" API_CONTRACT_POSITION_URL = "/contract/private/position" API_CONTRACT_POSITION_RISK_URL = "/contract/private/position-risk" API_CONTRACT_TRANSACTION_HISTORY_URL = "/contract/private/transaction-history" API_CONTRACT_TRADES_URL = "/contract/private/trades" API_CONTRACT_TRANSFER_LIST_URL = "/account/v1/transfer-contract-list" API_CONTRACT_SUBMIT_ORDER_URL = "/contract/private/submit-order" API_CONTRACT_CANCEL_ORDER_URL = "/contract/private/cancel-order" API_CONTRACT_CANCEL_ORDERS_URL = "/contract/private/cancel-orders" API_CONTRACT_SUBMIT_PLAN_ORDER_URL = "/contract/private/submit-plan-order" API_CONTRACT_CANCEL_PLAN_ORDER_URL = "/contract/private/cancel-plan-order" API_CONTRACT_SUBMIT_TRAIL_ORDER_URL = "/contract/private/submit-trail-order" API_CONTRACT_CANCEL_TRAIL_ORDER_URL = "/contract/private/cancel-trail-order" API_CONTRACT_TRANSFER_URL = "/account/v1/transfer-contract" API_CONTRACT_SUBMIT_LEVERAGE_URL = "/contract/private/submit-leverage" API_CONTRACT_SUBMIT_TP_SL_ORDER_URL = "/contract/private/submit-tp-sl-order" API_CONTRACT_MODIFY_PLAN_ORDER_URL = "/contract/private/modify-plan-order" API_CONTRACT_MODIFY_PRESET_PLAN_ORDER_URL = "/contract/private/modify-preset-plan-order" API_CONTRACT_MODIFY_TP_SL_ORDER_URL = "/contract/private/modify-tp-sl-order" // web socket // spot common WS_PUBLIC_SPOT_TICKER = "spot/ticker" WS_PUBLIC_SPOT_TRADE = "spot/trade" WS_PUBLIC_SPOT_DEPTH5 = "spot/depth5" WS_PUBLIC_SPOT_DEPTH20 = "spot/depth20" WS_PUBLIC_SPOT_DEPTH50 = "spot/depth50" WS_PUBLIC_SPOT_KLINE_1M = "spot/kline1m" WS_PUBLIC_SPOT_KLINE_3M = "spot/kline3m" WS_PUBLIC_SPOT_KLINE_5M = "spot/kline5m" WS_PUBLIC_SPOT_KLINE_15M = "spot/kline15m" WS_PUBLIC_SPOT_KLINE_30M = "spot/kline30m" WS_PUBLIC_SPOT_KLINE_1H = "spot/kline1H" WS_PUBLIC_SPOT_KLINE_2H = "spot/kline2H" WS_PUBLIC_SPOT_KLINE_4H = "spot/kline4H" WS_PUBLIC_SPOT_KLINE_1D = "spot/kline1D" WS_PUBLIC_SPOT_KLINE_1W = "spot/kline1W" WS_PUBLIC_SPOT_KLINE_1MON = "spot/kline1M" // spot user WS_USER_SPOT_ORDER = "spot/user/order" // contract common WS_PUBLIC_CONTRACT_TICKER = "futures/ticker" WS_PUBLIC_CONTRACT_DEPTH5 = "futures/depth5" WS_PUBLIC_CONTRACT_DEPTH20 = "futures/depth20" WS_PUBLIC_CONTRACT_DEPTH50 = "futures/depth50" WS_PUBLIC_CONTRACT_KLINE_1M = "futures/klineBin1m" WS_PUBLIC_CONTRACT_KLINE_5M = "futures/klineBin5m" WS_PUBLIC_CONTRACT_KLINE_15M = "futures/klineBin15m" WS_PUBLIC_CONTRACT_KLINE_30M = "futures/klineBin30m" WS_PUBLIC_CONTRACT_KLINE_1H = "futures/klineBin1H" WS_PUBLIC_CONTRACT_KLINE_2H = "futures/klineBin2H" WS_PUBLIC_CONTRACT_KLINE_4H = "futures/klineBin4H" WS_PUBLIC_CONTRACT_KLINE_1D = "futures/klineBin1D" WS_PUBLIC_CONTRACT_KLINE_1W = "futures/klineBin1W" // contract user WS_USER_CONTRACT_ASSET = "futures/asset" WS_USER_CONTRACT_POSITION = "futures/position" WS_USER_CONTRACT_UNICAST = "futures/unicast" )
const ( DEBUG = iota INFO WARN ERROR )
Variables ¶
This section is empty.
Functions ¶
func AddParams ¶ added in v1.0.2
func AddParams(params map[string]interface{}, options ...map[string]interface{}) map[string]interface{}
AddParams add param
func AddToParams ¶ added in v1.0.2
AddToParams add to params
func CreateChannel ¶
CreateChannel create channel
func CreateParams ¶ added in v1.0.2
CreateParams get param
func CreateQueryString ¶
CreateQueryString create query string
func CreateSubscribeParam ¶
CreateSubscribeParam create subscribe param
func GetHttpStatus
deprecated
func GetHttpStatus(response *CloudResponse) int
Deprecated: Use `.HttpStatus` instead. GetHttpStatus get http status
func GetResponse
deprecated
func GetResponse(response *CloudResponse) string
Deprecated: Use `.Response` instead. GetResponse get response
func Headers ¶
func Headers(request *http.Request, apiKey string, timestamp string, sign string, additionalHeaders map[string]string)
Headers set headers
func HmacSha256Base64Signer ¶
HmacSha256Base64Signer hmac sha256 base64 signer
func InterfaceToString ¶
func InterfaceToString(inter interface{}) string
func JsonBytesToStrut ¶
JsonBytesToStrut jsonBytes to struct
func ParseRequestParams ¶
ParseRequestParams /** Parse request params to json and bin styles
func PreHashString ¶
PreHashString pre hash string /** timestamp + "#" + memo + "#" + queryString
func PrintRequest ¶
PrintRequest print request
Types ¶
type ApiMessage ¶
type BatchOrder ¶ added in v1.0.2
type BatchOrder struct { Side string `json:"side"` Type string `json:"type"` ClientOrderId string `json:"clientOrderId,omitempty"` Size string `json:"size,omitempty"` Price string `json:"price,omitempty"` Notional string `json:"notional,omitempty"` }
BatchOrder /** Spot Order Parameters
type CloudClient ¶
func (*CloudClient) GetAccountCurrencies ¶
func (cloudClient *CloudClient) GetAccountCurrencies() (*CloudResponse, error)
GetAccountCurrencies /** Get Currencies
func (*CloudClient) GetAccountDepositAddress ¶
func (cloudClient *CloudClient) GetAccountDepositAddress(currency string) (*CloudResponse, error)
GetAccountDepositAddress /** Deposit Address (KEYED)
func (*CloudClient) GetAccountWithdrawCharge ¶
func (cloudClient *CloudClient) GetAccountWithdrawCharge(currency string) (*CloudResponse, error)
GetAccountWithdrawCharge /** Withdraw Quota (KEYED)
func (*CloudClient) GetActualTradeFeeRate ¶
func (cloudClient *CloudClient) GetActualTradeFeeRate(symbol string) (*CloudResponse, error)
GetActualTradeFeeRate /** Get Actual Trade Fee Rate (KEYED)
func (*CloudClient) GetBasicFeeRate ¶
func (cloudClient *CloudClient) GetBasicFeeRate() (*CloudResponse, error)
GetBasicFeeRate /** Get Basic Fee Rate (KEYED)
func (*CloudClient) GetBorrowRecordIsolated ¶
func (cloudClient *CloudClient) GetBorrowRecordIsolated(symbol string, borrowId string, startTime int64, endTime int64, N int) (*CloudResponse, error)
GetBorrowRecordIsolated /** Get Borrow Record(Isolated) (KEYED)
func (*CloudClient) GetBrokerRebate ¶
func (cloudClient *CloudClient) GetBrokerRebate() (*CloudResponse, error)
GetBrokerRebate broker rebate
func (*CloudClient) GetBrokerRebateByTimestamp ¶
func (cloudClient *CloudClient) GetBrokerRebateByTimestamp(startTime int64, endTime int64) (*CloudResponse, error)
GetBrokerRebateByTimestamp broker rebate by timestamp
func (*CloudClient) GetContractAssetsDetail ¶
func (cloudClient *CloudClient) GetContractAssetsDetail() (*CloudResponse, error)
GetContractAssetsDetail assets-detail /** Get Contract Assets (KEYED)
func (*CloudClient) GetContractCurrentPlanOrders ¶ added in v1.0.2
func (cloudClient *CloudClient) GetContractCurrentPlanOrders(options ...map[string]interface{}) (*CloudResponse, error)
GetContractCurrentPlanOrders /** Get All Current Plan Orders (KEYED) Parameters: - Options.symbol: Symbol of the contract(like BTCUSDT) - Options.type: Order type -limit - market - Options.limit: The number of returned results, with a maximum of 100 and a default of 100 - Options.plan_type: Plan order type -plan - profit_loss (default all)
func (*CloudClient) GetContractDepth ¶
func (cloudClient *CloudClient) GetContractDepth(contractSymbol string) (*CloudResponse, error)
GetContractDepth depth /** Get Market Depth
func (*CloudClient) GetContractDetails ¶
func (cloudClient *CloudClient) GetContractDetails(contractSymbol string) (*CloudResponse, error)
GetContractDetails details /** Get Contract Details
func (*CloudClient) GetContractFundingRate ¶
func (cloudClient *CloudClient) GetContractFundingRate(contractSymbol string) (*CloudResponse, error)
GetContractFundingRate funding-rate /** Get Current Funding Rate
func (*CloudClient) GetContractFundingRateHistory ¶ added in v1.3.0
func (cloudClient *CloudClient) GetContractFundingRateHistory(contractSymbol string, limit int) (*CloudResponse, error)
GetContractFundingRateHistory funding-rate-history /** Get Funding Rate History
func (*CloudClient) GetContractKline ¶
func (cloudClient *CloudClient) GetContractKline(contractSymbol string, startTime, endTime, step int) (*CloudResponse, error)
GetContractKline kline /** Get K-line
func (*CloudClient) GetContractMarkPriceKline ¶ added in v1.3.0
func (cloudClient *CloudClient) GetContractMarkPriceKline(contractSymbol string, startTime, endTime, step int) (*CloudResponse, error)
GetContractMarkPriceKline mark kline /** Get MarkPrice K-line
func (*CloudClient) GetContractOpenInterest ¶
func (cloudClient *CloudClient) GetContractOpenInterest(contractSymbol string) (*CloudResponse, error)
GetContractOpenInterest open-interest /** Get Futures Open Interest
func (*CloudClient) GetContractOpenOrders ¶ added in v1.0.1
func (cloudClient *CloudClient) GetContractOpenOrders(options ...map[string]interface{}) (*CloudResponse, error)
GetContractOpenOrders open orders /** Get All Open Orders (KEYED) Parameters: - Options.symbol: Symbol of the contract(like BTCUSDT) - Options.type: Order type -limit - market - trailing - Options.order_state: Order state -all(default) - partially_filled - Options.limit: The number of returned results, with a maximum of 100 and a default of 100
func (*CloudClient) GetContractOrder ¶
func (cloudClient *CloudClient) GetContractOrder(contractSymbol string, orderId string) (*CloudResponse, error)
GetContractOrder order /** Get Order Detail (KEYED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - orderId: Order ID
func (*CloudClient) GetContractOrderHistory ¶
func (cloudClient *CloudClient) GetContractOrderHistory(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
GetContractOrderHistory order-history /** Get Order History (KEYED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - Options.start_time: Start time, default is the last 7 days - Options.end_time: End time, default is the last 7 days
func (*CloudClient) GetContractPosition ¶
func (cloudClient *CloudClient) GetContractPosition(options ...map[string]interface{}) (*CloudResponse, error)
GetContractPosition position /** Get Current Position (KEYED) Parameters: - Options.symbol: Symbol of the contract(like BTCUSDT)
func (*CloudClient) GetContractPositionRisk ¶ added in v1.0.2
func (cloudClient *CloudClient) GetContractPositionRisk(options ...map[string]interface{}) (*CloudResponse, error)
GetContractPositionRisk /** Get Current Position Risk Details(KEYED) Parameters: - Options.symbol: Symbol of the contract(like BTCUSDT)
func (*CloudClient) GetContractTradeFeeRate ¶ added in v1.2.0
func (cloudClient *CloudClient) GetContractTradeFeeRate(contractSymbol string) (*CloudResponse, error)
GetContractTradeFeeRate order /** Get Trade Fee Rate (KEYED) Parameters: - symbol: Symbol of the contract(like BTCUSDT)
func (*CloudClient) GetContractTrades ¶
func (cloudClient *CloudClient) GetContractTrades(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
GetContractTrades trades /** Get Order Trade (KEYED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - Options.start_time: Start time, default is the last 7 days - Options.end_time: End time, default is the last 7 days
func (*CloudClient) GetContractTransactionHistory ¶ added in v1.3.0
func (cloudClient *CloudClient) GetContractTransactionHistory(options ...map[string]interface{}) (*CloudResponse, error)
GetContractTransactionHistory /** Get Transaction History (KEYED) Parameters: - Options.symbol: Symbol of the contract(like BTCUSDT) - Options.flow_type: Type - 0 = All (default) - 1 = Transfer - 2 = Realized PNL - 3 = Funding Fee - 4 = Commission Fee - 5 = Liquidation Clearance - Options.start_time: Start time, timestamp in ms - Options.end_time: End time, timestamp in ms - Options.page_size: Default 100; max 1000
func (*CloudClient) GetContractTransferList ¶
func (cloudClient *CloudClient) GetContractTransferList(options ...map[string]interface{}) (*CloudResponse, error)
GetContractTransferList /** Get Transfer List (SIGNED) Parameters: - Options.currency: Currency (like USDT) - Options.time_start: Start time in milliseconds, (e.g. 1681701557927) - Options.time_end: End time in milliseconds, (e.g. 1681701557927) - Options.page: Number of pages, allowed range [1,1000] - Options.limit: Number of queries, allowed range [10,100] - Options.recvWindow: Trade time limit, allowed range (0,60000], default: 5000 milliseconds
func (*CloudClient) GetDepositWithdrawDetail ¶
func (cloudClient *CloudClient) GetDepositWithdrawDetail(id string) (*CloudResponse, error)
GetDepositWithdrawDetail /** Get A Deposit Or Withdraw Detail (KEYED)
func (*CloudClient) GetDepositWithdrawHistory ¶
func (cloudClient *CloudClient) GetDepositWithdrawHistory(operationType string, n int, options ...map[string]interface{}) (*CloudResponse, error)
GetDepositWithdrawHistory /** Get Deposit And Withdraw History (KEYED) Parameters: - operationType: type -deposit=deposit -withdraw=withdraw - n: Recent N records (value range 1-100) - Options: currency - Token symbol, e.g., 'BTC'
func (*CloudClient) GetMarginAccountDetailsIsolated ¶
func (cloudClient *CloudClient) GetMarginAccountDetailsIsolated(options ...map[string]interface{}) (*CloudResponse, error)
GetMarginAccountDetailsIsolated /** Get Margin Account Details(Isolated) (KEYED) Parameters: - Options: symbol - Trading pair (e.g. BMX_USDT), no symbol is passed, and all isolated margin assets are returned
func (*CloudClient) GetRepaymentRecordIsolated ¶
func (cloudClient *CloudClient) GetRepaymentRecordIsolated(symbol string, repayId string, currency string, startTime int64, endTime int64, N int) (*CloudResponse, error)
GetRepaymentRecordIsolated /** Get Repayment Record(Isolated) (KEYED)
func (*CloudClient) GetSpotAccountOrders ¶
func (cloudClient *CloudClient) GetSpotAccountOrders(symbol string, orderMode string, startTime int64, endTime int64, limit int, recvWindow int) (*CloudResponse, error)
GetSpotAccountOrders /** Query Account Orders (v4) (SIGNED)
func (*CloudClient) GetSpotAccountTradeList ¶
func (cloudClient *CloudClient) GetSpotAccountTradeList(symbol string, orderMode string, startTime int64, endTime int64, limit int, recvWindow int) (*CloudResponse, error)
GetSpotAccountTradeList /** Account Trade List (v4) (SIGNED)
func (*CloudClient) GetSpotAccountWallet ¶
func (cloudClient *CloudClient) GetSpotAccountWallet(options ...map[string]interface{}) (*CloudResponse, error)
GetSpotAccountWallet /** Get Account Balance (KEYED) Parameters: - Options: currency - currency, .e.g. "BTC", "ETH", "USDT"
func (*CloudClient) GetSpotCurrencies ¶
func (cloudClient *CloudClient) GetSpotCurrencies() (*CloudResponse, error)
GetSpotCurrencies /** Get Currency List (v1)
func (*CloudClient) GetSpotOpenOrders ¶
func (cloudClient *CloudClient) GetSpotOpenOrders(symbol string, orderMode string, startTime int64, endTime int64, limit int, recvWindow int) (*CloudResponse, error)
GetSpotOpenOrders /** Query Open Orders (v4) (SIGNED)
func (*CloudClient) GetSpotOrderByClientOrderId ¶
func (cloudClient *CloudClient) GetSpotOrderByClientOrderId(clientOrderId string, queryState string, recvWindow int) (*CloudResponse, error)
GetSpotOrderByClientOrderId /** Query Order By clientOrderId(v4) (SIGNED)
func (*CloudClient) GetSpotOrderByOrderId ¶
func (cloudClient *CloudClient) GetSpotOrderByOrderId(orderId string, queryState string, recvWindow int) (*CloudResponse, error)
GetSpotOrderByOrderId /** Query Order By Id (v4) (SIGNED)
func (*CloudClient) GetSpotOrderTradeList ¶
func (cloudClient *CloudClient) GetSpotOrderTradeList(orderId string, recvWindow int) (*CloudResponse, error)
GetSpotOrderTradeList /** Order Trade List(v4) (SIGNED)
func (*CloudClient) GetSpotSymbol ¶
func (cloudClient *CloudClient) GetSpotSymbol() (*CloudResponse, error)
GetSpotSymbol /** Get List of Trading Pairs (v1)
func (*CloudClient) GetSpotSymbolDetail ¶
func (cloudClient *CloudClient) GetSpotSymbolDetail() (*CloudResponse, error)
GetSpotSymbolDetail /** Get List of Trading Pair Details (v1)
func (*CloudClient) GetSpotV3Book ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3Book(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
GetSpotV3Book /** Get Depth (V3) Parameters: - symbol - Trading pair (e.g. BMX_USDT) - Options: limit - Order book depth per side. Maximum 50, e.g. 50 bids + 50 asks. Default returns to 35 depth data, e.g. 35 bids + 35 asks.
func (*CloudClient) GetSpotV3HistoryKline ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3HistoryKline(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
GetSpotV3HistoryKline /** Get History K-Line (V3)
Parameters: - symbol - Trading pair (e.g. BMX_USDT) - Options: before - Query timestamp (unit: second, e.g. 1525760116), query the data before this time - Options: after - Query timestamp (unit: second, e.g. 1525769116), query the data after this time - Options: step - k-line step, value [1, 3, 5, 15, 30, 45, 60, 120, 180, 240, 1440, 10080, 43200] unit: minute, default 1 - Options: limit - Return number, the maximum value is 200, default is 100
func (*CloudClient) GetSpotV3LatestKline ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3LatestKline(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
GetSpotV3LatestKline /** Get Latest K-Line (V3)
Parameters: - symbol - Trading pair (e.g. BMX_USDT) - Options: before - Query timestamp (unit: second, e.g. 1525760116), query the data before this time - Options: after - Query timestamp (unit: second, e.g. 1525769116), query the data after this time - Options: step - k-line step, value [1, 3, 5, 15, 30, 45, 60, 120, 180, 240, 1440, 10080, 43200] unit: minute, default 1 - Options: limit - Return number, the maximum value is 200, default is 100
func (*CloudClient) GetSpotV3Ticker ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3Ticker(symbol string) (*CloudResponse, error)
GetSpotV3Ticker /** Get Ticker of a Trading Pair (V3)
func (*CloudClient) GetSpotV3Tickers ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3Tickers() (*CloudResponse, error)
GetSpotV3Tickers /** Get Ticker of All Pairs (V3)
func (*CloudClient) GetSpotV3Trade ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3Trade(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
GetSpotV3Trade /** Get Recent Trades (V3) Parameters: - symbol - Trading pair (e.g. BMX_USDT) - Options: limit - Number of returned items, maximum is 50, default 50
func (*CloudClient) GetSpotWallet ¶
func (cloudClient *CloudClient) GetSpotWallet() (*CloudResponse, error)
GetSpotWallet /** Get Account Balance (KEYED)
func (*CloudClient) GetSystemService ¶
func (cloudClient *CloudClient) GetSystemService() (*CloudResponse, error)
GetSystemService /** Get System Service Status (NONE)
func (*CloudClient) GetSystemTime ¶
func (cloudClient *CloudClient) GetSystemTime() (*CloudResponse, error)
GetSystemTime /** Get System Time (NONE)
func (*CloudClient) GetTradingPairBorrowingRateAndAmount ¶
func (cloudClient *CloudClient) GetTradingPairBorrowingRateAndAmount(symbol string) (*CloudResponse, error)
GetTradingPairBorrowingRateAndAmount /** Get Trading Pair Borrowing Rate and Amount (KEYED)
func (*CloudClient) MarginAssetTransfer ¶
func (cloudClient *CloudClient) MarginAssetTransfer(transfer MarginAssetTransfer) (*CloudResponse, error)
MarginAssetTransfer /** Margin Asset Transfer (SIGNED)
func (*CloudClient) MarginBorrowIsolated ¶
func (cloudClient *CloudClient) MarginBorrowIsolated(symbol string, currency string, amount string) (*CloudResponse, error)
MarginBorrowIsolated /** Margin Borrow (Isolated) (SIGNED)
func (*CloudClient) MarginRepayIsolated ¶
func (cloudClient *CloudClient) MarginRepayIsolated(symbol string, currency string, amount string) (*CloudResponse, error)
MarginRepayIsolated /** Margin Repay (Isolated) (SIGNED)
func (*CloudClient) PostAccountWithdrawApply ¶
func (cloudClient *CloudClient) PostAccountWithdrawApply(apply WithdrawApply) (*CloudResponse, error)
PostAccountWithdrawApply /** Withdraw (SIGNED)
func (*CloudClient) PostContractCancelOrder ¶
func (cloudClient *CloudClient) PostContractCancelOrder(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
PostContractCancelOrder cancel-order /** Cancel Order (SIGNED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - options.order_id: Order ID - options.client_order_id: Client-defined OrderId
func (*CloudClient) PostContractCancelOrders ¶
func (cloudClient *CloudClient) PostContractCancelOrders(contractSymbol string) (*CloudResponse, error)
PostContractCancelOrders cancel-orders /** Cancel All Orders (SIGNED) Parameters: - symbol: Symbol of the contract(like BTCUSDT)
func (*CloudClient) PostContractCancelPlanOrder ¶
func (cloudClient *CloudClient) PostContractCancelPlanOrder(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
PostContractCancelPlanOrder cancel-plan-order /** Cancel Plan Order (SIGNED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - options.order_id: Order ID - options.client_order_id: Client Order ID
func (*CloudClient) PostContractCancelTrailOrder ¶ added in v1.3.0
func (cloudClient *CloudClient) PostContractCancelTrailOrder(contractSymbol string, options ...map[string]interface{}) (*CloudResponse, error)
PostContractCancelTrailOrder cancel-trail-order /** Cancel Trail Order (SIGNED)
func (*CloudClient) PostContractModifyPlanOrder ¶ added in v1.1.0
func (cloudClient *CloudClient) PostContractModifyPlanOrder(contractSymbol string, orderType string, triggerPrice string, priceType int, options ...map[string]interface{}) (*CloudResponse, error)
PostContractModifyPlanOrder /** Modify Plan Order (SIGNED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - orderType: Order type -limit -market - triggerPrice: Trigger price - priceType: Trigger price type -1=last_price -2=fair_price - Options.order_id: Order ID(order_id or client_order_id must give one) - Options.executive_price: Execution price for plan order, mandatory when type = limit
func (*CloudClient) PostContractModifyPresetPlanOrder ¶ added in v1.1.0
func (cloudClient *CloudClient) PostContractModifyPresetPlanOrder(contractSymbol string, orderId string, options ...map[string]interface{}) (*CloudResponse, error)
PostContractModifyPresetPlanOrder /** Modify Preset Plan Order (SIGNED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - orderId: Order ID - Options.preset_take_profit_price_type: Pre-set TP price type -1=last_price(default) -2=fair_price - Options.preset_stop_loss_price_type: Pre-set SL price type -1=last_price(default) -2=fair_price - Options.preset_take_profit_price: Pre-set TP price - Options.preset_stop_loss_price: Pre-set SL price
func (*CloudClient) PostContractModifyTpSlOrder ¶ added in v1.1.0
func (cloudClient *CloudClient) PostContractModifyTpSlOrder(contractSymbol string, triggerPrice string, priceType int, options ...map[string]interface{}) (*CloudResponse, error)
PostContractModifyTpSlOrder /** Modify TP/SL Order (SIGNED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - triggerPrice: Trigger price - priceType: Trigger price type -1=last_price -2=fair_price - Options.order_id: Order ID(order_id or client_order_id must give one) - Options.client_order_id: Client order ID(order_id or client_order_id must give one) - Options.executive_price: Execution price for order, mandatory when plan_category = - Options.plan_category: TP/SL type -1=TP/SL -2=Position TP/SL - Options.category: Order type, Position TP/SL default market -limit -market
func (*CloudClient) PostContractPlanOrder ¶
func (cloudClient *CloudClient) PostContractPlanOrder(planOrder ContractPlanOrder) (*CloudResponse, error)
PostContractPlanOrder plan-order /** Submit Plan Order (SIGNED)
func (*CloudClient) PostContractSubmitLeverage ¶ added in v1.0.1
func (cloudClient *CloudClient) PostContractSubmitLeverage(contractSymbol string, leverage string, openType string) (*CloudResponse, error)
PostContractSubmitLeverage submit-leverage /** Submit Leverage (SIGNED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - leverage: Order leverage - openType: Open type, required at close position -cross -isolated
func (*CloudClient) PostContractSubmitOrder ¶
func (cloudClient *CloudClient) PostContractSubmitOrder(order ContractOrder) (*CloudResponse, error)
PostContractSubmitOrder submit-order /** Submit Order (SIGNED)
func (*CloudClient) PostContractSubmitTpSlOrder ¶ added in v1.1.0
func (cloudClient *CloudClient) PostContractSubmitTpSlOrder(contractSymbol string, orderType string, side int, triggerPrice string, executivePrice string, priceType int, options ...map[string]interface{}) (*CloudResponse, error)
PostContractSubmitTpSlOrder /** Submit TP or SL Order (SIGNED) Parameters: - symbol: Symbol of the contract(like BTCUSDT) - orderType: Order type -take_profit -stop_loss - side: Order side -2=buy_close_short -3=sell_close_long - triggerPrice: Trigger price - executivePrice: Execution price - priceType: Trigger price type -1=last_price -2=fair_price - Options.size: Order size (Number of contracts) Default the size of position - Options.plan_category: TP/SL type -1=TP/SL(default) -2=Position TP/SL - Options.client_order_id: Client order ID - Options.category: Trigger order type, position TP/SL default market, -limit -market
func (*CloudClient) PostContractTrailOrder ¶ added in v1.3.0
func (cloudClient *CloudClient) PostContractTrailOrder(trailOrder ContractTrailOrder) (*CloudResponse, error)
PostContractTrailOrder plan-order /** Submit Trail Order (SIGNED)
func (*CloudClient) PostContractTransfer ¶
func (cloudClient *CloudClient) PostContractTransfer(currency string, amount string, transferType string, recvWindow int) (*CloudResponse, error)
PostContractTransfer transfer /** Transfer (SIGNED) Parameters: - currency: Currency - amount: Transfer amount,allowed range[0.01,10000000000] - type: Transfer type -spot_to_contract -contract_to_spot - recvWindow: Trade time limit, allowed range (0,60000], default: 5000 milliseconds
func (*CloudClient) PostMarginSubmitOrder ¶
func (cloudClient *CloudClient) PostMarginSubmitOrder(order MarginOrder) (*CloudResponse, error)
PostMarginSubmitOrder /** New Margin Order(v1) (SIGNED)
func (*CloudClient) PostSpotBatchOrders ¶
func (cloudClient *CloudClient) PostSpotBatchOrders(symbol string, orderParams []BatchOrder, options ...map[string]interface{}) (*CloudResponse, error)
PostSpotBatchOrders /** Batch New Order(v4) (SIGNED) Parameters: - symbol: Trading pair (e.g. BTC_USDT) - orderParams: Order parameters, the number of transactions cannot exceed 10 - Options.recvWindow - Trade time limit, allowed range (0,60000], default: 5000 milliseconds
func (*CloudClient) PostSpotCancelAllOrder ¶ added in v1.0.2
func (cloudClient *CloudClient) PostSpotCancelAllOrder(options ...map[string]interface{}) (*CloudResponse, error)
PostSpotCancelAllOrder /** Cancel All Order(v4) (SIGNED) Parameters: - Options.symbol: Trading pair (e.g. BTC_USDT) - Options.side: Order side -buy -sell
func (*CloudClient) PostSpotCancelOrder ¶
func (cloudClient *CloudClient) PostSpotCancelOrder(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
PostSpotCancelOrder /** Cancel Order(v3) (SIGNED) Parameters: - symbol: Trading pair (e.g. BTC_USDT) - Options.order_id - Order ID - Options.client_order_id - Client-defined Order ID
func (*CloudClient) PostSpotCancelOrders ¶
func (cloudClient *CloudClient) PostSpotCancelOrders(symbol string, options ...map[string]interface{}) (*CloudResponse, error)
PostSpotCancelOrders /** Cancel Batch Order(v4) (SIGNED) Parameters: - symbol: Trading pair (e.g. BTC_USDT) - Options.orderIds - Order Id List (Either orderIds or clientOrderIds must be provided) - Options.clientOrderIds - Client-defined OrderId List (Either orderIds or clientOrderIds must be provided) - Options.recvWindow - Trade time limit, allowed range (0,60000], default: 5000 milliseconds
func (*CloudClient) PostSpotSubmitOrder ¶
func (cloudClient *CloudClient) PostSpotSubmitOrder(order Order) (*CloudResponse, error)
PostSpotSubmitOrder /** New Order(v2) (SIGNED)
type CloudFuturesWSClient ¶ added in v1.2.0
type CloudFuturesWSClient struct {
CloudWsClient
}
type CloudResponse ¶
type CloudSpotWSClient ¶ added in v1.2.0
type CloudSpotWSClient struct {
CloudWsClient
}
func NewFuturesWSClient ¶ added in v1.2.0
func NewFuturesWSClient(config Config, callback Callback) *CloudSpotWSClient
func NewSpotWSClient ¶ added in v1.2.0
func NewSpotWSClient(config Config, callback Callback) *CloudSpotWSClient
type CloudWsClient ¶ added in v1.2.0
type CloudWsClient struct { Config Config Conn *websocket.Conn // contains filtered or unexported fields }
func (*CloudWsClient) FuturesCheckLogin ¶ added in v1.2.0
func (ws *CloudWsClient) FuturesCheckLogin(message []byte) bool
FuturesCheckLogin /* check login result
func (*CloudWsClient) FuturesLogin ¶ added in v1.2.0
func (ws *CloudWsClient) FuturesLogin() error
FuturesLogin /* Send Login Message
func (*CloudWsClient) FuturesPing ¶ added in v1.2.0
func (ws *CloudWsClient) FuturesPing()
FuturesPing /* Send Ping Message
func (*CloudWsClient) Init ¶ added in v1.2.0
func (ws *CloudWsClient) Init(isSpot bool, config Config, callback Callback)
func (*CloudWsClient) Login ¶ added in v1.2.0
func (ws *CloudWsClient) Login() error
Login /* Send Login message to Server
func (*CloudWsClient) Send ¶ added in v1.2.0
func (ws *CloudWsClient) Send(message string) error
Send /* Send message to Server
func (*CloudWsClient) SpotCheckLogin ¶ added in v1.2.0
func (ws *CloudWsClient) SpotCheckLogin(message []byte) bool
SpotCheckLogin /* check login result
func (*CloudWsClient) SpotLogin ¶ added in v1.2.0
func (ws *CloudWsClient) SpotLogin() error
SpotLogin /* Send Login Message
func (*CloudWsClient) SpotPing ¶ added in v1.2.0
func (ws *CloudWsClient) SpotPing()
SpotPing /* Send Ping Message
func (*CloudWsClient) Stop ¶ added in v1.2.0
func (ws *CloudWsClient) Stop()
Stop /* websocket close
type ContractOrder ¶
type ContractOrder struct { Symbol string `json:"symbol,omitempty"` ClientOrderId string `json:"client_order_id,omitempty"` Type string `json:"type,omitempty"` Side int `json:"side,omitempty"` Leverage string `json:"leverage,omitempty"` OpenType string `json:"open_type,omitempty"` Mode int `json:"mode,omitempty"` Price string `json:"price,omitempty"` Size int `json:"size,omitempty"` PresetTakeProfitPriceType int `json:"preset_take_profit_price_type,omitempty"` PresetStopLossPriceType int `json:"preset_stop_loss_price_type,omitempty"` PresetTakeProfitPrice string `json:"preset_take_profit_price,omitempty"` PresetStopLossPrice string `json:"preset_stop_loss_price,omitempty"` }
ContractOrder submit_contract order params
type ContractPlanOrder ¶
type ContractPlanOrder struct { Symbol string `json:"symbol"` Type string `json:"type,omitempty"` Side int `json:"side"` Leverage string `json:"leverage"` OpenType string `json:"open_type"` Mode int `json:"mode,omitempty"` Size int `json:"size"` TriggerPrice string `json:"trigger_price"` ExecutivePrice string `json:"executive_price"` PriceWay int `json:"price_way"` PriceType int `json:"price_type"` PlanCategory int `json:"plan_category"` PresetTakeProfitPriceType int `json:"preset_take_profit_price_type"` PresetStopLossPriceType int `json:"preset_stop_loss_price_type"` PresetTakeProfitPrice string `json:"preset_take_profit_price"` PresetStopLossPrice string `json:"preset_stop_loss_price"` }
type ContractTrailOrder ¶ added in v1.3.0
type ContractTrailOrder struct { Symbol string `json:"symbol"` Side int `json:"side"` Leverage string `json:"leverage"` OpenType string `json:"open_type"` Size int `json:"size"` ActivationPrice string `json:"activation_price"` CallbackRate string `json:"callback_rate"` ActivationPriceType int `json:"activation_price_type"` }
type CustomLogger ¶ added in v1.0.2
type CustomLogger struct {
// contains filtered or unexported fields
}
func NewCustomLogger ¶ added in v1.0.2
func NewCustomLogger(logLevel int, output io.Writer) *CustomLogger
NewCustomLogger Creating a custom logger
func (*CustomLogger) Log ¶ added in v1.0.2
func (l *CustomLogger) Log(level int, msg string)
Log Print logs (support different log levels)
func (*CustomLogger) Logf ¶ added in v1.0.2
func (l *CustomLogger) Logf(level int, format string, v ...interface{})
Logf Create a log with formatting
func (*CustomLogger) SetLogLevel ¶ added in v1.0.2
func (l *CustomLogger) SetLogLevel(level int)
SetLogLevel Setting the log level
type FuturesWsRespMsg ¶ added in v1.2.0
type MarginAssetTransfer ¶
type MarginOrder ¶
type MarginOrder struct { Symbol string `json:"symbol"` Side string `json:"side"` Type string `json:"type"` ClientOrderId string `json:"clientOrderId"` Size string `json:"size"` Price string `json:"price"` Notional string `json:"notional"` }
MarginOrder /** Margin Order Parameters
type Order ¶
type Order struct { Symbol string `json:"symbol"` Side string `json:"side"` Type string `json:"type"` ClientOrderId string `json:"client_order_id,omitempty"` Size string `json:"size,omitempty"` Price string `json:"price,omitempty"` Notional string `json:"notional,omitempty"` }
Order /** Spot Order Parameters
type RateLimit ¶
func GetLimit
deprecated
func GetLimit(response *CloudResponse) RateLimit
Deprecated: Use `.Limit` instead. GetLimit get limit
type SpotWsRespMsg ¶ added in v1.2.0
type WithdrawApply ¶
type WithdrawApply struct { Currency string `json:"currency"` Amount string `json:"amount"` Destination string `json:"destination"` // -To Digital Address Address string `json:"address"` // Withdraw address (only the address added on the official website is supported) AddressMemo string `json:"address_memo"` // Address tag(tag Or payment_id Or memo) Type int `json:"type"` // Account type 1=CID 2=Email 3=Phone Value string `json:"value"` // Account AreaCode string `json:"areaCode"` // Phone area code, required when account type is phone, e.g.: 61 }
WithdrawApply Withdraw Parameters