coinbase

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCEPT        = "Accept"
	CONTENT_TYPE  = "Content-Type"
	CACHE_CONTROL = "Cache-control"

	APPLICATION_JSON      = "application/json"
	APPLICATION_JSON_UTF8 = "application/json; charset=UTF-8"

	ENDPOINT = "https://api.exchange.coinbase.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Coinbase

type Coinbase struct {
	Spot *Spot
	// contains filtered or unexported fields
}

func New

func New(config *APIConfig) *Coinbase

func (*Coinbase) DoRequest

func (coinbase *Coinbase) DoRequest(
	httpMethod,
	uri,
	reqBody string,
	response interface{},
) ([]byte, error)

type Spot

type Spot struct {
	*Coinbase
}

func (*Spot) CancelOrder

func (*Spot) CancelOrder(*Order) ([]byte, error)

func (*Spot) GetAccount

func (*Spot) GetAccount() (*Account, []byte, error)

func (*Spot) GetDepth

func (*Spot) GetDepth(pair Pair, size int) (*Depth, []byte, error)

func (*Spot) GetExchangeName

func (*Spot) GetExchangeName() string

func (*Spot) GetExchangeRule

func (spot *Spot) GetExchangeRule(pair Pair) (*Rule, []byte, error)

func (*Spot) GetKlineRecords

func (spot *Spot) GetKlineRecords(pair Pair, period, size, since int) ([]*Kline, []byte, error)

func (*Spot) GetOHLCs

func (spot *Spot) GetOHLCs(symbol string, period, size, since int) ([]*OHLC, []byte, error)

func (*Spot) GetOrder

func (*Spot) GetOrder(*Order) ([]byte, error)

func (*Spot) GetOrders

func (*Spot) GetOrders(pair Pair) ([]*Order, error)

func (*Spot) GetTicker

func (spot *Spot) GetTicker(pair Pair) (*Ticker, []byte, error)

public api

func (*Spot) GetTrades

func (*Spot) GetTrades(pair Pair, since int64) ([]*Trade, error)

func (*Spot) GetUnFinishOrders

func (*Spot) GetUnFinishOrders(pair Pair) ([]*Order, []byte, error)

func (*Spot) KeepAlive

func (spot *Spot) KeepAlive()

util api

func (*Spot) PlaceOrder

func (*Spot) PlaceOrder(*Order) ([]byte, error)

private api

Jump to

Keyboard shortcuts

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