forked from cowdao-grants/cow-py
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add order signing and order book api (#7)
* start porting order signing code from cow sdk * refactor codegen * complete order signing module * add component tests * add order book api * remove order signing * add order book tests * add ideas * chore: add e2e order quote to post example * fix: order link print * update readme * merge into order book api * refactor request strategy and merge with updated order book api * add refactors * compose config with api base * fix example interface errors * fix: remove generated app data schemas * fix tests using async mock on sync function * Pyright and Ci fix (#13) * wip: fix poetry lock * fix: pyright types * wip: fix cache --------- Co-authored-by: Pedro Yves Fracari <[email protected]> Co-authored-by: Pedro Yves Fracari <[email protected]>
- Loading branch information
1 parent
b2ca788
commit 54fd0ec
Showing
53 changed files
with
2,786 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
USER_ADDRESS= | ||
PRIVATE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.1.4 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
# Run the formatter. | ||
- id: ruff-format | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.3.7 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: [--fix] | ||
# Run the formatter. | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
.PHONY: codegen | ||
.PHONY: codegen web3_codegen orderbook_codegen subgraph_codegen test lint format remove_unused_imports | ||
|
||
codegen: web3_codegen orderbook_codegen subgraph_codegen | ||
|
||
web3_codegen: | ||
poetry run web3_codegen | ||
# web3_codegen: | ||
# poetry run web3_codegen | ||
|
||
orderbook_codegen: | ||
datamodel-codegen --url="https://raw.githubusercontent.com/cowprotocol/services/v2.245.1/crates/orderbook/openapi.yml" --output cow_py/order_book/__generated__/model.py --target-python-version 3.12 --output-model-type pydantic_v2.BaseModel --input-file-type openapi | ||
poetry run datamodel-codegen --url="https://raw.githubusercontent.com/cowprotocol/services/v2.245.1/crates/orderbook/openapi.yml" --output cow_py/order_book/generated/model.py --target-python-version 3.12 --output-model-type pydantic_v2.BaseModel --input-file-type openapi | ||
|
||
subgraph_codegen: | ||
ariadne-codegen | ||
poetry run ariadne-codegen | ||
|
||
test: | ||
pytest -s | ||
poetry run pytest -s | ||
|
||
lint: | ||
ruff check . --fix | ||
poetry run ruff check . --fix | ||
|
||
format: | ||
ruff format | ||
format: remove_unused_imports | ||
poetry run ruff format | ||
|
||
remove_unused_imports: | ||
poetry run pycln --all . | ||
|
||
typecheck: | ||
poetry run pyright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .abi_handler import ABIHandler | ||
|
||
__all__ = [ | ||
"ABIHandler", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.