lnbits icon indicating copy to clipboard operation
lnbits copied to clipboard

[Feature request] Filter for outgoing/incoming transactions/payments

Open lujakob opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. I am working to implement separate lists for outgoing and incoming transactions/payments for the Alby browser extension. Currently I don't know how to filter for outgoing/incoming. The list of parameters in https://legend.lnbits.com/docs#/default/Payment_List_api_v1_payments_get does not include anything like this

Describe the solution you'd like A clear and concise description of what you want to happen.

I would like to have a filter parameter available to filter the result for outgoing and incoming payments.

In case it is already possible to do see, please let me know.

lujakob avatar Jul 21 '23 10:07 lujakob

You can do this by filtering on the amount field.

An incoming payment has an amount greater than 0 - this can be filtered by GET /api/v1/payments?amount[gt]=0 Would only return incoming payments.

Outgoing are just the reverse GET /api/v1/payments?amount[lt]=0

So it is possible, altough a bit hidden

jackstar12 avatar Jul 23 '23 18:07 jackstar12

Todo: add an explicit flag for querying incomming/outgoing (for both normal and paginated endpoints)

motorina0 avatar Jul 30 '24 11:07 motorina0