Code Monkey home page Code Monkey logo

go-etherdelta's Introduction

go-etherdelta

EtherDelta client for Golang.

License Go Report Card GoDoc

Documentation

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

Getting started

package main

import (
	"log"

	ed "github.com/coincircle/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

coopermaruyama avatar miguelmota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-etherdelta's Issues

bigint SetString euler number

amountGet := new(big.Int)
amountGet, _ = amountGet.SetString("1.973556415142968800e+22", 10)
fmt.Println(amountGet.String())

Result: nil

undefined error

Hi.
I am getting this error in etherdelta.go running the examples in folder
" ../etherdelta.go:602:12: undefined: "github.com/ethereum/go-ethereum/crypto".ToECDSAPub "
something with row 602: pubKey := crypto.ToECDSAPub(recoveredPub)

Regards,

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.