deltadefi 0.0.11__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of deltadefi might be problematic. Click here for more details.

Files changed (41) hide show
  1. deltadefi-0.1.1/.env.example +3 -0
  2. deltadefi-0.1.1/.github/workflows/publish.yml +37 -0
  3. deltadefi-0.1.1/.gitignore +62 -0
  4. deltadefi-0.1.1/.pre-commit-config.yaml +67 -0
  5. deltadefi-0.1.1/Makefile +94 -0
  6. {deltadefi-0.0.11 → deltadefi-0.1.1}/PKG-INFO +19 -19
  7. deltadefi-0.1.1/coverage.xml +764 -0
  8. deltadefi-0.1.1/examples/websocket_example.py +311 -0
  9. deltadefi-0.1.1/pyproject.toml +127 -0
  10. deltadefi-0.1.1/src/deltadefi/__init__.py +2 -0
  11. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/api.py +4 -4
  12. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/api_resources/auth.py +3 -4
  13. deltadefi-0.1.1/src/deltadefi/clients/__init__.py +3 -0
  14. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/clients/accounts.py +23 -8
  15. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/clients/client.py +14 -6
  16. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/clients/markets.py +3 -26
  17. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/clients/orders.py +1 -1
  18. deltadefi-0.1.1/src/deltadefi/clients/websocket.py +355 -0
  19. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/error.py +2 -2
  20. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/models/models.py +3 -3
  21. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/responses/accounts.py +18 -6
  22. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/responses/responses.py +4 -4
  23. deltadefi-0.1.1/src/deltadefi/utils/__init__.py +2 -0
  24. deltadefi-0.0.11/src/deltadefi/lib/utils.py → deltadefi-0.1.1/src/deltadefi/utils/helpers.py +2 -2
  25. deltadefi-0.1.1/tests/clients/__init__.py +0 -0
  26. deltadefi-0.1.1/tests/clients/test_accounts.py +47 -0
  27. deltadefi-0.1.1/tests/clients/test_order.py +40 -0
  28. deltadefi-0.1.1/tests/clients/test_sign.py +26 -0
  29. deltadefi-0.1.1/uv.lock +1842 -0
  30. deltadefi-0.0.11/pyproject.toml +0 -47
  31. deltadefi-0.0.11/src/deltadefi/__init__.py +0 -2
  32. deltadefi-0.0.11/src/deltadefi/clients/__init__.py +0 -2
  33. deltadefi-0.0.11/src/deltadefi/clients/app.py +0 -23
  34. {deltadefi-0.0.11 → deltadefi-0.1.1}/README.md +0 -0
  35. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/api_resources/__init__.py +0 -0
  36. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/api_resources/validation.py +0 -0
  37. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/constants/__init__.py +0 -0
  38. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/constants/constants.py +0 -0
  39. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/models/__init__.py +0 -0
  40. {deltadefi-0.0.11 → deltadefi-0.1.1}/src/deltadefi/responses/__init__.py +0 -0
  41. {deltadefi-0.0.11/src/deltadefi/lib → deltadefi-0.1.1/tests}/__init__.py +0 -0
