dostr_signer 0.2.0
dostr_signer: ^0.2.0 copied to clipboard
The NostrSigner interface that signers implement, and the accounts and AuthPolicy that decide when one is revealed to a relay (NIP-42) or Blossom.
example/dostr_signer_example.dart
import 'package:dostr_nip01/dostr_nip01.dart';
import 'package:dostr_signer/dostr_signer.dart';
/// Returns null when the request is rejected, cancelled, or fails.
Future<Nip01Event?> signNote(NostrSigner signer, String text) async {
try {
return await signer.sign(
Nip01Event(
pubkey: signer.publicKey,
kind: Nip01Event.kTextNoteKind,
tags: [],
content: text,
),
);
} on SignerRequestException {
return null;
}
}