tagz

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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_ID           = 66
	DEFAULT_TAKER_FEE    = 0.00
	DEFAULT_MAKER_FEE    = 0.00
	DEFAULT_LOT_SIZE     = 0.00000001
	DEFAULT_PRICE_FILTER = 0.00000001 //PRICE FILTER
	DEFAULT_TXFEE        = 0.005
	DEFAULT_WITHDRAW     = true
	DEFAULT_DEPOSIT      = true
	DEFAULT_CONFIRMATION = 2
	DEFAULT_LISTED       = true
)
View Source
const (
	API_URL = "https://trade.tagz.com"
)

The Base Endpoint URL

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalance

type AccountBalance []struct {
	Balance   string `json:"balance"`
	Available string `json:"available"`
	Holds     string `json:"holds"`
	Currency  string `json:"currency"`
	ID        string `json:"id"`
	Type      string `json:"type"`
}

type AccountID

type AccountID []struct {
	ID        string `json:"id"`
	Currency  string `json:"currency"`
	Type      string `json:"type"`
	Balance   string `json:"balance"`
	Available string `json:"available"`
	Holds     string `json:"holds"`
}

type CancelOrder

type CancelOrder struct {
	CancelledOrderIds []string `json:"cancelledOrderIds"`
}

type InnerTrans

type InnerTrans struct {
	Code    string `json:"code"`
	Msg     string `json:"msg"`
	OrderID string `json:"orderId"`
}

type JsonResponse

type JsonResponse struct {
	Success bool            `json:"success"`
	Code    string          `json:"code"`
	Msg     string          `json:"msg"`
	Retry   bool            `json:"retry"`
	Data    json.RawMessage `json:"data"`
}

type OrderBook

type OrderBook struct {
	Instrument string `json:"instrument"`
	Bids       []struct {
		Amount float64 `json:"amount"`
		Price  float64 `json:"price"`
	} `json:"bids"`
	Asks []struct {
		Amount float64 `json:"amount"`
		Price  float64 `json:"price"`
	} `json:"asks"`
	Version        int     `json:"version"`
	AskTotalAmount float64 `json:"askTotalAmount"`
	BidTotalAmount float64 `json:"bidTotalAmount"`
	Snapshot       bool    `json:"snapshot"`
}

type OrderDetail

type OrderDetail struct {
	OrderID string `json:"orderId"`
}

type OrderStatus

type OrderStatus struct {
	ID            string `json:"id"`
	Symbol        string `json:"symbol"`
	OpType        string `json:"opType"`
	Type          string `json:"type"`
	Side          string `json:"side"`
	Price         string `json:"price"`
	Size          string `json:"size"`
	Funds         string `json:"funds"`
	DealFunds     string `json:"dealFunds"`
	DealSize      string `json:"dealSize"`
	Fee           string `json:"fee"`
	FeeCurrency   string `json:"feeCurrency"`
	Stp           string `json:"stp"`
	Stop          string `json:"stop"`
	StopTriggered bool   `json:"stopTriggered"`
	StopPrice     string `json:"stopPrice"`
	TimeInForce   string `json:"timeInForce"`
	PostOnly      bool   `json:"postOnly"`
	Hidden        bool   `json:"hidden"`
	Iceberg       bool   `json:"iceberg"`
	VisibleSize   string `json:"visibleSize"`
	CancelAfter   int    `json:"cancelAfter"`
	Channel       string `json:"channel"`
	ClientOid     string `json:"clientOid"`
	Remark        string `json:"remark"`
	Tags          string `json:"tags"`
	IsActive      bool   `json:"isActive"`
	CancelExist   bool   `json:"cancelExist"`
	CreatedAt     int64  `json:"createdAt"`
}

type PairsData

type PairsData []string

type Tagz

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

	API_KEY    string
	API_SECRET string
	Passphrase string

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

func CreateTagz

func CreateTagz(config *exchange.Config) *Tagz

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

func (*Tagz) ApiKeyRequest

func (e *Tagz) 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 (*Tagz) CanDeposit

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

func (*Tagz) CanWithdraw

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

func (*Tagz) CancelAllOrder

func (e *Tagz) CancelAllOrder() error

func (*Tagz) CancelOrder

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

func (*Tagz) DeleteCoin

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

func (*Tagz) DeletePair

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

func (*Tagz) DoAccountOperation

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

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

func (*Tagz) GetBalance

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

func (*Tagz) GetCoinBySymbol

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

func (*Tagz) GetCoinConstraint

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

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

func (*Tagz) GetCoins

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

func (*Tagz) GetCoinsData

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

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

func (*Tagz) GetConstraintFetchMethod

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

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

func (*Tagz) GetFee

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

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

func (*Tagz) GetID

func (e *Tagz) GetID() int

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

func (*Tagz) GetLotSize

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

func (*Tagz) GetName

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

func (*Tagz) GetPairBySymbol

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

func (*Tagz) GetPairConstraint

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

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

func (*Tagz) GetPairs

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

func (*Tagz) GetPairsData

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

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

func (*Tagz) GetSymbolByCoin

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

func (*Tagz) GetSymbolByPair

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

func (*Tagz) GetTradingWebURL

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

no trade url for each pair

func (*Tagz) GetTxFee

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

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

func (*Tagz) HasPair

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

func (*Tagz) InitData

func (e *Tagz) InitData() error

func (*Tagz) LimitBuy

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

func (*Tagz) LimitSell

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

func (*Tagz) ListOrders

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

func (*Tagz) LoadPublicData

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

************** Public API **************

func (*Tagz) OrderBook

func (e *Tagz) OrderBook(p *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 (*Tagz) OrderStatus

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

func (*Tagz) SetCoinConstraint

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

func (*Tagz) SetPairConstraint

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

func (*Tagz) UpdateAllBalances

func (e *Tagz) UpdateAllBalances()

func (*Tagz) UpdateConstraint

func (e *Tagz) UpdateConstraint()

func (*Tagz) Withdraw

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

Withdraw(coin *coin.Coin, quantity float64, addr, tag string)

type Withdraw

type Withdraw struct {
	WithdrawalID string `json:"withdrawalId"`
}

Jump to

Keyboard shortcuts

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