diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-12 00:53:15 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-12 00:53:15 +0800 |
commit | faee7513952a4b87d5f9e9dde9deb20126f58834 (patch) | |
tree | 8168000e484e621e1526cf48fb0f979a6d98d972 /python-packages/sra_client | |
parent | 742e5e039dd4e821209b5511fb6a194d11c6291c (diff) | |
parent | 2cf57a48dd2857dd5cf2f31f4c60dd47ae4d34a5 (diff) | |
download | dexon-sol-tools-faee7513952a4b87d5f9e9dde9deb20126f58834.tar.gz dexon-sol-tools-faee7513952a4b87d5f9e9dde9deb20126f58834.tar.zst dexon-sol-tools-faee7513952a4b87d5f9e9dde9deb20126f58834.zip |
Merge branch 'development' into feature/instant/asset-buyer-check-liquidity
Diffstat (limited to 'python-packages/sra_client')
-rw-r--r-- | python-packages/sra_client/README.md | 77 | ||||
-rw-r--r-- | python-packages/sra_client/docs/DefaultApi.md | 28 | ||||
-rwxr-xr-x | python-packages/sra_client/setup.py | 10 |
3 files changed, 77 insertions, 38 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 diff --git a/python-packages/sra_client/docs/DefaultApi.md b/python-packages/sra_client/docs/DefaultApi.md index 942188bc6..9e3f5f2ca 100644 --- a/python-packages/sra_client/docs/DefaultApi.md +++ b/python-packages/sra_client/docs/DefaultApi.md @@ -62,8 +62,8 @@ No authorization required ### HTTP request headers -* **Content-Type**: Not defined -* **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -113,8 +113,8 @@ No authorization required ### HTTP request headers -* **Content-Type**: Not defined -* **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -162,8 +162,8 @@ No authorization required ### HTTP request headers -* **Content-Type**: Not defined -* **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -211,8 +211,8 @@ No authorization required ### HTTP request headers -* **Content-Type**: application/json -* **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -266,8 +266,8 @@ No authorization required ### HTTP request headers -* **Content-Type**: Not defined -* **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -343,8 +343,8 @@ No authorization required ### HTTP request headers -* **Content-Type**: Not defined -* **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -391,7 +391,7 @@ No authorization required ### HTTP request headers -* **Content-Type**: application/json -* **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/python-packages/sra_client/setup.py b/python-packages/sra_client/setup.py index b47f71ae7..0921149bd 100755 --- a/python-packages/sra_client/setup.py +++ b/python-packages/sra_client/setup.py @@ -48,6 +48,15 @@ class PublishCommand(distutils.command.build_py.build_py): subprocess.check_call("twine upload dist/*".split()) # nosec +class LintCommand(distutils.command.build_py.build_py): + """No-op lint command to support top-level lint script.""" + + description = "No-op" + + def run(self): + pass + + setup( name=NAME, version=VERSION, @@ -63,5 +72,6 @@ setup( cmdclass={ "test_publish": TestPublishCommand, "publish": PublishCommand, + "lint": LintCommand, }, ) |