lightsparkdev/js-sdk

execution error

Closed this issue · 3 comments

I use the lightspark payInvoice -i ticket command and the prompt given to me is as follows:

Paying an invoice with options: {
"amount": -1,
"invoice": "lnbc120n1pja97chpp5ukwlph4aycvar4gqg348v2ghe9t7cz87s3px2dz2tncukv5pmyxsdqhfahx2jm90ysyjmnkda5kxegcqzzsxqyz5vqsp5v8ah2kc3sd5lav4ppphny9n4k8g93p7hc77a5jerc72fpdaes46q9qyyssqc34w0w229jp82aq89e47upvluf7yq35ue8yavk7adka7cat7klg85nhdnt0shw5q7urznltl8wfwenarwk2gl3pjqfhu8lcla76uh2gqzguxzj"
}

Oh no, something went wrong.
LightsparkException [Error]: Request PayInvoice failed. [{"message":"You do not have enough balance, your available balance is 0 msats, which is lower than the amount to send 12000 msats. Are you using the right balance? You should check the available_to_send_balance when sending a Lightning Payment. See https://docs.lightspark.com/lightspark-sdk/api-reference/types/Balances","locations":[{"line":9,"column":5}],"path":["pay_invoice"],"extensions":{"error_name":"InvalidInputException"}}]
at Requester.makeRawRequest (file:///root/.nvm/versions/node/v18.17.0/lib/node_modules/@lightsparkdev/lightspark-cli/node_modules/@lightsparkdev/core/dist/index.js:593:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async LightsparkClient.payInvoice (file:///root/.nvm/versions/node/v18.17.0/lib/node_modules/@lightsparkdev/lightspark-cli/node_modules/@lightsparkdev/lightspark-sdk/dist/index.js:1783:22)
at async payInvoice (file:///root/.nvm/versions/node/v18.17.0/lib/node_modules/@lightsparkdev/lightspark-cli/dist/index.js:221:21)
at async main (file:///root/.nvm/versions/node/v18.17.0/lib/node_modules/@lightsparkdev/lightspark-cli/dist/index.js:16:5) {
code: 'RequestFailed',
extraInfo: undefined
}

What are msats? Why does it give me this prompt when I pay the bill normally?

@cxqi msats are millisatoshis or 0.001 satoshi. We represent amounts in msats by default.

When you pass -1 as the amount to lightspark-cli it will try to pay the entire invoice. Let us know if you're still experiencing an unexpected issue here and provide the email associated with your account so we can help investigate.

@cxqi msats are millisatoshis or 0.001 satoshi. We represent amounts in msats by default.

When you pass -1 as the amount to lightspark-cli it will try to pay the entire invoice. Let us know if you're still experiencing an unexpected issue here and provide the email associated with your account so we can help investigate.

1710142588392

Please see the picture above. I have 131sats on my account. When I go to pay the bill, it says that the available balance in the account is 0. I don’t know what is going on?

@SirSteven1 I've reached out to the email on the account above from our support platform. There's additional information about what the different account balances represent here, but essentially there is a minimum balance that is held in reserve for things like closing channels.