blank

package
v0.0.0-...-5439e55 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_ID           = 0
	DEFAULT_TAKER_FEE    = 0.002
	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
)
View Source
const (
	API_URL = "API End-point URL"
)

The Base Endpoint URL

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalances

type AccountBalances []struct {
	Asset     string  `json:"asset"`
	Total     float64 `json:"total"`
	Available float64 `json:"available"`
	Locked    float64 `json:"locked"`
}

********* Private API Structure*********

type Blank

type Blank 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 CreateBlank

func CreateBlank(config *exchange.Config) *Blank

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

func (*Blank) ApiKeyGet

func (e *Blank) ApiKeyGet(strRequestPath string, mapParams map[string]string) string

************** Signature Http Request ************** Method: API Get 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 (*Blank) ApiKeyRequest

func (e *Blank) ApiKeyRequest(strMethod, strRequestPath string, mapParams map[string]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

func (*Blank) CanDeposit

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

func (*Blank) CanWithdraw

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

func (*Blank) CancelAllOrder

func (e *Blank) CancelAllOrder() error

func (*Blank) CancelOrder

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

func (*Blank) DeleteCoin

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

func (*Blank) DeletePair

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

func (*Blank) DoAccountOperation

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

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

func (*Blank) GetBalance

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

func (*Blank) GetCoinBySymbol

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

func (*Blank) GetCoinConstraint

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

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

func (*Blank) GetCoins

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

func (*Blank) GetCoinsData

func (e *Blank) 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(strRequestPath)

func (*Blank) GetConfirmation

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

func (*Blank) GetConstraintFetchMethod

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

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

func (*Blank) GetFee

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

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

func (*Blank) GetID

func (e *Blank) GetID() int

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

func (*Blank) GetLotSize

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

func (*Blank) GetName

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

func (*Blank) GetPairBySymbol

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

func (*Blank) GetPairConstraint

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

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

func (*Blank) GetPairs

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

func (*Blank) GetPairsData

func (e *Blank) 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 (*Blank) GetPriceFilter

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

func (*Blank) GetSymbolByCoin

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

func (*Blank) GetSymbolByPair

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

func (*Blank) GetTradingWebURL

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

func (*Blank) GetTxFee

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

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

func (*Blank) HasPair

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

func (*Blank) InitData

func (e *Blank) InitData() error

func (*Blank) LimitBuy

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

func (*Blank) LimitSell

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

func (*Blank) ListOrders

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

func (*Blank) LoadPublicData

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

func (*Blank) OrderBook

func (e *Blank) 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.GetSymbolByPair(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 (*Blank) OrderStatus

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

func (*Blank) SetCoinConstraint

func (e *Blank) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)

func (*Blank) SetPairConstraint

func (e *Blank) SetPairConstraint(pairConstraint *exchange.PairConstraint)

func (*Blank) UpdateAllBalances

func (e *Blank) UpdateAllBalances()

func (*Blank) UpdateConstraint

func (e *Blank) UpdateConstraint()

func (*Blank) Withdraw

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

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

type CoinsData

type CoinsData []struct {
	ID             string  `json:"id"`
	AssetCode      string  `json:"assetCode"`
	AssetName      string  `json:"assetName"`
	Website        string  `json:"website"`
	BlockURL       string  `json:"blockUrl"`
	TransactionFee float64 `json:"transactionFee"`
	EnableCharge   bool    `json:"enableCharge"`
	EnableWithdraw bool    `json:"enableWithdraw"`
	Confirmations  int     `json:"confirmations"`
	Delisted       bool    `json:"delisted"`
}

********* Public API Structure*********

type JsonResponse

type JsonResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data"`
}

type OrderBook

type OrderBook struct {
	Bids [][]float64 `json:"bids"`
	Asks [][]float64 `json:"asks"`
}

type PairsData

type PairsData []struct {
	Symbol      string  `json:"symbol"`
	Status      string  `json:"status"`
	BaseAsset   string  `json:"baseAsset"`
	QuoteAsset  string  `json:"quoteAsset"`
	MakerFee    float64 `json:"makerFee"`
	TakerFee    float64 `json:"takerFee"`
	PriceFilter float64 `json:"priceFilter"`
	LotSize     float64 `json:"lotSize"`
}

type PlaceOrder

type PlaceOrder struct {
	Symbol       string `json:"symbol"`
	OrderID      string `json:"orderId"`
	Side         string `json:"side"`
	Type         string `json:"type"`
	Price        string `json:"price"`
	AveragePrice string `json:"executedQty"`
	OrigQty      string `json:"origQty"`
	ExecutedQty  string `json:"executedQty"`
	Status       string `json:"status"`
	TimeInForce  string `json:"timeInForce"`
}

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