bithumb

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           = 54
	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://global-openapi.bithumb.pro/openapi/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalances

type AccountBalances []struct {
	CoinType    string `json:"coinType"`
	Count       string `json:"count"`
	Frozen      string `json:"frozen"`
	BtcQuantity string `json:"btcQuantity"`
	Type        string `json:"type"`
}

type Bithumb

type Bithumb 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 CreateBithumb

func CreateBithumb(config *exchange.Config) *Bithumb

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

func (*Bithumb) ApiKeyGET

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

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

func (*Bithumb) CanDeposit

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

func (*Bithumb) CanWithdraw

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

func (*Bithumb) CancelAllOrder

func (e *Bithumb) CancelAllOrder() error

func (*Bithumb) CancelOrder

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

func (*Bithumb) DeleteCoin

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

func (*Bithumb) DeletePair

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

func (*Bithumb) DoAccountOperation

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

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

func (*Bithumb) GetBalance

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

func (*Bithumb) GetCoinBySymbol

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

func (*Bithumb) GetCoinConstraint

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

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

func (*Bithumb) GetCoins

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

func (*Bithumb) GetCoinsData

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

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

func (*Bithumb) GetConstraintFetchMethod

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

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

func (*Bithumb) GetFee

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

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

func (*Bithumb) GetID

func (e *Bithumb) GetID() int

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

func (*Bithumb) GetLotSize

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

func (*Bithumb) GetName

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

func (*Bithumb) GetPairBySymbol

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

func (*Bithumb) GetPairConstraint

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

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

func (*Bithumb) GetPairs

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

func (*Bithumb) GetPairsData

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

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

func (*Bithumb) GetSymbolByCoin

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

func (*Bithumb) GetSymbolByPair

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

func (*Bithumb) GetTradingWebURL

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

func (*Bithumb) GetTxFee

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

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

func (*Bithumb) HasPair

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

func (*Bithumb) InitData

func (e *Bithumb) InitData() error

func (*Bithumb) LimitBuy

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

func (*Bithumb) LimitSell

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

func (*Bithumb) ListOrders

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

func (*Bithumb) LoadPublicData

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

************** PUBLIC API **************

func (*Bithumb) OrderBook

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

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

func (*Bithumb) SetCoinConstraint

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

func (*Bithumb) SetPairConstraint

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

func (*Bithumb) UpdateAllBalances

func (e *Bithumb) UpdateAllBalances()

func (*Bithumb) UpdateConstraint

func (e *Bithumb) UpdateConstraint()

func (*Bithumb) Withdraw

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

type CoinsData

type CoinsData struct {
	CoinConfig []struct {
		// MakerFeeRate   string `json:"makerFeeRate"`
		MinTxAmt      string `json:"minTxAmt,omitempty"`
		Name          string `json:"name"`
		DepositStatus string `json:"depositStatus"`
		FullName      string `json:"fullName"`
		// TakerFeeRate   string `json:"takerFeeRate"`
		MinWithdraw    string `json:"minWithdraw"`
		WithdrawFee    string `json:"withdrawFee"`
		WithdrawStatus string `json:"withdrawStatus"`
	} `json:"coinConfig"`
	ContractConfig []struct {
		Symbol       string `json:"symbol"`
		MakerFeeRate string `json:"makerFeeRate"`
		TakerFeeRate string `json:"takerFeeRate"`
	} `json:"contractConfig"`
	SpotConfig []struct {
		Symbol   string   `json:"symbol"`
		Accuracy []string `json:"accuracy"`
		OpenTime int64    `json:"openTime"`
	} `json:"spotConfig"`
}

type JsonResponse

type JsonResponse struct {
	Data    json.RawMessage `json:"data"`
	Success bool            `json:"success"`
	Msg     string          `json:"msg"`
	Code    string          `json:"code"`
	Params  []interface{}   `json:"params"`
}

type OrderBook

type OrderBook struct {
	Symbol string     `json:"symbol"`
	B      [][]string `json:"b"`
	Ver    string     `json:"ver"`
	S      [][]string `json:"s"`
}

type OrderStatus

type OrderStatus struct {
	OrderID    string `json:"orderId"`
	Symbol     string `json:"symbol"`
	Price      string `json:"price"`
	TradedNum  string `json:"tradedNum"`
	Quantity   string `json:"quantity"`
	AvgPrice   string `json:"avgPrice"`
	Status     string `json:"status"`
	Type       string `json:"type"`
	Side       string `json:"side"`
	CreateTime int64  `json:"createTime"`
	TradeTotal string `json:"tradeTotal"`
}

type PlaceOrder

type PlaceOrder struct {
	OrderID string `json:"orderId"`
	Symbol  string `json:"symbol"`
}

type TradeHistory

type TradeHistory struct {
	Data []struct {
		P   string `json:"p"`
		Ver string `json:"ver"`
		S   string `json:"s"`
		T   string `json:"t"`
		V   string `json:"v"`
	} `json:"data"`
	Code      string `json:"code"`
	Msg       string `json:"msg"`
	Timestamp int64  `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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