@zucchinifi/dapp-sdk 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,10 +2,11 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/@zucchinifi/dapp-sdk.svg)](https://www.npmjs.com/package/@zucchinifi/dapp-sdk)
4
4
 
5
- The Zucchini SDK provides a simple way for DApps to interact with the Zucchini Wallet extension.
5
+ The Zucchini SDK provides a simple way for DApps to interact with the Zucchini Wallet extension and Mini-App.
6
6
 
7
- **Zucchini Wallet is coming soon to the public!**
8
- You can view the extension on the [Chrome Web Store](https://chromewebstore.google.com/detail/zucchini/khaifnjdhfaadfhgbilokobnaalmimad).
7
+ **Zucchini Wallet is now live!**
8
+ - Desktop: [Chrome Web Store](https://chromewebstore.google.com/detail/zucchini/khaifnjdhfaadfhgbilokobnaalmimad)
9
+ - Mobile: Coming soon to the **Base App** as a Farcaster Mini-App.
9
10
 
10
11
  ## Installation
11
12
 
package/dist/index.js CHANGED
@@ -602,14 +602,26 @@ async function generateQRCode(text, options = {}) {
602
602
  logoHeight = 60
603
603
  } = options;
604
604
  try {
605
- const qrDataUrl = await import_qrcode.default.toDataURL(text, {
606
- width,
607
- margin,
608
- color,
609
- errorCorrectionLevel: "H"
610
- // High error correction for logo overlay
611
- });
612
- if (!logoUrl) {
605
+ let qrDataUrl = "";
606
+ if (typeof document === "undefined") {
607
+ const svgString = await import_qrcode.default.toString(text, {
608
+ type: "svg",
609
+ width,
610
+ margin,
611
+ color,
612
+ errorCorrectionLevel: "H"
613
+ });
614
+ const base64 = typeof Buffer !== "undefined" ? Buffer.from(svgString).toString("base64") : btoa(unescape(encodeURIComponent(svgString)));
615
+ qrDataUrl = `data:image/svg+xml;base64,${base64}`;
616
+ } else {
617
+ qrDataUrl = await import_qrcode.default.toDataURL(text, {
618
+ width,
619
+ margin,
620
+ color,
621
+ errorCorrectionLevel: "H"
622
+ });
623
+ }
624
+ if (!logoUrl || typeof document === "undefined") {
613
625
  return qrDataUrl;
614
626
  }
615
627
  if (typeof document === "undefined") {
package/dist/index.mjs CHANGED
@@ -555,14 +555,26 @@ async function generateQRCode(text, options = {}) {
555
555
  logoHeight = 60
556
556
  } = options;
557
557
  try {
558
- const qrDataUrl = await QRCode.toDataURL(text, {
559
- width,
560
- margin,
561
- color,
562
- errorCorrectionLevel: "H"
563
- // High error correction for logo overlay
564
- });
565
- if (!logoUrl) {
558
+ let qrDataUrl = "";
559
+ if (typeof document === "undefined") {
560
+ const svgString = await QRCode.toString(text, {
561
+ type: "svg",
562
+ width,
563
+ margin,
564
+ color,
565
+ errorCorrectionLevel: "H"
566
+ });
567
+ const base64 = typeof Buffer !== "undefined" ? Buffer.from(svgString).toString("base64") : btoa(unescape(encodeURIComponent(svgString)));
568
+ qrDataUrl = `data:image/svg+xml;base64,${base64}`;
569
+ } else {
570
+ qrDataUrl = await QRCode.toDataURL(text, {
571
+ width,
572
+ margin,
573
+ color,
574
+ errorCorrectionLevel: "H"
575
+ });
576
+ }
577
+ if (!logoUrl || typeof document === "undefined") {
566
578
  return qrDataUrl;
567
579
  }
568
580
  if (typeof document === "undefined") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zucchinifi/dapp-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "TypeScript SDK for Zcash self-custody browser wallet Zucchini",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",