Categorygithub.com/alvinlaw/go-etherdelta
modulepackage
1.0.0
Repository: https://github.com/alvinlaw/go-etherdelta.git
Documentation: pkg.go.dev

# README

go-etherdelta

EtherDelta client for Golang.

License Go Report Card GoDoc

Documentation

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

Getting started

package main

import (
	"log"

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

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

New returns new service.
NewForkDelta returns new ForkDelta service.

# Structs

CancelOrderOpts Options for cancelling an order.
DepositEthOpts Options for depositing ETH.
GetOrderBookOpts Options for getting order book.
GetTokenBalanceOpts Options for getting token balance.
GetTokenPriceOpts Options for getting token price.
GetTokenTickerOpts Options for getting token ticker.
MakeOrderOpts Options for making an order.
MakeTrade Options for making a trade.
Options service options.
Order Individual order struct.
OrderBook Order Book struct.
OrderPost Order struct for posting a new order to EtherDelta.
PostOrderOpts Options for posting an order.
Service service struct.
TokenTicker Ticker infor for token.
WithdrawTokenOpts Options for withdrawing token.