Wallet class
Represents a wallet file. Wallets are used to securely store credentials like a private key belonging to an Ethereum address. The private key in a wallet is encrypted with a secret password that needs to be known in order to obtain the private key.
Constructors
- Wallet.createNew(EthPrivateKey credentials, String password, Random random, {int scryptN = 8192, int p = 1})
-
Creates a new wallet wrapping the specified
credentials
by encrypting the private key with thepassword
. Therandom
instance, which should be cryptographically secure, is used to generate encryption keys. You can configure the parameter N of the scrypt algorithm if you need to. The default value forscryptN
is 8192. Be aware that this N must be a power of two.factory - Wallet.fromJson(String encoded, String password)
-
Reads and unlocks the wallet denoted in the json string given with the
specified
password
.encoded
must be the String contents of a valid v3 Ethereum wallet file.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- privateKey → EthPrivateKey
-
The credentials stored in this wallet file
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uuid → String
-
Gets the random uuid assigned to this wallet file
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → String - Encrypts the private key using the secret specified earlier and returns a json representation of its data as a v3-wallet file.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited