1
2
3
4
5
6
7
8
9
# First of ALL, you need accounts
import secrets
from eth_account import Account
from eth_account.signers.local import LocalAccount
def generate_random_account()-> LocalAccount:
# or simply return Account.create()
return Account.from_key(f'0x{secrets.token_hex(32)}')