From d39b4ac16e067169ec7f3dcb050d7be2ea48aa88 Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Mon, 19 Feb 2024 14:04:44 +0100 Subject: [PATCH] fix: cip14 import --- src/routes/assets/asset/index.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/routes/assets/asset/index.ts b/src/routes/assets/asset/index.ts index 5128e400..2b832531 100644 --- a/src/routes/assets/asset/index.ts +++ b/src/routes/assets/asset/index.ts @@ -93,10 +93,13 @@ async function route(fastify: FastifyInstance) { // retrieve off-chain metadata const metadata = await fetchAssetMetadata(request.params.asset); - const fingerprint = AssetFingerprint.fromParts( - Uint8Array.from(Buffer.from(rows[0].policy_id, 'hex')), - Uint8Array.from(Buffer.from(rows[0].asset_name ?? '', 'hex')), - ).fingerprint(); + // @ts-expect-error .default necessary due to some ESM import weirdness + const fingerprint = AssetFingerprint.default + .fromParts( + Uint8Array.from(Buffer.from(rows[0].policy_id, 'hex')), + Uint8Array.from(Buffer.from(rows[0].asset_name ?? '', 'hex')), + ) + .fingerprint(); return reply.send({ ...rows[0],