Send multi-line signature to Metamask via web3js

Viewed 365

Checked all the similar questions suggested and couldn't find an answer, unfortunately.

Is there a way to send a multi-line message to metamask via web3.eth.personal.sign as the first parameter? (The problem is how to get multiple lines, not how to actually send a message there)

A more eloquent example of my question can be seen in the image attached. There are multiple paragraphs on separate lines: 'Welcome to OpenSea!', 'Click "Sign" to sign in..." etc.

Thanks a lot!

Multi line message in metamask request signature event

1 Answers

You can either use \n or use instead of '' or "" when you send the message. The option with takes the spacing in the content into consideration (in js).

Related