Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CoinsData
- type JsonResponse
- type ListData
- type ListItem
- type OrderBook
- type OrderBooks
- type Pair
- type PairsData
- type PlaceOrder
- type Switcheo
- func (e *Switcheo) ApiKeyGet(strRequestPath string, mapParams map[string]string) string
- func (e *Switcheo) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Switcheo) CanDeposit(coin *coin.Coin) bool
- func (e *Switcheo) CanWithdraw(coin *coin.Coin) bool
- func (e *Switcheo) CancelAllOrder() error
- func (e *Switcheo) CancelOrder(order *exchange.Order) error
- func (e *Switcheo) DeleteCoin(coin *coin.Coin)
- func (e *Switcheo) DeletePair(pair *pair.Pair)
- func (e *Switcheo) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Switcheo) GetBalance(coin *coin.Coin) float64
- func (e *Switcheo) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Switcheo) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Switcheo) GetCoins() []*coin.Coin
- func (e *Switcheo) GetCoinsData() error
- func (e *Switcheo) GetConfirmation(coin *coin.Coin) int
- func (e *Switcheo) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Switcheo) GetFee(pair *pair.Pair) float64
- func (e *Switcheo) GetID() int
- func (e *Switcheo) GetLotSize(pair *pair.Pair) float64
- func (e *Switcheo) GetName() exchange.ExchangeName
- func (e *Switcheo) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Switcheo) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Switcheo) GetPairs() []*pair.Pair
- func (e *Switcheo) GetPairsData() error
- func (e *Switcheo) GetPriceFilter(pair *pair.Pair) float64
- func (e *Switcheo) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Switcheo) GetSymbolByPair(pair *pair.Pair) string
- func (e *Switcheo) GetTradingWebURL(pair *pair.Pair) string
- func (e *Switcheo) GetTxFee(coin *coin.Coin) float64
- func (e *Switcheo) HasPair(pair *pair.Pair) bool
- func (e *Switcheo) InitData() error
- func (e *Switcheo) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Switcheo) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Switcheo) ListOrders() ([]*exchange.Order, error)
- func (e *Switcheo) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Switcheo) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Switcheo) OrderStatus(order *exchange.Order) error
- func (e *Switcheo) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Switcheo) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Switcheo) UpdateAllBalances()
- func (e *Switcheo) UpdateConstraint()
- func (e *Switcheo) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type Token
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 55 DEFAULT_TAKER_FEE = 0.0020 DEFAULT_MAKER_FEE = 0 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 )
const (
API_URL = "https://api.switcheo.network"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances []struct { Asset string `json:"asset"` Total float64 `json:"total"` Available float64 `json:"available"` Locked float64 `json:"locked"` }
********* Private API Structure*********
type JsonResponse ¶
type JsonResponse struct { Success bool `json:"success"` Message string `json:"message"` Data json.RawMessage `json:"data"` }
type OrderBooks ¶
type Pair ¶
type Pair struct { Name string `json:"name"` Precision int `json:"precision"` BaseAssetName string `json:"baseAssetName"` BaseAssetSymbol string `json:"baseAssetSymbol"` BaseContract string `json:"baseContract"` QuoteAssetName string `json:"quoteAssetName"` QuoteAssetSymbol string `json:"quoteAssetSymbol"` QuoteContract string `json:"quoteContract"` }
type PlaceOrder ¶
type PlaceOrder struct { Symbol string `json:"symbol"` OrderID string `json:"orderId"` Side string `json:"side"` Type string `json:"type"` Price string `json:"price"` AveragePrice string `json:"executedQty"` OrigQty string `json:"origQty"` ExecutedQty string `json:"executedQty"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` }
type Switcheo ¶
type Switcheo 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 CreateSwitcheo ¶
*************************************************
func (*Switcheo) ApiKeyGet ¶
************** Signature Http Request ************** Method: API Get 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 (*Switcheo) ApiKeyRequest ¶
func (e *Switcheo) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
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
func (*Switcheo) CancelAllOrder ¶
func (*Switcheo) DeleteCoin ¶
func (*Switcheo) DeletePair ¶
func (*Switcheo) DoAccountOperation ¶
func (e *Switcheo) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Switcheo) GetCoinConstraint ¶
func (e *Switcheo) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Switcheo) GetCoinsData ¶
************** 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(strRequestPath)
func (*Switcheo) GetConstraintFetchMethod ¶
func (e *Switcheo) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Switcheo) GetName ¶
func (e *Switcheo) GetName() exchange.ExchangeName
func (*Switcheo) GetPairConstraint ¶
func (e *Switcheo) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Switcheo) GetPairsData ¶
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 (*Switcheo) LoadPublicData ¶
func (e *Switcheo) LoadPublicData(operation *exchange.PublicOperation) error
func (*Switcheo) OrderBook ¶
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.GetSymbolByPair(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 (*Switcheo) SetCoinConstraint ¶
func (e *Switcheo) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Switcheo) SetPairConstraint ¶
func (e *Switcheo) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Switcheo) UpdateAllBalances ¶
func (e *Switcheo) UpdateAllBalances()
func (*Switcheo) UpdateConstraint ¶
func (e *Switcheo) UpdateConstraint()
type Token ¶
type Token struct { Symbol string `json:"symbol"` Name string `json:"name"` Type string `json:"type"` Hash string `json:"hash"` Decimals int `json:"decimals"` TransferDecimals int `json:"transfer_decimals"` Precision int `json:"precision"` MinimumQuantity string `json:"minimum_quantity"` TradingActive bool `json:"trading_active"` IsStablecoin bool `json:"is_stablecoin"` StablecoinType interface{} `json:"stablecoin_type"` Active bool `json:"active"` ListingInfo ListData `json:"listing_info"` }