Skip to content

Commit

Permalink
Merge pull request #16 from dart-pacotes/6-enhancement-improve-docs
Browse files Browse the repository at this point in the history
enhancement: improve docs
  • Loading branch information
freitzzz authored Sep 13, 2022
2 parents c0a0212 + fcabe29 commit ffe357d
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,48 @@

Port of web3.storage SDK in Dart

Live demo: https://bafybeigtf5gnvr5fiohg7enum736ia6tteziirouf4reeqx2zgazb24bki.ipfs.dweb.link

## How to use

TBD
Before using the package, make sure you have an account in Web3.Storage and an [API Token](https://web3.storage/tokens/). Uploading a file to Web3.Storage is as simple as:

```dart
// You can grab an API Token here: https://web3.storage/tokens/
final String apiToken = '<web3.storage_api_token>';
final web3Storage = withApiToken(apiToken);
// Create file reference model of what will be uploaded to Web3.storage
final file = RawFile(
name: 'hello',
extension: 'txt',
data: Uint8List.fromList(
utf8.encode('Hello world'),
),
);
// Upload it
final result = await web3Storage.upload(file: file);
// Tadaaaaam! It should print your Web3 file IPFS CID
print(result);
```

## Features

TBD
So far the package is capable of:

- Uploading a file
- Retrieving information of a file
- Downloding a file
- Listing files using filters

Web3.Storage API errors are also typed in the package, providing you an easy way to identify issues when a request fails.

## Missing features

TBD
No CAR endpoint has been implemented yet, meaning you can not upload or retrieve `CAR` files. The upload status endpoint has also not been implemented yet.

## Side Effects

Expand Down

0 comments on commit ffe357d

Please sign in to comment.