Skip to main content

ndk_sembast 0.1.0 copy "ndk_sembast: ^0.1.0" to clipboard
ndk_sembast: ^0.1.0 copied to clipboard

A Sembast cache manager and wallets repository for NDK (Nostr Development Kit), in pure Dart with web support.

ndk_sembast #

A Sembast cache manager and wallets repository for NDK, in pure Dart.

  • SembastCacheManager persists the NDK cache, in a database file on native platforms and in IndexedDB on the web.
  • SembastWalletsRepo persists wallets. SembastWalletsRepo.create opens a database file, so it is native only; on the web, pass an opened Sembast database to the constructor.
  • No Flutter required.

Usage #

import 'package:ndk/ndk.dart';
import 'package:ndk_sembast/ndk_sembast.dart';

// databasePath is required on native platforms and ignored on the web.
final cache = await SembastCacheManager.create(databasePath: '/path/to/db');
final walletsRepo = await SembastWalletsRepo.create(filename: 'wallets.db');

final ndk = Ndk(
  NdkConfig(
    cache: cache,
    walletsRepo: walletsRepo,
    eventVerifier: Bip340EventVerifier(),
  ),
);

// ...

await ndk.destroy();
await cache.close();
await walletsRepo.close();

More in example/.

0
likes
70
points
768
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Sembast cache manager and wallets repository for NDK (Nostr Development Kit), in pure Dart with web support.

Repository (GitHub)
View/report issues

Topics

#nostr #ndk #sembast

License

MIT (license)

Dependencies

ndk, path, sembast, sembast_web

More

Packages that depend on ndk_sembast