const handleName = 'web3';
const policyID = 'f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a';
// A blank Handle name should always be ignored.
if (handleName.length === 0) {
// Convert handleName to hex encoding.
const assetName = Buffer.from(handleName).toString('hex');
// Fetch matching address for the asset.
const data = await fetch(
`https://cardano-mainnet.blockfrost.io/api/v0/assets/${policyID}${assetName}/addresses`,
// Your Blockfrost API key
project_id: process.env.BLOCKFROST_API_KEY,
'Content-Type': 'application/json'
).then(res => res.json());
const [{ address }] = data;
console.log(address); // addr1qx3c9...