encodePrivateKeyToNsec method

  1. @override
String encodePrivateKeyToNsec(
  1. String privateKey
)
override

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);
}