client

package
v0.0.0-...-82616d5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Endpoint = "http://localhost:3000"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
}

func NewClient

func NewClient() *Client

func (*Client) CancelOrder

func (c *Client) CancelOrder(orderID int64) error

func (*Client) GetBestAsk

func (c *Client) GetBestAsk() (*server.Order, error)

func (*Client) GetBestBid

func (c *Client) GetBestBid() (*server.Order, error)

func (*Client) GetOrders

func (c *Client) GetOrders(userID int64) (*server.GetOrdersResponse, error)

func (*Client) GetTrades

func (c *Client) GetTrades(market string) ([]*orderbook.Trade, error)

func (*Client) PlaceLimitOrder

func (c *Client) PlaceLimitOrder(p *PlaceOrderParams) (*server.PlaceOrderResponse, error)

func (*Client) PlaceMarketOrder

func (c *Client) PlaceMarketOrder(p *PlaceOrderParams) (*server.PlaceOrderResponse, error)

type PlaceOrderParams

type PlaceOrderParams struct {
	UserID int64
	Bid    bool
	// price only needed for placing limit order
	Price float64
	Size  float64
}

Jump to

Keyboard shortcuts

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