https://github.com/safe-global/safe-decoder-service
Decodes transaction data providing a human readable output
https://github.com/safe-global/safe-decoder-service
Last synced: 11 months ago
JSON representation
Decodes transaction data providing a human readable output
- Host: GitHub
- URL: https://github.com/safe-global/safe-decoder-service
- Owner: safe-global
- License: mit
- Created: 2024-10-28T11:12:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-20T11:23:14.000Z (12 months ago)
- Last Synced: 2025-08-20T13:12:02.661Z (12 months ago)
- Language: Python
- Size: 268 KB
- Stars: 10
- Watchers: 6
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://github.com/safe-global/safe-decoder-service/actions/workflows/ci.yml)
[](https://coveralls.io/github/safe-global/safe-decoder-service?branch=main)
[](https://github.com/pre-commit/pre-commit)

[](https://hub.docker.com/r/safeglobal/safe-decoder-service)
# Safe Decoder Service
Decodes transaction data providing a human-readable output.
## Configuration
```bash
cp .env.sample .env
```
## Execution
```bash
docker compose build
docker compose up
```
Then go to http://localhost:8000 to see the service documentation.
## Setup for development
Use a virtualenv if possible:
```bash
python -m venv venv
```
Then enter the virtualenv and install the dependencies:
```bash
source venv/bin/activate
pip install -r requirements.txt
pre-commit install -f
cp .env.sample .env
```
### Handle migrations
This projects is using [Alembic](https://alembic.sqlalchemy.org/en/latest/) to manage database migrations.
To create a new migration based on changes made to the model code, run the following command:
```bash
alembic revision --autogenerate -m "MIGRATION TITLE"
```
### Querying the database via Python Shell in Docker
To open an interactive Python shell within a Docker container and query the database, use the following command:
```
docker exec -it safe-decoder-service-web-1 python -m IPython -i ./scripts/db_profile.py
```
Example usage:
```python
contracts = await Contract.get_all()
contracts[0].address
b'J\xdb\xaa\xc7\xbc#\x9e%\x19\xcb\xfd#\x97\xe0\xf7Z\x1d\xe3U\xc8'
```
Call `await restore_session()` to reopen a new session.
## Contributors
[See contributors](https://github.com/safe-global/safe-decoder-service/graphs/contributors)