bestinslot-xyz / OPI

Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin.
Apache License 2.0
202 stars 110 forks source link

feat: fetch runes events by transaction_id #37

Closed hwnprsd closed 4 months ago

hwnprsd commented 6 months ago

Similar to https://github.com/bestinslot-xyz/OPI/pull/27, this API will help exchanges and applications verify the legitimacy of a RUNES transfer using a transaction_id.

Unlike with BRC20s, the indexer is more explicit about inputs and outputs, helping prove runes transfers easily with this API.

Sample response:

{
  "error": null,
  "result": [
    {
      "event_type": "input",
      "outpoint": "c0d2a6597018746559f5071c84d2d50d1bbf278881f3da4f6eac79d0d4513d81:1",
      "pkscript": "76a914303019947624d93a403cc980a952a05b8bfd144688ac",
      "wallet_addr": "mjukMJXd9nyceEeqRpyBjK8fHe2kTtVQ4e",
      "rune_id": "124:1",
      "amount": "100"
    },
    {
      "event_type": "output",
      "outpoint": "3a8e35371adea036aa50f8e3233150a1b0a45c584bc7b63d625e186c178822ed:1",
      "pkscript": "76a914ec340c92c428b0d7ceb5460e0d6dadf35fff515388ac",
      "wallet_addr": "n33t7m9CTN3dRH1Ywdshxh3ZpoSF1udNbW",
      "rune_id": "124:1",
      "amount": "100"
    }
  ]
}