bitatm

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           = 26
	DEFAULT_TAKER_FEE    = 0.001
	DEFAULT_MAKER_FEE    = 0.001
	DEFAULT_LOT_SIZE     = 0.00000001
	DEFAULT_PRICE_FILTER = 0.01
	DEFAULT_TXFEE        = 0.005
	DEFAULT_WITHDRAW     = true
	DEFAULT_DEPOSIT      = true
	DEFAULT_CONFIRMATION = 2
	DEFAULT_LISTED       = true
)
View Source
const (
	API_URL string = "https://open.bitatm.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalances

type AccountBalances []struct {
	Currency string  `json:"currency"`
	Balance  float64 `json:"balance"`
	Frozen   float64 `json:"frozen"`
}

type BitATM

type BitATM 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 CreateBitATM

func CreateBitATM(config *exchange.Config) *BitATM

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

func (*BitATM) ApiKeyGET

func (e *BitATM) ApiKeyGET(strRequestPath string, mapParams map[string]interface{}) 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 (*BitATM) ApiKeyPOST

func (e *BitATM) ApiKeyPOST(strRequestPath string, mapParams map[string]interface{}) string

func (*BitATM) CanDeposit

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

func (*BitATM) CanWithdraw

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

func (*BitATM) CancelAllOrder

func (e *BitATM) CancelAllOrder() error

func (*BitATM) CancelOrder

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

func (*BitATM) DeleteCoin

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

func (*BitATM) DeletePair

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

func (*BitATM) DoAccountOperation

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

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

func (*BitATM) GetBalance

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

func (*BitATM) GetCoinBySymbol

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

func (*BitATM) GetCoinConstraint

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

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

func (*BitATM) GetCoins

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

func (*BitATM) GetCoinsData

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

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

func (*BitATM) GetConstraintFetchMethod

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

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

func (*BitATM) GetFee

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

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

func (*BitATM) GetID

func (e *BitATM) GetID() int

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

func (*BitATM) GetLotSize

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

func (*BitATM) GetName

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

func (*BitATM) GetPairBySymbol

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

func (*BitATM) GetPairConstraint

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

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

func (*BitATM) GetPairs

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

func (*BitATM) GetPairsData

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

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

func (*BitATM) GetSymbolByCoin

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

func (*BitATM) GetSymbolByPair

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

func (*BitATM) GetTradingWebURL

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

func (*BitATM) GetTxFee

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

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

func (*BitATM) HasPair

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

func (*BitATM) InitData

func (e *BitATM) InitData() error

func (*BitATM) LimitBuy

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

func (*BitATM) LimitSell

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

func (*BitATM) ListOrders

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

func (*BitATM) LoadPublicData

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

func (*BitATM) OrderBook

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

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

func (*BitATM) SetCoinConstraint

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

func (*BitATM) SetPairConstraint

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

func (*BitATM) UpdateAllBalances

func (e *BitATM) UpdateAllBalances()

func (*BitATM) UpdateConstraint

func (e *BitATM) UpdateConstraint()

func (*BitATM) Withdraw

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

type CoinsData

type CoinsData []struct {
	ID           string `json:"id"`
	Currencyname string `json:"currencyname"`
}

type JsonResponse

type JsonResponse struct {
	Code string          `json:"code"`
	Msg  string          `json:"msg"`
	Ts   int             `json:"ts"`
	Data json.RawMessage `json:"Data"`
}

type OrderBook

type OrderBook struct {
	Ts   int `json:"ts"`
	Bids []struct {
		Price  float64 `json:"price"`
		Amount float64 `json:"amount"`
		ID     int     `json:"id"`
	} `json:"bids"`
	Asks []struct {
		Price  float64 `json:"price"`
		Amount float64 `json:"amount"`
		ID     int     `json:"id"`
	} `json:"asks"`
}

type OrderStatus

type OrderStatus struct {
	Orderid           int64     `json:"orderid"`
	Ordertype         int32     `json:"ordertype"`
	Direction         int32     `json:"direction"`
	Price             float64   `json:"price"`
	Amount            float64   `json:"amount"`
	Transactionamount float64   `json:"transactionamount"`
	Fee               float64   `json:"fee"`
	Symbol            string    `json:"symbol"`
	Orderstatus       int32     `json:"orderstatus"`
	Updatetime        time.Time `json:"updatetime"`
	Createtime        time.Time `json:"createtime"`
	Basecurrency      string    `json:"basecurrency"`
	Quotecurrency     string    `json:"quotecurrency"`
}

type PairsData

type PairsData []struct {
	ID              string `json:"id"`
	Basecurrency    string `json:"basecurrency"`
	Quotecurrency   string `json:"quotecurrency"`
	Symbol          string `json:"symbol"`
	Priceprecision  string `json:"priceprecision"`
	Amountprecision string `json:"amountprecision"`
}

type Withdrawal

type Withdrawal struct {
	Succeed    bool  `json:"succeed"`
	Withdrawid int64 `json:"withdrawid"`
}

Jump to

Keyboard shortcuts

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