probit

package
v0.0.0-...-db5ea55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
const (
	API_URL = "https://api.probit.com/api/exchange/v1"
)

The Base Endpoint URL

Variables

This section is empty.

Functions

func Sort

func Sort(slice interface{}, less func(i, j int) bool)

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 OrderBook

type OrderBook struct {
	Data []struct {
		Side     string `json:"side"`
		Price    string `json:"price"`
		Quantity string `json:"quantity"`
	} `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 CreateProbit(config *exchange.Config) *Probit

*************************************************

func (*Probit) ApiKeyGet

func (e *Probit) ApiKeyGet(mapParams map[string]string, 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 (*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) CanDeposit

func (e *Probit) CanDeposit(coin *coin.Coin) bool

func (*Probit) CanWithdraw

func (e *Probit) CanWithdraw(coin *coin.Coin) bool

func (*Probit) CancelAllOrder

func (e *Probit) CancelAllOrder() error

func (*Probit) CancelOrder

func (e *Probit) CancelOrder(order *exchange.Order) error

func (*Probit) DeleteCoin

func (e *Probit) DeleteCoin(coin *coin.Coin)

func (*Probit) DeletePair

func (e *Probit) DeletePair(pair *pair.Pair)

func (*Probit) DoAccountOperation

func (e *Probit) DoAccountOperation(operation *exchange.AccountOperation) error

************** Private API **************

func (*Probit) GetBalance

func (e *Probit) GetBalance(coin *coin.Coin) float64

func (*Probit) GetCoinBySymbol

func (e *Probit) GetCoinBySymbol(symbol string) *coin.Coin

func (*Probit) GetCoinConstraint

func (e *Probit) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint

************** Coins on the Exchanges **************

func (*Probit) GetCoins

func (e *Probit) GetCoins() []*coin.Coin

func (*Probit) GetCoinsData

func (e *Probit) GetCoinsData() error

************** 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) GetConfirmation

func (e *Probit) GetConfirmation(coin *coin.Coin) int

func (*Probit) GetConstraintFetchMethod

func (e *Probit) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod

*************** Exchange Constraint ***************

func (*Probit) GetFee

func (e *Probit) GetFee(pair *pair.Pair) float64

*************** Pair Constraint ***************

func (*Probit) GetID

func (e *Probit) GetID() int

*************** Exchange Information ***************

func (*Probit) GetLotSize

func (e *Probit) GetLotSize(pair *pair.Pair) float64

func (*Probit) GetName

func (e *Probit) GetName() exchange.ExchangeName

func (*Probit) GetPairBySymbol

func (e *Probit) GetPairBySymbol(symbol string) *pair.Pair

func (*Probit) GetPairConstraint

func (e *Probit) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint

************** Pairs on the Exchanges **************

func (*Probit) GetPairs

func (e *Probit) GetPairs() []*pair.Pair

func (*Probit) GetPairsData

func (e *Probit) GetPairsData() error
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) GetPriceFilter

func (e *Probit) GetPriceFilter(pair *pair.Pair) float64

func (*Probit) GetSymbolByCoin

func (e *Probit) GetSymbolByCoin(coin *coin.Coin) string

func (*Probit) GetSymbolByPair

func (e *Probit) GetSymbolByPair(pair *pair.Pair) string

func (*Probit) GetTradingWebURL

func (e *Probit) GetTradingWebURL(pair *pair.Pair) string

func (*Probit) GetTxFee

func (e *Probit) GetTxFee(coin *coin.Coin) float64

*************** Coin Constraint ***************

func (*Probit) HasPair

func (e *Probit) HasPair(pair *pair.Pair) bool

func (*Probit) InitData

func (e *Probit) InitData() error

func (*Probit) LimitBuy

func (e *Probit) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)

func (*Probit) LimitSell

func (e *Probit) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)

func (*Probit) ListOrders

func (e *Probit) ListOrders() ([]*exchange.Order, error)

func (*Probit) LoadPublicData

func (e *Probit) LoadPublicData(operation *exchange.PublicOperation) error

func (*Probit) OrderBook

func (e *Probit) OrderBook(p *pair.Pair) (*exchange.Maker, error)

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) OrderStatus

func (e *Probit) OrderStatus(order *exchange.Order) error

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

func (*Probit) Withdraw

func (e *Probit) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool

Withdraw(coin *coin.Coin, quantity float64, addr, tag string)

type WithdrawResponse

type WithdrawResponse struct {
	Msg     string `json:"msg"`
	Success bool   `json:"success"`
	ID      string `json:"id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL