@lnurlp_ext.route('/api/v1/lnurl/<link_id>', methods=['GET'])
async def api_lnurl_response(link_id):
    link = (await increment_pay_link(link_id, served_meta=1))
    if (not link):
        return (jsonify({'status': 'ERROR', 'reason': 'LNURL-pay not found.'}), HTTPStatus.OK)
    rate = ((await get_fiat_rate_satoshis(link.currency)) if link.currency else 1)
    resp = LnurlPayResponse(callback=url_for('lnurlp.api_lnurl_callback', link_id=link.id, _external=True), min_sendable=(math.ceil((link.min * rate)) * 1000), max_sendable=(round((link.max * rate)) * 1000), metadata=link.lnurlpay_metadata)
    params = resp.dict()
    if (link.comment_chars > 0):
        params['commentAllowed'] = link.comment_chars
    return (jsonify(params), HTTPStatus.OK)
@lnurlp_ext.route('/api/v1/lnurl/<link_id>', methods=['GET'])
async def api_lnurl_response(link_id):
    link = (await increment_pay_link(link_id, served_meta=1))
    if (not link):
        return (jsonify({'status': 'ERROR', 'reason': 'LNURL-pay not found.'}), HTTPStatus.OK)
    rate = ((await get_fiat_rate_satoshis(link.currency)) if link.currency else 1)
    resp = LnurlPayResponse(callback=url_for('lnurlp.api_lnurl_callback', link_id=link.id, _external=True), min_sendable=(math.ceil((link.min * rate)) * 1000), max_sendable=(round((link.max * rate)) * 1000), metadata=link.lnurlpay_metadata)
    params = resp.dict()
    if (link.comment_chars > 0):
        params['commentAllowed'] = link.comment_chars
    return (jsonify(params), HTTPStatus.OK)