Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions brownie_safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class BrownieSafeV141(BrownieSafeBase, SafeV141):
}


def BrownieSafe(address, base_url=None, multisend=None, auth_token=None):
def BrownieSafe(address, base_url=None, multisend=None, api_key=None):
"""
Create an BrownieSafe from an address or a ENS name and use a default connection.
"""
Expand All @@ -397,9 +397,10 @@ def BrownieSafe(address, base_url=None, multisend=None, auth_token=None):
brownie_safe.transaction_service = TransactionServiceApi(ethereum_client.get_network(), ethereum_client, base_url)
brownie_safe.multisend = MultiSend(ethereum_client, multisend, call_only=True)

token = auth_token or os.environ.get("SAFE_AUTH_TOKEN")
if token:
brownie_safe.transaction_service.http_session.headers["Authorization"] = f"Bearer {token}"
api_key = os.getenv("SAFE_TRANSACTION_SERVICE_API_KEY") if api_key is None else api_key
api_key = api_key.strip() if api_key else api_key
if api_key:
brownie_safe.transaction_service.http_session.headers["Authorization"] = f"Bearer {api_key}"

return brownie_safe


4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ readme = "readme.md"
python = ">=3.10,<3.13"
# eth-brownie v1.20.7 requires web3==6.15.1
eth-brownie = ">=1.20.7"
# safe-eth-py v6.0.0 renames gnosis to safe_eth
# safe-eth-py v7.0.0 requires web3>=7.0.0
safe-eth-py = ">=6.0.0,<7"
safe-eth-py = { git = "https://github.com/wavey0x/safe-eth-py.git", branch = "wavey_edit" }
trezor = ">=0.13.8"

[tool.poetry.dev-dependencies]
Expand Down