bitmax

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: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_ID           = 7
	DEFAULT_TAKER_FEE    = 0.0004
	DEFAULT_MAKER_FEE    = 0.0004
	DEFAULT_LOT_SIZE     = 0.00000001
	DEFAULT_PRICE_FILTER = 0.00000001
	DEFAULT_WITHDRAW     = true
	DEFAULT_DEPOSIT      = true
	DEFAULT_CONFIRMATION = 2
	DEFAULT_LISTED       = true
)
View Source
const (
	API_URL string = "https://bitmax.io"
)

Variables

This section is empty.

Functions

func ComputeHmac256EncodingTwice

func ComputeHmac256EncodingTwice(strMessage string, strSecret string) string

func CreatePayload

func CreatePayload(nonce string, path string, coid string) string

Types

type AccountBalances

type AccountBalances []struct {
	AssetCode       string `json:"assetCode"`
	AssetName       string `json:"assetName"`
	TotalAmount     string `json:"totalAmount"`
	AvailableAmount string `json:"availableAmount"`
	InOrderAmount   string `json:"inOrderAmount"`
}

type AccountGroup

type AccountGroup struct {
	AccountGroup int `json:"accountGroup"`
}

type Bitmax

type Bitmax struct {
	ID      int
	Name    string `bson:"name"`
	Website string `bson:"website"`

	API_KEY       string
	API_SECRET    string
	Account_Group string

	Source    exchange.DataSource // / exchange API / microservicve api 1 / PSQL
	SourceURI string
}

func CreateBitmax

func CreateBitmax(config *exchange.Config) *Bitmax

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

func (*Bitmax) AccountGroup

func (e *Bitmax) AccountGroup()

func (*Bitmax) ApiKeyGet

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

func (e *Bitmax) ApiKeyRequest(mapParams map[string]string, strMethod, strRequestPath, path string) string

func (*Bitmax) CanDeposit

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

func (*Bitmax) CanWithdraw

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

func (*Bitmax) CancelAllOrder

func (e *Bitmax) CancelAllOrder() error

func (*Bitmax) CancelOrder

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

func (*Bitmax) DeleteCoin

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

func (*Bitmax) DeletePair

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

func (*Bitmax) DoAccountOperation

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

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

func (*Bitmax) GetBalance

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

func (*Bitmax) GetCoinBySymbol

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

func (*Bitmax) GetCoinConstraint

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

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

func (*Bitmax) GetCoins

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

func (*Bitmax) GetCoinsData

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

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

func (*Bitmax) GetConstraintFetchMethod

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

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

func (*Bitmax) GetFee

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

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

func (*Bitmax) GetID

func (e *Bitmax) GetID() int

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

func (*Bitmax) GetLotSize

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

func (*Bitmax) GetName

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

func (*Bitmax) GetPairBySymbol

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

func (*Bitmax) GetPairConstraint

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

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

func (*Bitmax) GetPairs

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

func (*Bitmax) GetPairsData

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

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

func (*Bitmax) GetSymbolByCoin

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

func (*Bitmax) GetSymbolByPair

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

func (*Bitmax) GetTradingWebURL

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

func (*Bitmax) GetTxFee

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

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

func (*Bitmax) HasPair

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

func (*Bitmax) InitData

func (e *Bitmax) InitData() error

func (*Bitmax) LimitBuy

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

func (*Bitmax) LimitSell

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

func (*Bitmax) ListOrders

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

func (*Bitmax) LoadPublicData

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

func (*Bitmax) OrderBook

func (e *Bitmax) 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 (*Bitmax) OrderStatus

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

func (*Bitmax) SetCoinConstraint

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

func (*Bitmax) SetPairConstraint

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

func (*Bitmax) UpdateAllBalances

func (e *Bitmax) UpdateAllBalances()

func (*Bitmax) UpdateConstraint

func (e *Bitmax) UpdateConstraint()

func (*Bitmax) Withdraw

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

type CoinsData

type CoinsData []struct {
	AssetCode        string  `json:"assetCode"`
	AssetName        string  `json:"assetName"`
	PrecisionScale   int     `json:"precisionScale"`
	NativeScale      int     `json:"nativeScale"`
	WithdrawalFee    float64 `json:"withdrawalFee"`
	MinWithdrawalAmt float64 `json:"minWithdrawalAmt"`
	Status           string  `json:"status"`
}

type JsonResponse

type JsonResponse struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Status  string          `json:"status"`
	Email   string          `json:"email"`
	Data    json.RawMessage `json:"data"`
}

type OrderBook

type OrderBook struct {
	M      string     `json:"m"`
	S      string     `json:"s"`
	Seqnum int        `json:"seqnum"`
	Asks   [][]string `json:"asks"`
	Bids   [][]string `json:"bids"`
}

type OrderStatus

type OrderStatus struct {
	Time       int64  `json:"time"`
	Coid       string `json:"coid"`
	Symbol     string `json:"symbol"`
	BaseAsset  string `json:"baseAsset"`
	QuoteAsset string `json:"quoteAsset"`
	Side       string `json:"side"`
	OrderPrice string `json:"orderPrice"`
	StopPrice  string `json:"stopPrice"`
	OrderQty   string `json:"orderQty"`
	Filled     string `json:"filled"`
	Fee        string `json:"fee"`
	FeeAsset   string `json:"feeAsset"`
	Status     string `json:"status"`
}

type PairsData

type PairsData []struct {
	Symbol        string `json:"symbol"`
	BaseAsset     string `json:"baseAsset"`
	QuoteAsset    string `json:"quoteAsset"`
	PriceScale    int    `json:"priceScale"`
	QtyScale      int    `json:"qtyScale"`
	NotionalScale int    `json:"notionalScale"`
	MinQty        string `json:"minQty"`
	MaxQty        string `json:"maxQty"`
	MinNotional   string `json:"minNotional"`
	MaxNotional   string `json:"maxNotional"`
	Status        string `json:"status"`
	MiningStatus  string `json:"miningStatus"`
}

type PlaceOrder

type PlaceOrder struct {
	Coid    string `json:"coid"`
	Action  string `json:"action"`
	Success bool   `json:"success"`
}

type Withdrawal

type Withdrawal struct {
	Msg    string `json:"msg"`
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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