bitbns

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

Documentation

Index

Constants

View Source
const (
	DEFAULT_ID           = 73
	DEFAULT_TAKER_FEE    = 0.0025
	DEFAULT_MAKER_FEE    = 0.0025
	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 = "https://api.bitbns.com"
)

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 Bitbns

type Bitbns 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 CreateBitbns

func CreateBitbns(config *exchange.Config) *Bitbns

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

func (*Bitbns) ApiKeyGet

func (e *Bitbns) 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 (*Bitbns) ApiKeyRequest

func (e *Bitbns) 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 (*Bitbns) CanDeposit

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

func (*Bitbns) CanWithdraw

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

func (*Bitbns) CancelAllOrder

func (e *Bitbns) CancelAllOrder() error

func (*Bitbns) CancelOrder

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

func (*Bitbns) DeleteCoin

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

func (*Bitbns) DeletePair

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

func (*Bitbns) DoAccountOperation

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

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

func (*Bitbns) GetBalance

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

func (*Bitbns) GetCoinBySymbol

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

func (*Bitbns) GetCoinConstraint

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

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

func (*Bitbns) GetCoins

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

func (*Bitbns) GetCoinsData

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

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

func (*Bitbns) GetConstraintFetchMethod

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

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

func (*Bitbns) GetFee

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

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

func (*Bitbns) GetID

func (e *Bitbns) GetID() int

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

func (*Bitbns) GetLotSize

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

func (*Bitbns) GetName

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

func (*Bitbns) GetPairBySymbol

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

func (*Bitbns) GetPairConstraint

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

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

func (*Bitbns) GetPairs

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

func (*Bitbns) GetPairsData

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

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

func (*Bitbns) GetSymbolByCoin

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

func (*Bitbns) GetSymbolByPair

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

func (*Bitbns) GetTradingWebURL

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

func (*Bitbns) GetTxFee

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

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

func (*Bitbns) HasPair

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

func (*Bitbns) InitData

func (e *Bitbns) InitData() error

func (*Bitbns) LimitBuy

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

func (*Bitbns) LimitSell

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

func (*Bitbns) ListOrders

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

func (*Bitbns) LoadPublicData

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

func (*Bitbns) OrderBook

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

Orderbook Only Support INR based pair

func (*Bitbns) OrderStatus

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

func (*Bitbns) SetCoinConstraint

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

func (*Bitbns) SetPairConstraint

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

func (*Bitbns) UpdateAllBalances

func (e *Bitbns) UpdateAllBalances()

func (*Bitbns) UpdateConstraint

func (e *Bitbns) UpdateConstraint()

func (*Bitbns) Withdraw

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

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

type CoinsData

type CoinsData map[string]*CoinsDetail

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

type CoinsDetail

type CoinsDetail struct {
	HighestBuyBid   float64 `json:"highest_buy_bid"`
	LowestSellBid   float64 `json:"lowest_sell_bid"`
	LastTradedPrice float64 `json:"last_traded_price"`
	YesPrice        float64 `json:"yes_price"`
	Volume          struct {
		Max    float64 `json:"max"`
		Min    float64 `json:"min"`
		Volume float64 `json:"volume"`
	} `json:"volume"`
}

type JsonResponse

type JsonResponse struct {
	Status int             `json:"status"`
	Error  interface{}     `json:"error"`
	Code   int             `json:"code"`
	Data   json.RawMessage `json:"data"`
	// old
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type OrderBook

type OrderBook []struct {
	Rate float64 `json:"rate"`
	Btc  float64 `json:"btc"`
}

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