bitflyer

package
v0.0.0-...-58a001c Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RFC3339local = "2006-01-02T15:04:05Z"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	CurrentCode string  `json:"currency_code"`
	Amount      float64 `json:"amount"`
	Available   float64 `json:"available"`
}

type Client

type Client struct {
	Balance    *balanceClient
	Commission *commissionClient
	Order      *orderClient
	Realtime   *realtimeClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(key, secret string, httpTimeout, wsTimeout time.Duration) *Client

type Commission

type Commission struct {
	CommissionRate float64 `json:"commission_rate"`
}

type Order

type Order struct {
	ID                     int     `json:"id"`
	ChildOrderID           string  `json:"child_order_id"`
	ProductCode            string  `json:"product_code"`
	Side                   string  `json:"side"`
	ChildOrderType         string  `json:"child_order_type"`
	Price                  int     `json:"price"`
	AveragePrice           int     `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        int     `json:"outstanding_size"`
	CancelSize             int     `json:"cancel_size"`
	ExecutedSize           float64 `json:"executed_size"`
	TotalCommission        int     `json:"total_commission"`
}

type OrderRequest

type OrderRequest struct {
	ProductCode    string  `json:"product_code"`
	ChildOrderType string  `json:"child_order_type"`
	Side           string  `json:"side"`
	Price          int     `json:"price"`
	Size           float64 `json:"size"`
	MinuteToExpire int     `json:"minute_to_expire"`
	TimeInForce    string  `json:"time_in_force"`
}

type SendOrderResponse

type SendOrderResponse struct {
	ChildOrderAcceptanceID string `json:"child_order_acceptance_id"`
}

type SubscribeParams

type SubscribeParams struct {
	Channel string `json:"channel"`
}

type Ticker

type Ticker struct {
	ProductCode     string  `json:"product_code"`
	Timestamp       string  `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"`
}

func (*Ticker) DateTime

func (t *Ticker) DateTime() time.Time

func (*Ticker) MidPrice

func (t *Ticker) MidPrice() float64

Jump to

Keyboard shortcuts

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