Ethereum address length 32 bytes result (how to change it)

106 Views Asked by At

When trying to get the balance of an Ethereum address, I get the error:

*ERROR Error: Uncaught (in promise): Error: Private key must be 32 bytes in length.*

The line for the signature is:

var signed = await this.web3.eth.accounts.signTransaction(rawData, this.wallet.privateKey.toString("Hex"));

And the var of the private key is

  var privateKey =  wallet.getPrivateKey();

I don't know what syntax to change, since an Ethereum account has 42 characters so I am so lost with this issue...

Can anyone help me?

I read some documentation about the versions of libraryis like ether.js, signingKey, byte manipulaton or Strings on ethereum´s documentation.

If some one can help me with the correct syntax or something like this will be appreciated

0

There are 0 best solutions below