npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

This package has been deprecated

Author message:

“@skalenetwork/filestorage-js

@skalenetwork/filestorage-js

0.1.0 • Public • Published

SKALE Filestorage.js

A library for decentralized file storage on SKALE chains.

Install

npm i --save @skalenetwork/filestorage-js

Usage

// 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

filestorage.getFileInfoByAddress(address);

Contributing

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

Discord

Keywords

none

install

npm i @skalenetwork/filestorage-js

Downloadsweekly downloads

3

version

0.1.0

license

LGPL-3.0

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability