Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fusion44/dart_bolt11_decoder
A decoder for BOLT11 invoices written in pure Dart
https://github.com/fusion44/dart_bolt11_decoder
Last synced: about 2 months ago
JSON representation
A decoder for BOLT11 invoices written in pure Dart
- Host: GitHub
- URL: https://github.com/fusion44/dart_bolt11_decoder
- Owner: fusion44
- License: mit
- Created: 2019-09-29T08:15:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-21T08:50:48.000Z (6 months ago)
- Last Synced: 2024-07-21T22:46:34.180Z (6 months ago)
- Language: Dart
- Homepage:
- Size: 323 KB
- Stars: 8
- Watchers: 5
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
A decoder for [BOLT #11](https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md) invoices written in pure Dart.
## Installing
With Dart:```bash
$ dart pub add bolt11_decoder
```With Flutter:
```bash
$ flutter pub add bolt11_decoder
```## Usage
A simple usage example:
```dart
import 'package:bolt11_decoder/bolt11_decoder.dart';void main() {
var req = Bolt11PaymentRequest(
'lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d73gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ecky03ylcqca784w');
print('amount: ${req.amount}');
// => amount: 0
print('timestamp: ${req.timestamp}');
// => timestamp: 1496314658req.tags.forEach((TaggedField? t) {
print('${t!.type}: ${t.data}');
});
// => payment_hash: 0001020304050607080900010203040506070809000102030405060708090102
// => description: Please consider supporting this project
}
```## Features and bugs
Please file feature requests and bugs at the [tracker](https://github.com/fusion44/dart_bolt11_decoder/issues).
[tracker]: http://example.com/issues/replaceme
## Credits
Much of this is based on Richard Bondis [bolt11 tutorial](https://github.com/rsbondi/bolt11-tutorial). Thanks a lot!## License
Distributed under the MIT license. See LICENSE for more information.