Now it can 100% be a me-only thing but the Hive Account History Operation filters make no damn sense to me and I don't think it ever will.
That does mean what I am saying is that I do not understand bitmask filters, which is something I should look into I am sure, I do recall once starting a Medium tutorial on it but I don't know if I ever finished it.
All in all , the only thing I care about is to get the account history. Usually when I do that though I need something specific. There is a good post by Ali here: @ali-h/changes-to-the-getaccounthistory-filtering-operations , in their post they get all reward types.
So yes sometimes I might care to get multiple types as in the post example which wants all curation, author and comment rewards etc.
Mostly I just want one thing.
I do tend to overcomplicate stuff so finding what I want is not always the easiest even when it is staring me in the face.
Hence ...
Back now, had to check something, and after 30minutes I realised my mask is the one that was correct and the mask in the Ali post was not right.
Anyhow the code is right just the comment with the mask filter is not correct.
So definitely follow their post to pull in only the serializer and importantly the BitMaskFilter code to calculate exact account history operations.
To break it down a bit you mainly need the BitMaskFilter function unless you understand what it does and can just write your own then stop reading smarty pants.
Something that confused me is how the map-reduce is being used, but regardless, ternaries and clever code aside the function is doing just that, reducing all the operation codes to a single Low and High bitmasked value array.
With that you technically do not need the ChainTypes file which lists all operations and their code. For some reason these codes are not present in the actual Hive chain .hpp that I could see but the libraries Hivejs and DHive or whatnot have them mapped.
https://github.com/openhive-network/hive-js/blob/bdb59cb99a0355963f8aaaf06cbf3e9b531921e2/src/auth/serializer/src/ChainTypes.js
In the post from Ali you will see how they use the op.curation_reward etc chain type to build the operations array which gets passed to the makeBitmaskFilter function.
With that, if you really only care about one type of operation and or know the codes anyhow you can just pass an array like I did in the previous screenshot - [51,2,4,70] etc.
The magical ternary bitMaskFilter function then returns you the low and high bitmask values needed to use and get only those operations from account history
As usual, this is no tutorial of any kind but merely notes to myself as I dig deeper into some things. The biggest takeaway would be, to find a reason to use bitmasking so I grok the nonsense easier.