Copyright | Keagan McClelland 2018 |
---|---|
License | BSD3 |
Maintainer | keagan.mcclelland@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
Ethereum node JSON-RPC API methods with personal_
prefix.
Synopsis
- type Passphrase = Text
- importRawKey :: JsonRpc m => HexString -> Passphrase -> m Address
- listAccounts :: JsonRpc m => m [Address]
- lockAccount :: JsonRpc m => Address -> m Bool
- newAccount :: JsonRpc m => Passphrase -> m Address
- unlockAccount :: JsonRpc m => Address -> Passphrase -> m Bool
- sendTransaction :: JsonRpc m => Call -> Passphrase -> m HexString
- sign :: JsonRpc m => HexString -> Address -> Passphrase -> m HexString
- ecRecover :: JsonRpc m => HexString -> HexString -> m Address
Documentation
type Passphrase = Text Source #
importRawKey :: JsonRpc m => HexString -> Passphrase -> m Address Source #
Imports the given unencrypted private key (hex string) into the key store, encrypting it with the passphrase.
Parameters:
- unencrypted private key
- passphrase
Returns: address of new account
listAccounts :: JsonRpc m => m [Address] Source #
Returns all the Ethereum account addresses of all keys in the key store.
lockAccount :: JsonRpc m => Address -> m Bool Source #
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 Source #
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 Source #
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 Source #
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.