v1

package
v0.0.0-...-44eb7c0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MARKET is 成行き
	MARKET = "MARKET"
	// LIMIT is 指値
	LIMIT = "LIMIT"
	// BUY is 買い注文
	BUY = "BUY"
	// SELL is 売り注文
	SELL = "SELL"

	// Type TimeInForce
	IOC = "IOC"
	FOK = "FOK"

	APIREMAIN         = 500
	APIREMAINFORORDER = 300
	TIMELAYOUT        = "20060102.150405.999999999"
)
View Source
const (
	APIHost    string = "https://api.bitflyer.jp"
	APIHostCom string = "https://api.bitflyer.com"
)

Variables

This section is empty.

Functions

func ToPrice

func ToPrice(price float64) float64

func ToSide

func ToSide(side int) string

func ToSize

func ToSize(size float64) float64

func ToTimeByOrderID

func ToTimeByOrderID(s string) (time.Time, error)

func ToType

func ToType(isMarket bool) string

Types

type API

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

func NewAPI

func NewAPI(c *Client, apiPath string) *API

func (*API) ToURL

func (api *API) ToURL() (*url.URL, error)

type APIHeaders

type APIHeaders struct {
	Public  Limit
	Private Limit
}

基本的には5分毎リセット

func (*APIHeaders) IsCache

func (p *APIHeaders) IsCache(h http.Header) bool

type Client

type Client struct {
	Host string

	HTTPClient *httpclient.Client

	AuthConfig *auth.AuthConfig
}

func NewClient

func NewClient(opts *ClientOpts) *Client

func (*Client) APIHost

func (c *Client) APIHost() string

func (*Client) Addresses

func (c *Client) Addresses(req *addresses.Request) (*addresses.Response, *http.Response, error)

func (*Client) Balance

func (c *Client) Balance(req *balance.Request) (*balance.Response, *http.Response, error)

func (*Client) BankAccounts

func (c *Client) BankAccounts(req *bankaccounts.Request) (*bankaccounts.Response, *http.Response, error)

func (*Client) Board

func (c *Client) Board(req *board.Request) (*board.Response, *http.Response, error)

func (*Client) CancelByID

func (c *Client) CancelByID(req *cpositions.Request) (*cpositions.Response, *http.Response, error)

func (*Client) CancelOrderAll

func (c *Client) CancelOrderAll(req *corders.Request) (*corders.Response, *http.Response, error)

func (*Client) Chats

func (c *Client) Chats(req *chats.Request) (*chats.Response, *http.Response, error)

func (*Client) ChildOrdersMe

func (c *Client) ChildOrdersMe(req *childorders.Request) (*childorders.Response, *http.Response, error)

func (*Client) Coinins

func (c *Client) Coinins(req *coinins.Request) (*coinins.Response, *http.Response, error)

func (*Client) Coinouts

func (c *Client) Coinouts(req *coinouts.Request) (*coinouts.Response, *http.Response, error)

func (*Client) Collateral

func (c *Client) Collateral(req *collateral.Request) (*collateral.Response, *http.Response, error)

func (*Client) CollateralAccounts

func (c *Client) CollateralAccounts(req *amounts.Request) (*amounts.Response, *http.Response, error)

func (*Client) Executions

func (c *Client) Executions(req *executions.Request) (*executions.Response, *http.Response, error)

func (*Client) ExecutionsMe

func (c *Client) ExecutionsMe(req *ex.Request) (*ex.Response, *http.Response, error)

func (*Client) Health

func (c *Client) Health(req *health.Request) (*health.Response, *http.Response, error)

func (*Client) Histories

func (c *Client) Histories(req *histories.Request) (*histories.Response, *http.Response, error)

func (*Client) Markets

func (c *Client) Markets(req *markets.Request) (*markets.Response, *http.Response, error)
# Public APIs

Markets

func (*Client) OrderSP

func (c *Client) OrderSP(req *sp.Request) (*sp.Response, *http.Response, error)

func (*Client) OrderSingle

func (c *Client) OrderSingle(req *single.Request) (*single.Response, *http.Response, error)

func (*Client) Permissions

func (c *Client) Permissions(req *permissions.Request) (*permissions.Response, *http.Response, error)
# Private APIs

Permissions

func (*Client) Positions

func (c *Client) Positions(req *positions.Request) (*positions.Response, *http.Response, error)

func (*Client) Ticker

func (c *Client) Ticker(req *ticker.Request) (*ticker.Response, *http.Response, error)

type ClientOpts

type ClientOpts struct {
	AuthConfig *auth.AuthConfig
}

type Limit

type Limit struct {
	Period         int       // Period is リセットまでの秒数
	PeriodForOrder int       // Period is リセットまでの秒数
	Remain         int       // Remain is 残Requests
	RemainForOrder int       // Remain is 残Requests
	Reset          time.Time // Reset Remainの詳細時間(sec未満なし)
	ResetForOrder  time.Time // Reset Remainの詳細時間(sec未満なし)
}

Limit is API Limit, ForOrder is Order(child/parent), CancelAll

func NewLimit

func NewLimit() *Limit

func (*Limit) Check

func (p *Limit) Check() error

func (*Limit) CheckForOrder

func (p *Limit) CheckForOrder() error

CheckForOrder is check API limit for Order method

func (*Limit) FromHeader

func (p *Limit) FromHeader(h http.Header)

FromHeader X-xxxからLimitを取得

Jump to

Keyboard shortcuts

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