EthPrivateKey class

Credentials that can sign payloads with an Ethereum private key.

Inheritance

Constructors

EthPrivateKey(Uint8List privateKey)
Creates a private key from a byte array representation.
EthPrivateKey.createRandom(Random random)
Creates a new, random private key from the random number generator.
factory
EthPrivateKey.fromHex(String hex)
Parses a private key from a hexadecimal representation.
EthPrivateKey.fromInt(BigInt privateKeyInt)
Creates a private key from the underlying number.

Properties

address EthereumAddress
The ethereum address belonging to this credential.
no setteroverride
encodedPublicKey Uint8List
Get the encoded public key in an (uncompressed) byte representation.
no setter
hashCode int
The hash code for this object.
no setteroverride
isolateSafe bool
Whether these Credentials are safe to be copied to another isolate and can operate there. If this getter returns true, the client might chose to perform the expensive signing operations on another isolate.
final
privateKey Uint8List
final
privateKeyInt BigInt
ECC's d private parameter.
final
publicKey → ECPoint
The public key corresponding to this private key.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

extractAddress() Future<EthereumAddress>
Loads the ethereum address specified by these credentials.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign(Uint8List payload, {int? chainId, bool isEIP1559 = false}) Future<Uint8List>
Signs the payload with a private key. The output will be like the bytes representation of the eth_sign RPC method, but without the "Ethereum signed message" prefix. The payload parameter contains the raw data, not a hash.
inherited
signPersonalMessage(Uint8List payload, {int? chainId}) Future<Uint8List>
Signs an Ethereum specific signature. This method is equivalent to sign, but with a special prefix so that this method can't be used to sign, for instance, transactions.
inherited
signPersonalMessageToUint8List(Uint8List payload, {int? chainId}) Uint8List
Signs an Ethereum specific signature. This method is equivalent to signToUint8List, but with a special prefix so that this method can't be used to sign, for instance, transactions.
inherited
signToEcSignature(Uint8List payload, {int? chainId, bool isEIP1559 = false}) MsgSignature
Signs the payload with a private key and returns the obtained signature.
override
signToSignature(Uint8List payload, {int? chainId, bool isEIP1559 = false}) Future<MsgSignature>
Signs the payload with a private key and returns the obtained signature.
override
signToUint8List(Uint8List payload, {int? chainId, bool isEIP1559 = false}) Uint8List
Signs the payload with a private key. The output will be like the bytes representation of the eth_sign RPC method, but without the "Ethereum signed message" prefix. The payload parameter contains the raw data, not a hash.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override