pull down to refresh

I noticed the example is using SendNofferRequest while the NPM snippet is using sdk.Noffer. Does that matter?
const handleGetInvoice = async () => {
    if (!decodedOffer) {
        alert("Offer data is missing. Please decode a new offer first.");
        return;
    }

    nofferInput.disabled = true;
    offerActions.style.display = 'none';
    resultHeader.textContent = 'Invoice';
    resultData.textContent = 'Requesting invoice...';

    try {
        const amountSats = amountInput.value ? parseInt(amountInput.value, 10) : undefined;

        // Use the CLINK SDK to send a request for an invoice from the offer provider.
        // This request is sent over Nostr and signed with our ephemeral client key.
        const response = await SendNofferRequest(
            pool, clientPrivateKey, [decodedOffer.relay], decodedOffer.pubkey,
            { offer: decodedOffer.offer, amount_sats: amountSats }
        );

        if ('bolt11' in response && typeof response.bolt11 === 'string') {
            resultData.textContent = response.bolt11;
            qrCanvas.style.display = 'block';
            QRCode.toCanvas(qrCanvas, response.bolt11.toUpperCase(), { width: 256, margin: 1 });
        } else {
            resultHeader.textContent = 'Error Response';
            resultData.textContent = JSON.stringify(response, null, 2);
        }
    } catch (error) {
        console.error("Error getting invoice:", error);
        resultHeader.textContent = 'Error';
        resultData.textContent = `Error: ${error instanceof Error ? error.message : String(error)}`;
    } finally {
        isInvoiceDisplayed = true;
        decodeOfferButton.textContent = 'Reset';
        decodeOfferButton.style.display = 'block';
        scrollIntoView();
    }
};
Shouldn't matter, they're the same... sdk one just handle creating the pool
reply
Hmm ok. I’ll try a bit more later and keep you posted.
reply