Skip to content

Commit

Permalink
Merge pull request #12 from kleros/fix/upload-ipfs-non-directory
Browse files Browse the repository at this point in the history
Fix/upload ipfs non directory
  • Loading branch information
salgozino committed Jun 5, 2024
2 parents 37af87b + 86d59ef commit 5303f80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async function main() {
for (let attemptIPFS = 1; attemptIPFS <= 5; attemptIPFS++) {
try {
ipfsResponse = await ipfsPublish(
`${token.symbol}.png`,
`${token.symbol}`,
resizedImageBuffer,
)
console.info(` Done.`)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ipfs-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function ipfsPublish(
): Promise<{ hash: string; path: string }[]> { // Return an array of objects with a hash property
const buffer = Buffer.from(data);

const cid = await filebase.storeDirectory([new File([buffer], fileName)]);
const cid = await filebase.storeBlob(new File([buffer], fileName), fileName);

return [{ hash: cid, path: `${cid}/${fileName}` }]; // Return an array
}
Expand Down

0 comments on commit 5303f80

Please sign in to comment.