Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codegen (contracts, subgraph), order signing and order book API interface #6

Closed
wants to merge 2 commits into from

Conversation

ribeirojose
Copy link
Collaborator

@ribeirojose ribeirojose commented Feb 27, 2024

Sorry for the gigantic PR 🤠 🐄 😬

Contents for this PR:

  • Codegen:
    • Create module to generate objects to interact with deployed contracts.
    • Generate Composable CoW, Fallback Handler, Milkman and TWAP Contracts.
  • Common:
    • Create API base class with backoff and rate limit configuration
    • Refactor chain and config contants
  • Contracts:
    • Add ability to sign and normalize orders with EIP 712, ETH Sign, EIP 1271, and Pre Sign.
  • Order Book API:
    • Add models with codegen;
    • Create interface to call public endpoints;
  • Subgraph:
    • Add subgraph codegen, queries and clients.
  • Examples:
    • Add example of order quoting, signing and posting using OrderBookAPI and Contract Signing.

@ribeirojose ribeirojose marked this pull request as ready for review April 17, 2024 19:38
@ribeirojose ribeirojose requested a review from mfw78 as a code owner April 17, 2024 19:38
@ribeirojose ribeirojose changed the title [WIP] contracts, subgraph, and orderbook api codegen Add codegen (contracts, subgraph), order signing and order book API interface Apr 17, 2024
@mfw78
Copy link
Contributor

mfw78 commented Apr 25, 2024

Hey, so yeah, this is gigantic 😆 I'm going to go out on a limb and estimate that a lot of this code is auto-generated. Can this potentially please be broken into two PRs, one that commits what is needed to do the generation, the other being the auto-generated files (so then reviewers can also determine the success of auto-generation, and SDK-specific logic?) 🙏

@ribeirojose
Copy link
Collaborator Author

Hey, so yeah, this is gigantic 😆 I'm going to go out on a limb and estimate that a lot of this code is auto-generated. Can this potentially please be broken into two PRs, one that commits what is needed to do the generation, the other being the auto-generated files (so then reviewers can also determine the success of auto-generation, and SDK-specific logic?) 🙏

for sure! I'll squash the commits here to allow for that =)

@ribeirojose
Copy link
Collaborator Author

ribeirojose commented Apr 25, 2024

Closing in favor of breaking down into small PRs:

#8
bleu#15
bleu#17
bleu#18
bleu#19
bleu#20

@mfw78 to make this easier to review I chained one PR to another's branch, but unfortunately that means that I couldn't open all PRs in this repo since I don't have write permissions here. IMO it's not an issue if you review them in our repo and we work on it there, but lmk if you prefer an alternative to this workflow.

yvesfracari pushed a commit that referenced this pull request Aug 15, 2024
#6 breakdown pt1 - add codegen module
yvesfracari pushed a commit that referenced this pull request Aug 15, 2024
#6 breakdown pt2 - add common module
yvesfracari pushed a commit that referenced this pull request Aug 16, 2024
* refactor repo configs/readme

* add codegen module

* Update README.md

Co-authored-by: mfw78 <53399572+mfw78@users.noreply.github.com>

* Update README.md

Co-authored-by: mfw78 <53399572+mfw78@users.noreply.github.com>

---------

Co-authored-by: mfw78 <53399572+mfw78@users.noreply.github.com>
ribeirojose added a commit that referenced this pull request Sep 4, 2024
* refactor repo configs/readme

* add codegen module

* add common module

* remove stale subgraphs/core modules

* remove trailing slash from sepolia etherscan url

* add readme instruction about contracts codegen

* add codegen on makefile

* docs(readme): add instructions about when to run codegen

* explain usage of context_override in api_base

---------

Co-authored-by: José Ribeiro <me@joseribeiro.dev>
Co-authored-by: José Ribeiro <jose@bleu.studio>
yvesfracari added a commit that referenced this pull request Sep 6, 2024
* add new repo structure

* add codegen (contracts, subgraph), order signing and order book API interface

* refactor repo configs/readme

* add codegen module

* add common module

* remove stale subgraphs/core modules

* add contracts module

* add order_book module

* add order posting example

* remove web3_codegen from Makefile

* remove order signing TODO from readme

* fix PR reviews

* remove duplicated ETH constant address

* fix lint

* remove eth but address constant

* add types of domain and add order hashing tests

* fix types

* fix type in order_posting_e2e test

* add generated files to lib

---------

Co-authored-by: José Ribeiro <me@joseribeiro.dev>
ribeirojose added a commit that referenced this pull request Sep 10, 2024
* refactor repo configs/readme

* add codegen module

* add common module

* remove stale subgraphs/core modules

* add contracts module

* add order_book module

* add order posting example

* add generated api model

* add python-dotenv package

* refactor importing sort

* refactor .env usage and variables requested

* codegen: update reference openapi file for orderbook api codegen

* add E2E_SEPOLIA_TESTING_EOA_PRIVATE_KEY to .env.example

* codegen: regenerate order book models

* api: refactor api base code to handle errors from orderbook api

* orderbook: fix issue with type in order cancellation

* tests(e2e): add e2e order posting test backed by vcr

* ignore .env* files

* api(orderbook): refactor data serialization/deserialization

* tests(e2e): use gnosis mainnet for e2e test

* ci: stop using deprecated version of actions/upload-artifact

* chore: ignore pyright error when instantiating model with string positional param

* chore: remove TODO/WIP comments from README

* ci: ensure E2E_GNOSIS_MAINNET_TESTING_EOA_PRIVATE_KEY is available when running pytest

* chore(ci): revert actions/upload-artifact to v3 to avoid bug when saving conflicting artifacts

actions/upload-artifact#480

---------

Co-authored-by: José Ribeiro <me@joseribeiro.dev>
ribeirojose added a commit that referenced this pull request Sep 10, 2024
* refactor repo configs/readme

* add codegen module

* add common module

* remove stale subgraphs/core modules

* add contracts module

* add order_book module

* add order posting example

* add generated subgraph files

* add contract abis

* add generated codegen

* add generated order_book

* add generated api model

* add python-dotenv package

* refactor importing sort

* refactor .env usage and variables requested

* chore: disable subgraph codegen in codegen Makefile command

---------

Co-authored-by: José Ribeiro <me@joseribeiro.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants