Skip to content

mkazutaka/gabtms

Repository files navigation

gabtms

gather BTC Websocket. This is library for aggregating trade data from some exchanges through web socket

demo

Install

$ go get github.com/mkazutaka/gabtms

How to use

show simple example

package main

import (
	"encoding/json"
	"log"

	"github.com/mkazutaka/gabtms/bitmex"
)

func main() {
	ch, _, err := bitmex.Subscribe([]string{bitmex.TopicTrade})
	if err != nil {
		log.Fatal(err)
	}

	for v := range ch {
		trade := bitmex.ResponseTrade{}
		err := json.Unmarshal(v, &trade)
		if err != nil {
			log.Fatal(err)
		}
		for _, v := range trade.Data {
			m := v.Generalize()
			log.Printf("bitmex: %+v", m)
		}
	}
}

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Releases

No releases published

Packages

No packages published

Languages