coinbase

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrRequireConfigParameters = "not correct input parameters"
)

Variables

This section is empty.

Functions

func NewCoinbaseClient

func NewCoinbaseClient(url, protocol, origin string) (*client, error)

NewCoinbaseClient init client for Coinbase

Types

type Response

type Response struct {
	Type      ResponseType `json:"type,string"`
	Message   string       `json:"message,omitempty"`
	Reason    string       `json:"reason,omitempty"`
	ProductID string       `json:"product_id"`
	BestBid   float64      `json:"best_bid,string"`
	BestAsk   float64      `json:"best_ask,string"`
}

func ParseResponse

func ParseResponse(message []byte) (response *Response, err error)

type ResponseType

type ResponseType int
const (
	Error ResponseType = iota
	Subscriptions
	Unsubscribe
	Heartbeat
	Ticker
	Level2
)

func (ResponseType) String

func (r ResponseType) String() string

func (*ResponseType) UnmarshalJSON

func (r *ResponseType) UnmarshalJSON(v []byte) error

type Subscribe

type Subscribe struct {
	Type       string   `json:"type"`
	ProductIDs []string `json:"product_ids"`
	Channels   []string `json:"channels"`
}

Jump to

Keyboard shortcuts

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