A wrapper for web3 to be used with GopherJS. Tries to enforce best practices. Methods are called asynchronously to maintain support for metamask and mist.
$ go get -u github.com/jaynagpaul/go-web3
$ go get -u github.com/gopherjs/gopherjs
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
- Framework for testing.
- Finalize API.
- Examples