Zap receipts only work if the zap request event contains all the necessary data, For regular zap requests the sample code is below, and just above it is the code for fetching zap receipts

https://github.com/abh3po/nostr-polls/blob/main/src%2Fcomponents%2FCommon%2FZaps%2Fzaps.tsx#L63

I've not done zap splits , but I think the way to do it is to divide the amount and create individual invoices to the participants.

Reply to this note

Please Login to reply.

Discussion

Sweet. I think I have this working now. Any idea about zap splits?

I had given a method in the last message, but now i don't think it would work, since the user would have to individually pay those invoices, idk how amethyst does it seemlessly. Maybe worth grokking their codebase.

I have an implementation of something similar to zap splits here: https://supertestnet.github.io/nwc_prisms/

You can peep the code easily as it is all in that html file. I don't know how amethyst does it, but how I do it is, I collect all the lightning addresses of the recipients, make one invoice which the zapper pays, and then my software "manually" (technicality, it's automatic now, because it's software) pays a percentage to each of the lightning addresses in the list. It's not atomic, and I don't think Amethyst's implementation is atomic either. But it seems to work well enough.

How do I automate these

I don't know what you mean. It is software, therefore it is automatic. If you mean "how do I write/run the software," that's why I linked you to an implementation.