Parity API¶
Note
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.
ParityPersonal¶
The following methods are available on the web3.parity.personal namespace.
-
web3.parity.personal.list_accounts()¶ - Delegates to
personal_listAccountsRPC Method
Returns the list of known accounts.
>>> web3.parity.personal.list_accounts() ['0xd3CdA913deB6f67967B99D67aCDFa1712C293601']
- Delegates to
-
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_importRawKeyRPC Method
Adds the given
private_keyto the node’s keychain, encrypted with the givenpassphrase. Returns the address of the imported account.>>> web3.parity.personal.import_raw_key(some_private_key, 'the-passphrase') '0xd3CdA913deB6f67967B99D67aCDFa1712C293601'
- Delegates to
-
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_newAccountRPC 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'
- Delegates to
-
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_unlockAccountRPC Method
Unlocks the given
accountfordurationseconds. IfdurationisNonethen 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
- Delegates to
-
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_sendTransactionRPC Method
Sends the transaction.
- Delegates to
-
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_signTypedDataRPC Method
Please note that the
jsonMessageargument is the loaded JSON Object and NOT the JSON String itself.Signs the
Structured Data(orTyped Data) with the passphrase of the givenaccount- Delegates to
-
web3.parity.personal.signTypedData(self, jsonMessage, account, passphrase)¶ Warning
Deprecated: This method is deprecated in favor of
sign_typed_data()