lnbits / splitpayments

MIT License
13 stars 7 forks source link

Implement Manual Trigger Endpoint for Executing Splits on Specific Wallets #17

Open Opago-Pay opened 7 months ago

Opago-Pay commented 7 months ago

This pull request introduces a new POST endpoint that allows for the manual triggering of split executions on specific wallets.

Automatic split execution occasionally fails to trigger under certain conditions. To ensure reliability and control in these scenarios, we have developed an endpoint that addresses the challenge.

Implementation Details: Feature: A new POST endpoint is added. Functionality: This endpoint accepts a request body containing a wallet_id and an amount, enabling users to manually initiate split executions for the specified wallet.

Feedback on this implementation is welcomed to refine its functionality. We hope for collaborative improvement for the benefit of the community.

dni commented 7 months ago

thanks for the contributiuon!

Automatic split execution occasionally fails to trigger under certain conditions. To ensure reliability and control in these scenarios, we have developed an endpoint that addresses the challenge.

i don't see this as a real solution for this problem, but an additional feature, endpoint where you can just split to those users and specify a custom amount, without the need of having a payment there in the first place. this could be useful if you have an initial amount in the wallet but did not create the split yet.

there could be a button on the ui, like we have for topup wallet with distribute to splits + amount utilizing this endpoint.

dni commented 7 months ago

to the problem, maybe we can add an additional safety mechanism, where we fetch the latest 5 payments of this wallet and check if there is payment.extra.get("splitted") missing on some of those and if we retry splitting that payment on the on_invoice_paid event.

what do you think?

MichaelAntonFischer commented 7 months ago

thanks for the contributiuon!

Automatic split execution occasionally fails to trigger under certain conditions. To ensure reliability and control in these scenarios, we have developed an endpoint that addresses the challenge.

i don't see this as a real solution for this problem, but an additional feature, endpoint where you can just split to those users and specify a custom amount, without the need of having a payment there in the first place. this could be useful if you have an initial amount in the wallet but did not create the split yet.

there could be a button on the ui, like we have for topup wallet with distribute to splits + amount utilizing this endpoint.

Why not simply have an option to check after each split was triggered if there is more balance in the wallet than fee reserve and if yes, split that balance sub fee reserve?

Opago-Pay commented 5 months ago

to the problem, maybe we can add an additional safety mechanism, where we fetch the latest 5 payments of this wallet and check if there is payment.extra.get("splitted") missing on some of those and if we retry splitting that payment on the on_invoice_paid event.

what do you think?

Is the plugin flagging the incoming transactions as splitted? Upon checking it seems the extra data is only on the transactions generated by the plugin, but not the source transactions.

If it did add it to source, the best implementation would simply be both an automatic check on new invoice to see if the last few were split and an endpoint to manually check the last x transactions.