1
2
3
4
5
6
7
8
9
10
11
export async function uploadTo0x0(data, name) {
const blob = new Blob([data]);
const formData = new FormData();
formData.append("file", blob, name);
formData.append("expires", "1");
const response = await fetch("https://0x0.st", {
method: "POST",
body: formData,
});
return await response.text();
}