Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@ensdomains/avatar-resolver
Advanced tools
Avatar resolution library for both nodejs and browser.
Avatar resolution library for both nodejs and browser.
And good to go!
# npm
npm i @ensdomains/avatar-resolver
# yarn
yarn add @ensdomains/avatar-resolver
import { StaticJsonRpcProvider } from '@ethersproject/providers';
import { AvatarResolver, utils: avtUtils } from '@ensdomains/avatar-resolver';
// const { JSDOM } = require('jsdom'); on nodejs
// const jsdom = new JSDOM().window; on nodejs
const provider = new StaticJsonRpcProvider(
...
);
...
async function getAvatar() {
const avt = new AvatarResolver(provider);
const avatarURI = await avt.getAvatar({ ens: 'tanrikulu.eth' /*, jsdomWindow: jsdom (on nodejs) */ });
// avatarURI = https://ipfs.io/ipfs/QmUShgfoZQSHK3TQyuTfUpsc8UfeNfD8KwPUvDBUdZ4nmR
}
async function getAvatarMetadata() {
const avt = new AvatarResolver(provider);
const avatarMetadata = await avt.getMetadata({ ens: 'tanrikulu.eth' });
// avatarMetadata = { image: ... , uri: ... , name: ... , description: ... }
const avatarURI = avtUtils.getImageURI({ metadata /*, jsdomWindow: jsdom (on nodejs) */ });
// avatarURI = https://ipfs.io/ipfs/QmUShgfoZQSHK3TQyuTfUpsc8UfeNfD8KwPUvDBUdZ4nmR
}
const avt = new AvatarResolver(provider, { ttl: 300 }); // 5 min response cache in memory
const avt = new AvatarResolver(provider, { ipfs: 'https://dweb.link' });
Create .env file with INFURA_KEY env variable
Build the library
Node example
node example/node.js ENS_NAME
yarn build:demo
http-server example
FAQs
Avatar resolution library for both nodejs and browser.
The npm package @ensdomains/avatar-resolver receives a total of 0 weekly downloads. As such, @ensdomains/avatar-resolver popularity was classified as not popular.
We found that @ensdomains/avatar-resolver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.