Skip to content

Commit

Permalink
✨ Add ipfs tag in arweave
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Sep 20, 2023
1 parent 045b73b commit 2104fb2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions utils/arweave/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ export async function uploadSingleFileToBundlr(
}: { fileSize: number; fileType?: string, ipfsHash: string; txHash: string },
) {
const bundler = await getBundler({ fileSize, ipfsHash, txHash })
const response = await bundler.upload(file, {
tags: fileType ? [{ name: 'Content-Type', value: fileType }] : [],
})
const tags = [
{ name: 'IPFS-Add', value: ipfsHash },
{ name: 'standard', value: 'v0.1'},
];
if (fileType) tags.push({ name: 'Content-Type', value: fileType })
const response = await bundler.upload(file, { tags })
return response.id
}

0 comments on commit 2104fb2

Please sign in to comment.