Skip to content

Commit

Permalink
fix: cip14 import
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Feb 19, 2024
1 parent 52f847a commit d39b4ac
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/routes/assets/asset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit d39b4ac

Please sign in to comment.