2.0.1 • Published 9 months ago

@doichain/bcur-code-scanner-svelte v2.0.1

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

PWA QR Code Scanner with BC-UR support

QR Code scanner in a Svelte Component with BC-UR Encoding support. It is also known as "animated" QR-Codes.

BC-UR not to confuse with BBQR - Better Bitcoin QR, which isn't supported yet. Both standards are supported by major Bitcoin wallets such as Electrum, BlueWallet, Sparrow Wallet and numerous other hardware wallets.

Basic use:

Run npm i @doichain/bcur-code-scanner-svelte

<Scanner />

Custom

    let result

    <Scanner bind:result>
        <!-- Insert custom results component if you want to do something unique with the QR code data -->
		<!-- override default by placing handler in here  -->
		{#if result}
			<div>
				The result is: {result}
			</div>
			<div>
				<button on:click={() => (result = null)}>Scan again</button>
			</div>
		{/if}
	</Scanner>

Run a demo

  1. Checkout this repo and run npm i
  2. Run npm run dev