Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Coinbase
- func (e *Coinbase) ApiKeyRequest(strMethod string, mapParams map[string]interface{}, strRequestPath string) string
- func (e *Coinbase) CanDeposit(coin *coin.Coin) bool
- func (e *Coinbase) CanWithdraw(coin *coin.Coin) bool
- func (e *Coinbase) CancelAllOrder() error
- func (e *Coinbase) CancelOrder(order *exchange.Order) error
- func (e *Coinbase) DeleteCoin(coin *coin.Coin)
- func (e *Coinbase) DeletePair(pair *pair.Pair)
- func (e *Coinbase) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Coinbase) GetBalance(coin *coin.Coin) float64
- func (e *Coinbase) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Coinbase) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Coinbase) GetCoins() []*coin.Coin
- func (e *Coinbase) GetCoinsData() error
- func (e *Coinbase) GetConfirmation(coin *coin.Coin) int
- func (e *Coinbase) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Coinbase) GetFee(pair *pair.Pair) float64
- func (e *Coinbase) GetID() int
- func (e *Coinbase) GetLotSize(pair *pair.Pair) float64
- func (e *Coinbase) GetName() exchange.ExchangeName
- func (e *Coinbase) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Coinbase) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Coinbase) GetPairs() []*pair.Pair
- func (e *Coinbase) GetPairsData() error
- func (e *Coinbase) GetPriceFilter(pair *pair.Pair) float64
- func (e *Coinbase) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Coinbase) GetSymbolByPair(pair *pair.Pair) string
- func (e *Coinbase) GetTradingWebURL(pair *pair.Pair) string
- func (e *Coinbase) GetTxFee(coin *coin.Coin) float64
- func (e *Coinbase) HasPair(pair *pair.Pair) bool
- func (e *Coinbase) InitData() error
- func (e *Coinbase) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Coinbase) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Coinbase) ListOrders() ([]*exchange.Order, error)
- func (e *Coinbase) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Coinbase) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Coinbase) OrderStatus(order *exchange.Order) error
- func (e *Coinbase) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Coinbase) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Coinbase) UpdateAllBalances()
- func (e *Coinbase) UpdateConstraint()
- func (e *Coinbase) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type CoinsData
- type OrderBook
- type PairsData
- type PlaceOrder
- type TradeHistory
- type WithdrawResponse
Constants ¶
const ( DEFAULT_ID = 70 DEFAULT_TAKER_FEE = 0.001 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 //PRICE FILTER DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 DEFAULT_LISTED = true )
const (
API_URL = "https://api.pro.coinbase.com"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type Coinbase ¶
type Coinbase struct { ID int Name string `bson:"name"` Website string `bson:"website"` API_KEY string API_SECRET string Passphrase string Source exchange.DataSource // / exchange API / microservicve api 1 / PSQL SourceURI string }
func CreateCoinbase ¶
*************************************************
func (*Coinbase) ApiKeyRequest ¶
func (e *Coinbase) ApiKeyRequest(strMethod string, mapParams map[string]interface{}, strRequestPath 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 (*Coinbase) CancelAllOrder ¶
func (*Coinbase) DeleteCoin ¶
func (*Coinbase) DeletePair ¶
func (*Coinbase) DoAccountOperation ¶
func (e *Coinbase) DoAccountOperation(operation *exchange.AccountOperation) error
func (*Coinbase) GetCoinConstraint ¶
func (e *Coinbase) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Coinbase) GetCoinsData ¶
************** 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 (*Coinbase) GetConstraintFetchMethod ¶
func (e *Coinbase) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Coinbase) GetName ¶
func (e *Coinbase) GetName() exchange.ExchangeName
func (*Coinbase) GetPairConstraint ¶
func (e *Coinbase) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Coinbase) GetPairsData ¶
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 (*Coinbase) LoadPublicData ¶
func (e *Coinbase) LoadPublicData(operation *exchange.PublicOperation) error
************** PUBLIC API **************
func (*Coinbase) OrderBook ¶
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 (*Coinbase) SetCoinConstraint ¶
func (e *Coinbase) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Coinbase) SetPairConstraint ¶
func (e *Coinbase) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Coinbase) UpdateAllBalances ¶
func (e *Coinbase) UpdateAllBalances()
func (*Coinbase) UpdateConstraint ¶
func (e *Coinbase) UpdateConstraint()
type CoinsData ¶
type CoinsData []struct { ID string `json:"id"` Name string `json:"name"` MinSize string `json:"min_size"` Status string `json:"status"` Message string `json:"message"` Details struct { Type string `json:"type"` Symbol string `json:"symbol"` NetworkConfirmations int `json:"network_confirmations"` SortOrder int `json:"sort_order"` CryptoAddressLink string `json:"crypto_address_link"` CryptoTransactionLink string `json:"crypto_transaction_link"` PushPaymentMethods []string `json:"push_payment_methods"` ProcessingTimeSeconds int `json:"processing_time_seconds"` MinWithdrawalAmount float64 `json:"min_withdrawal_amount"` } `json:"details"` MaxPrecision string `json:"max_precision"` ConvertibleTo []string `json:"convertible_to,omitempty"` }
type PairsData ¶
type PairsData []struct { ID string `json:"id"` BaseCurrency string `json:"base_currency"` QuoteCurrency string `json:"quote_currency"` BaseMinSize string `json:"base_min_size"` BaseMaxSize string `json:"base_max_size"` QuoteIncrement string `json:"quote_increment"` BaseIncrement string `json:"base_increment"` DisplayName string `json:"display_name"` MinMarketFunds string `json:"min_market_funds"` MaxMarketFunds string `json:"max_market_funds"` MarginEnabled bool `json:"margin_enabled"` PostOnly bool `json:"post_only"` LimitOnly bool `json:"limit_only"` CancelOnly bool `json:"cancel_only"` Status string `json:"status"` StatusMessage string `json:"status_message"` }
type PlaceOrder ¶
type PlaceOrder struct { ID string `json:"id"` Price string `json:"price"` Size string `json:"size"` ProductID string `json:"product_id"` Side string `json:"side"` Stp string `json:"stp"` Funds string `json:"funds"` SpecifiedFunds string `json:"specified_funds"` Type string `json:"type"` TimeInForce string `json:"time_in_force"` PostOnly bool `json:"post_only"` CreatedAt time.Time `json:"created_at"` DoneAt time.Time `json:"done_at"` DoneReason string `json:"done_reason"` FillFees string `json:"fill_fees"` FilledSize string `json:"filled_size"` ExecutedValue string `json:"executed_value"` Status string `json:"status"` Settled bool `json:"settled"` Message string `json:"message"` }