NostrUtils class
This class is responsible for handling some of the helper utils of the library.
- Implemented types
Constructors
- NostrUtils({required NostrClientUtils utils})
- This class is responsible for handling some of the helper utils of the library.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
- utils → NostrClientUtils
-
General utils to be used in a whole Nostr instance.
final
Methods
-
consistent64HexChars(
String input) → String -
Generates a random 64 length hexadecimal string that is consistent with the given
input.override -
countDifficultyOfHex(
String hexString) → int -
Counts the difficulty of the given
hexString, this wis intebded t be used in the NIP 13 with this package.override -
decodeBech32(
String bech32String) → List< String> -
Decodes a bech32 string into a
hexstring and ahrphuman readable part.override -
decodeNeventToMap(
String bech32) → Map< String, dynamic> -
Decodes the given
bech32nprofile id to a map with pubkey and relays. You can encode a map to a nprofile id with encodeNProfile.override -
decodeNprofileToMap(
String bech32) → Map< String, dynamic> -
Decodes the given
bech32nprofile id to a map with pubkey and relays. You can encode a map to a nprofile id with encodeNProfile.override -
encodeBech32(
String hex, String hrp) → String -
Encodes a
hexstring into a bech32 string with ahrphuman readable part.override -
encodeNevent(
{required String eventId, required String pubkey, List< String> userRelays = const []}) → String -
Generates a nprofile id from the given
eventId,pubkeyandrelays. You can decode the generated nprofile id with decodeNeventToMap.override -
encodeNProfile(
{required String pubkey, List< String> userRelays = const []}) → String -
Generates a nprofile id from the given
pubkeyandrelays, if norelaysare given, it will be an empty list. You can decode the generated nprofile id with decodeNprofileToMap.override -
hexEncodeString(
String input) → String -
Encodes the given
inputto hex formatoverride -
isValidNip05Identifier(
String identifier) → bool -
Wether the given
identifierhas a valid format.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pubKeyFromIdentifierNip05(
{required String internetIdentifier}) → Future< String> -
Return the public key found by the NIP05 implementation via the given for the given
internetIdentifieroverride -
random64HexChars(
) → String -
Generates a randwom 64-length hexadecimal string.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
verifyNip05(
{required String internetIdentifier, required String pubKey}) → Future< bool> -
This method will verify the
internetIdentifierwith apubKeyusing the NIP05 implementation, and simply will return a Future with a bool that indicates if the verification was successful or not.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited