{"id":20433904,"url":"https://github.com/flashbots/web3-flashbots","last_synced_at":"2025-04-08T04:14:25.876Z","repository":{"id":38322219,"uuid":"338610509","full_name":"flashbots/web3-flashbots","owner":"flashbots","description":"Web3.py plugin for using Flashbots' bundle APIs","archived":false,"fork":false,"pushed_at":"2024-07-31T23:41:48.000Z","size":268,"stargazers_count":417,"open_issues_count":8,"forks_count":218,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-03T00:12:17.490Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/flashbots/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashbots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-13T15:56:43.000Z","updated_at":"2025-03-21T07:18:55.000Z","dependencies_parsed_at":"2024-06-18T22:44:12.667Z","dependency_job_id":"f5295be3-980e-4f85-b884-d68371e5825f","html_url":"https://github.com/flashbots/web3-flashbots","commit_stats":{"total_commits":71,"total_committers":20,"mean_commits":3.55,"dds":0.7746478873239436,"last_synced_commit":"d69f57b0f574998c232a6d74e55338fbbd344f64"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fweb3-flashbots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fweb3-flashbots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fweb3-flashbots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fweb3-flashbots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/web3-flashbots/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773719,"owners_count":20993639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:22:19.497Z","updated_at":"2025-04-08T04:14:25.860Z","avatar_url":"https://github.com/flashbots.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web3-flashbots\n\nThis library works by injecting flashbots as a new module in the Web3.py instance, which allows submitting \"bundles\" of transactions directly to miners. This is done by also creating a middleware which captures calls to `eth_sendBundle` and `eth_callBundle`, and sends them to an RPC endpoint which you have specified, which corresponds to `mev-geth`.\n\nTo apply correct headers we use the `flashbot` method which injects the correct header on POST.\n\n## Quickstart\n\n```python\nfrom eth_account.signers.local import LocalAccount\nfrom web3 import Web3, HTTPProvider\nfrom flashbots import flashbot\nfrom eth_account.account import Account\nimport os\n\nETH_ACCOUNT_SIGNATURE: LocalAccount = Account.from_key(os.environ.get(\"ETH_SIGNER_KEY\"))\n\n\nw3 = Web3(HTTPProvider(\"http://localhost:8545\"))\nflashbot(w3, ETH_ACCOUNT_SIGNATURE)\n```\n\nNow the `w3.flashbots.sendBundle` method should be available to you. Look in [examples/simple.py](./examples/simple.py) for usage examples.\n\n### Goerli\n\nTo use goerli, add the goerli relay RPC to the `flashbot` function arguments.\n\n```python\nflashbot(w3, ETH_ACCOUNT_SIGNATURE, \"https://relay-goerli.flashbots.net\")\n```\n\n## Development and testing\n\nInstall [poetry](https://python-poetry.org/)\n\nPoetry will automatically fix your venv and all packages needed.\n\n```sh\npoetry install\n```\n\nTips: PyCharm has a poetry plugin\n\n## Simple Testnet Example\n\nSee [examples/simple.py](./examples/simple.py) for environment variable definitions.\n\n```sh\npoetry shell\nETH_SENDER_KEY=\u003csender_private_key\u003e \\\nPROVIDER_URL=https://eth-holesky.g.alchemy.com/v2/\u003calchemy_key\u003e \\\nETH_SIGNER_KEY=\u003csigner_private_key\u003e \\\npython examples/simple.py\n```\n\n## Linting\n\nIt's advisable to run black with default rules for linting\n\n```sh\nsudo pip install black # Black should be installed with a global entrypoint\nblack .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fweb3-flashbots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Fweb3-flashbots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fweb3-flashbots/lists"}