poloniex

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 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 Exchange added in v1.3.9

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

func New

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

func (*Exchange) CancelOrder added in v1.3.9

func (exchange *Exchange) CancelOrder(orderId string, currency CurrencyPair) (bool, error)

func (*Exchange) CloseMarginPosition added in v1.3.9

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

func (*Exchange) GetAccount added in v1.3.9

func (exchange *Exchange) GetAccount() (*Account, error)

func (*Exchange) GetAssets added in v1.3.9

func (exchange *Exchange) GetAssets(currency CurrencyPair) (*Assets, error)

func (*Exchange) GetDepositsWithdrawals added in v1.3.9

func (exchange *Exchange) GetDepositsWithdrawals(start, end string) (*PoloniexDepositsWithdrawals, error)

func (*Exchange) GetDepth added in v1.3.9

func (exchange *Exchange) GetDepth(size int, currency CurrencyPair) (*Depth, error)

func (*Exchange) GetExchangeName added in v1.3.9

func (exchange *Exchange) GetExchangeName() string

func (*Exchange) GetKlineRecords added in v1.3.9

func (exchange *Exchange) GetKlineRecords(currency CurrencyPair, period KlinePeriod, size int, optional ...OptionalParameter) ([]Kline, error)

func (*Exchange) GetMarginPosition added in v1.3.9

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

func (*Exchange) GetOneOrder added in v1.3.9

func (exchange *Exchange) GetOneOrder(orderId string, currency CurrencyPair) (*Order, error)

func (*Exchange) GetOrderHistorys added in v1.3.9

func (exchange *Exchange) GetOrderHistorys(currency CurrencyPair, opt ...OptionalParameter) ([]Order, error)

func (*Exchange) GetTicker added in v1.3.9

func (exchange *Exchange) GetTicker(currency CurrencyPair) (*Ticker, error)

func (*Exchange) GetTradeHistory added in v1.3.9

func (exchange *Exchange) GetTradeHistory(currency CurrencyPair, optional ...OptionalParameter) ([]Trade, error)

func (*Exchange) GetTrades added in v1.3.9

func (exchange *Exchange) GetTrades(currencyPair CurrencyPair, since int64) ([]Trade, error)

func (*Exchange) GetUnfinishOrders added in v1.3.9

func (exchange *Exchange) GetUnfinishOrders(currency CurrencyPair) ([]Order, error)

func (*Exchange) LimitBuy added in v1.3.9

func (exchange *Exchange) LimitBuy(amount, price string, currency CurrencyPair, opt ...LimitOrderOptionalParameter) (*Order, error)

func (*Exchange) LimitSell added in v1.3.9

func (exchange *Exchange) LimitSell(amount, price string, currency CurrencyPair, opt ...LimitOrderOptionalParameter) (*Order, error)

func (*Exchange) MarginLimitBuy added in v1.3.9

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

func (*Exchange) MarginLimitSell added in v1.3.9

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

func (*Exchange) MarketBuy added in v1.3.9

func (exchange *Exchange) MarketBuy(amount, price string, currency CurrencyPair) (*Order, error)

func (*Exchange) MarketSell added in v1.3.9

func (exchange *Exchange) MarketSell(amount, price string, currency CurrencyPair) (*Order, error)

func (*Exchange) Withdraw added in v1.3.9

func (exchange *Exchange) 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