sra_client.py: remove support for chainId parameter
This commit is contained in:
parent
810bf7af0c
commit
0ec8a4a160
@ -84,11 +84,6 @@ To start, connect to the Ethereum network:
|
||||
>>> from web3 import HTTPProvider, Web3
|
||||
>>> eth_node = HTTPProvider("http://localhost:8545")
|
||||
|
||||
What chain are we on?
|
||||
|
||||
>>> from zero_ex.contract_addresses import ChainId
|
||||
>>> chain_id = ChainId.GANACHE # you might use .MAINNET or .KOVAN
|
||||
|
||||
For our Maker role, we'll just use the first address available in the node:
|
||||
|
||||
>>> maker_address = Web3(eth_node).eth.accounts[0]
|
||||
@ -98,8 +93,8 @@ for this account, so the example orders below have the maker trading away ZRX.
|
||||
Before such an order can be valid, though, the maker must give the 0x contracts
|
||||
permission to trade their ZRX tokens:
|
||||
|
||||
>>> from zero_ex.contract_addresses import chain_to_addresses
|
||||
>>> contract_addresses = chain_to_addresses(chain_id)
|
||||
>>> from zero_ex.contract_addresses import chain_to_addresses, ChainId
|
||||
>>> contract_addresses = chain_to_addresses(ChainId(Web3(eth_node).eth.chainId))
|
||||
>>>
|
||||
>>> from zero_ex.contract_artifacts import abi_by_name
|
||||
>>> zrx_token_contract = Web3(eth_node).eth.contract(
|
||||
@ -156,7 +151,6 @@ Post an order for our Maker to trade ZRX for WETH:
|
||||
... order, contract_addresses.exchange, Web3(eth_node).eth.chainId
|
||||
... )
|
||||
>>> relayer.post_order_with_http_info(
|
||||
... chain_id=chain_id.value,
|
||||
... signed_order_schema=order_to_jsdict(
|
||||
... order=order,
|
||||
... exchange_address=contract_addresses.exchange,
|
||||
|
@ -42,7 +42,6 @@ class DefaultApi(object):
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param str asset_data_a: The assetData value for the first asset in the pair.
|
||||
:param str asset_data_b: The assetData value for the second asset in the pair.
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param int page: The number of the page to request in the collection.
|
||||
:param int per_page: The number of records to return per page.
|
||||
|
||||
@ -71,7 +70,6 @@ class DefaultApi(object):
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param str asset_data_a: The assetData value for the first asset in the pair.
|
||||
:param str asset_data_b: The assetData value for the second asset in the pair.
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param int page: The number of the page to request in the collection.
|
||||
:param int per_page: The number of records to return per page.
|
||||
|
||||
@ -86,7 +84,6 @@ class DefaultApi(object):
|
||||
all_params = [
|
||||
"asset_data_a",
|
||||
"asset_data_b",
|
||||
"chain_id",
|
||||
"page",
|
||||
"per_page",
|
||||
]
|
||||
@ -117,8 +114,6 @@ class DefaultApi(object):
|
||||
query_params.append(
|
||||
("assetDataB", local_var_params["asset_data_b"])
|
||||
)
|
||||
if "chain_id" in local_var_params:
|
||||
query_params.append(("chainId", local_var_params["chain_id"]))
|
||||
if "page" in local_var_params:
|
||||
query_params.append(("page", local_var_params["page"]))
|
||||
if "per_page" in local_var_params:
|
||||
@ -170,7 +165,6 @@ class DefaultApi(object):
|
||||
>>> result = thread.get() # doctest: +SKIP
|
||||
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param int page: The number of the page to request in the collection.
|
||||
:param int per_page: The number of records to return per page.
|
||||
|
||||
@ -196,7 +190,6 @@ class DefaultApi(object):
|
||||
>>> result = thread.get() # doctest: +SKIP
|
||||
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param int page: The number of the page to request in the collection.
|
||||
:param int per_page: The number of records to return per page.
|
||||
|
||||
@ -208,7 +201,7 @@ class DefaultApi(object):
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ["chain_id", "page", "per_page"]
|
||||
all_params = ["page", "per_page"]
|
||||
all_params.append("async_req")
|
||||
all_params.append("_return_http_data_only")
|
||||
all_params.append("_preload_content")
|
||||
@ -228,8 +221,6 @@ class DefaultApi(object):
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if "chain_id" in local_var_params:
|
||||
query_params.append(("chainId", local_var_params["chain_id"]))
|
||||
if "page" in local_var_params:
|
||||
query_params.append(("page", local_var_params["page"]))
|
||||
if "per_page" in local_var_params:
|
||||
@ -281,7 +272,6 @@ class DefaultApi(object):
|
||||
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param str order_hash: The hash of the desired 0x order. (required)
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
|
||||
:return: :class:`RelayerApiOrderSchema`.
|
||||
If the method is called asynchronously, returns the request thread.
|
||||
@ -305,7 +295,6 @@ class DefaultApi(object):
|
||||
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param str order_hash: The hash of the desired 0x order. (required)
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
|
||||
:return: A tuple consisting of a
|
||||
:class:`RelayerApiOrderSchema`, an HTTP status code integer, and a
|
||||
@ -315,7 +304,7 @@ class DefaultApi(object):
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ["order_hash", "chain_id"]
|
||||
all_params = ["order_hash"]
|
||||
all_params.append("async_req")
|
||||
all_params.append("_return_http_data_only")
|
||||
all_params.append("_preload_content")
|
||||
@ -345,8 +334,6 @@ class DefaultApi(object):
|
||||
path_params["orderHash"] = local_var_params["order_hash"]
|
||||
|
||||
query_params = []
|
||||
if "chain_id" in local_var_params:
|
||||
query_params.append(("chainId", local_var_params["chain_id"]))
|
||||
|
||||
header_params = {}
|
||||
|
||||
@ -401,7 +388,6 @@ class DefaultApi(object):
|
||||
>>> result = thread.get() # doctest: +SKIP
|
||||
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param relayer_api_order_config_payload_schema: instance of
|
||||
:class:`RelayerApiOrderConfigPayloadSchema`. The fields of a 0x
|
||||
order the relayer may want to decide what configuration to send
|
||||
@ -436,7 +422,6 @@ class DefaultApi(object):
|
||||
>>> result = thread.get() # doctest: +SKIP
|
||||
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param relayer_api_order_config_payload_schema: instance of
|
||||
:class: `RelayerApiOrderConfigPayloadSchema`. The fields of a 0x
|
||||
order the relayer may want to decide what configuration to send
|
||||
@ -450,7 +435,7 @@ class DefaultApi(object):
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ["chain_id", "relayer_api_order_config_payload_schema"]
|
||||
all_params = ["relayer_api_order_config_payload_schema"]
|
||||
all_params.append("async_req")
|
||||
all_params.append("_return_http_data_only")
|
||||
all_params.append("_preload_content")
|
||||
@ -470,8 +455,6 @@ class DefaultApi(object):
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if "chain_id" in local_var_params:
|
||||
query_params.append(("chainId", local_var_params["chain_id"]))
|
||||
|
||||
header_params = {}
|
||||
|
||||
@ -545,7 +528,6 @@ class DefaultApi(object):
|
||||
:param str quote_asset_data: assetData (makerAssetData or
|
||||
takerAssetData) designated as the quote currency in the currency
|
||||
pair calculation of price. (required)
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param int page: The number of the page to request in the collection.
|
||||
:param int per_page: The number of records to return per page.
|
||||
|
||||
@ -594,7 +576,6 @@ class DefaultApi(object):
|
||||
:param str quote_asset_data: assetData (makerAssetData or
|
||||
takerAssetData) designated as the quote currency in the currency
|
||||
pair calculation of price. (required)
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param int page: The number of the page to request in the collection.
|
||||
:param int per_page: The number of records to return per page.
|
||||
|
||||
@ -609,7 +590,6 @@ class DefaultApi(object):
|
||||
all_params = [
|
||||
"base_asset_data",
|
||||
"quote_asset_data",
|
||||
"chain_id",
|
||||
"page",
|
||||
"per_page",
|
||||
]
|
||||
@ -658,8 +638,6 @@ class DefaultApi(object):
|
||||
query_params.append(
|
||||
("quoteAssetData", local_var_params["quote_asset_data"])
|
||||
)
|
||||
if "chain_id" in local_var_params:
|
||||
query_params.append(("chainId", local_var_params["chain_id"]))
|
||||
if "page" in local_var_params:
|
||||
query_params.append(("page", local_var_params["page"]))
|
||||
if "per_page" in local_var_params:
|
||||
@ -760,7 +738,6 @@ class DefaultApi(object):
|
||||
`0x Protocol v3 Specification
|
||||
<https://github.com/0xProject/0x-protocol-specification/blob/
|
||||
master/v3/v3-specification.md#order-message-format>`__
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param int page: The number of the page to request in the collection.
|
||||
:param int per_page: The number of records to return per page.
|
||||
|
||||
@ -837,7 +814,6 @@ class DefaultApi(object):
|
||||
`0x Protocol v3 Specification
|
||||
<https://github.com/0xProject/0x-protocol-specification/blob/
|
||||
master/v3/v3-specification.md#order-message-format>`__
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param int page: The number of the page to request in the collection.
|
||||
:param int per_page: The number of records to return per page.
|
||||
|
||||
@ -863,7 +839,6 @@ class DefaultApi(object):
|
||||
"taker_address",
|
||||
"trader_address",
|
||||
"fee_recipient_address",
|
||||
"chain_id",
|
||||
"page",
|
||||
"per_page",
|
||||
]
|
||||
@ -941,8 +916,6 @@ class DefaultApi(object):
|
||||
local_var_params["fee_recipient_address"],
|
||||
)
|
||||
)
|
||||
if "chain_id" in local_var_params:
|
||||
query_params.append(("chainId", local_var_params["chain_id"]))
|
||||
if "page" in local_var_params:
|
||||
query_params.append(("page", local_var_params["page"]))
|
||||
if "per_page" in local_var_params:
|
||||
@ -993,7 +966,6 @@ class DefaultApi(object):
|
||||
>>> result = thread.get() # doctest: +SKIP
|
||||
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param signed_order_schema: Instance of :class:`SignedOrderSchema`.
|
||||
A valid signed 0x order based on the schema.
|
||||
|
||||
@ -1018,7 +990,6 @@ class DefaultApi(object):
|
||||
>>> result = thread.get() # doctest: +SKIP
|
||||
|
||||
:param bool async_req: Whether request should be asynchronous.
|
||||
:param int chain_id: The id of the Ethereum chain
|
||||
:param signed_order_schema: Instance of :class:`SignedOrderSchema`
|
||||
A valid signed 0x order based on the schema.
|
||||
|
||||
@ -1030,7 +1001,7 @@ class DefaultApi(object):
|
||||
|
||||
local_var_params = locals()
|
||||
|
||||
all_params = ["chain_id", "signed_order_schema"]
|
||||
all_params = ["signed_order_schema"]
|
||||
all_params.append("async_req")
|
||||
all_params.append("_return_http_data_only")
|
||||
all_params.append("_preload_content")
|
||||
@ -1050,8 +1021,6 @@ class DefaultApi(object):
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if "chain_id" in local_var_params:
|
||||
query_params.append(("chainId", local_var_params["chain_id"]))
|
||||
|
||||
header_params = {}
|
||||
|
||||
|
@ -24,7 +24,6 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
|
||||
openapi_types = {
|
||||
"maker_asset_proxy_id": "str",
|
||||
"taker_asset_proxy_id": "str",
|
||||
"chain_id": "float",
|
||||
"maker_asset_address": "str",
|
||||
"taker_asset_address": "str",
|
||||
"maker_asset_data": "str",
|
||||
@ -35,7 +34,6 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
|
||||
attribute_map = {
|
||||
"maker_asset_proxy_id": "makerAssetProxyId",
|
||||
"taker_asset_proxy_id": "takerAssetProxyId",
|
||||
"chain_id": "chainId",
|
||||
"maker_asset_address": "makerAssetAddress",
|
||||
"taker_asset_address": "takerAssetAddress",
|
||||
"maker_asset_data": "makerAssetData",
|
||||
@ -47,7 +45,6 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
|
||||
self,
|
||||
maker_asset_proxy_id=None,
|
||||
taker_asset_proxy_id=None,
|
||||
chain_id=None,
|
||||
maker_asset_address=None,
|
||||
taker_asset_address=None,
|
||||
maker_asset_data=None,
|
||||
@ -58,7 +55,6 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
|
||||
|
||||
self._maker_asset_proxy_id = None
|
||||
self._taker_asset_proxy_id = None
|
||||
self._chain_id = None
|
||||
self._maker_asset_address = None
|
||||
self._taker_asset_address = None
|
||||
self._maker_asset_data = None
|
||||
@ -70,8 +66,6 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
|
||||
self.maker_asset_proxy_id = maker_asset_proxy_id
|
||||
if taker_asset_proxy_id is not None:
|
||||
self.taker_asset_proxy_id = taker_asset_proxy_id
|
||||
if chain_id is not None:
|
||||
self.chain_id = chain_id
|
||||
if maker_asset_address is not None:
|
||||
self.maker_asset_address = maker_asset_address
|
||||
if taker_asset_address is not None:
|
||||
@ -137,27 +131,6 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
|
||||
|
||||
self._taker_asset_proxy_id = taker_asset_proxy_id
|
||||
|
||||
@property
|
||||
def chain_id(self):
|
||||
"""Gets the chain_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
|
||||
|
||||
|
||||
:return: The chain_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
|
||||
:rtype: float
|
||||
"""
|
||||
return self._chain_id
|
||||
|
||||
@chain_id.setter
|
||||
def chain_id(self, chain_id):
|
||||
"""Sets the chain_id of this RelayerApiOrdersChannelSubscribePayloadSchema.
|
||||
|
||||
|
||||
:param chain_id: The chain_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
|
||||
:type: float
|
||||
"""
|
||||
|
||||
self._chain_id = chain_id
|
||||
|
||||
@property
|
||||
def maker_asset_address(self):
|
||||
"""Gets the maker_asset_address of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
|
||||
|
Loading…
x
Reference in New Issue
Block a user