Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
TTNguyenDev committed Feb 29, 2024
1 parent 6cecea2 commit 926fef7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/web-app/lib/ipfs.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { NFTStorage, Blob } from "nft.storage";
const ipfsGateway = "https://w3s.link/ipfs";
export const IPFSUriToUrl = (uri: string) => {
return `${ipfsGateway}/${uri.split("ipfs://").pop()}`;
return `${ipfsGateway}/${uri.split("ipfs://").pop()}`;
};
const client = new NFTStorage({
token: process.env.NEXT_PUBLIC_NFTSTORAGE_KEY || "",
token: process.env.NEXT_PUBLIC_NFTSTORAGE_KEY || "",
});

export const preparePutToIPFS = async (data: string | object, filename?: string) => {
const d = new Blob([JSON.stringify(data)]);
const put = async () => {
return await client.storeBlob(d);
};
return { put };
const d = new Blob([JSON.stringify(data)]);
const put = async () => {
return await client.storeBlob(d);
};
return { put };
};

0 comments on commit 926fef7

Please sign in to comment.