fecthInvoice method
Future<InvoiceResponse?>
fecthInvoice({
- required String lud16Link,
- required int amountSats,
- ZapRequest? zapRequest,
- String? comment,
creates an invoice with an optional zap request encoded if signer, pubKey & relays are non empty
Implementation
Future<InvoiceResponse?> fecthInvoice(
{required String lud16Link,
required int amountSats,
ZapRequest? zapRequest,
String? comment}) async {
final lnurlResponse = await _lnurl.getLnurlResponse(lud16Link);
if (lnurlResponse == null) {
return null;
}
try {
return _lnurl.fetchInvoice(
lnurlResponse: lnurlResponse, amountSats: amountSats, zapRequest: zapRequest);
} catch (e) {
Logger.log.d(e);
return null;
}
}