Closed lylepratt closed 2 years ago
I will make a patch with a fix for that! Thanks for reporting!
Cool! Let me know if I can do anything to help. 🍻
Hey @lylepratt I've tested the npm module and got the right result. The only thing that I had to change was the endpoint: 'https://legend.lnbits.com'
Get your credentials, don't forget the adminKey:
Then you can get your user wallet id
:
Here is the code for it:
import LNBits from '../src/index';
const init = async () => {
// Config
const { userManager } = LNBits({
adminKey: 'e1be6220afc7431f8c3c8bbe6c61b40e',
invoiceReadKey: 'fa94a6672e63434f80d3a164feca0534',
endpoint: 'https://legend.lnbits.com',
});
const tx = await userManager.getTransactions({
wallet_id: 'd0043952cc7c47a89eeaaea654350015',
});
console.log(tx);
};
init();
Howdy!
I was just testing out the
userManager.getTransactions
function, but it appears to return nothing because the API response for the endpoint that the function hits always returns nothing. I took a look at what endpoint the LNBits dashboard appears to use, and it looks like it usesapi/v1/payments
with the user's InvoiceRead Key passed as thex-api-key
parameter.Here is a CURL example that returns results: