NostrBech32 class

Constructors

NostrBech32.new({required NostrLogger logger})

Properties

hashCode int
The hash code for this object.
no setterinherited
logger NostrLogger
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tlv NostrTLV
This class is responsible for handling some of the helper utils of the library.
final

Methods

decodeBech32(String bech32String) List<String>
Decodes a bech32 string into a hex string and a hrp human readable part.
decodeNeventToMap(String bech32) Map<String, dynamic>
Decodes the given bech32 nprofile id to a map with pubkey and relays. You can encode a map to a nprofile id with encodeNProfile.
decodeNprofileToMap(String bech32) Map<String, dynamic>
Decodes the given bech32 nprofile id to a map with pubkey and relays. You can encode a map to a nprofile id with encodeNProfile.
decodeNpubKeyToPublicKey(String npubKey) String
Decodes a Nostr npubKey to a public key.
decodeNsecKeyToPrivateKey(String nsecKey) String
Decodes a Nostr nsecKey to a private key.
encodeBech32(String hex, String hrp) String
Encodes a hex string into a bech32 string with a hrp human readable part.
encodeNevent({required String eventId, required String pubkey, List<String> userRelays = const []}) String
Generates a nprofile id from the given eventId, pubkey and relays. You can decode the generated nprofile id with decodeNeventToMap.
encodeNProfile({required String pubkey, List<String> userRelays = const []}) String
Generates a nprofile id from the given pubkey and relays, if no relays are given, it will be an empty list. You can decode the generated nprofile id with decodeNprofileToMap.
encodePrivateKeyToNsec(String privateKey) String
Encodes a Nostr privateKey to an nsec key (bech32 encoding).
encodePublicKeyToNpub(String publicKey) String
Encodes a Nostr publicKey to an npub key (bech32 encoding).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited