goincheck: github.com/takuyaohashi/goincheck Index | Files

package goincheck

import "github.com/takuyaohashi/goincheck"

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

Package Files

currency.go goincheck.go version.go

func Version Uses

func Version() string

Version returns current version.

type Balance Uses

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 Uses

type Client struct {
    BaseURL *url.URL

    HTTPClient *http.Client
    // contains filtered or unexported fields
}

Client struct represents Coincheck API client.

func NewClient Uses

func NewClient(key, secretKey string) (*Client, error)

NewClient creats Client Struct.

func (*Client) GetBalance Uses

func (cli *Client) GetBalance(ctx context.Context) (*Balance, error)

func (*Client) GetExchangeRate Uses

func (cli *Client) GetExchangeRate(ctx context.Context) (*ExchangeRate, error)

func (*Client) GetOrderBook Uses

func (cli *Client) GetOrderBook(ctx context.Context) (*OrderBook, error)

func (*Client) GetRatePair Uses

func (cli *Client) GetRatePair(ctx context.Context, pair Pair) (*RatePair, error)

func (*Client) GetTicker Uses

func (cli *Client) GetTicker(ctx context.Context) (*Ticker, error)

func (*Client) GetTrade Uses

func (cli *Client) GetTrade(ctx context.Context) (*[]Trade, error)

func (*Client) OrderToBuy Uses

func (cli *Client) OrderToBuy(ctx context.Context, rate int, amount float64) (*Order, error)

func (*Client) OrderToMarketBuy Uses

func (cli *Client) OrderToMarketBuy(ctx context.Context, yen int) (*Order, error)

func (*Client) OrderToMarketSell Uses

func (cli *Client) OrderToMarketSell(ctx context.Context, amount float64) (*Order, error)

func (*Client) OrderToSell Uses

func (cli *Client) OrderToSell(ctx context.Context, rate int, amount float64) (*Order, error)

type ExchangeRate Uses

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 Uses

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 OrderBook Uses

type OrderBook struct {
    Asks [][]string `json:"asks"`
    Bids [][]string `json:"bids"`
}

OrderBook struct represents Coincheck OrderBook API Response.

type Pair Uses

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"

    // 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"
)

type RatePair Uses

type RatePair struct {
    Rate string `json:"rate"`
}

RatePair struct reporesents Coincheck RatePair API Response.

type Ticker Uses

type Ticker struct {
    Last      float64 `json:"last"`
    Bid       float64 `json:"bid"`
    Ask       float64 `json:"ask"`
    High      float64 `json:"high"`
    Low       float64 `json:"low"`
    Volume    float64 `json:"volume"`
    Timestamp float64 `json:"timestamp"`
}

Ticker struct represents Coincheck Ticker API Response.

type Trade Uses

type Trade struct {
    ID        int     `json:"id"`
    Amount    string  `json:"amount"`
    Rate      float64 `json:"rate"`
    OrderType string  `json:"order_type"`
    CreatedAt string  `json:"created_at"`
}

Trade struct represents Coincheck Trade API Respoonse.

Package goincheck imports 14 packages (graph). Updated 2017-11-18. Refresh now. Tools for package owners.