@ape.swap/bonds-sdk 2.6.1-3.testshare.4 → 2.6.1-3.testshare.6
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/dist/main.js +14 -9
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -72097,14 +72097,19 @@ function generateImageFromTemplate(bondNFTData, link, apiUrl) {
|
|
|
72097
72097
|
share(link);
|
|
72098
72098
|
}
|
|
72099
72099
|
else {
|
|
72100
|
-
|
|
72101
|
-
|
|
72102
|
-
|
|
72103
|
-
|
|
72104
|
-
|
|
72105
|
-
|
|
72106
|
-
|
|
72107
|
-
|
|
72100
|
+
try {
|
|
72101
|
+
const dataImage = yield domtoimage.toJpeg(templateElement, { quality: 0.85 });
|
|
72102
|
+
const response = yield fetch(dataImage);
|
|
72103
|
+
const blob = yield response.blob();
|
|
72104
|
+
let formData = new FormData();
|
|
72105
|
+
formData.append('file', blob, fileName);
|
|
72106
|
+
yield axios.post(`${apiUrl}/cloudinary/uploadFile`, formData, {
|
|
72107
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
72108
|
+
});
|
|
72109
|
+
}
|
|
72110
|
+
catch (error) {
|
|
72111
|
+
console.error('Error upload file to cloudinary', error);
|
|
72112
|
+
}
|
|
72108
72113
|
share(link);
|
|
72109
72114
|
}
|
|
72110
72115
|
}
|
|
@@ -72120,7 +72125,7 @@ function checkImageExists(fileName) {
|
|
|
72120
72125
|
return __awaiter$9(this, void 0, void 0, function* () {
|
|
72121
72126
|
let existImg = true;
|
|
72122
72127
|
try {
|
|
72123
|
-
yield axios.get(`https://res.cloudinary.com/
|
|
72128
|
+
yield axios.get(`https://res.cloudinary.com/dtlafxop8/image/upload/v1/bond_share/${fileName}.jpg`);
|
|
72124
72129
|
}
|
|
72125
72130
|
catch (e) {
|
|
72126
72131
|
existImg = false;
|