go-hdwallet icon indicating copy to clipboard operation
go-hdwallet copied to clipboard

Sign ETH transactions

Open kbgod opened this issue 1 year ago • 0 comments

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

kbgod avatar Jul 28 '23 15:07 kbgod