Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CancelOrder
- type CoinsData
- type EmptyAccount
- type JsonResponse
- type JsonResponseV3
- type OpenOrders
- type OrderBook
- type PairsData
- type PlaceOrder
- type Stex
- func (e *Stex) ApiKeyGet(mapParams map[string]string, strRequestPath string) string
- func (e *Stex) ApiKeyRequest(method string, mapParams map[string]interface{}, strRequestPath string) string
- func (e *Stex) CanDeposit(coin *coin.Coin) bool
- func (e *Stex) CanWithdraw(coin *coin.Coin) bool
- func (e *Stex) CancelAllOrder() error
- func (e *Stex) CancelOrder(order *exchange.Order) error
- func (e *Stex) DeleteCoin(coin *coin.Coin)
- func (e *Stex) DeletePair(pair *pair.Pair)
- func (e *Stex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Stex) GetBalance(coin *coin.Coin) float64
- func (e *Stex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Stex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Stex) GetCoins() []*coin.Coin
- func (e *Stex) GetCoinsData() error
- func (e *Stex) GetConfirmation(coin *coin.Coin) int
- func (e *Stex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Stex) GetFee(pair *pair.Pair) float64
- func (e *Stex) GetID() int
- func (e *Stex) GetIDByPair(pair *pair.Pair) string
- func (e *Stex) GetLotSize(pair *pair.Pair) float64
- func (e *Stex) GetName() exchange.ExchangeName
- func (e *Stex) GetPairByID(exID string) *pair.Pair
- func (e *Stex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Stex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Stex) GetPairs() []*pair.Pair
- func (e *Stex) GetPairsData() error
- func (e *Stex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Stex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Stex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Stex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Stex) GetTxFee(coin *coin.Coin) float64
- func (e *Stex) HasPair(pair *pair.Pair) bool
- func (e *Stex) InitData() error
- func (e *Stex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Stex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Stex) ListOrders() ([]*exchange.Order, error)
- func (e *Stex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Stex) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Stex) OrderStatus(order *exchange.Order) error
- func (e *Stex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Stex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Stex) UpdateAllBalances()
- func (e *Stex) UpdateConstraint()
- func (e *Stex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type TradeHistory
- type WalletDetails
- type WebOrderBook
- type WithdrawResult
Constants ¶
const ( API_URL string = "https://app.stex.com/api2" API3_URL string = "https://api3.stex.com" )
const ( DEFAULT_ID = 4 DEFAULT_TAKER_FEE = 0.002 DEFAULT_MAKER_FEE = 0.002 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 DEFAULT_CONFIRMATION = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type CancelOrder ¶
type CancelOrder struct { PutIntoProcessingQueue []*PlaceOrder `json:"put_into_processing_queue"` NotPutIntoProcessingQueue []interface{} `json:"not_put_into_processing_queue"` Message string `json:"message"` }
type CoinsData ¶
type CoinsData []struct { ID int `json:"id"` Code string `json:"code"` Name string `json:"name"` Active bool `json:"active"` Delisted bool `json:"delisted"` Precision int `json:"precision"` MinimumTxConfirmations int `json:"minimum_tx_confirmations"` MinimumWithdrawalAmount string `json:"minimum_withdrawal_amount"` MinimumDepositAmount string `json:"minimum_deposit_amount"` DepositFeeCurrencyID int `json:"deposit_fee_currency_id"` DepositFeeCurrencyCode string `json:"deposit_fee_currency_code"` DepositFeeConst string `json:"deposit_fee_const"` DepositFeePercent string `json:"deposit_fee_percent"` WithdrawalFeeCurrencyID int `json:"withdrawal_fee_currency_id"` WithdrawalFeeCurrencyCode string `json:"withdrawal_fee_currency_code"` WithdrawalFeeConst string `json:"withdrawal_fee_const"` WithdrawalFeePercent string `json:"withdrawal_fee_percent"` BlockExplorerURL string `json:"block_explorer_url"` ProtocolSpecificSettings interface{} `json:"protocol_specific_settings"` }
type EmptyAccount ¶
type EmptyAccount struct { Success int `json:"success"` Data struct { Email string `json:"email"` Username string `json:"username"` Hash string `json:"hash"` IntercomHash string `json:"intercom_hash"` Funds []interface{} `json:"funds"` OpenOrders int `json:"open_orders"` ServerTime int `json:"server_time"` } `json:"data"` }
type JsonResponse ¶
type JsonResponseV3 ¶
type JsonResponseV3 struct { Success bool `json:"success"` Data json.RawMessage `json:"data"` Message string `json:"message"` Err interface{} `json:"errors"` }
type OpenOrders ¶
type OpenOrders []struct { ID int `json:"id"` CurrencyPairID int `json:"currency_pair_id"` CurrencyPairName string `json:"currency_pair_name"` Price string `json:"price"` TriggerPrice float64 `json:"trigger_price"` InitialAmount string `json:"initial_amount"` ProcessedAmount string `json:"processed_amount"` Type string `json:"type"` OriginalType string `json:"original_type"` Created string `json:"created"` Timestamp string `json:"timestamp"` Status string `json:"status"` }
type OrderBook ¶
type OrderBook struct { Ask []struct { CurrencyPairID int `json:"currency_pair_id"` Amount string `json:"amount"` Price string `json:"price"` Amount2 string `json:"amount2"` Count int `json:"count"` CumulativeAmount float64 `json:"cumulative_amount"` } `json:"ask"` Bid []struct { CurrencyPairID int `json:"currency_pair_id"` Amount string `json:"amount"` Price string `json:"price"` Amount2 string `json:"amount2"` Count int `json:"count"` CumulativeAmount float64 `json:"cumulative_amount"` } `json:"bid"` }
type PairsData ¶
type PairsData []struct { ID int `json:"id"` CurrencyID int `json:"currency_id"` CurrencyCode string `json:"currency_code"` CurrencyName string `json:"currency_name"` MarketCurrencyID int `json:"market_currency_id"` MarketCode string `json:"market_code"` MarketName string `json:"market_name"` MinOrderAmount string `json:"min_order_amount"` MinBuyPrice string `json:"min_buy_price"` MinSellPrice string `json:"min_sell_price"` BuyFeePercent string `json:"buy_fee_percent"` SellFeePercent string `json:"sell_fee_percent"` Active bool `json:"active"` Delisted bool `json:"delisted"` PairMessage string `json:"pair_message"` CurrencyPrecision int `json:"currency_precision"` MarketPrecision int `json:"market_precision"` Symbol string `json:"symbol"` GroupName string `json:"group_name"` GroupID int `json:"group_id"` }
type PlaceOrder ¶
type PlaceOrder struct { ID int `json:"id"` CurrencyPairID int `json:"currency_pair_id"` Price string `json:"price"` TriggerPrice float64 `json:"trigger_price"` InitialAmount string `json:"initial_amount"` ProcessedAmount string `json:"processed_amount"` Type string `json:"type"` OriginalType string `json:"original_type"` Created string `json:"created"` Timestamp interface{} `json:"timestamp"` Status string `json:"status"` }
type Stex ¶
type Stex struct { ID int Name string `bson:"name"` Website string `bson:"website"` API_KEY string API_SECRET string ExpireTS int64 Source exchange.DataSource // / exchange API / microservicve api 1 / PSQL SourceURI string }
func CreateStex ¶
*************************************************
func (*Stex) ApiKeyGet ¶
************** 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 (*Stex) ApiKeyRequest ¶
func (*Stex) CancelAllOrder ¶
func (*Stex) DeleteCoin ¶
func (*Stex) DeletePair ¶
func (*Stex) DoAccountOperation ¶
func (e *Stex) DoAccountOperation(operation *exchange.AccountOperation) error
func (*Stex) GetCoinConstraint ¶
func (e *Stex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Stex) 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(strRequestUrl)
func (*Stex) GetConstraintFetchMethod ¶
func (e *Stex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Stex) GetName ¶
func (e *Stex) GetName() exchange.ExchangeName
func (*Stex) GetPairConstraint ¶
func (e *Stex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Stex) 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 (*Stex) LoadPublicData ¶
func (e *Stex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Stex) 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.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 (*Stex) SetCoinConstraint ¶
func (e *Stex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Stex) SetPairConstraint ¶
func (e *Stex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Stex) UpdateAllBalances ¶
func (e *Stex) UpdateAllBalances()
func (*Stex) UpdateConstraint ¶
func (e *Stex) UpdateConstraint()
type TradeHistory ¶
type WalletDetails ¶
type WalletDetails []struct { ID int `json:"id"` CurrencyID int `json:"currency_id"` Delisted bool `json:"delisted"` Disabled bool `json:"disabled"` DisableDeposits bool `json:"disable_deposits"` CurrencyCode string `json:"currency_code"` Balance string `json:"balance"` FrozenBalance string `json:"frozen_balance"` BonusBalance string `json:"bonus_balance"` }
type WebOrderBook ¶
type WithdrawResult ¶
type WithdrawResult struct { ID int `json:"id"` Amount string `json:"amount"` CurrencyID int `json:"currency_id"` CurrencyCode string `json:"currency_code"` Fee string `json:"fee"` FeeCurrencyID int `json:"fee_currency_id"` FeeCurrencyCode string `json:"fee_currency_code"` Status string `json:"status"` CreatedAt string `json:"created_at"` CreatedTs string `json:"created_ts"` UpdatedAt string `json:"updated_at"` UpdatedTs string `json:"updated_ts"` Txid interface{} `json:"txid"` WithdrawalAddress struct { Address string `json:"address"` AddressName string `json:"address_name"` AdditionalAddressParameter string `json:"additional_address_parameter"` AdditionalAddressParameterName string `json:"additional_address_parameter_name"` } `json:"withdrawal_address"` }