Parity API

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.

ParityPersonal

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

web3.parity.personal.list_accounts()
  • Delegates to personal_listAccounts RPC Method

Returns the list of known accounts.

>>> web3.parity.personal.list_accounts()
['0xd3CdA913deB6f67967B99D67aCDFa1712C293601']
web3.parity.personal.listAccounts()

Warning

Deprecated: This method is deprecated in favor of 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')
'0xd3CdA913deB6f67967B99D67aCDFa1712C293601'
web3.parity.personal.importRawKey(self, private_key, passphrase)

Warning

Deprecated: This method is deprecated in favor of import_raw_key()

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')
'0xd3CdA913deB6f67967B99D67aCDFa1712C293601'
web3.parity.personal.newAccount(self, password)

Warning

Deprecated: This method is deprecated in favor of new_account()

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')
True
>>> web3.parity.personal.unlock_account('0xd3CdA913deB6f67967B99D67aCDFa1712C293601', 'the-passphrase')
True
web3.parity.personal.unlockAccount(self, account, passphrase, duration=None)

Warning

Deprecated: This method is deprecated in favor of unlock_account()

web3.parity.personal.send_transaction(self, transaction, passphrase)
  • Delegates to personal_sendTransaction RPC Method

Sends the transaction.

web3.parity.personal.sendTransaction(self, account, passphrase, duration=None)

Warning

Deprecated: This method is deprecated in favor of send_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

web3.parity.personal.signTypedData(self, jsonMessage, account, passphrase)

Warning

Deprecated: This method is deprecated in favor of sign_typed_data()