Skip to content

Commit 6cecea2

Browse files
committed
rm log
1 parent 5239901 commit 6cecea2

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

packages/web-app/lib/ipfs.tsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
import { NFTStorage, Blob } from "nft.storage";
22
const ipfsGateway = "https://w3s.link/ipfs";
33
export const IPFSUriToUrl = (uri: string) => {
4-
return `${ipfsGateway}/${uri.split("ipfs://").pop()}`;
4+
return `${ipfsGateway}/${uri.split("ipfs://").pop()}`;
55
};
66
const client = new NFTStorage({
7-
token: process.env.NEXT_PUBLIC_NFTSTORAGE_KEY || "",
7+
token: process.env.NEXT_PUBLIC_NFTSTORAGE_KEY || "",
88
});
9-
console.log("TRIET");
10-
console.log(process.env);
11-
const objectToFile = (obj: object, filename: string) => {
12-
const blob = new Blob([JSON.stringify(obj)], { type: "application/json" });
13-
return new File([blob], filename);
14-
};
15-
const stringToFile = (str: string, filename: string) => {
16-
return new File([Buffer.from(str)], filename);
17-
};
9+
1810
export const preparePutToIPFS = async (data: string | object, filename?: string) => {
19-
const d = new Blob([JSON.stringify(data)]);
20-
const put = async () => {
21-
return await client.storeBlob(d);
22-
};
23-
return { put };
11+
const d = new Blob([JSON.stringify(data)]);
12+
const put = async () => {
13+
return await client.storeBlob(d);
14+
};
15+
return { put };
2416
};

0 commit comments

Comments
 (0)