All files / test/Asset/fixtures queries.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 454x             4x                   4x               4x                     4x             4x  
export const withoutMetadata = `
  SELECT policy, name
  FROM ma_tx_mint AS mint
  JOIN multi_asset AS ma ON mint.ident = ma.id
  WHERE mint.tx_id not in (SELECT tx_id FROM tx_metadata)
  LIMIT $1`;
 
export const withCIP25Metadata = `
  SELECT policy, name, json
  FROM ma_tx_mint AS mint
  JOIN multi_asset AS ma ON mint.ident = ma.id
  JOIN tx_metadata AS meta ON meta.tx_id = mint.tx_id
  JOIN tx ON tx.id = mint.tx_id
  WHERE meta.key = 721
  ORDER BY mint.id DESC
  LIMIT $1`;
 
export const findMultiAssetHistory = `
  SELECT tx.hash AS hash, mint.quantity AS quantity
  FROM ma_tx_mint AS mint
  JOIN multi_asset AS ma ON mint.ident = ma.id
  JOIN tx ON tx.id = mint.tx_id
  WHERE ma.policy = $1 AND ma.name = $2
`;
 
export const findLastNftMintTx = `
  SELECT tx.hash AS tx_hash
  FROM ma_tx_mint AS mint
  JOIN multi_asset AS ma ON mint.ident = ma.id
  JOIN tx_metadata AS meta ON meta.tx_id = mint.tx_id
  JOIN tx ON tx.id = mint.tx_id
  WHERE ma.policy = $1 AND ma.name = $2 AND meta.key = 721
  ORDER BY mint.id DESC
  LIMIT 1
`;
 
const Queries = {
  findLastNftMintTx,
  findMultiAssetHistory,
  withCIP25Metadata,
  withoutMetadata
};
 
export default Queries;