Documentation
¶
Index ¶
- Variables
- type Balance
- type Bitflyer
- type Board
- type Collateral
- type Execution
- type Order
- type Position
- type Price
- type PrivateAPIClient
- func (p *PrivateAPIClient) CancelAllOrder() error
- func (p *PrivateAPIClient) CancelOrder(id string) error
- func (p *PrivateAPIClient) CreateOrder(product_code string, child_order_type string, side string, price, size float64, ...) (string, error)
- func (p *PrivateAPIClient) GetActiveOrders(product_code string) ([]*Order, error)
- func (p *PrivateAPIClient) GetBalance() ([]*Balance, error)
- func (p *PrivateAPIClient) GetCollateral() (*Collateral, error)
- func (p *PrivateAPIClient) GetOrder(id string, product_code string) (*Order, error)
- func (p *PrivateAPIClient) GetOrders(product_code string) ([]*Order, error)
- func (p *PrivateAPIClient) GetPositions() ([]*Position, error)
- type PublicAPIClient
- type RealtimeAPIClient
- func (r *RealtimeAPIClient) AddOnBoardCallback(ctx context.Context, callback func(mid float64, bids []*Price, asks []*Price))
- func (r *RealtimeAPIClient) AddOnExecutionCallback(ctx context.Context, callback func([]*Execution))
- func (r *RealtimeAPIClient) Close() error
- func (r *RealtimeAPIClient) GetBoard() (float64, []*Price, []*Price)
- func (r *RealtimeAPIClient) GetExecutions(duration time.Duration) []*Execution
- func (r *RealtimeAPIClient) Subscribe(ctx context.Context) error
- type Ticker
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidResponse = errors.New("invalid response")
View Source
var ErrInvalidStatusCode = errors.New("invalid status code")
Functions ¶
This section is empty.
Types ¶
type Bitflyer ¶
type Bitflyer struct{}
func NewBitflyer ¶
func NewBitflyer() *Bitflyer
func (*Bitflyer) GetPublicAPIClient ¶
func (b *Bitflyer) GetPublicAPIClient() (*PublicAPIClient, error)
func (*Bitflyer) GetRealtimeAPIClient ¶
func (b *Bitflyer) GetRealtimeAPIClient() (*RealtimeAPIClient, error)
func (*Bitflyer) PrivateAPIClient ¶
func (b *Bitflyer) PrivateAPIClient(key, secret string) (*PrivateAPIClient, error)
type Collateral ¶
type Execution ¶
type Execution struct {
ID int64 `json:"id"`
Side string `json:"side"`
Price float64 `json:"price"`
Size float64 `json:"size"`
ExecDate string `json:"exec_date"`
Timestamp time.Time `json:"timestamp"`
BuyChildOrderAcceptanceID string `json:"buy_child_order_acceptance_id"`
SellChildOrderAcceptanceID string `json:"sell_child_order_acceptance_id"`
}
type Order ¶
type Order struct {
ID int64 `json:"id"`
ChildOrderID string `json:"child_order_id"`
ProductCode string `json:"product_code"`
Side string `json:"side"`
ChildOrderType string `json:"child_order_type"`
Price float64 `json:"price"`
AveragePrice float64 `json:"average_price"`
Size float64 `json:"size"`
ChildOrderState string `json:"child_order_state"`
ExpireDate string `json:"expire_date"`
ChildOrderDate string `json:"child_order_date"`
ChildOrderAcceptanceID string `json:"child_order_acceptance_id"`
OutstandingSize float64 `json:"outstanding_size"`
CancelSize float64 `json:"cancel_size"`
ExecutedSize float64 `json:"executed_size"`
TotalCommission float64 `json:"total_commission"`
}
type PrivateAPIClient ¶
type PrivateAPIClient struct {
// contains filtered or unexported fields
}
func (*PrivateAPIClient) CancelAllOrder ¶
func (p *PrivateAPIClient) CancelAllOrder() error
func (*PrivateAPIClient) CancelOrder ¶
func (p *PrivateAPIClient) CancelOrder(id string) error
func (*PrivateAPIClient) CreateOrder ¶
func (*PrivateAPIClient) GetActiveOrders ¶ added in v1.0.17
func (p *PrivateAPIClient) GetActiveOrders(product_code string) ([]*Order, error)
func (*PrivateAPIClient) GetBalance ¶
func (p *PrivateAPIClient) GetBalance() ([]*Balance, error)
func (*PrivateAPIClient) GetCollateral ¶
func (p *PrivateAPIClient) GetCollateral() (*Collateral, error)
func (*PrivateAPIClient) GetOrder ¶
func (p *PrivateAPIClient) GetOrder(id string, product_code string) (*Order, error)
func (*PrivateAPIClient) GetOrders ¶ added in v1.0.18
func (p *PrivateAPIClient) GetOrders(product_code string) ([]*Order, error)
func (*PrivateAPIClient) GetPositions ¶
func (p *PrivateAPIClient) GetPositions() ([]*Position, error)
type PublicAPIClient ¶
type PublicAPIClient struct{}
type RealtimeAPIClient ¶
type RealtimeAPIClient struct {
// contains filtered or unexported fields
}
func (*RealtimeAPIClient) AddOnBoardCallback ¶
func (*RealtimeAPIClient) AddOnExecutionCallback ¶
func (r *RealtimeAPIClient) AddOnExecutionCallback(ctx context.Context, callback func([]*Execution))
func (*RealtimeAPIClient) Close ¶
func (r *RealtimeAPIClient) Close() error
func (*RealtimeAPIClient) GetBoard ¶
func (r *RealtimeAPIClient) GetBoard() (float64, []*Price, []*Price)
func (*RealtimeAPIClient) GetExecutions ¶
func (r *RealtimeAPIClient) GetExecutions(duration time.Duration) []*Execution
type Ticker ¶
type Ticker struct {
ProductCode string `json:"product_code"`
Timestamp time.Time `json:"timestamp"`
TickID int `json:"tick_id"`
BestBid float64 `json:"best_bid"`
BestAsk float64 `json:"best_ask"`
BestBidSize float64 `json:"best_bid_size"`
BestAskSize float64 `json:"best_ask_size"`
TotalBidDepth float64 `json:"total_bid_depth"`
TotalAskDepth float64 `json:"total_ask_depth"`
Ltp float64 `json:"ltp"`
Volume float64 `json:"volume"`
VolumeByProduct float64 `json:"volume_by_product"`
}
Click to show internal directories.
Click to hide internal directories.