gemini

package module
v0.0.0-...-c6ff946 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2018 License: MIT Imports: 10 Imported by: 1

README

go-gemini

go-gemini is an implementation of the Gemini API (public and private) in Golang.

Based off of https://github.com/toorop/go-bittrex/

Import

import "github.com/jyap808/go-gemini"

This library is more of a framework for some bots I use so it is expected that a lot of things don't work but pull requests are accepted.

Usage

package main

import (
	"fmt"
	"github.com/jyap808/go-gemini"
)

const (
	API_KEY    = "YOUR_API_KEY"
	API_SECRET = "YOUR_API_SECRET"
)

func main() {
	// Gemini client
	gemini := gemini.New(API_KEY, API_SECRET)

	// Get markets
	markets, err := gemini.GetMarkets()
	fmt.Println(err, markets)
}

See "Examples" folder for more... examples

Documentation

Overview

Package Gemini is an implementation of the Gemini API in Golang.

Index

Constants

View Source
const (
	API_BASE                   = "https://api.gemini.com/" // Gemini API endpoint
	API_VERSION                = "v1"                      // Gemini API version
	DEFAULT_HTTPCLIENT_TIMEOUT = 30                        // HTTP client timeout
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(apiKey, apiSecret string) (c *client)

NewClient return a new Gemini HTTP client

Types

type Gemini

type Gemini struct {
	// contains filtered or unexported fields
}

gemini represent a gemini client

func New

func New(apiKey, apiSecret string) *Gemini

New return a instanciate gemini struct

func (*Gemini) GetTicker

func (b *Gemini) GetTicker(market string) (ticker Ticker, err error)

GetTicker is used to get the current ticker values for a market.

type Ticker

type Ticker struct {
	Bid  float64 `json:"bid,string"`  // Innermost bid
	Ask  float64 `json:"ask,string"`  // Innermost ask
	Last float64 `json:"last,string"` // The price at which the last order executed
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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