bigone

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

Documentation

Index

Constants

View Source
const (
	DEFAULT_ID           = 17
	DEFAULT_TAKER_FEE    = 0.001
	DEFAULT_MAKER_FEE    = 0.001
	DEFAULT_LOT_SIZE     = 0.00000001
	DEFAULT_PRICE_FILTER = 0.00000001
	DEFAULT_TXFEE        = 0.005
	DEFAULT_WITHDRAW     = true
	DEFAULT_DEPOSIT      = true
	DEFAULT_CONFIRMATION = 2
	DEFAULT_LISTED       = true
)
View Source
const (
	API_URL string = "https://big.one/api/v3"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalances

type AccountBalances []struct {
	AssetSymbol   string `json:"asset_symbol"`
	Balance       string `json:"balance"`
	LockedBalance string `json:"locked_balance"`
}

type Bigone

type Bigone 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 CreateBigone

func CreateBigone(config *exchange.Config) *Bigone

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

func (*Bigone) ApiKeyRequest

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

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

func (*Bigone) CanWithdraw

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

func (*Bigone) CancelAllOrder

func (e *Bigone) CancelAllOrder() error

func (*Bigone) CancelOrder

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

func (*Bigone) DeleteCoin

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

func (*Bigone) DeletePair

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

func (*Bigone) DoAccountOperation

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

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

func (*Bigone) GetBalance

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

func (*Bigone) GetCoinBySymbol

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

func (*Bigone) GetCoinConstraint

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

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

func (*Bigone) GetCoins

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

func (*Bigone) GetCoinsData

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

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

func (*Bigone) GetConstraintFetchMethod

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

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

func (*Bigone) GetFee

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

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

func (*Bigone) GetID

func (e *Bigone) GetID() int

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

func (*Bigone) GetLotSize

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

func (*Bigone) GetName

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

func (*Bigone) GetPairBySymbol

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

func (*Bigone) GetPairConstraint

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

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

func (*Bigone) GetPairs

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

func (*Bigone) GetPairsData

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

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

func (*Bigone) GetSymbolByCoin

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

func (*Bigone) GetSymbolByPair

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

func (*Bigone) GetTradingWebURL

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

func (*Bigone) GetTxFee

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

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

func (*Bigone) HasPair

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

func (*Bigone) InitData

func (e *Bigone) InitData() error

func (*Bigone) LimitBuy

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

func (*Bigone) LimitSell

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

func (*Bigone) ListOrders

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

func (*Bigone) LoadPublicData

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

func (*Bigone) OrderBook

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

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

func (*Bigone) SetCoinConstraint

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

func (*Bigone) SetPairConstraint

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

func (*Bigone) UpdateAllBalances

func (e *Bigone) UpdateAllBalances()

func (*Bigone) UpdateConstraint

func (e *Bigone) UpdateConstraint()

func (*Bigone) Withdraw

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

read only withdrawal

type JsonResponse

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

type OrderBook

type OrderBook struct {
	AssetPairName string `json:"asset_pair_name"`
	Bids          []struct {
		Price      string `json:"price"`
		OrderCount int    `json:"order_count"`
		Quantity   string `json:"quantity"`
	} `json:"bids"`
	Asks []struct {
		Price      string `json:"price"`
		OrderCount int    `json:"order_count"`
		Quantity   string `json:"quantity"`
	} `json:"asks"`
}

type PairsData

type PairsData []struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	QuoteScale int    `json:"quote_scale"`
	QuoteAsset struct {
		ID     string `json:"id"`
		Symbol string `json:"symbol"`
		Name   string `json:"name"`
	} `json:"quote_asset"`
	BaseAsset struct {
		ID     string `json:"id"`
		Symbol string `json:"symbol"`
		Name   string `json:"name"`
	} `json:"base_asset"`
	BaseScale     int    `json:"base_scale"`
	MinQuoteValue string `json:"min_quote_value"`
}

type PlaceOrder

type PlaceOrder struct {
	ID            int       `json:"id"`
	AssetPairName string    `json:"asset_pair_name"`
	Price         string    `json:"price"`
	Amount        string    `json:"amount"`
	FilledAmount  string    `json:"filled_amount"`
	AvgDealPrice  string    `json:"avg_deal_price"`
	Side          string    `json:"side"`
	State         string    `json:"state"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

type Withdraw

type Withdraw []struct {
	ID          int         `json:"id"`
	CustomerID  int         `json:"customer_id"`
	AssetUUID   string      `json:"asset_uuid"`
	Amount      string      `json:"amount"`
	Recipient   interface{} `json:"recipient"`
	State       string      `json:"state"`
	IsInternal  bool        `json:"is_internal"`
	Note        string      `json:"note"`
	Kind        string      `json:"kind"`
	Txid        string      `json:"txid"`
	Confirms    int         `json:"confirms"`
	InsertedAt  interface{} `json:"inserted_at"`
	UpdatedAt   interface{} `json:"updated_at"`
	CompletedAt interface{} `json:"completed_at"`
	Commision   interface{} `json:"commision"`
	Explain     string      `json:"explain"`
}

Jump to

Keyboard shortcuts

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