A simple integration test for the API server you set up in Receive order flow. It is a Docker container that can be executed against your running API instance. It will request an indicative quote and firm quote and check that the response is as expected for either the legacy or sponsored endpoints.
The Docker CLI must be installed.
Execute the following command to pull the container:
docker pull ghcr.io/dflowprotocol/market-maker-api-integration-test:latest
To run the Docker image, run the following command:
docker run -e MARKET_MAKER_URL=<URL> mm_api_validator --evm-legacy --evm-sponsored
The following options are available, but only one should be run at a time:
--evm-legacy Run legacy swap API tests --evm-sponsored Run sponsored swap API tests
MARKET_MAKER_URL environment variable can be used to specify the URL of your API instance to test against. This environment variable is required.
This URL should specify the full path for either the legacy or sponsored swap API, e.g.
Executing the above command should give the following results, showing all tests passing:
➜ docker run -e MARKET_MAKER_URL=http://host.docker.internal:8084/evm/legacy ghcr.io/dflowprotocol/market-maker-api-integration-test:latest --evm-legacy yarn run v1.22.19 $ mocha --timeout 1000000 --require source-map-support/register dist/evm_legacy.js Market Maker URL: http://host.docker.internal:8084/evm/legacy market_maker ✔ getFirmQuote (778ms) ✔ getIndicativeQuote (288ms) 2 passing (1s) Done in 1.52s.
Updated 28 days ago