umbracle/ethgo

[panic] type *hdkeychain.ExtendedKey has no field or method Child)

0xdigiscore opened this issue · 1 comments

package main

import (
	"fmt"

	"github.com/umbracle/go-web3/jsonrpc"
	"github.com/umbracle/go-web3/wallet"
)

func main() {
	client, err := jsonrpc.NewClient("https://eth-rinkeby.alchemyapi.io/v2/oYHKrgZwrX8PV76knF7hVPekQ8b5mCFd")
	if err != nil {
		panic(err)
	}

	number, err := client.Eth().BlockNumber()
	if err != nil {
		panic(err)
	}

	fmt.Println(number)

	key, _ := wallet.GenerateKey()
	fmt.Println(key.Address())

}

I got error:

../../../../../go/pkg/mod/github.com/umbracle/go-web3@v0.0.0-20220224145938-aaa1038c1b69/wallet/wallet_hd.go:26:17: key.Child undefined (type *hdkeychain.ExtendedKey has no field or method Child)

It looks like the installation of the library is wrong. How did you installed the library?