Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

vottun-web3-auth

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vottun-web3-auth

A ready-to-use Metamask integration module.

latest
npmnpm
Version
1.0.72
Version published
Weekly downloads
115
360%
Maintainers
1
Weekly downloads
 
Created
Source

Vottun Web3 Login Tool

This project is entirely developed and owned by Vottun.

Available methods

Within this npm package, you can call the following methods:

connectMetamaskWallet()

Triggers the Metamask window in order to make the user connect its wallet.
Returns true if the user successfully connects its wallet and false otherwise.
Disclaimer: the user must be on a non-private window and must have Metamask installed in its browser in order to complete this action.

connectMetamaskWallet()

Triggers the CoinbaseWallet window in order to make the user connect its wallet.
Returns true if the user successfully connects its wallet and false otherwise.
Disclaimer: the user must be on a non-private window and must have CoinbaseWallet installed in its browser in order to complete this action.

getWalletInfo()

Asks for the information related to the wallet: address, chainId.
Returns the information if the wallet is correctly connected, and null otherwise.

signMessage(origin, walletAddress, chainId)

Triggers the Metamask window in order to make the user sign an EIP191 message. Expects the following arguments:

  • origin: The URL of the origin page
  • walletAddress: The address of the connected wallet
  • chainId: The ID of the connected blockchain

Returns an object that contains the signatureHash and the nonce:

  • signatureHash: a hash that represents the result of the signature, which will have to be validated against the server in order to verify the operation
  • nonce: a unique hash used as an operation identifier, used for security purposes

Expected steps

When using this npm package in a web application, the steps that are supposed to be followed in order to achieve a successful Web3 login are:

  • Display a button that calls the connectWallet() method.
  • Retrieve the walletAddress and chainId values
  • Call the signMessage() method
  • Validate the obtained hash against the server
  • Manage the obtained accessToken as desired

Keywords

metamask

FAQs

Package last updated on 04 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