api

package
v0.0.0-...-5621b75 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BITFLYER_BASE_URL = "https://api.bitflyer.jp/v1"
)
View Source
const (
	HITBTC_BASE_URL = "https://api.hitbtc.com/api/2"
)
View Source
const (
	POLONIEX_BASE_URL = "https://poloniex.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitflyerApi

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

func (*BitflyerApi) CurrencyPairs

func (b *BitflyerApi) CurrencyPairs() ([]*CurrencyPair, error)

func (*BitflyerApi) GetExchangeId

func (b *BitflyerApi) GetExchangeId() models.ExchangeID

func (*BitflyerApi) Rate

func (b *BitflyerApi) Rate(trading string, settlement string) (float64, error)

func (*BitflyerApi) Volume

func (b *BitflyerApi) Volume(trading string, settlement string) (float64, error)

type BitflyerApiConfig

type BitflyerApiConfig struct {
	ExchangeId models.ExchangeID
	Apikey     string
	ApiSecret  string
	BaseURL    string

	RateCacheDuration time.Duration
}

type Currency

type Currency struct {
	ID             int     `json:"id"`
	Name           string  `json:"name"`
	TxFee          float64 `json:"txFee,string"`
	MinConf        int     `json:"minConf"`
	DepositAddress string  `json:"depositAddress"`
	Disabled       int     `json:"disabled"`
	Delisted       int     `json:"delisted"`
	Frozen         int     `json:"frozen"`
}

type CurrencyPair

type CurrencyPair struct {
	Trading    string
	Settlement string
}

type ExchangeApi

type ExchangeApi interface {
	GetExchangeId() models.ExchangeID

	Volume(trading string, settlement string) (float64, error)
	CurrencyPairs() ([]*CurrencyPair, error)
	Rate(trading string, settlement string) (float64, error)
	// contains filtered or unexported methods
}

func NewBitflyerApiUsingConfigFunc

func NewBitflyerApiUsingConfigFunc(f func(*BitflyerApiConfig)) (ExchangeApi, error)

func NewExchangeAPI

func NewExchangeAPI(id models.ExchangeID) (ExchangeApi, error)

func NewHitbtcApiUsingConfigFunc

func NewHitbtcApiUsingConfigFunc(f func(*HitbtcApiConfig)) (ExchangeApi, error)

func NewPoloniexApiUsingConfigFunc

func NewPoloniexApiUsingConfigFunc(f func(*PoloniexApiConfig)) (ExchangeApi, error)

type HitbtcApi

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

func (*HitbtcApi) CurrencyPairs

func (h *HitbtcApi) CurrencyPairs() ([]*CurrencyPair, error)

func (*HitbtcApi) GetExchangeId

func (h *HitbtcApi) GetExchangeId() models.ExchangeID

func (*HitbtcApi) Rate

func (h *HitbtcApi) Rate(trading string, settlement string) (float64, error)

func (*HitbtcApi) Volume

func (h *HitbtcApi) Volume(trading string, settlement string) (float64, error)

type HitbtcApiConfig

type HitbtcApiConfig struct {
	ExchangeId models.ExchangeID
	Apikey     string
	ApiSecret  string
	BaseURL    string

	RateCacheDuration time.Duration
}

type PoloniexApi

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

func (*PoloniexApi) Currencies

func (p *PoloniexApi) Currencies() (map[string]Currency, error)

func (*PoloniexApi) CurrencyPairs

func (p *PoloniexApi) CurrencyPairs() ([]*CurrencyPair, error)

func (*PoloniexApi) GetExchangeId

func (p *PoloniexApi) GetExchangeId() models.ExchangeID

func (*PoloniexApi) Rate

func (p *PoloniexApi) Rate(trading string, settlement string) (float64, error)

func (*PoloniexApi) Volume

func (p *PoloniexApi) Volume(trading string, settlement string) (float64, error)

type PoloniexApiConfig

type PoloniexApiConfig struct {
	ExchangeId models.ExchangeID
	Apikey     string
	ApiSecret  string
	BaseURL    string

	RateCacheDuration time.Duration
}

Jump to

Keyboard shortcuts

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