Documentation ¶
Index ¶
- Constants
- func FillParams(symbol, side, orderType, tradeType string, startAt, endAt time.Time) url.Values
- func GetRateLimit() request.RateLimitDefinitions
- func IntervalToString(interval kline.Interval) (string, error)
- func MarginModeToString(mType margin.Type) string
- func OrderTypeToString(oType order.Type) (string, error)
- type APIKeyDetail
- type AccountBalance
- type AccountCurrencyInfo
- type AccountInfo
- type AccountLedgerResponse
- type AccountSummaryInformation
- type AssetInfo
- type AutoCancelHFOrderResponse
- type BorrowAndRepaymentOrderResp
- type BorrowOrder
- type BorrowOrderMatchItem
- type BorrowRepayDetailItem
- type BorrowRepayDetailResponse
- type CancelAllHFOrdersResponse
- type CancelOrderByNumberResponse
- type CancelOrderResponse
- type Chain
- type CompletedHFOrder
- type CompletedRepaymentRecord
- type ConnectionMessage
- type Contract
- type CrossMarginAccountDetail
- type CrossMarginRiskLimitCurrencyConfig
- type CrossMarginStatusAndAssets
- type Currency
- type CurrencyBase
- type CurrencyDetail
- type Decomposition
- type DeleteSubAccountResponse
- type Deposit
- type DepositAddress
- type DepositAddressParams
- type DepositResponse
- type EarnProduct
- type EarnRedeem
- type EarnRedemptionPreview
- type EarnSavingProduct
- type Error
- type ExchangeFundingAndLoanMargin
- type FailedHFOrderCancellationInfo
- type Fees
- type Fill
- type FilledMarginHFOrdersResponse
- type FixedIncomeEarnHoldings
- type FixedIncomeHolding
- type FundTransferFuturesParam
- type FundTransferInfo
- type FundTransferToFuturesParam
- type FundTransferToFuturesResponse
- type FundingHistoryItem
- type FundingInterestRateResponse
- type FutureFillsResponse
- type FutureOrdersResponse
- type FuturesAccount
- type FuturesAccountOverview
- type FuturesDepositDetail
- type FuturesDepositDetailsResponse
- type FuturesFill
- type FuturesFundingHistory
- type FuturesFundingHistoryResponse
- type FuturesFundingRate
- type FuturesIndex
- type FuturesIndexResponse
- type FuturesInterestRate
- type FuturesInterestRateResponse
- type FuturesKline
- type FuturesLedgerInfo
- type FuturesLedgerInfoDataItem
- type FuturesMarkPrice
- type FuturesMaxOpenPositionSize
- type FuturesOpenOrderStats
- type FuturesOrder
- type FuturesOrderParam
- type FuturesOrderRespItem
- type FuturesPosition
- type FuturesPositionDetail
- type FuturesPositionHistory
- type FuturesRiskLimitLevel
- type FuturesServiceStatus
- type FuturesSubAccountBalance
- type FuturesSubAccountBalanceDetail
- type FuturesTicker
- type FuturesTrade
- type FuturesTransactionHistory
- type FuturesTransactionHistoryResponse
- type FuturesTransferOutResponse
- type FuturesWithdrawalHistory
- type FuturesWithdrawalLimit
- type FuturesWithdrawalsListResponse
- type HFMarginOrderTrade
- type HFMarginOrderTransaction
- type HFOrderFills
- type HistoricalDepositWithdrawal
- type HistoricalDepositWithdrawalResponse
- type InnerTransferToMainAndTradeResponse
- type InstanceServer
- type InterestRate
- type IsolatedMarginAccountDetail
- type IsolatedMarginAccountInfo
- type IsolatedMarginAssetDetail
- type IsolatedMarginBorrowing
- type IsolatedMarginPairConfig
- type IsolatedMarginRiskLimitCurrencyConfig
- type Kline
- type Kucoin
- func (ku *Kucoin) AccountToTradeTypeString(a asset.Item, marginMode string) string
- func (ku *Kucoin) AddMargin(ctx context.Context, symbol, uniqueID string, margin float64) (*FuturesPosition, error)
- func (ku *Kucoin) ApplyWithdrawal(ctx context.Context, ccy currency.Code, ...) (string, error)
- func (ku *Kucoin) AutoCancelHFOrderSetting(ctx context.Context, timeout int64, symbols []string) (*AutoCancelHFOrderResponse, error)
- func (ku *Kucoin) AutoCancelHFOrderSettingQuery(ctx context.Context) (*AutoCancelHFOrderResponse, error)
- func (ku *Kucoin) CalculateAssets(topic string, cp currency.Pair) ([]asset.Item, error)
- func (ku *Kucoin) CancelAllFuturesStopOrders(ctx context.Context, symbol string) ([]string, error)
- func (ku *Kucoin) CancelAllHFOrders(ctx context.Context) (*CancelAllHFOrdersResponse, error)
- func (ku *Kucoin) CancelAllHFOrdersBySymbol(ctx context.Context, symbol string) (string, error)
- func (ku *Kucoin) CancelAllMarginHFOrdersBySymbol(ctx context.Context, symbol, tradeType string) (string, error)
- func (ku *Kucoin) CancelAllOpenOrders(ctx context.Context, symbol, tradeType string) ([]string, error)
- func (ku *Kucoin) CancelAllOrders(ctx context.Context, orderCancellation *order.Cancel) (order.CancelAllResponse, error)
- func (ku *Kucoin) CancelBatchOrders(_ context.Context, _ []order.Cancel) (*order.CancelBatchResponse, error)
- func (ku *Kucoin) CancelFuturesOrderByClientOrderID(ctx context.Context, symbol, clientOrderID string) ([]string, error)
- func (ku *Kucoin) CancelFuturesOrderByOrderID(ctx context.Context, orderID string) ([]string, error)
- func (ku *Kucoin) CancelHFOrder(ctx context.Context, orderID, symbol string) (string, error)
- func (ku *Kucoin) CancelHFOrderByClientOrderID(ctx context.Context, clientOrderID, symbol string) (string, error)
- func (ku *Kucoin) CancelMarginHFOrderByClientOrderID(ctx context.Context, clientOrderID, symbol string) (string, error)
- func (ku *Kucoin) CancelMarginHFOrderByID(ctx context.Context, id, symbol, path string) (string, error)
- func (ku *Kucoin) CancelMarginHFOrderByOrderID(ctx context.Context, orderID, symbol string) (string, error)
- func (ku *Kucoin) CancelMultipleFuturesLimitOrders(ctx context.Context, symbol string) ([]string, error)
- func (ku *Kucoin) CancelOCOMultipleOrders(ctx context.Context, orderIDs []string, symbol string) (*OCOOrderCancellationResponse, error)
- func (ku *Kucoin) CancelOCOOrderByClientOrderID(ctx context.Context, clientOrderID string) (*OCOOrderCancellationResponse, error)
- func (ku *Kucoin) CancelOCOOrderByID(ctx context.Context, path, id string) (*OCOOrderCancellationResponse, error)
- func (ku *Kucoin) CancelOCOOrderByOrderID(ctx context.Context, orderID string) (*OCOOrderCancellationResponse, error)
- func (ku *Kucoin) CancelOrder(ctx context.Context, ord *order.Cancel) error
- func (ku *Kucoin) CancelOrderByClientOID(ctx context.Context, orderID string) (*CancelOrderResponse, error)
- func (ku *Kucoin) CancelSingleOrder(ctx context.Context, orderID string) ([]string, error)
- func (ku *Kucoin) CancelSpecifiedNumberHFOrdersByOrderID(ctx context.Context, orderID, symbol string, cancelSize float64) (*CancelOrderByNumberResponse, error)
- func (ku *Kucoin) CancelStopOrder(ctx context.Context, orderID string) ([]string, error)
- func (ku *Kucoin) CancelStopOrderByClientID(ctx context.Context, symbol, clientOID string) (*CancelOrderResponse, error)
- func (ku *Kucoin) CancelStopOrderByClientOrderID(ctx context.Context, clientOrderID, symbol string) ([]string, error)
- func (ku *Kucoin) CancelStopOrders(ctx context.Context, symbol, tradeType string, orderIDs []string) ([]string, error)
- func (ku *Kucoin) CancelWithdrawal(ctx context.Context, withdrawalID string) error
- func (ku *Kucoin) ChangePositionMargin(ctx context.Context, r *margin.PositionChangeRequest) (*margin.PositionChangeResponse, error)
- func (ku *Kucoin) CreateDepositAddress(ctx context.Context, arg *DepositAddressParams) (*DepositAddress, error)
- func (ku *Kucoin) CreateFuturesSubAccountAPIKey(ctx context.Context, ...) (*APIKeyDetail, error)
- func (ku *Kucoin) CreateSpotAPIsForSubAccount(ctx context.Context, arg *SpotAPISubAccountParams) (*SpotAPISubAccount, error)
- func (ku *Kucoin) CreateSubUser(ctx context.Context, subAccountName, password, remarks, access string) (*SubAccount, error)
- func (ku *Kucoin) DeleteSubAccountSpotAPI(ctx context.Context, apiKey, subAccountName, passphrase string) (*DeleteSubAccountResponse, error)
- func (ku *Kucoin) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (ku *Kucoin) FetchOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (ku *Kucoin) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (ku *Kucoin) FetchTradablePairs(ctx context.Context, assetType asset.Item) (currency.Pairs, error)
- func (ku *Kucoin) FillFuturesPostOrderArgumentFilter(arg *FuturesOrderParam) error
- func (ku *Kucoin) FlushAndCleanup(p currency.Pair, assetType asset.Item)
- func (ku *Kucoin) FuturesUpdateRiskLmitLevel(ctx context.Context, symbol string, level int64) (bool, error)
- func (ku *Kucoin) Get24HourFuturesTransactionVolume(ctx context.Context) (*TransactionVolume, error)
- func (ku *Kucoin) Get24hrStats(ctx context.Context, symbol string) (*Stats24hrs, error)
- func (ku *Kucoin) GetAccountDetail(ctx context.Context, accountID string) (*AccountInfo, error)
- func (ku *Kucoin) GetAccountFundingHistory(ctx context.Context) ([]exchange.FundingHistory, error)
- func (ku *Kucoin) GetAccountLedgerHFMargin(ctx context.Context, ccy currency.Code, direction, bizType string, ...) ([]LedgerInfo, error)
- func (ku *Kucoin) GetAccountLedgers(ctx context.Context, ccy currency.Code, direction, bizType string, ...) (*AccountLedgerResponse, error)
- func (ku *Kucoin) GetAccountLedgersHFTrade(ctx context.Context, ccy currency.Code, direction, bizType string, ...) ([]LedgerInfo, error)
- func (ku *Kucoin) GetAccountSummaryInformation(ctx context.Context) (*AccountSummaryInformation, error)
- func (ku *Kucoin) GetActiveHFOrderSymbols(ctx context.Context, tradeType string) (*MarginActiveSymbolDetail, error)
- func (ku *Kucoin) GetActiveHFOrders(ctx context.Context, symbol string) ([]OrderDetail, error)
- func (ku *Kucoin) GetActiveMarginHFOrders(ctx context.Context, symbol, tradeType string) ([]OrderDetail, error)
- func (ku *Kucoin) GetActiveOrders(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (ku *Kucoin) GetAffilateUserRebateInformation(ctx context.Context, date time.Time, offset string, maxCount int64) ([]UserRebateInfo, error)
- func (ku *Kucoin) GetAggregatedSubAccountBalance(ctx context.Context) ([]SubAccountInfo, error)
- func (ku *Kucoin) GetAllAccounts(ctx context.Context, ccy currency.Code, accountType string) ([]AccountInfo, error)
- func (ku *Kucoin) GetAllFuturesSubAccountBalances(ctx context.Context, ccy currency.Code) (*FuturesSubAccountBalance, error)
- func (ku *Kucoin) GetAllMarginTradingPairsMarkPrices(ctx context.Context) ([]MarkPrice, error)
- func (ku *Kucoin) GetAllSubAccountsBalanceV2(ctx context.Context) (*SubAccountsBalanceV2, error)
- func (ku *Kucoin) GetAllSubAccountsInfoV1(ctx context.Context) ([]SubAccount, error)
- func (ku *Kucoin) GetAllSubAccountsInfoV2(ctx context.Context, currentPage, pageSize int64) (*SubAccountV2Response, error)
- func (ku *Kucoin) GetAuthenticatedInstanceServers(ctx context.Context) (*WSInstanceServers, error)
- func (ku *Kucoin) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error)
- func (ku *Kucoin) GetBasicFee(ctx context.Context, currencyType string) (*Fees, error)
- func (ku *Kucoin) GetCollateralMode(_ context.Context, _ asset.Item) (collateral.Mode, error)
- func (ku *Kucoin) GetCrossIsolatedMarginInterestRecords(ctx context.Context, isIsolated bool, symbol string, ccy currency.Code, ...) (*MarginInterestRecords, error)
- func (ku *Kucoin) GetCrossMarginAccountsDetail(ctx context.Context, quoteCurrency, queryType string) (*CrossMarginAccountDetail, error)
- func (ku *Kucoin) GetCrossMarginRiskLimitCurrencyConfig(ctx context.Context, symbol string, ccy currency.Code) ([]CrossMarginRiskLimitCurrencyConfig, error)
- func (ku *Kucoin) GetCurrenciesV3(ctx context.Context) ([]CurrencyDetail, error)
- func (ku *Kucoin) GetCurrencyDetailV3(ctx context.Context, ccy currency.Code, chain string) (*CurrencyDetail, error)
- func (ku *Kucoin) GetCurrencyTradeURL(_ context.Context, a asset.Item, cp currency.Pair) (string, error)
- func (ku *Kucoin) GetCurrentServerTime(ctx context.Context) (time.Time, error)
- func (ku *Kucoin) GetDepositAddress(ctx context.Context, c currency.Code, _, chain string) (*deposit.Address, error)
- func (ku *Kucoin) GetDepositAddressV1(ctx context.Context, ccy currency.Code, chain string) (*DepositAddress, error)
- func (ku *Kucoin) GetDepositAddressesV2(ctx context.Context, ccy currency.Code) ([]DepositAddress, error)
- func (ku *Kucoin) GetDepositList(ctx context.Context, ccy currency.Code, status string, ...) (*DepositResponse, error)
- func (ku *Kucoin) GetEarnETHStakingProducts(ctx context.Context) ([]EarnProduct, error)
- func (ku *Kucoin) GetEarnFixedIncomeCurrentHoldings(ctx context.Context, productID, productCategory string, ccy currency.Code, ...) (*FixedIncomeEarnHoldings, error)
- func (ku *Kucoin) GetEarnKCSStakingProducts(ctx context.Context, ccy currency.Code) ([]EarnProduct, error)
- func (ku *Kucoin) GetEarnRedeemPreviewByHoldingID(ctx context.Context, orderID, fromAccountType string) (*EarnRedemptionPreview, error)
- func (ku *Kucoin) GetEarnSavingsProducts(ctx context.Context, ccy currency.Code) ([]EarnSavingProduct, error)
- func (ku *Kucoin) GetEarnStakingProducts(ctx context.Context, ccy currency.Code) ([]EarnProduct, error)
- func (ku *Kucoin) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
- func (ku *Kucoin) GetFiatPrice(ctx context.Context, base, currencies string) (map[string]types.Number, error)
- func (ku *Kucoin) GetFilledHFMarginOrders(ctx context.Context, symbol, tradeType, side, orderType string, ...) (*FilledMarginHFOrdersResponse, error)
- func (ku *Kucoin) GetFills(ctx context.Context, orderID, symbol, side, orderType, tradeType string, ...) (*ListFills, error)
- func (ku *Kucoin) GetFuturesAccountDetail(ctx context.Context, ccy currency.Code) (*FuturesAccountOverview, error)
- func (ku *Kucoin) GetFuturesAccountLedgers(ctx context.Context, ccy currency.Code, forward bool, startAt, endAt time.Time, ...) (*FuturesLedgerInfo, error)
- func (ku *Kucoin) GetFuturesAccountOverview(ctx context.Context, ccy string) (*FuturesAccount, error)
- func (ku *Kucoin) GetFuturesContract(ctx context.Context, symbol string) (*Contract, error)
- func (ku *Kucoin) GetFuturesContractDetails(ctx context.Context, item asset.Item) ([]futures.Contract, error)
- func (ku *Kucoin) GetFuturesCurrentFundingRate(ctx context.Context, symbol string) (*FuturesFundingRate, error)
- func (ku *Kucoin) GetFuturesCurrentMarkPrice(ctx context.Context, symbol string) (*FuturesMarkPrice, error)
- func (ku *Kucoin) GetFuturesFills(ctx context.Context, orderID, symbol, side, orderType string, ...) (*FutureFillsResponse, error)
- func (ku *Kucoin) GetFuturesFundingHistory(ctx context.Context, symbol string, offset, maxCount int64, ...) (*FuturesFundingHistoryResponse, error)
- func (ku *Kucoin) GetFuturesIndexList(ctx context.Context, symbol string, startAt, endAt time.Time, ...) (*FuturesIndexResponse, error)
- func (ku *Kucoin) GetFuturesInterestRate(ctx context.Context, symbol string, startAt, endAt time.Time, ...) (*FundingInterestRateResponse, error)
- func (ku *Kucoin) GetFuturesKline(ctx context.Context, granularity int64, symbol string, from, to time.Time) ([]FuturesKline, error)
- func (ku *Kucoin) GetFuturesOpenContracts(ctx context.Context) ([]Contract, error)
- func (ku *Kucoin) GetFuturesOpenOrderStats(ctx context.Context, symbol string) (*FuturesOpenOrderStats, error)
- func (ku *Kucoin) GetFuturesOrderDetails(ctx context.Context, orderID, clientOrderID string) (*FuturesOrder, error)
- func (ku *Kucoin) GetFuturesOrderDetailsByClientOrderID(ctx context.Context, clientOrderID string) (*FuturesOrder, error)
- func (ku *Kucoin) GetFuturesOrderbook(ctx context.Context, symbol string) (*Orderbook, error)
- func (ku *Kucoin) GetFuturesOrders(ctx context.Context, status, symbol, side, orderType string, ...) (*FutureOrdersResponse, error)
- func (ku *Kucoin) GetFuturesPartOrderbook100(ctx context.Context, symbol string) (*Orderbook, error)
- func (ku *Kucoin) GetFuturesPartOrderbook20(ctx context.Context, symbol string) (*Orderbook, error)
- func (ku *Kucoin) GetFuturesPosition(ctx context.Context, symbol string) (*FuturesPosition, error)
- func (ku *Kucoin) GetFuturesPositionList(ctx context.Context) ([]FuturesPosition, error)
- func (ku *Kucoin) GetFuturesPositionOrders(ctx context.Context, r *futures.PositionsRequest) ([]futures.PositionResponse, error)
- func (ku *Kucoin) GetFuturesPositionSummary(ctx context.Context, r *futures.PositionSummaryRequest) (*futures.PositionSummary, error)
- func (ku *Kucoin) GetFuturesPremiumIndex(ctx context.Context, symbol string, startAt, endAt time.Time, ...) (*FuturesInterestRateResponse, error)
- func (ku *Kucoin) GetFuturesRecentCompletedOrders(ctx context.Context, symbol string) ([]FuturesOrder, error)
- func (ku *Kucoin) GetFuturesRecentFills(ctx context.Context) ([]FuturesFill, error)
- func (ku *Kucoin) GetFuturesRiskLimitLevel(ctx context.Context, symbol string) ([]FuturesRiskLimitLevel, error)
- func (ku *Kucoin) GetFuturesServerTime(ctx context.Context) (time.Time, error)
- func (ku *Kucoin) GetFuturesServiceStatus(ctx context.Context) (*FuturesServiceStatus, error)
- func (ku *Kucoin) GetFuturesTicker(ctx context.Context, symbol string) (*FuturesTicker, error)
- func (ku *Kucoin) GetFuturesTickers(ctx context.Context) ([]*ticker.Price, error)
- func (ku *Kucoin) GetFuturesTradeHistory(ctx context.Context, symbol string) ([]FuturesTrade, error)
- func (ku *Kucoin) GetFuturesTradingPairsActualFees(ctx context.Context, symbol string) (*TradingPairFee, error)
- func (ku *Kucoin) GetFuturesTransactionHistory(ctx context.Context, ccy currency.Code, txType string, offset, maxCount int64, ...) (*FuturesTransactionHistoryResponse, error)
- func (ku *Kucoin) GetFuturesTransferOutList(ctx context.Context, ccy currency.Code, status string, ...) (*TransferListsResponse, error)
- func (ku *Kucoin) GetFuturesTransferOutRequestRecords(ctx context.Context, startAt, endAt time.Time, status, queryStatus string, ...) (*FuturesTransferOutResponse, error)
- func (ku *Kucoin) GetHFCompletedOrderList(ctx context.Context, symbol, side, orderType, lastID string, ...) (*CompletedHFOrder, error)
- func (ku *Kucoin) GetHFFilledList(ctx context.Context, orderID, symbol, side, orderType, lastID string, ...) (*HFOrderFills, error)
- func (ku *Kucoin) GetHFOrderDetailsByClientOrderID(ctx context.Context, clientOrderID, symbol string) (*OrderDetail, error)
- func (ku *Kucoin) GetHFOrderDetailsByID(ctx context.Context, orderID, symbol, path string) (*OrderDetail, error)
- func (ku *Kucoin) GetHFOrderDetailsByOrderID(ctx context.Context, orderID, symbol string) (*OrderDetail, error)
- func (ku *Kucoin) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (ku *Kucoin) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, ...) (*kline.Item, error)
- func (ku *Kucoin) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
- func (ku *Kucoin) GetHistoricalDepositList(ctx context.Context, ccy currency.Code, status string, ...) (*HistoricalDepositWithdrawalResponse, error)
- func (ku *Kucoin) GetHistoricalFundingRates(ctx context.Context, r *fundingrate.HistoricalRatesRequest) (*fundingrate.HistoricalRates, error)
- func (ku *Kucoin) GetHistoricalWithdrawalList(ctx context.Context, ccy currency.Code, status string, ...) (*HistoricalDepositWithdrawalResponse, error)
- func (ku *Kucoin) GetInformationOnAccountInvolvedInOffExchangeLoans(ctx context.Context) ([]VIPLendingAccounts, error)
- func (ku *Kucoin) GetInformationOnOffExchangeFundingAndLoans(ctx context.Context) (*OffExchangeFundingAndLoan, error)
- func (ku *Kucoin) GetInstanceServers(ctx context.Context) (*WSInstanceServers, error)
- func (ku *Kucoin) GetInterestRate(ctx context.Context, ccy currency.Code) ([]InterestRate, error)
- func (ku *Kucoin) GetIsolatedMarginAccountDetail(ctx context.Context, symbol, queryCurrency, queryType string) (*IsolatedMarginAccountDetail, error)
- func (ku *Kucoin) GetIsolatedMarginAccountInfo(ctx context.Context, balanceCurrency string) (*IsolatedMarginAccountInfo, error)
- func (ku *Kucoin) GetIsolatedMarginPairConfig(ctx context.Context) ([]IsolatedMarginPairConfig, error)
- func (ku *Kucoin) GetIsolatedMarginRiskLimitCurrencyConfig(ctx context.Context, symbol string, ccy currency.Code) ([]IsolatedMarginRiskLimitCurrencyConfig, error)
- func (ku *Kucoin) GetKlines(ctx context.Context, symbol, period string, start, end time.Time) ([]Kline, error)
- func (ku *Kucoin) GetLatestFundingRates(ctx context.Context, r *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
- func (ku *Kucoin) GetLatestTickersForAllContracts(ctx context.Context) ([]WsFuturesTicker, error)
- func (ku *Kucoin) GetLendingCurrencyInformation(ctx context.Context, ccy currency.Code) ([]LendingCurrencyInfo, error)
- func (ku *Kucoin) GetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ order.Side) (float64, error)
- func (ku *Kucoin) GetLeveragedTokenInfo(ctx context.Context, ccy currency.Code) ([]LeveragedTokenInfo, error)
- func (ku *Kucoin) GetLimitedTimePromotionProducts(ctx context.Context, ccy currency.Code) ([]EarnProduct, error)
- func (ku *Kucoin) GetMarginAccount(ctx context.Context) (*MarginAccounts, error)
- func (ku *Kucoin) GetMarginBorrowingHistory(ctx context.Context, ccy currency.Code, isIsolated bool, ...) (*BorrowRepayDetailResponse, error)
- func (ku *Kucoin) GetMarginConfiguration(ctx context.Context) (*MarginConfiguration, error)
- func (ku *Kucoin) GetMarginHFOrderDetailByClientOrderID(ctx context.Context, clientOrderID, symbol string) (*OrderDetail, error)
- func (ku *Kucoin) GetMarginHFOrderDetailByID(ctx context.Context, orderID, symbol, path string) (*OrderDetail, error)
- func (ku *Kucoin) GetMarginHFOrderDetailByOrderID(ctx context.Context, orderID, symbol string) (*OrderDetail, error)
- func (ku *Kucoin) GetMarginHFTradeFills(ctx context.Context, orderID, symbol, tradeType, side, orderType string, ...) (*HFMarginOrderTransaction, error)
- func (ku *Kucoin) GetMarginPairsConfigurations(ctx context.Context, symbol string) (*MarginPairConfigs, error)
- func (ku *Kucoin) GetMarkPrice(ctx context.Context, symbol string) (*MarkPrice, error)
- func (ku *Kucoin) GetMarketList(ctx context.Context) ([]string, error)
- func (ku *Kucoin) GetMaxWithdrawMargin(ctx context.Context, symbol string) (float64, error)
- func (ku *Kucoin) GetMaximumOpenPositionSize(ctx context.Context, symbol string, price float64, leverage int64) (*FuturesMaxOpenPositionSize, error)
- func (ku *Kucoin) GetOCOOrderDetailsByOrderID(ctx context.Context, orderID string) (*OCOOrderDetail, error)
- func (ku *Kucoin) GetOCOOrderInfoByClientOrderID(ctx context.Context, clientOrderID string) (*OCOOrderInfo, error)
- func (ku *Kucoin) GetOCOOrderInfoByID(ctx context.Context, id, path string) (*OCOOrderInfo, error)
- func (ku *Kucoin) GetOCOOrderInfoByOrderID(ctx context.Context, orderID string) (*OCOOrderInfo, error)
- func (ku *Kucoin) GetOCOOrderList(ctx context.Context, pageSize, currentPage int64, symbol string, ...) (*OCOOrders, error)
- func (ku *Kucoin) GetOpenInterest(ctx context.Context, k ...key.PairAsset) ([]futures.OpenInterest, error)
- func (ku *Kucoin) GetOrderByClientSuppliedOrderID(ctx context.Context, clientOID string) (*OrderDetail, error)
- func (ku *Kucoin) GetOrderByID(ctx context.Context, orderID string) (*OrderDetail, error)
- func (ku *Kucoin) GetOrderHistory(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error)
- func (ku *Kucoin) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (*order.Detail, error)
- func (ku *Kucoin) GetOrderbook(ctx context.Context, symbol string) (*Orderbook, error)
- func (ku *Kucoin) GetPaginatedListOfSubAccounts(ctx context.Context, currentPage, pageSize int64) (*SubAccountResponse, error)
- func (ku *Kucoin) GetPaginatedSubAccountInformation(ctx context.Context, currentPage, pageSize int64) ([]SubAccountInfo, error)
- func (ku *Kucoin) GetPartOrderbook100(ctx context.Context, symbol string) (*Orderbook, error)
- func (ku *Kucoin) GetPartOrderbook20(ctx context.Context, symbol string) (*Orderbook, error)
- func (ku *Kucoin) GetPositionHistory(ctx context.Context, symbol string, from, to time.Time, limit, pageID int64) (*FuturesPositionHistory, error)
- func (ku *Kucoin) GetPublicFundingRate(ctx context.Context, symbol string, from, to time.Time) ([]FundingHistoryItem, error)
- func (ku *Kucoin) GetRecentFills(ctx context.Context) ([]Fill, error)
- func (ku *Kucoin) GetRecentOrders(ctx context.Context) ([]OrderDetail, error)
- func (ku *Kucoin) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
- func (ku *Kucoin) GetRedemptionOrders(ctx context.Context, ccy currency.Code, status, redeemOrderNo string, ...) (*RedemptionOrdersResponse, error)
- func (ku *Kucoin) GetRepaymentHistory(ctx context.Context, ccy currency.Code, isIsolated bool, ...) (*BorrowRepayDetailResponse, error)
- func (ku *Kucoin) GetServerTime(ctx context.Context, a asset.Item) (time.Time, error)
- func (ku *Kucoin) GetServiceStatus(ctx context.Context) (*ServiceStatus, error)
- func (ku *Kucoin) GetSingleIsolatedMarginAccountInfo(ctx context.Context, symbol string) (*AssetInfo, error)
- func (ku *Kucoin) GetStopOrder(ctx context.Context, orderID string) (*StopOrder, error)
- func (ku *Kucoin) GetStopOrderByClientID(ctx context.Context, symbol, clientOID string) ([]StopOrder, error)
- func (ku *Kucoin) GetSubAccountSpotAPIList(ctx context.Context, subAccountName, apiKeys string) ([]SpotAPISubAccount, error)
- func (ku *Kucoin) GetSubAccounts(ctx context.Context, subUserID string, includeBaseAmount bool) (*SubAccounts, error)
- func (ku *Kucoin) GetSubscriptionOrders(ctx context.Context, ccy currency.Code, purchaseOrderNo, status string, ...) (*PurchaseSubscriptionOrdersResponse, error)
- func (ku *Kucoin) GetSubscriptionTemplate(_ *subscription.Subscription) (*template.Template, error)
- func (ku *Kucoin) GetSymbols(ctx context.Context, market string) ([]SymbolInfo, error)
- func (ku *Kucoin) GetSymbolsWithActiveHFOrderList(ctx context.Context) ([]string, error)
- func (ku *Kucoin) GetTicker(ctx context.Context, symbol string) (*Ticker, error)
- func (ku *Kucoin) GetTickers(ctx context.Context) (*TickersResponse, error)
- func (ku *Kucoin) GetTradeHistory(ctx context.Context, symbol string) ([]Trade, error)
- func (ku *Kucoin) GetTradingFee(ctx context.Context, pairs currency.Pairs) ([]Fees, error)
- func (ku *Kucoin) GetTradingPairActualFees(ctx context.Context, symbols []string) ([]TradingPairFee, error)
- func (ku *Kucoin) GetTransferableBalance(ctx context.Context, ccy currency.Code, accountType, tag string) (*TransferableBalanceInfo, error)
- func (ku *Kucoin) GetUniversalTransfer(ctx context.Context, arg *UniversalTransferParam) (string, error)
- func (ku *Kucoin) GetUntriggeredFuturesStopOrders(ctx context.Context, symbol, side, orderType string, startAt, endAt time.Time) (*FutureOrdersResponse, error)
- func (ku *Kucoin) GetUserInfoOfAllSubAccounts(ctx context.Context) (*SubAccountResponse, error)
- func (ku *Kucoin) GetWithdrawalList(ctx context.Context, ccy currency.Code, status string, ...) (*WithdrawalsResponse, error)
- func (ku *Kucoin) GetWithdrawalQuotas(ctx context.Context, ccy currency.Code, chain string) (*WithdrawalQuota, error)
- func (ku *Kucoin) GetWithdrawalsHistory(ctx context.Context, c currency.Code, assetType asset.Item) ([]exchange.WithdrawalHistory, error)
- func (ku *Kucoin) HFSpotPlaceOrder(ctx context.Context, arg *PlaceHFParam) (string, error)
- func (ku *Kucoin) HandlePostOrder(ctx context.Context, arg *SpotOrderParam, path string) (string, error)
- func (ku *Kucoin) IsPerpetualFutureCurrency(a asset.Item, cp currency.Pair) (bool, error)
- func (ku *Kucoin) ListOrders(ctx context.Context, status, symbol, side, orderType, tradeType string, ...) (*OrdersListResponse, error)
- func (ku *Kucoin) ListStopOrders(ctx context.Context, symbol, side, orderType, tradeType string, ...) (*StopOrderListResponse, error)
- func (ku *Kucoin) MakeInnerTransfer(ctx context.Context, amount float64, ccy currency.Code, ...) (string, error)
- func (ku *Kucoin) MarginLendingSubscription(ctx context.Context, ccy currency.Code, size, interestRate float64) (*OrderNumberResponse, error)
- func (ku *Kucoin) ModifyHFOrder(ctx context.Context, arg *ModifyHFOrderParam) (string, error)
- func (ku *Kucoin) ModifyLeverageMultiplier(ctx context.Context, symbol string, leverage int64, isIsolated bool) error
- func (ku *Kucoin) ModifyOrder(_ context.Context, _ *order.Modify) (*order.ModifyResponse, error)
- func (ku *Kucoin) ModifySubAccountSpotAPIs(ctx context.Context, arg *SpotAPISubAccountParams) (*SpotAPISubAccount, error)
- func (ku *Kucoin) ModifySubscriptionOrder(ctx context.Context, ccy currency.Code, purchaseOrderNo string, ...) (*ModifySubscriptionOrderResponse, error)
- func (ku *Kucoin) OrderSideString(side order.Side) (string, error)
- func (ku *Kucoin) PlaceMarginHFOrder(ctx context.Context, arg *PlaceMarginHFOrderParam) (*MarginHFOrderResponse, error)
- func (ku *Kucoin) PlaceMarginHFOrderTest(ctx context.Context, arg *PlaceMarginHFOrderParam) (*MarginHFOrderResponse, error)
- func (ku *Kucoin) PlaceMultipleFuturesOrders(ctx context.Context, args []FuturesOrderParam) ([]FuturesOrderRespItem, error)
- func (ku *Kucoin) PlaceMultipleOrders(ctx context.Context, args []PlaceHFParam) ([]PlaceOrderResp, error)
- func (ku *Kucoin) PlaceOCOOrder(ctx context.Context, arg *OCOOrderParams) (string, error)
- func (ku *Kucoin) PostBulkOrder(ctx context.Context, symbol string, orderList []OrderRequest) ([]PostBulkOrderResp, error)
- func (ku *Kucoin) PostFuturesOrder(ctx context.Context, arg *FuturesOrderParam) (string, error)
- func (ku *Kucoin) PostFuturesOrderTest(ctx context.Context, arg *FuturesOrderParam) (string, error)
- func (ku *Kucoin) PostMarginBorrowOrder(ctx context.Context, arg *MarginBorrowParam) (*BorrowAndRepaymentOrderResp, error)
- func (ku *Kucoin) PostMarginOrder(ctx context.Context, arg *MarginOrderParam) (*PostMarginOrderResp, error)
- func (ku *Kucoin) PostMarginOrderTest(ctx context.Context, arg *MarginOrderParam) (*PostMarginOrderResp, error)
- func (ku *Kucoin) PostOrder(ctx context.Context, arg *SpotOrderParam) (string, error)
- func (ku *Kucoin) PostOrderTest(ctx context.Context, arg *SpotOrderParam) (string, error)
- func (ku *Kucoin) PostRepayment(ctx context.Context, arg *RepayParam) (*BorrowAndRepaymentOrderResp, error)
- func (ku *Kucoin) PostStopOrder(ctx context.Context, ...) (string, error)
- func (ku *Kucoin) RedeemByEarnHoldingID(ctx context.Context, orderID, fromAccountType, confirmPunishRedeem string, ...) (*EarnRedeem, error)
- func (ku *Kucoin) Redemption(ctx context.Context, ccy currency.Code, size float64, purchaseOrderNo string) (*OrderNumberResponse, error)
- func (ku *Kucoin) RemoveMarginManually(ctx context.Context, arg *WithdrawMarginResponse) (*MarginRemovingResponse, error)
- func (ku *Kucoin) SeedLocalCache(ctx context.Context, p currency.Pair, assetType asset.Item) error
- func (ku *Kucoin) SeedLocalCacheWithBook(p currency.Pair, orderbookNew *Orderbook, assetType asset.Item) error
- func (ku *Kucoin) SendAuthHTTPRequest(ctx context.Context, ePath exchange.URL, epl request.EndpointLimit, ...) error
- func (ku *Kucoin) SendHTTPRequest(ctx context.Context, ePath exchange.URL, epl request.EndpointLimit, ...) error
- func (ku *Kucoin) SendPlaceMarginHFOrder(ctx context.Context, arg *PlaceMarginHFOrderParam, path string) (*MarginHFOrderResponse, error)
- func (ku *Kucoin) SendPostMarginOrder(ctx context.Context, arg *MarginOrderParam, path string) (*PostMarginOrderResp, error)
- func (ku *Kucoin) SendSpotHFPlaceOrder(ctx context.Context, arg *PlaceHFParam, path string) (string, error)
- func (ku *Kucoin) SendSyncCancelHFOrder(ctx context.Context, id, symbol, path string) (*SyncCancelHFOrderResp, error)
- func (ku *Kucoin) SetAutoDepositMargin(ctx context.Context, symbol string, status bool) (bool, error)
- func (ku *Kucoin) SetCollateralMode(_ context.Context, _ asset.Item, _ collateral.Mode) error
- func (ku *Kucoin) SetDefaults()
- func (ku *Kucoin) SetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ float64, ...) error
- func (ku *Kucoin) SetMarginType(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type) error
- func (ku *Kucoin) Setup(exch *config.Exchange) error
- func (ku *Kucoin) SpotPlaceHFOrderTest(ctx context.Context, arg *PlaceHFParam) (string, error)
- func (ku *Kucoin) StringToOrderStatus(status string) (order.Status, error)
- func (ku *Kucoin) SubmitOrder(ctx context.Context, s *order.Submit) (*order.SubmitResponse, error)
- func (ku *Kucoin) Subscribe(subscriptions subscription.List) error
- func (ku *Kucoin) SubscribeToEarnFixedIncomeProduct(ctx context.Context, productID, accountType string, amount float64) (*SusbcribeEarn, error)
- func (ku *Kucoin) SyncCancelHFOrder(ctx context.Context, orderID, symbol string) (*SyncCancelHFOrderResp, error)
- func (ku *Kucoin) SyncCancelHFOrderByClientOrderID(ctx context.Context, clientOrderID, symbol string) (*SyncCancelHFOrderResp, error)
- func (ku *Kucoin) SyncPlaceHFOrder(ctx context.Context, arg *PlaceHFParam) (*SyncPlaceHFOrderResp, error)
- func (ku *Kucoin) SyncPlaceMultipleHFOrders(ctx context.Context, args []PlaceHFParam) ([]SyncPlaceHFOrderResp, error)
- func (ku *Kucoin) SynchroniseWebsocketOrderbook()
- func (ku *Kucoin) TransferFundsToFuturesAccount(ctx context.Context, amount float64, ccy currency.Code, payAccountType string) error
- func (ku *Kucoin) TransferFuturesFundsToMainAccount(ctx context.Context, amount float64, ccy currency.Code, recAccountType string) (*TransferRes, error)
- func (ku *Kucoin) TransferMainToSubAccount(ctx context.Context, ccy currency.Code, amount float64, ...) (string, error)
- func (ku *Kucoin) TransferToFuturesAccount(ctx context.Context, arg *FundTransferToFuturesParam) (*FundTransferToFuturesResponse, error)
- func (ku *Kucoin) TransferToMainOrTradeAccount(ctx context.Context, arg *FundTransferFuturesParam) (*InnerTransferToMainAndTradeResponse, error)
- func (ku *Kucoin) Unsubscribe(subscriptions subscription.List) error
- func (ku *Kucoin) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
- func (ku *Kucoin) UpdateOrderExecutionLimits(ctx context.Context, a asset.Item) error
- func (ku *Kucoin) UpdateOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (ku *Kucoin) UpdateTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (ku *Kucoin) UpdateTickers(ctx context.Context, assetType asset.Item) error
- func (ku *Kucoin) UpdateTradablePairs(ctx context.Context, forceUpdate bool) error
- func (ku *Kucoin) ValidateAPICredentials(ctx context.Context, assetType asset.Item) error
- func (ku *Kucoin) ValidateCredentials(ctx context.Context, assetType asset.Item) error
- func (ku *Kucoin) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (ku *Kucoin) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (ku *Kucoin) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (ku *Kucoin) WsConnect() error
- type LedgerInfo
- type LendOrder
- type LendingCurrencyInfo
- type Level2Depth5Or20
- type LeveragedTokenInfo
- type ListFills
- type MarginAccount
- type MarginAccounts
- type MarginActiveSymbolDetail
- type MarginAssetDetail
- type MarginBorrowParam
- type MarginConfiguration
- type MarginHFOrderResponse
- type MarginInterestInfo
- type MarginInterestRecords
- type MarginOrderParam
- type MarginPairConfig
- type MarginPairConfigs
- type MarginRemovingResponse
- type MarginRiskLimit
- type MarkPrice
- type ModifyHFOrderParam
- type ModifySubscriptionOrderResponse
- type OCOOrderCancellationResponse
- type OCOOrderDetail
- type OCOOrderInfo
- type OCOOrderItem
- type OCOOrderParams
- type OCOOrders
- type OffExchangeFundingAndLoan
- type OffExchangeFundingAndLoanOrder
- type OrderDetail
- type OrderNumberResponse
- type OrderRequest
- type Orderbook
- type OrderbookChanges
- type OrdersListResponse
- type PlaceHFParam
- type PlaceMarginHFOrderParam
- type PlaceOrderParams
- type PlaceOrderResp
- type PostBulkOrderResp
- type PostMarginOrderResp
- type PurchaseSubscriptionOrdersResponse
- type PurchaseSubscriptionResponseItem
- type RedemptionOrder
- type RedemptionOrdersResponse
- type RepaidRecord
- type RepaidRecordsResponse
- type RepayParam
- type Response
- type ServiceStatus
- type SpotAPISubAccount
- type SpotAPISubAccountParams
- type SpotOrderParam
- type Stats24hrs
- type StopOrder
- type StopOrderListResponse
- type SubAccount
- type SubAccountBalanceDetail
- type SubAccountCreatedResponse
- type SubAccountCurrencyBalanceDetail
- type SubAccountInfo
- type SubAccountResponse
- type SubAccountV2Response
- type SubAccounts
- type SubAccountsBalanceV2
- type SubAccountsResponse
- type SusbcribeEarn
- type SymbolInfo
- type SyncCancelHFOrderResp
- type SyncPlaceHFOrderResp
- type Ticker
- type TickerInfo
- type TickerInfoBase
- type TickersResponse
- type Trade
- type TradingPairFee
- type TransactionVolume
- type Transfer
- type TransferBase
- type TransferListsResponse
- type TransferRes
- type TransferableBalanceInfo
- type UniversalTransferParam
- type UnmarshalTo
- type UserRebateInfo
- type VIPLendingAccounts
- type WSConnMessages
- type WSInstanceServers
- type WithdrawMarginResponse
- type Withdrawal
- type WithdrawalQuota
- type WithdrawalsResponse
- type WsAccountBalance
- type WsCandlestick
- type WsCandlestickData
- type WsDebtRatioChange
- type WsFundingRate
- type WsFuturesAvailableBalance
- type WsFuturesExecutionData
- type WsFuturesFundingBegin
- type WsFuturesKline
- type WsFuturesMarkPriceAndIndexPrice
- type WsFuturesMarkPricePositionChanges
- type WsFuturesOrderMarginEvent
- type WsFuturesOrderbookInfo
- type WsFuturesPosition
- type WsFuturesPositionFundingSettlement
- type WsFuturesTicker
- type WsFuturesTradeOrder
- type WsFuturesTransactionStatisticsTimeEvent
- type WsFuturesWithdrawalAmountAndTransferOutAmountEvent
- type WsMarginTradeOrderDoneEvent
- type WsMarginTradeOrderEntersEvent
- type WsOrderbook
- type WsOrderbookLevel5
- type WsOrderbookLevel5Response
- type WsPositionStatus
- type WsPriceIndicator
- type WsPushData
- type WsSnapshot
- type WsSnapshotDetail
- type WsStopOrder
- type WsStopOrderLifecycleEvent
- type WsSubscriptionInput
- type WsTicker
- type WsTrade
- type WsTradeOrder
Constants ¶
const ( SpotTradeType = "TRADE" IsolatedMarginTradeType = "MARGIN_ISOLATED_TRADE" CrossMarginTradeType = "MARGIN_TRADE" )
Trade type values for Spot, Isolated Margin, and Cross Margin accounts
Variables ¶
This section is empty.
Functions ¶
func FillParams ¶
FillParams fills request parameters for orders and order fills.
func GetRateLimit ¶
func GetRateLimit() request.RateLimitDefinitions
GetRateLimit returns a RateLimit instance, which implements the request.Limiter interface.
func IntervalToString ¶
IntervalToString returns a string from kline.Interval input.
func MarginModeToString ¶
MarginModeToString returns a string representation of a MarginMode
Types ¶
type APIKeyDetail ¶
type APIKeyDetail struct { SubName string `json:"subName"` Remark string `json:"remark"` APIKey string `json:"apiKey"` APISecret string `json:"apiSecret"` Passphrase string `json:"passphrase"` Permission string `json:"permission"` IPWhitelist string `json:"ipWhitelist"` CreateAt types.Time `json:"createdAt"` }
APIKeyDetail represents the API key detail
type AccountBalance ¶
type AccountBalance struct { Currency string `json:"currency"` Balance types.Number `json:"balance"` Available types.Number `json:"available"` Holds types.Number `json:"holds"` BaseCurrency string `json:"baseCurrency"` BaseCurrencyPrice types.Number `json:"baseCurrencyPrice"` BaseAmount types.Number `json:"baseAmount"` }
AccountBalance represents an account balance detail
type AccountCurrencyInfo ¶
type AccountCurrencyInfo struct { AccountInfo BaseCurrency string `json:"baseCurrency"` BaseCurrencyPrice float64 `json:"baseCurrencyPrice,string"` BaseAmount float64 `json:"baseAmount,string"` }
AccountCurrencyInfo represents main account detailed information
type AccountInfo ¶
type AccountInfo struct { ID string `json:"id"` Currency string `json:"currency"` AccountType string `json:"type"` // Account type:,main、trade、trade_hf、margin Balance types.Number `json:"balance"` Available types.Number `json:"available"` Holds types.Number `json:"holds"` }
AccountInfo represents account information
type AccountLedgerResponse ¶
type AccountLedgerResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []LedgerInfo `json:"items"` }
AccountLedgerResponse represents the account ledger response detailed information
type AccountSummaryInformation ¶
type AccountSummaryInformation struct { Level float64 `json:"level"` SubQuantity float64 `json:"subQuantity"` MaxSubQuantity float64 `json:"maxSubQuantity"` SpotSubQuantity float64 `json:"spotSubQuantity"` MarginSubQuantity float64 `json:"marginSubQuantity"` FuturesSubQuantity float64 `json:"futuresSubQuantity"` MaxSpotSubQuantity float64 `json:"maxSpotSubQuantity"` MaxMarginSubQuantity float64 `json:"maxMarginSubQuantity"` MaxFuturesSubQuantity float64 `json:"maxFuturesSubQuantity"` MaxDefaultSubQuantity float64 `json:"maxDefaultSubQuantity"` }
AccountSummaryInformation represents account summary information detail
type AssetInfo ¶
type AssetInfo struct { Symbol string `json:"symbol"` Status string `json:"status"` DebtRatio float64 `json:"debtRatio,string"` BaseAsset baseAsset `json:"baseAsset"` QuoteAsset baseAsset `json:"quoteAsset"` }
AssetInfo holds asset information for an instrument
type AutoCancelHFOrderResponse ¶
type AutoCancelHFOrderResponse struct { Timeout int64 `json:"timeout"` Symbols string `json:"symbols"` CurrentTime types.Time `json:"currentTime"` TriggerTime types.Time `json:"triggerTime"` }
AutoCancelHFOrderResponse represents an auto cancel HF order response
type BorrowAndRepaymentOrderResp ¶
type BorrowAndRepaymentOrderResp struct { OrderNo string `json:"orderNo"` ActualSize float64 `json:"actualSize"` Symbol string `json:"symbol"` Currency string `json:"currency"` Size types.Number `json:"size"` Principal types.Number `json:"principal"` Interest types.Number `json:"interest"` Status string `json:"status"` CreatedTime types.Time `json:"createdTime"` }
BorrowAndRepaymentOrderResp stores borrow order response
type BorrowOrder ¶
type BorrowOrder struct { OrderID string `json:"orderId"` Currency string `json:"currency"` Size float64 `json:"size,string"` Filled float64 `json:"filled"` MatchList []BorrowOrderMatchItem `json:"matchList"` Status string `json:"status"` }
BorrowOrder stores borrow order
type BorrowOrderMatchItem ¶
type BorrowOrderMatchItem struct { TradeID string `json:"tradeId"` Currency string `json:"currency"` DailyIntRate float64 `json:"dailyIntRate,string"` Size float64 `json:"size,string"` Term int64 `json:"term"` Timestamp types.Time `json:"timestamp"` }
BorrowOrderMatchItem represents a borrow order match item detail
type BorrowRepayDetailItem ¶
type BorrowRepayDetailItem struct { OrderNo string `json:"orderNo"` Symbol string `json:"symbol"` Currency string `json:"currency"` Size float64 `json:"size"` Principal types.Number `json:"principal"` Interest types.Number `json:"interest"` ActualSize float64 `json:"actualSize"` Status string `json:"status"` CreatedTime types.Time `json:"createdTime"` }
BorrowRepayDetailItem represents a borrow and repay order detail
type BorrowRepayDetailResponse ¶
type BorrowRepayDetailResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []BorrowRepayDetailItem `json:"items"` }
BorrowRepayDetailResponse a full response of borrow and repay order
type CancelAllHFOrdersResponse ¶
type CancelAllHFOrdersResponse struct { SucceedSymbols []string `json:"succeedSymbols"` FailedSymbols []FailedHFOrderCancellationInfo `json:"failedSymbols"` }
CancelAllHFOrdersResponse represents a response for cancelling all high-frequency orders
type CancelOrderByNumberResponse ¶
type CancelOrderByNumberResponse struct { OrderID string `json:"orderId"` CancelSize string `json:"cancelSize"` }
CancelOrderByNumberResponse represents response for canceling an order by number
type CancelOrderResponse ¶
type CancelOrderResponse struct { CancelledOrderID string `json:"cancelledOrderId"` ClientOID string `json:"clientOid"` Error }
CancelOrderResponse represents cancel order response model
type Chain ¶
type Chain struct { ChainName string `json:"chainName"` Confirms int64 `json:"confirms"` ContractAddress string `json:"contractAddress"` WithdrawalMinSize float64 `json:"withdrawalMinSize,string"` WithdrawalMinFee float64 `json:"withdrawalMinFee,string"` IsWithdrawEnabled bool `json:"isWithdrawEnabled"` IsDepositEnabled bool `json:"isDepositEnabled"` DepositMinSize any `json:"depositMinSize"` WithdrawFeeRate types.Number `json:"withdrawFeeRate"` PreConfirms int64 `json:"preConfirms"` ChainID string `json:"chainId"` }
Chain stores blockchain data
type CompletedHFOrder ¶
type CompletedHFOrder struct { LastID int64 `json:"lastId"` Items []OrderDetail `json:"items"` }
CompletedHFOrder represents a completed HF orders list
type CompletedRepaymentRecord ¶
type CompletedRepaymentRecord struct { RepayFinishAt types.Time `json:"repayFinishAt"` // contains filtered or unexported fields }
CompletedRepaymentRecord represents repayment records of isolated margin positions
type ConnectionMessage ¶
ConnectionMessage represents a connection and subscription status message
type Contract ¶
type Contract struct { Symbol string `json:"symbol"` RootSymbol string `json:"rootSymbol"` ContractType string `json:"type"` FirstOpenDate types.Time `json:"firstOpenDate"` ExpireDate types.Time `json:"expireDate"` SettleDate types.Time `json:"settleDate"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` SettleCurrency string `json:"settleCurrency"` MaxOrderQty float64 `json:"maxOrderQty"` MaxPrice float64 `json:"maxPrice"` LotSize float64 `json:"lotSize"` TickSize float64 `json:"tickSize"` IndexPriceTickSize float64 `json:"indexPriceTickSize"` Multiplier float64 `json:"multiplier"` InitialMargin float64 `json:"initialMargin"` MaintainMargin float64 `json:"maintainMargin"` MaxRiskLimit float64 `json:"maxRiskLimit"` MinRiskLimit float64 `json:"minRiskLimit"` RiskStep float64 `json:"riskStep"` MakerFeeRate float64 `json:"makerFeeRate"` TakerFeeRate float64 `json:"takerFeeRate"` TakerFixFee float64 `json:"takerFixFee"` MakerFixFee float64 `json:"makerFixFee"` SettlementFee float64 `json:"settlementFee"` IsDeleverage bool `json:"isDeleverage"` IsQuanto bool `json:"isQuanto"` IsInverse bool `json:"isInverse"` MarkMethod string `json:"markMethod"` FairMethod string `json:"fairMethod"` FundingBaseSymbol string `json:"fundingBaseSymbol"` FundingQuoteSymbol string `json:"fundingQuoteSymbol"` FundingRateSymbol string `json:"fundingRateSymbol"` IndexSymbol string `json:"indexSymbol"` SettlementSymbol string `json:"settlementSymbol"` Status string `json:"status"` FundingFeeRate float64 `json:"fundingFeeRate"` PredictedFundingFeeRate float64 `json:"predictedFundingFeeRate"` OpenInterest types.Number `json:"openInterest"` TurnoverOf24h float64 `json:"turnoverOf24h"` VolumeOf24h float64 `json:"volumeOf24h"` MarkPrice float64 `json:"markPrice"` IndexPrice float64 `json:"indexPrice"` LastTradePrice float64 `json:"lastTradePrice"` NextFundingRateTime int64 `json:"nextFundingRateTime"` MaxLeverage float64 `json:"maxLeverage"` SourceExchanges []string `json:"sourceExchanges"` PremiumsSymbol1M string `json:"premiumsSymbol1M"` PremiumsSymbol8H string `json:"premiumsSymbol8H"` FundingBaseSymbol1M string `json:"fundingBaseSymbol1M"` FundingQuoteSymbol1M string `json:"fundingQuoteSymbol1M"` LowPrice float64 `json:"lowPrice"` HighPrice float64 `json:"highPrice"` PriceChgPct float64 `json:"priceChgPct"` PriceChg float64 `json:"priceChg"` }
Contract store contract details
type CrossMarginAccountDetail ¶
type CrossMarginAccountDetail struct { Timestamp types.Time `json:"timestamp"` CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []CrossMarginStatusAndAssets `json:"items"` }
CrossMarginAccountDetail represents a cross-margin account details
type CrossMarginRiskLimitCurrencyConfig ¶
type CrossMarginRiskLimitCurrencyConfig struct { Timestamp types.Time `json:"timestamp"` Currency string `json:"currency"` BorrowMaxAmount types.Number `json:"borrowMaxAmount"` BuyMaxAmount types.Number `json:"buyMaxAmount"` HoldMaxAmount types.Number `json:"holdMaxAmount"` BorrowCoefficient string `json:"borrowCoefficient"` MarginCoefficient string `json:"marginCoefficient"` Precision float64 `json:"precision"` BorrowMinAmount types.Number `json:"borrowMinAmount"` BorrowMinUnit string `json:"borrowMinUnit"` BorrowEnabled bool `json:"borrowEnabled"` }
CrossMarginRiskLimitCurrencyConfig currency configuration of cross margin accounts
type CrossMarginStatusAndAssets ¶
type CrossMarginStatusAndAssets struct { TotalLiabilityOfQuoteCurrency string `json:"totalLiabilityOfQuoteCurrency"` TotalAssetOfQuoteCurrency string `json:"totalAssetOfQuoteCurrency"` DebtRatio types.Number `json:"debtRatio"` Status string `json:"status"` Assets []MarginAssetDetail `json:"assets"` }
CrossMarginStatusAndAssets represents a cross-margin status and assets with similar status
type Currency ¶
type Currency struct { CurrencyBase WithdrawalMinSize float64 `json:"withdrawalMinSize,string"` WithdrawalMinFee float64 `json:"withdrawalMinFee,string"` IsWithdrawEnabled bool `json:"isWithdrawEnabled"` IsDepositEnabled bool `json:"isDepositEnabled"` }
Currency stores currency data
type CurrencyBase ¶
type CurrencyBase struct { Currency string `json:"currency"` // a unique currency code that will never change Name string `json:"name"` // will change after renaming FullName string `json:"fullName"` Precision int64 `json:"precision"` Confirms int64 `json:"confirms"` ContractAddress string `json:"contractAddress"` IsMarginEnabled bool `json:"isMarginEnabled"` IsDebitEnabled bool `json:"isDebitEnabled"` }
CurrencyBase represents currency code response details
type CurrencyDetail ¶
type CurrencyDetail struct { CurrencyBase Chains []Chain `json:"chains"` }
CurrencyDetail stores currency details
type Decomposition ¶
type Decomposition struct { Exchange string `json:"exchange"` Price float64 `json:"price"` Weight float64 `json:"weight"` }
Decomposition stores decomposition data
type DeleteSubAccountResponse ¶
type DeleteSubAccountResponse struct { SubAccountName string `json:"subName"` APIKey string `json:"apiKey"` }
DeleteSubAccountResponse represents delete sub-account response
type Deposit ¶
type Deposit struct { Amount float64 `json:"amount,string"` Address string `json:"address"` Memo string `json:"memo"` Fee float64 `json:"fee,string"` Remark string `json:"remark"` CreatedAt types.Time `json:"createdAt"` UpdatedAt types.Time `json:"updatedAt"` Chain string `json:"chain"` // contains filtered or unexported fields }
Deposit represents deposit address and detail and timestamp information
type DepositAddress ¶
type DepositAddress struct { Address string `json:"address"` Memo string `json:"memo"` Chain string `json:"chain"` // TODO: to be removed if not used by other endpoints ContractAddress string `json:"contractAddress"` // missing in case of futures }
DepositAddress represents deposit address information for Spot and Margin trading
type DepositAddressParams ¶
type DepositAddressParams struct { Currency currency.Code `json:"currency"` Chain string `json:"chain,omitempty"` }
DepositAddressParams represents a deposit address creation parameters
type DepositResponse ¶
type DepositResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []Deposit `json:"items"` }
DepositResponse represents a detailed response for list of deposit
type EarnProduct ¶
type EarnProduct struct { ID string `json:"id"` Currency string `json:"currency"` Category string `json:"category"` Type string `json:"type"` Precision float64 `json:"precision"` ProductUpperLimit types.Number `json:"productUpperLimit"` UserUpperLimit types.Number `json:"userUpperLimit"` UserLowerLimit types.Number `json:"userLowerLimit"` RedeemPeriod int64 `json:"redeemPeriod"` LockStartTime types.Time `json:"lockStartTime"` LockEndTime types.Time `json:"lockEndTime"` ApplyStartTime types.Time `json:"applyStartTime"` ApplyEndTime types.Time `json:"applyEndTime"` ReturnRate types.Number `json:"returnRate"` IncomeCurrency string `json:"incomeCurrency"` EarlyRedeemSupported int64 `json:"earlyRedeemSupported"` ProductRemainAmount types.Number `json:"productRemainAmount"` Status string `json:"status"` RedeemType string `json:"redeemType"` IncomeReleaseType string `json:"incomeReleaseType"` InterestDate int64 `json:"interestDate"` Duration int64 `json:"duration"` NewUserOnly int64 `json:"newUserOnly"` }
EarnProduct represents a time-limited earn limited product item
type EarnRedeem ¶
type EarnRedeem struct { RedemptionOrderID string `json:"orderTxId"` DeliverTime types.Time `json:"deliverTime"` Status string `json:"status"` Amount types.Number `json:"amount"` }
EarnRedeem represents an earn redeem by holding id
type EarnRedemptionPreview ¶
type EarnRedemptionPreview struct { Currency string `json:"currency"` RedeemAmount types.Number `json:"redeemAmount"` PenaltyInterestAmount types.Number `json:"penaltyInterestAmount"` RedeemPeriod int64 `json:"redeemPeriod"` DeliverTime types.Time `json:"deliverTime"` ManualRedeemable bool `json:"manualRedeemable"` RedeemAll bool `json:"redeemAll"` }
EarnRedemptionPreview represents a redemption information of a holding
type EarnSavingProduct ¶
type EarnSavingProduct struct { ID string `json:"id"` Currency string `json:"currency"` Category string `json:"category"` Type string `json:"type"` Precision int64 `json:"precision"` ProductUpperLimit string `json:"productUpperLimit"` UserUpperLimit types.Number `json:"userUpperLimit"` UserLowerLimit types.Number `json:"userLowerLimit"` RedeemPeriod int64 `json:"redeemPeriod"` LockStartTime types.Time `json:"lockStartTime"` LockEndTime types.Time `json:"lockEndTime"` ApplyStartTime types.Time `json:"applyStartTime"` ApplyEndTime types.Time `json:"applyEndTime"` ReturnRate types.Number `json:"returnRate"` IncomeCurrency string `json:"incomeCurrency"` EarlyRedeemSupported int64 `json:"earlyRedeemSupported"` ProductRemainAmount types.Number `json:"productRemainAmount"` Status string `json:"status"` RedeemType string `json:"redeemType"` IncomeReleaseType string `json:"incomeReleaseType"` InterestDate int64 `json:"interestDate"` Duration int64 `json:"duration"` NewUserOnly int64 `json:"newUserOnly"` }
EarnSavingProduct represents a saving product instance
type ExchangeFundingAndLoanMargin ¶
type ExchangeFundingAndLoanMargin struct { MarginCcy string `json:"marginCcy"` MarginQty types.Number `json:"marginQty"` MarginFactor string `json:"marginFactor"` }
ExchangeFundingAndLoanMargin represents an exchange funding and loan margin
type FailedHFOrderCancellationInfo ¶
type FailedHFOrderCancellationInfo struct { Symbol string `json:"symbol"` Error string `json:"error"` }
FailedHFOrderCancellationInfo represents a failed order cancellation information
type Fees ¶
type Fees struct { Symbol string `json:"symbol"` TakerFeeRate float64 `json:"takerFeeRate,string"` MakerFeeRate float64 `json:"makerFeeRate,string"` }
Fees represents taker and maker fee information a symbol
type Fill ¶
type Fill struct { Symbol string `json:"symbol"` TradeID string `json:"tradeId"` OrderID string `json:"orderId"` CounterOrderID string `json:"counterOrderId"` Side string `json:"side"` Liquidity string `json:"liquidity"` ForceTaker bool `json:"forceTaker"` Price float64 `json:"price,string"` Size float64 `json:"size,string"` Funds float64 `json:"funds,string"` Fee float64 `json:"fee,string"` FeeRate float64 `json:"feeRate,string"` FeeCurrency string `json:"feeCurrency"` Stop string `json:"stop"` OrderType string `json:"type"` CreatedAt types.Time `json:"createdAt"` TradeType string `json:"tradeType"` // Used by HF orders ID int64 `json:"id"` }
Fill represents order fills for margin and spot orders
type FilledMarginHFOrdersResponse ¶
type FilledMarginHFOrdersResponse struct { LastID int64 `json:"lastId"` Items []OrderDetail `json:"items"` }
FilledMarginHFOrdersResponse represents a filled HF margin orders
type FixedIncomeEarnHoldings ¶
type FixedIncomeEarnHoldings struct { TotalNum int64 `json:"totalNum"` Items []FixedIncomeHolding `json:"items"` CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalPage int64 `json:"totalPage"` }
FixedIncomeEarnHoldings represents a fixed income earn holdings
type FixedIncomeHolding ¶
type FixedIncomeHolding struct { OrderID string `json:"orderId"` ProductID string `json:"productId"` ProductCategory string `json:"productCategory"` ProductType string `json:"productType"` Currency string `json:"currency"` IncomeCurrency string `json:"incomeCurrency"` ReturnRate types.Number `json:"returnRate"` HoldAmount types.Number `json:"holdAmount"` RedeemedAmount types.Number `json:"redeemedAmount"` RedeemingAmount types.Number `json:"redeemingAmount"` LockStartTime types.Time `json:"lockStartTime"` LockEndTime types.Time `json:"lockEndTime"` PurchaseTime types.Time `json:"purchaseTime"` RedeemPeriod int64 `json:"redeemPeriod"` Status string `json:"status"` EarlyRedeemSupported int64 `json:"earlyRedeemSupported"` }
FixedIncomeHolding represents a fixed income earn holding detail
type FundTransferFuturesParam ¶
type FundTransferFuturesParam struct { Amount float64 `json:"amount"` Currency currency.Code `json:"currency"` RecieveAccountType string `json:"recAccountType"` // possible values are: MAIN and TRADE }
FundTransferFuturesParam holds parameter values for internal transfer
type FundTransferInfo ¶
type FundTransferInfo struct { ApplyID string `json:"applyId"` Currency string `json:"currency"` RecRemark string `json:"recRemark"` RecSystem string `json:"recSystem"` Status string `json:"status"` Reason string `json:"reason"` Offset int64 `json:"offset"` Remark string `json:"remark"` Amount types.Number `json:"amount"` CreatedAt types.Time `json:"createdAt"` }
FundTransferInfo represents a fund transfer instance information
type FundTransferToFuturesParam ¶
type FundTransferToFuturesParam struct { Amount float64 `json:"amount"` Currency currency.Code `json:"currency"` PaymentAccountType string `json:"payAccountType"` // Payment account type, including MAIN,TRADE }
FundTransferToFuturesParam holds request parameters to transfer funds to futures account
type FundTransferToFuturesResponse ¶
type FundTransferToFuturesResponse struct { Code string `json:"code"` Message string `json:"msg"` Retry bool `json:"retry"` Success bool `json:"success"` }
FundTransferToFuturesResponse response struct after transferring fund to Futures account
type FundingHistoryItem ¶
type FundingHistoryItem struct { Symbol string `json:"symbol"` FundingRate float64 `json:"fundingRate"` Timepoint types.Time `json:"timepoint"` }
FundingHistoryItem represents funding history item
type FundingInterestRateResponse ¶
type FundingInterestRateResponse struct { List []FuturesInterestRate `json:"dataList"` HasMore bool `json:"hasMore"` }
FundingInterestRateResponse represents a funding interest rate list response information
type FutureFillsResponse ¶
type FutureFillsResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []FuturesFill `json:"items"` }
FutureFillsResponse represents a future fills list response detail
type FutureOrdersResponse ¶
type FutureOrdersResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []FuturesOrder `json:"items"` }
FutureOrdersResponse represents a future order response list detail
type FuturesAccount ¶
type FuturesAccount struct { AccountEquity float64 `json:"accountEquity"` // marginBalance + Unrealised PNL UnrealisedPNL float64 `json:"unrealisedPNL"` // unrealised profit and loss MarginBalance float64 `json:"marginBalance"` // positionMargin + orderMargin + frozenFunds + availableBalance - unrealisedPNL PositionMargin float64 `json:"positionMargin"` OrderMargin float64 `json:"orderMargin"` FrozenFunds float64 `json:"frozenFunds"` // frozen funds for withdrawal and out-transfer AvailableBalance float64 `json:"availableBalance"` Currency string `json:"currency"` }
FuturesAccount holds futures account detail information
type FuturesAccountOverview ¶
type FuturesAccountOverview struct { AccountEquity float64 `json:"accountEquity"` UnrealisedPNL float64 `json:"unrealisedPNL"` MarginBalance float64 `json:"marginBalance"` PositionMargin float64 `json:"positionMargin"` OrderMargin float64 `json:"orderMargin"` FrozenFunds float64 `json:"frozenFunds"` AvailableBalance float64 `json:"availableBalance"` Currency string `json:"currency"` }
FuturesAccountOverview represents a futures account detail
type FuturesDepositDetail ¶
type FuturesDepositDetail struct { Currency string `json:"currency"` Status string `json:"status"` Address string `json:"address"` IsInner bool `json:"isInner"` Amount float64 `json:"amount"` Fee float64 `json:"fee"` WalletTxID string `json:"walletTxId"` CreatedAt types.Time `json:"createdAt"` }
FuturesDepositDetail represents futures deposit detail information
type FuturesDepositDetailsResponse ¶
type FuturesDepositDetailsResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []FuturesDepositDetail `json:"items"` }
FuturesDepositDetailsResponse represents a futures deposits list detail response
type FuturesFill ¶
type FuturesFill struct { Symbol string `json:"symbol"` TradeID string `json:"tradeId"` OrderID string `json:"orderId"` Side string `json:"side"` Liquidity string `json:"liquidity"` ForceTaker bool `json:"forceTaker"` Price float64 `json:"price,string"` Size float64 `json:"size,string"` Value float64 `json:"value,string"` FeeRate float64 `json:"feeRate,string"` FixFee float64 `json:"fixFee,string"` FeeCurrency string `json:"feeCurrency"` Stop string `json:"stop"` Fee float64 `json:"fee,string"` OrderType string `json:"orderType"` TradeType string `json:"tradeType"` CreatedAt types.Time `json:"createdAt"` SettleCurrency string `json:"settleCurrency"` TradeTime types.Time `json:"tradeTime"` }
FuturesFill represents list of recent fills for futures orders
type FuturesFundingHistory ¶
type FuturesFundingHistory struct { ID string `json:"id"` Symbol string `json:"symbol"` Time types.Time `json:"timePoint"` FundingRate float64 `json:"fundingRate"` MarkPrice float64 `json:"markPrice"` PositionQty float64 `json:"positionQty"` PositionCost float64 `json:"positionCost"` Funding float64 `json:"funding"` SettleCurrency string `json:"settleCurrency"` }
FuturesFundingHistory represents futures funding information
type FuturesFundingHistoryResponse ¶
type FuturesFundingHistoryResponse struct { DataList []FuturesFundingHistory `json:"dataList"` HasMore bool `json:"hasMore"` }
FuturesFundingHistoryResponse represents funding history response for futures account
type FuturesFundingRate ¶
type FuturesFundingRate struct { FuturesInterestRate PredictedValue float64 `json:"predictedValue"` }
FuturesFundingRate stores funding rate data
type FuturesIndex ¶
type FuturesIndex struct { FuturesInterestRate DecompositionList []Decomposition `json:"decompositionList"` }
FuturesIndex stores index data
type FuturesIndexResponse ¶
type FuturesIndexResponse struct { List []FuturesIndex `json:"dataList"` HasMore bool `json:"hasMore"` }
FuturesIndexResponse represents a response data for futures indexes
type FuturesInterestRate ¶
type FuturesInterestRate struct { Symbol string `json:"symbol"` TimePoint types.Time `json:"timePoint"` Value float64 `json:"value"` Granularity int64 `json:"granularity"` }
FuturesInterestRate stores interest rate data
type FuturesInterestRateResponse ¶
type FuturesInterestRateResponse struct { List []FuturesInterestRate `json:"dataList"` HasMore bool `json:"hasMore"` }
FuturesInterestRateResponse represents a futures interest rate list response
type FuturesKline ¶
type FuturesKline struct { StartTime time.Time Open float64 Close float64 High float64 Low float64 Volume float64 }
FuturesKline stores kline data
type FuturesLedgerInfo ¶
type FuturesLedgerInfo struct { HasMore bool `json:"hasMore"` DataList []FuturesLedgerInfoDataItem `json:"dataList"` }
FuturesLedgerInfo represents account ledger information for futures trading
type FuturesLedgerInfoDataItem ¶
type FuturesLedgerInfoDataItem struct { Time types.Time `json:"time"` Type string `json:"type"` Amount float64 `json:"amount"` Fee float64 `json:"fee"` AccountEquity float64 `json:"accountEquity"` Status string `json:"status"` Remark string `json:"remark"` Offset int64 `json:"offset"` Currency string `json:"currency"` }
FuturesLedgerInfoDataItem represents a futures ledger info data item
type FuturesMarkPrice ¶
type FuturesMarkPrice struct { FuturesInterestRate IndexPrice float64 `json:"indexPrice"` }
FuturesMarkPrice stores mark price data
type FuturesMaxOpenPositionSize ¶
type FuturesMaxOpenPositionSize struct { Symbol string `json:"symbol"` MaxBuyOpenSize int64 `json:"maxBuyOpenSize"` MaxSellOpenSize int64 `json:"maxSellOpenSize"` }
FuturesMaxOpenPositionSize represents maximum buy/sell open positions an account could have.
type FuturesOpenOrderStats ¶
type FuturesOpenOrderStats struct { OpenOrderBuySize int64 `json:"openOrderBuySize"` OpenOrderSellSize int64 `json:"openOrderSellSize"` OpenOrderBuyCost float64 `json:"openOrderBuyCost,string"` OpenOrderSellCost float64 `json:"openOrderSellCost,string"` SettleCurrency string `json:"settleCurrency"` }
FuturesOpenOrderStats represents futures open order summary stats information
type FuturesOrder ¶
type FuturesOrder struct { ID string `json:"id"` Symbol string `json:"symbol"` OrderType string `json:"type"` Side string `json:"side"` Price float64 `json:"price,string"` Size float64 `json:"size"` Value float64 `json:"value,string"` DealValue float64 `json:"dealValue,string"` DealSize float64 `json:"dealSize"` Stp string `json:"stp"` Stop string `json:"stop"` StopPriceType string `json:"stopPriceType"` StopTriggered bool `json:"stopTriggered"` StopPrice float64 `json:"stopPrice,string"` TimeInForce string `json:"timeInForce"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` Iceberg bool `json:"iceberg"` Leverage float64 `json:"leverage,string"` ForceHold bool `json:"forceHold"` CloseOrder bool `json:"closeOrder"` VisibleSize float64 `json:"visibleSize"` ClientOid string `json:"clientOid"` Remark string `json:"remark"` Tags string `json:"tags"` IsActive bool `json:"isActive"` CancelExist bool `json:"cancelExist"` CreatedAt types.Time `json:"createdAt"` UpdatedAt types.Time `json:"updatedAt"` EndAt types.Time `json:"endAt"` OrderTime types.Time `json:"orderTime"` SettleCurrency string `json:"settleCurrency"` Status string `json:"status"` FilledValue float64 `json:"filledValue,string"` FilledSize float64 `json:"filledSize"` ReduceOnly bool `json:"reduceOnly"` }
FuturesOrder represents futures order information
type FuturesOrderParam ¶
type FuturesOrderParam struct { ClientOrderID string `json:"clientOid"` Side string `json:"side"` Symbol currency.Pair `json:"symbol"` Leverage float64 `json:"leverage,string"` Size float64 `json:"size,omitempty,string"` Price float64 `json:"price,string,omitempty"` OrderType string `json:"type"` Remark string `json:"remark,omitempty"` Stop string `json:"stop,omitempty"` // Either down or up. Requires stopPrice and stopPriceType to be defined StopPriceType string `json:"stopPriceType,omitempty"` // [optional] Either TP, IP or MP, Need to be defined if stop is specified. `TP` for trade price, `MP` for Mark price, and "IP" for index price StopPrice float64 `json:"stopPrice,omitempty,string"` ReduceOnly bool `json:"reduceOnly,omitempty"` CloseOrder bool `json:"closeOrder,omitempty"` ForceHold bool `json:"forceHold,omitempty"` SelfTradePrevention string `json:"stp,omitempty"` // self trade prevention, CN, CO, CB. Not supported DC at the moment TimeInForce string `json:"timeInForce,omitempty"` VisibleSize float64 `json:"visibleSize,omitempty,string"` // The maximum visible size of an iceberg order PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` Iceberg bool `json:"iceberg,omitempty"` }
FuturesOrderParam represents a query parameter for placing future oorder
type FuturesOrderRespItem ¶
type FuturesOrderRespItem struct { OrderID string `json:"orderId"` ClientOrderID string `json:"clientOid"` Symbol string `json:"symbol"` Code string `json:"code"` Msg string `json:"msg"` }
FuturesOrderRespItem represents a single futures order placing response in placing multiple orders
type FuturesPosition ¶
type FuturesPosition struct { ID string `json:"id"` Symbol string `json:"symbol"` AutoDeposit bool `json:"autoDeposit"` MaintMarginReq float64 `json:"maintMarginReq"` RiskLimit int64 `json:"riskLimit"` RealLeverage float64 `json:"realLeverage"` CrossMode bool `json:"crossMode"` ADLRankingPercentile float64 `json:"delevPercentage"` OpeningTimestamp types.Time `json:"openingTimestamp"` CurrentTimestamp types.Time `json:"currentTimestamp"` CurrentQty float64 `json:"currentQty"` CurrentCost float64 `json:"currentCost"` // Current position value CurrentComm float64 `json:"currentComm"` // Current commission UnrealisedCost float64 `json:"unrealisedCost"` RealisedGrossCost float64 `json:"realisedGrossCost"` RealisedCost float64 `json:"realisedCost"` IsOpen bool `json:"isOpen"` MarkPrice float64 `json:"markPrice"` MarkValue float64 `json:"markValue"` PosCost float64 `json:"posCost"` // Position value PosCross float64 `json:"posCross"` // Added margin PosInit float64 `json:"posInit"` // Leverage margin PosComm float64 `json:"posComm"` // Bankruptcy cost PosLoss float64 `json:"posLoss"` // Funding fees paid out PosMargin float64 `json:"posMargin"` // Position margin PosMaint float64 `json:"posMaint"` // Maintenance margin MaintMargin float64 `json:"maintMargin"` RealisedGrossPnl float64 `json:"realisedGrossPnl"` RealisedPnl float64 `json:"realisedPnl"` UnrealisedPnl float64 `json:"unrealisedPnl"` UnrealisedPnlPcnt float64 `json:"unrealisedPnlPcnt"` UnrealisedRoePcnt float64 `json:"unrealisedRoePcnt"` AvgEntryPrice float64 `json:"avgEntryPrice"` LiquidationPrice float64 `json:"liquidationPrice"` BankruptPrice float64 `json:"bankruptPrice"` SettleCurrency string `json:"settleCurrency"` MaintainMargin float64 `json:"maintainMargin"` RiskLimitLevel int64 `json:"riskLimitLevel"` }
FuturesPosition represents futures position detailed information
type FuturesPositionDetail ¶
type FuturesPositionDetail struct { CloseID string `json:"closeId"` PositionID string `json:"positionId"` UID int64 `json:"uid"` UserID string `json:"userId"` Symbol string `json:"symbol"` SettleCurrency string `json:"settleCurrency"` Leverage types.Number `json:"leverage"` Type string `json:"type"` Side string `json:"side"` CloseSize types.Number `json:"closeSize"` PNL types.Number `json:"pnl"` RealisedGrossCost types.Number `json:"realisedGrossCost"` WithdrawPNL types.Number `json:"withdrawPnl"` ReturnOnEquityRate types.Number `json:"roe"` TradeFee types.Number `json:"tradeFee"` FundingFee types.Number `json:"fundingFee"` OpenTime types.Time `json:"openTime"` CloseTime types.Time `json:"closeTime"` OpenPrice types.Number `json:"openPrice"` ClosePrice types.Number `json:"closePrice"` }
FuturesPositionDetail represents a futures position detail
type FuturesPositionHistory ¶
type FuturesPositionHistory struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []FuturesPositionDetail `json:"items"` }
FuturesPositionHistory represents a position history of futures asset
type FuturesRiskLimitLevel ¶
type FuturesRiskLimitLevel struct { Symbol string `json:"symbol"` Level int64 `json:"level"` MaxRiskLimit float64 `json:"maxRiskLimit"` MinRiskLimit float64 `json:"minRiskLimit"` MaxLeverage float64 `json:"maxLeverage"` InitialMargin float64 `json:"initialMargin"` MaintainMargin float64 `json:"maintainMargin"` }
FuturesRiskLimitLevel represents futures risk limit level information
type FuturesServiceStatus ¶
FuturesServiceStatus represents service status
type FuturesSubAccountBalance ¶
type FuturesSubAccountBalance struct { Summary struct { AccountEquityTotal float64 `json:"accountEquityTotal"` UnrealisedPNLTotal float64 `json:"unrealisedPNLTotal"` MarginBalanceTotal float64 `json:"marginBalanceTotal"` PositionMarginTotal float64 `json:"positionMarginTotal"` OrderMarginTotal float64 `json:"orderMarginTotal"` FrozenFundsTotal float64 `json:"frozenFundsTotal"` AvailableBalanceTotal float64 `json:"availableBalanceTotal"` Currency string `json:"currency"` } `json:"summary"` Accounts []FuturesSubAccountBalanceDetail `json:"accounts"` }
FuturesSubAccountBalance represents a subaccount balances for futures trading
type FuturesSubAccountBalanceDetail ¶
type FuturesSubAccountBalanceDetail struct { AccountName string `json:"accountName"` AccountEquity float64 `json:"accountEquity"` UnrealisedPNL float64 `json:"unrealisedPNL"` MarginBalance float64 `json:"marginBalance"` PositionMargin float64 `json:"positionMargin"` OrderMargin float64 `json:"orderMargin"` FrozenFunds float64 `json:"frozenFunds"` AvailableBalance float64 `json:"availableBalance"` Currency string `json:"currency"` }
FuturesSubAccountBalanceDetail represents a futures sub-account balance detail
type FuturesTicker ¶
type FuturesTicker struct { Sequence int64 `json:"sequence"` Symbol string `json:"symbol"` Side order.Side `json:"side"` Size float64 `json:"size"` Price types.Number `json:"price"` BestBidSize float64 `json:"bestBidSize"` BestBidPrice types.Number `json:"bestBidPrice"` BestAskSize float64 `json:"bestAskSize"` BestAskPrice types.Number `json:"bestAskPrice"` TradeID string `json:"tradeId"` FilledTime types.Time `json:"ts"` }
FuturesTicker stores ticker data
type FuturesTrade ¶
type FuturesTrade struct { Sequence int64 `json:"sequence"` TradeID string `json:"tradeId"` TakerOrderID string `json:"takerOrderId"` MakerOrderID string `json:"makerOrderId"` Price float64 `json:"price,string"` Size float64 `json:"size"` Side string `json:"side"` FilledTime types.Time `json:"ts"` }
FuturesTrade stores trade data
type FuturesTransactionHistory ¶
type FuturesTransactionHistory struct { Time types.Time `json:"time"` Type string `json:"type"` Amount float64 `json:"amount"` Fee float64 `json:"fee"` AccountEquity float64 `json:"accountEquity"` Status string `json:"status"` Remark string `json:"remark"` Offset int64 `json:"offset"` Currency string `json:"currency"` }
FuturesTransactionHistory represents a transaction history
type FuturesTransactionHistoryResponse ¶
type FuturesTransactionHistoryResponse struct { List []FuturesTransactionHistory `json:"dataList"` HasMore bool `json:"hasMore"` }
FuturesTransactionHistoryResponse represents a futures transaction history response
type FuturesTransferOutResponse ¶
type FuturesTransferOutResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []FundTransferInfo `json:"items"` }
FuturesTransferOutResponse represents a list of transfer out instance
type FuturesWithdrawalHistory ¶
type FuturesWithdrawalHistory struct { WithdrawalID string `json:"withdrawalId"` Currency string `json:"currency"` Status string `json:"status"` Address string `json:"address"` Memo string `json:"memo"` IsInner bool `json:"isInner"` Amount float64 `json:"amount"` Fee float64 `json:"fee"` WalletTxID string `json:"walletTxId"` CreatedAt types.Time `json:"createdAt"` Remark string `json:"remark"` Reason string `json:"reason"` }
FuturesWithdrawalHistory represents a list of Futures withdrawal history
type FuturesWithdrawalLimit ¶
type FuturesWithdrawalLimit struct { Currency string `json:"currency"` ChainID string `json:"chainId"` LimitAmount float64 `json:"limitAmount"` UsedAmount float64 `json:"usedAmount"` RemainAmount float64 `json:"remainAmount"` AvailableAmount float64 `json:"availableAmount"` WithdrawMinFee float64 `json:"withdrawMinFee"` InnerWithdrawMinFee float64 `json:"innerWithdrawMinFee"` WithdrawMinSize float64 `json:"withdrawMinSize"` IsWithdrawEnabled bool `json:"isWithdrawEnabled"` Precision float64 `json:"precision"` }
FuturesWithdrawalLimit represents withdrawal limit information
type FuturesWithdrawalsListResponse ¶
type FuturesWithdrawalsListResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []FuturesWithdrawalHistory `json:"items"` }
FuturesWithdrawalsListResponse represents a list of futures Withdrawal history instance
type HFMarginOrderTrade ¶
type HFMarginOrderTrade struct { ID int64 `json:"id"` Symbol string `json:"symbol"` TradeID int64 `json:"tradeId"` OrderID string `json:"orderId"` CounterOrderID string `json:"counterOrderId"` Side string `json:"side"` Liquidity string `json:"liquidity"` ForceTaker bool `json:"forceTaker"` Price types.Number `json:"price"` Size types.Number `json:"size"` Funds types.Number `json:"funds"` Fee types.Number `json:"fee"` FeeRate types.Number `json:"feeRate"` FeeCurrency string `json:"feeCurrency"` Stop string `json:"stop"` TradeType string `json:"tradeType"` Type string `json:"type"` CreatedAt types.Time `json:"createdAt"` }
HFMarginOrderTrade represents a HF margin order trade item
type HFMarginOrderTransaction ¶
type HFMarginOrderTransaction struct { Items []HFMarginOrderTrade `json:"items"` LastID int64 `json:"lastId"` }
HFMarginOrderTransaction represents a HF margin order transaction detail
type HFOrderFills ¶
HFOrderFills represents an HF order list
type HistoricalDepositWithdrawal ¶
type HistoricalDepositWithdrawal struct { Amount float64 `json:"amount,string"` CreatedAt types.Time `json:"createAt"` // contains filtered or unexported fields }
HistoricalDepositWithdrawal represents deposit and withdrawal funding item
type HistoricalDepositWithdrawalResponse ¶
type HistoricalDepositWithdrawalResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []HistoricalDepositWithdrawal `json:"items"` }
HistoricalDepositWithdrawalResponse represents deposit and withdrawal funding items details
type InnerTransferToMainAndTradeResponse ¶
type InnerTransferToMainAndTradeResponse struct { ApplyID string `json:"applyId"` BizNo string `json:"bizNo"` PayAccountType string `json:"payAccountType"` PayTag string `json:"payTag"` Remark string `json:"remark"` RecAccountType string `json:"recAccountType"` RecTag string `json:"recTag"` RecRemark string `json:"recRemark"` RecSystem string `json:"recSystem"` Status string `json:"status"` Currency string `json:"currency"` Amount types.Number `json:"amount"` Fee types.Number `json:"fee"` SerialNumber int64 `json:"sn"` Reason string `json:"reason"` CreatedAt types.Time `json:"createdAt"` UpdatedAt types.Time `json:"updatedAt"` }
InnerTransferToMainAndTradeResponse represents a detailed response after transferring fund to main and trade accounts
type InstanceServer ¶
type InstanceServer struct { Endpoint string `json:"endpoint"` Encrypt bool `json:"encrypt"` Protocol string `json:"protocol"` PingInterval int64 `json:"pingInterval"` PingTimeout int64 `json:"pingTimeout"` }
InstanceServer represents a single websocket instance server information
type InterestRate ¶
type InterestRate struct { Time types.Time `json:"time"` MarketInterestRate types.Number `json:"marketInterestRate"` }
InterestRate represents a currency interest rate
type IsolatedMarginAccountDetail ¶
type IsolatedMarginAccountDetail struct { TotalAssetOfQuoteCurrency string `json:"totalAssetOfQuoteCurrency"` TotalLiabilityOfQuoteCurrency string `json:"totalLiabilityOfQuoteCurrency"` Timestamp types.Time `json:"timestamp"` Assets []IsolatedMarginAssetDetail `json:"assets"` }
IsolatedMarginAccountDetail represents an isolated-margin account detail
type IsolatedMarginAccountInfo ¶
type IsolatedMarginAccountInfo struct { TotalConversionBalance float64 `json:"totalConversionBalance,string"` LiabilityConversionBalance float64 `json:"liabilityConversionBalance,string"` Assets []AssetInfo `json:"assets"` }
IsolatedMarginAccountInfo holds isolated margin accounts of the current user
type IsolatedMarginAssetDetail ¶
type IsolatedMarginAssetDetail struct { Symbol string `json:"symbol"` Status string `json:"status"` DebtRatio types.Number `json:"debtRatio"` BaseAsset MarginAssetDetail `json:"baseAsset"` QuoteAsset MarginAssetDetail `json:"quoteAsset"` }
IsolatedMarginAssetDetail represents an isolated margin asset detail
type IsolatedMarginBorrowing ¶
type IsolatedMarginBorrowing struct { OrderID string `json:"orderId"` Currency string `json:"currency"` ActualSize float64 `json:"actualSize,string"` }
IsolatedMarginBorrowing represents response data for initiating isolated margin borrowing
type IsolatedMarginPairConfig ¶
type IsolatedMarginPairConfig struct { Symbol string `json:"symbol"` SymbolName string `json:"symbolName"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` MaxLeverage int64 `json:"maxLeverage"` LiquidationDebtRatio float64 `json:"flDebtRatio,string"` TradeEnable bool `json:"tradeEnable"` AutoRenewMaxDebtRatio float64 `json:"autoRenewMaxDebtRatio,string"` BaseBorrowEnable bool `json:"baseBorrowEnable"` QuoteBorrowEnable bool `json:"quoteBorrowEnable"` BaseTransferInEnable bool `json:"baseTransferInEnable"` QuoteTransferInEnable bool `json:"quoteTransferInEnable"` }
IsolatedMarginPairConfig current isolated margin trading pair configuration
type IsolatedMarginRiskLimitCurrencyConfig ¶
type IsolatedMarginRiskLimitCurrencyConfig struct { Timestamp types.Time `json:"timestamp"` Symbol string `json:"symbol"` BaseMaxBorrowAmount types.Number `json:"baseMaxBorrowAmount"` QuoteMaxBorrowAmount types.Number `json:"quoteMaxBorrowAmount"` BaseMaxBuyAmount types.Number `json:"baseMaxBuyAmount"` QuoteMaxBuyAmount types.Number `json:"quoteMaxBuyAmount"` BaseMaxHoldAmount types.Number `json:"baseMaxHoldAmount"` QuoteMaxHoldAmount types.Number `json:"quoteMaxHoldAmount"` BasePrecision int64 `json:"basePrecision"` QuotePrecision int64 `json:"quotePrecision"` BaseBorrowCoefficient types.Number `json:"baseBorrowCoefficient"` QuoteBorrowCoefficient types.Number `json:"quoteBorrowCoefficient"` BaseMarginCoefficient types.Number `json:"baseMarginCoefficient"` QuoteMarginCoefficient types.Number `json:"quoteMarginCoefficient"` BaseBorrowMinAmount string `json:"baseBorrowMinAmount"` BaseBorrowMinUnit string `json:"baseBorrowMinUnit"` QuoteBorrowMinAmount types.Number `json:"quoteBorrowMinAmount"` QuoteBorrowMinUnit types.Number `json:"quoteBorrowMinUnit"` BaseBorrowEnabled bool `json:"baseBorrowEnabled"` QuoteBorrowEnabled bool `json:"quoteBorrowEnabled"` }
IsolatedMarginRiskLimitCurrencyConfig represents a currency configuration of isolated margin account
type Kline ¶
type Kline struct { StartTime time.Time Open float64 Close float64 High float64 Low float64 Volume float64 // Transaction volume Amount float64 // Transaction amount }
Kline stores kline data
type Kucoin ¶
Kucoin is the overarching type across this package
func (*Kucoin) AccountToTradeTypeString ¶
AccountToTradeTypeString returns the account trade type given the asset type and margin mode information for spot and margin assets.
func (*Kucoin) AddMargin ¶
func (ku *Kucoin) AddMargin(ctx context.Context, symbol, uniqueID string, margin float64) (*FuturesPosition, error)
AddMargin is used to add margin manually
func (*Kucoin) ApplyWithdrawal ¶
func (ku *Kucoin) ApplyWithdrawal(ctx context.Context, ccy currency.Code, address, memo, remark, chain, feeDeductType string, isInner bool, amount float64) (string, error)
ApplyWithdrawal create a withdrawal request The endpoint was deprecated for futures, please transfer assets from the FUTURES account to the MAIN account first, and then withdraw from the MAIN account Withdrawal fee deduct types are: INTERNAL and EXTERNAL
TIP: On the WEB end, you can open the switch of specified favorite addresses for withdrawal, and when it is turned on, it will verify whether your withdrawal address(including chain) is a favorite address(it is case sensitive); if it fails validation, it will respond with the error message {"msg":"Already set withdraw whitelist, this address is not favorite address","code":"260325"}.
func (*Kucoin) AutoCancelHFOrderSetting ¶
func (ku *Kucoin) AutoCancelHFOrderSetting(ctx context.Context, timeout int64, symbols []string) (*AutoCancelHFOrderResponse, error)
AutoCancelHFOrderSetting automatically cancel all orders of the set trading pair after the specified time. If this interface is not called again for renewal or cancellation before the set time, the system will help the user to cancel the order of the corresponding trading pair. Otherwise it will not.
func (*Kucoin) AutoCancelHFOrderSettingQuery ¶
func (ku *Kucoin) AutoCancelHFOrderSettingQuery(ctx context.Context) (*AutoCancelHFOrderResponse, error)
AutoCancelHFOrderSettingQuery query the settings of automatic order cancellation
func (*Kucoin) CalculateAssets ¶
CalculateAssets returns the available asset types for a currency pair
func (*Kucoin) CancelAllFuturesStopOrders ¶
CancelAllFuturesStopOrders used to cancel all untriggered stop orders
func (*Kucoin) CancelAllHFOrders ¶
func (ku *Kucoin) CancelAllHFOrders(ctx context.Context) (*CancelAllHFOrdersResponse, error)
CancelAllHFOrders cancels all high-frequency orders for all symbols
func (*Kucoin) CancelAllHFOrdersBySymbol ¶
CancelAllHFOrdersBySymbol cancel all open high-frequency orders
func (*Kucoin) CancelAllMarginHFOrdersBySymbol ¶
func (ku *Kucoin) CancelAllMarginHFOrdersBySymbol(ctx context.Context, symbol, tradeType string) (string, error)
CancelAllMarginHFOrdersBySymbol cancel all open high-frequency Margin orders(orders created through POST /api/v3/hf/margin/order). Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade
func (*Kucoin) CancelAllOpenOrders ¶
func (ku *Kucoin) CancelAllOpenOrders(ctx context.Context, symbol, tradeType string) ([]string, error)
CancelAllOpenOrders used to cancel all order based upon the parameters passed
func (*Kucoin) CancelAllOrders ¶
func (ku *Kucoin) CancelAllOrders(ctx context.Context, orderCancellation *order.Cancel) (order.CancelAllResponse, error)
CancelAllOrders cancels all orders associated with a currency pair
func (*Kucoin) CancelBatchOrders ¶
func (ku *Kucoin) CancelBatchOrders(_ context.Context, _ []order.Cancel) (*order.CancelBatchResponse, error)
CancelBatchOrders cancels orders by their corresponding ID numbers
func (*Kucoin) CancelFuturesOrderByClientOrderID ¶
func (ku *Kucoin) CancelFuturesOrderByClientOrderID(ctx context.Context, symbol, clientOrderID string) ([]string, error)
CancelFuturesOrderByClientOrderID cancels a futures order by using client order ID
func (*Kucoin) CancelFuturesOrderByOrderID ¶
func (ku *Kucoin) CancelFuturesOrderByOrderID(ctx context.Context, orderID string) ([]string, error)
CancelFuturesOrderByOrderID used to cancel single order previously placed including a stop order
func (*Kucoin) CancelHFOrder ¶
CancelHFOrder used to cancel a high-frequency order by orderId.
func (*Kucoin) CancelHFOrderByClientOrderID ¶
func (ku *Kucoin) CancelHFOrderByClientOrderID(ctx context.Context, clientOrderID, symbol string) (string, error)
CancelHFOrderByClientOrderID sends out a request to cancel a high-frequency order using clientOid.
func (*Kucoin) CancelMarginHFOrderByClientOrderID ¶
func (ku *Kucoin) CancelMarginHFOrderByClientOrderID(ctx context.Context, clientOrderID, symbol string) (string, error)
CancelMarginHFOrderByClientOrderID to cancel a single order by clientOid.
func (*Kucoin) CancelMarginHFOrderByID ¶
func (ku *Kucoin) CancelMarginHFOrderByID(ctx context.Context, id, symbol, path string) (string, error)
CancelMarginHFOrderByID sends a cancel order high frequency margin orders by order ID or client supplied order ID.
func (*Kucoin) CancelMarginHFOrderByOrderID ¶
func (ku *Kucoin) CancelMarginHFOrderByOrderID(ctx context.Context, orderID, symbol string) (string, error)
CancelMarginHFOrderByOrderID cancels a single order by orderId. If the order cannot be canceled (sold or canceled), an error message will be returned, and the reason can be obtained according to the returned msg.
func (*Kucoin) CancelMultipleFuturesLimitOrders ¶
func (ku *Kucoin) CancelMultipleFuturesLimitOrders(ctx context.Context, symbol string) ([]string, error)
CancelMultipleFuturesLimitOrders used to cancel all futures order excluding stop orders
func (*Kucoin) CancelOCOMultipleOrders ¶
func (ku *Kucoin) CancelOCOMultipleOrders(ctx context.Context, orderIDs []string, symbol string) (*OCOOrderCancellationResponse, error)
CancelOCOMultipleOrders batch cancel OCO orders through orderIds.
func (*Kucoin) CancelOCOOrderByClientOrderID ¶
func (ku *Kucoin) CancelOCOOrderByClientOrderID(ctx context.Context, clientOrderID string) (*OCOOrderCancellationResponse, error)
CancelOCOOrderByClientOrderID cancels a single oco order previously placed by client order ID.
func (*Kucoin) CancelOCOOrderByID ¶
func (ku *Kucoin) CancelOCOOrderByID(ctx context.Context, path, id string) (*OCOOrderCancellationResponse, error)
CancelOCOOrderByID sends a cancel OCO order by order ID or client supplied order ID.
func (*Kucoin) CancelOCOOrderByOrderID ¶
func (ku *Kucoin) CancelOCOOrderByOrderID(ctx context.Context, orderID string) (*OCOOrderCancellationResponse, error)
CancelOCOOrderByOrderID cancels a single oco order previously placed by order ID.
func (*Kucoin) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*Kucoin) CancelOrderByClientOID ¶
func (ku *Kucoin) CancelOrderByClientOID(ctx context.Context, orderID string) (*CancelOrderResponse, error)
CancelOrderByClientOID used to cancel order via the clientOid
func (*Kucoin) CancelSingleOrder ¶
CancelSingleOrder used to cancel single order previously placed
func (*Kucoin) CancelSpecifiedNumberHFOrdersByOrderID ¶
func (ku *Kucoin) CancelSpecifiedNumberHFOrdersByOrderID(ctx context.Context, orderID, symbol string, cancelSize float64) (*CancelOrderByNumberResponse, error)
CancelSpecifiedNumberHFOrdersByOrderID cancel the specified quantity of the order according to the orderId.
func (*Kucoin) CancelStopOrder ¶
CancelStopOrder used to cancel single stop order previously placed
func (*Kucoin) CancelStopOrderByClientID ¶
func (ku *Kucoin) CancelStopOrderByClientID(ctx context.Context, symbol, clientOID string) (*CancelOrderResponse, error)
CancelStopOrderByClientID used to cancel a stop order via the clientOID.
func (*Kucoin) CancelStopOrderByClientOrderID ¶
func (ku *Kucoin) CancelStopOrderByClientOrderID(ctx context.Context, clientOrderID, symbol string) ([]string, error)
CancelStopOrderByClientOrderID used to cancel single stop order previously placed by client supplied order ID.
func (*Kucoin) CancelStopOrders ¶
func (ku *Kucoin) CancelStopOrders(ctx context.Context, symbol, tradeType string, orderIDs []string) ([]string, error)
CancelStopOrders used to cancel all order based upon the parameters passed
func (*Kucoin) CancelWithdrawal ¶
CancelWithdrawal used to cancel a withdrawal request
func (*Kucoin) ChangePositionMargin ¶
func (ku *Kucoin) ChangePositionMargin(ctx context.Context, r *margin.PositionChangeRequest) (*margin.PositionChangeResponse, error)
ChangePositionMargin will modify a position/currencies margin parameters
func (*Kucoin) CreateDepositAddress ¶
func (ku *Kucoin) CreateDepositAddress(ctx context.Context, arg *DepositAddressParams) (*DepositAddress, error)
CreateDepositAddress create a deposit address for a currency you intend to deposit
func (*Kucoin) CreateFuturesSubAccountAPIKey ¶
func (ku *Kucoin) CreateFuturesSubAccountAPIKey(ctx context.Context, ipWhitelist, passphrase, permission, remark, subName string) (*APIKeyDetail, error)
CreateFuturesSubAccountAPIKey is used to create Futures APIs for sub-accounts
func (*Kucoin) CreateSpotAPIsForSubAccount ¶
func (ku *Kucoin) CreateSpotAPIsForSubAccount(ctx context.Context, arg *SpotAPISubAccountParams) (*SpotAPISubAccount, error)
CreateSpotAPIsForSubAccount can be used to create Spot APIs for sub-accounts.
func (*Kucoin) CreateSubUser ¶
func (ku *Kucoin) CreateSubUser(ctx context.Context, subAccountName, password, remarks, access string) (*SubAccount, error)
CreateSubUser creates a new sub-user for the account.
func (*Kucoin) DeleteSubAccountSpotAPI ¶
func (ku *Kucoin) DeleteSubAccountSpotAPI(ctx context.Context, apiKey, subAccountName, passphrase string) (*DeleteSubAccountResponse, error)
DeleteSubAccountSpotAPI delete sub-account Spot APIs.
func (*Kucoin) FetchAccountInfo ¶
func (ku *Kucoin) FetchAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
FetchAccountInfo retrieves balances for all enabled currencies
func (*Kucoin) FetchOrderbook ¶
func (ku *Kucoin) FetchOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchOrderbook returns orderbook base on the currency pair
func (*Kucoin) FetchTicker ¶
func (ku *Kucoin) FetchTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
FetchTicker returns the ticker for a currency pair
func (*Kucoin) FetchTradablePairs ¶
func (ku *Kucoin) FetchTradablePairs(ctx context.Context, assetType asset.Item) (currency.Pairs, error)
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*Kucoin) FillFuturesPostOrderArgumentFilter ¶
func (ku *Kucoin) FillFuturesPostOrderArgumentFilter(arg *FuturesOrderParam) error
FillFuturesPostOrderArgumentFilter verifies futures order request parameters
func (*Kucoin) FlushAndCleanup ¶
FlushAndCleanup flushes orderbook and clean local cache
func (*Kucoin) FuturesUpdateRiskLmitLevel ¶
func (ku *Kucoin) FuturesUpdateRiskLmitLevel(ctx context.Context, symbol string, level int64) (bool, error)
FuturesUpdateRiskLmitLevel is used to adjustment the risk limit level
func (*Kucoin) Get24HourFuturesTransactionVolume ¶
func (ku *Kucoin) Get24HourFuturesTransactionVolume(ctx context.Context) (*TransactionVolume, error)
Get24HourFuturesTransactionVolume retrieves a 24 hour transaction volume
func (*Kucoin) Get24hrStats ¶
Get24hrStats get the statistics of the specified pair in the last 24 hours
func (*Kucoin) GetAccountDetail ¶
GetAccountDetail get information of single account
func (*Kucoin) GetAccountFundingHistory ¶
GetAccountFundingHistory returns funding history, deposits and withdrawals
func (*Kucoin) GetAccountLedgerHFMargin ¶
func (ku *Kucoin) GetAccountLedgerHFMargin(ctx context.Context, ccy currency.Code, direction, bizType string, lastID, limit int64, startTime, endTime time.Time) ([]LedgerInfo, error)
GetAccountLedgerHFMargin returns all transfer (in and out) records in high-frequency margin trading account and supports multi-coin queries.
func (*Kucoin) GetAccountLedgers ¶
func (ku *Kucoin) GetAccountLedgers(ctx context.Context, ccy currency.Code, direction, bizType string, startAt, endAt time.Time) (*AccountLedgerResponse, error)
GetAccountLedgers retrieves the transaction records from all types of your accounts, supporting inquiry of various currencies. bizType possible values: 'DEPOSIT' -deposit, 'WITHDRAW' -withdraw, 'TRANSFER' -transfer, 'SUB_TRANSFER' -subaccount transfer,'TRADE_EXCHANGE' -trade, 'MARGIN_EXCHANGE' -margin trade, 'KUCOIN_BONUS' -bonus
func (*Kucoin) GetAccountLedgersHFTrade ¶
func (ku *Kucoin) GetAccountLedgersHFTrade(ctx context.Context, ccy currency.Code, direction, bizType string, lastID, limit int64, startTime, endTime time.Time) ([]LedgerInfo, error)
GetAccountLedgersHFTrade returns all transfer (in and out) records in high-frequency trading account and supports multi-coin queries. The query results are sorted in descending order by createdAt and id.
func (*Kucoin) GetAccountSummaryInformation ¶
func (ku *Kucoin) GetAccountSummaryInformation(ctx context.Context) (*AccountSummaryInformation, error)
GetAccountSummaryInformation this can be used to obtain account summary information.
func (*Kucoin) GetActiveHFOrderSymbols ¶
func (ku *Kucoin) GetActiveHFOrderSymbols(ctx context.Context, tradeType string) (*MarginActiveSymbolDetail, error)
GetActiveHFOrderSymbols retrieves the symbols of active high-frequency orders. Possible values for tradeType are MARGIN_TRADE for cross-margin trading and MARGIN_ISOLATED_TRADE for isolated margin trading.
func (*Kucoin) GetActiveHFOrders ¶
GetActiveHFOrders retrieves all high-frequency active orders
func (*Kucoin) GetActiveMarginHFOrders ¶
func (ku *Kucoin) GetActiveMarginHFOrders(ctx context.Context, symbol, tradeType string) ([]OrderDetail, error)
GetActiveMarginHFOrders retrieves list if active high-frequency margin orders
func (*Kucoin) GetActiveOrders ¶
func (ku *Kucoin) GetActiveOrders(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error)
GetActiveOrders retrieves any orders that are active/open
func (*Kucoin) GetAffilateUserRebateInformation ¶
func (ku *Kucoin) GetAffilateUserRebateInformation(ctx context.Context, date time.Time, offset string, maxCount int64) ([]UserRebateInfo, error)
GetAffilateUserRebateInformation allows getting affiliate user rebate information.
func (*Kucoin) GetAggregatedSubAccountBalance ¶
func (ku *Kucoin) GetAggregatedSubAccountBalance(ctx context.Context) ([]SubAccountInfo, error)
GetAggregatedSubAccountBalance get the account info of all sub-users
func (*Kucoin) GetAllAccounts ¶
func (ku *Kucoin) GetAllAccounts(ctx context.Context, ccy currency.Code, accountType string) ([]AccountInfo, error)
GetAllAccounts get all accounts accountType possible values are main、trade、margin、trade_hf
func (*Kucoin) GetAllFuturesSubAccountBalances ¶
func (ku *Kucoin) GetAllFuturesSubAccountBalances(ctx context.Context, ccy currency.Code) (*FuturesSubAccountBalance, error)
GetAllFuturesSubAccountBalances retrieves all futures subaccount balances
func (*Kucoin) GetAllMarginTradingPairsMarkPrices ¶
GetAllMarginTradingPairsMarkPrices retrieves all margin trading pairs ticker mark price information
func (*Kucoin) GetAllSubAccountsBalanceV2 ¶
func (ku *Kucoin) GetAllSubAccountsBalanceV2(ctx context.Context) (*SubAccountsBalanceV2, error)
GetAllSubAccountsBalanceV2 retrieves sub-account balance information through the V2 API
func (*Kucoin) GetAllSubAccountsInfoV1 ¶
func (ku *Kucoin) GetAllSubAccountsInfoV1(ctx context.Context) ([]SubAccount, error)
GetAllSubAccountsInfoV1 retrieves the user info of all sub-account via this interface.
func (*Kucoin) GetAllSubAccountsInfoV2 ¶
func (ku *Kucoin) GetAllSubAccountsInfoV2(ctx context.Context, currentPage, pageSize int64) (*SubAccountV2Response, error)
GetAllSubAccountsInfoV2 retrieves list of sub-accounts.
func (*Kucoin) GetAuthenticatedInstanceServers ¶
func (ku *Kucoin) GetAuthenticatedInstanceServers(ctx context.Context) (*WSInstanceServers, error)
GetAuthenticatedInstanceServers retrieves server instances for authenticated users.
func (*Kucoin) GetAvailableTransferChains ¶
func (ku *Kucoin) GetAvailableTransferChains(ctx context.Context, cryptocurrency currency.Code) ([]string, error)
GetAvailableTransferChains returns the available transfer blockchains for the specific cryptocurrency
func (*Kucoin) GetBasicFee ¶
GetBasicFee get basic fee rate of users Currency type: '0'-crypto currency, '1'-fiat currency. default is '0'-crypto currency
func (*Kucoin) GetCollateralMode ¶
GetCollateralMode returns the collateral type for your account
func (*Kucoin) GetCrossIsolatedMarginInterestRecords ¶
func (ku *Kucoin) GetCrossIsolatedMarginInterestRecords(ctx context.Context, isIsolated bool, symbol string, ccy currency.Code, startTime, endTime time.Time, currentPage, pageSize int64) (*MarginInterestRecords, error)
GetCrossIsolatedMarginInterestRecords request via this endpoint to get the interest records of the cross/isolated margin lending
func (*Kucoin) GetCrossMarginAccountsDetail ¶
func (ku *Kucoin) GetCrossMarginAccountsDetail(ctx context.Context, quoteCurrency, queryType string) (*CrossMarginAccountDetail, error)
GetCrossMarginAccountsDetail retrieves the info of the cross margin account.
func (*Kucoin) GetCrossMarginRiskLimitCurrencyConfig ¶
func (ku *Kucoin) GetCrossMarginRiskLimitCurrencyConfig(ctx context.Context, symbol string, ccy currency.Code) ([]CrossMarginRiskLimitCurrencyConfig, error)
GetCrossMarginRiskLimitCurrencyConfig risk limit and currency configuration of cross margin account isIsolated: true - isolated, false - cross ; default false
func (*Kucoin) GetCurrenciesV3 ¶
func (ku *Kucoin) GetCurrenciesV3(ctx context.Context) ([]CurrencyDetail, error)
GetCurrenciesV3 the V3 of retrieving list of currencies
func (*Kucoin) GetCurrencyDetailV3 ¶
func (ku *Kucoin) GetCurrencyDetailV3(ctx context.Context, ccy currency.Code, chain string) (*CurrencyDetail, error)
GetCurrencyDetailV3 V3 endpoint to gets currency detail using currency code and chain information.
func (*Kucoin) GetCurrencyTradeURL ¶
func (ku *Kucoin) GetCurrencyTradeURL(_ context.Context, a asset.Item, cp currency.Pair) (string, error)
GetCurrencyTradeURL returns the URL to the exchange's trade page for the given asset and currency pair
func (*Kucoin) GetCurrentServerTime ¶
GetCurrentServerTime gets the server time
func (*Kucoin) GetDepositAddress ¶
func (ku *Kucoin) GetDepositAddress(ctx context.Context, c currency.Code, _, chain string) (*deposit.Address, error)
GetDepositAddress returns a deposit address for a specified currency
func (*Kucoin) GetDepositAddressV1 ¶
func (ku *Kucoin) GetDepositAddressV1(ctx context.Context, ccy currency.Code, chain string) (*DepositAddress, error)
GetDepositAddressV1 get a deposit address for the currency you intend to deposit
func (*Kucoin) GetDepositAddressesV2 ¶
func (ku *Kucoin) GetDepositAddressesV2(ctx context.Context, ccy currency.Code) ([]DepositAddress, error)
GetDepositAddressesV2 get all deposit addresses for the currency you intend to deposit
func (*Kucoin) GetDepositList ¶
func (ku *Kucoin) GetDepositList(ctx context.Context, ccy currency.Code, status string, startAt, endAt time.Time) (*DepositResponse, error)
GetDepositList get deposit list items and sorted to show the latest first Status. Available value: PROCESSING, SUCCESS, and FAILURE
func (*Kucoin) GetEarnETHStakingProducts ¶
func (ku *Kucoin) GetEarnETHStakingProducts(ctx context.Context) ([]EarnProduct, error)
GetEarnETHStakingProducts retrieves ETH Staking products. If no ETH Staking products are available, an empty list is returned.
func (*Kucoin) GetEarnFixedIncomeCurrentHoldings ¶
func (ku *Kucoin) GetEarnFixedIncomeCurrentHoldings(ctx context.Context, productID, productCategory string, ccy currency.Code, currentPage, pageSize int64) (*FixedIncomeEarnHoldings, error)
GetEarnFixedIncomeCurrentHoldings retrieves current holding assets of fixed income products. If no current holding assets are available, an empty list is returned.
func (*Kucoin) GetEarnKCSStakingProducts ¶
func (ku *Kucoin) GetEarnKCSStakingProducts(ctx context.Context, ccy currency.Code) ([]EarnProduct, error)
GetEarnKCSStakingProducts retrieves KCS Staking products. If no KCS Staking products are available, an empty list is returned.
func (*Kucoin) GetEarnRedeemPreviewByHoldingID ¶
func (ku *Kucoin) GetEarnRedeemPreviewByHoldingID(ctx context.Context, orderID, fromAccountType string) (*EarnRedemptionPreview, error)
GetEarnRedeemPreviewByHoldingID retrieves redemption preview information by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist.
func (*Kucoin) GetEarnSavingsProducts ¶
func (ku *Kucoin) GetEarnSavingsProducts(ctx context.Context, ccy currency.Code) ([]EarnSavingProduct, error)
GetEarnSavingsProducts retrieves savings products. If no savings products are available, an empty list is returned.
func (*Kucoin) GetEarnStakingProducts ¶
func (ku *Kucoin) GetEarnStakingProducts(ctx context.Context, ccy currency.Code) ([]EarnProduct, error)
GetEarnStakingProducts retrieves staking products. If no staking products are available, an empty list is returned.
func (*Kucoin) GetFeeByType ¶
func (ku *Kucoin) GetFeeByType(ctx context.Context, feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on the type of transaction
func (*Kucoin) GetFiatPrice ¶
func (ku *Kucoin) GetFiatPrice(ctx context.Context, base, currencies string) (map[string]types.Number, error)
GetFiatPrice gets fiat prices of currencies, default base currency is USD
func (*Kucoin) GetFilledHFMarginOrders ¶
func (ku *Kucoin) GetFilledHFMarginOrders(ctx context.Context, symbol, tradeType, side, orderType string, startAt, endAt time.Time, lastID, limit int64) (*FilledMarginHFOrdersResponse, error)
GetFilledHFMarginOrders list of filled margin HF orders and returns paginated data. The returned data is sorted in descending order based on the latest order update times.
func (*Kucoin) GetFills ¶
func (ku *Kucoin) GetFills(ctx context.Context, orderID, symbol, side, orderType, tradeType string, startAt, endAt time.Time) (*ListFills, error)
GetFills get fills
func (*Kucoin) GetFuturesAccountDetail ¶
func (ku *Kucoin) GetFuturesAccountDetail(ctx context.Context, ccy currency.Code) (*FuturesAccountOverview, error)
GetFuturesAccountDetail retrieves futures account detail information
func (*Kucoin) GetFuturesAccountLedgers ¶
func (ku *Kucoin) GetFuturesAccountLedgers(ctx context.Context, ccy currency.Code, forward bool, startAt, endAt time.Time, offset, maxCount int64) (*FuturesLedgerInfo, error)
GetFuturesAccountLedgers If there are open positions, the status of the first page returned will be Pending, indicating the realised profit and loss in the current 8-hour settlement period. Type RealisedPNL-Realised profit and loss, Deposit-Deposit, Withdrawal-withdraw, Transferin-Transfer in, TransferOut-Transfer out
func (*Kucoin) GetFuturesAccountOverview ¶
func (ku *Kucoin) GetFuturesAccountOverview(ctx context.Context, ccy string) (*FuturesAccount, error)
GetFuturesAccountOverview gets future account overview
func (*Kucoin) GetFuturesContract ¶
GetFuturesContract get contract details
func (*Kucoin) GetFuturesContractDetails ¶
func (ku *Kucoin) GetFuturesContractDetails(ctx context.Context, item asset.Item) ([]futures.Contract, error)
GetFuturesContractDetails returns details about futures contracts
func (*Kucoin) GetFuturesCurrentFundingRate ¶
func (ku *Kucoin) GetFuturesCurrentFundingRate(ctx context.Context, symbol string) (*FuturesFundingRate, error)
GetFuturesCurrentFundingRate get current funding rate
func (*Kucoin) GetFuturesCurrentMarkPrice ¶
func (ku *Kucoin) GetFuturesCurrentMarkPrice(ctx context.Context, symbol string) (*FuturesMarkPrice, error)
GetFuturesCurrentMarkPrice get current mark price
func (*Kucoin) GetFuturesFills ¶
func (ku *Kucoin) GetFuturesFills(ctx context.Context, orderID, symbol, side, orderType string, startAt, endAt time.Time) (*FutureFillsResponse, error)
GetFuturesFills gets list of recent fills
func (*Kucoin) GetFuturesFundingHistory ¶
func (ku *Kucoin) GetFuturesFundingHistory(ctx context.Context, symbol string, offset, maxCount int64, reverse, forward bool, startAt, endAt time.Time) (*FuturesFundingHistoryResponse, error)
GetFuturesFundingHistory gets information about funding history
func (*Kucoin) GetFuturesIndexList ¶
func (ku *Kucoin) GetFuturesIndexList(ctx context.Context, symbol string, startAt, endAt time.Time, reverse, forward bool, offset, maxCount int64) (*FuturesIndexResponse, error)
GetFuturesIndexList retrieves futures index information for a symbol
func (*Kucoin) GetFuturesInterestRate ¶
func (ku *Kucoin) GetFuturesInterestRate(ctx context.Context, symbol string, startAt, endAt time.Time, reverse, forward bool, offset, maxCount int64) (*FundingInterestRateResponse, error)
GetFuturesInterestRate get interest rate
func (*Kucoin) GetFuturesKline ¶
func (ku *Kucoin) GetFuturesKline(ctx context.Context, granularity int64, symbol string, from, to time.Time) ([]FuturesKline, error)
GetFuturesKline get contract's kline data
func (*Kucoin) GetFuturesOpenContracts ¶
GetFuturesOpenContracts gets all open futures contract with its details
func (*Kucoin) GetFuturesOpenOrderStats ¶
func (ku *Kucoin) GetFuturesOpenOrderStats(ctx context.Context, symbol string) (*FuturesOpenOrderStats, error)
GetFuturesOpenOrderStats gets the total number and value of the all your active orders
func (*Kucoin) GetFuturesOrderDetails ¶
func (ku *Kucoin) GetFuturesOrderDetails(ctx context.Context, orderID, clientOrderID string) (*FuturesOrder, error)
GetFuturesOrderDetails gets single order details by order ID
func (*Kucoin) GetFuturesOrderDetailsByClientOrderID ¶
func (ku *Kucoin) GetFuturesOrderDetailsByClientOrderID(ctx context.Context, clientOrderID string) (*FuturesOrder, error)
GetFuturesOrderDetailsByClientOrderID gets single order details by client ID
func (*Kucoin) GetFuturesOrderbook ¶
GetFuturesOrderbook gets full orderbook for a specified symbol
func (*Kucoin) GetFuturesOrders ¶
func (ku *Kucoin) GetFuturesOrders(ctx context.Context, status, symbol, side, orderType string, startAt, endAt time.Time) (*FutureOrdersResponse, error)
GetFuturesOrders gets the user current futures order list
func (*Kucoin) GetFuturesPartOrderbook100 ¶
func (ku *Kucoin) GetFuturesPartOrderbook100(ctx context.Context, symbol string) (*Orderbook, error)
GetFuturesPartOrderbook100 gets orderbook for a specified symbol with depth 100
func (*Kucoin) GetFuturesPartOrderbook20 ¶
GetFuturesPartOrderbook20 gets orderbook for a specified symbol with depth 20
func (*Kucoin) GetFuturesPosition ¶
GetFuturesPosition gets the position details of a specified position
func (*Kucoin) GetFuturesPositionList ¶
func (ku *Kucoin) GetFuturesPositionList(ctx context.Context) ([]FuturesPosition, error)
GetFuturesPositionList gets the list of position with details
func (*Kucoin) GetFuturesPositionOrders ¶
func (ku *Kucoin) GetFuturesPositionOrders(ctx context.Context, r *futures.PositionsRequest) ([]futures.PositionResponse, error)
GetFuturesPositionOrders returns the orders for futures positions
func (*Kucoin) GetFuturesPositionSummary ¶
func (ku *Kucoin) GetFuturesPositionSummary(ctx context.Context, r *futures.PositionSummaryRequest) (*futures.PositionSummary, error)
GetFuturesPositionSummary returns position summary details for an active position
func (*Kucoin) GetFuturesPremiumIndex ¶
func (ku *Kucoin) GetFuturesPremiumIndex(ctx context.Context, symbol string, startAt, endAt time.Time, reverse, forward bool, offset, maxCount int64) (*FuturesInterestRateResponse, error)
GetFuturesPremiumIndex get premium index
func (*Kucoin) GetFuturesRecentCompletedOrders ¶
func (ku *Kucoin) GetFuturesRecentCompletedOrders(ctx context.Context, symbol string) ([]FuturesOrder, error)
GetFuturesRecentCompletedOrders gets list of recent 1000 orders in the last 24 hours
func (*Kucoin) GetFuturesRecentFills ¶
func (ku *Kucoin) GetFuturesRecentFills(ctx context.Context) ([]FuturesFill, error)
GetFuturesRecentFills gets list of 1000 recent fills in the last 24 hrs
func (*Kucoin) GetFuturesRiskLimitLevel ¶
func (ku *Kucoin) GetFuturesRiskLimitLevel(ctx context.Context, symbol string) ([]FuturesRiskLimitLevel, error)
GetFuturesRiskLimitLevel gets information about risk limit level of a specific contract
func (*Kucoin) GetFuturesServerTime ¶
GetFuturesServerTime get server time
func (*Kucoin) GetFuturesServiceStatus ¶
func (ku *Kucoin) GetFuturesServiceStatus(ctx context.Context) (*FuturesServiceStatus, error)
GetFuturesServiceStatus get service status
func (*Kucoin) GetFuturesTicker ¶
GetFuturesTicker get real time ticker
func (*Kucoin) GetFuturesTickers ¶
GetFuturesTickers does n * REST requests based on enabled pairs of the futures asset type
func (*Kucoin) GetFuturesTradeHistory ¶
func (ku *Kucoin) GetFuturesTradeHistory(ctx context.Context, symbol string) ([]FuturesTrade, error)
GetFuturesTradeHistory get last 100 trades for symbol
func (*Kucoin) GetFuturesTradingPairsActualFees ¶
func (ku *Kucoin) GetFuturesTradingPairsActualFees(ctx context.Context, symbol string) (*TradingPairFee, error)
GetFuturesTradingPairsActualFees retrieves the actual fee rate of the trading pair. The fee rate of your sub-account is the same as that of the master account
func (*Kucoin) GetFuturesTransactionHistory ¶
func (ku *Kucoin) GetFuturesTransactionHistory(ctx context.Context, ccy currency.Code, txType string, offset, maxCount int64, forward bool, startAt, endAt time.Time) (*FuturesTransactionHistoryResponse, error)
GetFuturesTransactionHistory gets future transaction history
func (*Kucoin) GetFuturesTransferOutList ¶
func (ku *Kucoin) GetFuturesTransferOutList(ctx context.Context, ccy currency.Code, status string, startAt, endAt time.Time) (*TransferListsResponse, error)
GetFuturesTransferOutList gets list of transfer out
func (*Kucoin) GetFuturesTransferOutRequestRecords ¶
func (ku *Kucoin) GetFuturesTransferOutRequestRecords(ctx context.Context, startAt, endAt time.Time, status, queryStatus string, ccy currency.Code, currentPage, pageSize int64) (*FuturesTransferOutResponse, error)
GetFuturesTransferOutRequestRecords retrieves futures transfers out requests.
func (*Kucoin) GetHFCompletedOrderList ¶
func (ku *Kucoin) GetHFCompletedOrderList(ctx context.Context, symbol, side, orderType, lastID string, startAt, endAt time.Time, limit int64) (*CompletedHFOrder, error)
GetHFCompletedOrderList obtains a list of filled HF orders and returns paginated data. The returned data is sorted in descending order based on the latest order update times.
func (*Kucoin) GetHFFilledList ¶
func (ku *Kucoin) GetHFFilledList(ctx context.Context, orderID, symbol, side, orderType, lastID string, startAt, endAt time.Time, limit int64) (*HFOrderFills, error)
GetHFFilledList retrieves a list of the latest HF transaction details. The returned results are paginated. The data is sorted in descending order according to time.
func (*Kucoin) GetHFOrderDetailsByClientOrderID ¶
func (ku *Kucoin) GetHFOrderDetailsByClientOrderID(ctx context.Context, clientOrderID, symbol string) (*OrderDetail, error)
GetHFOrderDetailsByClientOrderID used to obtain information about a single order using clientOid. If the order does not exist, then there will be a prompt saying that the order does not exist.
func (*Kucoin) GetHFOrderDetailsByID ¶
func (ku *Kucoin) GetHFOrderDetailsByID(ctx context.Context, orderID, symbol, path string) (*OrderDetail, error)
GetHFOrderDetailsByID retrieves a high-frequency order by order ID or client supplied ID.
func (*Kucoin) GetHFOrderDetailsByOrderID ¶
func (ku *Kucoin) GetHFOrderDetailsByOrderID(ctx context.Context, orderID, symbol string) (*OrderDetail, error)
GetHFOrderDetailsByOrderID obtain information for a single HF order using the order id. If the order is not an active order, you can only get data within the time range of 3 _ 24 hours (ie: from the current time to 3 _ 24 hours ago).
func (*Kucoin) GetHistoricCandles ¶
func (ku *Kucoin) GetHistoricCandles(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*Kucoin) GetHistoricCandlesExtended ¶
func (ku *Kucoin) GetHistoricCandlesExtended(ctx context.Context, pair currency.Pair, a asset.Item, interval kline.Interval, start, end time.Time) (*kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*Kucoin) GetHistoricTrades ¶
func (ku *Kucoin) GetHistoricTrades(_ context.Context, _ currency.Pair, _ asset.Item, _, _ time.Time) ([]trade.Data, error)
GetHistoricTrades returns historic trade data within the timeframe provided
func (*Kucoin) GetHistoricalDepositList ¶
func (ku *Kucoin) GetHistoricalDepositList(ctx context.Context, ccy currency.Code, status string, startAt, endAt time.Time) (*HistoricalDepositWithdrawalResponse, error)
GetHistoricalDepositList get historical deposit list items
func (*Kucoin) GetHistoricalFundingRates ¶
func (ku *Kucoin) GetHistoricalFundingRates(ctx context.Context, r *fundingrate.HistoricalRatesRequest) (*fundingrate.HistoricalRates, error)
GetHistoricalFundingRates returns funding rates for a given asset and currency for a time period
func (*Kucoin) GetHistoricalWithdrawalList ¶
func (ku *Kucoin) GetHistoricalWithdrawalList(ctx context.Context, ccy currency.Code, status string, startAt, endAt time.Time) (*HistoricalDepositWithdrawalResponse, error)
GetHistoricalWithdrawalList get historical withdrawal list items
func (*Kucoin) GetInformationOnAccountInvolvedInOffExchangeLoans ¶
func (ku *Kucoin) GetInformationOnAccountInvolvedInOffExchangeLoans(ctx context.Context) ([]VIPLendingAccounts, error)
GetInformationOnAccountInvolvedInOffExchangeLoans retrieves accounts that are currently involved in off-exchange loans.
func (*Kucoin) GetInformationOnOffExchangeFundingAndLoans ¶
func (ku *Kucoin) GetInformationOnOffExchangeFundingAndLoans(ctx context.Context) (*OffExchangeFundingAndLoan, error)
GetInformationOnOffExchangeFundingAndLoans retrieves accounts that are currently involved in loans.
func (*Kucoin) GetInstanceServers ¶
func (ku *Kucoin) GetInstanceServers(ctx context.Context) (*WSInstanceServers, error)
GetInstanceServers retrieves the server list and temporary public token
func (*Kucoin) GetInterestRate ¶
GetInterestRate retrieves the interest rates of the margin lending market over the past 7 days.
func (*Kucoin) GetIsolatedMarginAccountDetail ¶
func (ku *Kucoin) GetIsolatedMarginAccountDetail(ctx context.Context, symbol, queryCurrency, queryType string) (*IsolatedMarginAccountDetail, error)
GetIsolatedMarginAccountDetail to get the info of the isolated margin account.
func (*Kucoin) GetIsolatedMarginAccountInfo ¶
func (ku *Kucoin) GetIsolatedMarginAccountInfo(ctx context.Context, balanceCurrency string) (*IsolatedMarginAccountInfo, error)
GetIsolatedMarginAccountInfo get all isolated margin accounts of the current user
func (*Kucoin) GetIsolatedMarginPairConfig ¶
func (ku *Kucoin) GetIsolatedMarginPairConfig(ctx context.Context) ([]IsolatedMarginPairConfig, error)
GetIsolatedMarginPairConfig get the current isolated margin trading pair configuration
func (*Kucoin) GetIsolatedMarginRiskLimitCurrencyConfig ¶
func (ku *Kucoin) GetIsolatedMarginRiskLimitCurrencyConfig(ctx context.Context, symbol string, ccy currency.Code) ([]IsolatedMarginRiskLimitCurrencyConfig, error)
GetIsolatedMarginRiskLimitCurrencyConfig risk limit and currency configuration of cross isolated margin
func (*Kucoin) GetKlines ¶
func (ku *Kucoin) GetKlines(ctx context.Context, symbol, period string, start, end time.Time) ([]Kline, error)
GetKlines gets kline of the specified pair
func (*Kucoin) GetLatestFundingRates ¶
func (ku *Kucoin) GetLatestFundingRates(ctx context.Context, r *fundingrate.LatestRateRequest) ([]fundingrate.LatestRateResponse, error)
GetLatestFundingRates returns the latest funding rates data
func (*Kucoin) GetLatestTickersForAllContracts ¶
func (ku *Kucoin) GetLatestTickersForAllContracts(ctx context.Context) ([]WsFuturesTicker, error)
GetLatestTickersForAllContracts retrieves all futures instruments ticker information
func (*Kucoin) GetLendingCurrencyInformation ¶
func (ku *Kucoin) GetLendingCurrencyInformation(ctx context.Context, ccy currency.Code) ([]LendingCurrencyInfo, error)
GetLendingCurrencyInformation retrieves a lending currency information.
func (*Kucoin) GetLeverage ¶
func (ku *Kucoin) GetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ order.Side) (float64, error)
GetLeverage gets the account's initial leverage for the asset type and pair
func (*Kucoin) GetLeveragedTokenInfo ¶
func (ku *Kucoin) GetLeveragedTokenInfo(ctx context.Context, ccy currency.Code) ([]LeveragedTokenInfo, error)
GetLeveragedTokenInfo returns leveraged token information
func (*Kucoin) GetLimitedTimePromotionProducts ¶
func (ku *Kucoin) GetLimitedTimePromotionProducts(ctx context.Context, ccy currency.Code) ([]EarnProduct, error)
GetLimitedTimePromotionProducts retrieves limited-time promotion products. If no products are available, an empty list is returned.
func (*Kucoin) GetMarginAccount ¶
func (ku *Kucoin) GetMarginAccount(ctx context.Context) (*MarginAccounts, error)
GetMarginAccount gets configure info of the margin
func (*Kucoin) GetMarginBorrowingHistory ¶
func (ku *Kucoin) GetMarginBorrowingHistory(ctx context.Context, ccy currency.Code, isIsolated bool, symbol, orderNo string, startTime, endTime time.Time, currentPage, pageSize int64) (*BorrowRepayDetailResponse, error)
GetMarginBorrowingHistory retrieves the borrowing orders for cross and isolated margin accounts
func (*Kucoin) GetMarginConfiguration ¶
func (ku *Kucoin) GetMarginConfiguration(ctx context.Context) (*MarginConfiguration, error)
GetMarginConfiguration gets configure info of the margin
func (*Kucoin) GetMarginHFOrderDetailByClientOrderID ¶
func (ku *Kucoin) GetMarginHFOrderDetailByClientOrderID(ctx context.Context, clientOrderID, symbol string) (*OrderDetail, error)
GetMarginHFOrderDetailByClientOrderID retrieves the detaul of a HF margin order by client order ID.
func (*Kucoin) GetMarginHFOrderDetailByID ¶
func (ku *Kucoin) GetMarginHFOrderDetailByID(ctx context.Context, orderID, symbol, path string) (*OrderDetail, error)
GetMarginHFOrderDetailByID sends an HTTP request to fetch margin high frequency orders by order ID or client supplied order ID.
func (*Kucoin) GetMarginHFOrderDetailByOrderID ¶
func (ku *Kucoin) GetMarginHFOrderDetailByOrderID(ctx context.Context, orderID, symbol string) (*OrderDetail, error)
GetMarginHFOrderDetailByOrderID retrieves the detail of a HF margin order by order ID.
func (*Kucoin) GetMarginHFTradeFills ¶
func (ku *Kucoin) GetMarginHFTradeFills(ctx context.Context, orderID, symbol, tradeType, side, orderType string, startAt, endAt time.Time, lastID, limit int64) (*HFMarginOrderTransaction, error)
GetMarginHFTradeFills to obtain a list of the latest margin HF transaction details. The returned results are paginated. The data is sorted in descending order according to time.
func (*Kucoin) GetMarginPairsConfigurations ¶
func (ku *Kucoin) GetMarginPairsConfigurations(ctx context.Context, symbol string) (*MarginPairConfigs, error)
GetMarginPairsConfigurations allows querying the configuration of cross margin trading pairs.
func (*Kucoin) GetMarkPrice ¶
GetMarkPrice gets index price of the specified pair
func (*Kucoin) GetMarketList ¶
GetMarketList get the transaction currency for the entire trading market
func (*Kucoin) GetMaxWithdrawMargin ¶
GetMaxWithdrawMargin query the maximum amount of margin that the current position supports withdrawal
func (*Kucoin) GetMaximumOpenPositionSize ¶
func (ku *Kucoin) GetMaximumOpenPositionSize(ctx context.Context, symbol string, price float64, leverage int64) (*FuturesMaxOpenPositionSize, error)
GetMaximumOpenPositionSize retrieves a maximum open position size
func (*Kucoin) GetOCOOrderDetailsByOrderID ¶
func (ku *Kucoin) GetOCOOrderDetailsByOrderID(ctx context.Context, orderID string) (*OCOOrderDetail, error)
GetOCOOrderDetailsByOrderID get a oco order detail via the order ID.
func (*Kucoin) GetOCOOrderInfoByClientOrderID ¶
func (ku *Kucoin) GetOCOOrderInfoByClientOrderID(ctx context.Context, clientOrderID string) (*OCOOrderInfo, error)
GetOCOOrderInfoByClientOrderID to get a oco order information via the client order ID.
func (*Kucoin) GetOCOOrderInfoByID ¶
GetOCOOrderInfoByID sends a request to get an OCO order by order ID or client supplied order ID.
func (*Kucoin) GetOCOOrderInfoByOrderID ¶
func (ku *Kucoin) GetOCOOrderInfoByOrderID(ctx context.Context, orderID string) (*OCOOrderInfo, error)
GetOCOOrderInfoByOrderID to get a oco order information via the order ID.
func (*Kucoin) GetOCOOrderList ¶
func (ku *Kucoin) GetOCOOrderList(ctx context.Context, pageSize, currentPage int64, symbol string, startAt, endAt time.Time, orderIDs []string) (*OCOOrders, error)
GetOCOOrderList retrieves list of OCO orders.
func (*Kucoin) GetOpenInterest ¶
func (ku *Kucoin) GetOpenInterest(ctx context.Context, k ...key.PairAsset) ([]futures.OpenInterest, error)
GetOpenInterest returns the open interest rate for a given asset pair
func (*Kucoin) GetOrderByClientSuppliedOrderID ¶
func (ku *Kucoin) GetOrderByClientSuppliedOrderID(ctx context.Context, clientOID string) (*OrderDetail, error)
GetOrderByClientSuppliedOrderID get a single order info by client order ID
func (*Kucoin) GetOrderByID ¶
GetOrderByID get a single order info by order ID
func (*Kucoin) GetOrderHistory ¶
func (ku *Kucoin) GetOrderHistory(ctx context.Context, getOrdersRequest *order.MultiOrderRequest) (order.FilteredOrders, error)
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*Kucoin) GetOrderInfo ¶
func (ku *Kucoin) GetOrderInfo(ctx context.Context, orderID string, pair currency.Pair, assetType asset.Item) (*order.Detail, error)
GetOrderInfo returns order information based on order ID
func (*Kucoin) GetOrderbook ¶
GetOrderbook gets full orderbook for a specified pair
func (*Kucoin) GetPaginatedListOfSubAccounts ¶
func (ku *Kucoin) GetPaginatedListOfSubAccounts(ctx context.Context, currentPage, pageSize int64) (*SubAccountResponse, error)
GetPaginatedListOfSubAccounts to retrieve a paginated list of sub-accounts. Pagination is required.
func (*Kucoin) GetPaginatedSubAccountInformation ¶
func (ku *Kucoin) GetPaginatedSubAccountInformation(ctx context.Context, currentPage, pageSize int64) ([]SubAccountInfo, error)
GetPaginatedSubAccountInformation this endpoint can be used to get paginated sub-account information. Pagination is required.
func (*Kucoin) GetPartOrderbook100 ¶
GetPartOrderbook100 gets orderbook for a specified pair with depth 100
func (*Kucoin) GetPartOrderbook20 ¶
GetPartOrderbook20 gets orderbook for a specified pair with depth 20
func (*Kucoin) GetPositionHistory ¶
func (ku *Kucoin) GetPositionHistory(ctx context.Context, symbol string, from, to time.Time, limit, pageID int64) (*FuturesPositionHistory, error)
GetPositionHistory query position history information records
func (*Kucoin) GetPublicFundingRate ¶
func (ku *Kucoin) GetPublicFundingRate(ctx context.Context, symbol string, from, to time.Time) ([]FundingHistoryItem, error)
GetPublicFundingRate query the funding rate at each settlement time point within a certain time range of the corresponding contract
func (*Kucoin) GetRecentFills ¶
GetRecentFills get a list of 1000 fills in last 24 hours
func (*Kucoin) GetRecentOrders ¶
func (ku *Kucoin) GetRecentOrders(ctx context.Context) ([]OrderDetail, error)
GetRecentOrders get orders in the last 24 hours.
func (*Kucoin) GetRecentTrades ¶
func (ku *Kucoin) GetRecentTrades(ctx context.Context, p currency.Pair, assetType asset.Item) ([]trade.Data, error)
GetRecentTrades returns the most recent trades for a currency and asset
func (*Kucoin) GetRedemptionOrders ¶
func (ku *Kucoin) GetRedemptionOrders(ctx context.Context, ccy currency.Code, status, redeemOrderNo string, currentPage, pageSize int64) (*RedemptionOrdersResponse, error)
GetRedemptionOrders query for the redemption orders. Status: DONE-completed; PENDING-settling
func (*Kucoin) GetRepaymentHistory ¶
func (ku *Kucoin) GetRepaymentHistory(ctx context.Context, ccy currency.Code, isIsolated bool, symbol, orderNo string, startTime, endTime time.Time, currentPage, pageSize int64) (*BorrowRepayDetailResponse, error)
GetRepaymentHistory retrieves the repayment orders for cross and isolated margin accounts.
func (*Kucoin) GetServerTime ¶
GetServerTime returns the current exchange server time.
func (*Kucoin) GetServiceStatus ¶
func (ku *Kucoin) GetServiceStatus(ctx context.Context) (*ServiceStatus, error)
GetServiceStatus gets the service status
func (*Kucoin) GetSingleIsolatedMarginAccountInfo ¶
func (ku *Kucoin) GetSingleIsolatedMarginAccountInfo(ctx context.Context, symbol string) (*AssetInfo, error)
GetSingleIsolatedMarginAccountInfo get single isolated margin accounts of the current user
func (*Kucoin) GetStopOrder ¶
GetStopOrder used to cancel single stop order previously placed
func (*Kucoin) GetStopOrderByClientID ¶
func (ku *Kucoin) GetStopOrderByClientID(ctx context.Context, symbol, clientOID string) ([]StopOrder, error)
GetStopOrderByClientID get a stop order information via the clientOID
func (*Kucoin) GetSubAccountSpotAPIList ¶
func (ku *Kucoin) GetSubAccountSpotAPIList(ctx context.Context, subAccountName, apiKeys string) ([]SpotAPISubAccount, error)
GetSubAccountSpotAPIList used to obtain a list of Spot APIs pertaining to a sub-account.
func (*Kucoin) GetSubAccounts ¶
func (ku *Kucoin) GetSubAccounts(ctx context.Context, subUserID string, includeBaseAmount bool) (*SubAccounts, error)
GetSubAccounts retrieves all sub-account information
func (*Kucoin) GetSubscriptionOrders ¶
func (ku *Kucoin) GetSubscriptionOrders(ctx context.Context, ccy currency.Code, purchaseOrderNo, status string, currentPage, pageSize int64) (*PurchaseSubscriptionOrdersResponse, error)
GetSubscriptionOrders provides pagination query for the subscription orders.
func (*Kucoin) GetSubscriptionTemplate ¶
func (ku *Kucoin) GetSubscriptionTemplate(_ *subscription.Subscription) (*template.Template, error)
GetSubscriptionTemplate returns a subscription channel template
func (*Kucoin) GetSymbols ¶
GetSymbols gets pairs details on the exchange For market details see endpoint: https://www.kucoin.com/docs/rest/spot-trading/market-data/get-market-list
func (*Kucoin) GetSymbolsWithActiveHFOrderList ¶
GetSymbolsWithActiveHFOrderList retrieves all trading pairs that the user has active orders
func (*Kucoin) GetTickers ¶
func (ku *Kucoin) GetTickers(ctx context.Context) (*TickersResponse, error)
GetTickers gets all trading pair ticker information including 24h volume
func (*Kucoin) GetTradeHistory ¶
GetTradeHistory gets trade history of the specified pair
func (*Kucoin) GetTradingFee ¶
GetTradingFee get fee rate of trading pairs WARNING: There is a limit of 10 currency pairs allowed to be requested per call.
func (*Kucoin) GetTradingPairActualFees ¶
func (ku *Kucoin) GetTradingPairActualFees(ctx context.Context, symbols []string) ([]TradingPairFee, error)
GetTradingPairActualFees retrieves list of trading pairs and fees.
func (*Kucoin) GetTransferableBalance ¶
func (ku *Kucoin) GetTransferableBalance(ctx context.Context, ccy currency.Code, accountType, tag string) (*TransferableBalanceInfo, error)
GetTransferableBalance get the transferable balance of a specified account The account type:MAIN、TRADE、TRADE_HF、MARGIN、ISOLATED
func (*Kucoin) GetUniversalTransfer ¶
func (ku *Kucoin) GetUniversalTransfer(ctx context.Context, arg *UniversalTransferParam) (string, error)
GetUniversalTransfer support transfer between master and sub accounts (only applicable to master account APIKey).
func (*Kucoin) GetUntriggeredFuturesStopOrders ¶
func (ku *Kucoin) GetUntriggeredFuturesStopOrders(ctx context.Context, symbol, side, orderType string, startAt, endAt time.Time) (*FutureOrdersResponse, error)
GetUntriggeredFuturesStopOrders gets the untriggered stop orders list
func (*Kucoin) GetUserInfoOfAllSubAccounts ¶
func (ku *Kucoin) GetUserInfoOfAllSubAccounts(ctx context.Context) (*SubAccountResponse, error)
GetUserInfoOfAllSubAccounts get the user info of all sub-users via this interface.
func (*Kucoin) GetWithdrawalList ¶
func (ku *Kucoin) GetWithdrawalList(ctx context.Context, ccy currency.Code, status string, startAt, endAt time.Time) (*WithdrawalsResponse, error)
GetWithdrawalList get withdrawal list items
func (*Kucoin) GetWithdrawalQuotas ¶
func (ku *Kucoin) GetWithdrawalQuotas(ctx context.Context, ccy currency.Code, chain string) (*WithdrawalQuota, error)
GetWithdrawalQuotas get withdrawal quota details
func (*Kucoin) GetWithdrawalsHistory ¶
func (ku *Kucoin) GetWithdrawalsHistory(ctx context.Context, c currency.Code, assetType asset.Item) ([]exchange.WithdrawalHistory, error)
GetWithdrawalsHistory returns previous withdrawals data
func (*Kucoin) HFSpotPlaceOrder ¶
HFSpotPlaceOrder places a high frequency spot order There are two types of orders: (limit) order: set price and quantity for the transaction. (market) order : set amount or quantity for the transaction.
func (*Kucoin) HandlePostOrder ¶
func (ku *Kucoin) HandlePostOrder(ctx context.Context, arg *SpotOrderParam, path string) (string, error)
HandlePostOrder applies a spot order placement or tests the order placement process.
func (*Kucoin) IsPerpetualFutureCurrency ¶
IsPerpetualFutureCurrency ensures a given asset and currency is a perpetual future
func (*Kucoin) ListOrders ¶
func (ku *Kucoin) ListOrders(ctx context.Context, status, symbol, side, orderType, tradeType string, startAt, endAt time.Time) (*OrdersListResponse, error)
ListOrders gets the user order list
func (*Kucoin) ListStopOrders ¶
func (ku *Kucoin) ListStopOrders(ctx context.Context, symbol, side, orderType, tradeType string, orderIDs []string, startAt, endAt time.Time, currentPage, pageSize int64) (*StopOrderListResponse, error)
ListStopOrders get all current untriggered stop orders
func (*Kucoin) MakeInnerTransfer ¶
func (ku *Kucoin) MakeInnerTransfer(ctx context.Context, amount float64, ccy currency.Code, clientOID, paymentAccountType, receivingAccountType, fromTag, toTag string) (string, error)
MakeInnerTransfer used to transfer funds between accounts internally possible account types: main, trade, trade_hf, margin, isolated, margin_v2, isolated_v2, contract
func (*Kucoin) MarginLendingSubscription ¶
func (ku *Kucoin) MarginLendingSubscription(ctx context.Context, ccy currency.Code, size, interestRate float64) (*OrderNumberResponse, error)
MarginLendingSubscription retrieves margin lending subscription information.
func (*Kucoin) ModifyHFOrder ¶
ModifyHFOrder modifies a high frequency order.
func (*Kucoin) ModifyLeverageMultiplier ¶
func (ku *Kucoin) ModifyLeverageMultiplier(ctx context.Context, symbol string, leverage int64, isIsolated bool) error
ModifyLeverageMultiplier this endpoint allows modifying the leverage multiplier for cross margin or isolated margin
func (*Kucoin) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*Kucoin) ModifySubAccountSpotAPIs ¶
func (ku *Kucoin) ModifySubAccountSpotAPIs(ctx context.Context, arg *SpotAPISubAccountParams) (*SpotAPISubAccount, error)
ModifySubAccountSpotAPIs modifies sub-account Spot APIs.
func (*Kucoin) ModifySubscriptionOrder ¶
func (ku *Kucoin) ModifySubscriptionOrder(ctx context.Context, ccy currency.Code, purchaseOrderNo string, interestRate float64) (*ModifySubscriptionOrderResponse, error)
ModifySubscriptionOrder is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour.
func (*Kucoin) OrderSideString ¶
OrderSideString converts an order.Side instance to a string representation
func (*Kucoin) PlaceMarginHFOrder ¶
func (ku *Kucoin) PlaceMarginHFOrder(ctx context.Context, arg *PlaceMarginHFOrderParam) (*MarginHFOrderResponse, error)
PlaceMarginHFOrder used to place cross-margin or isolated-margin high-frequency margin trading
func (*Kucoin) PlaceMarginHFOrderTest ¶
func (ku *Kucoin) PlaceMarginHFOrderTest(ctx context.Context, arg *PlaceMarginHFOrderParam) (*MarginHFOrderResponse, error)
PlaceMarginHFOrderTest used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.
func (*Kucoin) PlaceMultipleFuturesOrders ¶
func (ku *Kucoin) PlaceMultipleFuturesOrders(ctx context.Context, args []FuturesOrderParam) ([]FuturesOrderRespItem, error)
PlaceMultipleFuturesOrders used to place multiple futures orders The maximum limit orders for a single contract is 100 per account, and the maximum stop orders for a single contract is 50 per account
func (*Kucoin) PlaceMultipleOrders ¶
func (ku *Kucoin) PlaceMultipleOrders(ctx context.Context, args []PlaceHFParam) ([]PlaceOrderResp, error)
PlaceMultipleOrders endpoint supports sequential batch order placement from a single endpoint. A maximum of 5 orders can be placed simultaneously.
func (*Kucoin) PlaceOCOOrder ¶
PlaceOCOOrder creates a new One cancel other(OCO) order.
func (*Kucoin) PostBulkOrder ¶
func (ku *Kucoin) PostBulkOrder(ctx context.Context, symbol string, orderList []OrderRequest) ([]PostBulkOrderResp, error)
PostBulkOrder used to place 5 orders at the same time. The order type must be a limit order of the same symbol Note: it supports only SPOT trades Note: To check if order was posted successfully, check status field in response
func (*Kucoin) PostFuturesOrder ¶
PostFuturesOrder used to place two types of futures orders: limit and market
func (*Kucoin) PostFuturesOrderTest ¶
PostFuturesOrderTest a test endpoint to place a single futures order
func (*Kucoin) PostMarginBorrowOrder ¶
func (ku *Kucoin) PostMarginBorrowOrder(ctx context.Context, arg *MarginBorrowParam) (*BorrowAndRepaymentOrderResp, error)
PostMarginBorrowOrder used to post borrow order
func (*Kucoin) PostMarginOrder ¶
func (ku *Kucoin) PostMarginOrder(ctx context.Context, arg *MarginOrderParam) (*PostMarginOrderResp, error)
PostMarginOrder used to place two types of margin orders: limit and market
func (*Kucoin) PostMarginOrderTest ¶
func (ku *Kucoin) PostMarginOrderTest(ctx context.Context, arg *MarginOrderParam) (*PostMarginOrderResp, error)
PostMarginOrderTest a test endpoint used to place two types of margin orders: limit and margin.
func (*Kucoin) PostOrder ¶
PostOrder used to place two types of orders: limit and market Note: use this only for SPOT trades
func (*Kucoin) PostOrderTest ¶
PostOrderTest used to verify whether the signature is correct and other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.
func (*Kucoin) PostRepayment ¶
func (ku *Kucoin) PostRepayment(ctx context.Context, arg *RepayParam) (*BorrowAndRepaymentOrderResp, error)
PostRepayment used to initiate an application for the repayment of cross or isolated margin borrowing.
func (*Kucoin) PostStopOrder ¶
func (ku *Kucoin) PostStopOrder(ctx context.Context, clientOID, side, symbol, orderType, remark, stop, stp, tradeType, timeInForce string, size, price, stopPrice, cancelAfter, visibleSize, funds float64, postOnly, hidden, iceberg bool) (string, error)
PostStopOrder used to place two types of stop orders: limit and market
func (*Kucoin) RedeemByEarnHoldingID ¶
func (ku *Kucoin) RedeemByEarnHoldingID(ctx context.Context, orderID, fromAccountType, confirmPunishRedeem string, amount float64) (*EarnRedeem, error)
RedeemByEarnHoldingID allows initiating redemption by holding ID. If the current holding is fully redeemed or in the process of being redeemed, it indicates that the holding does not exist. Confirmation field for early redemption penalty: 1 (confirm early redemption, and the current holding will be fully redeemed). This parameter is valid only for fixed-term products
func (*Kucoin) Redemption ¶
func (ku *Kucoin) Redemption(ctx context.Context, ccy currency.Code, size float64, purchaseOrderNo string) (*OrderNumberResponse, error)
Redemption initiate redemptions of margin lending.
func (*Kucoin) RemoveMarginManually ¶
func (ku *Kucoin) RemoveMarginManually(ctx context.Context, arg *WithdrawMarginResponse) (*MarginRemovingResponse, error)
RemoveMarginManually removes a margin manually
func (*Kucoin) SeedLocalCache ¶
SeedLocalCache seeds depth data
func (*Kucoin) SeedLocalCacheWithBook ¶
func (ku *Kucoin) SeedLocalCacheWithBook(p currency.Pair, orderbookNew *Orderbook, assetType asset.Item) error
SeedLocalCacheWithBook seeds the local orderbook cache
func (*Kucoin) SendAuthHTTPRequest ¶
func (ku *Kucoin) SendAuthHTTPRequest(ctx context.Context, ePath exchange.URL, epl request.EndpointLimit, method, path string, arg, result interface{}) error
SendAuthHTTPRequest sends an authenticated HTTP request Request parameters are added to path variable for GET and DELETE request and for other requests its passed in params variable
func (*Kucoin) SendHTTPRequest ¶
func (ku *Kucoin) SendHTTPRequest(ctx context.Context, ePath exchange.URL, epl request.EndpointLimit, path string, result interface{}) error
SendHTTPRequest sends an unauthenticated HTTP request
func (*Kucoin) SendPlaceMarginHFOrder ¶
func (ku *Kucoin) SendPlaceMarginHFOrder(ctx context.Context, arg *PlaceMarginHFOrderParam, path string) (*MarginHFOrderResponse, error)
SendPlaceMarginHFOrder applies a high-frequency margin order placement or tests the order placement process.
func (*Kucoin) SendPostMarginOrder ¶
func (ku *Kucoin) SendPostMarginOrder(ctx context.Context, arg *MarginOrderParam, path string) (*PostMarginOrderResp, error)
SendPostMarginOrder applies a margin order placement or tests the order placement process.
func (*Kucoin) SendSpotHFPlaceOrder ¶
func (ku *Kucoin) SendSpotHFPlaceOrder(ctx context.Context, arg *PlaceHFParam, path string) (string, error)
SendSpotHFPlaceOrder sends a spot high-frequency order to the specified path Use HFSpotPlaceOrder to place an order or SpotPlaceHFOrderTest to send a test order
func (*Kucoin) SendSyncCancelHFOrder ¶
func (ku *Kucoin) SendSyncCancelHFOrder(ctx context.Context, id, symbol, path string) (*SyncCancelHFOrderResp, error)
SendSyncCancelHFOrder sends a sync-cancel high-frequency order by order ID or client supplied order ID.
func (*Kucoin) SetAutoDepositMargin ¶
func (ku *Kucoin) SetAutoDepositMargin(ctx context.Context, symbol string, status bool) (bool, error)
SetAutoDepositMargin enable/disable of auto-deposit margin
func (*Kucoin) SetCollateralMode ¶
SetCollateralMode sets the collateral type for your account
func (*Kucoin) SetDefaults ¶
func (ku *Kucoin) SetDefaults()
SetDefaults sets the basic defaults for Kucoin
func (*Kucoin) SetLeverage ¶
func (ku *Kucoin) SetLeverage(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type, _ float64, _ order.Side) error
SetLeverage sets the account's initial leverage for the asset type and pair
func (*Kucoin) SetMarginType ¶
func (ku *Kucoin) SetMarginType(_ context.Context, _ asset.Item, _ currency.Pair, _ margin.Type) error
SetMarginType sets the default margin type for when opening a new position
func (*Kucoin) SpotPlaceHFOrderTest ¶
SpotPlaceHFOrderTest order test endpoint, the request parameters and return parameters of this endpoint are exactly the same as the order endpoint, and can be used to verify whether the signature is correct and other operations.
func (*Kucoin) StringToOrderStatus ¶
StringToOrderStatus returns an order.Status instance from string.
func (*Kucoin) SubmitOrder ¶
SubmitOrder submits a new order For OCO (One Cancels the Other) orders, the StopLoss parameters under the order submission argument field RiskManagementModes are treated as stop values, and the TakeProfit parameters are treated as limit order.
func (*Kucoin) Subscribe ¶
func (ku *Kucoin) Subscribe(subscriptions subscription.List) error
Subscribe sends a websocket message to receive data from the channel
func (*Kucoin) SubscribeToEarnFixedIncomeProduct ¶
func (ku *Kucoin) SubscribeToEarnFixedIncomeProduct(ctx context.Context, productID, accountType string, amount float64) (*SusbcribeEarn, error)
SubscribeToEarnFixedIncomeProduct allows subscribing to fixed income products. If the subscription fails, it returns the corresponding error code.
func (*Kucoin) SyncCancelHFOrder ¶
func (ku *Kucoin) SyncCancelHFOrder(ctx context.Context, orderID, symbol string) (*SyncCancelHFOrderResp, error)
SyncCancelHFOrder this interface will synchronously return the order information after the order canceling is completed.
func (*Kucoin) SyncCancelHFOrderByClientOrderID ¶
func (ku *Kucoin) SyncCancelHFOrderByClientOrderID(ctx context.Context, clientOrderID, symbol string) (*SyncCancelHFOrderResp, error)
SyncCancelHFOrderByClientOrderID this interface will synchronously return the order information after the order canceling is completed.
func (*Kucoin) SyncPlaceHFOrder ¶
func (ku *Kucoin) SyncPlaceHFOrder(ctx context.Context, arg *PlaceHFParam) (*SyncPlaceHFOrderResp, error)
SyncPlaceHFOrder this interface will synchronously return the order information after the order matching is completed.
func (*Kucoin) SyncPlaceMultipleHFOrders ¶
func (ku *Kucoin) SyncPlaceMultipleHFOrders(ctx context.Context, args []PlaceHFParam) ([]SyncPlaceHFOrderResp, error)
SyncPlaceMultipleHFOrders this interface will synchronously return the order information after the order matching is completed
func (*Kucoin) SynchroniseWebsocketOrderbook ¶
func (ku *Kucoin) SynchroniseWebsocketOrderbook()
SynchroniseWebsocketOrderbook synchronises full orderbook for currency pair asset
func (*Kucoin) TransferFundsToFuturesAccount ¶
func (ku *Kucoin) TransferFundsToFuturesAccount(ctx context.Context, amount float64, ccy currency.Code, payAccountType string) error
TransferFundsToFuturesAccount helps in transferring funds from payee account to futures account
func (*Kucoin) TransferFuturesFundsToMainAccount ¶
func (ku *Kucoin) TransferFuturesFundsToMainAccount(ctx context.Context, amount float64, ccy currency.Code, recAccountType string) (*TransferRes, error)
TransferFuturesFundsToMainAccount helps in transferring funds from futures to main/trade account
func (*Kucoin) TransferMainToSubAccount ¶
func (ku *Kucoin) TransferMainToSubAccount(ctx context.Context, ccy currency.Code, amount float64, clientOID, direction, accountType, subAccountType, subUserID string) (string, error)
TransferMainToSubAccount used to transfer funds from main account to sub-account
func (*Kucoin) TransferToFuturesAccount ¶
func (ku *Kucoin) TransferToFuturesAccount(ctx context.Context, arg *FundTransferToFuturesParam) (*FundTransferToFuturesResponse, error)
TransferToFuturesAccount transfers fund from KuCoin Futures account to Main or Trade accounts.
func (*Kucoin) TransferToMainOrTradeAccount ¶
func (ku *Kucoin) TransferToMainOrTradeAccount(ctx context.Context, arg *FundTransferFuturesParam) (*InnerTransferToMainAndTradeResponse, error)
TransferToMainOrTradeAccount transfers fund from KuCoin Futures account to Main or Trade accounts.
func (*Kucoin) Unsubscribe ¶
func (ku *Kucoin) Unsubscribe(subscriptions subscription.List) error
Unsubscribe sends a websocket message to stop receiving data from the channel
func (*Kucoin) UpdateAccountInfo ¶
func (ku *Kucoin) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (account.Holdings, error)
UpdateAccountInfo retrieves balances for all enabled currencies
func (*Kucoin) UpdateOrderExecutionLimits ¶
UpdateOrderExecutionLimits updates order execution limits
func (*Kucoin) UpdateOrderbook ¶
func (ku *Kucoin) UpdateOrderbook(ctx context.Context, pair currency.Pair, assetType asset.Item) (*orderbook.Base, error)
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*Kucoin) UpdateTicker ¶
func (ku *Kucoin) UpdateTicker(ctx context.Context, p currency.Pair, assetType asset.Item) (*ticker.Price, error)
UpdateTicker updates and returns the ticker for a currency pair
func (*Kucoin) UpdateTickers ¶
UpdateTickers updates all currency pairs of a given asset type
func (*Kucoin) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*Kucoin) ValidateAPICredentials ¶
ValidateAPICredentials validates current credentials used for wrapper functionality
func (*Kucoin) ValidateCredentials ¶
ValidateCredentials validates current credentials used for wrapper
func (*Kucoin) WithdrawCryptocurrencyFunds ¶
func (ku *Kucoin) WithdrawCryptocurrencyFunds(ctx context.Context, withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted The endpoint was deprecated for futures, please transfer assets from the FUTURES account to the MAIN account first, and then withdraw from the MAIN account
func (*Kucoin) WithdrawFiatFunds ¶
func (ku *Kucoin) WithdrawFiatFunds(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*Kucoin) WithdrawFiatFundsToInternationalBank ¶
func (ku *Kucoin) WithdrawFiatFundsToInternationalBank(_ context.Context, _ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
type LedgerInfo ¶
type LedgerInfo struct { ID string `json:"id"` Currency string `json:"currency"` Amount types.Number `json:"amount"` Fee types.Number `json:"fee"` Balance types.Number `json:"balance"` AccountType string `json:"accountType"` BizType string `json:"bizType"` Direction string `json:"direction"` CreatedAt types.Time `json:"createdAt"` Context string `json:"context"` }
LedgerInfo represents account ledger information
type LendOrder ¶
type LendOrder struct { OrderID string `json:"orderId"` Currency string `json:"currency"` Size float64 `json:"size,string"` FilledSize float64 `json:"filledSize,string"` DailyIntRate float64 `json:"dailyIntRate,string"` Term int64 `json:"term"` CreatedAt types.Time `json:"createdAt"` }
LendOrder stores lend order
type LendingCurrencyInfo ¶
type LendingCurrencyInfo struct { Currency string `json:"currency"` PurchaseEnable bool `json:"purchaseEnable"` RedeemEnable bool `json:"redeemEnable"` Increment string `json:"increment"` MinPurchaseSize types.Number `json:"minPurchaseSize"` MinInterestRate types.Number `json:"minInterestRate"` MaxInterestRate types.Number `json:"maxInterestRate"` InterestIncrement string `json:"interestIncrement"` MaxPurchaseSize types.Number `json:"maxPurchaseSize"` MarketInterestRate types.Number `json:"marketInterestRate"` AutoPurchaseEnable bool `json:"autoPurchaseEnable"` }
LendingCurrencyInfo represents a lending currency information
type Level2Depth5Or20 ¶
type Level2Depth5Or20 struct { Asks [][2]types.Number `json:"asks"` Bids [][2]types.Number `json:"bids"` Timestamp types.Time `json:"timestamp"` }
Level2Depth5Or20 stores the orderbook data for the level 5 or level 20 orderbook
type LeveragedTokenInfo ¶
type LeveragedTokenInfo struct { Currency string `json:"currency"` NetAsset float64 `json:"netAsset"` IssuedSize types.Number `json:"issuedSize"` TargetLeverage types.Number `json:"targetLeverage"` ActualLeverage types.Number `json:"actualLeverage"` AssetsUnderManagement string `json:"assetsUnderManagement"` Basket string `json:"basket"` }
LeveragedTokenInfo represents a leveraged token information
type ListFills ¶
type ListFills struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNumber int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []Fill `json:"items"` }
ListFills represents fills response list detail
type MarginAccount ¶
type MarginAccount struct { AvailableBalance float64 `json:"availableBalance,string"` Currency string `json:"currency"` HoldBalance float64 `json:"holdBalance,string"` Liability float64 `json:"liability,string"` MaxBorrowSize float64 `json:"maxBorrowSize,string"` TotalBalance float64 `json:"totalBalance,string"` }
MarginAccount stores margin account data
type MarginAccounts ¶
type MarginAccounts struct { Accounts []MarginAccount `json:"accounts"` DebtRatio float64 `json:"debtRatio,string"` }
MarginAccounts stores margin accounts data
type MarginActiveSymbolDetail ¶
type MarginActiveSymbolDetail struct { SymbolSize int64 `json:"symbolSize"` Symbols []string `json:"symbols"` }
MarginActiveSymbolDetail represents an active high frequency margin symbols information
type MarginAssetDetail ¶
type MarginAssetDetail struct { Currency string `json:"currency"` BorrowEnabled bool `json:"borrowEnabled"` RepayEnabled bool `json:"repayEnabled"` TransferEnabled bool `json:"transferEnabled"` Borrowed types.Number `json:"borrowed"` TotalAsset types.Number `json:"totalAsset"` Available types.Number `json:"available"` Hold types.Number `json:"hold"` MaxBorrowSize types.Number `json:"maxBorrowSize"` Liability string `json:"liability"` Total types.Number `json:"total"` }
MarginAssetDetail represents an asset detailed information
type MarginBorrowParam ¶
type MarginBorrowParam struct { Currency currency.Code `json:"currency"` Size float64 `json:"size"` IsIsolated bool `json:"isisolated"` Symbol currency.Pair `json:"symbol"` TimeInForce string `json:"timeInForce"` }
MarginBorrowParam represents a margin borrow parameter
type MarginConfiguration ¶
type MarginConfiguration struct { CurrencyList []string `json:"currencyList"` WarningDebtRatio float64 `json:"warningDebtRatio,string"` LiqDebtRatio float64 `json:"liqDebtRatio,string"` MaxLeverage float64 `json:"maxLeverage"` }
MarginConfiguration stores margin configuration
type MarginHFOrderResponse ¶
type MarginHFOrderResponse struct { OrderID string `json:"orderId"` BorrowSize float64 `json:"borrowSize"` LoanApplyID string `json:"loanApplyId"` }
MarginHFOrderResponse represents a margin HF order creation response
type MarginInterestInfo ¶
type MarginInterestInfo struct { CreatedAt types.Time `json:"createdAt"` Currency string `json:"currency"` InterestAmount types.Number `json:"interestAmount"` DayRatio types.Number `json:"dayRatio"` }
MarginInterestInfo represents a margin account currency interest information
type MarginInterestRecords ¶
type MarginInterestRecords struct { Timestamp int64 `json:"timestamp"` CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []MarginInterestInfo `json:"items"` }
MarginInterestRecords represents a cross/isolated margin interest records
type MarginOrderParam ¶
type MarginOrderParam struct { ClientOrderID string `json:"clientOid"` Side string `json:"side"` Symbol currency.Pair `json:"symbol"` OrderType string `json:"type,omitempty"` Remark string `json:"remark,omitempty"` SelfTradePrevention string `json:"stp,omitempty"` // [Optional] self trade prevention , CN, CO, CB or DC. `CN` for Cancel newest, `DC` for Decrease and Cancel, `CO` for cancel oldest, and `CB` for Cancel both MarginModel string `json:"marginModel,omitempty"` // [Optional] The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default AutoBorrow bool `json:"autoBorrow,omitempty"` // [Optional] Auto-borrow to place order. The system will first borrow you funds at the optimal interest rate and then place an order for you. Currently autoBorrow parameter only supports cross mode, not isolated mode. When add this param, stop profit and stop loss are not supported AutoRepay bool `json:"autoRepay,omitempty"` Price float64 `json:"price,string,omitempty"` Size float64 `json:"size,omitempty,string"` TimeInForce string `json:"timeInForce,omitempty"` // [Optional] GTC, GTT, IOC, or FOK (default is GTC) CancelAfter int64 `json:"cancelAfter,omitempty"` // [Optional] cancel after n seconds, requires timeInForce to be GTT PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` Iceberg bool `json:"iceberg,omitempty"` VisibleSize float64 `json:"visibleSize,omitempty,string"` Funds float64 `json:"funds,string,omitempty"` }
MarginOrderParam represents the margin place order request parameters
type MarginPairConfig ¶
type MarginPairConfig struct { Symbol string `json:"symbol"` Name string `json:"name"` EnableTrading bool `json:"enableTrading"` Market string `json:"market"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` BaseIncrement types.Number `json:"baseIncrement"` BaseMinSize types.Number `json:"baseMinSize"` QuoteIncrement types.Number `json:"quoteIncrement"` QuoteMinSize types.Number `json:"quoteMinSize"` BaseMaxSize types.Number `json:"baseMaxSize"` QuoteMaxSize types.Number `json:"quoteMaxSize"` PriceIncrement types.Number `json:"priceIncrement"` FeeCurrency string `json:"feeCurrency"` PriceLimitRate types.Number `json:"priceLimitRate"` MinFunds types.Number `json:"minFunds"` }
MarginPairConfig represents a margin pair configuration detail
type MarginPairConfigs ¶
type MarginPairConfigs struct { Timestamp types.Time `json:"timestamp"` Items []MarginPairConfig `json:"items"` }
MarginPairConfigs querying the configuration of cross margin trading pairs
type MarginRemovingResponse ¶
type MarginRemovingResponse struct { Symbol string `json:"symbol"` WithdrawAmount float64 `json:"withdrawAmount"` }
MarginRemovingResponse represents a response data for margin response
type MarginRiskLimit ¶
type MarginRiskLimit struct { Currency string `json:"currency"` MaximumBorrowAmount float64 `json:"borrowMaxAmount,string"` MaxumumBuyAmount float64 `json:"buyMaxAmount,string"` MaximumHoldAmount float64 `json:"holdMaxAmount,string"` Precision int64 `json:"precision"` }
MarginRiskLimit stores margin risk limit
type MarkPrice ¶
type MarkPrice struct { Symbol string `json:"symbol"` Granularity int64 `json:"granularity"` TimePoint types.Time `json:"timePoint"` Value float64 `json:"value"` }
MarkPrice stores mark price data
type ModifyHFOrderParam ¶
type ModifyHFOrderParam struct { Symbol currency.Pair `json:"symbol"` ClientOrderID string `json:"clientOid,omitempty"` OrderID string `json:"orderId,omitempty"` NewPrice float64 `json:"newPrice,omitempty,string"` NewSize float64 `json:"newSize,omitempty,string"` }
ModifyHFOrderParam represents a modify high frequency order parameter
type ModifySubscriptionOrderResponse ¶
type ModifySubscriptionOrderResponse struct { Success bool `json:"success"` Code string `json:"code"` Msg string `json:"msg"` Retry bool `json:"retry"` }
ModifySubscriptionOrderResponse represents a modify subscription order response
type OCOOrderCancellationResponse ¶
type OCOOrderCancellationResponse struct {
CancelledOrderIDs []string `json:"cancelledOrderIds"`
}
OCOOrderCancellationResponse represents an order cancellation response
type OCOOrderDetail ¶
type OCOOrderDetail struct { OrderID string `json:"orderId"` Symbol string `json:"symbol"` ClientOid string `json:"clientOid"` OrderTime types.Time `json:"orderTime"` Status string `json:"status"` Orders []OCOOrderItem `json:"orders"` }
OCOOrderDetail represents an oco order detail via the order ID
type OCOOrderInfo ¶
type OCOOrderInfo struct { OrderID string `json:"orderId"` Symbol string `json:"symbol"` ClientOrderID string `json:"clientOid"` OrderTime types.Time `json:"orderTime"` Status string `json:"status"` }
OCOOrderInfo represents an order info
type OCOOrderItem ¶
type OCOOrderItem struct { ID string `json:"id"` Symbol string `json:"symbol"` Side string `json:"side"` Price types.Number `json:"price"` StopPrice types.Number `json:"stopPrice"` Size types.Number `json:"size"` Status string `json:"status"` }
OCOOrderItem represents an OCO order item
type OCOOrderParams ¶
type OCOOrderParams struct { Symbol currency.Pair `json:"symbol"` Side string `json:"side"` Price float64 `json:"price,string"` Size float64 `json:"size,string"` StopPrice float64 `json:"stopPrice,string"` LimitPrice float64 `json:"limitPrice,string"` // The limit order price after take-profit and stop-loss are triggered TradeType string `json:"tradeType,omitempty"` ClientOrderID string `json:"clientOid"` Remark string `json:"remark,omitempty"` }
OCOOrderParams represents a an OCO order creation parameter
type OCOOrders ¶
type OCOOrders struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []OCOOrderInfo `json:"items"` }
OCOOrders represents an OCO orders list
type OffExchangeFundingAndLoan ¶
type OffExchangeFundingAndLoan struct { MasterAccountUID string `json:"parentUid"` Orders []OffExchangeFundingAndLoanOrder `json:"orders"` LoanToValueRatio struct { TransferLtv types.Number `json:"transferLtv"` OnlyClosePosLtv types.Number `json:"onlyClosePosLtv"` DelayedLiquidationLtv types.Number `json:"delayedLiquidationLtv"` InstantLiquidationLtv types.Number `json:"instantLiquidationLtv"` CurrentLtv types.Number `json:"currentLtv"` } `json:"ltv"` TotalMarginAmount types.Number `json:"totalMarginAmount"` TransferMarginAmount types.Number `json:"transferMarginAmount"` Margins []ExchangeFundingAndLoanMargin `json:"margins"` }
OffExchangeFundingAndLoan represents information of off-exchange funding and loan
type OffExchangeFundingAndLoanOrder ¶
type OffExchangeFundingAndLoanOrder struct { OrderID string `json:"orderId"` Currency string `json:"currency"` Principal types.Number `json:"principal"` Interest types.Number `json:"interest"` }
OffExchangeFundingAndLoanOrder represents an exchange funding and loan order detail
type OrderDetail ¶
type OrderDetail struct { ID string `json:"id"` ClientOID string `json:"clientOid"` Symbol string `json:"symbol"` Side string `json:"side"` Type string `json:"type"` // optional Remark string `json:"remark"` // optional Stop string `json:"stop"` // optional StopPrice types.Number `json:"stopPrice"` // optional SelfTradePrevention string `json:"stp,omitempty"` // optional Price types.Number `json:"price"` Size types.Number `json:"size"` TimeInForce string `json:"timeInForce"` // optional CancelAfter int64 `json:"cancelAfter"` // optional PostOnly bool `json:"postOnly"` // optional Hidden bool `json:"hidden"` // optional Iceberg bool `json:"iceberg"` // optional VisibleSize types.Number `json:"visibleSize"` // optional Channel string `json:"channel"` OperationType string `json:"opType"` // operation type: DEAL Funds string `json:"funds"` DealFunds string `json:"dealFunds"` DealSize types.Number `json:"dealSize"` Fee types.Number `json:"fee"` FeeCurrency string `json:"feeCurrency"` StopTriggered bool `json:"stopTriggered"` Tags string `json:"tags"` IsActive bool `json:"isActive"` CancelExist bool `json:"cancelExist"` CreatedAt types.Time `json:"createdAt"` TradeType string `json:"tradeType"` // Used by HF Orders Active bool `json:"active"` InOrderBook bool `json:"inOrderBook"` LastUpdatedAt types.Time `json:"lastUpdatedAt"` // Added for HF Spot orders CancelledSize types.Number `json:"cancelledSize"` CancelledFunds string `json:"cancelledFunds"` RemainSize types.Number `json:"remainSize"` RemainFunds string `json:"remainFunds"` }
OrderDetail represents order detail
type OrderNumberResponse ¶
type OrderNumberResponse struct {
OrderNo string `json:"orderNo"`
}
OrderNumberResponse represents a response for margin trading lending and redemption
type OrderRequest ¶
type OrderRequest struct { ClientOID string `json:"clientOid"` Symbol string `json:"symbol"` Side string `json:"side"` Type string `json:"type,omitempty"` // optional Remark string `json:"remark,omitempty"` // optional Stop string `json:"stop,omitempty"` // optional StopPrice float64 `json:"stopPrice,string,omitempty"` // optional SelfTradePrevention string `json:"stp,omitempty"` // optional Price float64 `json:"price,string,omitempty"` Size float64 `json:"size,string,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` // optional CancelAfter int64 `json:"cancelAfter,omitempty"` // optional PostOnly bool `json:"postOnly,omitempty"` // optional Hidden bool `json:"hidden,omitempty"` // optional Iceberg bool `json:"iceberg,omitempty"` // optional VisibleSize string `json:"visibleSize,omitempty"` // optional }
OrderRequest represents place order request parameters
type Orderbook ¶
type Orderbook struct { Sequence int64 Bids []orderbook.Tranche Asks []orderbook.Tranche Time time.Time }
Orderbook stores the orderbook data
type OrderbookChanges ¶
type OrderbookChanges struct { Asks [][]types.Number `json:"asks"` Bids [][]types.Number `json:"bids"` }
OrderbookChanges represents orderbook ask and bid changes
type OrdersListResponse ¶
type OrdersListResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []OrderDetail `json:"items"` }
OrdersListResponse represents an order list response
type PlaceHFParam ¶
type PlaceHFParam struct { ClientOrderID string `json:"clientOid,omitempty"` Symbol currency.Pair `json:"symbol"` OrderType string `json:"type"` Side string `json:"side"` SelfTradePrevention string `json:"stp,omitempty"` OrderTags string `json:"tags,omitempty"` Remark string `json:"remark,omitempty"` // Additional 'limit' order parameters Price float64 `json:"price,string,omitempty"` Size float64 `json:"size,string,omitempty"` TimeInForce string `json:"timeInForce"` CancelAfter int64 `json:"cancelAfter"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` Iceberg bool `json:"iceberg"` VisibleSize float64 `json:"visibleSize"` // Additional 'market' parameters Funds string `json:"funds"` }
PlaceHFParam represents a place HF order parameters
func (*PlaceHFParam) ValidatePlaceOrderParams ¶
func (a *PlaceHFParam) ValidatePlaceOrderParams() error
ValidatePlaceOrderParams validates an order placement parameters.
type PlaceMarginHFOrderParam ¶
type PlaceMarginHFOrderParam struct { ClientOrderID string `json:"clientOid"` Side string `json:"side"` Symbol currency.Pair `json:"symbol"` OrderType string `json:"type,omitempty"` SelfTradePrevention string `json:"stp,omitempty"` IsIsolated bool `json:"isIsolated,omitempty"` AutoBorrow bool `json:"autoBorrow,omitempty"` AutoRepay bool `json:"autoRepay,omitempty"` Price float64 `json:"price,string"` Size float64 `json:"size,string"` TimeInForce string `json:"timeInForce,omitempty,string"` CancelAfter int64 `json:"cancelAfter,omitempty,string"` PostOnly bool `json:"postOnly,omitempty,string"` Hidden bool `json:"hidden,omitempty,string"` Iceberg bool `json:"iceberg,omitempty,string"` VisibleSize float64 `json:"visibleSize,omitempty,string"` Funds string `json:"funds,omitempty"` }
PlaceMarginHFOrderParam represents a margin HF order parameters
type PlaceOrderParams ¶
type PlaceOrderParams struct {
OrderList []PlaceHFParam `json:"orderList"`
}
PlaceOrderParams represents a batch place order parameters
type PlaceOrderResp ¶
PlaceOrderResp represents a place order response
type PostBulkOrderResp ¶
type PostBulkOrderResp struct { OrderRequest ID string `json:"id"` Channel string `json:"channel"` Status string `json:"status"` FailMsg string `json:"failMsg"` }
PostBulkOrderResp response data for submitting a bulk order
type PostMarginOrderResp ¶
type PostMarginOrderResp struct { OrderID string `json:"orderId"` BorrowSize float64 `json:"borrowSize"` LoanApplyID string `json:"loanApplyId"` }
PostMarginOrderResp represents response data for placing margin orders
type PurchaseSubscriptionOrdersResponse ¶
type PurchaseSubscriptionOrdersResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []PurchaseSubscriptionResponseItem `json:"items"` }
PurchaseSubscriptionOrdersResponse represents list of purchase subscription orders response
type PurchaseSubscriptionResponseItem ¶
type PurchaseSubscriptionResponseItem struct { Currency string `json:"currency"` PurchaseOrderNo string `json:"purchaseOrderNo"` PurchaseAmount types.Number `json:"purchaseAmount"` MatchSize types.Number `json:"matchSize"` RedeemSize types.Number `json:"redeemSize"` RedeemAmount types.Number `json:"redeemAmount"` LendAmount types.Number `json:"lendAmount"` InterestRate types.Number `json:"interestRate"` IncomeAmount types.Number `json:"incomeAmount"` IncomeSize types.Number `json:"incomeSize"` ApplyTime types.Time `json:"applyTime"` Status string `json:"status"` }
PurchaseSubscriptionResponseItem represents a purchase order subscription response single item
type RedemptionOrder ¶
type RedemptionOrder struct { Currency string `json:"currency"` PurchaseOrderNo string `json:"purchaseOrderNo"` RedeemOrderNo string `json:"redeemOrderNo"` RedeemAmount types.Number `json:"redeemAmount"` ReceiptAmount types.Number `json:"receiptAmount"` ApplyTime types.Time `json:"applyTime"` Status string `json:"status"` }
RedemptionOrder represents a single redemption order instance
type RedemptionOrdersResponse ¶
type RedemptionOrdersResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []RedemptionOrder `json:"items"` }
RedemptionOrdersResponse represents a response for querying list of redemption orders
type RepaidRecord ¶
type RepaidRecord struct { Interest float64 `json:"interest,string"` RepayTime types.Time `json:"repayTime"` // contains filtered or unexported fields }
RepaidRecord stores repaid record
type RepaidRecordsResponse ¶
type RepaidRecordsResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNumber int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []RepaidRecord `json:"items"` }
RepaidRecordsResponse stores list of repaid record details
type RepayParam ¶
type RepayParam struct { Currency currency.Code `json:"currency"` Size float64 `json:"size"` IsIsolated bool `json:"isisolated"` Symbol currency.Pair `json:"symbol"` }
RepayParam represents a repayment parameter for cross and isolated margin orders
type Response ¶
type Response struct { Data interface{} `json:"data"` Error }
Response represents response model and implements UnmarshalTo interface
type ServiceStatus ¶
ServiceStatus represents a service status message
type SpotAPISubAccount ¶
type SpotAPISubAccount struct { APIKey string `json:"apiKey"` IPWhitelist string `json:"ipWhitelist"` Permission string `json:"permission"` SubName string `json:"subName"` Remark string `json:"remark"` CreatedAt types.Time `json:"createdAt"` // TODO: to be removed if not used any other place APISecret string `json:"apiSecret"` Passphrase string `json:"passphrase"` APIVersion string `json:"apiVersion"` }
SpotAPISubAccount represents a Spot APIs for sub-accounts
type SpotAPISubAccountParams ¶
type SpotAPISubAccountParams struct { SubAccountName string `json:"subName"` Passphrase string `json:"passphrase"` Remark string `json:"remark"` Permission string `json:"permission,omitempty"` // Permissions(Only General、Spot、Futures、Margin permissions can be set, such as "General, Trade". The default is "General") IPWhitelist string `json:"ipWhitelist,omitempty"` // IP whitelist(You may add up to 20 IPs. Use a halfwidth comma to each IP) Expire int64 `json:"expire,string,omitempty"` // API expiration time; Never expire(default)-1,30Day30,90Day90,180Day180,360Day360 // used when modifying sub-account API key APIKey string `json:"apiKey"` }
SpotAPISubAccountParams parameters for Spot APIs for sub-accounts
type SpotOrderParam ¶
type SpotOrderParam struct { ClientOrderID string `json:"clientOid"` Side string `json:"side"` Symbol currency.Pair `json:"symbol"` OrderType string `json:"type,omitempty"` TradeType string `json:"tradeType,omitempty"` // [Optional] The type of trading : TRADE(Spot Trade), MARGIN_TRADE (Margin Trade). Default is TRADE Remark string `json:"remark,omitempty"` SelfTradePrevention string `json:"stp,omitempty"` // [Optional] self trade prevention , CN, CO, CB or DC. `CN` for Cancel newest, `DC` for Decrease and Cancel, `CO` for cancel oldest, and `CB` for Cancel both TimeInForce string `json:"timeInForce,omitempty"` // [Optional] GTC, GTT, IOC, or FOK (default is GTC) PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` Iceberg bool `json:"iceberg,omitempty"` ReduceOnly bool `json:"reduceOnly,omitempty"` CancelAfter int64 `json:"cancelAfter,omitempty"` Size float64 `json:"size,omitempty,string"` Price float64 `json:"price,string,omitempty"` VisibleSize float64 `json:"visibleSize,omitempty,string"` Funds float64 `json:"funds,string,omitempty"` }
SpotOrderParam represents the spot place order request parameters
type Stats24hrs ¶
type Stats24hrs struct { TickerInfoBase Time types.Time `json:"time"` }
Stats24hrs stores 24 hrs statistics
type StopOrder ¶
type StopOrder struct { OrderRequest ID string `json:"id"` UserID string `json:"userId"` Status string `json:"status"` Funds float64 `json:"funds,string"` Channel string `json:"channel"` Tags string `json:"tags"` DomainID string `json:"domainId"` TradeSource string `json:"tradeSource"` TradeType string `json:"tradeType"` FeeCurrency string `json:"feeCurrency"` TakerFeeRate string `json:"takerFeeRate"` MakerFeeRate string `json:"makerFeeRate"` CreatedAt types.Time `json:"createdAt"` OrderTime types.Time `json:"orderTime"` StopTriggerTime types.Time `json:"stopTriggerTime"` }
StopOrder holds a stop order detail
type StopOrderListResponse ¶
type StopOrderListResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNumber int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []StopOrder `json:"items"` }
StopOrderListResponse represents a list of spot orders details
type SubAccount ¶
type SubAccount struct { UserID string `json:"userId"` SubName string `json:"subName"` Type int64 `json:"type"` //type:1-rebot or type:0-nomal Remarks string `json:"remarks"` UID int64 `json:"uid"` Status int64 `json:"status"` Access string `json:"access"` CreatedAt types.Time `json:"createdAt"` }
SubAccount represents sub-user
type SubAccountBalanceDetail ¶
type SubAccountBalanceDetail struct { SubUserID string `json:"subUserId"` SubName string `json:"subName"` MainAccounts []SubAccountCurrencyBalanceDetail `json:"mainAccounts"` }
SubAccountBalanceDetail represents a sub-account balance detail
type SubAccountCreatedResponse ¶
type SubAccountCreatedResponse struct { UID int64 `json:"uid"` SubName string `json:"subName"` Remarks string `json:"remarks"` Access string `json:"access"` }
SubAccountCreatedResponse represents the sub-account response
type SubAccountCurrencyBalanceDetail ¶
type SubAccountCurrencyBalanceDetail struct { Currency string `json:"currency"` BaseCurrency string `json:"baseCurrency"` Balance types.Number `json:"balance"` Available types.Number `json:"available"` Holds types.Number `json:"holds"` BaseCurrencyPrice types.Number `json:"baseCurrencyPrice"` BaseAmount types.Number `json:"baseAmount"` }
SubAccountCurrencyBalanceDetail represents a sub-account currency balance detail
type SubAccountInfo ¶
type SubAccountInfo struct { SubUserID string `json:"subUserId"` SubName string `json:"subName"` MainAccounts []AccountCurrencyInfo `json:"mainAccounts"` TradeAccounts []AccountCurrencyInfo `json:"tradeAccounts"` MarginAccounts []AccountCurrencyInfo `json:"marginAccounts"` }
SubAccountInfo holds subaccount data for main, spot(trade), and margin accounts
type SubAccountResponse ¶
type SubAccountResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []SubAccount `json:"items"` }
SubAccountResponse represents the sub-user detail
type SubAccountV2Response ¶
type SubAccountV2Response struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []SubAccount `json:"items"` }
SubAccountV2Response represents a sub-account detailed response of V2
type SubAccounts ¶
type SubAccounts struct { SubUserID string `json:"subUserId"` SubName string `json:"subName"` MainAccounts []AccountBalance `json:"mainAccounts"` TradeAccounts []AccountBalance `json:"tradeAccounts"` MarginAccounts []AccountBalance `json:"marginAccounts"` }
SubAccounts represents subacounts detail and balances
type SubAccountsBalanceV2 ¶
type SubAccountsBalanceV2 struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []SubAccountBalanceDetail `json:"items"` }
SubAccountsBalanceV2 represents a sub-account balance detail through the V2 API
type SubAccountsResponse ¶
type SubAccountsResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNumber int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []SubAccountInfo `json:"items"` }
SubAccountsResponse represents a sub-accounts items response instance
func (*SubAccountsResponse) UnmarshalJSON ¶
func (a *SubAccountsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON valid data to SubAccountsResponse of return nil if the data is empty list. this is added to handle the empty list returned when there are no accounts.
type SusbcribeEarn ¶
type SusbcribeEarn struct { OrderID string `json:"orderId"` SubscriptionOrderID string `json:"orderTxId"` }
SusbcribeEarn represents a subscription to earn
type SymbolInfo ¶
type SymbolInfo struct { Symbol string `json:"symbol"` Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` FeeCurrency string `json:"feeCurrency"` Market string `json:"market"` BaseMinSize float64 `json:"baseMinSize,string"` QuoteMinSize float64 `json:"quoteMinSize,string"` BaseMaxSize float64 `json:"baseMaxSize,string"` QuoteMaxSize float64 `json:"quoteMaxSize,string"` BaseIncrement float64 `json:"baseIncrement,string"` QuoteIncrement float64 `json:"quoteIncrement,string"` PriceIncrement float64 `json:"priceIncrement,string"` PriceLimitRate float64 `json:"priceLimitRate,string"` MinFunds float64 `json:"minFunds,string"` IsMarginEnabled bool `json:"isMarginEnabled"` EnableTrading bool `json:"enableTrading"` }
SymbolInfo stores symbol information
type SyncCancelHFOrderResp ¶
type SyncCancelHFOrderResp struct { OrderID string `json:"orderId"` OriginSize types.Number `json:"originSize"` OriginFunds string `json:"originFunds"` DealSize types.Number `json:"dealSize"` RemainSize types.Number `json:"remainSize"` CanceledSize types.Number `json:"canceledSize"` Status string `json:"status"` }
SyncCancelHFOrderResp represents a cancel sync high frequency order
type SyncPlaceHFOrderResp ¶
type SyncPlaceHFOrderResp struct { OrderID string `json:"orderId"` OrderTime types.Time `json:"orderTime"` OriginSize types.Number `json:"originSize"` OriginFunds string `json:"originFunds"` DealSize types.Number `json:"dealSize"` DealFunds string `json:"dealFunds"` RemainSize types.Number `json:"remainSize"` RemainFunds types.Number `json:"remainFunds"` CanceledSize string `json:"canceledSize"` CanceledFunds string `json:"canceledFunds"` Status string `json:"status"` MatchTime types.Time `json:"matchTime"` }
SyncPlaceHFOrderResp represents a request parameter for high frequency sync orders
type Ticker ¶
type Ticker struct { Sequence string `json:"sequence"` BestAsk float64 `json:"bestAsk,string"` Size float64 `json:"size,string"` Price float64 `json:"price,string"` BestBidSize float64 `json:"bestBidSize,string"` BestBid float64 `json:"bestBid,string"` BestAskSize float64 `json:"bestAskSize,string"` Time types.Time `json:"time"` }
Ticker stores ticker data
type TickerInfo ¶
type TickerInfo struct { TickerInfoBase SymbolName string `json:"symbolName"` }
TickerInfo stores ticker information
type TickerInfoBase ¶
type TickerInfoBase struct { Symbol string `json:"symbol"` Buy float64 `json:"buy,string"` Sell float64 `json:"sell,string"` ChangeRate float64 `json:"changeRate,string"` ChangePrice float64 `json:"changePrice,string"` High float64 `json:"high,string"` Low float64 `json:"low,string"` Volume float64 `json:"vol,string"` VolumeValue float64 `json:"volValue,string"` Last float64 `json:"last,string"` AveragePrice float64 `json:"averagePrice,string"` TakerFeeRate float64 `json:"takerFeeRate,string"` MakerFeeRate float64 `json:"makerFeeRate,string"` TakerCoefficient float64 `json:"takerCoefficient,string"` MakerCoefficient float64 `json:"makerCoefficient,string"` BestBidSize float64 `json:"bestBidSize,string"` BestAskSize float64 `json:"bestAskSize,string"` }
TickerInfoBase represents base price ticker details
type TickersResponse ¶
type TickersResponse struct { Time types.Time `json:"time"` Tickers []TickerInfo `json:"ticker"` }
TickersResponse represents list of tickers and update timestamp information
type Trade ¶
type Trade struct { Sequence string `json:"sequence"` Price float64 `json:"price,string"` Size float64 `json:"size,string"` Side string `json:"side"` Time types.Time `json:"time"` }
Trade stores trade data
type TradingPairFee ¶
type TradingPairFee struct { Symbol string `json:"symbol"` TakerFeeRate types.Number `json:"takerFeeRate"` MakerFeeRate types.Number `json:"makerFeeRate"` }
TradingPairFee represents actual fee information of a trading fee
type TransactionVolume ¶
type TransactionVolume struct {
TurnoverOf24Hr float64 `json:"turnoverOf24h"`
}
TransactionVolume represents a 24 hour transaction volume
type Transfer ¶
type Transfer struct { TransferBase Offset int64 `json:"offset"` }
Transfer represents a transfer detail
type TransferBase ¶
type TransferBase struct { ApplyID string `json:"applyId"` Currency string `json:"currency"` RecRemark string `json:"recRemark"` RecSystem string `json:"recSystem"` Status string `json:"status"` Amount float64 `json:"amount,string"` Reason string `json:"reason"` CreatedAt types.Time `json:"createdAt"` Remark string `json:"remark"` }
TransferBase represents transfer base information
type TransferListsResponse ¶
type TransferListsResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []Transfer `json:"items"` }
TransferListsResponse represents a transfer lists detail
type TransferRes ¶
type TransferRes struct { TransferBase BizNo string `json:"bizNo"` PayAccountType string `json:"payAccountType"` PayTag string `json:"payTag"` RecAccountType string `json:"recAccountType"` RecTag string `json:"recTag"` Fee float64 `json:"fee,string"` Serial int64 `json:"sn"` UpdatedAt types.Time `json:"updatedAt"` }
TransferRes represents a transfer response
type TransferableBalanceInfo ¶
type TransferableBalanceInfo struct { AccountInfo Transferable float64 `json:"transferable,string"` }
TransferableBalanceInfo represents transferable balance information
type UniversalTransferParam ¶
type UniversalTransferParam struct { ClientSuppliedOrderID string `json:"clientOid"` Currency currency.Code `json:"currency"` Amount float64 `json:"amount"` FromUserID string `json:"fromUserId"` FromAccountType string `json:"fromAccountType"` // Account type:MAIN、TRADE、CONTRACT、MARGIN、ISOLATED、TRADE_HF、MARGIN_V2、ISOLATED_V2 FromAccountTag string `json:"fromAccountTag"` // Symbol, required when the account type is ISOLATED or ISOLATED_V2, for example: BTC-USDT TransferType string `json:"type"` // Transfer Type: Transfer type:INTERNAL、PARENT_TO_SUB,SUB_TO_PARENT ToUserID string `json:"toUserId"` ToAccountType string `json:"toAccountType"` ToAccountTag string `json:"toAccountTag"` }
UniversalTransferParam represents a universal transfer parameter
type UnmarshalTo ¶
type UnmarshalTo interface {
GetError() error
}
UnmarshalTo acts as interface to exchange API response
type UserRebateInfo ¶
type UserRebateInfo struct { M1UID string `json:"m1Uid"` Rcode string `json:"rcode"` M2UID string `json:"m2Uid"` Amount types.Number `json:"amount"` Rebate types.Number `json:"rebate"` CashBack types.Number `json:"cashBack"` Offset string `json:"offset"` }
UserRebateInfo represents a user rebate information
type VIPLendingAccounts ¶
type VIPLendingAccounts struct { UID string `json:"uid"` MarginCcy string `json:"marginCcy"` MarginQty types.Number `json:"marginQty"` MarginFactor types.Number `json:"marginFactor"` AccountType string `json:"accountType"` IsParent bool `json:"isParent"` }
VIPLendingAccounts represents VIP accounts involved in off-exchange loans
type WSConnMessages ¶
WSConnMessages represents response messages ping, pong, and welcome message structures
type WSInstanceServers ¶
type WSInstanceServers struct { Token string `json:"token"` InstanceServers []InstanceServer `json:"instanceServers"` }
WSInstanceServers response connection token and websocket instance server information
type WithdrawMarginResponse ¶
type WithdrawMarginResponse struct { Symbol string `json:"symbol"` WithdrawAmount float64 `json:"withdrawAmount"` }
WithdrawMarginResponse represents a response data after withdrawing a margin
type Withdrawal ¶
Withdrawal represents withdrawal funding information
type WithdrawalQuota ¶
type WithdrawalQuota struct { Currency string `json:"currency"` LimitBTCAmount float64 `json:"limitBTCAmount,string"` UsedBTCAmount float64 `json:"usedBTCAmount,string"` RemainAmount float64 `json:"remainAmount,string"` AvailableAmount float64 `json:"availableAmount,string"` WithdrawMinFee float64 `json:"withdrawMinFee,string"` InnerWithdrawMinFee float64 `json:"innerWithdrawMinFee,string"` WithdrawMinSize float64 `json:"withdrawMinSize,string"` IsWithdrawEnabled bool `json:"isWithdrawEnabled"` Precision int64 `json:"precision"` Chain string `json:"chain"` QuotaCurrency string `json:"quotaCurrency"` LimitQuotaCurrencyAmount types.Number `json:"limitQuotaCurrencyAmount"` Reason string `json:"reason"` UsedQuotaCurrencyAmount string `json:"usedQuotaCurrencyAmount"` }
WithdrawalQuota represents withdrawal quota detail information
type WithdrawalsResponse ¶
type WithdrawalsResponse struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` Items []Withdrawal `json:"items"` }
WithdrawalsResponse represents a withdrawals list of items details
type WsAccountBalance ¶
type WsAccountBalance struct { Total float64 `json:"total,string"` Available float64 `json:"available,string"` AvailableChange float64 `json:"availableChange,string"` Currency string `json:"currency"` Hold float64 `json:"hold,string"` HoldChange float64 `json:"holdChange,string"` RelationEvent string `json:"relationEvent"` RelationEventID string `json:"relationEventId"` RelationContext struct { Symbol string `json:"symbol"` TradeID string `json:"tradeId"` OrderID string `json:"orderId"` } `json:"relationContext"` Time types.Time `json:"time"` }
WsAccountBalance represents a Account Balance push data
type WsCandlestick ¶
type WsCandlestick struct { Symbol string `json:"symbol"` Candles struct { StartTime time.Time OpenPrice float64 ClosePrice float64 HighPrice float64 LowPrice float64 TransactionVolume float64 TransactionAmount float64 } `json:"candles"` Time time.Time `json:"time"` }
WsCandlestick represents candlestick information push data for a symbol
type WsCandlestickData ¶
type WsCandlestickData struct { Symbol string `json:"symbol"` Candles [7]string `json:"candles"` Time types.Time `json:"time"` }
WsCandlestickData represents candlestick information push data for a symbol
type WsDebtRatioChange ¶
type WsDebtRatioChange struct { DebtRatio float64 `json:"debtRatio"` TotalDebt float64 `json:"totalDebt,string"` DebtList map[string]string `json:"debtList"` Timestamp types.Time `json:"timestamp"` }
WsDebtRatioChange represents a push data
type WsFundingRate ¶
type WsFundingRate struct { Symbol string `json:"symbol"` Granularity int64 `json:"granularity"` FundingRate float64 `json:"fundingRate"` Timestamp types.Time `json:"timestamp"` }
WsFundingRate represents the funding rate push data information through the websocket channel
type WsFuturesAvailableBalance ¶
type WsFuturesAvailableBalance struct { AvailableBalance float64 `json:"availableBalance"` HoldBalance float64 `json:"holdBalance"` Currency string `json:"currency"` Timestamp types.Time `json:"timestamp"` }
WsFuturesAvailableBalance represents an available balance push data for futures account
type WsFuturesExecutionData ¶
type WsFuturesExecutionData struct { Sequence int64 `json:"sequence"` FilledQuantity float64 `json:"matchSize"` // Filled quantity UnfilledQuantity float64 `json:"size"` FilledPrice float64 `json:"price"` TradeID string `json:"tradeId"` MakerUserID string `json:"makerUserId"` Symbol string `json:"symbol"` Side string `json:"side"` TakerOrderID string `json:"takerOrderId"` MakerOrderID string `json:"makerOrderId"` TakerUserID string `json:"takerUserId"` Timestamp types.Time `json:"ts"` }
WsFuturesExecutionData represents execution data for symbol
type WsFuturesFundingBegin ¶
type WsFuturesFundingBegin struct { Subject string `json:"subject"` Symbol string `json:"symbol"` FundingTime types.Time `json:"fundingTime"` FundingRate float64 `json:"fundingRate"` Timestamp types.Time `json:"timestamp"` }
WsFuturesFundingBegin represents the Start Funding Fee Settlement
type WsFuturesKline ¶
type WsFuturesKline struct { Symbol string `json:"symbol"` Candles [7]types.Number `json:"candles"` // Start Time, Open Price, Close Price, High Price, Low Price, Transaction Volume, and Transaction Amount respectively Time types.Time `json:"time"` }
WsFuturesKline represents a futures kline data
type WsFuturesMarkPriceAndIndexPrice ¶
type WsFuturesMarkPriceAndIndexPrice struct { Symbol string `json:"symbol"` Granularity int64 `json:"granularity"` IndexPrice float64 `json:"indexPrice"` MarkPrice float64 `json:"markPrice"` Timestamp types.Time `json:"timestamp"` }
WsFuturesMarkPriceAndIndexPrice represents mark price and index price information
type WsFuturesMarkPricePositionChanges ¶
type WsFuturesMarkPricePositionChanges struct { MarkPrice float64 `json:"markPrice"` // Mark price MarkValue float64 `json:"markValue"` // Mark value MaintMargin float64 `json:"maintMargin"` // Position margin RealLeverage float64 `json:"realLeverage"` // Leverage of the order UnrealisedPnl float64 `json:"unrealisedPnl"` // Unrealised profit and lost UnrealisedRoePcnt float64 `json:"unrealisedRoePcnt"` // Rate of return on investment UnrealisedPnlPcnt float64 `json:"unrealisedPnlPcnt"` // Position profit and loss ratio DelevPercentage float64 `json:"delevPercentage"` // ADL ranking percentile CurrentTimestamp types.Time `json:"currentTimestamp"` // Current timestamp SettleCurrency string `json:"settleCurrency"` // Currency used to clear and settle the trades }
WsFuturesMarkPricePositionChanges represents futures account position change caused by mark price
type WsFuturesOrderMarginEvent ¶
type WsFuturesOrderMarginEvent struct { OrderMargin float64 `json:"orderMargin"` Currency string `json:"currency"` Timestamp types.Time `json:"timestamp"` }
WsFuturesOrderMarginEvent represents an order margin account balance event
type WsFuturesOrderbookInfo ¶
type WsFuturesOrderbookInfo struct { Sequence int64 `json:"sequence"` Change string `json:"change"` Timestamp types.Time `json:"timestamp"` }
WsFuturesOrderbookInfo represents Level 2 order book information
type WsFuturesPosition ¶
type WsFuturesPosition struct { RealisedGrossPnl float64 `json:"realisedGrossPnl"` // Accumulated realised profit and loss Symbol string `json:"symbol"` CrossMode bool `json:"crossMode"` // Cross mode or not LiquidationPrice float64 `json:"liquidationPrice"` // Liquidation price PosLoss float64 `json:"posLoss"` // Manually added margin amount AvgEntryPrice float64 `json:"avgEntryPrice"` // Average entry price UnrealisedPnl float64 `json:"unrealisedPnl"` // Unrealised profit and loss MarkPrice float64 `json:"markPrice"` // Mark price PosMargin float64 `json:"posMargin"` // Position margin AutoDeposit bool `json:"autoDeposit"` // Auto deposit margin or not RiskLimit float64 `json:"riskLimit"` UnrealisedCost float64 `json:"unrealisedCost"` // Unrealised value PosComm float64 `json:"posComm"` // Bankruptcy cost PosMaint float64 `json:"posMaint"` // Maintenance margin PosCost float64 `json:"posCost"` // Position value MaintMarginReq float64 `json:"maintMarginReq"` // Maintenance margin rate BankruptPrice float64 `json:"bankruptPrice"` // Bankruptcy price RealisedCost float64 `json:"realisedCost"` // Currently accumulated realised position value MarkValue float64 `json:"markValue"` // Mark value PosInit float64 `json:"posInit"` // Position margin RealisedPnl float64 `json:"realisedPnl"` // Realised profit and loss MaintMargin float64 `json:"maintMargin"` // Position margin RealLeverage float64 `json:"realLeverage"` // Leverage of the order ChangeReason string `json:"changeReason"` // changeReason:marginChange、positionChange、liquidation、autoAppendMarginStatusChange、adl CurrentCost float64 `json:"currentCost"` // Current position value OpeningTimestamp types.Time `json:"openingTimestamp"` // Open time CurrentQty float64 `json:"currentQty"` // Current position DelevPercentage float64 `json:"delevPercentage"` // ADL ranking percentile CurrentComm float64 `json:"currentComm"` // Current commission RealisedGrossCost float64 `json:"realisedGrossCost"` // Accumulated realised gross profit value IsOpen bool `json:"isOpen"` // Opened position or not PosCross float64 `json:"posCross"` // Manually added margin CurrentTimestamp types.Time `json:"currentTimestamp"` // Current timestamp UnrealisedRoePcnt float64 `json:"unrealisedRoePcnt"` // Rate of return on investment UnrealisedPnlPcnt float64 `json:"unrealisedPnlPcnt"` // Position profit and loss ratio SettleCurrency string `json:"settleCurrency"` // Currency used to clear and settle the trades }
WsFuturesPosition represents futures account position change event
type WsFuturesPositionFundingSettlement ¶
type WsFuturesPositionFundingSettlement struct { PositionSize float64 `json:"qty"` MarkPrice float64 `json:"markPrice"` FundingRate float64 `json:"fundingRate"` FundingFee float64 `json:"fundingFee"` FundingTime types.Time `json:"fundingTime"` CurrentTimestamp types.Time `json:"ts"` SettleCurrency string `json:"settleCurrency"` }
WsFuturesPositionFundingSettlement represents futures account position funding settlement push data
type WsFuturesTicker ¶
type WsFuturesTicker struct { Symbol string `json:"symbol"` Sequence int64 `json:"sequence"` Side string `json:"side"` FilledPrice types.Number `json:"price"` FilledSize types.Number `json:"size"` TradeID string `json:"tradeId"` BestBidSize types.Number `json:"bestBidSize"` BestBidPrice types.Number `json:"bestBidPrice"` BestAskPrice types.Number `json:"bestAskPrice"` BestAskSize types.Number `json:"bestAskSize"` FilledTime types.Time `json:"ts"` }
WsFuturesTicker represents a futures ticker push data
type WsFuturesTradeOrder ¶
type WsFuturesTradeOrder struct { OrderID string `json:"orderId"` Symbol string `json:"symbol"` Type string `json:"type"` // Message Type: "open", "match", "filled", "canceled", "update" Status string `json:"status"` // Order Status: "match", "open", "done" MatchSize string `json:"matchSize"` // Match Size (when the type is "match") MatchPrice string `json:"matchPrice"` // Match Price (when the type is "match") OrderType string `json:"orderType"` // Order Type, "market" indicates market order, "limit" indicates limit order Side string `json:"side"` // Trading direction,include buy and sell OrderPrice float64 `json:"price,string"` OrderSize float64 `json:"size,string"` RemainSize float64 `json:"remainSize,string"` FilledSize float64 `json:"filledSize,string"` // Remaining Size for Trading CanceledSize float64 `json:"canceledSize,string"` // In the update message, the Size of order reduced TradeID string `json:"tradeId"` // Trade ID (when the type is "match") ClientOid string `json:"clientOid"` // Client supplied order id OrderTime types.Time `json:"orderTime"` OldSize string `json:"oldSize "` // Size Before Update (when the type is "update") TradingDirection string `json:"liquidity"` // Liquidity, Trading direction, buy or sell in taker Timestamp types.Time `json:"ts"` }
WsFuturesTradeOrder represents trade order information according to the market
type WsFuturesTransactionStatisticsTimeEvent ¶
type WsFuturesTransactionStatisticsTimeEvent struct { Symbol string `json:"symbol"` Volume24H float64 `json:"volume"` Turnover24H float64 `json:"turnover"` LastPrice int64 `json:"lastPrice"` PriceChangePercentage24H float64 `json:"priceChgPct"` SnapshotTime types.Time `json:"ts"` }
WsFuturesTransactionStatisticsTimeEvent represents transaction statistics data
type WsFuturesWithdrawalAmountAndTransferOutAmountEvent ¶
type WsFuturesWithdrawalAmountAndTransferOutAmountEvent struct { WithdrawHold float64 `json:"withdrawHold"` // Current frozen amount for withdrawal Currency string `json:"currency"` Timestamp types.Time `json:"timestamp"` }
WsFuturesWithdrawalAmountAndTransferOutAmountEvent represents Withdrawal Amount & Transfer-Out Amount Event push data
type WsMarginTradeOrderDoneEvent ¶
type WsMarginTradeOrderDoneEvent struct { Currency string `json:"currency"` OrderID string `json:"orderId"` Reason string `json:"reason"` Side string `json:"side"` Timestamp types.Time `json:"ts"` }
WsMarginTradeOrderDoneEvent represents a push message to the lenders when the order is completed
type WsMarginTradeOrderEntersEvent ¶
type WsMarginTradeOrderEntersEvent struct { Currency string `json:"currency"` OrderID string `json:"orderId"` // Trade ID DailyIntRate float64 `json:"dailyIntRate"` // Daily interest rate Term int64 `json:"term"` // Term (Unit: Day) Size float64 `json:"size"` // Size LentSize float64 `json:"lentSize"` // Size executed -- filled when the subject is order.update Side string `json:"side"` // Lend or borrow. Currently, only "Lend" is available Timestamp types.Time `json:"ts"` // Timestamp (nanosecond) }
WsMarginTradeOrderEntersEvent represents a push data to the lenders when the order enters the order book or when the order is executed
type WsOrderbook ¶
type WsOrderbook struct { Changes OrderbookChanges `json:"changes"` SequenceEnd int64 `json:"sequenceEnd"` SequenceStart int64 `json:"sequenceStart"` Symbol string `json:"symbol"` TimeMS types.Time `json:"time"` }
WsOrderbook represents orderbook information
type WsOrderbookLevel5 ¶
type WsOrderbookLevel5 struct { Sequence int64 `json:"sequence"` Asks []orderbook.Tranche `json:"asks"` Bids []orderbook.Tranche `json:"bids"` PushTimestamp types.Time `json:"ts"` Timestamp types.Time `json:"timestamp"` }
WsOrderbookLevel5 represents an orderbook push data with depth level 5
type WsOrderbookLevel5Response ¶
type WsOrderbookLevel5Response struct { Sequence int64 `json:"sequence"` Bids [][2]types.Number `json:"bids"` Asks [][2]types.Number `json:"asks"` PushTimestamp types.Time `json:"ts"` Timestamp types.Time `json:"timestamp"` }
WsOrderbookLevel5Response represents a response data for an orderbook push data with depth level 5
func (*WsOrderbookLevel5Response) ExtractOrderbookItems ¶
func (a *WsOrderbookLevel5Response) ExtractOrderbookItems() *WsOrderbookLevel5
ExtractOrderbookItems returns WsOrderbookLevel5 instance from WsOrderbookLevel5Response
type WsPositionStatus ¶
type WsPositionStatus struct { Type string `json:"type"` TimestampMS types.Time `json:"timestamp"` }
WsPositionStatus represents a position status push data
type WsPriceIndicator ¶
type WsPriceIndicator struct { Symbol string `json:"symbol"` Granularity float64 `json:"granularity"` Timestamp types.Time `json:"timestamp"` Value float64 `json:"value"` }
WsPriceIndicator represents index price or mark price indicator push data
type WsPushData ¶
type WsPushData struct { ID string `json:"id"` Type string `json:"type"` Topic string `json:"topic"` UserID string `json:"userId"` Subject string `json:"subject"` ChannelType string `json:"channelType"` Data json.RawMessage `json:"data"` }
WsPushData represents a push data from a server
type WsSnapshot ¶
type WsSnapshot struct { Sequence types.Number `json:"sequence"` Data WsSnapshotDetail `json:"data"` }
WsSnapshot represents a spot ticker push data
type WsSnapshotDetail ¶
type WsSnapshotDetail struct { AveragePrice float64 `json:"averagePrice"` BaseCurrency string `json:"baseCurrency"` Board int64 `json:"board"` Buy float64 `json:"buy"` ChangePrice float64 `json:"changePrice"` ChangeRate float64 `json:"changeRate"` Close float64 `json:"close"` Datetime types.Time `json:"datetime"` High float64 `json:"high"` LastTradedPrice float64 `json:"lastTradedPrice"` Low float64 `json:"low"` MakerCoefficient float64 `json:"makerCoefficient"` MakerFeeRate float64 `json:"makerFeeRate"` MarginTrade bool `json:"marginTrade"` Mark float64 `json:"mark"` Market string `json:"market"` Markets []string `json:"markets"` Open float64 `json:"open"` QuoteCurrency string `json:"quoteCurrency"` Sell float64 `json:"sell"` Sort int64 `json:"sort"` Symbol string `json:"symbol"` SymbolCode string `json:"symbolCode"` TakerCoefficient float64 `json:"takerCoefficient"` TakerFeeRate float64 `json:"takerFeeRate"` Trading bool `json:"trading"` Vol float64 `json:"vol"` VolValue float64 `json:"volValue"` }
WsSnapshotDetail represents the detail of a spot ticker data This represents all websocket ticker information pushed as a result of subscription to /market/snapshot:{symbol}, and /market/snapshot:{currency,market}
type WsStopOrder ¶
type WsStopOrder struct { CreatedAt types.Time `json:"createdAt"` OrderID string `json:"orderId"` OrderPrice float64 `json:"orderPrice,string"` OrderType string `json:"orderType"` Side string `json:"side"` Size float64 `json:"size,string"` Stop string `json:"stop"` StopPrice float64 `json:"stopPrice,string"` Symbol string `json:"symbol"` TradeType string `json:"tradeType"` TriggerSuccess bool `json:"triggerSuccess"` Timestamp types.Time `json:"ts"` Type string `json:"type"` }
WsStopOrder represents a stop order When a stop order is received by the system, you will receive a message with "open" type It means that this order entered the system and waited to be triggered
type WsStopOrderLifecycleEvent ¶
type WsStopOrderLifecycleEvent struct { OrderID string `json:"orderId"` Symbol string `json:"symbol"` Type string `json:"type"` OrderType string `json:"orderType"` Side string `json:"side"` Size float64 `json:"size,string"` OrderPrice float64 `json:"orderPrice,string"` Stop string `json:"stop"` StopPrice float64 `json:"stopPrice,string"` StopPriceType string `json:"stopPriceType"` TriggerSuccess bool `json:"triggerSuccess"` Error string `json:"error"` CreatedAt types.Time `json:"createdAt"` Timestamp types.Time `json:"ts"` }
WsStopOrderLifecycleEvent represents futures stop order lifecycle event
type WsSubscriptionInput ¶
type WsSubscriptionInput struct { ID string `json:"id"` Type string `json:"type"` Topic string `json:"topic"` PrivateChannel bool `json:"privateChannel"` Response bool `json:"response,omitempty"` }
WsSubscriptionInput represents a subscription information structure
type WsTicker ¶
type WsTicker struct { Sequence string `json:"sequence"` BestAsk float64 `json:"bestAsk,string"` Size float64 `json:"size,string"` BestBidSize float64 `json:"bestBidSize,string"` Price float64 `json:"price,string"` BestAskSize float64 `json:"bestAskSize,string"` BestBid float64 `json:"bestBid,string"` Timestamp types.Time `json:"time"` }
WsTicker represents a ticker push data from server
type WsTrade ¶
type WsTrade struct { Sequence string `json:"sequence"` Type string `json:"type"` Symbol string `json:"symbol"` Side string `json:"side"` Price float64 `json:"price,string"` Size float64 `json:"size,string"` TradeID string `json:"tradeId"` TakerOrderID string `json:"takerOrderId"` MakerOrderID string `json:"makerOrderId"` Time types.Time `json:"time"` }
WsTrade represents a trade push data
type WsTradeOrder ¶
type WsTradeOrder struct { Symbol string `json:"symbol"` OrderType string `json:"orderType"` Side string `json:"side"` OrderID string `json:"orderId"` Type string `json:"type"` OrderTime types.Time `json:"orderTime"` Size float64 `json:"size,string"` FilledSize float64 `json:"filledSize,string"` Price float64 `json:"price,string"` ClientOid string `json:"clientOid"` RemainSize float64 `json:"remainSize,string"` Status string `json:"status"` Timestamp types.Time `json:"ts"` Liquidity string `json:"liquidity"` MatchPrice types.Number `json:"matchPrice"` MatchSize types.Number `json:"matchSize"` OldSize types.Number `json:"oldSize"` TradeID string `json:"tradeId"` }
WsTradeOrder represents a private trade order push data