docs: Added info on signMessage (#1343).

This commit is contained in:
Richard Moore 2021-06-18 16:17:26 -04:00
parent 79c5bf6bcb
commit f9d09645e7
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

@ -74,6 +74,12 @@ _property: signer.signMessage(message) => Promise<string<[RawSignature](signatur
This returns a Promise which resolves to the [[signature-raw]] This returns a Promise which resolves to the [[signature-raw]]
of //message//. of //message//.
A signed message is prefixd with ``"\\x19Ethereum signed message:\\n"`` and
the length of the message, using the [hashMessage](utils-hashMessage)
method, so that it is [EIP-191](link-eip-191) compliant. If recovering
the address in Solidity, this prefix will be required to create a matching
hash.
Sub-classes **must** implement this, however they may throw if signing a Sub-classes **must** implement this, however they may throw if signing a
message is not supported, such as in a Contract-based Wallet or message is not supported, such as in a Contract-based Wallet or
Meta-Transaction-based Wallet. Meta-Transaction-based Wallet.