SKALE Filestorage client tools

Usage no npm install needed!

<script type="module">
  import skalenetworkFilestorageJs from 'https://cdn.skypack.dev/@skalenetwork/filestorage-js';


SKALE Filestorage.js

A library for decentralized file storage on SKALE chains.


npm i --save @skalenetwork/filestorage-js


// Import
const FileStorage = require('@skalenetwork/filestorage-js');
const Web3 = require('web3');

// Setup with web3
const web3Provider = new Web3.providers.HttpProvider('----SKALE ENDPOINT----');
let web3 = new Web3(web3Provider);
let filestorage = new FileStorage(web3);

// Setup with host directly
let filestorage = new FileStorage(host = '----SKALE ENDPOINT----');

Upload file

// Upload file with internal signatures
filestorage.uploadFile(address, fileName, fileSize, fileBuffer, logs, privateKey);

// Upload file with external service (Metamask etc)
filestorage.uploadFile(address, fileName, fileSize, fileBuffer, logs);

Download file to browser

filestorage.downloadFileIntoBrowser(storagePath, logs);

Download file to buffer

filestorage.downloadFileIntoBuffer(storagePath, logs);

Delete file

// Delete file with internal signatures
filestorage.deleteFile(yourAddress, fileName, logs, privateKey);

// Delete file with external service (Metamask etc)
filestorage.deleteFile(yourAddress, fileName, logs);

Get file info



If you have any questions please ask our development community on Discord.