web3-0.8.3.1: Ethereum API for Haskell

CopyrightKeagan McClelland 2018
LicenseBSD3
Maintainerkeagan.mcclelland@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Network.Ethereum.Api.Personal

Description

Ethereum node JSON-RPC API methods with personal_ prefix.

Synopsis

Documentation

importRawKey :: JsonRpc m => HexString -> Passphrase -> m Address #

Imports the given unencrypted private key (hex string) into the key store, encrypting it with the passphrase.

Parameters:

  1. unencrypted private key
  2. passphrase

Returns: address of new account

listAccounts :: JsonRpc m => m [Address] #

Returns all the Ethereum account addresses of all keys in the key store.

lockAccount :: JsonRpc m => Address -> m Bool #

Removes the private key with given address from memory. The account can no longer be used to send transactions.

newAccount :: JsonRpc m => Passphrase -> m Address #

Generates a new private key and stores it in the key store directory. The key file is encrypted with the given passphrase. Returns the address of the new account.

unlockAccount :: JsonRpc m => Address -> Passphrase -> m Bool #

Decrypts the key with the given address from the key store.

The unencrypted key will be held in memory until it is locked again

The account can be used with eth_sign and eth_sendTransaction while it is unlocked.

sendTransaction :: JsonRpc m => Call -> Passphrase -> m HexString #

Validate the given passphrase and submit transaction.

The transaction is the same argument as for eth_sendTransaction and contains the from address. If the passphrase can be used to decrypt the private key belonging to the transaction callFrom, the transaction is verified, signed and send onto the network. The account is not unlocked globally in the node and cannot be used in other RPC calls.

sign :: JsonRpc m => HexString -> Address -> Passphrase -> m HexString #

Returns an Ethereum specific signature with:

sign(keccak256("x19Ethereum Signed Message:n" + len(message) + message))).

when given a passphrase to decrypt the account's private key

ecRecover :: JsonRpc m => HexString -> HexString -> m Address #

Recovers address given message and signature data

Parameters:

  1. message: DATA, n bytes
  2. signature: DATA, 65 bytes

Returns: Address