encodePublicKeyToNpub method

  1. @override
String encodePublicKeyToNpub(
  1. String publicKey
)
override

Encodes a Nostr publicKey to an npub key (bech32 encoding).

final npubString = Nostr.instance.keysService.encodePublicKeyToNpub(yourPublicKey);
print(npubString); // ...

Implementation

@override
String encodePublicKeyToNpub(String publicKey) {
  return Nostr.instance.utilsService
      .encodeBech32(publicKey, NostrConstants.npub);
}