btcturk

package
v0.0.0-...-6a6f071 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BTCTRY   string = "BTCTRY"
	ETHBTC   string = "ETHBTC"
	ETHTRY   string = "ETHTRY"
	XRPTRY   string = "XRPTRY"
	LTCTRY   string = "LTCTRY"
	USDTTRY  string = "USDTTRY"
	BTCUSDT  string = "BTCUSDT"
	ETHUSDT  string = "ETHUSDT"
	XRPUSDT  string = "XRPUSDT"
	LTCUSDT  string = "LTCUSDT"
	XLMTRY   string = "XLMTRY"
	LTCBTC   string = "LTCBTC"
	XRPBTC   string = "XRPBTC"
	XLMBTC   string = "XLMBTC"
	XLMUSDT  string = "XLMUSDT"
	NEOTRY   string = "NEOTRY"
	NEOBTC   string = "NEOBTC"
	NEOUSDT  string = "NEOUSDT"
	EOSTRY   string = "EOSTRY"
	EOSUSDT  string = "EOSUSDT"
	EOSBTC   string = "EOSBTC"
	DASHTRY  string = "DASHTRY"
	DASHBTC  string = "DASHBTC"
	DASHUSDT string = "DASHUSDT"
	LINKTRY  string = "LINKTRY"
	LINKUSDT string = "LINKUSDT"
	LINKBTC  string = "LINKBTC"
	ATOMTRY  string = "ATOMTRY"
	ATOMUSDT string = "ATOMUSDT"
	ATOMBTC  string = "ATOMBTC"
	XTZTRY   string = "XTZTRY"
	TRY      string = "TRY"
	BTC      string = "BTC"
	ETH      string = "ETH"
	XRP      string = "XRP"
	LTC      string = "LTC"
	USDT     string = "USDT"
	XLM      string = "XLM"
	NEO      string = "NEO"
	EOS      string = "EOS"
	DASH     string = "DASH"
	LINK     string = "LINK"
	ATOM     string = "ATOM"
	XTZ      string = "XTZ"

	MarketOrder    string = "market"
	LimitOrder     string = "limit"
	StopLimitOrder string = "stoplimit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	Asset     string `json:"asset"`
	AssetName string `json:"assetname"`
	Balance   string `json:"balance"`
	Locked    string `json:"locked"`
	Free      string `json:"free"`
}

https://docs.btcturk.com/#account-balance

type Client

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

func NewBTCTurkClient

func NewBTCTurkClient() *Client

func (*Client) AddCustomParam

func (c *Client) AddCustomParam(k string, v string) *Client

Custom Param

func (*Client) Balance

func (c *Client) Balance() ([]Balance, error)

Returns User's Balance

func (*Client) Buy

func (c *Client) Buy(o *OrderInput) (OrderResult, error)

func (*Client) CancelOrder

func (c *Client) CancelOrder() (bool, error)

func (*Client) Limit

func (c *Client) Limit(v int) *Client

Limit Transactions

func (*Client) NewOrderClientID

func (c *Client) NewOrderClientID(v string) *Client

NewOrderClientID Buy or Sell

func (*Client) Offset

func (c *Client) Offset(v int) *Client

Offset Transactions

func (*Client) OpenOrders

func (c *Client) OpenOrders() (OpenOrderResult, error)

func (*Client) OrderBook

func (c *Client) OrderBook() (OrderBook, error)

GET ?pairSymbol=BTC_TRY Or GET ?pairSymbol=BTC_TRY&limit=100

func (*Client) OrderID

func (c *Client) OrderID(v int) *Client

OrderID Cancel

func (*Client) OrderMethod

func (c *Client) OrderMethod(v string) *Client

OrderMethod Buy or Sell ( "limit", "market", "stoplimit" )

func (*Client) PairSymbol

func (c *Client) PairSymbol(v string) *Client

PairSymbol must be (Buy or Sell), Open Orders, Trades, Order Book

func (*Client) Price

func (c *Client) Price(v float64) *Client

Price Buy or Sell

func (*Client) Quantity

func (c *Client) Quantity(v float64) *Client

Quantity Buy or Sell

func (*Client) Sell

func (c *Client) Sell(o *OrderInput) (OrderResult, error)

func (*Client) SetAuthKey

func (c *Client) SetAuthKey(publicKey, privateKey string)

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(basURL string) (err error)

func (*Client) Sort

func (c *Client) Sort(v string) *Client

Sort Transactions

func (*Client) StopPrice

func (c *Client) StopPrice(v float64) *Client

StopPrice Buy or Sell

func (*Client) Ticker

