hirosystems / ordhook

Build indexers, standards and protocols on top of Ordinals and Inscriptions (BRC20, etc).
Apache License 2.0
182 stars 54 forks source link

Add from location on inscription transfer events #225

Closed sontungpytn closed 3 months ago

sontungpytn commented 9 months ago

"inscription_transferred" event only have "destination" field, for example:

{
                "inscription_transferred": {
                  "destination": {
                    "type": "transferred",
                    "value": "bc1qctx9fzhzf4253ka7jd2s0sf5fqvzffnfvpk5wn"
                  },
                  "inscription_id": "26482871f33f1051f450f2da9af275794c0b5f1c61ebf35e4467fb42c2813403i0",
                  "post_transfer_output_value": 4562,
                  "satpoint_post_transfer": "a03017b45b99a61a69c8f4aa9e649ef476147396f59f0f75c03a156c3cc83aa5:0:0",
                  "satpoint_pre_transfer": "26482871f33f1051f450f2da9af275794c0b5f1c61ebf35e4467fb42c2813403:0:0",
                  "tx_index": 2296
                }
              }

It would be better to include both the "from" address and the "destination" address in the event, so that the event listener does not have to query them from the database history.

johnsmithfromalabama commented 5 months ago

Any workaround to get from currently?

lgalabru commented 3 months ago

When registering a predicate, you can ask to get the associated bitcoin inputs which would provide the from (in the parent payload of the inscription_transferred node)