utils library
Classes
- Base16Data
- Byte data represented by Base-16 (Hex) encoded text. @param value the data bytes
- Base58Data
- Byte data represented by Base-58 encoded text. @param value the underlying bytes data
- BifrostDateTime
- Convert Bifrost block time (secondsSinceEpoch in UTC) to DateTime and back.
- BifrostDateTimeDecoder
- BifrostDateTimeEncoder
- ByteListConverter
- DateTimeConverter
- Latin1Converter
- Latin1Data
- Byte data represented by Latin-1 encoded text. @param value the data bytes
- Latin1NullableConverter
- Network
- PolyFormatter
- POLY-specific currency formatter that expects all currency to be in nanopoly and converts it to poly (1 POLY = 1,000,000,000 nanopoly). Compact formatters replace groups of zeros with quantity abbreviation suffixes (i.e. K=thousond, M=million, B=billion & T=trillion). The simple formatters group zeros into threes. Decimal digits defaults to 6 places. The currency factory method allows complete customization.
- PropositionType
- SignatureConverter
- Uint8ListConverter
Mixins
Extensions
Constants
- addressLength → const int
- blake2b256DigestSize → const int
- bloomFilterBytes → const int
- curve25519 → const String
- curvePrefix → const int
- curveThresholdPrefix → const int
- defaultAccountIndex → const int
- defaultAddressIndex → const int
- defaultChange → const int
- 0=external/payments, 1=internal/change, 2=staking
- defaultChangeIndex → const int
- defaultCoinType → const int
- defaultPropositionPrefix → const int
- defaultPurpose → const int
- ed25519 → const String
- hardenedOffset → const int
- mainnetPrefix → const int
- maxJS → const int
- maxMnemonicValue → const int
- modifierIdSize → const int
-
networkRegistry
→ const Map<
String, int> - Container for information about topl networks
- pollingDuration → const int
- polyDateTime → const BifrostDateTime
- private → const String
- privatePrefix → const int
- pubKeyHashByte → const int
- shortNameLimit → const int
- supportedAssetCodeVersion → const int
- thresholdCurve25519 → const String
- toplnet → const String
- toplnetFee → const int
- valhalla → const String
- valhallaFee → const int
- valhallaPrefix → const int
Properties
- hexRegex → RegExp
-
final
-
networksDefault
→ Map<
String, Map< String, int> > -
final
-
privateMap
→ Map<
String, int> -
final
-
propositionMap
→ Map<
String, int> -
final
-
toplNetMap
→ Map<
String, int> -
final
-
valhallaMap
→ Map<
String, int> -
final
-
validNetworks
→ List<
String> -
final
-
validPropositionTypes
→ List<
String> -
final
Functions
-
generatePubKeyHashAddress(
Bip32PublicKey publicKey, NetworkId networkPrefix, String propositionType) → ToplAddress - Generate Hash Address using the Public Key and Network Prefix First parameter is the Base-58 encoded byte list of the public key The second parameter is the prefix of the network where the address will be used Third is the type of proposition used Returns the address and whether or not the operation was successful
-
getAddressNetwork(
String address) → Map< String, dynamic> - Returns the networkPrefix for a valid address Returns {success: boolean, networkPrefix:
-
hex(
int c) → int -
isValidHex(
String hex) → bool -
isValidMetadata(
Latin1Data? metadata) → bool - Takes in a Latin1Data and returns whether or not it is a valid data/metadata value Returns a bool about whether or not the argument is valid
-
isValidNetwork(
String networkPrefix) → bool - Validates whether the network passed in is valid
-
isValidPropositionType(
String propositionType) → bool - Validates whether the proposition passed in is valid
-
parseValue(
dynamic amount) → num -
toHex(
Uint8List bArr) → String -
toUnitList(
String str) → Uint8List -
validateAddressByNetwork(
String networkPrefix, String address) → Map< String, dynamic> - Checks if the address is valid by the following 4 steps:
-
validChecksum(
List< int> payload) → bool - Verify that the payload has not been corrupted by checking that the checksum is valid