INFURA

Dive into the specifics of connecting and using INFURA with web3stash

Initialization

To use INFURA you have to pass "INFURA" as the service name. No other name will work!

const infuraService = Web3Stash("INFURA",{projectId:"", projectSecret:""},{Infura APIconfig options})

Configuration

To use INFURA in web3stash, you need two things:

  • projectId - Project Id from infura dashboard

  • projectSecret - Project Secret from infura dashboard

Note: Use these names only while passing keys in object i.e, {projectId:"", projectSecret:""}

Optional Config Options

There are no configOptions for this service

Methods Available

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

  • Uploading JSON data

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

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

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

infuraService.uploadFile("./data.txt", {infuraServiceOptions}).then().catch()

Output

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

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

Last updated