pull down to refresh

@thebullishbitcoiner
stacking since: #362080longest cowboy streak: 5
108 sats \ 1 reply \ @thebullishbitcoiner OP 28 Nov \ parent \ on: Implementing CLINK Static Offers nostr
Hmm ok. I’ll try a bit more later and keep you posted.
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();
}
};
If the pubkey and such are ok to post publicly, I can do that. I'm assuming it is since it's using the bootstrap node?
Yeah it worked on the demo site -- decoded the string and then created an invoice, hence I was excited to integrate. I will definitely look into standing up my own pub once I get this working.
Yup! I use it myself all the time and I’ll fix any issues I find. I’m always thinking about features to add that are different and cool.
For example, I just added a way to buy merch using the ecash in your wallet. 😎
Tell me more about this use case.
When I created it initially, I thought it would be cool to have it on a touchscreen display in a coffee shop. Patrons could add a message to the board by paying a lighting invoice (similar to the ones now with business cards and such).