@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 +4 -3
- package/dist/index.js +20 -8
- package/dist/index.mjs +20 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
[](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
|
|
8
|
-
|
|
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
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
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
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
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") {
|