Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 2.31 KB

README.md

File metadata and controls

53 lines (43 loc) · 2.31 KB

CoW Protocol REST API client

This crate provides an async client for interacting with the CoW Protocol REST API. The benefit is to use typed models as they have been intended by the Cow Protocol service.

Status

The crate is currently just a showcase and not for productive use. Generated clients can be difficult to use when dealing with byte types like U256, Address, etc. This client directly uses some models from the services repository, ensuring compatibility with the API. The long-term goal is to migrate everything to use Alloy types or have some converter. This crate currently supports a limited set of API endpoints. If you need additional endpoints, please open an issue or a PR.

Current concept for types:

Future concept for types:

  • Alloy for all types

APIs

- Solver API (driver)
  - /quote (GET)
  - /solve (POST)
  - /reveal (POST)
  - /settle (POST)

- Solver Engine API (solvers)
  - /solve (POST)
  - /notify (POST)

- Order Book API (orderbook)
  - /orders (POST, DELETE)
  - /orders/{UID} (GET, DELETE)
  - /orders/{UID}/status (GET)
  - /transactions/{txHash}/orders (GET)
  - /trades (GET)
  - /auction (GET)
  - /account/{owner}/orders (GET)
  - /token/{token}/native_price (GET)
  - /quote (POST)
  - /solver_competition/{auction_id} (GET)
  - /solver_competition/by_tx_hash/{tx_hash} (GET)
  - /solver_competition/latest (GET)
  - /version (GET)
  - /app_data/{app_data_hash} (GET, PUT)
  - /app_data (PUT)
  - /users/{address}/total_surplus (GET)

Usage

See the examples directory for usage examples.

Acknowledgements

Many thanks to the CoW Protocol team for making their service open source. This project uses the models from the services repository.

License

This project is dual licensed under Apache 2.0 or MIT.