Documentation ¶
Index ¶
- Constants
- Variables
- func BestAskListV2(p Param) (interface{}, error)
- func BestBidListV2(p Param) (interface{}, error)
- func BuildOrder(p Param) (interface{}, error)
- func CancelOrder(p Param) (interface{}, error)
- func CancelOrderbookV2(p Param) (interface{}, error)
- func GetAccountTrades(p Param) (interface{}, error)
- func GetAllTrades(p Param) (interface{}, error)
- func GetDepositHistory(p Param) (interface{}, error)
- func GetFees(p Param) (interface{}, error)
- func GetGenerateAddress(p Param) (interface{}, error)
- func GetLockedBalance(p Param) (interface{}, error)
- func GetMarkets(_ Param) (interface{}, error)
- func GetOrderbook(p Param) (interface{}, error)
- func GetOrderbookV2(p Param) (interface{}, error)
- func GetOrders(p Param) (interface{}, error)
- func GetSchemaVersion(p Param) (interface{}, error)
- func GetSingleOrder(p Param) (interface{}, error)
- func GetTradingView(p Param) (interface{}, error)
- func PlaceOrder(p Param) (interface{}, error)
- func ProcessOrderbookV2(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 DepositGenAddrResp
- type DepositGenAddrResq
- type DepositGetSchemaResp
- type DepositGetSchemaResq
- type DepositHistoryResp
- type DepositHistoryResq
- type FeesReq
- type FeesResp
- type LockedBalance
- type LockedBalanceReq
- type LockedBalanceResp
- type Market
- type MarketStatus
- type MarketsReq
- type MarketsResp
- type NovaApiContext
- type Orderbook
- type OrderbookCancelMsgV2Req
- type OrderbookMsgV2Req
- type OrderbookReq
- type OrderbookResp
- type OrderbookV2Req
- type Param
- type PlaceOrderReq
- type QueryOrderReq
- type QueryOrderResp
- type QuerySingleOrderReq
- type QuerySingleOrderResp
- type QueryTradeReq
- type QueryTradeResp
- type Response
- type SnapshotV2
Constants ¶
View Source
const ( PENDING = "PENDING" SUCCESS = "SUCCESS" FAILED = "FAILED" DEPOSIT = "deposit" )
View Source
const MaxBarsCount = 200
Variables ¶
View Source
var CacheService common.IKVStore
View Source
var QueueService common.IQueue
Functions ¶
func BestAskListV2 ¶
func BestBidListV2 ¶
func BuildOrder ¶
func CancelOrder ¶
func CancelOrderbookV2 ¶
func GetAccountTrades ¶
func GetAllTrades ¶
func GetDepositHistory ¶
func GetGenerateAddress ¶
func GetLockedBalance ¶
func GetMarkets ¶
func GetOrderbook ¶
func GetOrderbookV2 ¶
func GetSchemaVersion ¶
func GetSingleOrder ¶
func GetTradingView ¶
func PlaceOrder ¶
func ProcessOrderbookV2 ¶
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 DepositGenAddrResp ¶
type DepositGenAddrResq ¶
type DepositGetSchemaResp ¶
type DepositGetSchemaResp struct {
Schema uint64
}
type DepositGetSchemaResq ¶
type DepositHistoryResp ¶
type DepositHistoryResp struct {
History []string
}
type DepositHistoryResq ¶
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 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 NovaApiContext ¶
type OrderbookCancelMsgV2Req ¶
type OrderbookCancelMsgV2Req struct { BaseReq protocol.OrderbookCancelMsg }
type OrderbookMsgV2Req ¶
type OrderbookMsgV2Req struct { BaseReq protocol.OrderbookMsg }
type OrderbookReq ¶
type OrderbookResp ¶
type OrderbookV2Req ¶
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.