If you only want to sign a hash, you should convert your hash string to an Bytes Array first using TronWeb.utils.ethersUtils.arrayify utility function.
So I use TronWeb.utils.ethersUtils.arrayify to turn it to a Uint8Array with a length of 32.
Then pass the Uint8Array to TronLinkAdapter.signMessage.
Then I got this error from TronLink browser plugin: Failed to sign transaction by v2: Invalid transaction provided.
I have a hashed message to be signed:
0x4a3264ece439ed1a76ba692380cce39da2eb570b78b0572259fe8c0e528f30e6
, According to TronWeb doc: https://tronweb.network/docu/docs/Sign%20and%20Verify%20MessageSo I use
TronWeb.utils.ethersUtils.arrayify
to turn it to a Uint8Array with a length of 32. Then pass the Uint8Array toTronLinkAdapter.signMessage
. Then I got this error from TronLink browser plugin:Failed to sign transaction by v2: Invalid transaction provided
.Please tell me what is wrong.
https://github.com/tronprotocol/tronweb/issues/447