Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@davatar/react
Advanced tools
This library provides components that make it easy to display decentralized avatars in Web3 applications.
npm install --save @davatar/react
- or -
yarn add @davatar/react
The <Davatar />
component takes an Ethereum address, the desired avatar size, and an optional Web3 provider and displays the avatar attached to the ENS reverse record assigned to the address, if it exists. Otherwise, it displays the Jazzicon for the address.
// ...
return (
<Davatar
size={24}
address='0x00000000000000000000000'
provider={provider} // optional
graphApiKey={apiKey} // optional
generatedAvatarType='jazzicon' // optional, 'jazzicon' or 'blockies'
/>
);
// ...
If you know the avatar URI (available URI types), you can use the <Image />
component which takes an image URI, avatar size, and an optional Ethereum address, and displays the image from the URI. If the URI is undefined or null, and the address is specified, it displays a Jazzicon. It supports the following URI types:
Origin
"mutability" tags// ...
return (
<Image
size={24}
address='0x00000000000000000000000'
uri='ar://0dbf9uwer8gw7efrg9bwe08r9v90ew8'
graphApiKey={apiKey} // optional
generatedAvatarType='jazzicon' // optional, 'jazzicon' or 'blockies'
/>
);
// ...
In order to prevent unnecessary and frequent re-querying of the blockchain for avatar metadata, the library caches fetched avatar URIs for 24 hours. This cache is maintained in local storage and looks like this:
key: davatar/cache
value: [address]{ avatar url, expiredAt: expiry datetime }
> npm install
> cd example
> npm install
> npm start
This project is MIT licensed. The LICENSE file is available at the top of the repository.
FAQs
An ENS avatar implementation for React
The npm package @davatar/react receives a total of 2,075 weekly downloads. As such, @davatar/react popularity was classified as popular.
We found that @davatar/react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.