Documentation ¶
Index ¶
- Constants
- func CreateChannel(channel string, symbol string) string
- func CreateQueryString(params map[string]interface{}) string
- func CreateSubscribeParam(channels []string) ([]byte, error)
- func GetHttpStatus(response *CloudResponse) int
- func GetResponse(response *CloudResponse) string
- 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 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) GetContractDepth(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractDetails(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractFundingRate(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractKline(contractSymbol string, from, to, step int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractOpenInterest(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractOpenOrders(contractSymbol string, orderType string, orderState string, limit int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractOrder(contractSymbol string, orderId string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractOrderHistory(contractSymbol string, from, to int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractPosition(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractTrades(contractSymbol string, from, to int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetContractTransferList(contractSymbol string, timeStart, timeEnd int64, page, limit, recvWindow int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetDepositWithdrawDetail(id string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetDepositWithdrawHistory(history HistoryApply) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetMarginAccountDetailsIsolated(symbol string) (*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(currency string) (*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) GetSpotSteps() (*CloudResponse, error)deprecated
- func (cloudClient *CloudClient) GetSpotSymbol() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotSymbolBook(symbol string, precision int, size int) (*CloudResponse, error)deprecated
- func (cloudClient *CloudClient) GetSpotSymbolDetail() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotSymbolKline(symbol string, from int64, to int64, step int) (*CloudResponse, error)deprecated
- func (cloudClient *CloudClient) GetSpotSymbolTrade(symbol string) (*CloudResponse, error)deprecated
- func (cloudClient *CloudClient) GetSpotTicker() (*CloudResponse, error)deprecated
- func (cloudClient *CloudClient) GetSpotTickerDetail(symbol string) (*CloudResponse, error)deprecated
- func (cloudClient *CloudClient) GetSpotV3Book(symbol string, limit int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3HistoryKline(symbol string, before, after int64, step, limit int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3LatestKline(symbol string, before, after int64, step, limit int) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3Ticker(symbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3Tickers() (*CloudResponse, error)
- func (cloudClient *CloudClient) GetSpotV3Trade(symbol string, limit int) (*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, orderId string) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractCancelOrders(contractSymbol string) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostContractCancelPlanOrder(contractSymbol string, orderId string) (*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) PostContractTransfer(currency string, amount string, transferType string, recvWindow int) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostMarginSubmitOrder(order MarginOrder) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostSpotBatchOrders(orderParams []Order) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostSpotCancelOrder(symbol string, orderId string, clientOrderId string) (*CloudResponse, error)
- func (cloudClient *CloudClient) PostSpotCancelOrders(symbol string, side string) (*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 CloudResponse
- type CloudWS
- type CloudWSContract
- type Config
- type ContractOrder
- type ContractPlanOrder
- type HistoryApply
- type MarginAssetTransfer
- type MarginOrder
- type Msg
- type OpParam
- type Order
- type RateLimit
- type RespMsg
- type WithdrawApply
Constants ¶
const ( API_URL_PRO = "https://api-cloud.bitmart.com" // rest api url WS_URL = "wss://ws-manager-compress.bitmart.com/api?protocol=1.1" // spot-ws-public WS_URL_USER = "wss://ws-manager-compress.bitmart.com/user?protocol=1.1" // spot-ws-private CONTRACT_WS_URL = "wss://openapi-ws.bitmart.com/api?protocol=1.1" // contract-ws-public CONTRACT_WS_PRIVATE_URL = "wss://openapi-ws.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.0.1" APPLICATION_JSON = "application/json" APPLICATION_JSON_UTF8 = "application/json; charset=UTF-8" GET = "GET" POST = "POST" DELETE = "DELETE" // System Status Endpoints: https://developer-pro.bitmart.com/en/spot/#system-status API_SYSTEM_TIME_URL = "/system/time" API_SYSTEM_SERVICE_URL = "/system/service" // 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" // 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_TICKER_URL = "/spot/v2/ticker" API_SPOT_TICKER_DETAIL_URL = "/spot/v1/ticker_detail" API_SPOT_STEPS_URL = "/spot/v1/steps" API_SPOT_SYMBOLS_KLINE_URL = "/spot/v1/symbols/kline" API_SPOT_SYMBOLS_BOOK_URL = "/spot/v1/symbols/book" API_SPOT_SYMBOLS_TRADES_URL = "/spot/v1/symbols/trades" 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" // 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/v2/batch_orders" API_SPOT_CANCEL_ORDER_URL = "/spot/v3/cancel_order" API_SPOT_CANCEL_ORDERS_URL = "/spot/v1/cancel_orders" 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_KLINE_URL = "/contract/public/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_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_POSITION_URL = "/contract/private/position" 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_TRANSFER_URL = "/account/v1/transfer-contract" API_CONTRACT_SUBMIT_LEVERAGE_URL = "/contract/private/submit-leverage" // 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" )
Variables ¶
This section is empty.
Functions ¶
func CreateChannel ¶
CreateChannel create channel
func CreateQueryString ¶
CreateQueryString create query string
func CreateSubscribeParam ¶
CreateSubscribeParam create subscribe param
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 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) 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) GetContractKline ¶
func (cloudClient *CloudClient) GetContractKline(contractSymbol string, from, to, step int) (*CloudResponse, error)
GetContractKline kline /** Get 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(contractSymbol string, orderType string, orderState string, limit int) (*CloudResponse, error)
GetContractOpenOrders open orders /** Get All Open Orders (KEYED)
func (*CloudClient) GetContractOrder ¶
func (cloudClient *CloudClient) GetContractOrder(contractSymbol string, orderId string) (*CloudResponse, error)
GetContractOrder order /** Get Order Detail (KEYED)
func (*CloudClient) GetContractOrderHistory ¶
func (cloudClient *CloudClient) GetContractOrderHistory(contractSymbol string, from, to int) (*CloudResponse, error)
GetContractOrderHistory order-history /** Get Order History (KEYED)
func (*CloudClient) GetContractPosition ¶
func (cloudClient *CloudClient) GetContractPosition(contractSymbol string) (*CloudResponse, error)
GetContractPosition position /** Get Current Position (KEYED)
func (*CloudClient) GetContractTrades ¶
func (cloudClient *CloudClient) GetContractTrades(contractSymbol string, from, to int) (*CloudResponse, error)
GetContractTrades trades /** Get Order Trade (KEYED)
func (*CloudClient) GetContractTransferList ¶
func (cloudClient *CloudClient) GetContractTransferList(contractSymbol string, timeStart, timeEnd int64, page, limit, recvWindow int) (*CloudResponse, error)
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(history HistoryApply) (*CloudResponse, error)
GetDepositWithdrawHistory /** Get Deposit And Withdraw History (KEYED)
func (*CloudClient) GetMarginAccountDetailsIsolated ¶
func (cloudClient *CloudClient) GetMarginAccountDetailsIsolated(symbol string) (*CloudResponse, error)
GetMarginAccountDetailsIsolated /** Get Margin Account Details(Isolated) (KEYED)
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(currency string) (*CloudResponse, error)
GetSpotAccountWallet /** Get Account Balance (KEYED)
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) GetSpotSteps
deprecated
func (cloudClient *CloudClient) GetSpotSteps() (*CloudResponse, error)
Deprecated: k-line step, value [1, 3, 5, 15, 30, 45, 60, 120, 180, 240, 1440, 10080, 43200] GetSpotSteps /** Get K-Line Step (V1)
func (*CloudClient) GetSpotSymbol ¶
func (cloudClient *CloudClient) GetSpotSymbol() (*CloudResponse, error)
GetSpotSymbol /** Get List of Trading Pairs (v1)
func (*CloudClient) GetSpotSymbolBook
deprecated
func (cloudClient *CloudClient) GetSpotSymbolBook(symbol string, precision int, size int) (*CloudResponse, error)
Deprecated: Use `GetSpotV3Book` instead. GetSpotSymbolBook /** Get Depth (V1)
func (*CloudClient) GetSpotSymbolDetail ¶
func (cloudClient *CloudClient) GetSpotSymbolDetail() (*CloudResponse, error)
GetSpotSymbolDetail /** Get List of Trading Pair Details (v1)
func (*CloudClient) GetSpotSymbolKline
deprecated
func (cloudClient *CloudClient) GetSpotSymbolKline(symbol string, from int64, to int64, step int) (*CloudResponse, error)
Deprecated: Use `GetSpotV3LatestKline` or `GetSpotV3HistoryKline` instead. GetSpotSymbolKline /** Get K-Line (V1)
func (*CloudClient) GetSpotSymbolTrade
deprecated
func (cloudClient *CloudClient) GetSpotSymbolTrade(symbol string) (*CloudResponse, error)
Deprecated: Use `GetSpotV3Trade` instead. GetSpotSymbolTrade /** Get Recent Trades (V1)
func (*CloudClient) GetSpotTicker
deprecated
func (cloudClient *CloudClient) GetSpotTicker() (*CloudResponse, error)
Deprecated: Use `GetSpotV3Tickers` instead. GetSpotTicker /** Get Ticker of All Pairs (V2)
func (*CloudClient) GetSpotTickerDetail
deprecated
func (cloudClient *CloudClient) GetSpotTickerDetail(symbol string) (*CloudResponse, error)
Deprecated: Use `GetSpotV3Ticker` instead. GetSpotTickerDetail /** Get Ticker of a Trading Pair (V1)
func (*CloudClient) GetSpotV3Book ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3Book(symbol string, limit int) (*CloudResponse, error)
GetSpotV3Book /** Get Depth (V3)
func (*CloudClient) GetSpotV3HistoryKline ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3HistoryKline(symbol string, before, after int64, step, limit int) (*CloudResponse, error)
GetSpotV3HistoryKline /** Get History K-Line (V3)
func (*CloudClient) GetSpotV3LatestKline ¶ added in v1.0.1
func (cloudClient *CloudClient) GetSpotV3LatestKline(symbol string, before, after int64, step, limit int) (*CloudResponse, error)
GetSpotV3LatestKline /** Get Latest K-Line (V3)
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, limit int) (*CloudResponse, error)
GetSpotV3Trade /** Get Recent Trades (V3)
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, orderId string) (*CloudResponse, error)
PostContractCancelOrder cancel-order /** Cancel Order (SIGNED)
func (*CloudClient) PostContractCancelOrders ¶
func (cloudClient *CloudClient) PostContractCancelOrders(contractSymbol string) (*CloudResponse, error)
PostContractCancelOrders cancel-orders /** Cancel All Orders (SIGNED)
func (*CloudClient) PostContractCancelPlanOrder ¶
func (cloudClient *CloudClient) PostContractCancelPlanOrder(contractSymbol string, orderId string) (*CloudResponse, error)
PostContractCancelPlanOrder cancel-plan-order /** Cancel Plan Order (SIGNED)
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)
func (*CloudClient) PostContractSubmitOrder ¶
func (cloudClient *CloudClient) PostContractSubmitOrder(order ContractOrder) (*CloudResponse, error)
PostContractSubmitOrder submit-order /** Submit Order (SIGNED)
func (*CloudClient) PostContractTransfer ¶
func (cloudClient *CloudClient) PostContractTransfer(currency string, amount string, transferType string, recvWindow int) (*CloudResponse, error)
PostContractTransfer transfer /** Transfer (SIGNED)
func (*CloudClient) PostMarginSubmitOrder ¶
func (cloudClient *CloudClient) PostMarginSubmitOrder(order MarginOrder) (*CloudResponse, error)
PostMarginSubmitOrder /** New Margin Order(v1) (SIGNED)
func (*CloudClient) PostSpotBatchOrders ¶
func (cloudClient *CloudClient) PostSpotBatchOrders(orderParams []Order) (*CloudResponse, error)
PostSpotBatchOrders /** Batch New Order(v2) (SIGNED)
func (*CloudClient) PostSpotCancelOrder ¶
func (cloudClient *CloudClient) PostSpotCancelOrder(symbol string, orderId string, clientOrderId string) (*CloudResponse, error)
PostSpotCancelOrder /** Cancel Order(v3) (SIGNED)
func (*CloudClient) PostSpotCancelOrders ¶
func (cloudClient *CloudClient) PostSpotCancelOrders(symbol string, side string) (*CloudResponse, error)
PostSpotCancelOrders /** Cancel Batch Order(v1) (SIGNED)
func (*CloudClient) PostSpotSubmitOrder ¶
func (cloudClient *CloudClient) PostSpotSubmitOrder(order Order) (*CloudResponse, error)
PostSpotSubmitOrder /** New Order(v2) (SIGNED)
type CloudResponse ¶
type CloudResponse struct {
// contains filtered or unexported fields
}
type CloudWS ¶
type CloudWS struct { Config Config Conn *websocket.Conn // contains filtered or unexported fields }
func (*CloudWS) Connection ¶
Connection to websocket
func (*CloudWS) SubscribeWithLogin ¶
SubscribeWithLogin Support public channel and private channel
func (*CloudWS) SubscribeWithoutLogin ¶
SubscribeWithoutLogin Only support public channel
type CloudWSContract ¶
type CloudWSContract struct {
CloudWS
}
func NewWSContract ¶
func NewWSContract(config Config) *CloudWSContract
func (*CloudWSContract) SubscribeWithLogin ¶
func (ws *CloudWSContract) SubscribeWithLogin(channels []string)
SubscribeWithLogin Support public channel and private channel
func (*CloudWSContract) SubscribeWithoutLogin ¶
func (ws *CloudWSContract) SubscribeWithoutLogin(channels []string)
SubscribeWithoutLogin Only support public channel
type ContractOrder ¶
type ContractOrder struct { Symbol string `json:"symbol"` ClientOrderId string `json:"client_order_id"` Type string `json:"type,omitempty"` Side int `json:"side"` Leverage string `json:"leverage"` OpenType string `json:"open_type"` Mode int `json:"mode"` Price string `json:"price"` Size int `json:"size"` }
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"` }
type HistoryApply ¶
type HistoryApply struct { Currency string `json:"currency"` OperationType string `json:"operation_type"` // type -deposit=deposit -withdraw=withdraw N int `json:"N"` }
HistoryApply Query Withdraw/Deposit History Parameters
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"` Size string `json:"size"` Price string `json:"price"` Notional string `json:"notional"` }
Order /** Spot Order Parameters