Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
web3-avatar
Advanced tools
Web3 Avatar is a lightweight JavaScript library for generating beautiful gradient avatars from Ethereum addresses. This is vanilla JavaScript version of the library. If you are looking for other versions like Vue or React, please check the main repository. Inspired by Web3 Modal avatar.
See live demo on web3-avatar.netlify.app
You can install the library using npm:
npm install web3-avatar # or yarn add web3-avatar
The library exports a single function that takes two arguments: the element
to render the avatar in and the Ethereum address
to generate the avatar from. The element can be either a DOM element or a CSS selector. After the function is called, the element inline styles will be updated to render the avatar.
import createWeb3Avatar from 'web3-avatar';
createWeb3Avatar(element, address);
<div id="#avatar"></div>
import Web3Avatar from 'web3-avatar';
createWeb3Avatar('#avatar', '0x11Ed0AC7D6142481E459B6e5d4bfB5646277796f');
// or
const someElement = document.querySelector('#avatar');
createWeb3Avatar(someElement, '0x11Ed0AC7D6142481E459B6e5d4bfB5646277796f');
createWeb3Avatar(element, address)
Creates a Web3 Avatar in the given element.
element
- DOM element or CSS selectoraddress
- Ethereum addressundefined
getGradientColors(address)
Returns the gradient colors for the given Ethereum address.
address
- Ethereum addresscolors
- Array of colors for gradient in rgb formatnpm run test # or yarn test
Released under the MIT License.
FAQs
Generate beautiful Web3 address gradient avatar
The npm package web3-avatar receives a total of 199 weekly downloads. As such, web3-avatar popularity was classified as not popular.
We found that web3-avatar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.