Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: data-provider-cascade package added #12

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ This would then convert `ipfs://<CID>` to `https://some.proxy?cid=<CID>`
### Pinning files

In order to get started with uploading data to IPFS you will need credentials to a pinning service.
Currently the pinning service supported by this library is either a local IPFS node, pinata, or infura.
Currently the pinning service supported by this library is either a local IPFS node, cascade, pinata, or infura.
Most providers are compatible with a configured version of `@lukso/data-provider-ipfs-http-client`, the pinata provider `@lukso/data-provider-pinata` allows you to configure it with the same JSON as needed for `@pinata/sdk` but otherwise also uses the standard formdata upload.
And also the cascade provider `@lukso/data-provider-cascade` is used to upload files to Cascade protocol.

For a local IPFS node running as a .mjs file.

Expand Down Expand Up @@ -96,6 +97,12 @@ const provider = new IPFSHttpClientUploader(import.meta.env.INFURA_GATEWAY, {
});
```

### Cascade

```mjs
const provider = new CascadeUploader(import.meta.env.CASCADE_API_KEY);
```

### API

You can post the data to any API which accepts formData with a file field called "file".
Expand Down Expand Up @@ -236,6 +243,7 @@ The node version of the API also supports createReadStream results (i.e. ReadStr
- `@lukso/data-provider-base`: Base data providers using formdata and url mapping libraries.
- `@lukso/data-provider-ipfs-http-client`: Custom data provider compatible ipfs-http-client (`POST /api/v0/add` only)
- `@lukso/data-provider-pinata`: Custom data provider compatible with pinata.
- `@lukso/data-provider-cascade`: Custom data provider compatible with [Cascade](https://cascade.pastel.network/).
- `@lukso/data-provider-urlresolver`: URL resolvers to map ipfs://, ar:// and so on to https:// urls.

### Useful commands
Expand Down
23 changes: 23 additions & 0 deletions etc/data-provider-cascade.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## API Report File for "@lukso/data-provider-cascade"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { BaseFormDataUploader } from '@lukso/data-provider-base';
import { FormDataPostHeaders } from '@lukso/data-provider-base';
import { FormDataRequestOptions } from '@lukso/data-provider-base';

// @public (undocumented)
class CascadeUploader extends BaseFormDataUploader {
constructor(apiKey: string);
getEndpoint(): string;
getRequestOptions(_dataContent: FormData, meta?: FormDataPostHeaders): Promise<FormDataRequestOptions>;
resolveUrl(result: any): string;
}
export { CascadeUploader }
export default CascadeUploader;

// (No @packageDocumentation comment for this package)

```
Loading
Loading