coinley-checkout 0.8.1 → 0.8.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.
@@ -20557,7 +20557,20 @@ const QRCode = ({
|
|
20557
20557
|
let paymentData;
|
20558
20558
|
switch (network) {
|
20559
20559
|
case "algorand":
|
20560
|
-
|
20560
|
+
const merchantAddress = "5OY4UMMWLFQWB7SZZ4YZCANFSESHAURQGEJWJFV2SRLGUDSSBOWXJOEPDM";
|
20561
|
+
const amountFloat = parseFloat(amount);
|
20562
|
+
if (currency === "ALGO") {
|
20563
|
+
const microAlgos = Math.floor(amountFloat * 1e6);
|
20564
|
+
paymentData = `algorand://${merchantAddress}?amount=${microAlgos}`;
|
20565
|
+
} else {
|
20566
|
+
const tokenConfig = getTokenConfigForCurrency2(currency, "algorand");
|
20567
|
+
if (tokenConfig && tokenConfig.assetId) {
|
20568
|
+
const assetAmount = Math.floor(amountFloat * Math.pow(10, tokenConfig.decimals));
|
20569
|
+
paymentData = `algorand://${merchantAddress}?amount=${assetAmount}&asset=${tokenConfig.assetId}`;
|
20570
|
+
} else {
|
20571
|
+
paymentData = `algorand://${merchantAddress}`;
|
20572
|
+
}
|
20573
|
+
}
|
20561
20574
|
break;
|
20562
20575
|
case "tron":
|
20563
20576
|
if (currency === "TRX") {
|
@@ -20607,27 +20620,6 @@ const QRCode = ({
|
|
20607
20620
|
setQrError("Error generating payment QR code");
|
20608
20621
|
}
|
20609
20622
|
}, [walletAddress, amount, currency, network]);
|
20610
|
-
const generateAlgorandQR2 = (address, amount2, currency2) => {
|
20611
|
-
try {
|
20612
|
-
const demoAddress = "5OY4UMMWLFQWB7SZZ4YZCANFSESHAURQGEJWJFV2SRLGUDSSBOWXJOEPDM";
|
20613
|
-
const amountFloat = parseFloat(amount2);
|
20614
|
-
if (currency2 === "ALGO") {
|
20615
|
-
const microAlgos = Math.floor(amountFloat * 1e6);
|
20616
|
-
return `https://perawallet.app/qr-code-generator/?receiver=${demoAddress}&amount=${microAlgos}¬e=Demo%20Payment`;
|
20617
|
-
} else {
|
20618
|
-
const tokenConfig = getTokenConfigForCurrency2(currency2, "algorand");
|
20619
|
-
if (tokenConfig && tokenConfig.assetId) {
|
20620
|
-
const assetAmount = Math.floor(amountFloat * Math.pow(10, tokenConfig.decimals));
|
20621
|
-
return `https://perawallet.app/qr-code-generator/?receiver=${demoAddress}&amount=${assetAmount}&asset=${tokenConfig.assetId}¬e=${currency2}%20Demo%20Payment`;
|
20622
|
-
} else {
|
20623
|
-
return demoAddress;
|
20624
|
-
}
|
20625
|
-
}
|
20626
|
-
} catch (error) {
|
20627
|
-
console.error("Error generating demo Algorand QR:", error);
|
20628
|
-
return "5OY4UMMWLFQWB7SZZ4YZCANFSESHAURQGEJWJFV2SRLGUDSSBOWXJOEPDM";
|
20629
|
-
}
|
20630
|
-
};
|
20631
20623
|
const getTokenConfigForCurrency2 = (currency2, network2) => {
|
20632
20624
|
var _a2;
|
20633
20625
|
const tokenConfigs = {
|