Wallet class Null safety

Represents a wallet which contains the hex private key, the hex public key and the hex address. In order to create one properly, the Wallet.derive method should always be used. The associated networkInfo will be used when computing the bech32Address associated with the wallet.

Inheritance

Constructors

Wallet({required NetworkInfo networkInfo, required Uint8List address, required Uint8List privateKey, required Uint8List publicKey})
const
Wallet.convert(Wallet wallet, NetworkInfo networkInfo)
Creates a new Wallet instance based on the existent wallet for the given networkInfo.
factory
Wallet.derive(List<String> mnemonic, NetworkInfo networkInfo, {String lastDerivationPathSegment = '0'})
Derives the private key from the given mnemonic using the specified networkInfo. Optionally can define a different derivation path setting lastDerivationPathSegment.
factory
Wallet.fromJson(Map<String, dynamic> json, Uint8List privateKey)
Creates a new Wallet instance from the given json and privateKey.
factory

Properties

address Uint8List
final
bech32Address String
Returns the associated address as a Bech32 string.
read-only
bech32PublicKey String
Returns the associated publicKey as a Bech32 string
read-only
ecPublicKey ECPublicKey
Returns the associated publicKey as an ECPublicKey instance.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
networkInfo NetworkInfo
final
privateKey Uint8List
final
props List<Object>
The list of properties that will be used to determine whether two instances are equal.
read-only, override
publicKey Uint8List
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props. [...]
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
sign(Uint8List data) Uint8List
Signs the given data using the private key associated with this wallet, returning the signature bytes ASN.1 DER encoded.
signTxData(List<int> data) Uint8List
Signs the given data using the associated privateKey and encodes the signature bytes to be included inside a transaction.
toJson() Map<String, dynamic>
Converts the current Wallet instance into a JSON object. Note that the private key is not serialized for safety reasons.
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

BASE_DERIVATION_PATH → const String
"m/44'/118'/0'/0"