@@ -0,0 +1,3 @@
1
+ TRADING_PASSWORD="xxxxxxxx"
2
+ DELTADEFI_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
3
+ BASE_URL="http://localhost:8080"
@@ -0,0 +1,37 @@
1
+ name: Release Distributables
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - published
7
+
8
+ jobs:
9
+ build-n-upload:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Set up Python 3.11
15
+ uses: actions/setup-python@v4
16
+ with:
17
+ python-version: "3.11"
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v3
21
+ with:
22
+ enable-cache: true
23
+
24
+ - name: Install dependencies
25
+ run: uv sync --dev
26
+
27
+ - name: Lint with ruff
28
+ run: uv run ruff check src
29
+
30
+ - name: Run unit tests
31
+ run: uv run pytest --cov=deltadefi --cov-report=xml
32
+
33
+ - name: Build distributables
34
+ run: uv build
35
+
36
+ - name: Build and publish to PyPI
37
+ run: uv publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,62 @@
1
+ # Virtual environment
2
+ .venv/
3
+
4
+ # Python
5
+ __pycache__/
6
+ *.pyc
7
+ *.pyo
8
+ *.pyd
9
+ .Python
10
+ build/
11
+ develop-eggs/
12
+ dist/
13
+ downloads/
14
+ eggs/
15
+ .eggs/
16
+ lib/
17
+ lib64/
18
+ parts/
19
+ sdist/
20
+ var/
21
+ wheels/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+
26
+ # Testing
27
+ .pytest_cache/
28
+ .coverage
29
+ htmlcov/
30
+ .tox/
31
+ .nox/
32
+ cov_html/
33
+
34
+ # Type checking
35
+ .mypy_cache/
36
+ .dmypy.json
37
+ dmypy.json
38
+
39
+ # Linting
40
+ .ruff_cache/
41
+
42
+ # Environment variables
43
+ .env
44
+ .env.local
45
+ .env.development.local
46
+ .env.test.local
47
+ .env.production.local
48
+
49
+ # Documentation
50
+ docs/build/
51
+ docs/_build/
52
+
53
+ # IDEs
54
+ .vscode/
55
+ .idea/
56
+ *.swp
57
+ *.swo
58
+ *~
59
+
60
+ # OS
61
+ .DS_Store
62
+ Thumbs.db
@@ -0,0 +1,67 @@
1
+ repos:
2
+ # Standard pre-commit hooks
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v5.0.0
5
+ hooks:
6
+ - id: trailing-whitespace
7
+ - id: end-of-file-fixer
8
+ - id: check-yaml
9
+ - id: check-added-large-files
10
+ - id: check-json
11
+ - id: check-toml
12
+ - id: check-merge-conflict
13
+ - id: debug-statements
14
+
15
+ # Ruff for linting and formatting
16
+ - repo: https://github.com/astral-sh/ruff-pre-commit
17
+ rev: v0.12.10
18
+ hooks:
19
+ - id: ruff
20
+ args: [--fix]
21
+ - id: ruff-format
22
+
23
+ # MyPy for type checking (lenient for now)
24
+ - repo: https://github.com/pre-commit/mirrors-mypy
25
+ rev: v1.17.1
26
+ hooks:
27
+ - id: mypy
28
+ additional_dependencies: [types-requests]
29
+ args: [--ignore-missing-imports, --disable-error-code=no-any-return, --disable-error-code=call-arg]
30
+
31
+ # Custom hooks for project-specific checks
32
+ - repo: local
33
+ hooks:
34
+ # Install dependencies
35
+ - id: uv-sync
36
+ name: Install dependencies
37
+ entry: uv sync --dev
38
+ language: system
39
+ pass_filenames: false
40
+ stages: [pre-commit]
41
+
42
+ # Run tests
43
+ - id: pytest
44
+ name: Run tests
45
+ entry: uv run pytest
46
+ language: system
47
+ pass_filenames: false
48
+ stages: [pre-commit]
49
+
50
+ # Build package
51
+ - id: uv-build
52
+ name: Build package
53
+ entry: uv build --out-dir .pre-commit-build
54
+ language: system
55
+ pass_filenames: false
56
+ stages: [pre-commit]
57
+
58
+ # Clean up build artifacts
59
+ - id: cleanup-build
60
+ name: Clean build artifacts
61
+ entry: rm -rf .pre-commit-build
62
+ language: system
63
+ pass_filenames: false
64
+ stages: [pre-commit]
65
+
66
+ # Configure which hooks run at different stages
67
+ default_stages: [pre-commit]
@@ -0,0 +1,94 @@
1
+
2
+ # Makefile for deltadefi-python-sdk (uv-managed Python project)
3
+ # Usage examples:
4
+ # make install # create venv and install project + dev deps
5
+ # make test # run pytest
6
+ # make fmt lint # format + lint with Ruff
7
+ # make build # build the package
8
+ # make help # list targets
9
+
10
+ SHELL := /bin/bash
11
+ .DEFAULT_GOAL := help
12
+
13
+ UV := uv
14
+ PY := python
15
+
16
+ .PHONY: help venv install fmt lint type test cov build clean docs deps
17
+
18
+ help: ## Show this help with grouped commands
19
+ @echo "Available commands:"
20
+ @echo ""
21
+ @echo "📦 Installation & Setup:"
22
+ @grep -E '^[a-zA-Z_\-]+:.*##.*install' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
23
+ @echo ""
24
+ @echo "🔧 Testing & Quality:"
25
+ @grep -E '^[a-zA-Z_\-]+:.*##.*\[(test|lint|format|type|quality|check)\]' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
26
+ @echo ""
27
+ @echo "🏗️ Building & Distribution:"
28
+ @grep -E '^[a-zA-Z_\-]+:.*##.*\[(build|dist)\]' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
29
+ @echo ""
30
+ @echo "📚 Other Utilities:"
31
+ @grep -E '^[a-zA-Z_\-]+:.*##[^[]*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
32
+
33
+ # 📦 Installation & Setup
34
+ venv: ## Create virtual environment [install]
35
+ @$(UV) venv
36
+
37
+ install: ## Install project in editable mode with dependencies [install]
38
+ @$(UV) pip install -e . --group dev --group docs
39
+
40
+ deps: install ## Install dependencies (alias for install) [install]
41
+
42
+ # 🔧 Testing & Quality
43
+ fmt: ## Format code with Ruff formatter [format]
44
+ @$(UV) run ruff format .
45
+
46
+ lint: ## Lint with Ruff (auto-fix + fail on remaining issues) [lint]
47
+ @$(UV) run ruff check --fix --exit-non-zero-on-fix .
48
+
49
+ type: ## Static type-check with mypy [type]
50
+ @$(UV) run mypy --config-file=pyproject.toml src/ || true
51
+
52
+ test: install ## Run tests with pytest [test]
53
+ @$(UV) run pytest -vv
54
+
55
+ cov: install ## Check code coverage [test]
56
+ @$(UV) run pytest -n 4 --cov deltadefi
57
+
58
+ cov-html: cov ## Check code coverage and generate HTML report [test]
59
+ @$(UV) run coverage html -d cov_html
60
+ @echo "Coverage report generated in cov_html/"
61
+
62
+ # 🏗️ Building & Distribution
63
+ build: install ## Build the package [build]
64
+ @$(UV) build
65
+
66
+ # 📚 Other Utilities
67
+ docs: install ## Build the documentation
68
+ @mkdir -p docs/requirements
69
+ @$(UV) export --group docs > docs/requirements.txt
70
+ @rm -r -f docs/build
71
+ @$(UV) run sphinx-build docs/source docs/build/html
72
+ @echo "Documentation built in docs/build/html/"
73
+
74
+ clean-test: ## Remove test and coverage artifacts
75
+ @rm -f .coverage
76
+ @rm -fr cov_html/
77
+ @rm -fr .pytest_cache
78
+
79
+ clean: clean-test ## Remove caches, build artifacts, and temp files
80
+ @rm -rf .mypy_cache .ruff_cache dist build
81
+ @find . -type d -name __pycache__ -prune -exec rm -rf {} +
82
+
83
+ version: ## Show uv and Python versions
84
+ @$(UV) --version
85
+ @$(UV) run $(PY) -c "import platform; print('Python', platform.python_version())"
86
+
87
+ precommit-install: ## Install pre-commit hooks
88
+ @$(UV) run pre-commit install
89
+
90
+ precommit: ## Run pre-commit hooks on all files
91
+ @$(UV) run pre-commit run --all-files
92
+
93
+ precommit-update: ## Update pre-commit hooks
94
+ @$(UV) run pre-commit autoupdate
@@ -1,29 +1,30 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: deltadefi
3
- Version: 0.0.11
3
+ Version: 0.1.1
4
4
  Summary: Python SDK for DeltaDeFi protocol.
