Versions in this module Expand all Collapse all v1 v1.0.1 Sep 8, 2023 Changes in this version + const API_CONTRACT_OPEN_ORDERS_URL + const API_CONTRACT_SUBMIT_LEVERAGE_URL + const API_SPOT_V3_BOOKS_URL + const API_SPOT_V3_HISTORY_KLINE_URL + const API_SPOT_V3_LATEST_KLINE_URL + const API_SPOT_V3_TICKERS_URL + const API_SPOT_V3_TICKER_URL + const API_SPOT_V3_TRADES_URL type CloudClient + func (cloudClient *CloudClient) GetContractOpenOrders(contractSymbol string, orderType string, orderState string, limit int) (*CloudResponse, error) + 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) PostContractSubmitLeverage(contractSymbol string, leverage string, openType string) (*CloudResponse, error) v1.0.0 Jun 9, 2023 Changes in this version + const ACCEPT + const API_ACCOUNT_CURRENCIES_URL + const API_ACCOUNT_DEPOSIT_ADDRESS_URL + const API_ACCOUNT_DEPOSIT_WITHDRAW_DETAIL_URL + const API_ACCOUNT_DEPOSIT_WITHDRAW_HISTORY_URL + const API_ACCOUNT_WALLET_URL + const API_ACCOUNT_WITHDRAW_APPLY_URL + const API_ACCOUNT_WITHDRAW_CHARGE_URL + const API_BORROW_ROCORD_ISOLATED_URL + const API_BROKER_REBATE_URL + const API_CONTRACT_ASSETS_DETAIL_URL + const API_CONTRACT_CANCEL_ORDERS_URL + const API_CONTRACT_CANCEL_ORDER_URL + const API_CONTRACT_CANCEL_PLAN_ORDER_URL + const API_CONTRACT_DEPTH_URL + const API_CONTRACT_DETAILS_URL + const API_CONTRACT_FUNDING_RATE_URL + const API_CONTRACT_KLINE_URL + const API_CONTRACT_OPEN_INTEREST_URL + const API_CONTRACT_ORDER_HISTORY_URL + const API_CONTRACT_ORDER_URL + const API_CONTRACT_POSITION_URL + const API_CONTRACT_SUBMIT_ORDER_URL + const API_CONTRACT_SUBMIT_PLAN_ORDER_URL + const API_CONTRACT_TRADES_URL + const API_CONTRACT_TRANSFER_LIST_URL + const API_CONTRACT_TRANSFER_URL + const API_MARGIN_BORROW_ISOLATED_URL + const API_MARGIN_REPAY_ISOLATED_URL + const API_REPAYMENT_ROCORD_ISOLATED_URL + const API_SPOT_BATCH_ORDERS_URL + const API_SPOT_CANCEL_ORDERS_URL + const API_SPOT_CANCEL_ORDER_URL + const API_SPOT_CURRENCIES_URL + const API_SPOT_MARGIN_ACCOUNT_ISOLATED_URL + const API_SPOT_MARGIN_ASSET_TRANSFER_URL + const API_SPOT_STEPS_URL + const API_SPOT_SUBMIT_MARGIN_ORDER_URL + const API_SPOT_SUBMIT_ORDER_URL + const API_SPOT_SYMBOLS_BOOK_URL + const API_SPOT_SYMBOLS_DETAILS_URL + const API_SPOT_SYMBOLS_KLINE_URL + const API_SPOT_SYMBOLS_TRADES_URL + const API_SPOT_SYMBOLS_URL + const API_SPOT_TICKER_DETAIL_URL + const API_SPOT_TICKER_URL + const API_SPOT_TRADE_FEE_URL + const API_SPOT_USER_FEE_URL + const API_SPOT_V4_QUERY_HISTORY_ORDERS_URL + const API_SPOT_V4_QUERY_OPEN_ORDERS_URL + const API_SPOT_V4_QUERY_ORDER_BY_CLIENT_URL + const API_SPOT_V4_QUERY_ORDER_BY_ID_URL + const API_SPOT_V4_QUERY_ORDER_TRADES_URL + const API_SPOT_V4_QUERY_TRADES_URL + const API_SPOT_WALLET_URL + const API_SYSTEM_SERVICE_URL + const API_SYSTEM_TIME_URL + const API_TRADING_PAIR_BORROWING_RATE_AND_AMOUNT + const API_URL_PRO + const APPLICATION_JSON + const APPLICATION_JSON_UTF8 + const CONTENT_TYPE + const CONTRACT_WS_PRIVATE_URL + const CONTRACT_WS_URL + const DELETE + const GET + const POST + const USER_AGENT + const VERSION + const WS_PUBLIC_CONTRACT_DEPTH20 + const WS_PUBLIC_CONTRACT_DEPTH5 + const WS_PUBLIC_CONTRACT_DEPTH50 + const WS_PUBLIC_CONTRACT_KLINE_15M + const WS_PUBLIC_CONTRACT_KLINE_1D + const WS_PUBLIC_CONTRACT_KLINE_1H + const WS_PUBLIC_CONTRACT_KLINE_1M + const WS_PUBLIC_CONTRACT_KLINE_1W + const WS_PUBLIC_CONTRACT_KLINE_2H + const WS_PUBLIC_CONTRACT_KLINE_30M + const WS_PUBLIC_CONTRACT_KLINE_4H + const WS_PUBLIC_CONTRACT_KLINE_5M + const WS_PUBLIC_CONTRACT_TICKER + const WS_PUBLIC_SPOT_DEPTH20 + const WS_PUBLIC_SPOT_DEPTH5 + const WS_PUBLIC_SPOT_DEPTH50 + const WS_PUBLIC_SPOT_KLINE_15M + const WS_PUBLIC_SPOT_KLINE_1D + const WS_PUBLIC_SPOT_KLINE_1H + const WS_PUBLIC_SPOT_KLINE_1M + const WS_PUBLIC_SPOT_KLINE_1MON + const WS_PUBLIC_SPOT_KLINE_1W + const WS_PUBLIC_SPOT_KLINE_2H + const WS_PUBLIC_SPOT_KLINE_30M + const WS_PUBLIC_SPOT_KLINE_3M + const WS_PUBLIC_SPOT_KLINE_4H + const WS_PUBLIC_SPOT_KLINE_5M + const WS_PUBLIC_SPOT_TICKER + const WS_PUBLIC_SPOT_TRADE + const WS_URL + const WS_URL_USER + const WS_USER_CONTRACT_ASSET + const WS_USER_CONTRACT_POSITION + const WS_USER_CONTRACT_UNICAST + const WS_USER_SPOT_ORDER + const X_BM_KEY + const X_BM_SIGN + const X_BM_TIMESTAMP + 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 struct + Code int + Message string + type Auth int + const KEYED + const NONE + const SIGNED + type Callback func(message string) + type CloudClient struct + Config Config + HttpClient *http.Client + func NewClient(config Config) *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) 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) + func (cloudClient *CloudClient) GetSpotSymbol() (*CloudResponse, error) + func (cloudClient *CloudClient) GetSpotSymbolBook(symbol string, precision int, size int) (*CloudResponse, error) + func (cloudClient *CloudClient) GetSpotSymbolDetail() (*CloudResponse, error) + func (cloudClient *CloudClient) GetSpotSymbolKline(symbol string, from int64, to int64, step int) (*CloudResponse, error) + func (cloudClient *CloudClient) GetSpotSymbolTrade(symbol string) (*CloudResponse, error) + func (cloudClient *CloudClient) GetSpotTicker() (*CloudResponse, error) + func (cloudClient *CloudClient) GetSpotTickerDetail(symbol string) (*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) 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 [1]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 struct + type CloudWS struct + Config Config + Conn *websocket.Conn + func NewWS(config Config) *CloudWS + func (ws *CloudWS) Connection(callback Callback) error + func (ws *CloudWS) SubscribeWithLogin(channels []string) + func (ws *CloudWS) SubscribeWithoutLogin(channels []string) + type CloudWSContract struct + func NewWSContract(config Config) *CloudWSContract + func (ws *CloudWSContract) SubscribeWithLogin(channels []string) + func (ws *CloudWSContract) SubscribeWithoutLogin(channels []string) + type Config struct + ApiKey string + IsPrint bool + Memo string + SecretKey string + TimeoutSecond int + Url string + WsUrl string + type ContractOrder struct + ClientOrderId string + Leverage string + Mode int + OpenType string + Price string + Side int + Size int + Symbol string + Type string + type ContractPlanOrder struct + ExecutivePrice string + Leverage string + Mode int + OpenType string + PriceType int + PriceWay int + Side int + Size int + Symbol string + TriggerPrice string + Type string + type HistoryApply struct + Currency string + N int + OperationType string + type MarginAssetTransfer struct + Amount string + Currency string + Side string + Symbol string + type MarginOrder struct + ClientOrderId string + Notional string + Price string + Side string + Size string + Symbol string + Type string + type Msg struct + Action string + Args []string + type OpParam struct + Args []string + Op string + type Order struct + ClientOrderId string + Notional string + Price string + Side string + Size string + Symbol string + Type string + type RateLimit struct + func GetLimit(response *CloudResponse) RateLimit + type RespMsg struct + Action string + Success bool + type WithdrawApply struct + Address string + AddressMemo string + Amount string + Currency string + Destination string v1.0.0-release Jun 9, 2023