Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CoinsData
- type JsonResponse
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type TradeHistory
- type Txbit
- func (e *Txbit) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Txbit) CanDeposit(coin *coin.Coin) bool
- func (e *Txbit) CanWithdraw(coin *coin.Coin) bool
- func (e *Txbit) CancelAllOrder() error
- func (e *Txbit) CancelOrder(order *exchange.Order) error
- func (e *Txbit) DeleteCoin(coin *coin.Coin)
- func (e *Txbit) DeletePair(pair *pair.Pair)
- func (e *Txbit) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Txbit) GetBalance(coin *coin.Coin) float64
- func (e *Txbit) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Txbit) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Txbit) GetCoins() []*coin.Coin
- func (e *Txbit) GetCoinsData() error
- func (e *Txbit) GetConfirmation(coin *coin.Coin) int
- func (e *Txbit) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Txbit) GetFee(pair *pair.Pair) float64
- func (e *Txbit) GetID() int
- func (e *Txbit) GetLotSize(pair *pair.Pair) float64
- func (e *Txbit) GetName() exchange.ExchangeName
- func (e *Txbit) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Txbit) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Txbit) GetPairs() []*pair.Pair
- func (e *Txbit) GetPairsData() error
- func (e *Txbit) GetPriceFilter(pair *pair.Pair) float64
- func (e *Txbit) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Txbit) GetSymbolByPair(pair *pair.Pair) string
- func (e *Txbit) GetTradingWebURL(pair *pair.Pair) string
- func (e *Txbit) GetTxFee(coin *coin.Coin) float64
- func (e *Txbit) HasPair(pair *pair.Pair) bool
- func (e *Txbit) InitData() error
- func (e *Txbit) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Txbit) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Txbit) ListOrders() ([]*exchange.Order, error)
- func (e *Txbit) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Txbit) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Txbit) OrderStatus(order *exchange.Order) error
- func (e *Txbit) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Txbit) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Txbit) UpdateAllBalances()
- func (e *Txbit) UpdateConstraint()
- func (e *Txbit) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type Uuid
Constants ¶
const ( DEFAULT_ID = 63 DEFAULT_TAKER_FEE = 0.0025 // not from website DEFAULT_MAKER_FEE = 0.0025 DEFAULT_LOT_SIZE = 0.0001 DEFAULT_PRICE_FILTER = 0.00000001 DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://api.txbit.io/api"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type JsonResponse ¶
type JsonResponse struct { Success bool `json:"success"` Message string `json:"message"` Result json.RawMessage `json:"result"` }
type OrderStatus ¶
type OrderStatus struct { Type string `json:"Type"` AccountID interface{} `json:"AccountId"` CommissionReserved float64 `json:"CommissionReserved"` CommissionReserveRemaining float64 `json:"CommissionReserveRemaining"` Sentinel interface{} `json:"Sentinel"` IsOpen bool `json:"IsOpen"` OrderUUID string `json:"OrderUuid"` Exchange string `json:"Exchange"` Quantity float64 `json:"Quantity"` QuantityRemaining float64 `json:"QuantityRemaining"` Limit float64 `json:"Limit"` CommissionPaid float64 `json:"CommissionPaid"` Price float64 `json:"Price"` PricePerUnit interface{} `json:"PricePerUnit"` Opened time.Time `json:"Opened"` Closed interface{} `json:"Closed"` CancelInitiated bool `json:"CancelInitiated"` ImmediateOrCancel bool `json:"ImmediateOrCancel"` IsConditional bool `json:"IsConditional"` Condition interface{} `json:"Condition"` ConditionTarget interface{} `json:"ConditionTarget"` }
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 time.Time `json:"Created"` }
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 { Success bool `json:"success"` Message string `json:"message"` Result []struct { ID int `json:"Id"` TimeStamp time.Time `json:"TimeStamp"` Quantity float64 `json:"Quantity"` Price float64 `json:"Price"` Total float64 `json:"Total"` FillType string `json:"FillType"` OrderType string `json:"OrderType"` } `json:"result"` }
type Txbit ¶
type Txbit 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 CreateTxbit ¶
*************************************************
func (*Txbit) 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 (*Txbit) CancelAllOrder ¶
func (*Txbit) DeleteCoin ¶
func (*Txbit) DeletePair ¶
func (*Txbit) DoAccountOperation ¶
func (e *Txbit) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Txbit) GetCoinConstraint ¶
func (e *Txbit) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Txbit) 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 (*Txbit) GetConstraintFetchMethod ¶
func (e *Txbit) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Txbit) GetName ¶
func (e *Txbit) GetName() exchange.ExchangeName
func (*Txbit) GetPairConstraint ¶
func (e *Txbit) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Txbit) 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 (*Txbit) LoadPublicData ¶
func (e *Txbit) LoadPublicData(operation *exchange.PublicOperation) error
************** PUBLIC API **************
func (*Txbit) 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 (*Txbit) SetCoinConstraint ¶
func (e *Txbit) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Txbit) SetPairConstraint ¶
func (e *Txbit) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Txbit) UpdateAllBalances ¶
func (e *Txbit) UpdateAllBalances()
func (*Txbit) UpdateConstraint ¶
func (e *Txbit) UpdateConstraint()