5
- License: Apache-2.0
6
- Keywords: cardano
7
- Author: HinsonSIDAN
8
- Author-email: wongkahinhinson@gmail.com
9
- Requires-Python: >3.11,<4.0.0
5
+ Author-email: HinsonSIDAN <wongkahinhinson@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Keywords: cardano,defi,sdk,trading
8
+ Classifier: Development Status :: 3 - Alpha
10
9
  Classifier: Intended Audience :: Developers
11
10
  Classifier: License :: OSI Approved :: Apache Software License
12
11
  Classifier: Natural Language :: English
13
12
  Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
- Classifier: Programming Language :: Python :: 3.11
17
- Requires-Dist: certifi (==2024.8.30)
18
- Requires-Dist: charset-normalizer (==3.4.0)
19
- Requires-Dist: dotenv (>=0.9.9,<0.10.0)
20
- Requires-Dist: idna (==3.10)
21
- Requires-Dist: pycardano (>=0.12.3,<0.13.0)
22
- Requires-Dist: requests (>=2.25,<3.0)
23
- Requires-Dist: sidan-gin (==0.1.6)
24
- Requires-Dist: urllib3 (==2.2.3)
25
- Project-URL: Documentation, https://github.com/deltadefi-protocol/python-sdk
26
- Project-URL: Homepage, https://github.com/deltadefi-protocol/python-sdk
16
+ Classifier: Topic :: Office/Business :: Financial :: Investment
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Requires-Python: <4.0.0,>3.11
19
+ Requires-Dist: certifi>=2024.8.30
20
+ Requires-Dist: charset-normalizer>=3.4.0
21
+ Requires-Dist: idna>=3.10
22
+ Requires-Dist: pycardano>=0.12.3
23
+ Requires-Dist: python-dotenv>=0.9.9
24
+ Requires-Dist: requests>=2.25.0
25
+ Requires-Dist: sidan-gin>=0.1.6
26
+ Requires-Dist: urllib3>=2.2.3
27
+ Requires-Dist: websockets>=12.0
27
28
  Description-Content-Type: text/markdown
28
29
 
29
30
  # DeltaDeFi Python SDK
@@ -119,4 +120,3 @@ DELTADEFI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx make test
119
120
  ## License
120
121
 
121
122
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>
122
-