bip_topl library Null safety

Support for doing something awesome.

More dartdocs go here.

Classes

Base58
Decode/Encode Bytes to Base58 String
Base58Encoder
Bip32ChildKeyDerivaton
Bip32Ed25519
This is the dart implementation of the BIP32-Ed25519 Hierarchical Deterministic Keys over a Non-linear Keyspace key derivation algorithm.
Bip32Ed25519KeyDerivation
Bip32KeyTree
Key Tree [...]
Bip32SigningKey
Bip32VerifyKey
ChainCode
Cip1852KeyTree
Using 1852' as the purpose field, we defined the following derivation path m / purpose' / coin_type' / managingWallet' / role / index Reference: CIP-1852
DefaultDictionary
Entropy
ExtendedSigningKey
MnemonicIndex
smart constructor, validate the given value fits the mnemonic index boundaries (see MAX_MNEMONIC_VALUE).
RandomBridge
Utility to use dart:math's Random class to generate numbers used by pointycastle.

Mixins

Bip32
Bip32Key
Bip32PrivateKey
Bip32PublicKey

Constants

BIP44_COIN_TYPE → const int
the BIP44 coin type is set, by default, to topl poly.
0x80001BB3
BIP44_PATH_LENGTH → const int
the BIP44 derivation path has a specific length
5
BIP44_PURPOSE → const int
the BIP44 derivation path has a specific purpose
0x8000002C
BIP44_SOFT_UPPER_BOUND → const int
the soft derivation is upper bounded
0x80000000
EXTENDED_SECRET_KEY_SIZE → const int
64
MAX_MNEMONIC_VALUE → const int
2047
PUBLIC_KEY_SIZE → const int
32
SALT_PREFIX → const String
'mnemonic'
SEED_SIZE → const int
32
XPRV_SIZE → const int
96
XPUB_SIZE → const int
64

Functions

bytesToUnsignedInt(Uint8List bytes) BigInt
This method converts bytes to an unsigned integer so that it can be used more easily by our pointycastle dependency
entropyToMnemonic(String entropyString, {String language = 'english'}) String
from_entropy_size(int len) Type
from_word_count(int len) Type
generateMnemonic(Random random, {int strength = 128, String language = 'english'}) String
This function generates a mnemonic with the given strength, language, and random number generator function (to generate random entropy). Developers should note that if you use Random.secure(), it might not be supported on all platforms (since under the hood it uses a native implementation which does not exist for some platforms i.e cross-compilation to Node).
generateSeed(Uint8List entropy, {String passphrase = ''}) Uint8List
listEquals(List<Object?>? list1, List<Object?>? list2) bool
Returns whether list1 and list2 have the same contents.
mnemonicToEntropy(dynamic mnemonic, String language) String
mnemonicToSeed(String mnemonic, {String passphrase = ''}) Uint8List
mnemonicToSeedHex(String mnemonic, {String passphrase = ''}) String
str2ByteArray(String str, {String enc = ''}) Uint8List
This is a utility function that is used by the keystore to decode strings that are used in the encrypted json
to_key_size(Type t) int
validateMnemonic(String mnemonic, String language) bool

Enums

Type

Typedefs

G = int Function()

Exceptions / Errors

InvalidBip23Ed25519DerivationKeyError
InvalidBip32Ed25519IndexException
InvalidBip32Ed25519MasterSecretException
InvalidSeedSize
InvalidSigningKeyError
InvalidXPubSize
MaxDepthExceededBip23Ed25519DerivationKeyError
MnemonicOutOfBounds
MnemonicWordNotFoundInDictionary
WrongKeySize
The entropy is of invalid size. The parameter contains the invalid size, the list of supported entropy size are described as part of the `Type`
WrongKeyType
The entropy is attempted to be generated from an invalid type. The parameter contains the invalid type, the list of supported entropy types are described as part of the `Type`
WrongNumberOfWords
Received an unsupported number of mnemonic words. The parameter contains the unsupported number. Supported values are described as part of the `Type`