-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from trustenterprises/feature/ipfs-provider-fi…
…lebase Add filebase, and implement client for all metadata post requests
- Loading branch information
Showing
4 changed files
with
1,089 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { FilebaseClient } from "@filebase/client" | ||
import Config from "app/config" | ||
|
||
// Returns metadata for pinned payload | ||
async function storeData(payload) { | ||
const storage = new FilebaseClient({ token: Config.nftStorageToken }) | ||
|
||
const asBlob = new Blob([JSON.stringify(payload)]) | ||
|
||
// Assume that metadata storage, like images is already handled | ||
try { | ||
return await storage.storeBlob(asBlob) | ||
} catch (e) { | ||
return false | ||
} | ||
} | ||
|
||
export default { | ||
storeData | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.