bitstamp

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           = 9
	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://www.bitstamp.net/api/v2"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitstamp

type Bitstamp 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 CreateBitstamp

func CreateBitstamp(config *exchange.Config) *Bitstamp

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

func (*Bitstamp) ApiKeyGET

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

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

func (*Bitstamp) CanWithdraw

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

func (*Bitstamp) CancelAllOrder

func (e *Bitstamp) CancelAllOrder() error

func (*Bitstamp) CancelOrder

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

func (*Bitstamp) DeleteCoin

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

func (*Bitstamp) DeletePair

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

func (*Bitstamp) DoAccountOperation

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

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

func (*Bitstamp) GetBalance

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

func (*Bitstamp) GetCoinBySymbol

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

func (*Bitstamp) GetCoinConstraint

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

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

func (*Bitstamp) GetCoins

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

func (*Bitstamp) GetCoinsData

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

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

func (*Bitstamp) GetConstraintFetchMethod

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

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

func (*Bitstamp) GetFee

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

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

func (*Bitstamp) GetID

func (e *Bitstamp) GetID() int

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

func (*Bitstamp) GetLotSize

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

func (*Bitstamp) GetName

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

func (*Bitstamp) GetPairBySymbol

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

func (*Bitstamp) GetPairConstraint

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

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

func (*Bitstamp) GetPairs

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

func (*Bitstamp) GetPairsData

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

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

func (*Bitstamp) GetSymbolByCoin

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

func (*Bitstamp) GetSymbolByPair

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

func (*Bitstamp) GetTradingWebURL

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

func (*Bitstamp) GetTxFee

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

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

func (*Bitstamp) HasPair

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

func (*Bitstamp) InitData

func (e *Bitstamp) InitData() error

func (*Bitstamp) LimitBuy

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

func (*Bitstamp) LimitSell

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

func (*Bitstamp) ListOrders

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

func (*Bitstamp) LoadPublicData

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

func (*Bitstamp) OrderBook

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

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

func (*Bitstamp) SetCoinConstraint

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

func (*Bitstamp) SetPairConstraint

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

func (*Bitstamp) UpdateAllBalances

func (e *Bitstamp) UpdateAllBalances()

func (*Bitstamp) UpdateConstraint

func (e *Bitstamp) UpdateConstraint()

func (*Bitstamp) Withdraw

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

type CoinsData

type CoinsData []struct {
	ID                  string `json:"id"`
	FullName            string `json:"fullName"`
	Crypto              bool   `json:"crypto"`
	DepositStatus       bool   `json:"depositStatus"`
	DepositConfirmation int    `json:"depositConfirmation"`
	WithdrawStatus      bool   `json:"withdrawStatus"`
	WithdrawFee         string `json:"withdrawFee"`
}

type OrderBook

type OrderBook struct {
	Timestamp string     `json:"timestamp"`
	Bids      [][]string `json:"bids"`
	Asks      [][]string `json:"asks"`
}

type PairsData

type PairsData []struct {
	BaseDecimals    int    `json:"base_decimals"`
	MinimumOrder    string `json:"minimum_order"`
	Name            string `json:"name"`
	CounterDecimals int    `json:"counter_decimals"`
	Trading         string `json:"trading"`
	URLSymbol       string `json:"url_symbol"`
	Description     string `json:"description"`
}

type TradeHistory

type TradeHistory []struct {
	Date   string `json:"date"`
	Tid    string `json:"tid"`
	Price  string `json:"price"`
	Type   string `json:"type"`
	Amount string `json:"amount"`
}

Jump to

Keyboard shortcuts

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