Documentation ¶
Index ¶
- Constants
- func Sort(slice interface{}, less func(i, j int) bool)
- type AccountBalances
- type CoinsData
- type OrderBook
- type PairsData
- type PlaceOrder
- type Probit
- func (e *Probit) ApiKeyGet(mapParams map[string]string, strRequestPath string) string
- func (e *Probit) ApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
- func (e *Probit) CanDeposit(coin *coin.Coin) bool
- func (e *Probit) CanWithdraw(coin *coin.Coin) bool
- func (e *Probit) CancelAllOrder() error
- func (e *Probit) CancelOrder(order *exchange.Order) error
- func (e *Probit) DeleteCoin(coin *coin.Coin)
- func (e *Probit) DeletePair(pair *pair.Pair)
- func (e *Probit) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Probit) GetBalance(coin *coin.Coin) float64
- func (e *Probit) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Probit) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Probit) GetCoins() []*coin.Coin
- func (e *Probit) GetCoinsData() error
- func (e *Probit) GetConfirmation(coin *coin.Coin) int
- func (e *Probit) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Probit) GetFee(pair *pair.Pair) float64
- func (e *Probit) GetID() int
- func (e *Probit) GetLotSize(pair *pair.Pair) float64
- func (e *Probit) GetName() exchange.ExchangeName
- func (e *Probit) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Probit) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Probit) GetPairs() []*pair.Pair
- func (e *Probit) GetPairsData() error
- func (e *Probit) GetPriceFilter(pair *pair.Pair) float64
- func (e *Probit) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Probit) GetSymbolByPair(pair *pair.Pair) string
- func (e *Probit) GetTradingWebURL(pair *pair.Pair) string
- func (e *Probit) GetTxFee(coin *coin.Coin) float64
- func (e *Probit) HasPair(pair *pair.Pair) bool
- func (e *Probit) InitData() error
- func (e *Probit) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Probit) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Probit) ListOrders() ([]*exchange.Order, error)
- func (e *Probit) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Probit) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Probit) OrderStatus(order *exchange.Order) error
- func (e *Probit) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Probit) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Probit) UpdateAllBalances()
- func (e *Probit) UpdateConstraint()
- func (e *Probit) WApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
- func (e *Probit) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 64 DEFAULT_TAKER_FEE = 0.001 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 //PRICE FILTER DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL = "https://api.probit.com/api/exchange/v1"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountBalances ¶
type AccountBalances struct { MakerCommission int `json:"makerCommission"` TakerCommission int `json:"takerCommission"` BuyerCommission int `json:"buyerCommission"` SellerCommission int `json:"sellerCommission"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` CanDeposit bool `json:"canDeposit"` Balances []struct { Asset string `json:"asset"` Free string `json:"free"` Locked string `json:"locked"` } `json:"balances"` }
type CoinsData ¶
type CoinsData struct { Data []struct { ID string `json:"id"` Name string `json:"name"` DisplayName struct { KoKr string `json:"ko-kr"` } `json:"display_name"` Platform string `json:"platform"` Precision int `json:"precision"` DisplayPrecision int `json:"display_precision"` MinConfirmationCount int `json:"min_confirmation_count"` MinWithdrawalAmount string `json:"min_withdrawal_amount"` WithdrawalFee string `json:"withdrawal_fee"` DepositSuspended bool `json:"deposit_suspended"` WithdrawalSuspended bool `json:"withdrawal_suspended"` InternalPrecision int `json:"internal_precision"` ShowInUI bool `json:"show_in_ui"` SuspendedReason string `json:"suspended_reason"` MinDepositAmount string `json:"min_deposit_amount"` } `json:"data"` }
type PairsData ¶
type PairsData struct { Data []struct { ID string `json:"id"` BaseCurrencyID string `json:"base_currency_id"` QuoteCurrencyID string `json:"quote_currency_id"` MinPrice string `json:"min_price"` MaxPrice string `json:"max_price"` PriceIncrement string `json:"price_increment"` MinQuantity string `json:"min_quantity"` MaxQuantity string `json:"max_quantity"` QuantityPrecision int `json:"quantity_precision"` MinCost string `json:"min_cost"` MaxCost string `json:"max_cost"` CostPrecision int `json:"cost_precision"` TakerFeeRate string `json:"taker_fee_rate"` MakerFeeRate string `json:"maker_fee_rate"` ShowInUI bool `json:"show_in_ui"` Closed bool `json:"closed"` } `json:"data"` }
type PlaceOrder ¶
type PlaceOrder struct { Symbol string `json:"symbol"` OrderID int `json:"orderId"` ClientOrderID string `json:"clientOrderId"` TransactTime int64 `json:"transactTime"` Price string `json:"price"` OrigQty string `json:"origQty"` ExecutedQty string `json:"executedQty"` Status string `json:"status"` TimeInForce string `json:"timeInForce"` Type string `json:"type"` Side string `json:"side"` StopPrice string `json:"stopPrice"` IcebergQty string `json:"icebergQty"` Time int64 `json:"time"` Code int `json:"code"` Msg string `json:"msg"` }
type Probit ¶
type Probit 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 CreateProbit ¶
*************************************************
func (*Probit) 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 (*Probit) ApiKeyRequest ¶
func (e *Probit) ApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
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 (*Probit) CancelAllOrder ¶
func (*Probit) DeleteCoin ¶
func (*Probit) DeletePair ¶
func (*Probit) DoAccountOperation ¶
func (e *Probit) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Probit) GetCoinConstraint ¶
func (e *Probit) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Probit) 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 (*Probit) GetConstraintFetchMethod ¶
func (e *Probit) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Probit) GetName ¶
func (e *Probit) GetName() exchange.ExchangeName
func (*Probit) GetPairConstraint ¶
func (e *Probit) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Probit) 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 (*Probit) LoadPublicData ¶
func (e *Probit) LoadPublicData(operation *exchange.PublicOperation) error
func (*Probit) 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 (*Probit) SetCoinConstraint ¶
func (e *Probit) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Probit) SetPairConstraint ¶
func (e *Probit) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Probit) UpdateAllBalances ¶
func (e *Probit) UpdateAllBalances()
func (*Probit) UpdateConstraint ¶
func (e *Probit) UpdateConstraint()
func (*Probit) WApiKeyRequest ¶
func (e *Probit) WApiKeyRequest(strMethod string, mapParams map[string]string, strRequestPath string) string
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