go-hdwallet
go-hdwallet copied to clipboard
Sign ETH transactions
master, err := hdwallet.NewKey(
hdwallet.Mnemonic(cfg.Mnemonic),
hdwallet.Params(&chaincfg.Params{}),
)
if err != nil {
log.Fatal("initialize master wallet private key: ", err)
}
evmWallet, err := master.GetWallet(hdwallet.CoinType(hdwallet.ETH))
if err != nil {
log.Fatal("initialize ETH wallet: ", err)
}
...
signedTx, err := types.SignTx(blockchainTx, types.LatestSignerForChainID(chainID), evmWallet.GetKey().PrivateECDSA)
i got error with that code: private key curve is not secp256k1