TokenComputer class
Helper for slicing / composing extended token identifiers
(TICKER-randomseq[-noncehex]) and inspecting Token properties.
Constructors
- TokenComputer()
-
Creates a token computer.
const
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
-
computeExtendedIdentifier(
Token token) → String -
Returns the extended identifier (
identifier-nonceHex) for a Token. -
extractIdentifierFromExtendedIdentifier(
String identifier) → String - Extracts the base identifier (prefix?-ticker-randomSequence) from an extended identifier, dropping the trailing nonce part if any.
-
extractNonceFromExtendedIdentifier(
String identifier) → int -
Extracts the integer nonce from an extended identifier like
FOO-abcdef-0a(returns10). Returns0for fungible identifiers. -
extractTickerFromExtendedIdentifier(
String identifier) → String -
Extracts just the ticker (e.g.
FOO) from an extended identifier. -
isFungible(
Token token) → bool -
Returns
truewhen the token is fungible (nonce == 0). -
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
Constants
- maxTickerLength → const int
- Maximum ticker length.
- maxTokenPrefixLength → const int
-
Maximum length of an optional
prefix-component (e.g.nfty-). - minTickerLength → const int
- Minimum ticker length.
- minTokenPrefixLength → const int
- Minimum prefix length, when present.
- tokenRandomSequenceLength → const int
-
Length of the random sequence in a fully qualified identifier
(e.g. the
abcdefinFOO-abcdef).