bitpie

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           = 65
	DEFAULT_TAKER_FEE    = 0.0025
	DEFAULT_MAKER_FEE    = 0.0025
	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://api.expie.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"`
	Available     float64 `json:"Available"`
	Pending       float64 `json:"Pending"`
	CryptoAddress string  `json:"CryptoAddress"`
	Requested     bool    `json:"Requested"`
	Uuid          string  `json:"Uuid"`
}

type Bitpie

type Bitpie 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 CreateBitpie

func CreateBitpie(config *exchange.Config) *Bitpie

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

func (*Bitpie) ApiKeyGET

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

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

func (*Bitpie) CanWithdraw

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

func (*Bitpie) CancelAllOrder

func (e *Bitpie) CancelAllOrder() error

func (*Bitpie) CancelOrder

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

func (*Bitpie) DeleteCoin

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

func (*Bitpie) DeletePair

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

func (*Bitpie) DoAccountOperation

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

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

func (*Bitpie) GetBalance

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

func (*Bitpie) GetCoinBySymbol

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

func (*Bitpie) GetCoinConstraint

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

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

func (*Bitpie) GetCoins

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

func (*Bitpie) GetCoinsData

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

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

func (*Bitpie) GetConstraintFetchMethod

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

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

func (*Bitpie) GetFee

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

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

func (*Bitpie) GetID

func (e *Bitpie) GetID() int

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

func (*Bitpie) GetLotSize

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

func (*Bitpie) GetName

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

func (*Bitpie) GetPairBySymbol

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

func (*Bitpie) GetPairConstraint

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

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

func (*Bitpie) GetPairs

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

func (*Bitpie) GetPairsData

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

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

func (*Bitpie) GetSymbolByCoin

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

func (*Bitpie) GetSymbolByPair

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

func (*Bitpie) GetTradingWebURL

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

no website version, use app

func (*Bitpie) GetTxFee

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

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

func (*Bitpie) HasPair

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

func (*Bitpie) InitData

func (e *Bitpie) InitData() error

func (*Bitpie) LimitBuy

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

func (*Bitpie) LimitSell

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

func (*Bitpie) ListOrders

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

func (*Bitpie) LoadPublicData

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

************** Public API **************

func (*Bitpie) OrderBook

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

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

func (*Bitpie) SetCoinConstraint

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

func (*Bitpie) SetPairConstraint

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

func (*Bitpie) TestAuth

func (e *Bitpie) TestAuth() string

func (*Bitpie) UpdateAllBalances

func (e *Bitpie) UpdateAllBalances()

func (*Bitpie) UpdateConstraint

func (e *Bitpie) UpdateConstraint()

func (*Bitpie) Withdraw

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

type CoinsData

type CoinsData []struct {
	Coins []struct {
		Chain                  string `json:"chain"`
		NumOfConfirmations     int    `json:"numOfConfirmations"`
		NumOfFastConfirmations int    `json:"numOfFastConfirmations"`
		DepositStatus          string `json:"depositStatus"`
		MinDepositAmt          string `json:"minDepositAmt"`
		WithdrawStatus         string `json:"withdrawStatus"`
		MinWithdrawAmt         string `json:"minWithdrawAmt"`
		WithdrawPrecision      int    `json:"withdrawPrecision"`
		MaxWithdrawAmt         string `json:"maxWithdrawAmt"`
		WithdrawQuotaPerDay    string `json:"withdrawQuotaPerDay"`
		WithdrawQuotaPerYear   string `json:"withdrawQuotaPerYear"`
		WithdrawQuotaTotal     string `json:"withdrawQuotaTotal"`
		WithdrawFeeType        string `json:"withdrawFeeType"`
		TransactFeeWithdraw    string `json:"transactFeeWithdraw"`
	} `json:"coins"`
}

type JsonResponse

type JsonResponse struct {
	Success bool            `json:"success"`
	Message string          `json:"message"`
	Result  json.RawMessage `json:"result"`
}

type OrderBook

type OrderBook struct {
	Buy  []exchange.Order `json:"buy"`
	Sell []exchange.Order `json:"sell"`
}

type PairsData

type PairsData []struct {
	Name                string `json:"name"`
	MarketOrderMinMoney string `json:"market_order_min_money"`
	StockPrecision      int    `json:"stock_precision"`
	Money               string `json:"money"`
	MakerFeeRate        int    `json:"maker_fee_rate"`
	OrderMinVol         string `json:"order_min_vol"`
	MoneyPrecision      int    `json:"money_precision"`
	MarketOrderEnabled  bool   `json:"market_order_enabled"`
	Stock               string `json:"stock"`
	Enabled             bool   `json:"enabled"`
	TakerFeeRate        int    `json:"taker_fee_rate"`
}

type PlaceOrder

type PlaceOrder struct {
	AccountId                  string
	OrderUuid                  string `json:"OrderUuid"`
	Exchange                   string `json:"Exchange"`
	Type                       string
	Quantity                   float64 `json:"Quantity"`
	QuantityRemaining          float64 `json:"QuantityRemaining"`
	Limit                      float64 `json:"Limit"`
	Reserved                   float64
	ReserveRemaining           float64
	CommissionReserved         float64
	CommissionReserveRemaining float64
	CommissionPaid             float64
	Price                      float64 `json:"Price"`
	PricePerUnit               float64 `json:"PricePerUnit"`
	Opened                     string
	Closed                     string
	IsOpen                     bool
	Sentinel                   string
	CancelInitiated            bool
	ImmediateOrCancel          bool
	IsConditional              bool
	Condition                  string
	ConditionTarget            float64
}

type Uuid

type Uuid struct {
	Id string `json:"uuid"`
}

Jump to

Keyboard shortcuts

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