close
Skip to content

Commit 93ff34f

Browse files
committed
nwc: floor msats to sats
1 parent a3d32c2 commit 93ff34f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • wallets/server/protocols

‎wallets/server/protocols/nwc.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { WalletPermissionsError } from '@/wallets/client/errors'
22
import { NWC_PAY_INVOICE_METHOD, nwcTryRun, supportedMethods } from '@/wallets/lib/protocols/nwc'
3+
import { msatsSatsFloor } from '@/lib/format'
34

45
export const name = 'NWC'
56

7+
// AlbyHub's NWC only invoices whole sats as of https://github.com/getAlby/hub/commit/64afc2227f128cf4cd90daf0d844af48e3513166
8+
export const receivableMsats = msatsSatsFloor
9+
610
export async function createInvoice ({ msats, description, expiry }, { url }, { signal }) {
711
const result = await nwcTryRun(
812
nwc => nwc.req('make_invoice', { amount: msats, description, expiry }),

0 commit comments

Comments
 (0)