This release is a pre-release and may not be stable for production use.
abstract-wallet
A software development kit for creating and managing ERC-4337 smart contract accounts on ethereum and ethereum layer-2 blockchains.
Installation
pip install abstract_wallet
Quickstart
from abstract_wallet import AbstractWallet
seed_phrase = AbstractWallet.get_random_seed_phrase()
wallet = AbstractWallet(seed_phrase, {
"provider": "https://eth-mainnet.g.alchemy.com/v2/<YOUR API-KEY>",
"url": "https://api.pimlico.io/v2/1/rpc?apikey=<YOUR API-KEY>",
"entry_point": "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
"factory": "0x9406Cc6185a346906296840746125a0E44976454"
})
account = wallet.get_account(0)
print(f"Address: {account.address}")
print(f"Balance: {account.get_balance()} wei")
Configuration
The BundlerConfig dictionary accepts the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
provider |
str |
Yes | URL of a JSON-RPC provider (e.g. Alchemy, Infura). |
url |
str |
Yes | URL of the ERC-4337 bundler (e.g. Pimlico, Stackup). |
entry_point |
str |
Yes | Address of the EntryPoint contract. |
factory |
str |
Yes | Address of a SimpleAccountFactory contract. |
paymaster |
str |
No | Address of a paymaster contract to sponsor operations. |
paymaster_data |
bytes |
No | Data to pass to the paymaster. |
Sending a user operation
hash = account.send_user_operation({
"to": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
"value": 0,
"data": b"..." # Encoded calldata
})
print(f"User operation hash: {hash}")
receipt = account.get_user_operation_receipt(hash)
Account discovery
The SDK implements the BIP-44 account discovery algorithm, scanning derivation paths until it finds a gap of 20 unused addresses:
accounts = wallet.get_accounts()
for path, account in accounts.items():
print(f"{path} -> {account.address}")
Examples
See the examples/ directory for complete, runnable scripts.
Documentation
Full API documentation is available in the docs/ directory. Open docs/index.html in your browser to browse it.
License
MIT - see LICENSE for details.
Metadata
Release files for abstract-wallet 1.0.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| abstract_wallet-1.0.0b1.tar.gz | 20.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abstract_wallet-1.0.0b1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.4 kB
Release files / abstract_wallet-1.0.0b1.tar.gz
| Download URL | abstract_wallet-1.0.0b1.tar.gz |
|---|---|
| Size | 20.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3716a2128d42a7ad18c33fece64d24b8015497f9746d6c65868d8c7b6108b2a
|
|
BLAKE2b-256 checksum How to use checksums |
0814d9efe5758370592ad37bffb0c55cfcbd575ea6a4130e652a9822ac439228
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Release files / abstract_wallet-1.0.0b1-py3-none-any.whl
| Download URL | abstract_wallet-1.0.0b1-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28d3b615f104b0dcc197da9457ff337e7714e63b8f949d43ec7c52b4de883f86
|
|
BLAKE2b-256 checksum How to use checksums |
dcb40ec0b58ee6626e341bd4600a707dc432445f9b31db36690d0cab22c949a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.0
|
Security for abstract-wallet 1.0.0b1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.