@@ -185,6 +185,33 @@ GethPersonal API
185
185
186
186
The following methods are available on the ``web3.geth.personal `` namespace.
187
187
188
+ .. py :method :: ec_recover(message, signature)
189
+
190
+ * Delegates to ``personal_ecRecover `` RPC Method
191
+
192
+ Returns the address associated with a signature created with ``personal.sign ``.
193
+
194
+ .. code-block :: python
195
+
196
+ >> > web3.geth.personal.sign(' snakesnax' , ' 0x9ad3c920dce5cea9a31d69467bb8d7c954e5acff' , ' ' )
197
+ ' 0x8eb502165dec388af1c45c4bc835fd1852eaf358316ae5d248a40af8cd8dd7dc6373a6e606d8b411f788718b8b09a6cf87d980639731f530e4481148f14abfdf1b'
198
+ >> > web3.geth.personal.ec_recover(' snakesnax' , ' 0x8eb502165dec388af1c45c4bc835fd1852eaf358316ae5d248a40af8cd8dd7dc6373a6e606d8b411f788718b8b09a6cf87d980639731f530e4481148f14abfdf1b' )
199
+ ' 0x9ad3c920dce5cea9a31d69467bb8d7c954e5acff'
200
+
201
+
202
+ .. py :method :: import_raw_key(private_key, passphrase)
203
+
204
+ * Delegates to ``personal_importRawKey `` RPC Method
205
+
206
+ Adds the given ``private_key `` to the node's keychain, encrypted with the
207
+ given ``passphrase ``. Returns the address of the imported account.
208
+
209
+ .. code-block :: python
210
+
211
+ >> > web3.geth.personal.import_raw_key(some_private_key, ' the-passphrase' )
212
+ ' 0xd3CdA913deB6f67967B99D67aCDFa1712C293601'
213
+
214
+
188
215
.. py :method :: list_accounts()
189
216
190
217
* Delegates to ``personal_listAccounts `` RPC Method
@@ -216,20 +243,19 @@ The following methods are available on the ``web3.geth.personal`` namespace.
216
243
}]
217
244
218
245
219
- .. py :method :: import_raw_key( self , private_key, passphrase )
246
+ .. py :method :: lock_account(account )
220
247
221
- * Delegates to ``personal_importRawKey `` RPC Method
248
+ * Delegates to ``personal_lockAccount `` RPC Method
222
249
223
- Adds the given ``private_key `` to the node's keychain, encrypted with the
224
- given ``passphrase ``. Returns the address of the imported account.
250
+ Locks the given ``account ``.
225
251
226
252
.. code-block :: python
227
253
228
- >> > web3.geth.personal.import_raw_key(some_private_key, ' the-passphrase ' )
229
- ' 0xd3CdA913deB6f67967B99D67aCDFa1712C293601 '
254
+ >> > web3.geth.personal.lock_account( ' 0xd3CdA913deB6f67967B99D67aCDFa1712C293601 ' )
255
+ True
230
256
231
257
232
- .. py :method :: new_account(self , passphrase)
258
+ .. py :method :: new_account(passphrase)
233
259
234
260
* Delegates to ``personal_newAccount `` RPC Method
235
261
@@ -242,18 +268,26 @@ The following methods are available on the ``web3.geth.personal`` namespace.
242
268
' 0xd3CdA913deB6f67967B99D67aCDFa1712C293601'
243
269
244
270
245
- .. py :method :: lock_account( self , account )
271
+ .. py :method :: send_transaction(transaction, passphrase )
246
272
247
- * Delegates to ``personal_lockAccount `` RPC Method
273
+ * Delegates to ``personal_sendTransaction `` RPC Method
248
274
249
- Locks the given `` account `` .
275
+ Sends the transaction .
250
276
277
+
278
+ .. py :method :: sign(message, account, passphrase)
279
+
280
+ * Delegates to ``personal_sign `` RPC Method
281
+
282
+ Generates an Ethereum-specific signature for ``keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)) ``
283
+
251
284
.. code-block :: python
252
285
253
- >> > web3.geth.personal.lock_account(' 0xd3CdA913deB6f67967B99D67aCDFa1712C293601' )
286
+ >> > web3.geth.personal.sign(' snakesnax' , ' 0x9ad3c920dce5cea9a31d69467bb8d7c954e5acff' , ' ' )
287
+ ' 0x8eb502165dec388af1c45c4bc835fd1852eaf358316ae5d248a40af8cd8dd7dc6373a6e606d8b411f788718b8b09a6cf87d980639731f530e4481148f14abfdf1b'
254
288
255
289
256
- .. py :method :: unlock_account(self , account, passphrase, duration = None )
290
+ .. py :method :: unlock_account(account, passphrase, duration = None )
257
291
258
292
* Delegates to ``personal_unlockAccount `` RPC Method
259
293
@@ -271,13 +305,6 @@ The following methods are available on the ``web3.geth.personal`` namespace.
271
305
True
272
306
273
307
274
- .. py :method :: send_transaction(self , transaction, passphrase)
275
-
276
- * Delegates to ``personal_sendTransaction `` RPC Method
277
-
278
- Sends the transaction.
279
-
280
-
281
308
.. py :module :: web3.geth.txpool
282
309
283
310
GethTxPool API
0 commit comments