NostrUtils class
This class is responsible for handling some of the helper utils of the library.
- Implemented types
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
hex
string and ahrp
human readable part.override -
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.override -
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.override -
encodeBech32(
String hex, String hrp) → String -
Encodes a
hex
string into a bech32 string with ahrp
human readable part.override -
encodeNevent(
{required String eventId, required String pubkey, List< String> userRelays = const []}) → String -
Generates a nprofile id from the given
eventId
,pubkey
andrelays
. 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
pubkey
andrelays
, if norelays
are given, it will be an empty list. You can decode the generated nprofile id with decodeNprofileToMap.override -
hexEncodeString(
String input) → String -
Encodes the given
input
to hex formatoverride -
isValidNip05Identifier(
String identifier) → bool -
Wether the given
identifier
has 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
internetIdentifier
override -
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
internetIdentifier
with apubKey
using 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