An open API service indexing awesome lists of open source software.

https://github.com/jaynagpaul/go-web3

A wrapper for web3.js to be used with GopherJS.
https://github.com/jaynagpaul/go-web3

ethereum gopherjs gopherjs-bindings solidity web3

Last synced: 5 months ago
JSON representation

A wrapper for web3.js to be used with GopherJS.

Awesome Lists containing this project

README

          

# go-web3
[![GoDoc](https://godoc.org/github.com/jaynagpaul/go-web3?status.svg)](https://godoc.org/github.com/jaynagpaul/go-web3) [![Go Report Card](https://goreportcard.com/badge/github.com/jaynagpaul/go-web3)](https://goreportcard.com/report/github.com/jaynagpaul/go-web3)

A wrapper for [web3](https://github.com/ethereum/web3.js/) to be used with [GopherJS](https://github.com/gopherjs/gopherjs).
Tries to enforce best practices. Methods are called asynchronously to maintain support for metamask and mist.

## Documentation
[GoDoc](https://godoc.org/github.com/jaynagpaul/go-web3)

## Getting Started

`$ go get -u github.com/jaynagpaul/go-web3`
`$ go get -u github.com/gopherjs/gopherjs`

```Go

import "github.com/jaynagpaul/go-web3"

func main() {
// Check if injected by browser
w3 := web3.NewWeb3()
w3.Version.GetEthereum(func(ver, err) {
if err != nil {
println(err)
} else {
println(ver) // Prints the version to the developer console.
}
})
// TODO
}
```

`gopherjs build`

[More Examples](https://godoc.org/github.com/jaynagpaul/go-web3#pkg-examples)

[One More](https://github.com/jaynagpaul/go-web3/tree/master/example)

## TODO
* Framework for testing.
* Finalize API.
* Examples