Documentation
¶
Index ¶
- Variables
- type APIKeyInformation
- type Account
- type AccountBalance
- type AccountState
- type AccountType
- type AssetValuation
- type BalanceType
- type CancelSource
- type CancelWithdrawal
- type CommonSymbol
- type Currency
- type CurrencyReference
- type CurrencyReferenceChain
- type DepositAddress
- type Direction
- type HtxErrorCode
- type ListItem
- type MarketDetail
- type MarketStatus
- type MarketStatusResponse
- type MarketSymbol
- type MarketTicker
- type Order
- type OrderSource
- type OrderState
- type OrderType
- type Symbol
- type SymbolStatus
- type TransferState
- type WithdrawalAddress
- type WithdrawalByClientID
- type WithdrawalDepositHistory
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHtxForbiddenTradeForOpenProtect = errors.New("forbidden-trade-for-open-protect") ErrHtxBaseArgumentUnsupported = errors.New("base-argument-unsupported") ErrHtxBaseSystemError = errors.New("base-system-error") ErrHtxLoginRequired = errors.New("login-required") ErrHtxParameterRequired = errors.New("parameter-required") ErrHtxBaseRecordInvalid = errors.New("base-record-invalid") ErrHtxOrderAmountOverLimit = errors.New("order-amount-over-limit") ErrHtxBaseSymbolTradeDisabled = errors.New("base-symbol-trade-disabled") ErrHtxBaseOperationForbidden = errors.New("base-operation-forbidden") ErrHtxAccountGetAccountsInexistent = errors.New("account-get-accounts-inexistent-error") ErrHtxAccountAccountIDInexistent = errors.New("account-account-id-inexistent") ErrHtxSubUserAuthRequired = errors.New("sub-user-auth-required") ErrHtxOrderDisabled = errors.New("order-disabled") ErrHtxCancelDisabled = errors.New("cancel-disabled") ErrHtxOrderInvalidPrice = errors.New("order-invalid-price") ErrHtxOrderAccountBalanceError = errors.New("order-accountbalance-error") ErrHtxOrderLimitOrderPriceMinError = errors.New("order-limitorder-price-min-error") ErrHtxOrderLimitOrderPriceMaxError = errors.New("order-limitorder-price-max-error") ErrHtxOrderLimitOrderAmountMinError = errors.New("order-limitorder-amount-min-error") ErrHtxOrderLimitOrderAmountMaxError = errors.New("order-limitorder-amount-max-error") ErrHtxOrderETPNAVPriceMinError = errors.New("order-etp-nav-price-min-error") ErrHtxOrderETPNAVPriceMaxError = errors.New("order-etp-nav-price-max-error") ErrHtxOrderOrderPricePrecisionError = errors.New("order-orderprice-precision-error") ErrHtxOrderOrderAmountPrecisionError = errors.New("order-orderamount-precision-error") ErrHtxOrderValueMinError = errors.New("order-value-min-error") ErrHtxOrderMarketOrderAmountMinError = errors.New("order-marketorder-amount-min-error") ErrHtxOrderMarketOrderAmountBuyMaxError = errors.New("order-marketorder-amount-buy-max-error") ErrHtxOrderMarketOrderAmountSellMaxError = errors.New("order-marketorder-amount-sell-max-error") ErrHtxOrderHoldingLimitFailed = errors.New("order-holding-limit-failed") ErrHtxOrderTypeInvalid = errors.New("order-type-invalid") ErrHtxOrderOrderStateError = errors.New("order-orderstate-error") ErrHtxOrderDateLimitError = errors.New("order-date-limit-error") ErrHtxOrderSourceInvalid = errors.New("order-source-invalid") ErrHtxOrderUpdateError = errors.New("order-update-error") ErrHtxOrderFLCancellationIsDisallowed = errors.New("order-fl-cancellation-is-disallowed") ErrHtxOperationForbiddenForFLAccountState = errors.New("operation-forbidden-for-fl-account-state") ErrHtxOperationForbiddenForLockAccountState = errors.New("operation-forbidden-for-lock-account-state") ErrHtxFLOrderAlreadyExisted = errors.New("fl-order-already-existed") ErrHtxOrderUserCancelForbidden = errors.New("order-user-cancel-forbidden") ErrHtxAccountStateInvalid = errors.New("account-state-invalid") ErrHtxOrderPriceGreaterThanLimit = errors.New("order-price-greater-than-limit") ErrHtxOrderPriceLessThanLimit = errors.New("order-price-less-than-limit") ErrHtxOrderStopOrderHitTrigger = errors.New("order-stop-order-hit-trigger") ErrHtxMarketOrdersNotSupportDuringLimitPriceTrading = errors.New("market-orders-not-support-during-limit-price-trading") ErrHtxPriceExceedsTheProtectivePriceDuringLimitPriceTrading = errors.New("price-exceeds-the-protective-price-during-limit-price-trading") ErrHtxInvalidClientOrderID = errors.New("invalid-client-order-id") ErrHtxInvalidInterval = errors.New("invalid-interval") ErrHtxInvalidStartDate = errors.New("invalid-start-date") ErrHtxInvalidEndDate = errors.New("invalid-end-date") ErrHtxInvalidStartTime = errors.New("invalid-start-time") ErrHtxInvalidEndTime = errors.New("invalid-end-time") ErrHtxValidationConstraintsRequired = errors.New("validation-constraints-required") ErrHtxSymbolNotSupport = errors.New("symbol-not-support") ErrHtxNotFound = errors.New("not-found") ErrHtxBaseNotFound = errors.New("base-not-found") ErrHtxAccountGetBalanceAccountInexistentError = errors.New("account-get-balance-account-inexistent-error") ErrHtxRateLimitExceeded = errors.New("rate-too-many-requests") )
Functions ¶
This section is empty.
Types ¶
type APIKeyInformation ¶
type APIKeyInformation struct {
AccessKey string `json:"accessKey"`
Note string `json:"note"`
Permission string `json:"permission"`
IPAddresses string `json:"ipAddresses"`
ValidDays int `json:"validDays"`
Status string `json:"status"`
CreateTime int64 `json:"createTime"`
UpdateTime int64 `json:"updateTime"`
}
type Account ¶
type Account struct {
ID int64 `json:"id"`
State AccountState `json:"state"`
Type AccountType `json:"type"`
SubType string `json:"subtype,omitempty"`
}
type AccountBalance ¶
type AccountBalance struct {
ID int64 `json:"id,omitempty"`
Type AccountType `json:"type,omitempty"`
State AccountState `json:"state,omitempty"`
List []ListItem `json:"list,omitempty"`
}
type AccountState ¶
type AccountState string
const ( AccountStateLocked AccountState = "lock" AccountStateWorking AccountState = "working" )
func (AccountState) String ¶
func (o AccountState) String() string
type AccountType ¶
type AccountType string
const ( AccountTypeSpot AccountType = "spot" AccountTypeMargin AccountType = "margin" AccountTypeOTC AccountType = "otc" AccountTypePoint AccountType = "point" AccountTypeSuper AccountType = "super-margin" AccountTypeInvest AccountType = "investment" )
func (AccountType) String ¶
func (o AccountType) String() string
type AssetValuation ¶
type BalanceType ¶
type BalanceType string
const ( BalanceTypeTrade BalanceType = "trade" BalanceTypeFrozen BalanceType = "frozen" BalanceTypeLoan BalanceType = "loan" BalanceTypeInterest BalanceType = "interest" BalanceTypeLock BalanceType = "lock" )
func (BalanceType) String ¶
func (o BalanceType) String() string
type CancelSource ¶
type CancelSource string
const ( CancelSourceTimeoutCanceledOrder CancelSource = "timeout-canceled-order" CancelSourceCrossMarginFlSys CancelSource = "cross-margin-fl-sys" CancelSourceIsolatedMarginFlSys CancelSource = "isolated-margin-fl-sys" CancelSourceCoinListingDelisting CancelSource = "coin-listing-delisting" CancelSourceAPI CancelSource = "api" CancelSourceUserActivelyCancelsWeb CancelSource = "user-actively-cancels-order-web" CancelSourceUserActivelyCancelsIOS CancelSource = "user-actively-cancels-order-ios" CancelSourceUserActivelyCancelsAndroid CancelSource = "user-actively-cancels-order-ios" CancelSourceAdmin CancelSource = "admin" CancelSourceGridEnd CancelSource = "grid-end" CancelSourceSystemManuallyCancelsOrder CancelSource = "system-manually-cancels-order" CancelSourceCircuit CancelSource = "circuit" CancelSourceSelfMatchPrevent CancelSource = "self_match_prevent" CancelSourceMarket CancelSource = "market" CancelSourceFok CancelSource = "fok" CancelSourceIOC CancelSource = "ioc" CancelSourceLimitMaker CancelSource = "limit_maker" )
type CancelWithdrawal ¶
type CancelWithdrawal struct{}
type CommonSymbol ¶
type CommonSymbol struct {
BaseCurrency string `json:"base-currency"`
QuoteCurrency string `json:"quote-currency"`
PricePrecision int `json:"price-precision"`
AmountPrecision int `json:"amount-precision"`
SymbolPartition string `json:"symbol-partition"`
Symbol string `json:"symbol"`
State SymbolStatus `json:"state"`
ValuePrecision int `json:"value-precision"`
MinOrderAmt float64 `json:"min-order-amt"`
MaxOrderAmt float64 `json:"max-order-amt"`
MinOrderValue float64 `json:"min-order-value"`
LimitOrderMinOrderAmt float64 `json:"limit-order-min-order-amt"`
LimitOrderMaxOrderAmt float64 `json:"limit-order-max-order-amt"`
LimitOrderMaxBuyAmt float64 `json:"limit-order-max-buy-amt"`
LimitOrderMaxSellAmt float64 `json:"limit-order-max-sell-amt"`
BuyLimitMustLessThan float64 `json:"buy-limit-must-less-than"`
SellLimitMustGreaterThan float64 `json:"sell-limit-must-greater-than"`
SellMarketMinOrderAmt float64 `json:"sell-market-min-order-amt"`
SellMarketMaxOrderAmt float64 `json:"sell-market-max-order-amt"`
BuyMarketMaxOrderValue float64 `json:"buy-market-max-order-value"`
MarketSellOrderRateMustLessThan float64 `json:"market-sell-order-rate-must-less-than"`
MarketBuyOrderRateMustLessThan float64 `json:"market-buy-order-rate-must-less-than"`
APITrading string `json:"api-trading"`
Tags string `json:"tags"`
}
type Currency ¶
type Currency struct {
CurrencyCode string `json:"cc,omitempty"`
DisplayName string `json:"dn,omitempty"`
FullName string `json:"fn,omitempty"`
AssetType int `json:"at,omitempty"`
WithdrawPrecision int `json:"wp,omitempty"`
FeeType string `json:"ft,omitempty"`
DepositMinAmount string `json:"dma,omitempty"`
WithdrawMinAmount string `json:"wma,omitempty"`
ShowPrecision string `json:"sp,omitempty"`
Weight int `json:"w,omitempty"`
IsQuoteCurrency bool `json:"qc,omitempty"`
State string `json:"state,omitempty"`
Visible bool `json:"v,omitempty"`
WhiteEnabled bool `json:"whe,omitempty"`
CountryDisabled bool `json:"cd,omitempty"`
DepositEnabled bool `json:"de,omitempty"`
WithdrawEnabled bool `json:"wed,omitempty"`
CurrencyAddrWithTag bool `json:"cawt,omitempty"`
FastConfirms int `json:"fc,omitempty"`
SafeConfirms int `json:"sc,omitempty"`
SuspendWithdrawDesc string `json:"swd,omitempty"`
WithdrawDesc string `json:"wd,omitempty"`
SuspendDepositDesc string `json:"sdd,omitempty"`
DepositDesc string `json:"dd,omitempty"`
SuspendVisibleDesc string `json:"svd,omitempty"`
Tags string `json:"tags,omitempty"`
}
type CurrencyReference ¶
type CurrencyReference struct {
Currency string `json:"currency"`
Chains []CurrencyReferenceChain `json:"chains"`
}
type CurrencyReferenceChain ¶
type CurrencyReferenceChain struct {
Chain string `json:"chain"`
DisplayName string `json:"displayName"`
BaseChain string `json:"baseChain"`
BaseChainProtocol string `json:"baseChainProtocol"`
IsDynamic bool `json:"isDynamic"`
NumOfConfirmations int `json:"numOfConfirmations"`
NumOfFastConfirmations int `json:"numOfFastConfirmations"`
MinDepositAmt string `json:"minDepositAmt"`
DepositStatus string `json:"depositStatus"`
MinWithdrawAmt string `json:"minWithdrawAmt"`
MaxWithdrawAmt string `json:"maxWithdrawAmt"`
WithdrawQuotaPerDay string `json:"withdrawQuotaPerDay"`
WithdrawQuotaPerYear string `json:"withdrawQuotaPerYear"`
WithdrawQuotaTotal string `json:"withdrawQuotaTotal"`
WithdrawPrecision int `json:"withdrawPrecision"`
WithdrawFeeType string `json:"withdrawFeeType"`
TransactFeeWithdraw string `json:"transactFeeWithdraw"`
MinTransactFeeWithdraw string `json:"minTransactFeeWithdraw"`
MaxTransactFeeWithdraw string `json:"maxTransactFeeWithdraw"`
TransactFeeRateWithdraw string `json:"transactFeeRateWithdraw"`
WithdrawStatus string `json:"withdrawStatus"`
}
type DepositAddress ¶
type HtxErrorCode ¶
type HtxErrorCode int
const ( HtxInternalError HtxErrorCode = 500 HtxInvalidSig HtxErrorCode = 1003 HtxInvalidField HtxErrorCode = 2002 HtxMissingField HtxErrorCode = 2003 )
Wallet errors codes
func (HtxErrorCode) String ¶
func (o HtxErrorCode) String() string
type MarketDetail ¶
type MarketStatus ¶
type MarketStatus int
const ( MarketStatusNormal MarketStatus = 1 MarketStatusSuspended MarketStatus = 2 MarketStatusCancelled MarketStatus = 3 )
type MarketStatusResponse ¶
type MarketStatusResponse struct {
MarketStatus MarketStatus `json:"marketStatus,omitempty"`
HaltStartTime int64 `json:"haltStartTime,omitempty"`
HaltEndTime int64 `json:"haltEndTime,omitempty"`
HaltReason int `json:"haltReason,omitempty"`
AffectedSymbols string `json:"affectedSymbols,omitempty"`
}
type MarketSymbol ¶
type MarketSymbol struct {
Symbol string `json:"symbol,omitempty"`
State SymbolStatus `json:"state,omitempty"`
BaseCurrency string `json:"bc,omitempty"`
QuoteCurrency string `json:"qc,omitempty"`
PricePrecision int `json:"pp,omitempty"`
AmountPrecision int `json:"ap,omitempty"`
ValuePrecision int `json:"vp,omitempty"`
MinOrderAmount float64 `json:"minoa,omitempty"`
MaxOrderAmount float64 `json:"maxoa,omitempty"`
MinOrderValue float64 `json:"minov,omitempty"`
SellMarketMinOrderAmount float64 `json:"smminoa,omitempty"`
SellMarketMaxOrderAmount float64 `json:"smmaxoa,omitempty"`
BuyMarketMaxOrderValue float64 `json:"bmmaxov,omitempty"`
APITrading string `json:"at,omitempty"`
}
type MarketTicker ¶
type MarketTicker struct {
Amount float64 `json:"amount"`
Count int `json:"count"`
Open float64 `json:"open"`
Close float64 `json:"close"`
Low float64 `json:"low"`
High float64 `json:"high"`
Volume float64 `json:"vol"`
Symbol string `json:"symbol"`
Bid float64 `json:"bid"`
BidSize float64 `json:"bidSize"`
Ask float64 `json:"ask"`
AskSize float64 `json:"askSize"`
}
type Order ¶
type Order struct {
ID int64 `json:"id,omitempty"`
ClientOrderID string `json:"client-order-id,omitempty"`
Symbol string `json:"symbol,omitempty"`
AccountID int64 `json:"account-id,omitempty"`
Amount string `json:"amount,omitempty"`
Price string `json:"price,omitempty"`
CreatedAt int64 `json:"created-at,omitempty"`
FinishedAt int64 `json:"finished-at,omitempty"`
CanceledAt int64 `json:"canceled-at,omitempty"`
Type OrderType `json:"type,omitempty"`
FieldAmount string `json:"field-amount,omitempty"`
FieldCashAmount string `json:"field-cash-amount,omitempty"`
FieldFees string `json:"field-fees,omitempty"`
Source OrderSource `json:"source,omitempty"`
CanceledSource CancelSource `json:"canceled-source,omitempty"`
State OrderState `json:"state,omitempty"`
StopPrice string `json:"stop-price,omitempty"`
Operator string `json:"operator,omitempty"`
}
type OrderSource ¶
type OrderSource string
const ( OrderSourceSys OrderSource = "sys" OrderSourceWeb OrderSource = "web" OrderSourceAPI OrderSource = "api" OrderSourceSpotAPI OrderSource = "spot-api" OrderSourceApp OrderSource = "app" OrderSourceFlSys OrderSource = "fl-sys" OrderSourceFlMgt OrderSource = "fl-mgt" OrderSourceSpotStop OrderSource = "spot-stop" OrderSourceMarginStop OrderSource = "margin-stop" OrderSourceSuperMarginStop OrderSource = "super-margin-stop" OrderSourceGridTradingSys OrderSource = "grid-trading-sys" )
type OrderState ¶
type OrderState string
const ( OrderStateCreated OrderState = "created" OrderStateSubmitted OrderState = "submitted" OrderStatePartialFilled OrderState = "partial-filled" OrderStateFilled OrderState = "filled" OrderStatePartialCanceled OrderState = "partial-canceled" OrderStateCanceling OrderState = "canceling" OrderStateCanceled OrderState = "canceled" )
func (OrderState) EncodeValues ¶
func (o OrderState) EncodeValues(key string, v *url.Values) error
func (OrderState) String ¶
func (o OrderState) String() string
type OrderType ¶
type OrderType string
const ( OrderTypeBuyMarket OrderType = "buy-market" OrderTypeSellMarket OrderType = "sell-market" OrderTypeBuyLimit OrderType = "buy-limit" OrderTypeSellLimit OrderType = "sell-limit" OrderTypeBuyIOC OrderType = "buy-ioc" OrderTypeSellIOC OrderType = "sell-ioc" OrderTypeBuyStopLimit OrderType = "buy-stop-limit" OrderTypeSellStopLimit OrderType = "sell-stop-limit" OrderTypeBuyLimitFok OrderType = "buy-limit-fok" OrderTypeSellLimitFok OrderType = "sell-limit-fok" OrderTypeBuyStopLimitFok OrderType = "buy-stop-limit-fok" OrderTypeSellStopLimitFok OrderType = "sell-stop-limit-fok" )
type Symbol ¶
type Symbol struct {
StateIsolated string `json:"si,omitempty"`
StateCross string `json:"scr,omitempty"`
OutsideSymbol string `json:"sc,omitempty"`
DisplayName string `json:"dn,omitempty"`
BaseCurrency string `json:"bc,omitempty"`
BaseCurrencyDisplayName string `json:"bcdn,omitempty"`
QuoteCurrency string `json:"qc,omitempty"`
QuoteCurrencyDisplayName string `json:"qcdn,omitempty"`
SymbolStatus SymbolStatus `json:"state,omitempty"`
WhiteEnabled bool `json:"whe,omitempty"`
CountryDisabled bool `json:"cd,omitempty"`
TradeEnabled bool `json:"te,omitempty"`
TradeOpenAt int64 `json:"toa,omitempty"`
SymbolPartition string `json:"sp,omitempty"`
WeightSort int `json:"w,omitempty"`
TradeTotalPrecision float64 `json:"ttp,omitempty"`
TradeAmountPrecision float64 `json:"tap,omitempty"`
TradePricePrecision float64 `json:"tpp,omitempty"`
FeePrecision float64 `json:"fp,omitempty"`
SuspendDesc string `json:"suspend_desc,omitempty"`
TransferBoardDesc string `json:"transfer_board_desc,omitempty"`
Tags string `json:"tags,omitempty"`
WithdrawRisk string `json:"wr,omitempty"`
}
type SymbolStatus ¶
type SymbolStatus string
const ( SymbolStatusUnknown SymbolStatus = "unknown" SymbolStatusNotOnline SymbolStatus = "not-online" SymbolStatusPreOnline SymbolStatus = "pre-online" SymbolStatusOnline SymbolStatus = "online" SymbolStatusSuspend SymbolStatus = "suspend" SymbolStatusOffline SymbolStatus = "offline" SymbolStatusTransferBoard SymbolStatus = "transfer-board" SymbolStatusFuse SymbolStatus = "fuse" )
func (SymbolStatus) String ¶
func (o SymbolStatus) String() string
type TransferState ¶
type TransferState string
const ( TransferStateVerifying TransferState = "verifying" TransferStateFailed TransferState = "failed" TransferStateSubmitted TransferState = "submitted" TransferStateReexamine TransferState = "reexamine" TransferStateCanceled TransferState = "canceled" TransferStatePass TransferState = "pass" TransferStateReject TransferState = "reject" TransferStatePreTransfer TransferState = "pre-transfer" TransferStateWalletTransfer TransferState = "wallet-transfer" TransferStateWalletReject TransferState = "wallet-reject" TransferStateConfirmed TransferState = "confirmed" TransferStateConfirmError TransferState = "confirm-error" TransferStateRepealed TransferState = "repealed" )
func (TransferState) String ¶
func (o TransferState) String() string
type WithdrawalAddress ¶
type WithdrawalByClientID ¶
type WithdrawalByClientID WithdrawalDepositHistory
type WithdrawalDepositHistory ¶
type WithdrawalDepositHistory struct {
ID int `json:"id"`
Type string `json:"type"`
Currency string `json:"currency"`
TxHash string `json:"tx-hash"`
Chain string `json:"chain"`
Amount float64 `json:"amount"`
Address string `json:"address"`
AddressTag string `json:"address-tag"`
Fee float64 `json:"fee"`
State TransferState `json:"state"`
ErrorCode string `json:"error-code"`
ErrorMessage string `json:"error-message"`
CreatedAt int64 `json:"created-at"`
UpdatedAt int64 `json:"updated-at"`
}
Click to show internal directories.
Click to hide internal directories.