bitstamp

package module
v0.0.0-...-7d08dfb Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 7 Imported by: 1

README

go-bitstamp

go-bitstamp is a go implementation of the bitstamp API (public) in Golang.

Import

import "github.com/jpatel888/go-bitstamp"

Usage

package main

import (
	"fmt"
	"github.com/jpatel888/go-bitstamp"
)

func main() {
	bitstamp_client := bitstamp.New()

	ticker, err := bitstamp_client.GetTicker("btcusd")

	fmt.Println(err, ticker)
	fmt.Println("Last:", ticker.Last)
}

Documentation

Index

Constants

View Source
const (
	API_BASE                   = "https://www.bitstamp.net/api/"
	API_VERSION                = "v2"
	DEFAULT_HTTPCLIENT_TIMEOUT = 8
)

Variables

This section is empty.

Functions

func NewClient

func NewClient() (c *client)

Types

type Bitstamp

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

func New

func New() *Bitstamp

func (*Bitstamp) GetTicker

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

type Ticker

type Ticker struct {
	High      float64 `json:"high,string"`
	Last      float64 `json:"last,string"`
	TimeStamp uint    `json:"timestamp,string"`
	Bid       float64 `json:"bid,string"`
	Vwap      float64 `json:"vwap,string"`
	Volume    float64 `json:"volume,string"`
	Low       float64 `json:"low,string"`
	Ask       float64 `json:"ask,string"`
	Open      float64 `json:"open,string"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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