1.2.7 • Published 12 days ago

ethstorage-sdk v1.2.7

Weekly downloads
-
License
ISC
Repository
github
Last release
12 days ago

ethstorage-sdk

Tool for uploading and downloading data for EthStorage network, utilizing the EIP-5018 standard for data.

Installation

With npm do

$ npm install ethstorage-sdk

Example

Constructor

Init ethstorage-sdk.

const { EthStorage } = require("ethstorage-sdk")

const ethStorage = new EthStorage(rpc, privateKey);

or

const ethStorage = new EthStorage(rpc, privateKey, flatDirectoryAddress);

Deploy

Deploy the implementation contract of the eip-5018 standard FlatDirectory.

// ethStorageContract is the contract address of ETHstorage deployed on L1. 
await ethStorage.deploy(ethStorageContract);

// Sepolia integrates this address internally
await ethStorage.deploySepolia();

Upload

Upload files to FlatDirectory.

// Pass the file path or file selected via browser folder.
await ethStorage.upload(fileOrPath);

or

const data = fs.readFileSync(filePath);
await ethStorage.uploadData(fileName, data);

Download

Download uploaded data from the EthStorage network.

// Since the data is downloaded from ethstorage, the provided RPC should be an ethstorage RPC.
const data = await ethStorage.download(fileName, ethStorageRpc);

or

const { Download } = require("ethstorage-sdk")
const data = await Download(ethstorageRpc, flatDirectoryAddress, fileName);
1.2.7

12 days ago

1.2.6

12 days ago

1.2.5

14 days ago

1.2.3

18 days ago

1.2.2

21 days ago

1.2.1

24 days ago

1.2.0

28 days ago

1.1.8

2 months ago

1.1.7

2 months ago

1.1.6

2 months ago

1.1.5

2 months ago

1.1.4

2 months ago

1.1.3

3 months ago

1.1.2

3 months ago

1.1.1

4 months ago

1.1.0

4 months ago

1.0.11

4 months ago

1.0.10

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

5 months ago