poloniex

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BASE_URL       = "https://poloniex.com/"
	TRADE_API      = BASE_URL + "tradingApi"
	PUBLIC_URL     = BASE_URL + "public"
	TICKER_API     = "?command=returnTicker"
	ORDER_BOOK_API = "?command=returnOrderBook&currencyPair=%s&depth=%d"
)
View Source
const EXCHANGE_NAME = "poloniex.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type Poloniex

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

func New

func New(client *http.Client, accessKey, secretKey string) *Poloniex

func (*Poloniex) CancelOrder

func (poloniex *Poloniex) CancelOrder(orderId string, currency CurrencyPair) (bool, error)

func (*Poloniex) CloseMarginPosition

func (poloniex *Poloniex) CloseMarginPosition(currency CurrencyPair) (bool, error)

func (*Poloniex) GetAccount

func (poloniex *Poloniex) GetAccount() (*Account, error)

func (*Poloniex) GetDepositsWithdrawals

func (poloniex *Poloniex) GetDepositsWithdrawals(start, end string) (*PoloniexDepositsWithdrawals, error)

func (*Poloniex) GetDepth

func (poloniex *Poloniex) GetDepth(size int, currency CurrencyPair) (*Depth, error)

func (*Poloniex) GetExchangeName

func (poloniex *Poloniex) GetExchangeName() string

func (*Poloniex) GetKlineRecords

func (Poloniex *Poloniex) GetKlineRecords(currency CurrencyPair, period, size, since int) ([]Kline, error)

func (*Poloniex) GetMarginPosition

func (poloniex *Poloniex) GetMarginPosition(currency CurrencyPair) (*PoloniexMarginPosition, error)

func (*Poloniex) GetOneOrder

func (poloniex *Poloniex) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)

func (*Poloniex) GetOrderHistorys

func (Poloniex *Poloniex) GetOrderHistorys(currency CurrencyPair, currentPage, pageSize int) ([]Order, error)

func (*Poloniex) GetTicker

func (poloniex *Poloniex) GetTicker(currency CurrencyPair) (*Ticker, error)

func (*Poloniex) GetTrades

func (poloniex *Poloniex) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

func (*Poloniex) GetUnfinishOrders

func (poloniex *Poloniex) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)

func (*Poloniex) LimitBuy

func (poloniex *Poloniex) LimitBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Poloniex) LimitSell

func (poloniex *Poloniex) LimitSell(amount, price string, currency CurrencyPair) (*Order, error)

func (*Poloniex) MarginLimitBuy

func (poloniex *Poloniex) MarginLimitBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Poloniex) MarginLimitSell

func (poloniex *Poloniex) MarginLimitSell(amount, price string, currency CurrencyPair) (*Order, error)

func (*Poloniex) MarketBuy

func (poloniex *Poloniex) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Poloniex) MarketSell

func (poloniex *Poloniex) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)

func (*Poloniex) Withdraw

func (p *Poloniex) Withdraw(amount string, currency Currency, fees, receiveAddr, safePwd string) (string, error)

type PoloniexDepositsWithdrawals

type PoloniexDepositsWithdrawals struct {
	Deposits []struct {
		Currency      string    `json:"currency"`
		Address       string    `json:"address"`
		Amount        float64   `json:"amount,string"`
		Confirmations int       `json:"confirmations"`
		TransactionID string    `json:"txid"`
		Timestamp     time.Time `json:"timestamp"`
		Status        string    `json:"status"`
	} `json:"deposits"`
	Withdrawals []struct {
		WithdrawalNumber int64     `json:"withdrawalNumber"`
		Currency         string    `json:"currency"`
		Address          string    `json:"address"`
		Amount           float64   `json:"amount,string"`
		Confirmations    int       `json:"confirmations"`
		TransactionID    string    `json:"txid"`
		Timestamp        time.Time `json:"timestamp"`
		Status           string    `json:"status"`
		IPAddress        string    `json:"ipAddress"`
	} `json:"withdrawals"`
}

type PoloniexGenericResponse

type PoloniexGenericResponse struct {
	Success int    `json:"success"`
	Error   string `json:"error"`
}

type PoloniexMarginPosition

type PoloniexMarginPosition struct {
	Amount            float64 `json:"amount,string"`
	Total             float64 `json:"total,string"`
	BasePrice         float64 `json:"basePrice,string"`
	LiquidiationPrice float64 `json:"liquidiationPrice"`
	ProfitLoss        float64 `json:"pl,string"`
	LendingFees       float64 `json:"lendingFees,string"`
	Type              string  `json:"type"`
}

Jump to

Keyboard shortcuts

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