Example how to create and fill a 0x order based on v4 of the protocol on Ropsten (Chain ID = 3).
Clone or fork 0x-fill-order-example
:
git clone https://github.com/Walodja1987/0x-fill-order-example
Install all dependencies:
cd 0x-fill-order-example
npm install
Run your app:
npm start
The following 0x packages were used (note that these packages will be installed automatically when running npm install
):
@0x/contract-addresses
A tiny utility library to get the 0x contract addresses across networks. Link to github: https://github.com/0xProject/protocol/blob/development/packages/contract-addresses/addresses.json
@0x/protocol-utils
0x protocol-related utilities for the V4/Exchange Proxy constellation of contracts. Link to github: https://github.com/0xProject/protocol/tree/development/packages/protocol-utils
@0x/contract-wrappers
: ...
web3
: ...
qs
: ...
Optional in case you want to use 0x library to initialize your provider or if you want to work with multiple providers that will handle different sets of JSON RPC requests (Provider Engine): @0x/subproviders
Link: https://0x.org/docs/tools/subproviders
- Official 0x protocol repository: https://github.com/0xProject/protocol
- 0x API: https://github.com/0xProject/website/blob/development/mdx/api/index.mdx#get-swapv1quote
- 0x API documentation: https://github.com/0xProject/0x-api
- 0x packages: https://github.com/0xProject/protocol/tree/4f32f3174f25858644eae4c3de59c3a6717a757c/packages