Amber signer for models.
The constructor needs a ref, so you can initialize it in a custom initialization provider, for example.
AmberSigner? amberSigner; // or: late final AmberSigner amberSigner;
final customInitializationProvider = FutureProvider((ref) async {
await ref.read(initializationProvider(StorageConfiguration(...)).future);
amberSigner = AmberSigner(ref);
});Then just sign partial events:
final note = await PartialNote('hello world').signWith(amberSigner!);
// If Amber manages multiple keys, specify which:
await PartialNote('test').signWith(amberSigner!, withPubkey: pubkey);MIT