⛏️uploadToIPFS

Description

The uploadToIPFS function uploads JSON data to the IPFS using the Pinata API and returns the IPFS hash of the uploaded data.

Parameters

Parameter
Type
Description

pinataApiKey

string

Pinata API key

pinataSecretApiKey

string

Pinata API secret key

data

object

Data to be uploaded to IPFS

Response

Property
Type
Description

ipfsHash

string

IPFS hash of the uploaded data

Example Request and Response

Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either npm or yarn. Use the following commands to install Volary SDK:

npm install @nest25/storage-lib
OR
yarn add @nest25/storage-lib

Request

Here is an example of how to make a uploadToIPFS request using the Volary SDK:

Response

Use Cases

  • NFT Marketplaces: The function can be used by NFT marketplaces to upload NFT metadata to IPFS.

  • Decentralized Applications (DApps): The function can be used by DApps to store data, such as user profiles or transaction records, on the IPFS network.

  • Digital Asset Management: The function can be used by digital asset management systems to store and retrieve digital files, such as images or videos, on IPFS.

Last updated