New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lukso/eip191-signer.js

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lukso/eip191-signer.js

Helper Library to allows to sign any EIP191 data

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
increased by83.33%
Maintainers
2
Weekly downloads
 
Created
Source

eip191-signer.js · GitHub license npm version PRs Welcome

@lukso/eip191-signer.js

Helper library to sign any EIP191 data.

For more information see Documentation.

Getting Started

The @lukso/lsp6-signer.js package is used to sign an LSP6 Execute Relay Call transaction.

This library will add the \x19Execute Relay Call:\n prefix to a message and sign it.

The LSP6 ExcuteRelayCall prefix is used instead of the standard Ethereum transaction prefix to sign messages so that an executeRelayCall transaction cannot be inadvertently signed when signing an Ethereum signed message.

Install

npm install @lukso/eip191-signer.js

Usage

import { EIP191Signer } from '@lukso/eip191-signer.js';

const eip191Signer = new EIP191Signer();

hashEthereumSignedMessage

eip191Signer.hashEthereumSignedMessage(message);

Hashes the given message. The message will be enveloped as follows: '\x19' + '\x45' + 'thereum Signed Message:\n' + messageBytes.length + message and hashed using keccak256.

hashDataWithIntendedValidator

eip191Signer.hashDataWithIntendedValidator(validatorAddress, message);

Hashes the given message. The message will be enveloped as follows: '\x19' + '\x00' + validatorAddress + message and hashed using keccak256.

signEthereumSignedMessage

eip191Signer.signEthereumSignedMessage(message, signingKey);

Signs a message. The message passed as parameter will be wrapped as follows: '\x19' + '\x45' + 'thereum Signed Message:\n' + messageBytes.length + message.

signDataWithIntendedValidator

eip191Signer.signDataWithIntendedValidator(
  validatorAddress,
  message,
  signingKey,
);

Signs a message. The message passed as parameter will be wrapped as follows: '\x19' + '\x00' + validatorAddress + message.

recover

eip191Signer.recover(messageHash, signature);

Recovers the address which was used to sign the given message.

Contributing

Please check CONTRIBUTING.md.

License

eip191-signer.js is Apache 2.0 licensed.

Contributors

Magali Morin
Magali Morin

💻 ⚠️
Fabian Vogelsteller
Fabian Vogelsteller

🤔
Callum Grindle
Callum Grindle

👀 🧑‍🏫
Hugo Masclet
Hugo Masclet

👀 🧑‍🏫

FAQs

Package last updated on 28 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc