OrdinalNews / client

The front-end and API for inscribe.news
https://inscribe.news
17 stars 7 forks source link

Indexer: BRC-20 indexed as news #32

Open whoabuddy opened 1 year ago

whoabuddy commented 1 year ago

Would be interesting to investigate what happened here, on 1btc.news home page there is an entry with no title:

anonymous • May 4, 2023 • Inscription # 3,668,162

Looking up that inscription in the API shows it's a BRC-20 mint operation:

{"p":"brc-20","op":"mint","tick":"XUNI","amt":"1"}

https://inscribe.news/api/content/3668162

Related inscription info:

{
  "id": "0aeb138bf3e08749d2f86523bafd47787d3df178456fc362218c3d868f059d6ei0",
  "number": 3668162,
  "address": "bc1p5mf5y9lpu22qhwgy2ylvaw5cxpzxdh09d0ekwlgqxkthghx8hg6qcujzuu",
  "content_type": "text/plain;charset=utf-8",
  "content_length": 50,
  "genesis_block_height": 788323,
  "genesis_tx_id": "0aeb138bf3e08749d2f86523bafd47787d3df178456fc362218c3d868f059d6e",
  "timestamp": "2023-05-05T03:34:57.000Z",
  "last_updated": "2023-05-09T20:58:37.742Z"
}

https://inscribe.news/api/info/3668162

Code path that should've prevented this:

https://github.com/OrdinalNews/client/blob/613318139f68b0b67f0ab4a9c9827367a051d24a/lib/api-helpers.ts#L120-L125

Maybe needs a better check on news.title?