GithubHelp home page GithubHelp logo

mathieugilbert / go-etherdelta Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coincircle/go-etherdelta

0.0 2.0 0.0 2.17 MB

EtherDelta client for Golang.

License: MIT License

Makefile 0.19% Go 99.81%

go-etherdelta's Introduction

go-etherdelta

EtherDelta client for Golang.

License Go Report Card GoDoc

Documentation

https://godoc.org/github.com/mathieugilbert/go-etherdelta

Getting started

package main

import (
	"log"

	ed "github.com/mathieugilbert/go-etherdelta"
)

func main() {
	service := ed.New(&ed.Options{
		ProviderURI: "wss://mainnet.infura.io/ws",
	})

	orders, err := service.GetOrderBook(&ed.GetOrderBookOpts{
		TokenAddress: "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
	})

	if err != nil {
		panic(err)
	}

	log.Println(orders)
}

ForkDelta

A ForkDelta client is avaiable:

service := ed.NewForkDelta(&ed.Options{
  ProviderURI: "wss://mainnet.infura.io/ws",
})

Examples

Take a look at the tests.

Config

You can pass the ProviderURI property to the EtherDelta constructor options. If this is not set, then the service will read the ETH_PROVIDER_URI environment variable, otherwise the Ethereum provider is set to wss://mainnet.infura.io/ws by default.

Test

go test -v ./...

FAQ

  • Q: Why do I get empty results sometimes?

    • A: Sometimes the EtherDelta websocket connection randomly disconnects. It can be unreliable at times.
  • Q: It's completely not working anymore!

    • A: EtherDelta may have changed their API or websocket endpoint.

Resources

License

MIT

go-etherdelta's People

Contributors

miguelmota avatar mathieugilbert avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.