tradeogre

package
v0.0.0-...-db5ea55 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_ID           = 31
	DEFAULT_TAKER_FEE    = 0.002
	DEFAULT_MAKER_FEE    = 0.002
	DEFAULT_LOT_SIZE     = 0.00000001
	DEFAULT_PRICE_FILTER = 0.00000001
	DEFAULT_TXFEE        = 0.005
	DEFAULT_WITHDRAW     = true
	DEFAULT_DEPOSIT      = true
	DEFAULT_CONFIRMATION = 2
	DEFAULT_LISTED       = true
)
View Source
const (
	API_URL string = "https://tradeogre.com/api/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalances

type AccountBalances struct {
	Success  bool              `json:"success"`
	Balances map[string]string `json:"balances"`
}

type CancelOrder

type CancelOrder struct {
	Success bool `json:"success"`
}

type Order

type Order struct {
	UUID     string `json:"uuid"`
	Date     int    `json:"date"`
	Type     string `json:"type"`
	Market   string `json:"market"`
	Price    string `json:"price"`
	Quantity string `json:"quantity"`
}

type OrderBook

type OrderBook struct {
	Success string            `json:"success"` //true false
	Buy     map[string]string `json:"buy"`
	Sell    map[string]string `json:"sell"`
}

type OrderStatus

type OrderStatus struct {
	Success   bool   `json:"success"`
	Date      string `json:"date"`
	Type      string `json:"type"`
	Market    string `json:"market"`
	Price     string `json:"price"`
	Quantity  string `json:"quantity"`
	Fulfilled string `json:"fulfilled"`
	Error     string `json:"error"`
}

type PairsData

type PairsData []map[string]*PairsDetail

type PairsDetail

type PairsDetail struct {
	Initialprice string `json:"initialprice"`
	Price        string `json:"price"`
	High         string `json:"high"`
	Low          string `json:"low"`
	Volume       string `json:"volume"`
	Bid          string `json:"bid"`
	Ask          string `json:"ask"`
}

type PlaceOrder

type PlaceOrder struct {
	Success      bool   `json:"success"`
	UUID         string `json:"uuid"`
	Bnewbalavail string `json:"bnewbalavail"`
	Snewbalavail string `json:"snewbalavail"`
}

type Tradeogre

type Tradeogre 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 CreateTradeogre

func CreateTradeogre(config *exchange.Config) *Tradeogre

*************************************************

func (*Tradeogre) ApiKeyRequest

func (e *Tradeogre) ApiKeyRequest(strMethod, 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 (*Tradeogre) CanDeposit

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

func (*Tradeogre) CanWithdraw

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

func (*Tradeogre) CancelAllOrder

func (e *Tradeogre) CancelAllOrder() error

func (*Tradeogre) CancelOrder

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

func (*Tradeogre) CancelOrderID

func (e *Tradeogre) CancelOrderID(operation *exchange.AccountOperation) error

func (*Tradeogre) DeleteCoin

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

func (*Tradeogre) DeletePair

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

func (*Tradeogre) DoAccountOperation

func (e *Tradeogre) DoAccountOperation(operation *exchange.AccountOperation) error
func (e *Tradeogre) LoadPublicData(operation *exchange.PublicOperation) error {
	return fmt.Errorf("LoadPublicData :: Operation type invalid: %+v", operation.Type)
}

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

func (*Tradeogre) GetBalance

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

func (*Tradeogre) GetCoinBySymbol

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

func (*Tradeogre) GetCoinConstraint

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

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

func (*Tradeogre) GetCoins

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

func (*Tradeogre) GetCoinsData

func (e *Tradeogre) 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 (*Tradeogre) GetConfirmation

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

func (*Tradeogre) GetConstraintFetchMethod

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

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

func (*Tradeogre) GetFee

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

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

func (*Tradeogre) GetID

func (e *Tradeogre) GetID() int

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

func (*Tradeogre) GetLotSize

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

func (*Tradeogre) GetName

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

func (*Tradeogre) GetPairBySymbol

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

func (*Tradeogre) GetPairConstraint

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

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

func (*Tradeogre) GetPairs

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

func (*Tradeogre) GetPairsData

func (e *Tradeogre) 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 (*Tradeogre) GetPriceFilter

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

func (*Tradeogre) GetSymbolByCoin

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

func (*Tradeogre) GetSymbolByPair

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

func (*Tradeogre) GetTradingWebURL

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

func (*Tradeogre) GetTxFee

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

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

func (*Tradeogre) HasPair

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

func (*Tradeogre) InitData

func (e *Tradeogre) InitData() error

func (*Tradeogre) LimitBuy

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

func (*Tradeogre) LimitSell

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

func (*Tradeogre) ListOrders

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

func (*Tradeogre) LoadPublicData

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

func (*Tradeogre) OrderBook

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

func (*Tradeogre) OrderStatus

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

func (*Tradeogre) SetCoinConstraint

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

func (*Tradeogre) SetPairConstraint

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

func (*Tradeogre) UpdateAllBalances

func (e *Tradeogre) UpdateAllBalances()

func (*Tradeogre) UpdateConstraint

func (e *Tradeogre) UpdateConstraint()

func (*Tradeogre) Withdraw

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

Jump to

Keyboard shortcuts

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