Comment
Author: Admin | 2025-04-28
Payment (source)Sveltekit (source)Sveltekit kitchen sink (source)API ReferenceBase attributes:AttributeTypeDescriptionDefaultExampleunifiedstringOptional. A BIP-21 URIbitcoin:BC1QYLH3U67J673H6Y6ALV70M0PL2YZ53TZHVXGG7U?amount=0.00001&label=sbddesign%3A%20For%20lunch%20Tuesday&message=For%20lunch%20Tuesday&lightning=LNBC10U1P3PJ257PP5YZTKWJCZ5FTL5LAXKAV23ZMZEKAW37ZK6KMV80PK4XAEV5QHTZ7QDPDWD3XGER9WD5KWM36YPRX7U3QD36KUCMGYP282ETNV3SHJCQZPGXQYZ5VQSP5USYC4LK9CHSFP53KVCNVQ456GANH60D89REYKDNGSMTJ6YW3NHVQ9QYYSSQJCEWM5CJWZ4A6RFJX77C490YCED6PEMK0UPKXHY89CMM7SCT66K8GNEANWYKZGDRWRFJE69H9U5U0W57RRCSYSAS7GADWMZXC8C6T0SPJAZUP6bitcoinstringOptional. A bitcoin addressBC1QYLH3U67J673H6Y6ALV70M0PL2YZ53TZHVXGG7UlightningstringOptional. A Lightning invoice (BOLT-11) or offer (BOLT-12)LNBC10U1P3PJ257PP5YZTKWJCZ5FTL5LAXKAV23ZMZEKAW37ZK6KMV80PK4XAEV5QHTZ7QDPDWD3XGER9WD5KWM36YPRX7U3QD36KUCMGYP282ETNV3SHJCQZPGXQYZ5VQSP5USYC4LK9CHSFP53KVCNVQ456GANH60D89REYKDNGSMTJ6YW3NHVQ9QYYSSQJCEWM5CJWZ4A6RFJX77C490YCED6PEMK0UPKXHY89CMM7SCT66K8GNEANWYKZGDRWRFJE69H9U5U0W57RRCSYSAS7GADWMZXC8C6T0SPJAZUP6parametersstringOptional. A query string. Must be parseable by URLSearchParams?amount=0.00001&label=sbddesign%3A%20For%20lunch%20Tuesday&message=For%20lunch%20Tuesdayis-pollingbooleanOptional. A boolean value indicating whether the component should continue pollingfalsepoll-intervalnumberOptional. The frequency at which to poll in milliseconds5000debugbooleanOptional. Enable debug modefalseimage-embeddedbooleanOptional. Specify if the image should be embedded within the QR code or overlayed on top. The larger the image overlay, the higher the qr-error-correction-level neededfalseAt least one of unified, bitcoin, or lightning must be defined in order for the QR Code to render. All Bitcoin addresses and Lightning invoices will be prepended with bitcoin: and lightning: URIs, respectively. If both bitcoin and lightning are defined, a unified string of the format bitcoin:?lightning= will be passed to the QR Code. If unified is defined, bitcoin and lightning are ignored. Whatever is passed to parameters will be appended to the unified string, whether it was provided via the unified attribute or created from the bitcoin & lightning params.NOTE: There is currently no validation for the unified, bitcoin, lightning, or parameters fields. This is currently on the roadmap. Validate what you're passing in!Callback can also be given a callback property which it will poll at a given poll-interval async function checkPayment() { ... } const qr = document.getElementById('my-bitcoin-qr') qr.callback = checkPayment">script> async function checkPayment() { ... } const qr = document.getElementById('my-bitcoin-qr') qr.callback = checkPaymentscript>Styles and Other OptionsThis component is built on top of qr-code-styling, refer to their documentation for more details on their API, surfaces the majority of it:AttributeTypeDescriptionwidthnumberOptional. Width of the QR code.heightnumberOptional. Height of the QR code.typestringOptional. Type of QR code to draw. Options: 'canvas', 'svg'.marginnumberOptional. Margin around the QR code.imagestringOptional. URL of the image to overlay on the QR code.shapestringOptional. Shape of the QR code. Options: 'square', 'circle'.qr-type-numbernumberOptional. Type number
Add Comment