
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
resolution-enaqx
Advanced tools
Resolution is a library for interacting with blockchain domain names. It can be used to retrieve payment addresses and IPFS hashes for decentralized websites.
Resolution is primarily built and maintained by Unstoppable Domains.
Resolution supports different decentralized domains. Please, refer to the Top Level Domains List
For more information, see our detailed API Referrence.
Resolution can be installed with either yarn
or npm
.
yarn add @unstoppabledomains/resolution
npm install @unstoppabledomains/resolution --save
If you're interested in resolving domains via the command line, see our CLI section.
Resolution can be updated with either yarn
or npm
.
yarn upgrade @unstoppabledomains/resolution --latest
npm update @unstoppabledomains/resolution --save
Create a new project.
mkdir resolution && cd $_
yarn init -y
yarn add @unstoppabledomains/resolution
Create a new file in your project, address.js
.
const {default: Resolution} = require('@unstoppabledomains/resolution');
const resolution = new Resolution();
function resolve(domain, currency) {
resolution
.addr(domain, currency)
.then((address) => console.log(domain, 'resolves to', address))
.catch(console.error);
}
resolve('brad.crypto', 'ETH');
resolve('brad.zil', 'ZIL');
Execute the script.
$ node address.js
brad.crypto resolves to 0x8aaD44321A86b170879d7A244c1e8d360c99DdA8
brad.zil resolves to zil1yu5u4hegy9v3xgluweg4en54zm8f8auwxu0xxj
Create a new file in your project, ipfs_hash.js
.
const {default: Resolution} = require('@unstoppabledomains/resolution');
const resolution = new Resolution();
function resolveIpfsHash(domain) {
resolution
.ipfsHash(domain)
.then((hash) =>
console.log(
`You can access this website via a public IPFS gateway: https://gateway.ipfs.io/ipfs/${hash}`,
),
)
.catch(console.error);
}
resolveIpfsHash('homecakes.crypto');
Execute the script.
$ node ipfs_hash.js
You can access this website via a public IPFS gateway: https://gateway.ipfs.io/ipfs/QmVJ26hBrwwNAPVmLavEFXDUunNDXeFSeMPmHuPxKe6dJv
Create a new file in your project, custom-resolution.js
.
const {default: Resolution} = require('@unstoppabledomains/resolution');
const resolution = new Resolution();
function resolveCustomRecord(domain, record) {
resolution
.records(domain, [record])
.then((value) => console.log(`Domain ${domain} ${record} is: ${value}`))
.catch(console.error);
}
resolveCustomRecord('homecakes.crypto', 'custom.record.value');
CLI support was removed from the Resolution library starting from version 6.0. Please use the standalone CLI tool.
The default Infura key provided is rate limited and should only be used for testing. For production applications, please bring your own Infura or Alchemy RPC URL to prevent downtime.
You may want to specify a custom provider:
Default provider can be changed by changing constructor options
new Resolution(options)
or by using one of the factory methods:
Resolution.alchemy()
Resolution.infura()
Resolution.fromWeb3Version1Provider()
Resolution.fromEthersProvider()
To see all constructor options and factory methods check Unstoppable API reference.
const {default: Resolution} = require('@unstoppabledomains/resolution');
const ethereumProviderUrl = ALCHEMY_ETHEREUM_API;
const polygonProviderUrl = ALCHEMY_POLYGON_API;
// custom provider config using the `Resolution` constructor options
const resolution = new Resolution({
sourceConfig: {
uns: {
locations: {
Layer1: {
url: ethereumProviderUrl,
network: 'mainnet'
},
Layer2: {
url: polygonProviderUrl,
network: 'polygon-mainnet',
},
},
},
},
});
In some scenarios system might not be flexible enough to easy distinguish
between various Ethereum testnets on compile time. For this case Resolution
library provide a special async constructor which should be waited for
await Resolution.autonetwork(options)
. This method makes a JSON RPC
"net_version" call to the provider to get the network id.
This method configures only Uns. Zns is supported only on Zilliqa mainnet which is going to be used in any cases. You can provide a configured provider or a blockchain url as in the following example:
await Resolution.autoNetwork({
uns: {provider},
});
When resolution encounters an error it returns the error code instead of
stopping the process. Keep an eye out for return values like RECORD_NOT_FOUND
.
Use these commands to set up a local development environment (macOS Terminal or Linux shell).
Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Install concrete version of node.js
nvm install 16.15.0
Install yarn
npm install -g yarn
Clone the repository
git clone https://github.com/unstoppabledomains/resolution.git
cd resolution
Install dependencies
yarn install
$ yarn network-config:pull
$ yarn resolver-keys:pull
$ yarn config:pull
Once your app has a working Unstoppable Domains integration, register it here. Registered apps appear on the Unstoppable Domains homepage and Applications page — putting your app in front of tens of thousands of potential customers per day.
Also, every week we select a newly-integrated app to feature in the Unstoppable Update newsletter. This newsletter is delivered to straight into the inbox of ~100,000 crypto fanatics — all of whom could be new customers to grow your business.
Join our discord community and ask questions.
We're always looking for ways to improve how developers use and integrate our products into their applications. We'd love to hear about your experience to help us improve by taking our survey.
9.0.0
FAQs
Domain Resolution for blockchain domains
The npm package resolution-enaqx receives a total of 2 weekly downloads. As such, resolution-enaqx popularity was classified as not popular.
We found that resolution-enaqx 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.