lnbits doesn't support msats either

This commit is contained in:
k00b 2024-08-17 18:43:39 -05:00
parent ffc156df2b
commit d2d04ce141

View File

@ -1,3 +1,5 @@
import { msatsToSats } from '@/lib/format'
export * from 'wallets/lnbits' export * from 'wallets/lnbits'
export async function testConnectServer ({ url, invoiceKey }) { export async function testConnectServer ({ url, invoiceKey }) {
@ -14,9 +16,12 @@ export async function createInvoice (
headers.append('Content-Type', 'application/json') headers.append('Content-Type', 'application/json')
headers.append('X-Api-Key', invoiceKey) headers.append('X-Api-Key', invoiceKey)
// lnbits doesn't support msats so we have to floor to nearest sat
const sats = msatsToSats(msats)
const body = JSON.stringify({ const body = JSON.stringify({
amount: msats, amount: sats,
unit: 'msat', unit: 'sat',
expiry, expiry,
memo: description, memo: description,
out: false out: false