Parity API


Parity is no longer being maintained, so this API will no longer be receiving active updates. It will be removed in v6.

The web3.parity object exposes modules that enable you to interact with the JSON-RPC endpoints supported by Parity that are not defined in the standard set of Ethereum JSONRPC endpoints according to EIP 1474.


The following methods are available on the web3.parity.personal namespace.

  • Delegates to personal_listAccounts RPC Method

Returns the list of known accounts.

>>> web3.parity.personal.list_accounts()
web3.parity.personal.import_raw_key(self, private_key, passphrase)
  • Delegates to personal_importRawKey RPC Method

Adds the given private_key to the node’s keychain, encrypted with the given passphrase. Returns the address of the imported account.

>>> web3.parity.personal.import_raw_key(some_private_key, 'the-passphrase')
web3.parity.personal.new_account(self, password)
  • Delegates to personal_newAccount RPC Method

Generates a new account in the node’s keychain encrypted with the given passphrase. Returns the address of the created account.

>>> web3.parity.personal.new_account('the-passphrase')
web3.parity.personal.unlock_account(self, account, passphrase, duration=None)
  • Delegates to personal_unlockAccount RPC Method

Unlocks the given account for duration seconds. If duration is None then the account will remain unlocked indefinitely. Returns boolean as to whether the account was successfully unlocked.

# Invalid call to personal_unlockAccount on Parity currently returns True, due to Parity bug
>>> web3.parity.personal.unlock_account('0xd3CdA913deB6f67967B99D67aCDFa1712C293601', 'wrong-passphrase')
>>> web3.parity.personal.unlock_account('0xd3CdA913deB6f67967B99D67aCDFa1712C293601', 'the-passphrase')
web3.parity.personal.send_transaction(self, transaction, passphrase)
  • Delegates to personal_sendTransaction RPC Method

Sends the transaction.

web3.parity.personal.sign_typed_data(self, jsonMessage, account, passphrase)
  • Delegates to personal_signTypedData RPC Method

Please note that the jsonMessage argument is the loaded JSON Object and NOT the JSON String itself.

Signs the Structured Data (or Typed Data) with the passphrase of the given account