rates

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

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

Go to latest
Published: Oct 26, 2019 License: MIT Imports: 4 Imported by: 0

README

rates

A package to fetch Feirm (XFE) prices from the CryptoBridge API.

Example usage:

package main

import (
	"fmt"
	"git.feirm.com/feirm/rates"
)

func main() {
	xfeRate := rates.FetchTicker()
	fmt.Println(xfeRate)
}

Expected output:

# go run main.go
&{XFE_BTC 0.00000300 0.00000030 0.00000007 0.00000030 328.56}

Execute tests:

go test -v ./... -count=1

Documentation

Index

Constants

View Source
const TRADING_PAIR = "XFE_BTC"

Variables

View Source
var Data = FetchTicker()

Functions

func GetAsk

func GetAsk() string

func GetBid

func GetBid() string

func GetId

func GetId() string

func GetLast

func GetLast() string

func GetPercentChange

func GetPercentChange() float64

func GetVolume

func GetVolume() string

Types

type MarketData

type MarketData struct {
	Id            string  `json:"id"`
	Volume        string  `json:"volume"`
	Ask           string  `json:"ask"`
	Bid           string  `json:"bid"`
	Last          string  `json:"last"`
	PercentChange float64 `json:"percentChange"`
}

func FetchTicker

func FetchTicker() *MarketData

type Markets

type Markets []MarketData

Jump to

Keyboard shortcuts

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