moontree_utils library

Constants

coin → const int
DEFAULT_ITERATIONS → const int
DEFAULT_MEMORY → const int
mainNetName → const String
testNetName → const String

Properties

addressChars String
getter/setter pair
alphanumeric String
getter/setter pair
assetBaseRegex String
getter/setter pair
assetTypeIdentifiers String
getter/setter pair
base58 String
getter/setter pair
base58Regex String
getter/setter pair
DEFAULT_SALT Uint8List
final
evrmoreMainnetChaindata Chaindata
final
evrmoreTestnetChaindata Chaindata
final
mainAssetAllowed String
getter/setter pair
mainnetConstants Constants
final
punctuation String
getter/setter pair
punctuationMinusCurrency String
getter/setter pair
punctuationNonProblematic String
getter/setter pair
punctuationProblematic String
getter/setter pair
ravencoinMainnetChaindata Chaindata
final
ravencoinTestnetChaindata Chaindata
final
subAssetBaseRegex String
getter/setter pair
testnetConstants Constants
final
verifierStringAllowed String
getter/setter pair
whiteSapce String
getter/setter pair

Functions

assetCondition(String asset) bool
base58ToH160Checked(String address) ByteData
binaryClosest({required List list, required dynamic value, Nearest type = Nearest.closest, Comparator? comp}) int
binaryInsert({required List list, required dynamic value, Comparator? comp, bool doubleAdd = false}) bool
binaryRemove({required List list, required dynamic value, Comparator? comp}) bool
binarySearch({required List list, required dynamic value, Comparator? comp}) int
cantor(int n, int m) int
gives a uniuqe int for every pair of integers, order matters. for example: cantor(0, 0); // 0 cantor(1, 0); // 1 cantor(0, 1); // 2 cantor(2, 0); // 3 cantor(1, 1); // 4 cantor(0, 2); // 5 cantor(3, 0); // 6 cantor(2, 1); // 7 cantor(1, 2); // 8 cantor(0, 3); // 9 cantor(4, 0); // 10 cantor(3, 1); // 11 cantor(2, 2); // 12 cantor(1, 3); // 13 cantor(0, 4); // 14 cantor(5, 0); // 15 cantor(4, 1); // 16 cantor(3, 2); // 17 cantor(2, 3); // 18
chooseAtRandom<T>(Iterable<T> items, [Random? generator]) → T
return a (psuedo-)random item from the iterable
decode(String encoded) Uint8List
decrypt(String hexString, CipherBase cipher) String
deterministicRandom(dynamic seed) Random
given a string a deterministic random object is returned
doLater<T>(T callback(), {Duration? wait, int? waitInSeconds, int? waitInMilliseconds}) Timer
doubleSHA256(Uint8List data) Uint8List
encode(Uint8List decoded) String
encrypt(String hexString, CipherBase cipher) String
enumerate(String text) List<int>
getChaindataFor(String chain) Chaindata
getOpCodes(Uint8List data, [dynamic offset = 0]) List<Tuple3<int, int, Uint8List>>
getRandString(int len) String
h160ToAddress(Uint8List h160, int addrType) String
hashDecode(Uint8List rawHash) String
hexToAscii(String hexString) String
invertDivisibility(int divisibility) int
maxRandomInt([dynamic seed]) int
provides a random int within range 0 - 2^32 which is the max possible range
parseAssetAndFlag(Uint8List data) → Tuple2<String, bool>?
parseAssetScript(Uint8List assetPortion) List<AssetData>
parseAssetTransfer(List<Tuple3<int, int, Uint8List>> ops, Uint8List raw) List<AssetData>
parseRawBlock(String rawBlockHex) RawBlock
parseRawTransaction(String hexData) RawTransaction
parseVoutScriptForData(Uint8List script) Iterable<VoutData>
randomBytes(int n) Uint8List
randomInRange(int min, int max, [Random? generator]) int
Generates a positive (psuedo-)random integer uniformly distributed on the range from min, inclusive, to max, exclusive.
randomString() String
range(int count, {int start = 0, int generator(int)?}) List<int>
ravenBase58Regex([bool mainnet = true]) String
readVarInt(Uint8List data, [dynamic offset = 0]) → Tuple2<int, int>
removeChars(String text, {String? chars}) String
removeCharsOtherThan(String text, {String? chars}) String
removeTrailingZeros(String n) → dynamic
rvnCondition(String address, {bool mainnet = true}) bool
simulateWait(String desc, [Duration? duration]) Future<void>
subAssetCondition(String asset) bool
unused but meant to verify a sub asset string such as: 'RAVENHEAD24#PaintedRVN5' subassets can have lowercase, we need to verify the logic is sound once this kind of functionality is called for
toHexString(String string) String
toStringOverride(dynamic object, List items, List<String> names) String
tryGuessAddressFromOpList(List<Tuple3<int, int, Uint8List>> ops, Constants networkConstants) AddressVoutData?
tryGuessAssetTagFromOpList(List<Tuple3<int, int, Uint8List>> ops) AssetTagData?
unsCondition(String address) bool
not complete. todo
validateAddressType(String address) String
returns the name of the type of address it is, if the address is preliminarily recognized as conforming to a known format from which we could potentially derive a valid RVN address
verifyValidAddress(String address) Future<String>
returns a valid RVN address from the data provided, or empty string if a valid address cannot be derived. potentially we could derivde a valid address from: a valid address asset name unstoppabledomains domain one other thing to consider - asset names are valid unstoppable domains so if we're going to support multiple of these we have to ask the user which one they want. might be too much. maybe you an turn it on in an advanced setting or something.
wholeAssetCondition(String asset) bool
unused but meant to verify a whole asset string such as: 'FANFT/RAVENHEAD24#PaintedRVN5'
zipIterable(Iterable<List> lists) List
zipMap(List names, List values) Map

Typedefs

Check<T> = bool Function(T event)
Listener<T> = void Function(T event)