Documentation ¶
Overview ¶
Package kucoin provides two kinds of APIs: `RESTful API` and `WebSocket feed`. The official document: https://docs.kucoin.com
Index ¶
- Constants
- Variables
- func IntToString(i int64) string
- func SetLoggerDirectory(directory string)
- func ToJsonString(v interface{}) string
- type AUtoCancelSettingModel
- type AccountHoldModel
- type AccountHoldsModel
- type AccountLedgerModel
- type AccountLedgersModel
- type AccountModel
- type AccountsModel
- type AccountsTransferableModel
- type ApiResponse
- type ApiService
- func (as *ApiService) Account(ctx context.Context, accountId string) (*ApiResponse, error)
- func (as *ApiService) AccountHolds(ctx context.Context, accountId string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) AccountLedgers(ctx context.Context, accountId string, startAt, endAt int64, ...) (*ApiResponse, error)
- func (as *ApiService) AccountLedgersV2(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) Accounts(ctx context.Context, currency, typo string) (*ApiResponse, error)
- func (as *ApiService) AccountsTransferable(ctx context.Context, currency, typo string) (*ApiResponse, error)
- func (as *ApiService) ActualFee(ctx context.Context, symbols string) (*ApiResponse, error)
- func (as *ApiService) AggregatedFullOrderBook(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) AggregatedFullOrderBookV3(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) AggregatedPartOrderBook(ctx context.Context, symbol string, depth int64) (*ApiResponse, error)
- func (as *ApiService) ApplyWithdrawal(ctx context.Context, currency, address, amount string, ...) (*ApiResponse, error)
- func (as *ApiService) AtomicFullOrderBook(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) AtomicFullOrderBookV2(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) BaseFee(ctx context.Context, currencyType string) (*ApiResponse, error)
- func (as *ApiService) BorrowOrder(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) BorrowOutstandingRecords(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) BorrowRepaidRecords(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) Call(ctx context.Context, request *Request) (*ApiResponse, error)
- func (as *ApiService) CancelLendOrder(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) CancelOrder(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) CancelOrderByClient(ctx context.Context, clientOid string) (*ApiResponse, error)
- func (as *ApiService) CancelOrders(ctx context.Context, p map[string]string) (*ApiResponse, error)
- func (as *ApiService) CancelStopOrder(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) CancelStopOrderBy(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) CancelStopOrderByClient(ctx context.Context, clientOid string, p map[string]string) (*ApiResponse, error)
- func (as *ApiService) CancelWithdrawal(ctx context.Context, withdrawalId string) (*ApiResponse, error)
- func (as *ApiService) CreateAccount(ctx context.Context, typo, currency string) (*ApiResponse, error)
- func (as *ApiService) CreateBorrowOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) CreateDepositAddress(ctx context.Context, currency, chain string) (*ApiResponse, error)
- func (as *ApiService) CreateEarnOrder(ctx context.Context, createEarnOrderReq *CreateEarnOrderReq) (*ApiResponse, error)
- func (as *ApiService) CreateLendOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) CreateMarginOrder(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
- func (as *ApiService) CreateMarginOrderTest(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
- func (as *ApiService) CreateMultiOrder(ctx context.Context, symbol string, orders []*CreateOrderModel) (*ApiResponse, error)
- func (as *ApiService) CreateOcoOrder(ctx context.Context, o *CreateOcoOrderModel) (*ApiResponse, error)
- func (as *ApiService) CreateOrder(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
- func (as *ApiService) CreateOrderTest(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
- func (as *ApiService) CreateStopOrder(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
- func (as *ApiService) CreateSubAccountV2(ctx context.Context, password, remarks, subName, access string) (*ApiResponse, error)
- func (as *ApiService) CreateSubApiKey(ctx context.Context, ...) (*ApiResponse, error)
- func (as *ApiService) Currencies(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) CurrenciesV3(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) Currency(ctx context.Context, currency string, chain string) (*ApiResponse, error)
- func (as *ApiService) CurrencyInfoV3(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) CurrencyV2(ctx context.Context, currency string, chain string) (*ApiResponse, error)
- func (as *ApiService) CurrentMarkPrice(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) DeleteEarnOrder(ctx context.Context, ...) (*ApiResponse, error)
- func (as *ApiService) DeleteOcoOrder(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) DeleteOcoOrderClientId(ctx context.Context, clientOrderId string) (*ApiResponse, error)
- func (as *ApiService) DeleteOcoOrders(ctx context.Context, symbol, orderIds string) (*ApiResponse, error)
- func (as *ApiService) DeleteSubApiKey(ctx context.Context, subName, passphrase, apiKey string) (*ApiResponse, error)
- func (as *ApiService) DepositAddresses(ctx context.Context, currency, chain string) (*ApiResponse, error)
- func (as *ApiService) DepositAddressesV2(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) Deposits(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) Fills(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) HfAccount(ctx context.Context, accountId string) (*ApiResponse, error)
- func (as *ApiService) HfAccountInnerTransfer(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) HfAccountLedgers(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) HfAccountTransferable(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) HfAccounts(ctx context.Context, currency, accountType string) (*ApiResponse, error)
- func (as *ApiService) HfAutoCancelSetting(ctx context.Context, timeout int64, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfCancelAllMarginOrdersV3(ctx context.Context, p *HfCancelAllMarginOrdersV3Req) (*ApiResponse, error)
- func (as *ApiService) HfCancelClientMarinOrderV3(ctx context.Context, p *HfCancelClientMarinOrderV3Req) (*ApiResponse, error)
- func (as *ApiService) HfCancelMarinOrderV3(ctx context.Context, p *HfCancelMarinOrderV3Req) (*ApiResponse, error)
- func (as *ApiService) HfCancelOrder(ctx context.Context, orderId, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfCancelOrderByClientId(ctx context.Context, clientOid, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfCancelOrders(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) HfCreateMarinOrderTestV3(ctx context.Context, p *HfMarginOrderV3Req) (*ApiResponse, error)
- func (as *ApiService) HfCreateMarinOrderV3(ctx context.Context, p *HfMarginOrderV3Req) (*ApiResponse, error)
- func (as *ApiService) HfMarginActiveSymbols(ctx context.Context, tradeType string) (*ApiResponse, error)
- func (as *ApiService) HfMarinActiveOrdersV3(ctx context.Context, p *HfMarinActiveOrdersV3Req) (*ApiResponse, error)
- func (as *ApiService) HfMarinClientOrderV3(ctx context.Context, p *HfMarinClientOrderV3Req) (*ApiResponse, error)
- func (as *ApiService) HfMarinDoneOrdersV3(ctx context.Context, p *HfMarinDoneOrdersV3Req) (*ApiResponse, error)
- func (as *ApiService) HfMarinFillsV3(ctx context.Context, p *HfMarinFillsV3Req) (*ApiResponse, error)
- func (as *ApiService) HfMarinOrderV3(ctx context.Context, p *HfMarinOrderV3Req) (*ApiResponse, error)
- func (as *ApiService) HfModifyOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) HfObtainActiveOrders(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfObtainActiveSymbols(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) HfObtainFilledOrders(ctx context.Context, p map[string]string) (*ApiResponse, error)
- func (as *ApiService) HfOrderDetail(ctx context.Context, orderId, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfOrderDetailByClientOid(ctx context.Context, clientOid, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfPlaceMultiOrders(ctx context.Context, orders []*HFCreateMultiOrderModel) (*ApiResponse, error)
- func (as *ApiService) HfPlaceOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) HfPlaceOrderTest(ctx context.Context, p *HfPlaceOrderReq) (*ApiResponse, error)
- func (as *ApiService) HfQueryAutoCancelSetting(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) HfSyncCancelAllOrders(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfSyncCancelOrder(ctx context.Context, orderId, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfSyncCancelOrderByClientId(ctx context.Context, clientOid, symbol string) (*ApiResponse, error)
- func (as *ApiService) HfSyncCancelOrderWithSize(ctx context.Context, orderId, symbol, cancelSize string) (*ApiResponse, error)
- func (as *ApiService) HfSyncPlaceMultiOrders(ctx context.Context, orders []*HFCreateMultiOrderModel) (*ApiResponse, error)
- func (as *ApiService) HfSyncPlaceOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) HfTransactionDetails(ctx context.Context, p map[string]string) (*ApiResponse, error)
- func (as *ApiService) InnerTransferV2(ctx context.Context, clientOid, currency, from, to, amount string) (*ApiResponse, error)
- func (as *ApiService) IsolatedAccount(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) IsolatedAccountsV3(ctx context.Context, symbol, quoteCurrency, queryType string) (*ApiResponse, error)
- func (as *ApiService) IsolatedBorrow(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) IsolatedBorrowOutstandingRecord(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) IsolatedBorrowRepaidRecord(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) IsolatedRepayAll(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) IsolatedRepaySingle(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) KLines(ctx context.Context, symbol, typo string, startAt, endAt int64) (*ApiResponse, error)
- func (as *ApiService) LendActiveOrders(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) LendAssets(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) LendDoneOrders(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) LendTradeSettledRecords(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) LendTradeUnsettledRecords(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) LendingPurchaseUpdateV3(ctx context.Context, p *LendingPurchaseUpdateV3Req) (*ApiResponse, error)
- func (as *ApiService) LendingPurchaseV3(ctx context.Context, p *LendingPurchaseV3Req) (*ApiResponse, error)
- func (as *ApiService) LendingRedeemV3(ctx context.Context, p *LendingRedeemV3Req) (*ApiResponse, error)
- func (as *ApiService) MarginAccount(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) MarginAccountsV3(ctx context.Context, quoteCurrency, queryType string) (*ApiResponse, error)
- func (as *ApiService) MarginBorrowV3(ctx context.Context, p *MarginBorrowV3Req) (*ApiResponse, error)
- func (as *ApiService) MarginConfig(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) MarginCurrencies(ctx context.Context, currency, symbol, isIsolated string) (*ApiResponse, error)
- func (as *ApiService) MarginCurrencyInfo(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) MarginIsolatedAccounts(ctx context.Context, balanceCurrency string) (*ApiResponse, error)
- func (as *ApiService) MarginIsolatedSymbols(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) MarginMarkets(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) MarginRepayV3(ctx context.Context, p *MarginRepay3VReq) (*ApiResponse, error)
- func (as *ApiService) MarginRiskLimit(ctx context.Context, marginModel string) (*ApiResponse, error)
- func (as *ApiService) MarginSymbolsV3(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) MarginTradeLast(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) Markets(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) NewWebSocketClient(token *WebSocketTokenModel) *WebSocketClient
- func (as *ApiService) NewWebSocketClientOpts(opts WebSocketClientOpts) *WebSocketClient
- func (as *ApiService) OcoClientOrder(ctx context.Context, clientOrderId string) (*ApiResponse, error)
- func (as *ApiService) OcoOrder(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) OcoOrderDetail(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) OcoOrders(ctx context.Context, p map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) Order(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) OrderByClient(ctx context.Context, clientOid string) (*ApiResponse, error)
- func (as *ApiService) Orders(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) Prices(ctx context.Context, base, currencies string) (*ApiResponse, error)
- func (as *ApiService) QueryETHProducts(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) QueryHoldAssets(ctx context.Context, productId, productCategory, currency string, ...) (*ApiResponse, error)
- func (as *ApiService) QueryInterestV3(ctx context.Context, p map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) QueryKCSStakingProducts(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) QueryMarginBorrowV3(ctx context.Context, p map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) QueryMarginCurrenciesV3(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) QueryMarginInterestRateV3(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) QueryMarginRepayV3(ctx context.Context, p map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) QueryOTCLoanAccountsInfo(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) QueryOTCLoanInfo(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) QueryPromotionProducts(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) QuerySavingProducts(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) QueryStakingProducts(ctx context.Context, currency string) (*ApiResponse, error)
- func (as *ApiService) RecentFills(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) RecentOrders(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) RedeemPreview(ctx context.Context, orderId, fromAccountType string) (*ApiResponse, error)
- func (as *ApiService) RedemptionOrdersV3(ctx context.Context, currency, status string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) RepayAll(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) RepaySingle(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) ServerTime(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) ServiceStatus(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) Stats24hr(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) StopOrder(ctx context.Context, orderId string) (*ApiResponse, error)
- func (as *ApiService) StopOrderByClient(ctx context.Context, clientOid string, p map[string]string) (*ApiResponse, error)
- func (as *ApiService) StopOrders(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) SubAccount(ctx context.Context, subUserId string) (*ApiResponse, error)
- func (as *ApiService) SubAccountUsers(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) SubAccountUsersV2(ctx context.Context, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) SubAccounts(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) SubAccountsV2(ctx context.Context, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) SubApiKey(ctx context.Context, subName, apiKey string) (*ApiResponse, error)
- func (as *ApiService) SubTransfer(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) SubTransferV2(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) SubscriptionOrdersV3(ctx context.Context, currency, status string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) Symbols(ctx context.Context, market string) (*ApiResponse, error)
- func (as *ApiService) SymbolsDetail(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) SymbolsV2(ctx context.Context, market string) (*ApiResponse, error)
- func (as *ApiService) TickerLevel1(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) Tickers(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) ToggleAutoLend(ctx context.Context, params map[string]string) (*ApiResponse, error)
- func (as *ApiService) TradeHistories(ctx context.Context, symbol string) (*ApiResponse, error)
- func (as *ApiService) UniversalTransfer(ctx context.Context, p *UniversalTransferReq) (*ApiResponse, error)
- func (as *ApiService) UpdateSubApiKey(ctx context.Context, ...) (*ApiResponse, error)
- func (as *ApiService) UpdateUserLeverageV3(ctx context.Context, p *UpdateUserLeverageV3Model) (*ApiResponse, error)
- func (as *ApiService) UserSummaryInfoV2(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) V1Deposits(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) V1Orders(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) V1Withdrawals(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- func (as *ApiService) WebSocketPrivateToken(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) WebSocketPublicToken(ctx context.Context) (*ApiResponse, error)
- func (as *ApiService) WithdrawalQuotas(ctx context.Context, currency, chain string) (*ApiResponse, error)
- func (as *ApiService) Withdrawals(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
- type ApiServiceOption
- func ApiBaseURIOption(uri string) ApiServiceOption
- func ApiKeyOption(key string) ApiServiceOption
- func ApiKeyVersionOption(apiKeyVersion string) ApiServiceOption
- func ApiPassPhraseOption(passPhrase string) ApiServiceOption
- func ApiRequesterOption(requester Requester) ApiServiceOption
- func ApiSecretOption(secret string) ApiServiceOption
- func ApiSkipVerifyTlsOption(skipVerifyTls bool) ApiServiceOption
- type ApplyWithdrawalResultModel
- type BaseFeeModel
- type BasicRequester
- type BorrowOrderModel
- type BorrowOutstandingRecordModel
- type BorrowOutstandingRecordsModel
- type BorrowRepaidRecordModel
- type BorrowRepaidRecordsModel
- type CancelOrderByClientResultModel
- type CancelOrderResultModel
- type CancelStopOrderByClientModel
- type CancelWithdrawalResultModel
- type CancelledOcoOrderResModel
- type ChainsModel
- type CreateAccountModel
- type CreateBorrowOrderResultModel
- type CreateEarnOrderReq
- type CreateEarnOrderRes
- type CreateLendOrderResultModel
- type CreateMultiOrderResultModel
- type CreateOcoOrderModel
- type CreateOrderModel
- type CreateOrderResultModel
- type CreateSubAccountV2Res
- type CreateSubApiKeyRes
- type CurrenciesModel
- type CurrenciesV3Model
- type CurrencyModel
- type CurrencyV2Model
- type CurrencyV3Model
- type DeleteEarnOrderRes
- type DeleteSubApiKeyRes
- type DepositAddressModel
- type DepositAddressesModel
- type DepositAddressesV2Model
- type DepositModel
- type DepositsModel
- type EarnProductModel
- type EarnProductsRes
- type FillModel
- type FillsModel
- type FullOrderBookModel
- type FullOrderBookV2Model
- type HFCreateMultiOrderModel
- type HFMarginActiveSymbolsModel
- type HfAccountInnerTransferRes
- type HfAccountLedgerModel
- type HfAccountLedgersModel
- type HfAccountModel
- type HfAccountTransferableModel
- type HfAccountsModel
- type HfAutoCancelSettingRes
- type HfCancelAllMarginOrdersV3Req
- type HfCancelAllMarginOrdersV3Resp
- type HfCancelClientMarinOrderV3Req
- type HfCancelClientMarinOrderV3Resp
- type HfCancelMarinOrderV3Req
- type HfCancelMarinOrderV3Resp
- type HfCancelOrdersFailedResultModel
- type HfCancelOrdersResultModel
- type HfClientOidModel
- type HfFilledOrdersModel
- type HfMarginOrderV3Req
- type HfMarginOrderV3Resp
- type HfMarinActiveOrdersV3Req
- type HfMarinActiveOrdersV3Resp
- type HfMarinClientOrderV3Req
- type HfMarinClientOrderV3Resp
- type HfMarinDoneOrdersV3Req
- type HfMarinDoneOrdersV3Resp
- type HfMarinFillsV3Req
- type HfMarinFillsV3Resp
- type HfMarinOrderV3Req
- type HfMarinOrderV3Resp
- type HfModifyOrderRes
- type HfOrderIdModel
- type HfOrderModel
- type HfOrdersModel
- type HfPlaceMultiOrdersRes
- type HfPlaceOrderReq
- type HfPlaceOrderRes
- type HfSymbolsModel
- type HfSyncCancelOrderRes
- type HfSyncCancelOrderWithSizeRes
- type HfSyncPlaceMultiOrdersRes
- type HfSyncPlaceOrderRes
- type HfTransactionDetailModel
- type HfTransactionDetailsModel
- type HoldAssetModel
- type HoldAssetsRes
- type InnerTransferResultModel
- type IsolatedBorrowOutstandingRecordModel
- type IsolatedBorrowOutstandingRecordsModel
- type IsolatedBorrowRepaidRecordRecordModel
- type IsolatedBorrowRepaidRecordRecordsModel
- type IsolatedCurrenciesRiskLimitModel
- type IsolatedCurrencyRiskLimitModel
- type KLineModel
- type KLinesModel
- type KcSigner
- type LendActiveOrderModel
- type LendActiveOrdersModel
- type LendAssetModel
- type LendAssetsModel
- type LendDoneOrderModel
- type LendDoneOrdersModel
- type LendOrderBaseModel
- type LendTradeSettledRecordModel
- type LendTradeSettledRecordsModel
- type LendTradeUnsettledRecordModel
- type LendTradeUnsettledRecordsModel
- type LendingPurchaseUpdateV3Req
- type LendingPurchaseV3Req
- type LendingRedeemV3Req
- type LendingV3Res
- type MarginAccountModel
- type MarginAccountV3Model
- type MarginBorrowV3Model
- type MarginBorrowV3Req
- type MarginBorrowV3Res
- type MarginBorrowsV3Model
- type MarginConfigModel
- type MarginCurrenciesModel
- type MarginCurrenciesRiskLimitModel
- type MarginCurrenciesV3Model
- type MarginCurrencyModel
- type MarginCurrencyRiskLimitModel
- type MarginCurrencyV3Model
- type MarginFillModel
- type MarginInterestRateV3Model
- type MarginInterestRatesV3Model
- type MarginInterestV3Model
- type MarginInterestsV3Model
- type MarginIsolatedAccountAssetsModel
- type MarginIsolatedAccountsModel
- type MarginIsolatedBorrowRes
- type MarginIsolatedSymbolModel
- type MarginIsolatedSymbolsModel
- type MarginMarketModel
- type MarginMarketsModel
- type MarginOrderV3Model
- type MarginRepay3VReq
- type MarginRepayV3Model
- type MarginRepayV3Res
- type MarginRepaysV3Model
- type MarginRiskLimitItemModel
- type MarginRiskLimitModel
- type MarginSymbolV3Model
- type MarginSymbolsV3Model
- type MarginTradeModel
- type MarginTradesModel
- type MarkPriceModel
- type MarketsModel
- type OTCAccountModel
- type OTCAccountsModel
- type OTCLoanModel
- type OcoOrderResModel
- type OcoOrdersModel
- type OcoOrdersRes
- type OcoSubOrderModel
- type OrderDetailModel
- type OrderModel
- type OrdersModel
- type PaginationModel
- type PaginationParam
- type PartOrderBookModel
- type PricesModel
- type RedeemPreviewModel
- type RedemptionOrderV3Model
- type RedemptionOrdersV3Model
- type Request
- type Requester
- type Response
- type ServerTimeModel
- type ServiceStatusModel
- type Sha256Signer
- type Signer
- type Stats24hrModel
- type StopOrderListModel
- type StopOrderModel
- type SubAccountModel
- type SubAccountUserModel
- type SubAccountUserModelV2
- type SubAccountUsersModel
- type SubAccountUsersModelV2
- type SubAccountsModel
- type SubApiKeyModel
- type SubApiKeyRes
- type SubTransferResultModel
- type SubscriptionOrderV3Model
- type SubscriptionOrdersV3Model
- type SymbolModel
- type SymbolModelV2
- type SymbolsModel
- type SymbolsModelV2
- type TickerLevel1Model
- type TickerModel
- type TickersModel
- type TickersResponseModel
- type TradeFeesResultModel
- type TradeHistoriesModel
- type TradeHistoryModel
- type UniversalTransferReq
- type UniversalTransferRes
- type UpdateSubApiKeyRes
- type UpdateUserLeverageV3Model
- type UserSummaryInfoModelV2
- type V1DepositModel
- type V1DepositsModel
- type V1OrderModel
- type V1OrdersModel
- type V1WithdrawalModel
- type V1WithdrawalsModel
- type WebSocketClient
- type WebSocketClientOpts
- type WebSocketDownstreamMessage
- type WebSocketMessage
- type WebSocketServerModel
- type WebSocketServersModel
- type WebSocketSubscribeMessage
- type WebSocketTokenModel
- type WebSocketUnsubscribeMessage
- type WithdrawalModel
- type WithdrawalQuotasModel
- type WithdrawalsModel
Constants ¶
const ( WelcomeMessage = "welcome" PingMessage = "ping" PongMessage = "pong" SubscribeMessage = "subscribe" AckMessage = "ack" UnsubscribeMessage = "unsubscribe" ErrorMessage = "error" Message = "message" Notice = "notice" Command = "command" )
All message types of WebSocket.
const ApiKeyVersionV1 = "1"
ApiKeyVersionV1 is v1 api key version
const ApiKeyVersionV2 = "2"
ApiKeyVersionV2 is v2 api key version
const (
ApiSuccess = "200000"
)
The predefined API codes
const ProductionApiBaseURI = "https://api.kucoin.com"
ProductionApiBaseURI is api base uri for production.
Variables ¶
var ( // Version is SDK version. Version = "1.2.10" // DebugMode will record the logs of API and WebSocket to files in the directory "kucoin.LogDirectory" according to the minimum log level "kucoin.LogLevel". DebugMode = os.Getenv("API_DEBUG_MODE") == "1" )
Functions ¶
func SetLoggerDirectory ¶ added in v1.1.5
func SetLoggerDirectory(directory string)
SetLoggerDirectory sets the directory for logrus output.
func ToJsonString ¶
func ToJsonString(v interface{}) string
ToJsonString converts any value to JSON string.
Types ¶
type AUtoCancelSettingModel ¶ added in v1.2.13
type AccountHoldModel ¶
type AccountHoldModel struct { Currency string `json:"currency"` HoldAmount string `json:"holdAmount"` BizType string `json:"bizType"` OrderId string `json:"orderId"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
An AccountHoldModel represents the holds on an account for any active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For a withdraw, once it is completed, the hold is removed.
type AccountHoldsModel ¶
type AccountHoldsModel []*AccountHoldModel
An AccountHoldsModel is the set of *AccountHoldModel.
type AccountLedgerModel ¶ added in v1.0.3
type AccountLedgerModel struct { ID string `json:"id"` Currency string `json:"currency"` Amount string `json:"amount"` Fee string `json:"fee"` Balance string `json:"balance"` AccountType string `json:"accountType"` BizType string `json:"bizType"` Direction string `json:"direction"` CreatedAt int64 `json:"createdAt"` Context json.RawMessage `json:"context"` }
An AccountLedgerModel represents account activity either increases or decreases your account balance.
type AccountLedgersModel ¶ added in v1.0.3
type AccountLedgersModel []*AccountLedgerModel
An AccountLedgersModel the set of *AccountLedgerModel.
type AccountModel ¶
type AccountModel struct { Id string `json:"id"` Currency string `json:"currency"` Type string `json:"type"` Balance string `json:"balance"` Available string `json:"available"` Holds string `json:"holds"` }
An AccountModel represents an account.
type AccountsModel ¶
type AccountsModel []*AccountModel
An AccountsModel is the set of *AccountModel.
type AccountsTransferableModel ¶ added in v1.2.10
type AccountsTransferableModel struct { Currency string `json:"currency"` Balance string `json:"balance"` Available string `json:"available"` Holds string `json:"holds"` Transferable string `json:"transferable"` }
AccountsTransferableModel RESPONSES of AccountsTransferable
type ApiResponse ¶
type ApiResponse struct { Code string `json:"code"` RawData json.RawMessage `json:"data"` // delay parsing Message string `json:"msg"` // contains filtered or unexported fields }
An ApiResponse represents a API response wrapped Response.
func (*ApiResponse) ApiSuccessful ¶
func (ar *ApiResponse) ApiSuccessful() bool
ApiSuccessful judges the success of API.
func (*ApiResponse) HttpSuccessful ¶
func (ar *ApiResponse) HttpSuccessful() bool
HttpSuccessful judges the success of http.
func (*ApiResponse) ReadData ¶
func (ar *ApiResponse) ReadData(v interface{}) error
ReadData read the api response `data` as JSON into v.
func (*ApiResponse) ReadPaginationData ¶
func (ar *ApiResponse) ReadPaginationData(v interface{}) (*PaginationModel, error)
ReadPaginationData read the data `items` as JSON into v, and returns *PaginationModel.
type ApiService ¶
type ApiService struct {
// contains filtered or unexported fields
}
An ApiService provides a HTTP client and a signer to make a HTTP request with the signature to KuCoin API.
func NewApiService ¶
func NewApiService(opts ...ApiServiceOption) *ApiService
NewApiService creates a instance of ApiService by passing ApiServiceOptions, then you can call methods.
func NewApiServiceFromEnv ¶
func NewApiServiceFromEnv() *ApiService
NewApiServiceFromEnv creates a instance of ApiService by environmental variables such as `API_BASE_URI` `API_KEY` `API_SECRET` `API_PASSPHRASE`, then you can call the methods of ApiService.
func (*ApiService) Account ¶
func (as *ApiService) Account(ctx context.Context, accountId string) (*ApiResponse, error)
Account returns an account when you know the accountId.
func (*ApiService) AccountHolds ¶
func (as *ApiService) AccountHolds(ctx context.Context, accountId string, pagination *PaginationParam) (*ApiResponse, error)
AccountHolds returns a list of currency hold. Holds are placed on an account for any active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For a withdraw, once it is completed, the hold is removed.
func (*ApiService) AccountLedgers ¶ added in v1.0.3
func (as *ApiService) AccountLedgers(ctx context.Context, accountId string, startAt, endAt int64, options map[string]string, pagination *PaginationParam) (*ApiResponse, error)
AccountLedgers returns a list of ledgers. Deprecated: This interface was discontinued on Nov 05, 2020. Please use AccountLedgersV2. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first. Deprecated
func (*ApiService) AccountLedgersV2 ¶ added in v1.2.8
func (as *ApiService) AccountLedgersV2(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
AccountLedgersV2 returns a list of ledgers. Recommended for use on Nov 05, 2020. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first.
func (*ApiService) Accounts ¶
func (as *ApiService) Accounts(ctx context.Context, currency, typo string) (*ApiResponse, error)
Accounts returns a list of accounts. See the Deposits section for documentation on how to deposit funds to begin trading.
func (*ApiService) AccountsTransferable ¶ added in v1.2.10
func (as *ApiService) AccountsTransferable(ctx context.Context, currency, typo string) (*ApiResponse, error)
AccountsTransferable returns the transferable balance of a specified account.
func (*ApiService) ActualFee ¶ added in v1.2.8
func (as *ApiService) ActualFee(ctx context.Context, symbols string) (*ApiResponse, error)
ActualFee returns the actual fee rate of the trading pair. You can inquire about fee rates of 10 trading pairs each time at most.
func (*ApiService) AggregatedFullOrderBook ¶
func (as *ApiService) AggregatedFullOrderBook(ctx context.Context, symbol string) (*ApiResponse, error)
AggregatedFullOrderBook returns a list of open orders(aggregated) for a symbol. Deprecated: Use AggregatedFullOrderBookV3/WebSocket instead.
func (*ApiService) AggregatedFullOrderBookV3 ¶ added in v1.2.10
func (as *ApiService) AggregatedFullOrderBookV3(ctx context.Context, symbol string) (*ApiResponse, error)
AggregatedFullOrderBookV3 returns a list of open orders(aggregated) for a symbol.
func (*ApiService) AggregatedPartOrderBook ¶ added in v1.0.3
func (as *ApiService) AggregatedPartOrderBook(ctx context.Context, symbol string, depth int64) (*ApiResponse, error)
AggregatedPartOrderBook returns a list of open orders(aggregated) for a symbol.
func (*ApiService) ApplyWithdrawal ¶
func (as *ApiService) ApplyWithdrawal(ctx context.Context, currency, address, amount string, options map[string]string) (*ApiResponse, error)
ApplyWithdrawal applies a withdrawal.
func (*ApiService) AtomicFullOrderBook ¶
func (as *ApiService) AtomicFullOrderBook(ctx context.Context, symbol string) (*ApiResponse, error)
AtomicFullOrderBook returns a list of open orders for a symbol. Level-3 order book includes all bids and asks (non-aggregated, each item in Level-3 means a single order).
func (*ApiService) AtomicFullOrderBookV2 ¶ added in v1.2.8
func (as *ApiService) AtomicFullOrderBookV2(ctx context.Context, symbol string) (*ApiResponse, error)
AtomicFullOrderBookV2 returns a list of open orders for a symbol. Level-3 order book includes all bids and asks (non-aggregated, each item in Level-3 means a single order).
func (*ApiService) BaseFee ¶ added in v1.2.8
func (as *ApiService) BaseFee(ctx context.Context, currencyType string) (*ApiResponse, error)
BaseFee returns the basic fee rate of users.
func (*ApiService) BorrowOrder ¶ added in v1.2.0
func (as *ApiService) BorrowOrder(ctx context.Context, orderId string) (*ApiResponse, error)
BorrowOrder returns a specific borrow order Deprecated please use QueryMarginBorrowV3
func (*ApiService) BorrowOutstandingRecords ¶ added in v1.2.0
func (as *ApiService) BorrowOutstandingRecords(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
BorrowOutstandingRecords returns borrow outstanding records
func (*ApiService) BorrowRepaidRecords ¶ added in v1.2.0
func (as *ApiService) BorrowRepaidRecords(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
BorrowRepaidRecords returns repaid borrow records Deprecated please use QueryMarginRepayV3
func (*ApiService) Call ¶
func (as *ApiService) Call(ctx context.Context, request *Request) (*ApiResponse, error)
Call calls the API by passing *Request and returns *ApiResponse.
func (*ApiService) CancelLendOrder ¶ added in v1.2.0
func (as *ApiService) CancelLendOrder(ctx context.Context, orderId string) (*ApiResponse, error)
CancelLendOrder cancel a lend order Deprecated please use LendingRedeemV3
func (*ApiService) CancelOrder ¶
func (as *ApiService) CancelOrder(ctx context.Context, orderId string) (*ApiResponse, error)
CancelOrder cancels a previously placed order.
func (*ApiService) CancelOrderByClient ¶ added in v1.2.8
func (as *ApiService) CancelOrderByClient(ctx context.Context, clientOid string) (*ApiResponse, error)
CancelOrderByClient cancels a previously placed order by client ID.
func (*ApiService) CancelOrders ¶
func (as *ApiService) CancelOrders(ctx context.Context, p map[string]string) (*ApiResponse, error)
CancelOrders cancels all orders of the symbol. With best effort, cancel all open orders. The response is a list of ids of the canceled orders.
func (*ApiService) CancelStopOrder ¶ added in v1.2.8
func (as *ApiService) CancelStopOrder(ctx context.Context, orderId string) (*ApiResponse, error)
CancelStopOrder cancels a previously placed stop-order.
func (*ApiService) CancelStopOrderBy ¶ added in v1.2.8
func (as *ApiService) CancelStopOrderBy(ctx context.Context, params map[string]string) (*ApiResponse, error)
CancelStopOrderBy returns a list your current orders.
func (*ApiService) CancelStopOrderByClient ¶ added in v1.2.8
func (as *ApiService) CancelStopOrderByClient(ctx context.Context, clientOid string, p map[string]string) (*ApiResponse, error)
CancelStopOrderByClient cancels a previously placed stop-order by client ID.
func (*ApiService) CancelWithdrawal ¶
func (as *ApiService) CancelWithdrawal(ctx context.Context, withdrawalId string) (*ApiResponse, error)
CancelWithdrawal cancels a withdrawal by withdrawalId.
func (*ApiService) CreateAccount ¶
func (as *ApiService) CreateAccount(ctx context.Context, typo, currency string) (*ApiResponse, error)
CreateAccount creates an account according to type(main|trade) and currency Parameter #1 typo is type of account. Deprecated
func (*ApiService) CreateBorrowOrder ¶ added in v1.2.0
func (as *ApiService) CreateBorrowOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
CreateBorrowOrder returns the result of create a borrow order Deprecated please use MarginBorrowV3
func (*ApiService) CreateDepositAddress ¶
func (as *ApiService) CreateDepositAddress(ctx context.Context, currency, chain string) (*ApiResponse, error)
CreateDepositAddress creates a deposit address.
func (*ApiService) CreateEarnOrder ¶ added in v1.2.15
func (as *ApiService) CreateEarnOrder(ctx context.Context, createEarnOrderReq *CreateEarnOrderReq) (*ApiResponse, error)
CreateEarnOrder subscribing to fixed income products. If the subscription fails, it returns the corresponding error code.
func (*ApiService) CreateLendOrder ¶ added in v1.2.0
func (as *ApiService) CreateLendOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
CreateLendOrder returns the result of create a lend order Deprecated please use LendingPurchaseV3
func (*ApiService) CreateMarginOrder ¶ added in v1.2.8
func (as *ApiService) CreateMarginOrder(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
CreateMarginOrder places a new margin order.
func (*ApiService) CreateMarginOrderTest ¶ added in v1.2.15
func (as *ApiService) CreateMarginOrderTest(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
CreateMarginOrderTest places a new margin test order.
func (*ApiService) CreateMultiOrder ¶ added in v1.2.5
func (as *ApiService) CreateMultiOrder(ctx context.Context, symbol string, orders []*CreateOrderModel) (*ApiResponse, error)
CreateMultiOrder places bulk orders.
func (*ApiService) CreateOcoOrder ¶ added in v1.2.14
func (as *ApiService) CreateOcoOrder(ctx context.Context, o *CreateOcoOrderModel) (*ApiResponse, error)
CreateOcoOrder places a new margin order.
func (*ApiService) CreateOrder ¶
func (as *ApiService) CreateOrder(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
CreateOrder places a new order.
func (*ApiService) CreateOrderTest ¶ added in v1.2.15
func (as *ApiService) CreateOrderTest(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
CreateOrderTest places a new order test.
func (*ApiService) CreateStopOrder ¶ added in v1.2.8
func (as *ApiService) CreateStopOrder(ctx context.Context, o *CreateOrderModel) (*ApiResponse, error)
CreateStopOrder places a new stop-order.
func (*ApiService) CreateSubAccountV2 ¶ added in v1.2.13
func (as *ApiService) CreateSubAccountV2(ctx context.Context, password, remarks, subName, access string) (*ApiResponse, error)
CreateSubAccountV2 Create sub account v2.
func (*ApiService) CreateSubApiKey ¶ added in v1.2.13
func (as *ApiService) CreateSubApiKey(ctx context.Context, subName, passphrase, remark, permission, ipWhitelist, expire string) (*ApiResponse, error)
CreateSubApiKey create sub api key of spot.
func (*ApiService) Currencies ¶
func (as *ApiService) Currencies(ctx context.Context) (*ApiResponse, error)
Currencies returns a list of known currencies.
func (*ApiService) CurrenciesV3 ¶ added in v1.2.15
func (as *ApiService) CurrenciesV3(ctx context.Context) (*ApiResponse, error)
func (*ApiService) Currency ¶
func (as *ApiService) Currency(ctx context.Context, currency string, chain string) (*ApiResponse, error)
Currency returns the details of the currency. Deprecated: Use CurrencyV2 instead.
func (*ApiService) CurrencyInfoV3 ¶ added in v1.2.15
func (as *ApiService) CurrencyInfoV3(ctx context.Context, currency string) (*ApiResponse, error)
CurrencyInfoV3 Request via this endpoint to get the currency details of a specified currency
func (*ApiService) CurrencyV2 ¶ added in v1.2.11
func (as *ApiService) CurrencyV2(ctx context.Context, currency string, chain string) (*ApiResponse, error)
CurrencyV2 returns the details of the currency.
func (*ApiService) CurrentMarkPrice ¶ added in v1.2.0
func (as *ApiService) CurrentMarkPrice(ctx context.Context, symbol string) (*ApiResponse, error)
CurrentMarkPrice returns current mark price of the input symbol
func (*ApiService) DeleteEarnOrder ¶ added in v1.2.15
func (as *ApiService) DeleteEarnOrder(ctx context.Context, orderId, amount, fromAccountType, confirmPunishRedeem string) (*ApiResponse, error)
DeleteEarnOrder initiating redemption by holding ID.
func (*ApiService) DeleteOcoOrder ¶ added in v1.2.14
func (as *ApiService) DeleteOcoOrder(ctx context.Context, orderId string) (*ApiResponse, error)
DeleteOcoOrder cancel a oco order. return CancelledOcoOrderResModel
func (*ApiService) DeleteOcoOrderClientId ¶ added in v1.2.14
func (as *ApiService) DeleteOcoOrderClientId(ctx context.Context, clientOrderId string) (*ApiResponse, error)
DeleteOcoOrderClientId cancel a oco order with clientOrderId. return CancelledOcoOrderResModel
func (*ApiService) DeleteOcoOrders ¶ added in v1.2.14
func (as *ApiService) DeleteOcoOrders(ctx context.Context, symbol, orderIds string) (*ApiResponse, error)
DeleteOcoOrders cancel all oco order. return CancelledOcoOrderResModel
func (*ApiService) DeleteSubApiKey ¶ added in v1.2.13
func (as *ApiService) DeleteSubApiKey(ctx context.Context, subName, passphrase, apiKey string) (*ApiResponse, error)
DeleteSubApiKey delete sub api key of spot.
func (*ApiService) DepositAddresses ¶
func (as *ApiService) DepositAddresses(ctx context.Context, currency, chain string) (*ApiResponse, error)
DepositAddresses returns the deposit address of currency for deposit. If return data is empty, you may need create a deposit address first.
func (*ApiService) DepositAddressesV2 ¶ added in v1.2.10
func (as *ApiService) DepositAddressesV2(ctx context.Context, currency string) (*ApiResponse, error)
DepositAddressesV2 Get all deposit addresses for the currency you intend to deposit. If the returned data is empty, you may need to create a deposit address first.
func (*ApiService) Deposits ¶
func (as *ApiService) Deposits(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
Deposits returns a list of deposit.
func (*ApiService) Fills ¶
func (as *ApiService) Fills(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
Fills returns a list of recent fills.
func (*ApiService) HfAccount ¶ added in v1.2.13
func (as *ApiService) HfAccount(ctx context.Context, accountId string) (*ApiResponse, error)
HfAccount Get the details of the high-frequency trading account
func (*ApiService) HfAccountInnerTransfer ¶ added in v1.2.13
func (as *ApiService) HfAccountInnerTransfer(ctx context.Context, params map[string]string) (*ApiResponse, error)
HfAccountInnerTransfer Users can transfer funds between their main account, trading account, and high-frequency trading account free of charge.
func (*ApiService) HfAccountLedgers ¶ added in v1.2.13
func (as *ApiService) HfAccountLedgers(ctx context.Context, params map[string]string) (*ApiResponse, error)
HfAccountLedgers 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 (*ApiService) HfAccountTransferable ¶ added in v1.2.13
func (as *ApiService) HfAccountTransferable(ctx context.Context, currency string) (*ApiResponse, error)
HfAccountTransferable This API can be used to obtain the amount of transferrable funds in high-frequency trading accounts.
func (*ApiService) HfAccounts ¶ added in v1.2.13
func (as *ApiService) HfAccounts(ctx context.Context, currency, accountType string) (*ApiResponse, error)
HfAccounts Get a list of high-frequency trading accounts.
func (*ApiService) HfAutoCancelSetting ¶ added in v1.2.13
func (as *ApiService) HfAutoCancelSetting(ctx context.Context, timeout int64, symbol string) (*ApiResponse, error)
HfAutoCancelSetting 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 (*ApiService) HfCancelAllMarginOrdersV3 ¶ added in v1.2.15
func (as *ApiService) HfCancelAllMarginOrdersV3(ctx context.Context, p *HfCancelAllMarginOrdersV3Req) (*ApiResponse, error)
HfCancelAllMarginOrdersV3 This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order detail or subscribing to websocket.
func (*ApiService) HfCancelClientMarinOrderV3 ¶ added in v1.2.15
func (as *ApiService) HfCancelClientMarinOrderV3(ctx context.Context, p *HfCancelClientMarinOrderV3Req) (*ApiResponse, error)
HfCancelClientMarinOrderV3 Cancel a single order by clientOid.
func (*ApiService) HfCancelMarinOrderV3 ¶ added in v1.2.15
func (as *ApiService) HfCancelMarinOrderV3(ctx context.Context, p *HfCancelMarinOrderV3Req) (*ApiResponse, error)
HfCancelMarinOrderV3 Cancel 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 (*ApiService) HfCancelOrder ¶ added in v1.2.13
func (as *ApiService) HfCancelOrder(ctx context.Context, orderId, symbol string) (*ApiResponse, error)
HfCancelOrder This endpoint can be used to cancel a high-frequency order by orderId.
func (*ApiService) HfCancelOrderByClientId ¶ added in v1.2.13
func (as *ApiService) HfCancelOrderByClientId(ctx context.Context, clientOid, symbol string) (*ApiResponse, error)
HfCancelOrderByClientId This endpoint sends out a request to cancel a high-frequency order using clientOid.
func (*ApiService) HfCancelOrders ¶ added in v1.2.14
func (as *ApiService) HfCancelOrders(ctx context.Context) (*ApiResponse, error)
HfCancelOrders This endpoint can be used to cancel all hf orders. return HfCancelOrdersResultModel
func (*ApiService) HfCreateMarinOrderTestV3 ¶ added in v1.2.15
func (as *ApiService) HfCreateMarinOrderTestV3(ctx context.Context, p *HfMarginOrderV3Req) (*ApiResponse, error)
HfCreateMarinOrderTestV3 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. After placing an order, the order will not enter the matching system, and the order cannot be queried.
func (*ApiService) HfCreateMarinOrderV3 ¶ added in v1.2.15
func (as *ApiService) HfCreateMarinOrderV3(ctx context.Context, p *HfMarginOrderV3Req) (*ApiResponse, error)
HfCreateMarinOrderV3 This interface is used to place cross-margin or isolated-margin high-frequency margin trading
func (*ApiService) HfMarginActiveSymbols ¶ added in v1.2.15
func (as *ApiService) HfMarginActiveSymbols(ctx context.Context, tradeType string) (*ApiResponse, error)
func (*ApiService) HfMarinActiveOrdersV3 ¶ added in v1.2.15
func (as *ApiService) HfMarinActiveOrdersV3(ctx context.Context, p *HfMarinActiveOrdersV3Req) (*ApiResponse, error)
HfMarinActiveOrdersV3 This interface is to obtain all active hf margin order lists, and the return value of the active order interface is the paged data of all uncompleted order lists.
func (*ApiService) HfMarinClientOrderV3 ¶ added in v1.2.15
func (as *ApiService) HfMarinClientOrderV3(ctx context.Context, p *HfMarinClientOrderV3Req) (*ApiResponse, error)
HfMarinClientOrderV3 This endpoint can be used to obtain information for a single margin HF order using the clientOid.
func (*ApiService) HfMarinDoneOrdersV3 ¶ added in v1.2.15
func (as *ApiService) HfMarinDoneOrdersV3(ctx context.Context, p *HfMarinDoneOrdersV3Req) (*ApiResponse, error)
HfMarinDoneOrdersV3 This endpoint obtains a 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 (*ApiService) HfMarinFillsV3 ¶ added in v1.2.15
func (as *ApiService) HfMarinFillsV3(ctx context.Context, p *HfMarinFillsV3Req) (*ApiResponse, error)
HfMarinFillsV3 This endpoint can be used 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 (*ApiService) HfMarinOrderV3 ¶ added in v1.2.15
func (as *ApiService) HfMarinOrderV3(ctx context.Context, p *HfMarinOrderV3Req) (*ApiResponse, error)
HfMarinOrderV3 This endpoint can be used to obtain information for a single margin HF order using the order id.
func (*ApiService) HfModifyOrder ¶ added in v1.2.13
func (as *ApiService) HfModifyOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
HfModifyOrder This interface can modify the price and quantity of the order according to orderId or clientOid.
func (*ApiService) HfObtainActiveOrders ¶ added in v1.2.13
func (as *ApiService) HfObtainActiveOrders(ctx context.Context, symbol string) (*ApiResponse, error)
HfObtainActiveOrders This endpoint obtains a list of all active HF orders. The return data is sorted in descending order based on the latest update times.
func (*ApiService) HfObtainActiveSymbols ¶ added in v1.2.13
func (as *ApiService) HfObtainActiveSymbols(ctx context.Context) (*ApiResponse, error)
HfObtainActiveSymbols This interface can query all trading pairs that the user has active orders
func (*ApiService) HfObtainFilledOrders ¶ added in v1.2.13
func (as *ApiService) HfObtainFilledOrders(ctx context.Context, p map[string]string) (*ApiResponse, error)
HfObtainFilledOrders This endpoint 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 (*ApiService) HfOrderDetail ¶ added in v1.2.13
func (as *ApiService) HfOrderDetail(ctx context.Context, orderId, symbol string) (*ApiResponse, error)
HfOrderDetail This endpoint can be used to obtain information for a single HF order using the order id.
func (*ApiService) HfOrderDetailByClientOid ¶ added in v1.2.13
func (as *ApiService) HfOrderDetailByClientOid(ctx context.Context, clientOid, symbol string) (*ApiResponse, error)
HfOrderDetailByClientOid The endpoint can be 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 (*ApiService) HfPlaceMultiOrders ¶ added in v1.2.13
func (as *ApiService) HfPlaceMultiOrders(ctx context.Context, orders []*HFCreateMultiOrderModel) (*ApiResponse, error)
HfPlaceMultiOrders This endpoint supports sequential batch order placement from a single endpoint. A maximum of 5orders can be placed simultaneously. The order types must be limit orders of the same trading pair (this endpoint currently only supports spot trading and does not support margin trading)
func (*ApiService) HfPlaceOrder ¶ added in v1.2.13
func (as *ApiService) HfPlaceOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
HfPlaceOrder 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 (*ApiService) HfPlaceOrderTest ¶ added in v1.2.15
func (as *ApiService) HfPlaceOrderTest(ctx context.Context, p *HfPlaceOrderReq) (*ApiResponse, error)
func (*ApiService) HfQueryAutoCancelSetting ¶ added in v1.2.13
func (as *ApiService) HfQueryAutoCancelSetting(ctx context.Context) (*ApiResponse, error)
HfQueryAutoCancelSetting Through this interface, you can query the settings of automatic order cancellation
func (*ApiService) HfSyncCancelAllOrders ¶ added in v1.2.13
func (as *ApiService) HfSyncCancelAllOrders(ctx context.Context, symbol string) (*ApiResponse, error)
HfSyncCancelAllOrders his endpoint allows cancellation of all orders related to a specific trading pair with a status of open (including all orders pertaining to high-frequency trading accounts and non-high-frequency trading accounts)
func (*ApiService) HfSyncCancelOrder ¶ added in v1.2.13
func (as *ApiService) HfSyncCancelOrder(ctx context.Context, orderId, symbol string) (*ApiResponse, error)
HfSyncCancelOrder The difference between this interface and "Cancel orders by orderId" is that this interface will synchronously return the order information after the order canceling is completed.
func (*ApiService) HfSyncCancelOrderByClientId ¶ added in v1.2.13
func (as *ApiService) HfSyncCancelOrderByClientId(ctx context.Context, clientOid, symbol string) (*ApiResponse, error)
HfSyncCancelOrderByClientId The difference between this interface and "Cancellation of order by clientOid" is that this interface will synchronously return the order information after the order canceling is completed.
func (*ApiService) HfSyncCancelOrderWithSize ¶ added in v1.2.13
func (as *ApiService) HfSyncCancelOrderWithSize(ctx context.Context, orderId, symbol, cancelSize string) (*ApiResponse, error)
HfSyncCancelOrderWithSize This interface can cancel the specified quantity of the order according to the orderId.
func (*ApiService) HfSyncPlaceMultiOrders ¶ added in v1.2.13
func (as *ApiService) HfSyncPlaceMultiOrders(ctx context.Context, orders []*HFCreateMultiOrderModel) (*ApiResponse, error)
HfSyncPlaceMultiOrders The request parameters of this interface are the same as those of the "Sync place multiple hf orders" interface The difference between this interface and "Sync place multiple hf orders" is that this interface will synchronously return the order information after the order matching is completed.
func (*ApiService) HfSyncPlaceOrder ¶ added in v1.2.13
func (as *ApiService) HfSyncPlaceOrder(ctx context.Context, params map[string]string) (*ApiResponse, error)
HfSyncPlaceOrder The difference between this interface and "Place hf order" is that this interface will synchronously return the order information after the order matching is completed. For higher latency requirements, please select the "Place hf order" interface. If there is a requirement for returning data integrity, please select this interface
func (*ApiService) HfTransactionDetails ¶ added in v1.2.13
func (as *ApiService) HfTransactionDetails(ctx context.Context, p map[string]string) (*ApiResponse, error)
HfTransactionDetails This endpoint can be used to obtain a list of the latest HF transaction details. The returned results are paginated. The data is sorted in descending order according to time.
func (*ApiService) InnerTransferV2 ¶ added in v1.1.3
func (as *ApiService) InnerTransferV2(ctx context.Context, clientOid, currency, from, to, amount string) (*ApiResponse, error)
InnerTransferV2 makes a currency transfer internally. Recommended for use on June 5, 2019. The inner transfer interface is used for transferring assets between the accounts of a user and is free of charges. For example, a user could transfer assets from their main account to their trading account on the platform.
func (*ApiService) IsolatedAccount ¶ added in v1.2.13
func (as *ApiService) IsolatedAccount(ctx context.Context, symbol string) (*ApiResponse, error)
IsolatedAccount query margin isolated account by symbol
func (*ApiService) IsolatedAccountsV3 ¶ added in v1.2.14
func (as *ApiService) IsolatedAccountsV3(ctx context.Context, symbol, quoteCurrency, queryType string) (*ApiResponse, error)
IsolatedAccountsV3 returns Isolated accounts of user v3.
func (*ApiService) IsolatedBorrow ¶ added in v1.2.13
func (as *ApiService) IsolatedBorrow(ctx context.Context, params map[string]string) (*ApiResponse, error)
IsolatedBorrow margin isolated borrow Deprecated
func (*ApiService) IsolatedBorrowOutstandingRecord ¶ added in v1.2.13
func (as *ApiService) IsolatedBorrowOutstandingRecord(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
IsolatedBorrowOutstandingRecord query margin isolated borrow outstanding records Deprecated
func (*ApiService) IsolatedBorrowRepaidRecord ¶ added in v1.2.13
func (as *ApiService) IsolatedBorrowRepaidRecord(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
IsolatedBorrowRepaidRecord query margin isolated borrow repaid records Deprecated
func (*ApiService) IsolatedRepayAll ¶ added in v1.2.13
func (as *ApiService) IsolatedRepayAll(ctx context.Context, params map[string]string) (*ApiResponse, error)
IsolatedRepayAll repay all isolated Deprecated
func (*ApiService) IsolatedRepaySingle ¶ added in v1.2.13
func (as *ApiService) IsolatedRepaySingle(ctx context.Context, params map[string]string) (*ApiResponse, error)
IsolatedRepaySingle repay single isolated Deprecated
func (*ApiService) KLines ¶ added in v1.0.5
func (as *ApiService) KLines(ctx context.Context, symbol, typo string, startAt, endAt int64) (*ApiResponse, error)
KLines returns the k lines for a symbol. Data are returned in grouped buckets based on requested type. Parameter #2 typo is the type of candlestick patterns.
func (*ApiService) LendActiveOrders ¶ added in v1.2.0
func (as *ApiService) LendActiveOrders(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
LendActiveOrders returns the active lend orders Deprecated
func (*ApiService) LendAssets ¶ added in v1.2.0
func (as *ApiService) LendAssets(ctx context.Context, currency string) (*ApiResponse, error)
LendAssets returns account lend assets Deprecated
func (*ApiService) LendDoneOrders ¶ added in v1.2.0
func (as *ApiService) LendDoneOrders(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
LendDoneOrders returns the history lend orders Deprecated
func (*ApiService) LendTradeSettledRecords ¶ added in v1.2.0
func (as *ApiService) LendTradeSettledRecords(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
LendTradeSettledRecords returns settled lend records Deprecated
func (*ApiService) LendTradeUnsettledRecords ¶ added in v1.2.0
func (as *ApiService) LendTradeUnsettledRecords(ctx context.Context, currency string, pagination *PaginationParam) (*ApiResponse, error)
LendTradeUnsettledRecords returns unsettled lend records Deprecated
func (*ApiService) LendingPurchaseUpdateV3 ¶ added in v1.2.15
func (as *ApiService) LendingPurchaseUpdateV3(ctx context.Context, p *LendingPurchaseUpdateV3Req) (*ApiResponse, error)
LendingPurchaseUpdateV3 update the interest rates of subscription orders, which will take effect at the beginning of the next hour.
func (*ApiService) LendingPurchaseV3 ¶ added in v1.2.15
func (as *ApiService) LendingPurchaseV3(ctx context.Context, p *LendingPurchaseV3Req) (*ApiResponse, error)
LendingPurchaseV3 Initiate subscriptions of margin lending.
func (*ApiService) LendingRedeemV3 ¶ added in v1.2.15
func (as *ApiService) LendingRedeemV3(ctx context.Context, p *LendingRedeemV3Req) (*ApiResponse, error)
LendingRedeemV3 Initiate redemptions of margin lending.
func (*ApiService) MarginAccount ¶ added in v1.2.0
func (as *ApiService) MarginAccount(ctx context.Context) (*ApiResponse, error)
MarginAccount returns a margin account information
func (*ApiService) MarginAccountsV3 ¶ added in v1.2.14
func (as *ApiService) MarginAccountsV3(ctx context.Context, quoteCurrency, queryType string) (*ApiResponse, error)
MarginAccountsV3 returns margin accounts of user v3.
func (*ApiService) MarginBorrowV3 ¶ added in v1.2.15
func (as *ApiService) MarginBorrowV3(ctx context.Context, p *MarginBorrowV3Req) (*ApiResponse, error)
MarginBorrowV3 initiate an application for cross or isolated margin borrowing
func (*ApiService) MarginConfig ¶ added in v1.2.0
func (as *ApiService) MarginConfig(ctx context.Context) (*ApiResponse, error)
MarginConfig returns a margin configuration
func (*ApiService) MarginCurrencies ¶ added in v1.2.14
func (as *ApiService) MarginCurrencies(ctx context.Context, currency, symbol, isIsolated string) (*ApiResponse, error)
MarginCurrencies This interface can obtain the risk limit and currency configuration of cross margin/isolated margin.
func (*ApiService) MarginCurrencyInfo ¶ added in v1.2.14
func (as *ApiService) MarginCurrencyInfo(ctx context.Context, currency string) (*ApiResponse, error)
MarginCurrencyInfo margin currency info
func (*ApiService) MarginIsolatedAccounts ¶ added in v1.2.13
func (as *ApiService) MarginIsolatedAccounts(ctx context.Context, balanceCurrency string) (*ApiResponse, error)
MarginIsolatedAccounts query margin isolated account
func (*ApiService) MarginIsolatedSymbols ¶ added in v1.2.13
func (as *ApiService) MarginIsolatedSymbols(ctx context.Context) (*ApiResponse, error)
MarginIsolatedSymbols query margin isolated symbols
func (*ApiService) MarginMarkets ¶ added in v1.2.0
func (as *ApiService) MarginMarkets(ctx context.Context, params map[string]string) (*ApiResponse, error)
MarginMarkets returns lending market data Deprecated
func (*ApiService) MarginRepayV3 ¶ added in v1.2.15
func (as *ApiService) MarginRepayV3(ctx context.Context, p *MarginRepay3VReq) (*ApiResponse, error)
MarginRepayV3 initiate an application for the repayment of cross or isolated margin borrowing
func (*ApiService) MarginRiskLimit ¶ added in v1.2.12
func (as *ApiService) MarginRiskLimit(ctx context.Context, marginModel string) (*ApiResponse, error)
func (*ApiService) MarginSymbolsV3 ¶ added in v1.2.15
func (as *ApiService) MarginSymbolsV3(ctx context.Context) (*ApiResponse, error)
MarginSymbolsV3 querying the configuration of cross margin trading pairs.
func (*ApiService) MarginTradeLast ¶ added in v1.2.0
func (as *ApiService) MarginTradeLast(ctx context.Context, currency string) (*ApiResponse, error)
MarginTradeLast returns latest lending market trade datas Deprecated
func (*ApiService) Markets ¶
func (as *ApiService) Markets(ctx context.Context) (*ApiResponse, error)
Markets returns the transaction currencies for the entire trading market.
func (*ApiService) NewWebSocketClient ¶
func (as *ApiService) NewWebSocketClient(token *WebSocketTokenModel) *WebSocketClient
NewWebSocketClient creates an instance of WebSocketClient.
func (*ApiService) NewWebSocketClientOpts ¶ added in v1.2.3
func (as *ApiService) NewWebSocketClientOpts(opts WebSocketClientOpts) *WebSocketClient
NewWebSocketClientOpts creates an instance of WebSocketClient with the parsed options.
func (*ApiService) OcoClientOrder ¶ added in v1.2.14
func (as *ApiService) OcoClientOrder(ctx context.Context, clientOrderId string) (*ApiResponse, error)
OcoClientOrder returns a oco order by order id. return OcoOrderResModel
func (*ApiService) OcoOrder ¶ added in v1.2.14
func (as *ApiService) OcoOrder(ctx context.Context, orderId string) (*ApiResponse, error)
OcoOrder returns a oco order by order id. return OcoOrderResModel
func (*ApiService) OcoOrderDetail ¶ added in v1.2.14
func (as *ApiService) OcoOrderDetail(ctx context.Context, orderId string) (*ApiResponse, error)
OcoOrderDetail returns a oco order detail by order id. return OrderDetailModel
func (*ApiService) OcoOrders ¶ added in v1.2.14
func (as *ApiService) OcoOrders(ctx context.Context, p map[string]string, pagination *PaginationParam) (*ApiResponse, error)
OcoOrders returns a oco order by order id. return OcoOrdersRes
func (*ApiService) Order ¶
func (as *ApiService) Order(ctx context.Context, orderId string) (*ApiResponse, error)
Order returns a single order by order id.
func (*ApiService) OrderByClient ¶ added in v1.2.8
func (as *ApiService) OrderByClient(ctx context.Context, clientOid string) (*ApiResponse, error)
OrderByClient returns a single order by client id.
func (*ApiService) Orders ¶
func (as *ApiService) Orders(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
Orders returns a list your current orders.
func (*ApiService) Prices ¶ added in v1.0.4
func (as *ApiService) Prices(ctx context.Context, base, currencies string) (*ApiResponse, error)
Prices returns the fiat prices for currency.
func (*ApiService) QueryETHProducts ¶ added in v1.2.15
func (as *ApiService) QueryETHProducts(ctx context.Context, currency string) (*ApiResponse, error)
QueryETHProducts retrieves ETH Staking products
func (*ApiService) QueryHoldAssets ¶ added in v1.2.15
func (as *ApiService) QueryHoldAssets(ctx context.Context, productId, productCategory, currency string, pagination *PaginationParam) (*ApiResponse, error)
QueryHoldAssets retrieves current holding assets of fixed income products
func (*ApiService) QueryInterestV3 ¶ added in v1.2.15
func (as *ApiService) QueryInterestV3(ctx context.Context, p map[string]string, pagination *PaginationParam) (*ApiResponse, error)
QueryInterestV3 get the interest records of the cross/isolated margin lending
func (*ApiService) QueryKCSStakingProducts ¶ added in v1.2.15
func (as *ApiService) QueryKCSStakingProducts(ctx context.Context, currency string) (*ApiResponse, error)
QueryKCSStakingProducts retrieves KCS Staking products
func (*ApiService) QueryMarginBorrowV3 ¶ added in v1.2.15
func (as *ApiService) QueryMarginBorrowV3(ctx context.Context, p map[string]string, pagination *PaginationParam) (*ApiResponse, error)
QueryMarginBorrowV3 get the borrowing orders for cross and isolated margin accounts
func (*ApiService) QueryMarginCurrenciesV3 ¶ added in v1.2.15
func (as *ApiService) QueryMarginCurrenciesV3(ctx context.Context, currency string) (*ApiResponse, error)
QueryMarginCurrenciesV3 get the interest records of the cross/isolated margin lending
func (*ApiService) QueryMarginInterestRateV3 ¶ added in v1.2.15
func (as *ApiService) QueryMarginInterestRateV3(ctx context.Context, currency string) (*ApiResponse, error)
QueryMarginInterestRateV3 g et the interest rates of the margin lending market over the past 7 days
func (*ApiService) QueryMarginRepayV3 ¶ added in v1.2.15
func (as *ApiService) QueryMarginRepayV3(ctx context.Context, p map[string]string, pagination *PaginationParam) (*ApiResponse, error)
QueryMarginRepayV3 get repay orders for cross and isolated margin accounts
func (*ApiService) QueryOTCLoanAccountsInfo ¶ added in v1.2.15
func (as *ApiService) QueryOTCLoanAccountsInfo(ctx context.Context) (*ApiResponse, error)
QueryOTCLoanAccountsInfo querying accounts that are currently involved in off-exchange funding and loans.
func (*ApiService) QueryOTCLoanInfo ¶ added in v1.2.15
func (as *ApiService) QueryOTCLoanInfo(ctx context.Context) (*ApiResponse, error)
QueryOTCLoanInfo querying accounts that are currently involved in loans.
func (*ApiService) QueryPromotionProducts ¶ added in v1.2.15
func (as *ApiService) QueryPromotionProducts(ctx context.Context, currency string) (*ApiResponse, error)
QueryPromotionProducts retrieves limited-time promotion products
func (*ApiService) QuerySavingProducts ¶ added in v1.2.15
func (as *ApiService) QuerySavingProducts(ctx context.Context, currency string) (*ApiResponse, error)
QuerySavingProducts retrieves savings products.
func (*ApiService) QueryStakingProducts ¶ added in v1.2.15
func (as *ApiService) QueryStakingProducts(ctx context.Context, currency string) (*ApiResponse, error)
QueryStakingProducts retrieves Staking products
func (*ApiService) RecentFills ¶ added in v1.0.1
func (as *ApiService) RecentFills(ctx context.Context) (*ApiResponse, error)
RecentFills returns the recent fills of the latest transactions within 24 hours.
func (*ApiService) RecentOrders ¶ added in v1.0.1
func (as *ApiService) RecentOrders(ctx context.Context) (*ApiResponse, error)
RecentOrders returns the recent orders of the latest transactions within 24 hours.
func (*ApiService) RedeemPreview ¶ added in v1.2.15
func (as *ApiService) RedeemPreview(ctx context.Context, orderId, fromAccountType string) (*ApiResponse, error)
RedeemPreview retrieves redemption preview information by holding ID
func (*ApiService) RedemptionOrdersV3 ¶ added in v1.2.15
func (as *ApiService) RedemptionOrdersV3(ctx context.Context, currency, status string, pagination *PaginationParam) (*ApiResponse, error)
RedemptionOrdersV3 pagination query for the redemption orders.
func (*ApiService) RepayAll ¶ added in v1.2.0
func (as *ApiService) RepayAll(ctx context.Context, params map[string]string) (*ApiResponse, error)
RepayAll repay borrow orders of one currency Deprecated please use MarginRepayV3
func (*ApiService) RepaySingle ¶ added in v1.2.0
func (as *ApiService) RepaySingle(ctx context.Context, params map[string]string) (*ApiResponse, error)
RepaySingle repay a single borrow order Deprecated please use MarginRepayV3
func (*ApiService) ServerTime ¶
func (as *ApiService) ServerTime(ctx context.Context) (*ApiResponse, error)
ServerTime returns the API server time.
func (*ApiService) ServiceStatus ¶ added in v1.2.5
func (as *ApiService) ServiceStatus(ctx context.Context) (*ApiResponse, error)
ServiceStatus returns the service status.
func (*ApiService) Stats24hr ¶
func (as *ApiService) Stats24hr(ctx context.Context, symbol string) (*ApiResponse, error)
Stats24hr returns 24 hr stats for the symbol. volume is in base currency units. open, high, low are in quote currency units.
func (*ApiService) StopOrder ¶ added in v1.2.8
func (as *ApiService) StopOrder(ctx context.Context, orderId string) (*ApiResponse, error)
StopOrder returns a single order by stop-order id.
func (*ApiService) StopOrderByClient ¶ added in v1.2.8
func (as *ApiService) StopOrderByClient(ctx context.Context, clientOid string, p map[string]string) (*ApiResponse, error)
StopOrderByClient returns a single stop-order by client id.
func (*ApiService) StopOrders ¶ added in v1.2.8
func (as *ApiService) StopOrders(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
StopOrders returns a list your current orders.
func (*ApiService) SubAccount ¶ added in v1.1.0
func (as *ApiService) SubAccount(ctx context.Context, subUserId string) (*ApiResponse, error)
SubAccount returns the detail of a sub-account.
func (*ApiService) SubAccountUsers ¶ added in v1.1.0
func (as *ApiService) SubAccountUsers(ctx context.Context) (*ApiResponse, error)
SubAccountUsers returns a list of sub-account user.
func (*ApiService) SubAccountUsersV2 ¶ added in v1.2.13
func (as *ApiService) SubAccountUsersV2(ctx context.Context, pagination *PaginationParam) (*ApiResponse, error)
SubAccountUsersV2 returns a list of sub-account user by page.
func (*ApiService) SubAccounts ¶ added in v1.1.0
func (as *ApiService) SubAccounts(ctx context.Context) (*ApiResponse, error)
SubAccounts returns the aggregated balance of all sub-accounts of the current user.
func (*ApiService) SubAccountsV2 ¶ added in v1.2.13
func (as *ApiService) SubAccountsV2(ctx context.Context, pagination *PaginationParam) (*ApiResponse, error)
SubAccountsV2 returns subAccounts of user with page info.
func (*ApiService) SubApiKey ¶ added in v1.2.13
func (as *ApiService) SubApiKey(ctx context.Context, subName, apiKey string) (*ApiResponse, error)
SubApiKey returns sub api key of spot.
func (*ApiService) SubTransfer ¶ added in v1.1.0
func (as *ApiService) SubTransfer(ctx context.Context, params map[string]string) (*ApiResponse, error)
SubTransfer transfers between master account and sub-account. Deprecated: This interface was discontinued on Oct 28, 2020. Please use SubTransferV2.
func (*ApiService) SubTransferV2 ¶ added in v1.2.8
func (as *ApiService) SubTransferV2(ctx context.Context, params map[string]string) (*ApiResponse, error)
SubTransferV2 transfers between master account and sub-account. Recommended for use on Oct 28, 2020.
func (*ApiService) SubscriptionOrdersV3 ¶ added in v1.2.15
func (as *ApiService) SubscriptionOrdersV3(ctx context.Context, currency, status string, pagination *PaginationParam) (*ApiResponse, error)
SubscriptionOrdersV3 pagination query for the subscription orders.
func (*ApiService) Symbols ¶
func (as *ApiService) Symbols(ctx context.Context, market string) (*ApiResponse, error)
Symbols returns a list of available currency pairs for trading. Deprecated
func (*ApiService) SymbolsDetail ¶ added in v1.2.17
func (as *ApiService) SymbolsDetail(ctx context.Context, symbol string) (*ApiResponse, error)
SymbolsDetail Request via this endpoint to get detail currency pairs for trading
func (*ApiService) SymbolsV2 ¶ added in v1.2.13
func (as *ApiService) SymbolsV2(ctx context.Context, market string) (*ApiResponse, error)
SymbolsV2 returns a list of available currency pairs for trading.
func (*ApiService) TickerLevel1 ¶ added in v1.0.3
func (as *ApiService) TickerLevel1(ctx context.Context, symbol string) (*ApiResponse, error)
TickerLevel1 returns the ticker include only the inside (i.e. best) bid and ask data, last price and last trade size.
func (*ApiService) Tickers ¶ added in v1.0.3
func (as *ApiService) Tickers(ctx context.Context) (*ApiResponse, error)
Tickers returns all tickers as TickersResponseModel for all trading pairs in the market (including 24h volume).
func (*ApiService) ToggleAutoLend ¶ added in v1.2.0
func (as *ApiService) ToggleAutoLend(ctx context.Context, params map[string]string) (*ApiResponse, error)
ToggleAutoLend set auto lend rules Deprecated
func (*ApiService) TradeHistories ¶
func (as *ApiService) TradeHistories(ctx context.Context, symbol string) (*ApiResponse, error)
TradeHistories returns a list the latest trades for a symbol.
func (*ApiService) UniversalTransfer ¶ added in v1.2.15
func (as *ApiService) UniversalTransfer(ctx context.Context, p *UniversalTransferReq) (*ApiResponse, error)
UniversalTransfer FlexTransfer
func (*ApiService) UpdateSubApiKey ¶ added in v1.2.13
func (as *ApiService) UpdateSubApiKey(ctx context.Context, subName, passphrase, apiKey, permission, ipWhitelist, expire string) (*ApiResponse, error)
UpdateSubApiKey update sub api key of spot.
func (*ApiService) UpdateUserLeverageV3 ¶ added in v1.2.15
func (as *ApiService) UpdateUserLeverageV3(ctx context.Context, p *UpdateUserLeverageV3Model) (*ApiResponse, error)
UpdateUserLeverageV3 modifying the leverage multiplier for cross margin or isolated margin.
func (*ApiService) UserSummaryInfoV2 ¶ added in v1.2.13
func (as *ApiService) UserSummaryInfoV2(ctx context.Context) (*ApiResponse, error)
UserSummaryInfoV2 returns summary information of user.
func (*ApiService) V1Deposits ¶ added in v1.1.0
func (as *ApiService) V1Deposits(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
V1Deposits returns a list of v1 historical deposits.
func (*ApiService) V1Orders ¶ added in v1.1.0
func (as *ApiService) V1Orders(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
V1Orders returns a list of v1 historical orders. Deprecated
func (*ApiService) V1Withdrawals ¶ added in v1.1.0
func (as *ApiService) V1Withdrawals(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
V1Withdrawals returns a list of v1 historical withdrawals.
func (*ApiService) WebSocketPrivateToken ¶
func (as *ApiService) WebSocketPrivateToken(ctx context.Context) (*ApiResponse, error)
WebSocketPrivateToken returns the token for private channel.
func (*ApiService) WebSocketPublicToken ¶
func (as *ApiService) WebSocketPublicToken(ctx context.Context) (*ApiResponse, error)
WebSocketPublicToken returns the token for public channel.
func (*ApiService) WithdrawalQuotas ¶
func (as *ApiService) WithdrawalQuotas(ctx context.Context, currency, chain string) (*ApiResponse, error)
WithdrawalQuotas returns the quotas of withdrawal.
func (*ApiService) Withdrawals ¶
func (as *ApiService) Withdrawals(ctx context.Context, params map[string]string, pagination *PaginationParam) (*ApiResponse, error)
Withdrawals returns a list of withdrawals.
type ApiServiceOption ¶
type ApiServiceOption func(service *ApiService)
An ApiServiceOption is a option parameter to create the instance of ApiService.
func ApiBaseURIOption ¶
func ApiBaseURIOption(uri string) ApiServiceOption
ApiBaseURIOption creates a instance of ApiServiceOption about apiBaseURI.
func ApiKeyOption ¶
func ApiKeyOption(key string) ApiServiceOption
ApiKeyOption creates a instance of ApiServiceOption about apiKey.
func ApiKeyVersionOption ¶ added in v1.2.8
func ApiKeyVersionOption(apiKeyVersion string) ApiServiceOption
ApiKeyVersionOption creates a instance of ApiServiceOption about apiKeyVersion.
func ApiPassPhraseOption ¶
func ApiPassPhraseOption(passPhrase string) ApiServiceOption
ApiPassPhraseOption creates a instance of ApiServiceOption about apiPassPhrase.
func ApiRequesterOption ¶ added in v1.2.7
func ApiRequesterOption(requester Requester) ApiServiceOption
ApiRequesterOption creates a instance of ApiServiceOption about requester.
func ApiSecretOption ¶
func ApiSecretOption(secret string) ApiServiceOption
ApiSecretOption creates a instance of ApiServiceOption about apiSecret.
func ApiSkipVerifyTlsOption ¶
func ApiSkipVerifyTlsOption(skipVerifyTls bool) ApiServiceOption
ApiSkipVerifyTlsOption creates a instance of ApiServiceOption about apiSkipVerifyTls.
type ApplyWithdrawalResultModel ¶
type ApplyWithdrawalResultModel struct {
WithdrawalId string `json:"withdrawalId"`
}
ApplyWithdrawalResultModel represents the result of ApplyWithdrawal().
type BaseFeeModel ¶ added in v1.2.10
type BaseFeeModel struct { TakerFeeRate string `json:"takerFeeRate"` MakerFeeRate string `json:"makerFeeRate"` }
BaseFeeModel RESPONSES of BaseFee endpoint
type BasicRequester ¶
type BasicRequester struct { }
A BasicRequester represents a basic implement of Requester by http.Client.
type BorrowOrderModel ¶ added in v1.2.0
type BorrowOrderModel struct { OrderId string `json:"orderId"` Currency string `json:"currency"` Size json.Number `json:"size"` Filled json.Number `json:"filled"` Status string `json:"status"` MatchList []struct { Currency string `json:"currency"` DailyIntRate json.Number `json:"dailyIntRate"` Size json.Number `json:"size"` Term json.Number `json:"term"` Timestamp json.Number `json:"timestamp"` TradeId string `json:"tradeId"` } `json:"matchList"` }
BorrowOrderModel represents a borrow order
type BorrowOutstandingRecordModel ¶ added in v1.2.0
type BorrowOutstandingRecordModel struct { Currency string `json:"currency"` TradeId string `json:"tradeId"` Liability json.Number `json:"liability"` Principal json.Number `json:"principal"` AccruedInterest json.Number `json:"accruedInterest"` CreatedAt json.Number `json:"createdAt"` MaturityTime json.Number `json:"maturityTime"` Term json.Number `json:"term"` RepaidSize json.Number `json:"repaidSize"` DailyIntRate json.Number `json:"dailyIntRate"` }
BorrowOutstandingRecordModel represents borrow outstanding record
type BorrowOutstandingRecordsModel ¶ added in v1.2.0
type BorrowOutstandingRecordsModel []*BorrowOutstandingRecordModel
BorrowOutstandingRecordsModel is a list of *BorrowOutstandingRecordModel
type BorrowRepaidRecordModel ¶ added in v1.2.0
type BorrowRepaidRecordModel struct { Currency string `json:"currency"` DailyIntRate json.Number `json:"dailyIntRate"` Interest json.Number `json:"interest"` Principal json.Number `json:"principal"` RepaidSize json.Number `json:"repaidSize"` RepayTime json.Number `json:"repayTime"` Term json.Number `json:"term"` TradeId string `json:"tradeId"` }
BorrowRepaidRecordModel represents a repaid borrow record
type BorrowRepaidRecordsModel ¶ added in v1.2.0
type BorrowRepaidRecordsModel []*BorrowRepaidRecordModel
BorrowRepaidRecordsModel is a list of *BorrowRepaidRecordModel
type CancelOrderByClientResultModel ¶ added in v1.2.10
type CancelOrderByClientResultModel struct { CancelledOrderId string `json:"cancelledOrderId"` ClientOid string `json:"clientOid"` }
A CancelOrderByClientResultModel represents the result of CancelOrderByClient().
type CancelOrderResultModel ¶
type CancelOrderResultModel struct {
CancelledOrderIds []string `json:"cancelledOrderIds"`
}
A CancelOrderResultModel represents the result of CancelOrder().
type CancelStopOrderByClientModel ¶ added in v1.2.10
type CancelStopOrderByClientModel struct { CancelledOrderId string `json:"cancelledOrderId"` ClientOid string `json:"clientOid"` }
CancelStopOrderByClientModel returns Model of CancelStopOrderByClient API
type CancelWithdrawalResultModel ¶
type CancelWithdrawalResultModel struct {
CancelledWithdrawIds []string `json:"cancelledWithdrawIds"`
}
CancelWithdrawalResultModel represents the result of CancelWithdrawal().
type CancelledOcoOrderResModel ¶ added in v1.2.14
type CancelledOcoOrderResModel struct {
CancelledOrderIds []string `json:"cancelledOrderIds"`
}
type ChainsModel ¶ added in v1.2.11
type ChainsModel struct { ChainName string `json:"chainName"` WithdrawalMinSize string `json:"withdrawalMinSize"` WithdrawalMinFee string `json:"withdrawalMinFee"` IsWithdrawEnabled bool `json:"isWithdrawEnabled"` IsDepositEnabled bool `json:"isDepositEnabled"` Confirms int64 `json:"confirms"` ContractAddress string `json:"contractAddress"` ChainId string `json:"chainId"` }
ChainsModel Chains Model
type CreateAccountModel ¶ added in v1.2.10
type CreateAccountModel struct {
Id string `json:"id"`
}
CreateAccountModel represents The account id returned from creating an account
type CreateBorrowOrderResultModel ¶ added in v1.2.0
type CreateBorrowOrderResultModel struct { OrderId string `json:"orderId"` Currency string `json:"currency"` }
CreateBorrowOrderResultModel represents the result of create a borrow order
type CreateEarnOrderReq ¶ added in v1.2.15
type CreateEarnOrderRes ¶ added in v1.2.15
type CreateLendOrderResultModel ¶ added in v1.2.0
type CreateLendOrderResultModel struct {
OrderId string `json:"orderId"`
}
CreateLendOrderResultModel the result of create a lend order
type CreateMultiOrderResultModel ¶ added in v1.2.5
type CreateMultiOrderResultModel struct {
Data OrdersModel `json:"data"`
}
A CreateMultiOrderResultModel represents the result of CreateMultiOrder().
type CreateOcoOrderModel ¶ added in v1.2.14
type CreateOcoOrderModel struct { Side string `json:"side"` Symbol string `json:"symbol,omitempty"` Price string `json:"price,omitempty"` Size string `json:"size,omitempty"` StopPrice string `json:"stopPrice,omitempty"` LimitPrice string `json:"limitPrice,omitempty"` TradeType string `json:"tradeType"` ClientOid string `json:"clientOid,omitempty"` Remark string `json:"remark"` }
A CreateOcoOrderModel is the input parameter of CreatOcoOrder().
type CreateOrderModel ¶ added in v1.2.5
type CreateOrderModel struct { // BASE PARAMETERS ClientOid string `json:"clientOid"` Side string `json:"side"` Symbol string `json:"symbol,omitempty"` Type string `json:"type,omitempty"` Remark string `json:"remark,omitempty"` Stop string `json:"stop,omitempty"` StopPrice string `json:"stopPrice,omitempty"` STP string `json:"stp,omitempty"` TradeType string `json:"tradeType,omitempty"` // LIMIT ORDER PARAMETERS Price string `json:"price,omitempty"` Size string `json:"size,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` CancelAfter int64 `json:"cancelAfter,omitempty"` PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` IceBerg bool `json:"iceberg,omitempty"` VisibleSize string `json:"visibleSize,omitempty"` // MARKET ORDER PARAMETERS // Size string `json:"size"` Funds string `json:"funds,omitempty"` // MARGIN ORDER PARAMETERS MarginMode string `json:"marginMode,omitempty"` AutoBorrow bool `json:"autoBorrow,omitempty"` AutoRepay bool `json:"autoRepay,omitempty"` }
A CreateOrderModel is the input parameter of CreateOrder().
type CreateOrderResultModel ¶
type CreateOrderResultModel struct {
OrderId string `json:"orderId"`
}
A CreateOrderResultModel represents the result of CreateOrder().
type CreateSubAccountV2Res ¶ added in v1.2.13
type CreateSubAccountV2Res struct { Uid int64 `json:"uid"` SubName string `json:"subName"` Remarks string `json:"remarks"` Access string `json:"access"` }
CreateSubAccountV2Res returns Create Sub account response
type CreateSubApiKeyRes ¶ added in v1.2.13
type CreateSubApiKeyRes struct { ApiKey string `json:"apiKey"` CreatedAt json.Number `json:"createdAt"` IpWhitelist string `json:"ipWhitelist"` Permission string `json:"permission"` Remark string `json:"remark"` SubName string `json:"subName"` ApiSecret string `json:"apiSecret"` Passphrase string `json:"passphrase"` }
type CurrenciesModel ¶
type CurrenciesModel []*CurrencyModel
A CurrenciesModel is the set of *CurrencyModel.
type CurrenciesV3Model ¶ added in v1.2.15
type CurrenciesV3Model []*CurrencyV3Model
type CurrencyModel ¶
type CurrencyModel struct { Name string `json:"name"` Currency string `json:"currency"` FullName string `json:"fullName"` Precision uint8 `json:"precision"` Confirms int64 `json:"confirms"` ContractAddress string `json:"contractAddress"` WithdrawalMinSize string `json:"withdrawalMinSize"` WithdrawalMinFee string `json:"withdrawalMinFee"` IsWithdrawEnabled bool `json:"isWithdrawEnabled"` IsDepositEnabled bool `json:"isDepositEnabled"` IsMarginEnabled bool `json:"isMarginEnabled"` IsDebitEnabled bool `json:"isDebitEnabled"` }
A CurrencyModel represents a model of known currency.
type CurrencyV2Model ¶ added in v1.2.11
type CurrencyV2Model struct { Name string `json:"name"` Currency string `json:"currency"` FullName string `json:"fullName"` Precision uint8 `json:"precision"` Confirms int64 `json:"confirms"` ContractAddress string `json:"contractAddress"` IsMarginEnabled bool `json:"isMarginEnabled"` IsDebitEnabled bool `json:"isDebitEnabled"` Chains []*ChainsModel `json:"chains"` }
CurrencyV2Model CurrencyV2 Model
type CurrencyV3Model ¶ added in v1.2.15
type CurrencyV3Model struct { Currency string `json:"currency"` Name string `json:"name"` FullName string `json:"fullName"` Precision int32 `json:"precision"` Confirms int32 `json:"confirms"` ContractAddress string `json:"contractAddress"` IsMarginEnabled bool `json:"isMarginEnabled"` IsDebitEnabled bool `json:"isDebitEnabled"` Chains []struct { ChainName string `json:"chainName"` WithdrawalMinFee json.Number `json:"withdrawalMinFee"` WithdrawalMinSize json.Number `json:"withdrawalMinSize"` WithdrawFeeRate json.Number `json:"withdrawFeeRate"` DepositMinSize json.Number `json:"depositMinSize"` IsWithdrawEnabled bool `json:"isWithdrawEnabled"` IsDepositEnabled bool `json:"isDepositEnabled"` PreConfirms int32 `json:"preConfirms"` ContractAddress string `json:"contractAddress"` ChainId string `json:"chainId"` Confirms int32 `json:"confirms"` } `json:"chains"` }
type DeleteEarnOrderRes ¶ added in v1.2.15
type DeleteSubApiKeyRes ¶ added in v1.2.13
type DepositAddressModel ¶
type DepositAddressModel struct { Address string `json:"address"` Memo string `json:"memo"` Chain string `json:"chain"` }
A DepositAddressModel represents a deposit address of currency for deposit.
type DepositAddressesModel ¶
type DepositAddressesModel DepositAddressModel
A DepositAddressesModel is the set of *DepositAddressModel.
type DepositAddressesV2Model ¶ added in v1.2.10
type DepositAddressesV2Model []*depositAddressV2Model
type DepositModel ¶
type DepositModel struct { Chain string `json:"chain"` Address string `json:"address"` Memo string `json:"memo"` Amount string `json:"amount"` Fee string `json:"fee"` Currency string `json:"currency"` IsInner bool `json:"isInner"` WalletTxId string `json:"walletTxId"` Status string `json:"status"` Remark string `json:"remark"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
A DepositModel represents a deposit record.
type DepositsModel ¶
type DepositsModel []*DepositModel
A DepositsModel is the set of *DepositModel.
type EarnProductModel ¶ added in v1.2.15
type EarnProductModel struct { Id string `json:"id"` Currency string `json:"currency"` Category string `json:"category"` Type string `json:"type"` Precision int32 `json:"precision"` ProductUpperLimit string `json:"productUpperLimit"` UserUpperLimit string `json:"userUpperLimit"` UserLowerLimit string `json:"userLowerLimit"` RedeemPeriod int `json:"redeemPeriod"` LockStartTime int64 `json:"lockStartTime"` LockEndTime int64 `json:"lockEndTime"` ApplyStartTime int64 `json:"applyStartTime"` ApplyEndTime int64 `json:"applyEndTime"` ReturnRate json.Number `json:"returnRate"` IncomeCurrency string `json:"incomeCurrency"` EarlyRedeemSupported int32 `json:"earlyRedeemSupported"` ProductRemainAmount json.Number `json:"productRemainAmount"` Status string `json:"status"` RedeemType string `json:"redeemType"` IncomeReleaseType string `json:"incomeReleaseType"` InterestDate int64 `json:"interestDate"` Duration int32 `json:"duration"` NewUserOnly int32 `json:"newUserOnly"` }
type EarnProductsRes ¶ added in v1.2.15
type EarnProductsRes []*EarnProductModel
type FillModel ¶
type FillModel 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 string `json:"price"` Size string `json:"size"` Funds string `json:"funds"` Fee string `json:"fee"` FeeRate string `json:"feeRate"` FeeCurrency string `json:"feeCurrency"` Stop string `json:"stop"` Type string `json:"type"` CreatedAt int64 `json:"createdAt"` TradeType string `json:"tradeType"` }
A FillModel represents the structure of fill.
type FullOrderBookModel ¶
type FullOrderBookModel struct { Sequence string `json:"sequence"` Time int64 `json:"time"` Bids [][]string `json:"bids"` Asks [][]string `json:"asks"` }
A FullOrderBookModel represents a list of open orders for a symbol, with full depth.
type FullOrderBookV2Model ¶ added in v1.2.8
type FullOrderBookV2Model struct { Sequence int64 `json:"sequence"` Time int64 `json:"time"` Bids [][]interface{} `json:"bids"` Asks [][]interface{} `json:"asks"` }
A FullOrderBookV2Model represents a list of open orders for a symbol, with full depth.
type HFCreateMultiOrderModel ¶ added in v1.2.13
type HFCreateMultiOrderModel struct { ClientOid string `json:"clientOid"` Symbol string `json:"symbol"` OrderType string `json:"type"` TimeInForce string `json:"timeInForce"` Stp string `json:"stp"` Side string `json:"side"` Price string `json:"price"` Size string `json:"size"` CancelAfter big.Int `json:"cancelAfter"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` Iceberg bool `json:"iceberg"` VisibleSize string `json:"visibleSize"` Tags string `json:"tags"` Remark string `json:"remark"` }
type HFMarginActiveSymbolsModel ¶ added in v1.2.15
type HfAccountInnerTransferRes ¶ added in v1.2.13
type HfAccountInnerTransferRes struct {
OrderId string `json:"orderId"`
}
type HfAccountLedgerModel ¶ added in v1.2.13
type HfAccountLedgerModel struct { Id string `json:"id"` Currency string `json:"currency"` Amount string `json:"amount"` Fee string `json:"fee"` Balance string `json:"balance"` AccountType string `json:"accountType"` BizType string `json:"bizType"` Direction string `json:"direction"` CreatedAt string `json:"createdAt"` Context string `json:"context"` }
type HfAccountLedgersModel ¶ added in v1.2.13
type HfAccountLedgersModel []*HfAccountLedgerModel
type HfAccountModel ¶ added in v1.2.13
type HfAccountTransferableModel ¶ added in v1.2.13
type HfAccountsModel ¶ added in v1.2.13
type HfAccountsModel []HfAccountModel
type HfAutoCancelSettingRes ¶ added in v1.2.13
type HfCancelAllMarginOrdersV3Req ¶ added in v1.2.15
type HfCancelAllMarginOrdersV3Resp ¶ added in v1.2.15
type HfCancelAllMarginOrdersV3Resp string
type HfCancelClientMarinOrderV3Req ¶ added in v1.2.15
type HfCancelClientMarinOrderV3Resp ¶ added in v1.2.15
type HfCancelClientMarinOrderV3Resp struct {
ClientOid string `json:"clientOid"`
}
type HfCancelMarinOrderV3Req ¶ added in v1.2.15
type HfCancelMarinOrderV3Resp ¶ added in v1.2.15
type HfCancelMarinOrderV3Resp struct {
OrderId string `json:"orderId"`
}
type HfCancelOrdersFailedResultModel ¶ added in v1.2.14
type HfCancelOrdersResultModel ¶ added in v1.2.14
type HfCancelOrdersResultModel struct { SucceedSymbols []string `json:"succeedSymbols"` FailedSymbols []*HfCancelOrdersFailedResultModel `json:"failedSymbols"` }
type HfClientOidModel ¶ added in v1.2.13
type HfClientOidModel struct {
ClientOid string `json:"clientOid"`
}
type HfFilledOrdersModel ¶ added in v1.2.13
type HfFilledOrdersModel struct { LastId json.Number `json:"lastId"` Items []*HfOrderModel `json:"items"` }
type HfMarginOrderV3Req ¶ added in v1.2.15
type HfMarginOrderV3Req struct { ClientOid string `json:"clientOid"` Symbol string `json:"symbol"` Side string `json:"side"` Type string `json:"type"` Stp string `json:"stp"` IsIsolated bool `json:"isIsolated"` AutoBorrow bool `json:"autoBorrow"` AutoRepay bool `json:"autoRepay"` Price string `json:"price,omitempty"` Size string `json:"size,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` CancelAfter int64 `json:"cancelAfter,omitempty"` PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` Iceberg bool `json:"iceberg,omitempty"` VisibleSize bool `json:"visibleSize,omitempty"` Funds string `json:"funds,omitempty"` }
type HfMarginOrderV3Resp ¶ added in v1.2.15
type HfMarinActiveOrdersV3Req ¶ added in v1.2.15
type HfMarinActiveOrdersV3Resp ¶ added in v1.2.15
type HfMarinActiveOrdersV3Resp []*MarginOrderV3Model
type HfMarinClientOrderV3Req ¶ added in v1.2.15
type HfMarinClientOrderV3Resp ¶ added in v1.2.15
type HfMarinClientOrderV3Resp struct {
MarginFillModel
}
type HfMarinDoneOrdersV3Req ¶ added in v1.2.15
type HfMarinDoneOrdersV3Req struct { TradeType string `url:"tradeType"` Symbol string `url:"symbol"` Side string `url:"side,omitempty"` Type string `url:"type,omitempty"` StartAt int64 `url:"startAt,omitempty"` EndAt int64 `url:"endAt,omitempty"` LastId int64 `url:"lastId,omitempty"` Limit int `url:"limit,omitempty"` }
type HfMarinDoneOrdersV3Resp ¶ added in v1.2.15
type HfMarinDoneOrdersV3Resp struct { Items []*MarginFillModel `json:"items"` LastId int64 `json:"lastId"` }
type HfMarinFillsV3Req ¶ added in v1.2.15
type HfMarinFillsV3Req struct { Symbol string `url:"symbol"` TradeType string `url:"tradeType"` OrderId string `url:"orderId,omitempty"` Side string `url:"side,omitempty"` Type string `url:"type,omitempty"` StartAt int64 `url:"startAt,omitempty"` EndAt int64 `url:"endAt,omitempty"` LastId int64 `url:"lastId,omitempty"` Limit int `url:"limit,omitempty"` }
type HfMarinFillsV3Resp ¶ added in v1.2.15
type HfMarinFillsV3Resp struct { Items []*MarginFillModel `json:"items"` LastId int64 `json:"lastId"` }
type HfMarinOrderV3Req ¶ added in v1.2.15
type HfMarinOrderV3Resp ¶ added in v1.2.15
type HfMarinOrderV3Resp struct {
MarginFillModel
}
type HfModifyOrderRes ¶ added in v1.2.13
type HfOrderIdModel ¶ added in v1.2.13
type HfOrderIdModel struct {
OrderId string `json:"orderId"`
}
type HfOrderModel ¶ added in v1.2.13
type HfOrderModel struct { Id string `json:"id"` Symbol string `json:"symbol"` OpType string `json:"opType"` Type string `json:"type"` Side string `json:"side"` Price string `json:"price"` Size string `json:"size"` Funds string `json:"funds"` DealSize string `json:"dealSize"` DealFunds string `json:"dealFunds"` Fee string `json:"fee"` FeeCurrency string `json:"feeCurrency"` Stp string `json:"stp"` TimeInForce string `json:"timeInForce"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` Iceberg bool `json:"iceberg"` VisibleSize string `json:"visibleSize"` CancelAfter int64 `json:"cancelAfter"` Channel string `json:"channel"` ClientOid string `json:"clientOid"` Remark string `json:"remark"` Tags string `json:"tags"` CancelExist bool `json:"cancelExist"` CreatedAt json.Number `json:"createdAt"` LastUpdatedAt json.Number `json:"lastUpdatedAt"` TradeType string `json:"tradeType"` InOrderBook bool `json:"inOrderBook"` Active bool `json:"active"` CancelledSize string `json:"cancelledSize"` CancelledFunds string `json:"cancelledFunds"` RemainSize string `json:"remainSize"` RemainFunds string `json:"remainFunds"` }
type HfOrdersModel ¶ added in v1.2.13
type HfOrdersModel []*HfOrderModel
type HfPlaceMultiOrdersRes ¶ added in v1.2.13
type HfPlaceMultiOrdersRes []*HfPlaceOrderRes
type HfPlaceOrderReq ¶ added in v1.2.15
type HfPlaceOrderReq struct { ClientOid string `json:"clientOid"` Symbol string `json:"symbol"` Side string `json:"side"` Stp string `json:"stp"` Tags string `json:"tags"` Remark string `json:"remark"` Price string `json:"price,omitempty"` Size string `json:"size,omitempty"` TimeInForce string `json:"timeInForce,omitempty"` CancelAfter int64 `json:"cancelAfter,omitempty"` PostOnly bool `json:"postOnly,omitempty"` Hidden bool `json:"hidden,omitempty"` Iceberg bool `json:"iceberg,omitempty"` VisibleSize bool `json:"visibleSize,omitempty"` Funds string `json:"funds,omitempty"` }
type HfPlaceOrderRes ¶ added in v1.2.13
type HfSymbolsModel ¶ added in v1.2.13
type HfSymbolsModel struct {
Symbols []string `json:"symbols"`
}
type HfSyncCancelOrderRes ¶ added in v1.2.13
type HfSyncCancelOrderWithSizeRes ¶ added in v1.2.13
type HfSyncPlaceMultiOrdersRes ¶ added in v1.2.13
type HfSyncPlaceMultiOrdersRes []*HfSyncPlaceOrderRes
type HfSyncPlaceOrderRes ¶ added in v1.2.13
type HfSyncPlaceOrderRes struct { OrderId string `json:"orderId"` ClientOid string `json:"clientOid"` OrderTime json.Number `json:"orderTime"` OriginSize string `json:"originSize"` DealSize string `json:"dealSize"` RemainSize string `json:"remainSize"` CanceledSize string `json:"canceledSize"` Status string `json:"status"` MatchTime json.Number `json:"matchTime"` }
type HfTransactionDetailModel ¶ added in v1.2.13
type HfTransactionDetailModel struct { Id json.Number `json:"id"` Symbol string `json:"symbol"` TradeId json.Number `json:"tradeId"` OrderId string `json:"orderId"` CounterOrderId string `json:"counterOrderId"` Side string `json:"side"` Liquidity string `json:"liquidity"` ForceTaker bool `json:"forceTaker"` Price string `json:"price"` Size string `json:"size"` Funds string `json:"funds"` Fee string `json:"fee"` FeeRate string `json:"feeRate"` FeeCurrency string `json:"feeCurrency"` OrderType string `json:"type"` Stop string `json:"stop"` CreatedAt json.Number `json:"createdAt"` TradeType string `json:"tradeType"` }
type HfTransactionDetailsModel ¶ added in v1.2.13
type HfTransactionDetailsModel struct { LastId json.Number `json:"lastId"` Items []*HfTransactionDetailModel `json:"items"` }
type HoldAssetModel ¶ added in v1.2.15
type HoldAssetModel 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 json.Number `json:"returnRate"` HoldAmount json.Number `json:"holdAmount"` RedeemedAmount json.Number `json:"redeemedAmount"` RedeemingAmount json.Number `json:"redeemingAmount"` LockStartTime int64 `json:"lockStartTime"` LockEndTime int64 `json:"lockEndTime"` PurchaseTime int64 `json:"purchaseTime"` RedeemPeriod int32 `json:"redeemPeriod"` Status string `json:"status"` EarlyRedeemSupported int32 `json:"earlyRedeemSupported"` }
type HoldAssetsRes ¶ added in v1.2.15
type HoldAssetsRes []*HoldAssetModel
type InnerTransferResultModel ¶ added in v1.1.0
type InnerTransferResultModel struct {
OrderId string `json:"orderId"`
}
An InnerTransferResultModel represents the result of a inner-transfer operation.
type IsolatedBorrowOutstandingRecordModel ¶ added in v1.2.13
type IsolatedBorrowOutstandingRecordModel struct { LoanId string `json:"loanId"` Symbol string `json:"symbol"` Currency string `json:"currency"` LiabilityBalance string `json:"liabilityBalance"` PrincipalTotal string `json:"principalTotal"` InterestBalance string `json:"interestBalance"` CreatedAt json.Number `json:"createdAt"` MaturityTime json.Number `json:"maturityTime"` Period int64 `json:"period"` RepaidSize string `json:"repaidSize"` DailyInterestRate string `json:"dailyInterestRate"` }
type IsolatedBorrowOutstandingRecordsModel ¶ added in v1.2.13
type IsolatedBorrowOutstandingRecordsModel []*IsolatedBorrowOutstandingRecordModel
type IsolatedBorrowRepaidRecordRecordModel ¶ added in v1.2.13
type IsolatedBorrowRepaidRecordRecordModel struct { LoanId string `json:"loanId"` Symbol string `json:"symbol"` Currency string `json:"currency"` PrincipalTotal string `json:"principalTotal"` InterestBalance string `json:"interestBalance"` RepaidSize string `json:"repaidSize"` CreatedAt json.Number `json:"createdAt"` Period int64 `json:"period"` DailyInterestRate string `json:"dailyInterestRate"` RepayFinishAt json.Number `json:"repayFinishAt"` }
type IsolatedBorrowRepaidRecordRecordsModel ¶ added in v1.2.13
type IsolatedBorrowRepaidRecordRecordsModel []*IsolatedBorrowRepaidRecordRecordModel
type IsolatedCurrenciesRiskLimitModel ¶ added in v1.2.14
type IsolatedCurrenciesRiskLimitModel []*IsolatedCurrencyRiskLimitModel
type IsolatedCurrencyRiskLimitModel ¶ added in v1.2.14
type IsolatedCurrencyRiskLimitModel struct { Timestamp json.Number `json:"timestamp"` Symbol string `json:"symbol"` BaseMaxBorrowAmount string `json:"baseMaxBorrowAmount"` QuoteMaxBorrowAmount string `json:"quoteMaxBorrowAmount"` BaseMaxBuyAmount string `json:"baseMaxBuyAmount"` QuoteMaxBuyAmount string `json:"quoteMaxBuyAmount"` BaseMaxHoldAmount string `json:"baseMaxHoldAmount"` QuoteMaxHoldAmount string `json:"quoteMaxHoldAmount"` BasePrecision int64 `json:"basePrecision"` QuotePrecision int64 `json:"quotePrecision"` BaseBorrowCoefficient string `json:"baseBorrowCoefficient"` QuoteBorrowCoefficient string `json:"quoteBorrowCoefficient"` BaseMarginCoefficient string `json:"baseMarginCoefficient"` QuoteMarginCoefficient string `json:"quoteMarginCoefficient"` BaseBorrowMinAmount string `json:"baseBorrowMinAmount"` BaseBorrowMinUnit string `json:"baseBorrowMinUnit"` QuoteBorrowMinAmount string `json:"quoteBorrowMinAmount"` QuoteBorrowMinUnit string `json:"quoteBorrowMinUnit"` BaseBorrowEnabled bool `json:"baseBorrowEnabled"` QuoteBorrowEnabled bool `json:"quoteBorrowEnabled"` }
type KLineModel ¶ added in v1.0.5
type KLineModel []string
KLineModel represents the k lines for a symbol. Rates are returned in grouped buckets based on requested type.
type KLinesModel ¶ added in v1.0.5
type KLinesModel []*KLineModel
A KLinesModel is the set of *KLineModel.
type KcSigner ¶
type KcSigner struct { Sha256Signer // contains filtered or unexported fields }
KcSigner is the implement of Signer for KuCoin.
func NewKcSigner ¶
NewKcSigner creates a instance of KcSigner.
func NewKcSignerV2 ¶ added in v1.2.8
NewKcSignerV2 creates a instance of KcSigner.
type LendActiveOrderModel ¶ added in v1.2.0
type LendActiveOrderModel struct {
LendOrderBaseModel
}
LendActiveOrderModel represents a active lend order
type LendActiveOrdersModel ¶ added in v1.2.0
type LendActiveOrdersModel []*LendActiveOrderModel
LendActiveOrdersModel is a list of *LendActiveOrderModel
type LendAssetModel ¶ added in v1.2.0
type LendAssetModel struct { Currency string `json:"currency"` Outstanding json.Number `json:"outstanding"` FilledSize json.Number `json:"filledSize"` AccruedInterest json.Number `json:"accruedInterest"` RealizedProfit json.Number `json:"realizedProfit"` IsAutoLend bool `json:"isAutoLend"` }
LendAssetModel represents account lend asset
type LendAssetsModel ¶ added in v1.2.0
type LendAssetsModel []*LendAssetModel
LendAssetsModel is a list of *LendAssetModel
type LendDoneOrderModel ¶ added in v1.2.0
type LendDoneOrderModel struct { LendOrderBaseModel Status string `json:"status"` }
LendDoneOrderModel represents a history lend order
type LendDoneOrdersModel ¶ added in v1.2.0
type LendDoneOrdersModel []*LendDoneOrderModel
LendDoneOrdersModel is a list of *LendDoneOrderModel
type LendOrderBaseModel ¶ added in v1.2.0
type LendOrderBaseModel struct { OrderId string `json:"orderId"` Currency string `json:"currency"` Size json.Number `json:"size"` FilledSize json.Number `json:"filledSize"` DailyIntRate json.Number `json:"dailyIntRate"` Term json.Number `json:"term"` CreatedAt json.Number `json:"createdAt"` }
LendOrderBaseModel represents Base model of lend order
type LendTradeSettledRecordModel ¶ added in v1.2.0
type LendTradeSettledRecordModel struct { TradeId string `json:"tradeId"` Currency string `json:"currency"` Size json.Number `json:"size"` Interest json.Number `json:"interest"` Repaid json.Number `json:"repaid"` DailyIntRate json.Number `json:"dailyIntRate"` Term json.Number `json:"term"` SettledAt json.Number `json:"settledAt"` Note string `json:"note"` }
LendTradeSettledRecordModel represents a settled lend record
type LendTradeSettledRecordsModel ¶ added in v1.2.0
type LendTradeSettledRecordsModel []*LendTradeSettledRecordModel
LendTradeSettledRecordsModel is a list of *LendTradeSettledRecordModel
type LendTradeUnsettledRecordModel ¶ added in v1.2.0
type LendTradeUnsettledRecordModel struct { TradeId string `json:"tradeId"` Currency string `json:"currency"` Size json.Number `json:"size"` AccruedInterest json.Number `json:"accruedInterest"` Repaid json.Number `json:"repaid"` DailyIntRate json.Number `json:"dailyIntRate"` Term json.Number `json:"term"` MaturityTime json.Number `json:"maturityTime"` }
LendTradeUnsettledRecordModel represents a unsettled lend record
type LendTradeUnsettledRecordsModel ¶ added in v1.2.0
type LendTradeUnsettledRecordsModel []*LendTradeUnsettledRecordModel
LendTradeUnsettledRecordsModel is a list of *LendTradeUnsettledRecordModel
type LendingPurchaseUpdateV3Req ¶ added in v1.2.15
type LendingPurchaseV3Req ¶ added in v1.2.15
type LendingRedeemV3Req ¶ added in v1.2.15
type LendingV3Res ¶ added in v1.2.15
type LendingV3Res struct {
OrderNo string `json:"orderNo"`
}
type MarginAccountModel ¶ added in v1.2.0
type MarginAccountModel struct { Accounts []struct { AvailableBalance json.Number `json:"availableBalance"` Currency string `json:"currency"` HoldBalance json.Number `json:"holdBalance"` Liability json.Number `json:"liability"` MaxBorrowSize json.Number `json:"maxBorrowSize"` TotalBalance json.Number `json:"totalBalance"` } `json:"accounts"` DebtRatio json.Number `json:"debtRatio"` }
MarginAccountModel represents a margin account information
type MarginAccountV3Model ¶ added in v1.2.14
type MarginAccountV3Model struct { DebtRatio string `json:"debtRatio"` Accounts []struct { Currency string `json:"currency"` TotalBalance string `json:"totalBalance"` AvailableBalance string `json:"availableBalance"` HoldBalance string `json:"holdBalance"` Liability string `json:"liability"` MaxBorrowSize string `json:"maxBorrowSize"` } `json:"accounts"` }
type MarginBorrowV3Model ¶ added in v1.2.15
type MarginBorrowV3Req ¶ added in v1.2.15
type MarginBorrowV3Res ¶ added in v1.2.15
type MarginBorrowsV3Model ¶ added in v1.2.15
type MarginBorrowsV3Model []*MarginBorrowV3Model
type MarginConfigModel ¶ added in v1.2.0
type MarginConfigModel struct { CurrencyList []string `json:"currencyList"` WarningDebtRatio json.Number `json:"warningDebtRatio"` LiqDebtRatio json.Number `json:"liqDebtRatio"` MaxLeverage json.Number `json:"maxLeverage"` }
MarginConfigModel represents a margin configuration
type MarginCurrenciesModel ¶ added in v1.2.14
type MarginCurrenciesModel []*MarginCurrencyModel
type MarginCurrenciesRiskLimitModel ¶ added in v1.2.14
type MarginCurrenciesRiskLimitModel []*MarginCurrencyRiskLimitModel
type MarginCurrenciesV3Model ¶ added in v1.2.15
type MarginCurrenciesV3Model []*MarginCurrencyV3Model
type MarginCurrencyModel ¶ added in v1.2.14
type MarginCurrencyRiskLimitModel ¶ added in v1.2.14
type MarginCurrencyRiskLimitModel struct { Timestamp json.Number `json:"timestamp"` Currency string `json:"currency"` BorrowMaxAmount string `json:"borrowMaxAmount"` BuyMaxAmount string `json:"buyMaxAmount"` HoldMaxAmount string `json:"holdMaxAmount"` BorrowCoefficient string `json:"borrowCoefficient"` MarginCoefficient string `json:"marginCoefficient"` Precision int64 `json:"precision"` BorrowMinAmount string `json:"borrowMinAmount"` BorrowMinUnit string `json:"borrowMinUnit"` BorrowEnabled bool `json:"borrowEnabled"` }
type MarginCurrencyV3Model ¶ added in v1.2.15
type MarginCurrencyV3Model struct { Currency string `json:"currency"` PurchaseEnable bool `json:"purchaseEnable"` RedeemEnable bool `json:"redeemEnable"` Increment string `json:"increment"` MinPurchaseSize string `json:"minPurchaseSize"` MinInterestRate string `json:"minInterestRate"` MaxInterestRate string `json:"maxInterestRate"` InterestIncrement string `json:"interestIncrement"` MaxPurchaseSize string `json:"maxPurchaseSize"` MarketInterestRate string `json:"marketInterestRate"` AutoPurchaseEnable bool `json:"autoPurchaseEnable"` }
type MarginFillModel ¶ added in v1.2.15
type MarginFillModel struct { ID int64 `json:"id"` Symbol string `json:"symbol"` OpType string `json:"opType"` Type string `json:"type"` Side string `json:"side"` Price string `json:"price"` Size string `json:"size"` Funds string `json:"funds"` DealFunds string `json:"dealFunds"` DealSize string `json:"dealSize"` Fee string `json:"fee"` FeeCurrency string `json:"feeCurrency"` STP string `json:"stp"` TimeInForce string `json:"timeInForce"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` Iceberg bool `json:"iceberg"` VisibleSize string `json:"visibleSize"` CancelAfter int64 `json:"cancelAfter"` Channel string `json:"channel"` ClientOid string `json:"clientOid"` Remark string `json:"remark"` Tags string `json:"tags"` Active bool `json:"active"` InOrderBook bool `json:"inOrderBook"` CancelExist bool `json:"cancelExist"` CreatedAt int64 `json:"createdAt"` LastUpdatedAt int64 `json:"lastUpdatedAt"` TradeType string `json:"tradeType"` }
type MarginInterestRateV3Model ¶ added in v1.2.15
type MarginInterestRatesV3Model ¶ added in v1.2.15
type MarginInterestRatesV3Model []*MarginInterestRateV3Model
type MarginInterestV3Model ¶ added in v1.2.15
type MarginInterestsV3Model ¶ added in v1.2.15
type MarginInterestsV3Model []*MarginInterestV3Model
type MarginIsolatedAccountAssetsModel ¶ added in v1.2.13
type MarginIsolatedAccountAssetsModel struct { Symbol string `json:"symbol"` Status string `json:"status"` DebtRatio string `json:"debtRatio"` BaseAsset struct { Currency string `json:"currency"` TotalBalance string `json:"totalBalance"` HoldBalance string `json:"holdBalance"` AvailableBalance string `json:"availableBalance"` Liability string `json:"liability"` Interest string `json:"interest"` BorrowableAmount string `json:"borrowableAmount"` } `json:"baseAsset"` QuoteAsset struct { Currency string `json:"currency"` TotalBalance string `json:"totalBalance"` HoldBalance string `json:"holdBalance"` AvailableBalance string `json:"availableBalance"` Liability string `json:"liability"` Interest string `json:"interest"` BorrowableAmount string `json:"borrowableAmount"` } `json:"quoteAsset"` }
type MarginIsolatedAccountsModel ¶ added in v1.2.13
type MarginIsolatedAccountsModel struct { TotalConversionBalance string `json:"totalConversionBalance"` LiabilityConversionBalance string `json:"liabilityConversionBalance"` Assets []*MarginIsolatedAccountAssetsModel `json:"assets"` }
type MarginIsolatedBorrowRes ¶ added in v1.2.13
type MarginIsolatedSymbolModel ¶ added in v1.2.13
type MarginIsolatedSymbolModel struct { Symbol string `json:"symbol"` SymbolName string `json:"symbolName"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` MaxLeverage int64 `json:"maxLeverage"` FlDebtRatio string `json:"flDebtRatio"` TradeEnable bool `json:"tradeEnable"` AutoRenewMaxDebtRatio string `json:"autoRenewMaxDebtRatio"` BaseBorrowEnable bool `json:"baseBorrowEnable"` QuoteBorrowEnable bool `json:"quoteBorrowEnable"` BaseTransferInEnable bool `json:"baseTransferInEnable"` QuoteTransferInEnable bool `json:"quoteTransferInEnable"` }
type MarginIsolatedSymbolsModel ¶ added in v1.2.13
type MarginIsolatedSymbolsModel []*MarginIsolatedSymbolModel
type MarginMarketModel ¶ added in v1.2.0
type MarginMarketModel struct { DailyIntRate json.Number `json:"dailyIntRate"` Term json.Number `json:"term"` Size json.Number `json:"size"` }
MarginMarketModel represents lending market data
type MarginMarketsModel ¶ added in v1.2.0
type MarginMarketsModel []*MarginMarketModel
MarginMarketsModel is a list of *MarginMarketModel
type MarginOrderV3Model ¶ added in v1.2.15
type MarginOrderV3Model struct { Id string `json:"id"` Symbol string `json:"symbol"` OpType string `json:"opType"` Type string `json:"type"` Side string `json:"side"` Price string `json:"price"` Size string `json:"size"` Funds string `json:"funds"` DealFunds string `json:"dealFunds"` DealSize string `json:"dealSize"` Fee string `json:"fee"` FeeCurrency string `json:"feeCurrency"` Stp string `json:"stp"` TimeInForce string `json:"timeInForce"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` Iceberg bool `json:"iceberg"` VisibleSize string `json:"visibleSize"` CancelAfter int `json:"cancelAfter"` Channel string `json:"channel"` ClientOid string `json:"clientOid"` Remark string `json:"remark"` Tags string `json:"tags"` Active bool `json:"active"` InOrderBook bool `json:"inOrderBook"` CancelExist bool `json:"cancelExist"` CreatedAt int64 `json:"createdAt"` LastUpdatedAt int64 `json:"lastUpdatedAt"` TradeType string `json:"tradeType"` }
type MarginRepay3VReq ¶ added in v1.2.15
type MarginRepayV3Model ¶ added in v1.2.15
type MarginRepayV3Res ¶ added in v1.2.15
type MarginRepaysV3Model ¶ added in v1.2.15
type MarginRepaysV3Model []*MarginRepayV3Model
type MarginRiskLimitItemModel ¶ added in v1.2.12
type MarginRiskLimitItemModel struct { Currency string `json:"currency"` BorrowMaxAmount string `json:"borrowMaxAmount"` BuyMaxAmount string `json:"buyMaxAmount"` Precision json.Number `json:"precision"` }
MarginRiskLimitItemModel is item of *MarginRiskLimitModel
type MarginRiskLimitModel ¶ added in v1.2.12
type MarginRiskLimitModel []*MarginRiskLimitItemModel
MarginRiskLimitModel is a list of *MarginRiskLimitModel
type MarginSymbolV3Model ¶ added in v1.2.15
type MarginSymbolV3Model 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 float64 `json:"baseIncrement"` BaseMinSize float64 `json:"baseMinSize"` QuoteIncrement float64 `json:"quoteIncrement"` QuoteMinSize float64 `json:"quoteMinSize"` BaseMaxSize int64 `json:"baseMaxSize"` QuoteMaxSize int `json:"quoteMaxSize"` PriceIncrement float64 `json:"priceIncrement"` FeeCurrency string `json:"feeCurrency"` PriceLimitRate float64 `json:"priceLimitRate"` MinFunds float64 `json:"minFunds"` }
type MarginSymbolsV3Model ¶ added in v1.2.15
type MarginSymbolsV3Model struct { Items []*MarginSymbolsV3Model `json:"items"` Timestamp int64 `json:"timestamp"` }
type MarginTradeModel ¶ added in v1.2.0
type MarginTradeModel struct { TradeId string `json:"tradeId"` Currency string `json:"currency"` Size json.Number `json:"size"` DailyIntRate json.Number `json:"dailyIntRate"` Term json.Number `json:"term"` Timestamp json.Number `json:"timestamp"` }
MarginTradeModel represents lending market trade data
type MarginTradesModel ¶ added in v1.2.0
type MarginTradesModel []*MarginTradeModel
MarginTradesModel is a list of *MarginTradeModel
type MarkPriceModel ¶ added in v1.2.0
type MarkPriceModel struct { Symbol string `json:"symbol"` Granularity json.Number `json:"granularity"` TimePoint json.Number `json:"timePoint"` Value json.Number `json:"value"` }
MarkPriceModel represents mark price of a symbol
type MarketsModel ¶ added in v1.2.10
type MarketsModel []string
MarketsModel returns Model of Markets API.
type OTCAccountModel ¶ added in v1.2.15
type OTCAccountsModel ¶ added in v1.2.15
type OTCAccountsModel []*OTCAccountModel
type OTCLoanModel ¶ added in v1.2.15
type OTCLoanModel struct { ParentUid string `json:"parentUid"` Orders []struct { OrderId string `json:"orderId"` Currency string `json:"currency"` Principal json.Number `json:"principal"` Interest json.Number `json:"interest"` } `json:"orders"` Ltv struct { TransferLtv json.Number `json:"transferLtv"` OnlyClosePosLtv json.Number `json:"onlyClosePosLtv"` DelayedLiquidationLtv json.Number `json:"delayedLiquidationLtv"` InstantLiquidationLtv json.Number `json:"instantLiquidationLtv"` CurrentLtv json.Number `json:"currentLtv"` } `json:"ltv"` TotalMarginAmount json.Number `json:"totalMarginAmount"` TransferMarginAmount json.Number `json:"transferMarginAmount"` Margins []struct { MarginCcy string `json:"marginCcy"` MarginQty json.Number `json:"marginQty"` MarginFactor json.Number `json:"marginFactor"` } `json:"margins"` }
type OcoOrderResModel ¶ added in v1.2.14
type OcoOrdersModel ¶ added in v1.2.14
type OcoOrdersModel []*OrderDetailModel
type OcoOrdersRes ¶ added in v1.2.14
type OcoOrdersRes []*OcoOrderResModel
type OcoSubOrderModel ¶ added in v1.2.14
type OrderDetailModel ¶ added in v1.2.14
type OrderModel ¶
type OrderModel struct { Id string `json:"id"` Symbol string `json:"symbol"` OpType string `json:"opType"` Type string `json:"type"` Side string `json:"side"` Price string `json:"price"` Size string `json:"size"` Funds string `json:"funds"` DealFunds string `json:"dealFunds"` DealSize string `json:"dealSize"` Fee string `json:"fee"` FeeCurrency string `json:"feeCurrency"` Stp string `json:"stp"` Stop string `json:"stop"` StopTriggered bool `json:"stopTriggered"` StopPrice string `json:"stopPrice"` TimeInForce string `json:"timeInForce"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` IceBerg bool `json:"iceberg"` VisibleSize string `json:"visibleSize"` CancelAfter int64 `json:"cancelAfter"` Channel string `json:"channel"` ClientOid string `json:"clientOid"` Remark string `json:"remark"` Tags string `json:"tags"` IsActive bool `json:"isActive"` CancelExist bool `json:"cancelExist"` CreatedAt int64 `json:"createdAt"` TradeType string `json:"tradeType"` }
An OrderModel represents an order.
type PaginationModel ¶
type PaginationModel struct { CurrentPage int64 `json:"currentPage"` PageSize int64 `json:"pageSize"` TotalNum int64 `json:"totalNum"` TotalPage int64 `json:"totalPage"` RawItems json.RawMessage `json:"items"` // delay parsing }
A PaginationModel represents the pagination in a response.
func (*PaginationModel) ReadItems ¶
func (p *PaginationModel) ReadItems(v interface{}) error
ReadItems read the `items` into v.
type PaginationParam ¶
A PaginationParam represents the pagination parameters `currentPage` `pageSize` in a request .
func (*PaginationParam) ReadParam ¶
func (p *PaginationParam) ReadParam(params map[string]string)
ReadParam read pagination parameters into params.
type PartOrderBookModel ¶
type PartOrderBookModel struct { Sequence string `json:"sequence"` Time int64 `json:"time"` Bids [][]string `json:"bids"` Asks [][]string `json:"asks"` }
A PartOrderBookModel represents a list of open orders for a symbol, a part of Order Book within 100 depth for each side(ask or bid).
type PricesModel ¶ added in v1.2.10
type RedeemPreviewModel ¶ added in v1.2.15
type RedeemPreviewModel struct { Currency string `json:"currency"` RedeemAmount json.Number `json:"redeemAmount"` PenaltyInterestAmount json.Number `json:"penaltyInterestAmount"` RedeemPeriod int32 `json:"redeemPeriod"` DeliverTime int64 `json:"deliverTime"` ManualRedeemable bool `json:"manualRedeemable"` RedeemAll bool `json:"redeemAll"` }
type RedemptionOrderV3Model ¶ added in v1.2.15
type RedemptionOrderV3Model struct { Currency string `json:"currency"` PurchaseOrderNo string `json:"purchaseOrderNo"` RedeemOrderNo string `json:"redeemOrderNo"` RedeemAmount json.Number `json:"redeemAmount"` ReceiptAmount json.Number `json:"receiptAmount"` ApplyTime int64 `json:"applyTime"` Status string `json:"status"` }
type RedemptionOrdersV3Model ¶ added in v1.2.15
type RedemptionOrdersV3Model []*RedemptionOrderV3Model
type Request ¶
type Request struct { BaseURI string Method string Path string Query url.Values Body []byte Header http.Header Timeout time.Duration SkipVerifyTls bool // contains filtered or unexported fields }
A Request represents a HTTP request.
func NewRequest ¶
NewRequest creates a instance of Request.
func (*Request) HttpRequest ¶
HttpRequest creates a instance of *http.Request.
func (*Request) RequestURI ¶
RequestURI returns the request uri.
type Requester ¶
type Requester interface {
Request(ctx context.Context, request *Request, timeout time.Duration) (*Response, error)
}
Requester contains Request() method, can launch a http request.
type Response ¶
A Response represents a HTTP response.
func NewResponse ¶ added in v1.2.7
NewResponse Creates a new Response
func (*Response) ReadJsonBody ¶
ReadJsonBody read the response data as JSON into v.
type ServerTimeModel ¶ added in v1.2.10
type ServerTimeModel int64
type ServiceStatusModel ¶ added in v1.2.5
A ServiceStatusModel represents the structure of service status.
type Sha256Signer ¶
type Sha256Signer struct {
// contains filtered or unexported fields
}
Sha256Signer is the sha256 Signer.
func (*Sha256Signer) Sign ¶
func (ss *Sha256Signer) Sign(plain []byte) []byte
Sign makes a signature by sha256.
type Stats24hrModel ¶
type Stats24hrModel struct { Time int64 `json:"time"` Symbol string `json:"symbol"` Buy string `json:"buy"` Sell string `json:"sell"` ChangeRate string `json:"changeRate"` ChangePrice string `json:"changePrice"` High string `json:"high"` Low string `json:"low"` Vol string `json:"vol"` VolValue string `json:"volValue"` Last string `json:"last"` AveragePrice string `json:"averagePrice"` TakerFeeRate string `json:"takerFeeRate"` MakerFeeRate string `json:"makerFeeRate"` TakerCoefficient string `json:"takerCoefficient"` MakerCoefficient string `json:"makerCoefficient"` }
A Stats24hrModel represents 24 hr stats for the symbol. Volume is in base currency units. Open, high, low are in quote currency units.
type StopOrderListModel ¶ added in v1.2.10
type StopOrderListModel []*StopOrderModel
StopOrderListModel StopOrderByClient model
type StopOrderModel ¶ added in v1.2.10
type StopOrderModel struct { Id string `json:"id"` Symbol string `json:"symbol"` UserId string `json:"userId"` Status string `json:"status"` Type string `json:"type"` Side string `json:"side"` Price string `json:"price"` Size string `json:"size"` Funds string `json:"funds"` Stp string `json:"stp"` TimeInForce string `json:"timeInForce"` CancelAfter int64 `json:"cancelAfter"` PostOnly bool `json:"postOnly"` Hidden bool `json:"hidden"` IceBerg bool `json:"iceberg"` VisibleSize string `json:"visibleSize"` Channel string `json:"channel"` ClientOid string `json:"clientOid"` Remark string `json:"remark"` Tags string `json:"tags"` OrderTime int64 `json:"orderTime"` 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 int64 `json:"createdAt"` Stop string `json:"stop"` StopTriggerTime string `json:"stopTriggerTime"` StopPrice string `json:"stopPrice"` }
StopOrderModel RESPONSES of StopOrder
type SubAccountModel ¶ added in v1.1.0
type SubAccountModel struct { SubUserId string `json:"subUserId"` SubName string `json:"subName"` MainAccounts []struct { Currency string `json:"currency"` Balance string `json:"balance"` Available string `json:"available"` Holds string `json:"holds"` BaseCurrency string `json:"baseCurrency"` BaseCurrencyPrice string `json:"baseCurrencyPrice"` BaseAmount string `json:"baseAmount"` } `json:"mainAccounts"` TradeAccounts []struct { Currency string `json:"currency"` Balance string `json:"balance"` Available string `json:"available"` Holds string `json:"holds"` BaseCurrency string `json:"baseCurrency"` BaseCurrencyPrice string `json:"baseCurrencyPrice"` BaseAmount string `json:"baseAmount"` } `json:"tradeAccounts"` MarginAccounts []struct { Currency string `json:"currency"` Balance string `json:"balance"` Available string `json:"available"` Holds string `json:"holds"` BaseCurrency string `json:"baseCurrency"` BaseCurrencyPrice string `json:"baseCurrencyPrice"` BaseAmount string `json:"baseAmount"` } `json:"marginAccounts"` }
A SubAccountModel represents the balance of a sub-account user.
type SubAccountUserModel ¶ added in v1.1.0
type SubAccountUserModel struct { UserId string `json:"userId"` SubName string `json:"subName"` Remarks string `json:"remarks"` Type int `json:"type"` Access string `json:"access"` Uid int64 `json:"uid"` }
A SubAccountUserModel represents a sub-account user.
type SubAccountUserModelV2 ¶ added in v1.2.13
type SubAccountUserModelV2 struct { UserId string `json:"userId"` Uid int64 `json:"uid"` SubName string `json:"subName"` Status int `json:"status"` Type int `json:"type"` Access string `json:"access"` CreatedAt json.Number `json:"createdAt"` Remarks string `json:"remarks"` }
A SubAccountUserModelV2 represents a sub-account user.
type SubAccountUsersModel ¶ added in v1.1.0
type SubAccountUsersModel []*SubAccountUserModel
A SubAccountUsersModel is the set of *SubAccountUserModel.
type SubAccountUsersModelV2 ¶ added in v1.2.13
type SubAccountUsersModelV2 []*SubAccountUserModelV2
A SubAccountUsersModelV2 is the set of *SubAccountUserModelV2.
type SubAccountsModel ¶ added in v1.1.0
type SubAccountsModel []*SubAccountModel
A SubAccountsModel is the set of *SubAccountModel.
type SubApiKeyModel ¶ added in v1.2.13
type SubApiKeyRes ¶ added in v1.2.13
type SubApiKeyRes []*SubApiKeyModel
type SubTransferResultModel ¶ added in v1.1.0
type SubTransferResultModel InnerTransferResultModel
A SubTransferResultModel represents the result of a sub-transfer operation.
type SubscriptionOrderV3Model ¶ added in v1.2.15
type SubscriptionOrderV3Model struct { Currency string `json:"currency"` PurchaseOrderNo string `json:"purchaseOrderNo"` PurchaseAmount json.Number `json:"purchaseAmount"` LendAmount json.Number `json:"lendAmount"` RedeemAmount json.Number `json:"redeemAmount"` InterestRate json.Number `json:"interestRate"` IncomeAmount json.Number `json:"incomeAmount"` ApplyTime int64 `json:"applyTime"` Status string `json:"status"` }
type SubscriptionOrdersV3Model ¶ added in v1.2.15
type SubscriptionOrdersV3Model []*SubscriptionOrderV3Model
type SymbolModel ¶
type SymbolModel struct { Symbol string `json:"symbol"` Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` Market string `json:"market"` BaseMinSize string `json:"baseMinSize"` QuoteMinSize string `json:"quoteMinSize"` BaseMaxSize string `json:"baseMaxSize"` QuoteMaxSize string `json:"quoteMaxSize"` BaseIncrement string `json:"baseIncrement"` QuoteIncrement string `json:"quoteIncrement"` PriceIncrement string `json:"priceIncrement"` FeeCurrency string `json:"feeCurrency"` EnableTrading bool `json:"enableTrading"` IsMarginEnabled bool `json:"isMarginEnabled"` PriceLimitRate string `json:"priceLimitRate"` }
A SymbolModel represents an available currency pairs for trading.
type SymbolModelV2 ¶ added in v1.2.13
type SymbolModelV2 struct { Symbol string `json:"symbol"` Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` Market string `json:"market"` BaseMinSize string `json:"baseMinSize"` QuoteMinSize string `json:"quoteMinSize"` BaseMaxSize string `json:"baseMaxSize"` QuoteMaxSize string `json:"quoteMaxSize"` BaseIncrement string `json:"baseIncrement"` QuoteIncrement string `json:"quoteIncrement"` PriceIncrement string `json:"priceIncrement"` FeeCurrency string `json:"feeCurrency"` EnableTrading bool `json:"enableTrading"` IsMarginEnabled bool `json:"isMarginEnabled"` PriceLimitRate string `json:"priceLimitRate"` MinFunds string `json:"minFunds"` }
type SymbolsModelV2 ¶ added in v1.2.13
type SymbolsModelV2 []*SymbolModelV2
A SymbolsModelV2 is the set of *SymbolsModelV2.
type TickerLevel1Model ¶ added in v1.0.3
type TickerLevel1Model struct { Sequence string `json:"sequence"` Price string `json:"price"` Size string `json:"size"` BestBid string `json:"bestBid"` BestBidSize string `json:"bestBidSize"` BestAsk string `json:"bestAsk"` BestAskSize string `json:"bestAskSize"` Time int64 `json:"time"` }
A TickerLevel1Model represents ticker include only the inside (i.e. best) bid and ask data, last price and last trade size.
type TickerModel ¶
type TickerModel struct { Symbol string `json:"symbol"` SymbolName string `json:"symbolName"` Buy string `json:"buy"` Sell string `json:"sell"` ChangeRate string `json:"changeRate"` ChangePrice string `json:"changePrice"` High string `json:"high"` Low string `json:"low"` Vol string `json:"vol"` VolValue string `json:"volValue"` Last string `json:"last"` AveragePrice string `json:"averagePrice"` TakerFeeRate string `json:"takerFeeRate"` MakerFeeRate string `json:"makerFeeRate"` TakerCoefficient string `json:"takerCoefficient"` MakerCoefficient string `json:"makerCoefficient"` }
A TickerModel represents a market ticker for all trading pairs in the market (including 24h volume).
type TickersModel ¶ added in v1.0.3
type TickersModel []*TickerModel
A TickersModel is the set of *MarketTickerModel.
type TickersResponseModel ¶ added in v1.0.3
type TickersResponseModel struct { Time int64 `json:"time"` Tickers TickersModel `json:"ticker"` }
TickersResponseModel represents the response model of MarketTickers().
type TradeFeesResultModel ¶ added in v1.2.10
type TradeHistoriesModel ¶
type TradeHistoriesModel []*TradeHistoryModel
A TradeHistoriesModel is the set of *TradeHistoryModel.
type TradeHistoryModel ¶
type TradeHistoryModel struct { Sequence string `json:"sequence"` Price string `json:"price"` Size string `json:"size"` Side string `json:"side"` Time int64 `json:"time"` }
A TradeHistoryModel represents the latest trades for a symbol.
type UniversalTransferReq ¶ added in v1.2.15
type UniversalTransferReq struct { ClientOid string `json:"clientOid"` Type string `json:"type"` Currency string `json:"currency"` Amount string `json:"amount"` FromUserId string `json:"fromUserId,omitempty"` FromAccountType string `json:"fromAccountType"` FromAccountTag string `json:"fromAccountTag,omitempty"` ToAccountType string `json:"toAccountType"` ToUserId string `json:"toUserId,omitempty"` ToAccountTag string `json:"toAccountTag,omitempty"` }
type UniversalTransferRes ¶ added in v1.2.15
type UniversalTransferRes struct {
OrderId string `json:"orderId"`
}
type UpdateSubApiKeyRes ¶ added in v1.2.13
type UpdateUserLeverageV3Model ¶ added in v1.2.15
type UserSummaryInfoModelV2 ¶ added in v1.2.13
type UserSummaryInfoModelV2 struct { Level int `json:"level"` SubQuantity int `json:"subQuantity"` MaxDefaultSubQuantity int `json:"maxDefaultSubQuantity"` MaxSubQuantity int `json:"maxSubQuantity"` SpotSubQuantity int `json:"spotSubQuantity"` MarginSubQuantity int `json:"marginSubQuantity"` FuturesSubQuantity int `json:"futuresSubQuantity"` MaxSpotSubQuantity int `json:"maxSpotSubQuantity"` MaxMarginSubQuantity int `json:"maxMarginSubQuantity"` MaxFuturesSubQuantity int `json:"maxFuturesSubQuantity"` }
An UserSummaryInfoModelV2 represents an account.
type V1DepositModel ¶ added in v1.1.0
type V1DepositModel struct { Amount string `json:"amount"` Currency string `json:"currency"` IsInner bool `json:"isInner"` WalletTxId string `json:"walletTxId"` Status string `json:"status"` CreateAt int64 `json:"createAt"` }
A V1DepositModel represents a v1 deposit record.
type V1DepositsModel ¶ added in v1.1.0
type V1DepositsModel []*V1DepositModel
A V1DepositsModel is the set of *V1DepositModel.
type V1OrderModel ¶ added in v1.1.0
type V1OrderModel struct { Symbol string `json:"symbol"` DealPrice string `json:"dealPrice"` DealValue string `json:"dealValue"` Amount string `json:"amount"` Fee string `json:"fee"` Side string `json:"side"` CreatedAt int64 `json:"createdAt"` }
A V1OrderModel represents a v1 order.
type V1OrdersModel ¶ added in v1.1.0
type V1OrdersModel []*V1OrderModel
A V1OrdersModel is the set of *V1OrderModel.
type V1WithdrawalModel ¶ added in v1.1.0
type V1WithdrawalModel struct { Address string `json:"address"` Amount string `json:"amount"` Currency string `json:"currency"` IsInner bool `json:"isInner"` WalletTxId string `json:"walletTxId"` Status string `json:"status"` CreateAt int64 `json:"createAt"` }
A V1WithdrawalModel represents a v1 historical withdrawal.
type V1WithdrawalsModel ¶ added in v1.1.0
type V1WithdrawalsModel []*V1WithdrawalModel
A V1WithdrawalsModel is the set of *V1WithdrawalModel.
type WebSocketClient ¶
type WebSocketClient struct {
// contains filtered or unexported fields
}
A WebSocketClient represents a connection to WebSocket server.
func (*WebSocketClient) Connect ¶
func (wc *WebSocketClient) Connect() (<-chan *WebSocketDownstreamMessage, <-chan error, error)
Connect connects the WebSocket server.
func (*WebSocketClient) Stop ¶
func (wc *WebSocketClient) Stop()
Stop stops subscribing the specified channel, all goroutines quit.
func (*WebSocketClient) Subscribe ¶
func (wc *WebSocketClient) Subscribe(channels ...*WebSocketSubscribeMessage) error
Subscribe subscribes the specified channel.
func (*WebSocketClient) Unsubscribe ¶ added in v1.0.6
func (wc *WebSocketClient) Unsubscribe(channels ...*WebSocketUnsubscribeMessage) error
Unsubscribe unsubscribes the specified channel.
type WebSocketClientOpts ¶ added in v1.2.3
type WebSocketClientOpts struct { Token *WebSocketTokenModel TLSSkipVerify bool Timeout time.Duration }
WebSocketClientOpts defines the options for the client during the websocket connection.
type WebSocketDownstreamMessage ¶
type WebSocketDownstreamMessage struct { *WebSocketMessage Sn int64 `json:"sn"` Topic string `json:"topic"` Subject string `json:"subject"` RawData json.RawMessage `json:"data"` }
A WebSocketDownstreamMessage represents a message from the WebSocket server to client.
func (*WebSocketDownstreamMessage) ReadData ¶
func (m *WebSocketDownstreamMessage) ReadData(v interface{}) error
ReadData read the data in channel.
type WebSocketMessage ¶
A WebSocketMessage represents a message between the WebSocket client and server.
func NewPingMessage ¶
func NewPingMessage() *WebSocketMessage
NewPingMessage creates a ping message instance.
type WebSocketServerModel ¶
type WebSocketServerModel struct { PingInterval int64 `json:"pingInterval"` Endpoint string `json:"endpoint"` Protocol string `json:"protocol"` Encrypt bool `json:"encrypt"` PingTimeout int64 `json:"pingTimeout"` }
A WebSocketServerModel contains some servers for WebSocket feed.
type WebSocketServersModel ¶
type WebSocketServersModel []*WebSocketServerModel
A WebSocketServersModel is the set of *WebSocketServerModel.
func (WebSocketServersModel) RandomServer ¶
func (s WebSocketServersModel) RandomServer() (*WebSocketServerModel, error)
RandomServer returns a server randomly.
type WebSocketSubscribeMessage ¶
type WebSocketSubscribeMessage struct { *WebSocketMessage Topic string `json:"topic"` PrivateChannel bool `json:"privateChannel"` Response bool `json:"response"` }
A WebSocketSubscribeMessage represents a message to subscribe the public/private channel.
func NewSubscribeMessage ¶
func NewSubscribeMessage(topic string, privateChannel bool) *WebSocketSubscribeMessage
NewSubscribeMessage creates a subscribe message instance.
type WebSocketTokenModel ¶
type WebSocketTokenModel struct { Token string `json:"token"` Servers WebSocketServersModel `json:"instanceServers"` AcceptUserMessage bool `json:"accept_user_message"` }
A WebSocketTokenModel contains a token and some servers for WebSocket feed.
type WebSocketUnsubscribeMessage ¶ added in v1.0.6
type WebSocketUnsubscribeMessage WebSocketSubscribeMessage
A WebSocketUnsubscribeMessage represents a message to unsubscribe the public/private channel.
func NewUnsubscribeMessage ¶
func NewUnsubscribeMessage(topic string, privateChannel bool) *WebSocketUnsubscribeMessage
NewUnsubscribeMessage creates a unsubscribe message instance.
type WithdrawalModel ¶
type WithdrawalModel struct { Chain string `json:"chain"` Id string `json:"id"` Address string `json:"address"` Memo string `json:"memo"` Currency string `json:"currency"` Amount string `json:"amount"` Fee string `json:"fee"` WalletTxId string `json:"walletTxId"` IsInner bool `json:"isInner"` Status string `json:"status"` Remark string `json:"remark"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
A WithdrawalModel represents a withdrawal.
type WithdrawalQuotasModel ¶
type WithdrawalQuotasModel struct { Currency string `json:"currency"` AvailableAmount string `json:"availableAmount"` RemainAmount string `json:"remainAmount"` WithdrawMinSize string `json:"withdrawMinSize"` LimitBTCAmount string `json:"limitBTCAmount"` InnerWithdrawMinFee string `json:"innerWithdrawMinFee"` UsedBTCAmount string `json:"usedBTCAmount"` IsWithdrawEnabled bool `json:"isWithdrawEnabled"` WithdrawMinFee string `json:"withdrawMinFee"` Precision uint8 `json:"precision"` Chain string `json:"chain"` }
A WithdrawalQuotasModel represents the quotas for a currency.
type WithdrawalsModel ¶
type WithdrawalsModel []*WithdrawalModel
A WithdrawalsModel is the set of *WithdrawalModel.