wallet library
Crypto wallet package for Bitcoin, Ethereum and Tron written in pure Dart.
Classes
- Address
- Represents an address.
- Bech32
- Bech32 is a dead simple wrapper around a Human Readable Part (HRP) and a bunch of bytes.
- Bech32Codec
- Bech32Decoder
- Bech32Encoder
- Bech32Validations
- Generic validations for Bech32 standard.
- Bitcoin
- BitcoinBech32
- Coin
- Ethereum
- EthereumAddress
- Represents an Ethereum address.
- ExtendedKey
- Abstract class on which ExtendedPrivateKey and ExtendedPublicKey are based.
- ExtendedPrivateKey
- An extended private key as defined by the BIP32 specification.
- ExtendedPublicKey
- An extended public key as defined by the BIP32 specification.
- PrivateKey
- Represents a private key.
- PublicKey
- Represents a public key.
- Segwit
-
A representation of a Segwit Bech32 address. This class can be used to obtain the
scriptPubKey
. - SegwitCodec
- A codec which converts a Segwit class to its String representation and vice versa.
- SegwitDecoder
- This class converts a String to a Segwit class instance.
- SegwitEncoder
- This class converts a Segwit class instance to a String.
- SegwitValidations
- Generic validations for a Segwit class.
- Tron
Constants
- bech32 → const Bech32Codec
- An instance of the default implementation of the Bech32Codec.
- bitcoin → const Bitcoin
- bitcoinbech32 → const BitcoinBech32
-
charset
→ const List<
String> - ethereum → const Ethereum
- firstHardenedChild → const int
- FirstHardenedChild is the index of the firxt "hardened" child key as per the bip32 spec
-
generator
→ const List<
int> - segwit → const SegwitCodec
- An instance of the default implementation of the SegwitCodec
- separator → const String
-
tprv
→ const List<
int> -
tpub
→ const List<
int> - tron → const Tron
-
vprv
→ const List<
int> -
vpub
→ const List<
int> -
xprv
→ const List<
int> -
xpub
→ const List<
int> -
zprv
→ const List<
int> -
zpub
→ const List<
int>
Functions
-
entropyToMnemonic(
Uint8List entropy) → List< String> -
generateMnemonic(
{int strength = 128, Uint8List randomBytes(int size) = _randomBytes}) → List< String> -
isValidTronAddress(
String address, [int version = 0x41]) → bool - Validates the given tron address.
-
mnemonicToEntropy(
List< String> mnemonic) → Uint8List -
mnemonicToSeed(
List< String> mnemonic, {String passphrase = ''}) → Uint8List -
mnemonicToSeedHex(
List< String> mnemonic, {String passphrase = ''}) → String -
validateMnemonic(
List< String> words) → bool
Exceptions / Errors
- InvalidAddress
- InvalidBach32Checksum
- InvalidBip32Checksum
- Thrown when deserializing a key with an invalid checksum.
- InvalidChildNumber
- Thrown when trying to derive a public key with a hardened child number.
- InvalidHrp
- InvalidKeyLength
- Thrown when deserializing a key which is not of correct length.
- InvalidPadding
- InvalidPath
- Thrown when trying to derive a child key with a wrong path.
- InvalidProgramLength
- InvalidSeparator
- InvalidWitnessVersion
- KeyBiggerThanOrder
- Thrown when a derived key is bigger than the order of the curve.
- KeyInfinite
- Thrown when a derived public key is infinite.
- KeyZero
- Thrown when a derived private key is zero.
- MixedCase
- OutOfBoundChars
- OutOfRangeHrpCharacters
- TooLong
- TooShortChecksum
- TooShortHrp