Documentation ¶
Index ¶
- Constants
- Variables
- func BuildOrder(p Param) (interface{}, error)
- func CancelOrder(p Param) (interface{}, error)
- func GetAccountTrades(p Param) (interface{}, error)
- func GetAllTrades(p Param) (interface{}, error)
- func GetFees(p Param) (interface{}, error)
- func GetLockedBalance(p Param) (interface{}, error)
- func GetMarkets(_ Param) (interface{}, error)
- func GetOrderBook(p Param) (interface{}, error)
- func GetOrders(p Param) (interface{}, error)
- func GetSingleOrder(p Param) (interface{}, error)
- func GetTradingView(p Param) (interface{}, error)
- func PlaceOrder(p Param) (interface{}, error)
- func StartServer(ctx context.Context, startMetric func())
- type ApiError
- type Bar
- type BaseReq
- type BaseResp
- type BuildOrderReq
- type BuildOrderResp
- type CacheOrder
- type CancelOrderReq
- type CandlesReq
- type CandlesResp
- type FeesReq
- type FeesResp
- type HydroApiContext
- type LockedBalance
- type LockedBalanceReq
- type LockedBalanceResp
- type Market
- type MarketStatus
- type MarketsReq
- type MarketsResp
- type OrderBook
- type OrderBookReq
- type OrderBookResp
- type Param
- type PlaceOrderReq
- type QueryOrderReq
- type QueryOrderResp
- type QuerySingleOrderReq
- type QuerySingleOrderResp
- type QueryTradeReq
- type QueryTradeResp
- type Response
- type SnapshotV2
Constants ¶
View Source
const MaxBarsCount = 200
Variables ¶
View Source
var CacheService common.IKVStore
View Source
var QueueService common.IQueue
Functions ¶
func BuildOrder ¶
func CancelOrder ¶
func GetAccountTrades ¶
func GetAllTrades ¶
func GetLockedBalance ¶
func GetMarkets ¶
func GetOrderBook ¶
func GetSingleOrder ¶
func GetTradingView ¶
func PlaceOrder ¶
func StartServer ¶
Types ¶
type ApiError ¶
func InvalidPriceAmountError ¶
func InvalidPriceAmountError() *ApiError
func MarketNotFoundError ¶
func NewApiError ¶
func ValidationError ¶
type Bar ¶
type BaseReq ¶
type BaseReq struct {
Address string `json:"address"`
}
func (*BaseReq) GetAddress ¶
func (*BaseReq) SetAddress ¶
type BuildOrderReq ¶
type BuildOrderReq struct { BaseReq MarketID string `json:"marketID" validate:"required"` Side string `json:"side" validate:"required,oneof=buy sell"` OrderType string `json:"orderType" validate:"required,oneof=limit market"` Price string `json:"price" validate:"required"` Amount string `json:"amount" validate:"required"` Expires int64 `json:"expires"` }
type BuildOrderResp ¶
type BuildOrderResp struct { ID string `json:"id"` MarketID string `json:"marketID"` Side string `json:"side"` Type string `json:"type"` Price decimal.Decimal `json:"price"` Amount decimal.Decimal `json:"amount"` Json *models.OrderJSON `json:"json"` AsMakerFeeRate decimal.Decimal `json:"asMakerFeeRate"` AsTakerFeeRate decimal.Decimal `json:"asTakerFeeRate"` MakerRebateRate decimal.Decimal `json:"makerRebateRate"` GasFeeAmount decimal.Decimal `json:"gasFeeAmount"` }
func BuildAndCacheOrder ¶
func BuildAndCacheOrder(address string, order *BuildOrderReq) (*BuildOrderResp, error)
type CacheOrder ¶
type CacheOrder struct { OrderResponse BuildOrderResp `json:"orderResponse"` Address string `json:"address"` BalanceOfTokenToOffer decimal.Decimal `json:"balanceOfTokenToOffer"` }
type CancelOrderReq ¶
type CandlesReq ¶
type CandlesResp ¶
type CandlesResp struct { BaseResp Data interface{} }
type FeesResp ¶
type FeesResp struct { GasFeeAmount decimal.Decimal `json:"gasFeeAmount"` AsMakerTotalFeeAmount decimal.Decimal `json:"asMakerTotalFeeAmount"` AsMakerTradeFeeAmount decimal.Decimal `json:"asMakerTradeFeeAmount"` AsMakerFeeRate decimal.Decimal `json:"asMakerFeeRate"` AsTakerTotalFeeAmount decimal.Decimal `json:"asTakerTotalFeeAmount"` AsTakerTradeFeeAmount decimal.Decimal `json:"asTakerTradeFeeAmount"` AsTakerFeeRate decimal.Decimal `json:"asTakerFeeRate"` }
type HydroApiContext ¶
type LockedBalance ¶
type LockedBalanceReq ¶
type LockedBalanceReq struct {
BaseReq
}
type LockedBalanceResp ¶
type LockedBalanceResp struct {
LockedBalances []LockedBalance `json:"lockedBalances"`
}
type Market ¶
type Market struct { ID string `json:"id"` BaseToken string `json:"baseToken"` BaseTokenProjectUrl string `json:"baseTokenProjectUrl"` BaseTokenName string `json:"baseTokenName"` BaseTokenDecimals int `json:"baseTokenDecimals"` BaseTokenAddress string `json:"baseTokenAddress"` QuoteToken string `json:"quoteToken"` QuoteTokenDecimals int `json:"quoteTokenDecimals"` QuoteTokenAddress string `json:"quoteTokenAddress"` MinOrderSize decimal.Decimal `json:"minOrderSize"` PricePrecision int `json:"pricePrecision"` PriceDecimals int `json:"priceDecimals"` AmountDecimals int `json:"amountDecimals"` AsMakerFeeRate decimal.Decimal `json:"asMakerFeeRate"` AsTakerFeeRate decimal.Decimal `json:"asTakerFeeRate"` GasFeeAmount decimal.Decimal `json:"gasFeeAmount"` SupportedOrderTypes []string `json:"supportedOrderTypes"` MarketOrderMaxSlippage decimal.Decimal `json:"marketOrderMaxSlippage"` MarketStatus }
type MarketStatus ¶
type MarketStatus struct { LastPriceIncrease decimal.Decimal `json:"lastPriceIncrease"` LastPrice decimal.Decimal `json:"lastPrice"` Price24h decimal.Decimal `json:"price24h"` Amount24h decimal.Decimal `json:"amount24h"` QuoteTokenVolume24h decimal.Decimal `json:"quoteTokenVolume24h"` }
func GetMarketStatus ¶
func GetMarketStatus(marketID string) *MarketStatus
type MarketsReq ¶
type MarketsReq struct {
BaseReq
}
type MarketsResp ¶
type OrderBookReq ¶
type OrderBookResp ¶
type PlaceOrderReq ¶
type QueryOrderReq ¶
type QueryOrderResp ¶
type QuerySingleOrderReq ¶
type QuerySingleOrderResp ¶
type QueryTradeReq ¶
type QueryTradeResp ¶
type SnapshotV2 ¶
Click to show internal directories.
Click to hide internal directories.