ord icon indicating copy to clipboard operation
ord copied to clipboard

Add rune parameter for "ord balances" command to get only specific rune balances.

Open proskillowner opened this issue 10 months ago • 3 comments

In the current implementation, ord balances command takes too long to show all rune balances. My suggestion is to add new parameter like "--rune" to specify which rune balances want to display.

proskillowner avatar Apr 17 '24 01:04 proskillowner

@raphjaph, I started looking into this but noticed there's no straightforward way to filter outpoints eagerly by rune (spaced, id, etc.). The balances command calls (get_rune_balance)[https://github.com/ordinals/ord/blob/879cee6559718f7bd683194ac17daf00367ae3cb/src/index.rs#L1068] in the index and later decodes the rune info from the outpoint data. The rune is unknown until this point, meaning we would still need to decode all balances before filtering. It would take just as long. Any recommendations here?

ldiego08 avatar May 14 '24 22:05 ldiego08

@ldiego08 yes, we would need a separate database table for that. PR #3675 adds this. I'll have a look what the status of that PR is and then we can build this feature ontop of that

raphjaph avatar May 30 '24 16:05 raphjaph

@ldiego08 yes, we would need a separate database table for that. PR #3675 adds this. I'll have a look what the status of that PR is and then we can build this feature ontop of that

@raphjaph awesome! If there's anything I can help with, just lmk. :)

ldiego08 avatar May 30 '24 20:05 ldiego08