Documentation ¶
Index ¶
- Constants
- func ComputeMD5(mapParams map[string]string, strSecret string) string
- type AccountBalances
- type CancelOrders
- type CoinsData
- type Lbank
- func (e *Lbank) ApiKeyPost(strRequestPath string, mapParams map[string]string) string
- func (e *Lbank) CanDeposit(coin *coin.Coin) bool
- func (e *Lbank) CanWithdraw(coin *coin.Coin) bool
- func (e *Lbank) CancelAllOrder() error
- func (e *Lbank) CancelOrder(order *exchange.Order) error
- func (e *Lbank) DeleteCoin(coin *coin.Coin)
- func (e *Lbank) DeletePair(pair *pair.Pair)
- func (e *Lbank) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Lbank) GetBalance(coin *coin.Coin) float64
- func (e *Lbank) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Lbank) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Lbank) GetCoins() []*coin.Coin
- func (e *Lbank) GetCoinsData() error
- func (e *Lbank) GetConfirmation(coin *coin.Coin) int
- func (e *Lbank) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Lbank) GetFee(pair *pair.Pair) float64
- func (e *Lbank) GetID() int
- func (e *Lbank) GetLotSize(pair *pair.Pair) float64
- func (e *Lbank) GetName() exchange.ExchangeName
- func (e *Lbank) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Lbank) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Lbank) GetPairs() []*pair.Pair
- func (e *Lbank) GetPairsData() error
- func (e *Lbank) GetPriceFilter(pair *pair.Pair) float64
- func (e *Lbank) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Lbank) GetSymbolByPair(pair *pair.Pair) string
- func (e *Lbank) GetTradingWebURL(pair *pair.Pair) string
- func (e *Lbank) GetTxFee(coin *coin.Coin) float64
- func (e *Lbank) HasPair(pair *pair.Pair) bool
- func (e *Lbank) InitData() error
- func (e *Lbank) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Lbank) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Lbank) ListOrders() ([]*exchange.Order, error)
- func (e *Lbank) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Lbank) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Lbank) OrderStatus(order *exchange.Order) error
- func (e *Lbank) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Lbank) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Lbank) UpdateAllBalances()
- func (e *Lbank) UpdateConstraint()
- func (e *Lbank) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type Withdraw
Constants ¶
const ( DEFAULT_ID = 34 DEFAULT_TAKER_FEE = 0.001 DEFAULT_MAKER_FEE = 0.001 DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://www.lbkex.net" //"https://api.lbkex.com"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountBalances ¶
type CancelOrders ¶
type CoinsData ¶
type CoinsData struct { Result string `json:"result"` Data []struct { AmountScale string `json:"amountScale"` AssetCode string `json:"assetCode"` CanWithDraw bool `json:"canWithDraw"` Fee string `json:"fee"` Type string `json:"type"` Min string `json:"min,omitempty"` } `json:"data"` ErrorCode int `json:"error_code"` Ts int64 `json:"ts"` }
v2
type Lbank ¶
type Lbank 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 CreateLbank ¶
*************************************************
func (*Lbank) ApiKeyPost ¶
************** 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 (*Lbank) CancelAllOrder ¶
func (*Lbank) DeleteCoin ¶
func (*Lbank) DeletePair ¶
func (*Lbank) DoAccountOperation ¶
func (e *Lbank) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Lbank) GetCoinConstraint ¶
func (e *Lbank) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Lbank) 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 (*Lbank) GetConstraintFetchMethod ¶
func (e *Lbank) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Lbank) GetName ¶
func (e *Lbank) GetName() exchange.ExchangeName
func (*Lbank) GetPairConstraint ¶
func (e *Lbank) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Lbank) 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 (*Lbank) LoadPublicData ¶
func (e *Lbank) LoadPublicData(operation *exchange.PublicOperation) error
func (*Lbank) 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 (*Lbank) SetCoinConstraint ¶
func (e *Lbank) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Lbank) SetPairConstraint ¶
func (e *Lbank) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Lbank) UpdateAllBalances ¶
func (e *Lbank) UpdateAllBalances()
func (*Lbank) UpdateConstraint ¶
func (e *Lbank) UpdateConstraint()
type OrderStatus ¶
type OrderStatus struct { Result string `json:"result"` ErrorCode int `json:"error_code"` Orders []struct { Symbol string `json:"symbol"` Amount float64 `json:"amount"` CreateTime int64 `json:"create_time"` Price float64 `json:"price"` CustomID interface{} `json:"custom_id"` AvgPrice float64 `json:"avg_price"` Type string `json:"type"` OrderID string `json:"order_id"` DealAmount float64 `json:"deal_amount"` Status int `json:"status"` } `json:"orders"` }