gdax

package
v0.0.0-...-54de7ac Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GDAX

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

GDAX struct

func NewGDAX

func NewGDAX() (*GDAX, error)

NewGDAX Exchange

func (GDAX) Name

func (e GDAX) Name() string

Name of provider

func (*GDAX) Ticker

func (e *GDAX) Ticker() exchanges.TickerProvider

Ticker channel

type Ticker

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

Ticker struct

func (*Ticker) Channel

func (t *Ticker) Channel() <-chan *exchanges.TickerEvent

Channel TickerEvent

func (*Ticker) Subscribe

func (t *Ticker) Subscribe(products ...exchanges.Product) error

Subscribe to product

func (*Ticker) Unsubscribe

func (t *Ticker) Unsubscribe(products ...exchanges.Product) error

Unsubscribe to product

type Time

type Time time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON marshal time back to time.Time for json encoding

func (*Time) Time

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

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

type WebSocketChannel

type WebSocketChannel struct {
	Name     WebSocketChannelType `json:"name"`
	Products []*WebSocketProduct  `json:"product_ids,omitempty"`
}

WebSocketChannel struct

type WebSocketChannelType

type WebSocketChannelType string
const (
	WebSocketChannelTypeLevel3    WebSocketChannelType = "level2"
	WebSocketChannelTypeTicker    WebSocketChannelType = "ticker"
	WebSocketChannelTypeHeartbeat WebSocketChannelType = "heartbeat"
	WebSocketChannelTypeFull      WebSocketChannelType = "full"
	WebSocketChannelTypeUser      WebSocketChannelType = "user"
	WebSocketChannelTypeMatches   WebSocketChannelType = "matches"
)

type WebSocketClient

type WebSocketClient struct {
	Ticker chan *WebSocketTickerResponse
	// contains filtered or unexported fields
}

WebSocketClient struct

func NewWebSocketClient

func NewWebSocketClient() *WebSocketClient

NewWebSocketClient constructor

func (*WebSocketClient) Connect

func (c *WebSocketClient) Connect() error

Connect to websocket server

func (*WebSocketClient) Subscribe

func (c *WebSocketClient) Subscribe(channels ...*WebSocketChannel) error

Subscribe to channel

func (*WebSocketClient) Unsubscribe

func (c *WebSocketClient) Unsubscribe(channels ...*WebSocketChannel) error

Unsubscribe to channel

type WebSocketEvent

type WebSocketEvent struct {
	Type WebSocketEventType `json:"type"`
}

WebSocketEvent struct

type WebSocketEventType

type WebSocketEventType string
const (
	WebSocketEventTypeSubscribe           WebSocketEventType = "subscribe"
	WebSocketEventTypeSubscriptions       WebSocketEventType = "subscriptions"
	WebSocketEventTypeError               WebSocketEventType = "error"
	WebSocketEventTypeUnsubscribe         WebSocketEventType = "unsubscribe"
	WebSocketEventTypeOpen                WebSocketEventType = "open"
	WebSocketEventTypeReceived            WebSocketEventType = "received"
	WebSocketEventTypeDone                WebSocketEventType = "done"
	WebSocketEventTypeMatch               WebSocketEventType = "match"
	WebSocketEventTypeChange              WebSocketEventType = "change"
	WebSocketEventTypeActivate            WebSocketEventType = "activate"
	WebSocketEventTypeHeartbeat           WebSocketEventType = "heartbeat"
	WebSocketEventTypeTicker              WebSocketEventType = "ticker"
	WebSocketEventTypeSnapshot            WebSocketEventType = "snapshot"
	WebSocketEventTypeLevel2Update        WebSocketEventType = "l2update"
	WebSocketEventTypeMarginProfileUpdate WebSocketEventType = "margin_profile_update"
)

type WebSocketProduct

type WebSocketProduct struct {
	From string
	To   string
}

WebSocketProduct struct

func NewWebSocketProduct

func NewWebSocketProduct(from string, to string) *WebSocketProduct

NewWebSocketProduct create product object

func (WebSocketProduct) MarshalJSON

func (p WebSocketProduct) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It will encode null if this time is null.

func (WebSocketProduct) String

func (p WebSocketProduct) String() string

func (*WebSocketProduct) UnmarshalJSON

func (p *WebSocketProduct) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler. It support string and null input.

type WebSocketSubscribeRequest

type WebSocketSubscribeRequest struct {
	*WebSocketEvent
	Channels []*WebSocketChannel `json:"channels"`
}

WebSocketSubscribeRequest struct

type WebSocketTickerResponse

type WebSocketTickerResponse struct {
	*WebSocketEvent
	TradeID  int               `json:"trade_id"`
	Sequence int               `json:"sequence"`
	Product  *WebSocketProduct `json:"product_id"`
	Price    string            `json:"price"`
	Side     string            `json:"side"`
	LastSize string            `json:"last_size"`
	BestBid  string            `json:"best_bid"`
	BestAsk  string            `json:"best_ask"`
	Time     Time              `json:"time"`
}

WebSocketTickerResponse struct

Jump to

Keyboard shortcuts

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