MORALIS IPFS

Dive into the specifics of connecting and using MORALIS-IPFS with web3stash

Initialization

To use MORALIS-IPFS you have to pass "MORALIS-IPFS" as service name. No other name will work!

const moralisService = Web3Stash("MORALIS-IPFS",{apiKey:""},{moralis APIconfig options})

Configuration

To use moralis in web3stash, you need one thing:

  • apiKey - API Key generated from Moralis dashboard

Note: Use these name only while passing keys in object i.e, {apiKey:"",}

Optional Config Options

You can pass config options that is available with moralis service- You can check moralis docs to check what config options are there which you can pass while initialising moralis

Methods Available

Following methods are available for this service, More will be added soon

  • Uploading Json data

moralisService.uploadJson({name:"example", url:"abc.com"}, {moralisOptions}).then().catch()
  • Uploading Image

moralisService.uploadImage("./image.png", {moralisOptions}).then().catch()
  • Uploading Video

moralisService.uploadVideo("./video.mp4", {moralisOptions}).then().catch()
  • Uploading File

moralisService.uploadFile("./data.txt", {moralisOptions}).then().catch()

Output

All the functions return id (cid) and metadata (data returned by the service on upload)

{id:"dewfnlpweurmwknrwiojhgcbxczz", metadata:{}}

Last updated