Version: v0.0.0-...-65438fe Latest Latest

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 14 Imported by: 0




View Source
const (
	DEFAULT_ID           = 2
	DEFAULT_TAKER_FEE    = 0.0025
	DEFAULT_MAKER_FEE    = 0.0025
	DEFAULT_LOT_SIZE     = 0.00000001
	DEFAULT_DEPOSIT      = true
View Source
const (
	API_URL string = ""


This section is empty.


This section is empty.


type AccountBalances

type AccountBalances []struct {
	Currency      string  `json:"Currency"`
	Balance       float64 `json:"Balance"`
	Available     float64 `json:"Available"`
	Pending       float64 `json:"Pending"`
	CryptoAddress string  `json:"CryptoAddress"`
	Requested     bool    `json:"Requested"`
	Uuid          string  `json:"Uuid"`

type Bittrex

type Bittrex struct {
	ID      int
	Name    string `bson:"name"`
	Website string `bson:"website"`

	API_KEY    string
	API_SECRET string

	Source    exchange.DataSource // / exchange API / microservicve api 1 / PSQL
	SourceURI string

func CreateBittrex

func CreateBittrex(config *exchange.Config) *Bittrex


func (*Bittrex) ApiKeyGET

func (e *Bittrex) ApiKeyGET(strRequestPath string, mapParams map[string]string) string

************** Signature Http Request ************** Method: API Request and Signature is required Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Create mapParams Depend on API Signature request Step 3: Add HttpGetRequest below strUrl if API has different requests

func (*Bittrex) CanDeposit

func (e *Bittrex) CanDeposit(coin *coin.Coin) bool

func (*Bittrex) CanWithdraw

func (e *Bittrex) CanWithdraw(coin *coin.Coin) bool

func (*Bittrex) CancelAllOrder

func (e *Bittrex) CancelAllOrder() error

func (*Bittrex) CancelOrder

func (e *Bittrex) CancelOrder(order *exchange.Order) error

func (*Bittrex) DeleteCoin

func (e *Bittrex) DeleteCoin(coin *coin.Coin)

func (*Bittrex) DeletePair

func (e *Bittrex) DeletePair(pair *pair.Pair)

func (*Bittrex) DoAccountOperation

func (e *Bittrex) DoAccountOperation(operation *exchange.AccountOperation) error

************** Private API **************

func (*Bittrex) GetBalance

func (e *Bittrex) GetBalance(coin *coin.Coin) float64

func (*Bittrex) GetCoinBySymbol

func (e *Bittrex) GetCoinBySymbol(symbol string) *coin.Coin

func (*Bittrex) GetCoinConstraint

func (e *Bittrex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint

************** Coins on the Exchanges **************

func (*Bittrex) GetCoins

func (e *Bittrex) GetCoins() []*coin.Coin

func (*Bittrex) GetCoinsData

func (e *Bittrex) GetCoinsData() error

************** Public API ************** Get Coins Information (If API provide) Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Modify API Path(strRequestUrl)

func (*Bittrex) GetConfirmation

func (e *Bittrex) GetConfirmation(coin *coin.Coin) int

func (*Bittrex) GetConstraintFetchMethod

func (e *Bittrex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod

*************** Exchange Constraint ***************

func (*Bittrex) GetFee

func (e *Bittrex) GetFee(pair *pair.Pair) float64

*************** Pair Constraint ***************

func (*Bittrex) GetID

func (e *Bittrex) GetID() int

*************** Exchange Information ***************

func (*Bittrex) GetLotSize

func (e *Bittrex) GetLotSize(pair *pair.Pair) float64

func (*Bittrex) GetName

func (e *Bittrex) GetName() exchange.ExchangeName

func (*Bittrex) GetPairBySymbol

func (e *Bittrex) GetPairBySymbol(symbol string) *pair.Pair

func (*Bittrex) GetPairConstraint

func (e *Bittrex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint

************** Pairs on the Exchanges **************

func (*Bittrex) GetPairs

func (e *Bittrex) GetPairs() []*pair.Pair

func (*Bittrex) GetPairsData

func (e *Bittrex) GetPairsData() error
GetPairsData - Get Pairs Information (If API provide)

Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Modify API Path(strRequestUrl)

func (*Bittrex) GetPriceFilter

func (e *Bittrex) GetPriceFilter(pair *pair.Pair) float64

func (*Bittrex) GetSymbolByCoin

func (e *Bittrex) GetSymbolByCoin(coin *coin.Coin) string

func (*Bittrex) GetSymbolByPair

func (e *Bittrex) GetSymbolByPair(pair *pair.Pair) string

func (*Bittrex) GetTradingWebURL

func (e *Bittrex) GetTradingWebURL(pair *pair.Pair) string

func (*Bittrex) GetTxFee

func (e *Bittrex) GetTxFee(coin *coin.Coin) float64

*************** Coin Constraint ***************

func (*Bittrex) HasPair

func (e *Bittrex) HasPair(pair *pair.Pair) bool

func (*Bittrex) InitData

func (e *Bittrex) InitData() error

func (*Bittrex) LimitBuy

func (e *Bittrex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)

func (*Bittrex) LimitSell

func (e *Bittrex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)

func (*Bittrex) ListOrders

func (e *Bittrex) ListOrders() ([]*exchange.Order, error)

func (*Bittrex) LoadPublicData

func (e *Bittrex) LoadPublicData(operation *exchange.PublicOperation) error

func (*Bittrex) OrderBook

func (e *Bittrex) OrderBook(pair *pair.Pair) (*exchange.Maker, error)

Get Pair Market Depth Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Get Exchange Pair Code ex. symbol := e.GetPairCode(p) Step 4: Modify API Path(strRequestUrl) Step 5: Add Params - Depend on API request Step 6: Convert the response to Standard Maker struct

func (*Bittrex) OrderStatus

func (e *Bittrex) OrderStatus(order *exchange.Order) error

func (*Bittrex) SetCoinConstraint

func (e *Bittrex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)

func (*Bittrex) SetPairConstraint

func (e *Bittrex) SetPairConstraint(pairConstraint *exchange.PairConstraint)

func (*Bittrex) UpdateAllBalances

func (e *Bittrex) UpdateAllBalances()

func (*Bittrex) UpdateConstraint

func (e *Bittrex) UpdateConstraint()

func (*Bittrex) Withdraw

func (e *Bittrex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool

type CoinsData

type CoinsData []struct {
	Currency        string      `json:"Currency"`
	CurrencyLong    string      `json:"CurrencyLong"`
	MinConfirmation int         `json:"MinConfirmation"`
	TxFee           float64     `json:"TxFee"`
	IsActive        bool        `json:"IsActive"`
	IsRestricted    bool        `json:"IsRestricted"`
	CoinType        string      `json:"CoinType"`
	BaseAddress     string      `json:"BaseAddress"`
	Notice          interface{} `json:"Notice"`

type JsonResponse

type JsonResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message"`
	Result  json.RawMessage `json:"result"`

type OrderBook

type OrderBook struct {
	Buy  []exchange.Order `json:"buy"`
	Sell []exchange.Order `json:"sell"`

type PairsData

type PairsData []struct {
	MarketCurrency     string      `json:"MarketCurrency"`
	BaseCurrency       string      `json:"BaseCurrency"`
	MarketCurrencyLong string      `json:"MarketCurrencyLong"`
	BaseCurrencyLong   string      `json:"BaseCurrencyLong"`
	MinTradeSize       float64     `json:"MinTradeSize"`
	MarketName         string      `json:"MarketName"`
	IsActive           bool        `json:"IsActive"`
	Created            string      `json:"Created"`
	Notice             interface{} `json:"Notice"`
	IsSponsored        interface{} `json:"IsSponsored"`
	LogoURL            string      `json:"LogoUrl"`

type PlaceOrder

type PlaceOrder struct {
	AccountId                  string
	OrderUuid                  string `json:"OrderUuid"`
	Exchange                   string `json:"Exchange"`
	Type                       string
	Quantity                   float64 `json:"Quantity"`
	QuantityRemaining          float64 `json:"QuantityRemaining"`
	Limit                      float64 `json:"Limit"`
	Reserved                   float64
	ReserveRemaining           float64
	CommissionReserved         float64
	CommissionReserveRemaining float64
	CommissionPaid             float64
	Price                      float64 `json:"Price"`
	PricePerUnit               float64 `json:"PricePerUnit"`
	Opened                     string
	Closed                     string
	IsOpen                     bool
	Sentinel                   string
	CancelInitiated            bool
	ImmediateOrCancel          bool
	IsConditional              bool
	Condition                  string
	ConditionTarget            float64

type TradeHistory

type TradeHistory []struct {
	ID        int     `json:"Id"`
	TimeStamp string  `json:"TimeStamp"`
	Quantity  float64 `json:"Quantity"`
	Price     float64 `json:"Price"`
	Total     float64 `json:"Total"`
	FillType  string  `json:"FillType"`
	OrderType string  `json:"OrderType"`
	UUID      string  `json:"Uuid"`

type Uuid

type Uuid struct {
	Id string `json:"uuid"`

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL