aboutsummaryrefslogtreecommitdiffstats
path: root/python-packages/sra_client/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'python-packages/sra_client/README.md')
-rw-r--r--python-packages/sra_client/README.md77
1 files changed, 53 insertions, 24 deletions
diff --git a/python-packages/sra_client/README.md b/python-packages/sra_client/README.md
index ab3939b41..a1a427bce 100644
--- a/python-packages/sra_client/README.md
+++ b/python-packages/sra_client/README.md
@@ -4,7 +4,36 @@ A Python client for interacting with servers conforming to [the Standard Relayer
# Schemas
-The [JSON schemas](http://json-schema.org/) for the API payloads and responses can be found in [@0xproject/json-schemas](https://github.com/0xProject/0x.js/tree/development/packages/json-schemas). Examples of each payload and response can be found in the 0x.js library's [test suite](https://github.com/0xProject/0x.js/blob/development/packages/json-schemas/test/schema_test.ts#L1).
+The [JSON schemas](http://json-schema.org/) for the API payloads and responses can be found in [@0xproject/json-schemas](https://github.com/0xProject/0x-monorepo/tree/development/packages/json-schemas). Examples of each payload and response can be found in the 0x.js library's [test suite](https://github.com/0xProject/0x-monorepo/blob/development/packages/json-schemas/test/schema_test.ts#L1).
+
+```bash
+pip install 0x-json-schemas
+```
+
+You can easily validate your API's payloads and responses using the [0x-json-schemas](https://github.com/0xProject/0x.js/tree/development/python-packages/json_schemas) package:
+
+```python
+from zero_ex.json_schemas import assert_valid
+from zero_ex.order_utils import Order
+
+order: Order = {
+ 'makerAddress': "0x0000000000000000000000000000000000000000",
+ 'takerAddress': "0x0000000000000000000000000000000000000000",
+ 'feeRecipientAddress': "0x0000000000000000000000000000000000000000",
+ 'senderAddress': "0x0000000000000000000000000000000000000000",
+ 'makerAssetAmount': "1000000000000000000",
+ 'takerAssetAmount': "1000000000000000000",
+ 'makerFee': "0",
+ 'takerFee': "0",
+ 'expirationTimeSeconds': "12345",
+ 'salt': "12345",
+ 'makerAssetData': "0x0000000000000000000000000000000000000000",
+ 'takerAssetData': "0x0000000000000000000000000000000000000000",
+ 'exchangeAddress': "0x0000000000000000000000000000000000000000",
+}
+
+assert_valid(order, "/orderSchema")
+```
# Pagination
@@ -190,16 +219,16 @@ A good example of such a field is `remainingTakerAssetAmount`, which is a conven
# Misc.
-* All requests and responses should be of **application/json** content type
-* All token amounts are sent in amounts of the smallest level of precision (base units). (e.g if a token has 18 decimal places, selling 1 token would show up as selling `'1000000000000000000'` units by this API).
-* All addresses are sent as lower-case (non-checksummed) Ethereum addresses with the `0x` prefix.
-* All parameters are to be written in `lowerCamelCase`.
+- All requests and responses should be of **application/json** content type
+- All token amounts are sent in amounts of the smallest level of precision (base units). (e.g if a token has 18 decimal places, selling 1 token would show up as selling `'1000000000000000000'` units by this API).
+- All addresses are sent as lower-case (non-checksummed) Ethereum addresses with the `0x` prefix.
+- All parameters are to be written in `lowerCamelCase`.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
-* API version: 2.0.0
-* Package version: 1.0.0
-* Build package: org.openapitools.codegen.languages.PythonClientCodegen
+- API version: 2.0.0
+- Package version: 1.0.0
+- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
@@ -281,22 +310,22 @@ All URIs are relative to _http://localhost_
## Documentation For Models
-* [OrderSchema](docs/OrderSchema.md)
-* [PaginatedCollectionSchema](docs/PaginatedCollectionSchema.md)
-* [RelayerApiAssetDataPairsResponseSchema](docs/RelayerApiAssetDataPairsResponseSchema.md)
-* [RelayerApiAssetDataTradeInfoSchema](docs/RelayerApiAssetDataTradeInfoSchema.md)
-* [RelayerApiErrorResponseSchema](docs/RelayerApiErrorResponseSchema.md)
-* [RelayerApiErrorResponseSchemaValidationErrors](docs/RelayerApiErrorResponseSchemaValidationErrors.md)
-* [RelayerApiFeeRecipientsResponseSchema](docs/RelayerApiFeeRecipientsResponseSchema.md)
-* [RelayerApiOrderConfigPayloadSchema](docs/RelayerApiOrderConfigPayloadSchema.md)
-* [RelayerApiOrderConfigResponseSchema](docs/RelayerApiOrderConfigResponseSchema.md)
-* [RelayerApiOrderSchema](docs/RelayerApiOrderSchema.md)
-* [RelayerApiOrderbookResponseSchema](docs/RelayerApiOrderbookResponseSchema.md)
-* [RelayerApiOrdersChannelSubscribePayloadSchema](docs/RelayerApiOrdersChannelSubscribePayloadSchema.md)
-* [RelayerApiOrdersChannelSubscribeSchema](docs/RelayerApiOrdersChannelSubscribeSchema.md)
-* [RelayerApiOrdersChannelUpdateSchema](docs/RelayerApiOrdersChannelUpdateSchema.md)
-* [RelayerApiOrdersResponseSchema](docs/RelayerApiOrdersResponseSchema.md)
-* [SignedOrderSchema](docs/SignedOrderSchema.md)
+- [OrderSchema](docs/OrderSchema.md)
+- [PaginatedCollectionSchema](docs/PaginatedCollectionSchema.md)
+- [RelayerApiAssetDataPairsResponseSchema](docs/RelayerApiAssetDataPairsResponseSchema.md)
+- [RelayerApiAssetDataTradeInfoSchema](docs/RelayerApiAssetDataTradeInfoSchema.md)
+- [RelayerApiErrorResponseSchema](docs/RelayerApiErrorResponseSchema.md)
+- [RelayerApiErrorResponseSchemaValidationErrors](docs/RelayerApiErrorResponseSchemaValidationErrors.md)
+- [RelayerApiFeeRecipientsResponseSchema](docs/RelayerApiFeeRecipientsResponseSchema.md)
+- [RelayerApiOrderConfigPayloadSchema](docs/RelayerApiOrderConfigPayloadSchema.md)
+- [RelayerApiOrderConfigResponseSchema](docs/RelayerApiOrderConfigResponseSchema.md)
+- [RelayerApiOrderSchema](docs/RelayerApiOrderSchema.md)
+- [RelayerApiOrderbookResponseSchema](docs/RelayerApiOrderbookResponseSchema.md)
+- [RelayerApiOrdersChannelSubscribePayloadSchema](docs/RelayerApiOrdersChannelSubscribePayloadSchema.md)
+- [RelayerApiOrdersChannelSubscribeSchema](docs/RelayerApiOrdersChannelSubscribeSchema.md)
+- [RelayerApiOrdersChannelUpdateSchema](docs/RelayerApiOrdersChannelUpdateSchema.md)
+- [RelayerApiOrdersResponseSchema](docs/RelayerApiOrdersResponseSchema.md)
+- [SignedOrderSchema](docs/SignedOrderSchema.md)
## Documentation For Authorization