- Published on
How to Verify a 0x Relayer is Implemented Correctly According to the SRA
- Authors
- Name
- Yair Mark
- @yairmark
When implementing a 0x relayer there is a specific protocol that should be implemented known as the Standard Relayer API (SRA). The http and web socket specs are easy to read.
But even after having implemented a relayer based on these specs it is still possible to have missed something. Luckily this is easy to verify by using the 0x Connect Client.
This client has both an Http client (which is responsible for interacting with the HTTP portion of an SRA) and an order channel factory (which is used to communicate with the web socket portion of an SRA). The client runs assertions on inputs to it and outputs from it. These assertions and associated schemas are what is used to verify that an SRA was implemented correctly. Any invalid inputs/outputs will result in errors in your browser/server console logs.
The 0x Connect Documentation is the easiest way to determine how to use the connect client.