# @way-network/way-ipfs-sdk

> SDKs to interact with Way-IPFS, e.g. upload, download, etc.

Latest version **1.1.1** (published 2023-02-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install @way-network/way-ipfs-sdk
pnpm add @way-network/way-ipfs-sdk
yarn add @way-network/way-ipfs-sdk
bun add @way-network/way-ipfs-sdk
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2023-02-20 |
| First published | 2022-12-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rayguo17, lay90 |

## Links

- npm: https://www.npmjs.com/package/@way-network/way-ipfs-sdk
- npm.io page: https://npm.io/package/@way-network/way-ipfs-sdk

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^1.2.1
- [form-data](https://npm.io/package/form-data.md) ^4.0.0

## Recent versions

- 1.1.1 (latest) — 2023-02-20
- 1.1.0 — 2023-02-20
- 1.0.0 — 2022-12-28

## README

# SDK for Way-IPFS

## Install

`npm i @way-network/way-ipfs-sdk`



## Usage

> For more info, please have a look on Way-IPFS docs on Notion

```javascript
import * as waySdk from "@way-network/way-ipfs-sdk";


const urlPrefix = "http://192.168.0.182:3001";
const filePath = "<file-path>";
const uploaderAddress = "0xabc";
const downloaderAddress = "0xdef,0xijk";  // comma separated list of addresses (without spaces)
const encryptId = "0";
const signature = "<your-signature>";
const cid = "<cid>";


waySdk.uploadFile(urlPrefix, filePath, uploaderAddress, encryptId, signature).then((resp) => {
  console.log(resp);
});


const fileUrlSuffix = "db29a01786a1fc7e2ddf397311244d71";
const fileOriginalName = "example.js";
const fileMimeType = "application/javascript";
waySdk.uploadFileV2(urlPrefix, fileUrlSuffix, fileOriginalName, fileMimeType, uploaderAddress, encryptId, signature, downloaderAddress).then((resp) => {
    console.log(resp);
});

waySdk.downloadFile(urlPrefix, cid, uploaderAddress, uploaderAddress, signature).then((resp) => {
  console.log(resp);
});


waySdk.metadata(urlPrefix, cid, uploaderAddress).then((resp) => {
    console.log(resp);
});


waySdk.accessControl(urlPrefix, cid, uploaderAddress).then((resp) => {
    console.log(resp);
});


const mode = "makePublic"
waySdk.updateAccessControl(urlPrefix, cid, uploaderAddress, signature, mode).then((resp) => {
    console.log(resp);
});


waySdk.uploadedFiles(urlPrefix, uploaderAddress).then((resp) => {
    console.log(resp);
});


```

---
_Source: https://npm.io/package/@way-network/way-ipfs-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
