Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CoinsData
- type JsonResponse
- type Latoken
- func (e *Latoken) ApiKeyGET(strRequestPath string, mapParams map[string]string) string
- func (e *Latoken) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Latoken) ApiKeyRequestV2(strMethod, strRequestPath string, mapParams map[string]string) string
- func (e *Latoken) CanDeposit(coin *coin.Coin) bool
- func (e *Latoken) CanWithdraw(coin *coin.Coin) bool
- func (e *Latoken) CancelAllOrder() error
- func (e *Latoken) CancelOrder(order *exchange.Order) error
- func (e *Latoken) DeleteCoin(coin *coin.Coin)
- func (e *Latoken) DeletePair(pair *pair.Pair)
- func (e *Latoken) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Latoken) GetBalance(coin *coin.Coin) float64
- func (e *Latoken) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Latoken) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Latoken) GetCoins() []*coin.Coin
- func (e *Latoken) GetCoinsData() error
- func (e *Latoken) GetConfirmation(coin *coin.Coin) int
- func (e *Latoken) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Latoken) GetFee(pair *pair.Pair) float64
- func (e *Latoken) GetID() int
- func (e *Latoken) GetLotSize(pair *pair.Pair) float64
- func (e *Latoken) GetName() exchange.ExchangeName
- func (e *Latoken) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Latoken) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Latoken) GetPairs() []*pair.Pair
- func (e *Latoken) GetPairsData() error
- func (e *Latoken) GetPriceFilter(pair *pair.Pair) float64
- func (e *Latoken) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Latoken) GetSymbolByPair(pair *pair.Pair) string
- func (e *Latoken) GetTradingWebURL(pair *pair.Pair) string
- func (e *Latoken) GetTxFee(coin *coin.Coin) float64
- func (e *Latoken) HasPair(pair *pair.Pair) bool
- func (e *Latoken) InitData() error
- func (e *Latoken) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Latoken) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Latoken) ListOrders() ([]*exchange.Order, error)
- func (e *Latoken) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Latoken) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Latoken) OrderStatus(order *exchange.Order) error
- func (e *Latoken) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Latoken) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Latoken) UpdateAllBalances()
- func (e *Latoken) UpdateConstraint()
- func (e *Latoken) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type TestBuy
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 49 DEFAULT_TAKER_FEE = 0.001 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL string = "https://api.latoken.com"
)
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 Latoken ¶
type Latoken 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 CreateLatoken ¶
*************************************************
func (*Latoken) 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 (*Latoken) ApiKeyRequest ¶
func (*Latoken) ApiKeyRequestV2 ¶
func (*Latoken) CancelAllOrder ¶
func (*Latoken) DeleteCoin ¶
func (*Latoken) DeletePair ¶
func (*Latoken) DoAccountOperation ¶
func (e *Latoken) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Latoken) GetCoinConstraint ¶
func (e *Latoken) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Latoken) 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 (*Latoken) GetConstraintFetchMethod ¶
func (e *Latoken) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Latoken) GetName ¶
func (e *Latoken) GetName() exchange.ExchangeName
func (*Latoken) GetPairConstraint ¶
func (e *Latoken) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Latoken) 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 (*Latoken) LoadPublicData ¶
func (e *Latoken) LoadPublicData(operation *exchange.PublicOperation) error
************** Public API **************
func (*Latoken) 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 (*Latoken) SetCoinConstraint ¶
func (e *Latoken) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Latoken) SetPairConstraint ¶
func (e *Latoken) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Latoken) UpdateAllBalances ¶
func (e *Latoken) UpdateAllBalances()
func (*Latoken) UpdateConstraint ¶
func (e *Latoken) UpdateConstraint()
type OrderBook ¶
type OrderBook struct { PairID string `json:"pairId"` Symbol string `json:"symbol"` Spread float64 `json:"spread"` Asks []struct { Price float64 `json:"price"` Amount float64 `json:"amount"` } `json:"asks"` Bids []struct { Price float64 `json:"price"` Amount float64 `json:"amount"` } `json:"bids"` }
type OrderStatus ¶
type OrderStatus struct { OrderID string `json:"orderId"` CliOrdID string `json:"cliOrdId"` PairID int `json:"pairId"` Symbol string `json:"symbol"` Side string `json:"side"` OrderType string `json:"orderType"` Price float64 `json:"price"` Amount float64 `json:"amount"` OrderStatus string `json:"orderStatus"` ExecutedAmount float64 `json:"executedAmount"` ReaminingAmount float64 `json:"reaminingAmount"` TimeCreated int64 `json:"timeCreated"` TimeFilled int `json:"timeFilled"` }
type PairsData ¶
type PairsData []struct { PairID int `json:"pairId"` Symbol string `json:"symbol"` BaseCurrency string `json:"baseCurrency"` QuotedCurrency string `json:"quotedCurrency"` MakerFee float64 `json:"makerFee"` TakerFee float64 `json:"takerFee"` PricePrecision int `json:"pricePrecision"` AmountPrecision int `json:"amountPrecision"` MinQty float64 `json:"minQty"` }
type PlaceOrder ¶
type WithdrawResponse ¶
type WithdrawResponse struct { WithdrawalID string `json:"withdrawalId"` CodeRequired bool `json:"codeRequired"` Transaction struct { ID string `json:"id"` Status string `json:"status"` Type string `json:"type"` SenderAddress string `json:"senderAddress"` RecipientAddress string `json:"recipientAddress"` Amount string `json:"amount"` Timestamp int64 `json:"timestamp"` TransactionHash string `json:"transactionHash"` BlockHeight int `json:"blockHeight"` Currency string `json:"currency"` RejectReason string `json:"rejectReason"` Memo string `json:"memo"` PaymentProvider string `json:"paymentProvider"` RequiresCode bool `json:"requiresCode"` } `json:"transaction"` }