ciori on Nostr: fiatjaf Kind of a strange question as I don't really know how clients usually handle ...
fiatjaf (npub180c…h6w6) Kind of a strange question as I don't really know how clients usually handle this kind of stuff, but let's say I want to build a relay that needs to process different Kinds requests in different manners, for example in the cashu world there are kinds that only the owner should retrieve and others that possibly anyone could ask for.
Now as I understand with #khatru based relays I don't see any problem when I need to check a new "write" event request, as it will only have one kind, but for "read" actions (I am referring to the `relay.RejectFilter` function) you have the input `filter` variable that contains the list of Kinds requested by the client, so it could be multiple kinds. In this last case, what is the best practice to handle this type of logic? Should I assume to expect only one kind from the client request and then process them "individually"? Should a relay process them in particular ways as I could get a filter with both a "private" (example: 17375) and a "public" (example: 10019) kind in the list?
Maybe the last two kinds are not a really good example as a wallet client will probably never ask them both on the same request, but you get the point. I hope I made my doubt clear.
Published at
2025-03-20 21:14:48Event JSON
{
"id": "ddd13aee5de3a4728d91d6e300370af8ac9271b7f8d017abb65e7b93c03ce9c7",
"pubkey": "bf03bdf659e463e31574aff7698cf83b4cd81ab17829c22f7d5ccf76faacdbbd",
"created_at": 1742505288,
"kind": 1,
"tags": [
[
"p",
"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"
],
[
"t",
"khatru"
]
],
"content": "nostr:npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6 Kind of a strange question as I don't really know how clients usually handle this kind of stuff, but let's say I want to build a relay that needs to process different Kinds requests in different manners, for example in the cashu world there are kinds that only the owner should retrieve and others that possibly anyone could ask for.\n\nNow as I understand with #khatru based relays I don't see any problem when I need to check a new \"write\" event request, as it will only have one kind, but for \"read\" actions (I am referring to the `relay.RejectFilter` function) you have the input `filter` variable that contains the list of Kinds requested by the client, so it could be multiple kinds. In this last case, what is the best practice to handle this type of logic? Should I assume to expect only one kind from the client request and then process them \"individually\"? Should a relay process them in particular ways as I could get a filter with both a \"private\" (example: 17375) and a \"public\" (example: 10019) kind in the list?\n\nMaybe the last two kinds are not a really good example as a wallet client will probably never ask them both on the same request, but you get the point. I hope I made my doubt clear. ",
"sig": "4f6f2b6f4f9929e3b2938e8ce6e9509f53be9c6c4ca77e93fba582fcf481e4c367e195d61c724b88782b37d5e70a9d4b6287dad61fa2b56ff55b0be91914656e"
}