hitbtc

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXCHANGE_NAME = "hitbtc.com"

	API_BASE_URL = "https://api.hitbtc.com/"
	API_V2       = "api/2/"
	SYMBOLS_URI  = "public/symbol"
	TICKER_URI   = "public/ticker/"
	BALANCE_URI  = "account/balance"
	ORDER_URI    = "order"
	DEPTH_URI    = "public/orderbook"
	TRADES_URI   = "public/trades"
	KLINE_URI    = "public/candles"
)

Variables

View Source
var (
	YCC     = goex.Currency{"YCC", "Yuan Chain New"}
	BTC     = goex.Currency{"BTC", "Bitcoin"}
	YCC_BTC = goex.CurrencyPair{CurrencyA: YCC, CurrencyB: BTC}
)

Functions

This section is empty.

Types

type Exchange added in v1.3.9

type Exchange struct {
	// contains filtered or unexported fields
}

func New

func New(client *http.Client, accessKey, secretKey string) *Exchange

func (*Exchange) CancelOrder added in v1.3.9

func (exchange *Exchange) CancelOrder(orderId string, currency goex.CurrencyPair) (bool, error)

func (*Exchange) GetAccount added in v1.3.9

func (exchange *Exchange) GetAccount() (*goex.Account, error)

https://api.hitbtc.com/#account-balance

func (*Exchange) GetAssets added in v1.3.9

func (exchange *Exchange) GetAssets(currency goex.CurrencyPair) (*goex.Assets, error)

func (*Exchange) GetDepth added in v1.3.9

func (exchange *Exchange) GetDepth(size int, currency goex.CurrencyPair) (*goex.Depth, error)

https://api.hitbtc.com/#orderbook

{
  "ask": [
    {
      "price": "0.046002",
      "size": "0.088"
    },
    {
      "price": "0.046800",
      "size": "0.200"
    }
  ],
  "bid": [
    {
      "price": "0.046001",
      "size": "0.005"
    },
    {
      "price": "0.046000",
      "size": "0.200"
    }
  ]
}

func (*Exchange) GetExchangeName added in v1.3.9

func (exchange *Exchange) GetExchangeName() string

func (*Exchange) GetKline added in v1.3.9

func (exchange *Exchange) GetKline(currencyPair goex.CurrencyPair, period string, size, since int64) ([]goex.Kline, error)

curl "https://api.hitbtc.com/api/2/public/candles/ETHBTC?period=M30" [

{
  "timestamp": "2017-10-20T20:00:00.000Z",
  "open": "0.050459",
  "close": "0.050087",
  "min": "0.050000",
  "max": "0.050511",
  "volume": "1326.628",
  "volumeQuote": "66.555987736"
},
{
  "timestamp": "2017-10-20T20:30:00.000Z",
  "open": "0.050108",
  "close": "0.050139",
  "min": "0.050068",
  "max": "0.050223",
  "volume": "87.515",
  "volumeQuote": "4.386062831"
}

]

func (*Exchange) GetKlineRecords added in v1.3.9

func (exchange *Exchange) GetKlineRecords(currency goex.CurrencyPair, period goex.KlinePeriod, size int, opt ...goex.OptionalParameter) ([]goex.Kline, error)

func (*Exchange) GetOneOrder added in v1.3.9

func (exchange *Exchange) GetOneOrder(orderId string, currency goex.CurrencyPair) (*goex.Order, error)

func (*Exchange) GetOrderHistorys added in v1.3.9

func (exchange *Exchange) GetOrderHistorys(currency goex.CurrencyPair, optional ...goex.OptionalParameter) ([]goex.Order, error)

TODO https://api.hitbtc.com/#orders-history

func (*Exchange) GetSymbols added in v1.3.9

func (exchange *Exchange) GetSymbols() ([]goex.CurrencyPair, error)

https://api.hitbtc.com/#symbols

curl "https://api.hitbtc.com/api/2/public/symbol" [

{
  "id": "ETHBTC",
  "baseCurrency": "ETH",
  "quoteCurrency": "BTC",
  "quantityIncrement": "0.001",
  "tickSize": "0.000001",
  "takeLiquidityRate": "0.001",
  "provideLiquidityRate": "-0.0001",
  "feeCurrency": "BTC"
}

]

func (*Exchange) GetTicker added in v1.3.9

func (exchange *Exchange) GetTicker(currency goex.CurrencyPair) (*goex.Ticker, error)

curl "https://api.hitbtc.com/api/2/public/ticker"

[

{
  "ask": "0.050043",
  "bid": "0.050042",
  "last": "0.050042",
  "open": "0.047800",
  "low": "0.047052",
  "high": "0.051679",
  "volume": "36456.720",
  "volumeQuote": "1782.625000",
  "timestamp": "2017-05-12T14:57:19.999Z",
  "symbol": "ETHBTC"
}

]

func (*Exchange) GetTradeHistory added in v1.3.9

func (exchange *Exchange) GetTradeHistory(currency goex.CurrencyPair, optional ...goex.OptionalParameter) ([]goex.Trade, error)

func (*Exchange) GetTrades added in v1.3.9

func (exchange *Exchange) GetTrades(currencyPair goex.CurrencyPair, since int64) ([]goex.Trade, error)

curl "https://api.hitbtc.com/api/2/public/trades/ETHBTC?from=2018-05-22T07:22:00&limit=2" [

{
   "id" : 297604734,
   "timestamp" : "2018-05-22T07:23:06.556Z",
   "quantity" : "6.551",
   "side" : "sell",
   "price" : "0.083421"
},
{
   "side" : "sell",
   "price" : "0.083401",
   "quantity" : "0.021",
   "timestamp" : "2018-05-22T07:23:05.908Z",
   "id" : 297604724
},

]

func (*Exchange) GetUnfinishOrders added in v1.3.9

func (exchange *Exchange) GetUnfinishOrders(currency goex.CurrencyPair) ([]goex.Order, error)

func (*Exchange) LimitBuy added in v1.3.9

func (exchange *Exchange) LimitBuy(amount, price string, currency goex.CurrencyPair, opt ...goex.LimitOrderOptionalParameter) (*goex.Order, error)

func (*Exchange) LimitSell added in v1.3.9

func (exchange *Exchange) LimitSell(amount, price string, currency goex.CurrencyPair, opt ...goex.LimitOrderOptionalParameter) (*goex.Order, error)

func (*Exchange) MarketBuy added in v1.3.9

func (exchange *Exchange) MarketBuy(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

func (*Exchange) MarketSell added in v1.3.9

func (exchange *Exchange) MarketSell(amount, price string, currency goex.CurrencyPair) (*goex.Order, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL