Skip to content
Snippets Groups Projects
Commit 8665c6ac authored by poka's avatar poka
Browse files

update readme

parent e6bf65f5
Branches
No related tags found
No related merge requests found
## 0.0.1 # 0.1.0
* TODO: Describe initial release. * Migrate files from Ğazelle to split responsabilities
This diff is collapsed.
<!-- # Durt2 Library
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for ## Overview
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for Durt2 is a Dart library designed for [Duniter v2s](https://git.duniter.org/nodes/rust/duniter-v2s) blockchain and cryptocurrency management. It integrates various services, including Squid GraphQL, Duniter networks use, and secure wallet functionalities, making it an all-encompassing solution for duniter v2s related operations in Dart and Flutter applications.
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->
TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.
## Features ## Features
TODO: List what your package can do. Maybe include images, gifs, or videos. - [Polkadart](https://pub.dev/packages/polkadart) integration for accessing Duniter blockchain functionalities.
- GraphQL integration for querying blockchain data.
- Wallet services including encryption and decryption of mnemonics.
- Secure storage and retrieval of wallet information.
- Support for multiple blockchain networks (`gdev`, `gtest`, `g1`).
## Getting started ## Getting Started
TODO: List prerequisites and provide or point to information on how to To use Durt2 in your project, you need to include it in your Dart or Flutter project's dependency list.
start using the package.
## Usage ### Installation
1. Add Durt2 to your `pubspec.yaml` file:
```yaml
dependencies:
durt2: <version>
```
2. Run the following command to get the package:
```bash
flutter pub get
```
### Initialization
TODO: Include short and useful examples for package users. Add longer examples To initialize the library, you need to specify the blockchain network and the endpoints for both Duniter and Squid services.
to `/example` folder.
```dart ```dart
const like = 'sample'; import 'package:durt2/durt2.dart';
void main() async {
await Durt2.init(
network: Networks.g1, // Specify the network
duniterEndpointsJson: '<your_duniter_endpoints_json>',
squidEndpointsJson: '<your_squid_endpoints_json>',
);
// ...
}
``` ```
## Additional information ## Usage
Durt2 provides various functionalities like querying the blockchain, managing wallet info, and interacting with the Duniter network.
You need Riverpod as state manager (you can use others state manager too for the state of your app) to use some parts of this lib.
### Fetching and Displaying Account History
TODO: Tell users more about the package: where to find more information, how to Below is an example of how to fetch and display account history in a Flutter widget.
contribute to the package, how to file issues, what response they can expect
from the package authors, and more. ```dart
Widget buildHistoryView() {
final historyAsync = ref.watch(accountHistoryProvider('5FeggKqw2AbnGZF9Y9WPM2QTgzENS3Hit94Ewgmzdg5a3LNa'));
return historyAsync.when(
loading: () => const Center(child: CircularProgressIndicator()),
error: (error, _) => Center(child: Text('Error: $error')),
data: (transactions) {
if (transactions.isEmpty) {
return const Center(
child: Text('No transactions', style: TextStyle(fontSize: 16)),
);
}
return ListView.builder(
itemCount: transactions.length,
itemBuilder: (context, index) {
final transaction = transactions[index];
return YourTransactionWidget(transaction);
},
),
},
);
}
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment