handy-ether
v1.0.2
Published
That's a lib that provides functionalities like generating Ethereum addresses, signing messages, and verifying signatures
Downloads
5
Readme
const { generateAddress, signMessage, verifySignature } = require('ethers-crypto');
// Generate Ethereum address const { address, privateKey } = generateAddress(); console.log('Generated Address:', address); console.log('Private Key:', privateKey);
// Sign message with private key const message = 'Hello, Ethereum!'; const signature = signMessage(message, privateKey); console.log('Message Signature:', signature);
// Verify signature const isValid = verifySignature(message, signature, address); console.log('Signature Verification Result:', isValid);
generateAddress() Generates a new Ethereum address and private key.
Returns an object with address and privateKey properties.
signMessage(message, privateKey) Signs a message using the provided private key.
message: The message to be signed. privateKey: The private key used for signing the message. Returns the signature of the message.
verifySignature(message, signature, address) Verifies the signature of a message.
message: The original message. signature: The signature to be verified. address: The Ethereum address corresponding to the public key used for signing. Returns true if the signature is valid, false otherwise.
┌▄▄▄▄µ
.╓╓╓╓╓╓╓ ╓╓╟████▌╓╓ ╓▄▄╓╓╓╓,
▐███████ ███╬╬╬╬╫██ ███████▌
███╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╫██
███╬╬╬╬╬╬╬╬╬╫██╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬╫██
████████╬╬╬╬╬╬╬╬╬╫██▓▓╬╬╬╬╬╣▓▓███╬╬╬╬╬╬╬╬╬╫███████
▐██╬╬╬╬╬╬╬▓██╬╬╬╬╬╬╬╬╬╬██████████╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬██▌
▐██╬╬╬╬╬╬╬╬╬╬███╣╣█████╙╙╙╙╙╙╙╙╙╙█████╣╣▓██╬╬▒╬╬╬╬╬╬╬██▌
▐██╬╬╬╬╬╬╬╬╬╬█████▀▀▀▀▀ ▀▀▀▀▀█████╬╬╬╬╬╬╬╬╬╬██▌
└▀▀▓▓▄╬╬╬╬╬╬╬▓██▀▀⌐" ""▀▀███╬╬╬╬╬╬╬╬▓▓▀▀▀
███╬╬▒▒╬▓▓██▌"" .,, ,, "-╟██▓▓╬▒▒╬╬███
████████▓▓██▌ ▐██ ██▌ ▐██▓▓╣███████
▐██╬╬╬╬╬▓▓╣██░ ▐██ ▐██ ''███▓▓╬╬╬╬╬██▌
███╬╬╬╬╬╬╬╬╬╫██ ▐██ ██▌ ███╬╬╬╬╬╬╬╬╬╫██
███╬╬╬╬╬╬╬╬╬╫██ ▐██ `─ └─' ██▌ ███╬╬╬╬╬╬╬╬╬╫██
╙╙╟██╬╬╬╬╬╣╣▓██ ╟██████████████████████╙╙└ ╙╙╟╣╣╬╬╬╬╬██▌╙╙
^▀▀██████████⌐.╟██▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▓▓▄ ▄▄▓███████▀▀^
██████████▄▄╣▀▀▄▄▄╓╓╙╙½╓╓..:╓╓╙╙▐▄▄▀▀▀ ██████████
,,███╬╬╬╬╣╣╣██▌▄▄███▄▄╓╓▄▄▄▄▄▄▄▄µ╓╟██▄▄▄µµ╣╣╬╬╬╬╬╫██,,
▐██╬╬╬╬╬╬╬╬╬╬╬╬╣██░,╟██████████████▌,,███╬╬╬╬╬╬╬╬╬╬╬╬██▌
▐██╬╬╬╬╬╬╬╬╬╬███▓▓██▌'' '.╟██▓▓███╬╬╬╬╬╬╬╬╬╬██▌
▐██╬╬╬╬╬╬╬╫██╬╬╬╬╬▓▓╣███████████████▓▓╬╬╬╬╬███╬╬╬╬╬╬╬██▌
████████╬╬╬╬╬╬╬╬╬╫██╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬╫███████
└└└└└███╬╬╬╬╬╬╬╬╬╫██╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬╫██└└└└└
███╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╫██
▀▀▀▓▓▓▓▓▓▓▀▀▀▀▀▓▓▌╬╬╬╬╫▓▓▀▀▀▀▀▓▓▓▓▓▓▓▓▀▀
╙▀▀▀▀▀▀▀ ▀▀█▓▓▓▓▓▀▀ ▀▀▀▀▀▀▀▀
▐████▌
Make sure to include this README.md file in your project directory before publishing it to npm. This README provides installation instructions, usage examples, and an API reference for your library. Adjust it according to your specific library features and requirements.