encodePrivateKeyToNsec method
Encodes a Nostr privateKey
to an nsec key (bech32 encoding).
final nsecString = Nostr.instance.keysService.encodePrivateKeyToNsec(yourPrivateKey);
print(nsecString); // ...
Implementation
@override
String encodePrivateKeyToNsec(String privateKey) {
return Nostr.instance.utilsService
.encodeBech32(privateKey, NostrConstants.nsec);
}