BlueWallet / LndHub

Wrapper for Lightning Network Daemon. It provides separate accounts for end-users
http://LndHub.io
MIT License
752 stars 185 forks source link

API / schema questions #309

Closed MG-ng closed 2 years ago

MG-ng commented 2 years ago

Hi, thanks for your responses a couple of days ago.

I've figured out that there is no route /gettx (only /gettxs) and it seems like there is no checking for the offset and limit parameter in the code: https://github.com/BlueWallet/LndHub/blob/66a54570c5a9a47f68a69f94c200ee6415204f45/controllers/api.js#L416-L443

Docs: https://github.com/BlueWallet/LndHub/blame/master/doc/Send-requirements.md#L45

I've got 2 topics of questions:

What is the preferred way of getting one transaction info? Is there a better way than to fetch all and only show the last?

Is it correct that there is no way of getting the destination, the route through the LN and the invoice after you have paid the invoice already? It's in the /payinvoice response but it doesn't seem like it is saved anywhere.

Thanks for your expertise!

xraid commented 2 years ago

all tx processed by LndHub and its connected LND wallet DB can be seen by :

LND Lightning : lncli listpayments

LND on-chain : lncli listchaintxns

MG-ng commented 2 years ago

Okay, thank you!

But it looks like there are no transactions between two members of one node as they have no preimage.

Is it purposely made so that you can't see who you sent the money to?

xraid commented 2 years ago

Accounts tx in same LndHub do not pass over the network but settles in LndHub = -flags invoices in DB as paid internally . invoices are in the LndHub´s Redis DB ...

MG-ng commented 2 years ago

Yes, I've notices that but my (last) question was a bit different. So, to conclude: 1) There is no way to reconstruct the receiver of a transaction between two members of one LndHub. (I've also checked the timestamps… They're in one case 37 (s (I think)) different)

2) There is no way of getting only one transaction from the LndHub API. You have to get all and only show those you want. (Routed ones are available via the payment hash in the LND API)

3) Details of a transaction that was routed is available in the LND API.

I just wanted to clarify that before I'm going to extend functionality that was already there. If something is wrong or you want to mention something additionally, just reopen, thanks!