Install dependencies for the workspace
yarn installAll commands below need to be run in the context of the orderbook package where this README is located. Read more about context here.
Running in dev mode:
yarn devBuilding to ./dist directory with javascript output:
yarn buildRunning all orderbook demos (these rely on the .env file explained in the demo script section):
yarn run:demoRunning the orderbook expiry demo (this relies on the .env file explained in the demo script section):
yarn run:demo-expiryRunning the orderbook order fulfillment demo (this relies on the .env file explained in the demo script section):
yarn run:demo-fulfillRunning the orderbook bulk orders fulfillment demo (this relies on the .env file explained in the demo script section):
yarn run:demo-fulfill-bulkRunning all tests:
yarn testRunning changed tests in watch mode:
yarn test:watchRunning E2E tests (these rely on the .env file explained in the demo script section):
yarn test:e2eLinting:
yarn lintLinting and attempting to auto-fix issues:
yarn lint:fixTypechecking:
yarn typecheckGenerating types from the ./abi/*.json files to ./src/typechain/types:
yarn generate-typesThe demo scripts and e2e test scripts mentioned above rely on an .env file that specifies the following properties:
ACCOUNT_1=
ACCOUNT_2=
RPC_ENDPOINT=
ORDERBOOK_MR_API_URL=
SEAPORT_CONTRACT_ADDRESS=
ZONE_CONTRACT_ADDRESS=- ACCOUNT_1 and ACCOUNT_2 are private keys for funded accounts to be used in the demo scripts
- RPC_ENDPOINT is the target zkEVM environment's RPC URL
- ORDERBOOK_MR_API_URL is the exposed URL for the API
- SEAPORT_CONTRACT_ADDRESS and ZONE_CONTRACT_ADDRESS depend on the address of the deployed contracts
An example .env.example file is provided in the root of the orderbook package, where this README is located, that can be used as a baseline for creating the .env file.
This package contains the Typescript SDK for the zkEVM Order Book. It is used to interact with the zkEVM Order Book API and provides a number of methods for placing, fulfilling and cancelling listings. The SDK is initialized with a configuration object that specifies the target environment and other necessary parameters.
Initializing the SDK can be achieved by specifying the target environment in the constructor:
new Orderbook({
baseConfig: {
environment: Environment.SANDBOX,
},
})The *.demo.ts and *.e2e.ts files in the ./test folder have a number of practical examples of how the SDK is used for placing, fulfilling and cancelling listings and can be used as a point of reference.
All content in src/openapi/sdk is auto-generated.