diff --git a/apps/web/pages/api/basenames/metadata/[tokenId].ts b/apps/web/pages/api/basenames/metadata/[tokenId].ts index 90d7857224..8a58d3b0fa 100644 --- a/apps/web/pages/api/basenames/metadata/[tokenId].ts +++ b/apps/web/pages/api/basenames/metadata/[tokenId].ts @@ -28,11 +28,11 @@ export default async function GET(request: Request) { return NextResponse.json({ error: '406: base domain name is missing' }, { status: 406 }); // Get labelhash from tokenId - const labelHash = toHex(BigInt(tokenId)); + const labelhash = toHex(BigInt(tokenId), { size: 32 }); // Convert labelhash to namehash const namehashNode = keccak256( - encodePacked(['bytes32', 'bytes32'], [namehash(baseDomainName), labelHash]), + encodePacked(['bytes32', 'bytes32'], [namehash(baseDomainName), labelhash]), ); let basenameFormatted = undefined;