Package for interacting with Open Zeppelin's Defender API
Using pip
$ pip install oz-defenderUsing poetry
$ poetry add oz-defenderThis package is intended to mirror as closely as possible the defender-client JavaScript package to provide a unified API across languages.
See defender-relay-client for this module's inspiration.
For the Relay API, used for administrating your team's relayers:
from oz_defender.relay import RelayClient
relay = RelayClient(api_key='defender-team-api-key', api_secret='defender-team-api-secret')
relay.list_relayers()For the Relayer API, used for transaction related operations with a specific relayer
from oz_defender.relay import RelayerClient
relayer = RelayerClient(api_key='relayer-api-key', api_secret='relayer-api-secret')
relayer.list_transactions()oz-defender is under active development so we welcome any and all contributions to improve the package!
To make it as simple as possible for us to help you, please include the following when creating an issue:
- OS
- python version
oz-defenderversion
NOTE: Unless the change you're making is minor, please open an issue in GitHub to discuss a change before opening a PR
This package is developed using poetry. Make sure its installed on your machine and peep the documentation to familiarize yourself with its commands.
- Clone this repository
$ git clone https://github.com/franklin-systems/oz-defender- Install
pre-commitand its hooks
$ pip install pre-commitor if you're using macOS
$ brew install pre-committhen
$ pre-commit install- Check out a new branch
$ git checkout my-new-feature-branch- Commit and create your PR with a detailed description and tag the GitHub issue that your work addresses
- Install (if it's your first time) or update deps
$ poetry installor
$ poetry update- Initialize a shell in
poetryvirtual env
$ poetry shell- Enter a python REPL
(oz-defender-py3.10) $ python3- Import
oz_defenderand off you go
>>> from oz_defender import *
>>> relayer = RelayerClient(api_key='relayer-api-key', api_secret='relayer-api-secret')- Quit the python REPL and re-initialize to pick up code changes as you develop