Documentation ¶
Index ¶
- Constants
- func ComputeHmac384NoDecode(strMessage string, strSecret string) string
- type AccountBalances
- type ErrorResponse
- type Gemini
- func (e *Gemini) ApiKeyRequest(strMethod string, strRequestPath string, mapParams map[string]interface{}) string
- func (e *Gemini) CanDeposit(coin *coin.Coin) bool
- func (e *Gemini) CanWithdraw(coin *coin.Coin) bool
- func (e *Gemini) CancelAllOrder() error
- func (e *Gemini) CancelOrder(order *exchange.Order) error
- func (e *Gemini) DeleteCoin(coin *coin.Coin)
- func (e *Gemini) DeletePair(pair *pair.Pair)
- func (e *Gemini) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Gemini) GetBalance(coin *coin.Coin) float64
- func (e *Gemini) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Gemini) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Gemini) GetCoins() []*coin.Coin
- func (e *Gemini) GetCoinsData() error
- func (e *Gemini) GetConfirmation(coin *coin.Coin) int
- func (e *Gemini) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Gemini) GetFee(pair *pair.Pair) float64
- func (e *Gemini) GetID() int
- func (e *Gemini) GetLotSize(pair *pair.Pair) float64
- func (e *Gemini) GetName() exchange.ExchangeName
- func (e *Gemini) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Gemini) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Gemini) GetPairs() []*pair.Pair
- func (e *Gemini) GetPairsData() error
- func (e *Gemini) GetPriceFilter(pair *pair.Pair) float64
- func (e *Gemini) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Gemini) GetSymbolByPair(pair *pair.Pair) string
- func (e *Gemini) GetTradingWebURL(pair *pair.Pair) string
- func (e *Gemini) GetTxFee(coin *coin.Coin) float64
- func (e *Gemini) HasPair(pair *pair.Pair) bool
- func (e *Gemini) InitData() error
- func (e *Gemini) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Gemini) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Gemini) ListOrders() ([]*exchange.Order, error)
- func (e *Gemini) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Gemini) OrderBook(pair *pair.Pair) (*exchange.Maker, error)
- func (e *Gemini) OrderStatus(order *exchange.Order) error
- func (e *Gemini) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Gemini) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Gemini) UpdateAllBalances()
- func (e *Gemini) UpdateConstraint()
- func (e *Gemini) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type OrderBook
- type PairsFile
- type PlaceOrder
- type Withdrawal
Constants ¶
const ( DEFAULT_ID = 37 DEFAULT_TAKER_FEE = 0.0035 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 )
const (
API_URL string = "https://api.sandbox.gemini.com"
)
Variables ¶
This section is empty.
Functions ¶
func ComputeHmac384NoDecode ¶
Types ¶
type AccountBalances ¶
type ErrorResponse ¶
type Gemini ¶
type Gemini 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 CreateGemini ¶
*************************************************
func (*Gemini) ApiKeyRequest ¶
func (e *Gemini) ApiKeyRequest(strMethod string, strRequestPath string, mapParams map[string]interface{}) 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 (*Gemini) CancelAllOrder ¶
func (*Gemini) DeleteCoin ¶
func (*Gemini) DeletePair ¶
func (*Gemini) DoAccountOperation ¶
func (e *Gemini) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Gemini) GetCoinConstraint ¶
func (e *Gemini) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Gemini) 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 (*Gemini) GetConstraintFetchMethod ¶
func (e *Gemini) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Gemini) GetName ¶
func (e *Gemini) GetName() exchange.ExchangeName
func (*Gemini) GetPairConstraint ¶
func (e *Gemini) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Gemini) 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 (*Gemini) LoadPublicData ¶
func (e *Gemini) LoadPublicData(operation *exchange.PublicOperation) error
func (*Gemini) 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 (*Gemini) SetCoinConstraint ¶
func (e *Gemini) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Gemini) SetPairConstraint ¶
func (e *Gemini) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Gemini) UpdateAllBalances ¶
func (e *Gemini) UpdateAllBalances()
func (*Gemini) UpdateConstraint ¶
func (e *Gemini) UpdateConstraint()
type PlaceOrder ¶
type PlaceOrder struct { OrderID string `json:"order_id"` ID string `json:"id"` Symbol string `json:"symbol"` Exchange string `json:"exchange"` AvgExecutionPrice string `json:"avg_execution_price"` Side string `json:"side"` Type string `json:"type"` Timestamp string `json:"timestamp"` Timestampms int64 `json:"timestampms"` IsLive bool `json:"is_live"` IsCancelled bool `json:"is_cancelled"` IsHidden bool `json:"is_hidden"` WasForced bool `json:"was_forced"` ExecutedAmount string `json:"executed_amount"` RemainingAmount string `json:"remaining_amount"` Options []interface{} `json:"options"` Price string `json:"price"` OriginalAmount string `json:"original_amount"` }