realtime

package
v0.0.0-...-df7f5f2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONRPCV    = "2.0"
	AUTH        = "auth"
	SUBSCRIBE   = "subscribe"
	UNSUBSCRIBE = "unsubscribe"

	CHANNEL = "channel"
)
View Source
const (
	ALL          = "ALL"
	Ticker       = "lightning_ticker_"
	Executions   = "lightning_executions_"
	Board        = "lightning_board_"
	BoardSnap    = "lightning_board_snapshot_"
	ChildOrders  = "child_order_events"
	ParentOrders = "parent_order_events"
	Error        = "error"
	Undefined    = "undefined"
)
View Source
const (
	ENDPOINT                   = "wss://ws.lightstream.bitflyer.com/json-rpc"
	READDEADLINE time.Duration = 300 * time.Second
	PINGTIMER    time.Duration = 3 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildOrder

type ChildOrder struct {
	ProductCode            string  `json:"product_code"`
	ChildOrderID           string  `json:"child_order_id"`
	ChildOrderAcceptanceID string  `json:"child_order_acceptance_id"`
	EventDate              string  `json:"event_date"`
	EventType              string  `json:"event_type"`
	ExecID                 int     `json:"exec_id,omitempty"`
	ChildOrderType         string  `json:"child_order_type,omitempty"`
	Side                   string  `json:"side,omitempty"`
	Price                  int     `json:"price"`
	Size                   float64 `json:"size"`
	ExpireDate             string  `json:"expire_date,omitempty"`
}

type Client

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

func New

func New(ctx context.Context) *Client

func (*Client) Close

func (p *Client) Close() error

func (*Client) Connect

func (p *Client) Connect(conf *auth.Client, channels, symbols []string, send chan Response)

func (*Client) Copy

func (p *Client) Copy() *websocket.Conn

If you want to utilize raw data

func (*Client) Subscribe

func (p *Client) Subscribe(conf *auth.Client, symbols, channels []string) []*Request

func (*Client) Unsubscribe

func (p *Client) Unsubscribe(requests []*Request) error

type ParentOrder

type ParentOrder struct {
	ProductCode             string  `json:"product_code"`
	ParentOrderID           string  `json:"parent_order_id"`
	ParentOrderAcceptanceID string  `json:"parent_order_acceptance_id"`
	EventDate               string  `json:"event_date"`
	EventType               string  `json:"event_type"`
	ParameterIndex          int     `json:"parameter_index"`
	ChildOrderType          string  `json:"child_order_type,omitempty"`
	Side                    string  `json:"side,omitempty"`
	Price                   int     `json:"price"`
	Size                    float64 `json:"size,omitempty"`
	ExpireDate              string  `json:"expire_date,omitempty"`
	ChildOrderAcceptanceID  string  `json:"child_order_acceptance_id"`
}

type Request

type Request struct {
	Jsonrpc string                 `json:"jsonrpc,omitempty"`
	Method  string                 `json:"method"`
	Params  map[string]interface{} `json:"params"`
	ID      int                    `json:"id,omitempty"`
}

type Response

type Response struct {
	Types       Types
	ProductCode string

	Board      public.ResponseForBoard
	Ticker     public.ResponseForTicker
	Executions []public.Execution

	ChildOrders  []ChildOrder
	ParentOrders []ParentOrder

	Results error
}

type Types

type Types int
const (
	AllN Types = iota
	TickerN
	ExecutionsN
	BoardN
	BoardSnapN
	ChildOrdersN
	ParentOrdersN
	UndefinedN
	ErrorN
)

func (Types) String

func (p Types) String() string

Jump to

Keyboard shortcuts

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