biki

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: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DEFAULT_ID           = 38
	DEFAULT_TAKER_FEE    = 0.0015
	DEFAULT_MAKER_FEE    = 0.0015
	DEFAULT_TXFEE        = 0.005
	DEFAULT_WITHDRAW     = true
	DEFAULT_DEPOSIT      = true
	DEFAULT_CONFIRMATION = 2
	DEFAULT_LISTED       = true
)
View Source
const (
	API_URL string = "https://api.biki.com"
)

Variables

This section is empty.

Functions

func MapSortByKey

func MapSortByKey(mapValue map[string]string) string

Types

type AccountBalances

type AccountBalances struct {
	TotalAsset string `json:"total_asset"`
	CoinList   []struct {
		Normal      string `json:"normal"`
		BtcValuatin string `json:"btcValuatin"`
		Locked      string `json:"locked"`
		Coin        string `json:"coin"`
	} `json:"coin_list"`
}

type Biki

type Biki 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 CreateBiki

func CreateBiki(config *exchange.Config) *Biki

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

func (*Biki) ApiKeyGet

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

func (e *Biki) ApiKeyPost(strRequestPath string, mapParams map[string]string) string

func (*Biki) CanDeposit

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

func (*Biki) CanWithdraw

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

func (*Biki) CancelAllOrder

func (e *Biki) CancelAllOrder() error

func (*Biki) CancelOrder

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

func (*Biki) DeleteCoin

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

func (*Biki) DeletePair

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

func (*Biki) DoAccountOperation

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

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

func (*Biki) GetBalance

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

func (*Biki) GetCoinBySymbol

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

func (*Biki) GetCoinConstraint

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

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

func (*Biki) GetCoins

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

func (*Biki) GetCoinsData

func (e *Biki) 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 (*Biki) GetConfirmation

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

func (*Biki) GetConstraintFetchMethod

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

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

func (*Biki) GetFee

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

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

func (*Biki) GetID

func (e *Biki) GetID() int

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

func (*Biki) GetLotSize

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

func (*Biki) GetName

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

func (*Biki) GetPairBySymbol

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

func (*Biki) GetPairConstraint

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

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

func (*Biki) GetPairs

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

func (*Biki) GetPairsData

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

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

func (*Biki) GetSymbolByCoin

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

func (*Biki) GetSymbolByPair

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

func (*Biki) GetTradingWebURL

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

func (*Biki) GetTxFee

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

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

func (*Biki) HasPair

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

func (*Biki) InitData

func (e *Biki) InitData() error

func (*Biki) LimitBuy

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

func (*Biki) LimitSell

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

func (*Biki) ListOrders

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

func (*Biki) LoadPublicData

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

func (*Biki) OrderBook

func (e *Biki) OrderBook(pair *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 (*Biki) OrderStatus

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

func (*Biki) SetCoinConstraint

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

func (*Biki) SetPairConstraint

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

func (*Biki) UpdateAllBalances

func (e *Biki) UpdateAllBalances()

func (*Biki) UpdateConstraint

func (e *Biki) UpdateConstraint()

func (*Biki) Withdraw

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

type JsonResponse

type JsonResponse struct {
	Code    string          `json:"code"`
	Message string          `json:"msg"`
	Result  json.RawMessage `json:"data"`
}

type OrderBook

type OrderBook struct {
	Tick struct {
		Asks [][]float64 `json:"asks"`
		Bids [][]float64 `json:"bids"`
		Time interface{} `json:"time"`
	} `json:"tick"`
}

type OrderStatus

type OrderStatus struct {
	TradeList []interface{} `json:"trade_list"`
	OrderInfo struct {
		Side         string        `json:"side"`
		TotalPrice   string        `json:"total_price"`
		Fee          float64       `json:"fee"`
		CreatedAt    int64         `json:"created_at"`
		DealPrice    float64       `json:"deal_price"`
		AvgPrice     string        `json:"avg_price"`
		CountCoin    string        `json:"countCoin"`
		Source       int           `json:"source"`
		Type         int           `json:"type"`
		SideMsg      string        `json:"side_msg"`
		Volume       string        `json:"volume"`
		Price        string        `json:"price"`
		SourceMsg    string        `json:"source_msg"`
		StatusMsg    string        `json:"status_msg"`
		DealVolume   string        `json:"deal_volume"`
		FeeCoin      string        `json:"fee_coin"`
		ID           int           `json:"id"`
		RemainVolume string        `json:"remain_volume"`
		BaseCoin     string        `json:"baseCoin"`
		TradeList    []interface{} `json:"tradeList"`
		Status       int           `json:"status"`
	} `json:"order_info"`
}

type PairsData

type PairsData []struct {
	Symbol          string `json:"symbol"`
	CountCoin       string `json:"count_coin"`
	AmountPrecision int    `json:"amount_precision"`
	BaseCoin        string `json:"base_coin"`
	PricePrecision  int    `json:"price_precision"`
}

type PlaceOrder

type PlaceOrder struct {
	OrderID int `json:"order_id"`
}

Jump to

Keyboard shortcuts

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