Skip to content

LightningLike.quote ​

ts
quote(invoice: Bolt11Invoice): Promise<LnQuoteLike>

Plans the payment of an invoice. Nothing is debited.

Parameters

NameTypeDescription
invoiceBolt11InvoiceThe invoice to pay. It must name an amount. Bolt11Invoice is a string.

Returns. LnQuoteLike. A frozen payment plan: the invoice amount, the fee, the route and the total.

Throws. AmountlessInvoice, NetworkMismatch, InvalidInput, GatewayUnavailable, InsufficientBalance, Recovering, NotSupported, FederationUnreachable, Timeout, Internal, FederationClosed. InvalidInput means an expired invoice.

Example

example.ts
ts
import type { Bolt11Invoice, LightningLike } from '@fedimint/react-native'

declare const ln: LightningLike
declare const invoice: Bolt11Invoice

const quote = await ln.quote(invoice) 
console.log(quote.total())

Used in. Send, step 04