Documentation ¶
Overview ¶
Package goincheck is client for Coincheck Exchange API
Package goincheck is client for Coincheck Exchange API ¶
Package goincheck is client for Coincheck Exchange API
Index ¶
- func Version() string
- type Balance
- type Client
- func (cli *Client) GetBalance(ctx context.Context) (*Balance, error)
- func (cli *Client) GetExchangeRate(ctx context.Context) (*ExchangeRate, error)
- func (cli *Client) GetOrderBook(ctx context.Context) (*OrderBook, error)
- func (cli *Client) GetRatePair(ctx context.Context, pair Pair) (*RatePair, error)
- func (cli *Client) GetTicker(ctx context.Context) (*Ticker, error)
- func (cli *Client) GetTrade(ctx context.Context) (*[]Trade, error)
- func (cli *Client) OrderToBuy(ctx context.Context, rate int, amount float64) (*Order, error)
- func (cli *Client) OrderToMarketBuy(ctx context.Context, yen int) (*Order, error)
- func (cli *Client) OrderToMarketSell(ctx context.Context, amount float64) (*Order, error)
- func (cli *Client) OrderToSell(ctx context.Context, rate int, amount float64) (*Order, error)
- type ExchangeRate
- type Order
- type OrderBook
- type Pair
- type RatePair
- type Ticker
- type Trade
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Balance ¶
type Balance struct { Success bool `json:"success"` Jpy string `json:"jpy"` Btc string `json:"btc"` JpyReserved string `json:"jpy_reserved"` BtcReserved string `json:"btc_reserved"` JpyLendInUse string `json:"jpy_lend_in_use"` BtcLendInUse string `json:"btc_lend_in_use"` JpyLend string `json:"jpy_lent"` BtcLend string `json:"btc_lent"` JpyDebt string `json:"jpy_debt"` BtcDebt string `json:"btc_debt"` }
Balance struct represents Coincheck Balance API Response.
type Client ¶
type Client struct { BaseURL *url.URL HTTPClient *http.Client // contains filtered or unexported fields }
Client struct represents Coincheck API client.
func (*Client) GetExchangeRate ¶
func (cli *Client) GetExchangeRate(ctx context.Context) (*ExchangeRate, error)
func (*Client) GetOrderBook ¶
func (*Client) GetRatePair ¶
func (*Client) OrderToBuy ¶
func (*Client) OrderToMarketBuy ¶
func (*Client) OrderToMarketSell ¶
type ExchangeRate ¶
type ExchangeRate struct { Success bool `json:"success"` Rate int `json:"rate"` Price int `json:"price"` Amount int `json:"amount"` }
ExchangeRate struct represents Coincheck ExchangeRate API Response.
type Order ¶
type Order struct { Success bool `json:"success"` ID int `json:"id"` Pair string `json:"pair"` OrderType string `json:"order_type"` Amount float64 `json:"amount"` Rate int `json:"rate"` StopLossRate int `json:"stop_less_rate"` CreatedAt string `json:"created_at"` Error string `json:"error"` }
Order struct represents Coincheck Order API Response.
type Pair ¶
type Pair string
Pair shows exchange pairs.
const ( // BtcJpy is pair of BTC(Bitcoin) and Japanese yen. BtcJpy Pair = "btc_jpy" // EthJpy is pair of ETH(Ethereum) and Japanese yen. EthJpy Pair = "eth_jpy" // EtcJpy is pair of ETC(Ethereum Classic) and Japanese yen. EtcJpy Pair = "etc_jpy" // DaoJpy is pair of DAO and Japanese yen. DaoJpy Pair = "dao_jpy" // LskJpy is pair of Lsk(Lisk) and Japanese yen. LskJpy Pair = "lsk_jpy" // FctJpy is pair of FCT(Factom) and Japanese yen. FctJpy Pair = "fct_jpy" // XmrJpy is pair of XMR(Manero) and Japanese yen. XmrJpy Pair = "xmr_jpy" // RepJpy is pair of REP(Augur) and Japanese yen. RepJpy Pair = "rep_jpy" // XrpJpy is pair of XRP(Ripple) and Japanese yen. XrpJpy Pair = "xrp_jpy" // ZecJpy is pair of ZEC(Zcash) and Japanese yen. ZecJpy Pair = "zec_jpy" // BchJpy is pair of BCH(Bitcoin Cash) and Japanese yen. BchJpy Pair = "bch_jpy" // EthBtc is pair of ETH(Ethereum) and BTC(Bitcoin). EthBtc Pair = "eth_btc" // EtcBtc is pair of ETC(Ethereum Classic) and BTC(Bitcoin). EtcBtc Pair = "etc_btc" // LskBtc is pair of LSK(Lisk) and BTC(Bitcoin). LskBtc Pair = "lsk_btc" // FctBtc is pair of FCT(Factom) and BTC(Bitcoin). FctBtc Pair = "fct_btc" // XmrBtc is pair of XMR(Monero) and BTC(Bitcoin). XmrBtc Pair = "xmr_btc" // RerBtc is pair of REP(Augur) and BTC(Bitcoin). RerBtc Pair = "rep_btc" // XrpBtc is pair of XRP(Ripple) and BTC(Bitcoin). XrpBtc Pair = "xrp_btc" // ZecBtc is pair of ZEC(Zcash) and BTC(Bitcoin). ZecBtc Pair = "zec_btc" // BchBtc is pair of BCH(Bitcoin Cash) and BTC(Bitcoin). BchBtc Pair = "bch_btc" )
type RatePair ¶
type RatePair struct {
Rate string `json:"rate"`
}
RatePair struct reporesents Coincheck RatePair API Response.
Click to show internal directories.
Click to hide internal directories.