jsonrpc

package
v0.0.0-...-30c84b1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ENDPOINT                   = "wss://ws.lightstream.bitflyer.com/json-rpc"
	READDEADLINE time.Duration = 300 * time.Second
)

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, ch chan Response, channels, symbols []string, l *log.Logger) error

func ConnectForPrivate

func ConnectForPrivate(ctx context.Context, ch chan Response, key, secret string, channels []string, l *log.Logger) error

Types

type ChildOrderEvent

type ChildOrderEvent struct {
	ProductCode            string `json:"product_code"`
	ChildOrderID           string `json:"child_order_id"`
	ChildOrderAcceptanceID string `json:"child_order_acceptance_id"`
	ChildOrderType         string `json:"child_order_type"`

	EventType  string  `json:"event_type"`
	Side       string  `json:"side"`
	Price      float64 `json:"price"`
	Size       float64 `json:"size"`
	ExpireDate string  `json:"expire_date"`

	// 新設分追記
	Reason     string  `json:"reason"`
	Commission float64 `json:"commission"`
	SFD        float64 `json:"sfd"`

	EventDate types.ExchangeTime `json:"event_date"`
	ExecID    int                `json:"exec_id"`
}

type Client

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

func New

func New(l *log.Logger) *Client

func (*Client) Close

func (p *Client) Close() error

type ParentEvent

type ParentEvent struct {
	ProductCode             string `json:"product_code"`
	ParentOrderID           string `json:"parent_order_id"`
	ParentOrderAcceptanceID string `json:"parent_order_acceptance_id"`
	ChildOrderAcceptanceID  string `json:"child_order_acceptance_id"`

	EventType       string `json:"event_type"`
	ParentOrderType string `json:"parent_order_type"`
	ChildOrderType  string `json:"child_order_type"`

	Reason string `json:"reason"`
	Side   string `json:"side"`

	Price float64 `json:"price"`
	Size  float64 `json:"size"`

	EventDate  types.ExchangeTime `json:"event_date"`
	ExpireDate types.ExchangeTime `json:"expire_date"`

	ParameterIndex int `json:"parameter_index"`
}

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 types.ProductCode

	Board      board.Response
	Ticker     ticker.Response
	Executions []execution.Execution

	ChildOrderEvents  []ChildOrderEvent
	ParentOrderEvents []ParentEvent

	Results error
}

type Types

type Types int
const (
	All Types = iota
	Ticker
	Executions
	Board
	ChildOrders
	ParentOrders
	Undefined
	Error
)

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