I've realised I have an architectural issue with @v4vapp which I don't need everyone to understand but I need to change.
I need to move the part that does the price conversion out from being inside my private code into the code that runs on a public API.
The upshot of doing that would be that I could give an exact Lighting invoice and then guarantee a certain number of Hive or HBD would be returned if paid in the next 10 minutes.
This is a bit of work but it is essential so I will start doing it though I'm going to be tied up for the next 3 or 4 weeks. Once its done it will make everything you're trying to do here much simpler.
This is great news and would surely open up many doors for Hive apps!
I've done it... I'll be writing it up properly next week but...
https://api.v4v.app/docs#/v4vapp/new_invoice_hive_qrcode_v1_new_invoice_hive_qrcode_post
curl -X 'POST' \ 'https://api.v4v.app/v1/new_invoice_hive/qrcode' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "app_name": "live_test", "expiry": 600, "hive_accname": "brianoflondon", "message": "live testing with a unique message", "hive_amount": 1 }'
That will get you exactly 1 Hive with whatever message you put in (and only that message). You can use hbd_amount to HBD or even usd_amount to get a USD value as Hive.