tuweni / org.apache.tuweni.wallet / Wallet

Wallet

class Wallet (source)

Wallet containing a private key that is secured with symmetric encryption.

This has not been audited for security concerns and should not be used in production.

This wallet encrypts the key pair at rest, and encrypts the key in memory.

Nonce is based on the password, should be instead stored in the wallet and unique.

The wallet loads from a file.

Constructors

<init>

Wallet containing a private key that is secured with symmetric encryption.

Wallet(file: Path, password: String)

Functions

address

fun address(): Address

sign

Creates and signs a transaction

fun sign(nonce: UInt256, gasPrice: Wei, gasLimit: Gas, to: Address?, value: Wei, payload: Bytes, chainId: Int?): Transaction

verify

fun verify(tx: Transaction): Boolean

Companion Object Functions

create

Creates a new wallet with that file, generating a private key and encrypting it with the password passed in.

fun create(file: Path, password: String): Wallet

open

Opens a new wallet with the file. If the file is missing, it throws an IllegalArgumentException.

fun open(file: Path, password: String): Wallet