Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type CancelOrder
- type CoinsData
- type Liquid
- func (e *Liquid) ApiKeyRequest(strMethod string, mapParams map[string]interface{}, strRequestPath string) string
- func (e *Liquid) CanDeposit(coin *coin.Coin) bool
- func (e *Liquid) CanWithdraw(coin *coin.Coin) bool
- func (e *Liquid) CancelAllOrder() error
- func (e *Liquid) CancelOrder(order *exchange.Order) error
- func (e *Liquid) DeleteCoin(coin *coin.Coin)
- func (e *Liquid) DeletePair(pair *pair.Pair)
- func (e *Liquid) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Liquid) GetBalance(coin *coin.Coin) float64
- func (e *Liquid) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Liquid) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Liquid) GetCoins() []*coin.Coin
- func (e *Liquid) GetCoinsData() error
- func (e *Liquid) GetConfirmation(coin *coin.Coin) int
- func (e *Liquid) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Liquid) GetFee(pair *pair.Pair) float64
- func (e *Liquid) GetID() int
- func (e *Liquid) GetLotSize(pair *pair.Pair) float64
- func (e *Liquid) GetName() exchange.ExchangeName
- func (e *Liquid) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Liquid) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Liquid) GetPairs() []*pair.Pair
- func (e *Liquid) GetPairsData() error
- func (e *Liquid) GetPriceFilter(pair *pair.Pair) float64
- func (e *Liquid) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Liquid) GetSymbolByPair(pair *pair.Pair) string
- func (e *Liquid) GetTradingWebURL(pair *pair.Pair) string
- func (e *Liquid) GetTxFee(coin *coin.Coin) float64
- func (e *Liquid) HasPair(pair *pair.Pair) bool
- func (e *Liquid) InitData() error
- func (e *Liquid) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Liquid) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Liquid) ListOrders() ([]*exchange.Order, error)
- func (e *Liquid) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Liquid) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Liquid) OrderStatus(order *exchange.Order) error
- func (e *Liquid) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Liquid) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Liquid) UpdateAllBalances()
- func (e *Liquid) UpdateConstraint()
- func (e *Liquid) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type OrderBook
- type OrderStatus
- type PairsData
- type PlaceOrder
- type TradeHistory
- type Withdraw
Constants ¶
const ( DEFAULT_ID = 21 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 string = "https://api.liquid.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type CancelOrder ¶
type CoinsData ¶
type CoinsData []struct { CurrencyType string `json:"currency_type"` Currency string `json:"currency"` Symbol string `json:"symbol"` AssetsPrecision int `json:"assets_precision"` QuotingPrecision int `json:"quoting_precision"` MinimumWithdrawal float64 `json:"minimum_withdrawal"` WithdrawalFee float64 `json:"withdrawal_fee"` MinimumFee interface{} `json:"minimum_fee"` MinimumOrderQuantity interface{} `json:"minimum_order_quantity"` DisplayPrecision int `json:"display_precision"` Depositable bool `json:"depositable"` Withdrawable bool `json:"withdrawable"` DiscountFee float64 `json:"discount_fee"` CreditCardFundable bool `json:"credit_card_fundable,omitempty"` Lendable bool `json:"lendable"` PositionFundable bool `json:"position_fundable"` }
type Liquid ¶
type Liquid 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 CreateLiquid ¶
*************************************************
func (*Liquid) ApiKeyRequest ¶
func (e *Liquid) ApiKeyRequest(strMethod string, mapParams map[string]interface{}, strRequestPath string) string
************** 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 (*Liquid) CancelAllOrder ¶
func (*Liquid) DeleteCoin ¶
func (*Liquid) DeletePair ¶
func (*Liquid) DoAccountOperation ¶
func (e *Liquid) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Liquid) GetCoinConstraint ¶
func (e *Liquid) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Liquid) 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 (*Liquid) GetConstraintFetchMethod ¶
func (e *Liquid) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Liquid) GetName ¶
func (e *Liquid) GetName() exchange.ExchangeName
func (*Liquid) GetPairConstraint ¶
func (e *Liquid) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Liquid) 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 (*Liquid) LoadPublicData ¶
func (e *Liquid) LoadPublicData(operation *exchange.PublicOperation) error
************** PUBLIC API **************
func (*Liquid) 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 (*Liquid) SetCoinConstraint ¶
func (e *Liquid) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Liquid) SetPairConstraint ¶
func (e *Liquid) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Liquid) UpdateAllBalances ¶
func (e *Liquid) UpdateAllBalances()
func (*Liquid) UpdateConstraint ¶
func (e *Liquid) UpdateConstraint()
type OrderStatus ¶
type OrderStatus struct { ID int `json:"id"` OrderType string `json:"order_type"` Quantity string `json:"quantity"` DiscQuantity string `json:"disc_quantity"` IcebergTotalQuantity string `json:"iceberg_total_quantity"` Side string `json:"side"` FilledQuantity string `json:"filled_quantity"` Price float64 `json:"price"` CreatedAt int `json:"created_at"` UpdatedAt int `json:"updated_at"` Status string `json:"status"` LeverageLevel int `json:"leverage_level"` SourceExchange string `json:"source_exchange"` ProductID int `json:"product_id"` ProductCode string `json:"product_code"` FundingCurrency string `json:"funding_currency"` CryptoAccountID interface{} `json:"crypto_account_id"` CurrencyPairCode string `json:"currency_pair_code"` AveragePrice float64 `json:"average_price"` Target string `json:"target"` OrderFee string `json:"order_fee"` SourceAction string `json:"source_action"` UnwoundTradeID interface{} `json:"unwound_trade_id"` TradeID interface{} `json:"trade_id"` }
type PairsData ¶
type PairsData []struct { ID string `json:"id"` ProductType string `json:"product_type"` Code string `json:"code"` Name string `json:"name"` MarketAsk float64 `json:"market_ask"` MarketBid float64 `json:"market_bid"` Indicator int `json:"indicator"` Currency string `json:"currency"` CurrencyPairCode string `json:"currency_pair_code"` Symbol string `json:"symbol"` BtcMinimumWithdraw interface{} `json:"btc_minimum_withdraw"` FiatMinimumWithdraw interface{} `json:"fiat_minimum_withdraw"` PusherChannel string `json:"pusher_channel"` TakerFee string `json:"taker_fee"` MakerFee string `json:"maker_fee"` LowMarketBid string `json:"low_market_bid"` HighMarketAsk string `json:"high_market_ask"` Volume24H string `json:"volume_24h"` LastPrice24H interface{} `json:"last_price_24h"` LastTradedPrice interface{} `json:"last_traded_price"` LastTradedQuantity interface{} `json:"last_traded_quantity"` QuotedCurrency string `json:"quoted_currency"` BaseCurrency string `json:"base_currency"` Disabled bool `json:"disabled"` MarginEnabled bool `json:"margin_enabled"` CfdEnabled bool `json:"cfd_enabled"` LastEventTimestamp interface{} `json:"last_event_timestamp"` }
type PlaceOrder ¶
type PlaceOrder struct { ID int `json:"id"` OrderType string `json:"order_type"` Quantity string `json:"quantity"` DiscQuantity string `json:"disc_quantity"` IcebergTotalQuantity string `json:"iceberg_total_quantity"` Side string `json:"side"` FilledQuantity string `json:"filled_quantity"` Price float64 `json:"price"` CreatedAt int `json:"created_at"` UpdatedAt int `json:"updated_at"` Status string `json:"status"` LeverageLevel int `json:"leverage_level"` SourceExchange string `json:"source_exchange"` ProductID int `json:"product_id"` ProductCode string `json:"product_code"` FundingCurrency string `json:"funding_currency"` CryptoAccountID interface{} `json:"crypto_account_id"` CurrencyPairCode string `json:"currency_pair_code"` AveragePrice float64 `json:"average_price"` Target string `json:"target"` OrderFee float64 `json:"order_fee"` SourceAction string `json:"source_action"` UnwoundTradeID interface{} `json:"unwound_trade_id"` TradeID interface{} `json:"trade_id"` }
type TradeHistory ¶
type Withdraw ¶
type Withdraw struct { ID int `json:"id"` Address string `json:"address"` Amount string `json:"amount"` State string `json:"state"` Currency string `json:"currency"` WithdrawalFee string `json:"withdrawal_fee"` CreatedAt int `json:"created_at"` UpdatedAt int `json:"updated_at"` PaymentID interface{} `json:"payment_id"` }