func (c *Client) Ticker() ([]Ticker, error)

If pairSymbol is not set, ticker for all pairs will be returned in a json array. Or GET ?pairSymbol=BTC_TRY Or GET ?symbol=USDT

func (*Client) Trades

func (c *Client) Trades() ([]Trade, error)

GET ?pairSymbol=BTC_TRY or GET ?pairSymbol=BTC_TRY&last=COUNT (Max. value for count parameter is 50)

func (*Client) UserTransactions

func (c *Client) UserTransactions() ([]UserTransactions, error)

Example Params : ?type=buy&type=sell&symbol=btc&symbol=try&symbol=usdt

func (*Client) Version

func (c *Client) Version() string

type GeneralResponse

type GeneralResponse struct {
	Success bool        `json:"success"`
	Message *string     `json:"message"`
	Code    int         `json:"code"`
	Data    interface{} `json:"data"`
}

type OpenOrderModel

type OpenOrderModel struct {
	ID            int64   `json:"id"`
	Price         string  `json:"price"`
	Amount        string  `json:"amount"`
	Quantity      string  `json:"quantity"`
	PairSymbol    string  `json:"pairsymbol"`
	Type          string  `json:"type"`
	Method        string  `json:"method"`
	OrderClientID string  `json:"orderClientId"`
	DateTime      float64 `json:"datetime"`
	UpdateTime    float64 `json:"updateTime"`
	Status        string  `json:"status"`
}

type OpenOrderResult

type OpenOrderResult struct {
	Asks []OpenOrderModel `json:"asks"`
	Bids []OpenOrderModel `json:"bids"`
}

type OrderBook

type OrderBook struct {
	TimeStamp float64    `json:"timestamp"`
	Bids      [][]string `json:"bids"`
	Asks      [][]string `json:"asks"`
}

https://docs.btcturk.com/#order-book

type OrderInput

type OrderInput struct {
	Quantity         float64 `json:"quantity"`
	Price            float64 `json:"price"`
	StopPrice        float64 `json:"stopPrice"`
	NewOrderClientId string  `json:"newOrderClientId"`
	OrderMethod      string  `json:"orderMethod"`
	OrderType        string  `json:"orderType"`
	PairSymbol       string  `json:"pairSymbol"`
}

type OrderResult

type OrderResult struct {
	ID                   int32  `json:"id"`
	DateTime             int32  `json:"datetime"`
	Type                 string `json:"type"`
	Method               string `json:"method"`
	Price                string `json:"price"`
	StopPrice            string `json:"stopPrice"`
	Quantity             string `json:"quantity"`
	PairSymbol           string `json:"pairSymbol"`
	PairSymbolNormalized string `json:"pairSymbolNormalized"`
	NewOrderClientID     string `json:"newOrderClientId"`
}

type Ticker

type Ticker struct {
	Pair              string  `json:"pair"`
	PairNormalized    string  `json:"pairNormalized"`
	Timestamp         float64 `json:"timestamp"`
	Last              float64 `json:"last"`
	High              float64 `json:"high"`
	Low               float64 `json:"low"`
	Bid               float64 `json:"bid"`
	Ask               float64 `json:"ask"`
	Open              float64 `json:"open"`
	Volume            float64 `json:"volume"`
	Average           float64 `json:"average"`
	Daily             float64 `json:"daily"`
	DailyPercent      float64 `json:"dailyPercent"`
	DenominatorSymbol string  `json:"denominatorSymbol"`
	NumeratorSymbol   string  `json:"numeratorSymbol"`
}

https://docs.btcturk.com/#ticker

type Trade

type Trade struct {
	Pair           string  `json:"pair"`
	PairNormalized string  `json:"pairNormalized"`
	Numerator      string  `json:"numerator"`
	Denominator    string  `json:"denominator"`
	TimeStamp      float64 `json:"date"`
	TID            string  `json:"tid"`
	Price          string  `json:"price"`
	Amount         string  `json:"amount"`
	Side           string  `json:"side"`
}

https://docs.btcturk.com/#trades

type UserTransactions

type UserTransactions struct {
	Price             float64 `json:"price"`
	NumeratorSymbol   string  `json:"numeratorSymbol"`
	DenominatorSymbol string  `json:"denominatorSymbol"`
	OrderType         string  `json:"orderType"`
	ID                string  `json:"id"`
	Timestamp         float64 `json:"timestamp"`
	Amount            float64 `json:"amount"`
	Fee               float64 `json:"fee"`
	Tax               float64 `json:"tax"`
}

https://docs.btcturk.com/#user-transactions

Jump to

Keyboard shortcuts

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