Skip to content

Commit

Permalink
fix multiasset metadata endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromtcosta committed Nov 23, 2022
1 parent 1cdafaa commit 0fb7a3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/neo4j/multiAsset/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const metadata = (driver: Driver) => ({

const cypher = `MATCH (m:MINT)-[:mintedAt]->(tx:TX)
WHERE (${whereParts.join(" OR ")}) AND tx.metadata IS NOT NULL
WITH DISTINCT m.asset as asset, m.policy as policy, [apoc.coll.reverse(collect(tx.metadata))[0]] as metadatas
WITH DISTINCT m.asset as asset, m.policy as policy, collect(tx.metadata) as metadatas
WITH DISTINCT asset, policy, [metadatas[size(metadatas) - 1]] as metadatas
RETURN asset, policy, metadatas
`;

Expand Down

0 comments on commit 0fb7a3d

Please sign in to comment.