private

package
v0.0.0-...-b48fe10 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Endpoint = "https://poloniex.com/tradingApi"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Balances

type Balances map[string]float64

type BalancesRequest

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

func NewBalancesRequest

func NewBalancesRequest(client *Client) *BalancesRequest

func (*BalancesRequest) Do

type CancelAllOrders

type CancelAllOrders struct {
	Message      string  `json:"message"`
	OrderNumbers []int64 `json:"orderNumbers"`
}

type CancelAllOrdersRequest

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

func NewCancelAllOrdersRequest

func NewCancelAllOrdersRequest(client *Client, currencyPair string) *CancelAllOrdersRequest

func (*CancelAllOrdersRequest) Do

type CancelOrder

type CancelOrder struct {
	Amount        float64 `json:"amount,string"`
	ClientOrderID int64   `json:"clientOrderId,string"`
	Message       string  `json:"message"`
}

type CancelOrderRequest

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

func NewCancelOrderRequest

func NewCancelOrderRequest(client *Client) *CancelOrderRequest

func (*CancelOrderRequest) ClientOrderID

func (r *CancelOrderRequest) ClientOrderID(clientOrderID int64) *CancelOrderRequest

func (*CancelOrderRequest) Do

func (*CancelOrderRequest) OrderNumber

func (r *CancelOrderRequest) OrderNumber(orderNumber int64) *CancelOrderRequest

type Client

type Client struct {
	HttpClient *http.Client
	Endpoint   string
	// contains filtered or unexported fields
}

func New

func New(key, secret string) *Client

type CompleteBalance

type CompleteBalance struct {
	Available float64 `json:"available,string"`
	OnOrders  float64 `json:"onOrders,string"`
	BtcValue  float64 `json:"btcValue,string"`
}

type CompleteBalances

type CompleteBalances map[string]CompleteBalance

type CompleteBalancesRequest

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

func NewCompleteBalancesRequest

func NewCompleteBalancesRequest(client *Client) *CompleteBalancesRequest

func (*CompleteBalancesRequest) Account

func (*CompleteBalancesRequest) Do

type MoveOrder

type MoveOrder struct {
	Amount        float64 `json:"amount,string"`
	ClientOrderID int64   `json:"clientOrderId,string"`
	Message       string  `json:"message"`
}

type MoveOrderRequest

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

func NewMoveOrderRequest

func NewMoveOrderRequest(client *Client, orderNumber int64, rate float64) *MoveOrderRequest

func (*MoveOrderRequest) Amount

func (r *MoveOrderRequest) Amount(amount float64) *MoveOrderRequest

func (*MoveOrderRequest) ClientOrderID

func (r *MoveOrderRequest) ClientOrderID(clientOrderID int64) *MoveOrderRequest

func (*MoveOrderRequest) Do

type OpenOrder

type OpenOrder struct {
	OrderNumber    int64   `json:"orderNumber,string"`
	Type           string  `json:"type"`
	Rate           float64 `json:"rate,string"`
	StartingAmount float64 `json:"startingAmount,string"`
	Amount         float64 `json:"amount,string"`
	Total          float64 `json:"total,string"`
	Date           string  `json:"date"`
	Margin         int     `json:"margin"`
}

func (*OpenOrder) DateTime

func (oo *OpenOrder) DateTime() time.Time

type OpenOrders

type OpenOrders map[string][]OpenOrder

type OpenOrdersRequest

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

func NewOpenOrdersRequest

func NewOpenOrdersRequest(client *Client, currencyPair string) *OpenOrdersRequest

func (*OpenOrdersRequest) Do

type Order

type Order struct {
	OrderNumber      int64   `json:"orderNumber"`
	ResultingTrades  []Trade `json:"resultingTrades"`
	Fee              float64 `json:"fee,string"`
	ClientOrderID    int64   `json:"clientOrderId,string"`
	CurrencyPair     string  `json:"currencyPair"`
	TokenFee         float64 `json:"tokenFee,string"`
	TokenFeeCurrency string  `json:"tokenFeeCurrency"`
}

type OrderRequest

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

func NewOrderRequest

func NewOrderRequest(client *Client, side OrderSide, currencyPair string) *OrderRequest

func (*OrderRequest) Amount

func (r *OrderRequest) Amount(amount float64) *OrderRequest

func (*OrderRequest) ClientOrderID

func (r *OrderRequest) ClientOrderID(clientOrderID int64) *OrderRequest

func (*OrderRequest) Do

func (r *OrderRequest) Do(ctx context.Context) (*Order, error)

func (*OrderRequest) FillOrKill

func (r *OrderRequest) FillOrKill(flag bool) *OrderRequest

func (*OrderRequest) ImmediateOrCancel

func (r *OrderRequest) ImmediateOrCancel(flag bool) *OrderRequest

func (*OrderRequest) PostOnly

func (r *OrderRequest) PostOnly(flag bool) *OrderRequest

func (*OrderRequest) Rate

func (r *OrderRequest) Rate(rate float64) *OrderRequest

type OrderSide

type OrderSide string
const (
	Buy  OrderSide = "buy"
	Sell OrderSide = "sell"
)

type OrderStatus

type OrderStatus struct {
	OrderNumber    int64
	Status         string  `json:"status"`
	Rate           float64 `json:"rate,string"`
	Amount         float64 `json:"amount,string"`
	CurrencyPair   string  `json:"currencyPair"`
	Date           string  `json:"date"`
	Total          float64 `json:"total,string"`
	Type           string  `json:"type"`
	StartingAmount float64 `json:"startingAmount,string"`
}

func (*OrderStatus) DateTime

func (o *OrderStatus) DateTime() time.Time

func (*OrderStatus) IsOpen

func (o *OrderStatus) IsOpen() bool

func (*OrderStatus) IsPartiallyFilled

func (o *OrderStatus) IsPartiallyFilled() bool

type OrderStatusRequest

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

func NewOrderStatusRequest

func NewOrderStatusRequest(client *Client, orderNumber int64) *OrderStatusRequest

func (*OrderStatusRequest) Do

type TradableBalancesRequest

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

func NewTradableBalancesRequest

func NewTradableBalancesRequest(client *Client) *TradableBalancesRequest

func (*TradableBalancesRequest) Do

type TradableCurrencyBalances

type TradableCurrencyBalances map[string]float64

type TradableCurrencyPairBalances

type TradableCurrencyPairBalances map[string]TradableCurrencyBalances

type Trade

type Trade struct {
	Amount  float64 `json:"amount,string"`
	Date    string  `json:"date"`
	Rate    float64 `json:"rate,string"`
	Total   float64 `json:"total,string"`
	TradeID string  `json:"tradeId"`
	Type    string  `json:"type"`
}

func (*Trade) DateTime

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

Jump to

Keyboard shortcuts

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