Python zero_ex.contract_wrappers¶
Python wrappers for interacting with 0x smart contracts.
The smart contract wrappers have simplified interfaces, performing client-side validation on transactions, and throwing helpful error messages.
Setup¶
Install the 0x-contract-wrappers with pip:
pip install 0x-contract-wrappers
We need a Web3 provider to allow us to talk to the blockchain. You can read more about providers in the Web3.py documentation. The examples below assume there’s a local instance of Ganache listening on port 8545:
>>> from web3 import HTTPProvider
>>> ganache = HTTPProvider("http://localhost:8545")
To replicate these examples, one can use the 0xorg/ganache-cli
docker
image, which comes with the 0x contracts pre-deployed. To start it:
docker run -d -p 8545:8545 0xorg/ganache-cli
Accounts¶
In the examples below, we will use the accounts provided by Ganache, which are accessible through the Web3 instance. The first account will be the maker, and the second account will be the taker.
>>> from web3 import Web3
>>> accounts = Web3(ganache).eth.accounts
>>> maker_address = accounts[0]
>>> taker_address = accounts[1]
In the examples below, we’ll use the optional tx_params
parameter to
the contract calls, in order to specify which account each transaction is to
originate from. Under normal circumstances, your provider will have a default
account which will be used if you decline to specify an originating address.
For convenience, a TxParams
class is provided:
>>> from zero_ex.contract_wrappers import TxParams
Contract Addresses¶
The 0x-contract-addresses
package (which is used by
0x-contract-wrappers
and thus gets installed along with it) provides
the addresses of the 0x contracts on each chain, including those that come
pre-deployed deployed in the 0xorg/ganache-cli
docker image. Let’s
capture the addresses we’ll use throughout the examples below:
>>> from zero_ex.contract_addresses import chain_to_addresses, ChainId
>>> weth_address = chain_to_addresses(ChainId.GANACHE).ether_token
>>> zrx_address = chain_to_addresses(ChainId.GANACHE).zrx_token
>>> exchange_address = chain_to_addresses(ChainId.GANACHE).exchange
Wrapping ETH¶
The examples below demonstrate constructing an order with the maker providing ZRX in exchange for the taker providing some WETH. For the order to be valid, our Taker first needs to wrap some ether as WETH.
First get an instance of the WETH contract on the network:
>>> from zero_ex.contract_artifacts import abi_by_name
>>> weth_instance = Web3(ganache).eth.contract(
... address=Web3.toChecksumAddress(weth_address),
... abi=abi_by_name("WETH9")
... )
Then have the Taker deposit some ETH into that contract, which will result in it receiving WETH:
>>> from eth_utils import to_wei
>>> weth_instance.functions.deposit().transact(
... {"from": Web3.toChecksumAddress(taker_address),
... "value": to_wei(1, 'ether')}
... )
HexBytes('0x...')
Approvals¶
In order to trade on 0x, one must approve the 0x smart contracts to transfer their tokens. Because the order constructed below has the maker giving WETH, we need to tell the WETH token contract to let the 0x contracts transfer our balance:
>>> from zero_ex.contract_wrappers.erc20_token import ERC20Token
>>> zrx_token = ERC20Token(
... web3_or_provider=ganache,
... contract_address=chain_to_addresses(ChainId.GANACHE).zrx_token,
... )
>>> weth_token = ERC20Token(
... web3_or_provider=ganache,
... contract_address=chain_to_addresses(ChainId.GANACHE).ether_token,
... )
>>> erc20_proxy_addr = chain_to_addresses(ChainId.GANACHE).erc20_proxy
>>> tx = zrx_token.approve.send_transaction(
... erc20_proxy_addr,
... to_wei(100, 'ether'),
... tx_params=TxParams(from_=maker_address),
... )
>>> tx = weth_token.approve.send_transaction(
... erc20_proxy_addr,
... to_wei(100, 'ether'),
... tx_params=TxParams(from_=taker_address),
... )
Constructing an order¶
>>> from zero_ex.contract_wrappers.exchange.types import Order
>>> from zero_ex.order_utils import asset_data_utils
>>> from datetime import datetime, timedelta
>>> import random
>>> order = Order(
... makerAddress=maker_address,
... takerAddress='0x0000000000000000000000000000000000000000',
... senderAddress='0x0000000000000000000000000000000000000000',
... feeRecipientAddress='0x0000000000000000000000000000000000000000',
... makerAssetData=asset_data_utils.encode_erc20(zrx_address),
... takerAssetData=asset_data_utils.encode_erc20(weth_address),
... salt=random.randint(1, 100000000000000000),
... makerFee=0,
... takerFee=0,
... makerAssetAmount=to_wei(0.1, 'ether'),
... takerAssetAmount=to_wei(0.1, 'ether'),
... expirationTimeSeconds=round(
... (datetime.utcnow() + timedelta(days=1)).timestamp()
... ),
... makerFeeAssetData='0x',
... takerFeeAssetData='0x',
... )
For this order to be valid, our Maker must sign a hash of it:
>>> from zero_ex.order_utils import generate_order_hash_hex
>>> order_hash_hex = generate_order_hash_hex(
... order, exchange_address, Web3(ganache).eth.chainId
... )
>>> from zero_ex.order_utils import sign_hash
>>> maker_signature = sign_hash(
... ganache, Web3.toChecksumAddress(maker_address), order_hash_hex
... )
Now our Maker can either deliver this order, along with his signature, directly to the taker, or he can choose to broadcast the order to a 0x Relayer. For more information on working with Relayers, see the documentation for 0x-sra-client.
Filling an order¶
Now we’ll have our Taker fill the order.
>>> from zero_ex.contract_wrappers.exchange import Exchange
>>> exchange = Exchange(
... web3_or_provider=ganache,
... contract_address=chain_to_addresses(ChainId.GANACHE).exchange,
... )
But before filling an order, one may wish to check that it’s actually fillable:
>>> from zero_ex.contract_wrappers.exchange.types import OrderStatus
>>> OrderStatus(exchange.get_order_info.call(order)["orderStatus"])
<OrderStatus.FILLABLE: 3>
The takerAssetAmount
parameter specifies the amount of tokens (in this
case WETH) that the taker wants to fill. This example fills the order
completely, but partial fills are possible too.
Note that sending value in the fill transaction is a way to pay the protocol fee. The value to send is a function of the gas price, so we’ll need some help in that determination:
>>> from web3.gas_strategies.rpc import rpc_gas_price_strategy
>>> web3 = Web3(ganache)
>>> web3.eth.setGasPriceStrategy(rpc_gas_price_strategy)
One may wish to first call the method in a read-only way, to ensure that it will not revert, and to validate that the return data is as expected:
>>> from pprint import pprint
>>> pprint(exchange.fill_order.call(
... order=order,
... taker_asset_fill_amount=order["takerAssetAmount"],
... signature=maker_signature,
... tx_params=TxParams(
... from_=taker_address, value=web3.eth.generateGasPrice() * 150000
... ),
... ))
{'makerAssetFilledAmount': 100000000000000000,
'makerFeePaid': 0,
'protocolFeePaid': ...,
'takerAssetFilledAmount': 100000000000000000,
'takerFeePaid': 0}
Finally, submit the transaction:
>>> tx_hash = exchange.fill_order.send_transaction(
... order=order,
... taker_asset_fill_amount=order["takerAssetAmount"],
... signature=maker_signature,
... tx_params=TxParams(
... from_=taker_address, value=web3.eth.generateGasPrice() * 150000
... )
... )
Once the transaction is mined, we can get the details of our exchange through the exchange wrapper:
>>> exchange.get_fill_event(tx_hash)
(AttributeDict({'args': ...({'makerAddress': ...}), 'event': 'Fill', ...}),)
>>> pprint(exchange.get_fill_event(tx_hash)[0].args.__dict__)
{'feeRecipientAddress': '0x0000000000000000000000000000000000000000',
'makerAddress': '0x...',
'makerAssetData': b...,
'makerAssetFilledAmount': 100000000000000000,
'makerFeeAssetData': b...,
'makerFeePaid': 0,
'orderHash': b...,
'protocolFeePaid': ...,
'senderAddress': '0x...',
'takerAddress': '0x...',
'takerAssetData': b...,
'takerAssetFilledAmount': 100000000000000000,
'takerFeeAssetData': b...,
'takerFeePaid': 0}
>>> exchange.get_fill_event(tx_hash)[0].args.takerAssetFilledAmount
100000000000000000
Cancelling an order¶
A Maker can cancel an order that has yet to be filled.
>>> order = Order(
... makerAddress=maker_address,
... takerAddress='0x0000000000000000000000000000000000000000',
... exchangeAddress=exchange_address,
... senderAddress='0x0000000000000000000000000000000000000000',
... feeRecipientAddress='0x0000000000000000000000000000000000000000',
... makerAssetData=asset_data_utils.encode_erc20(weth_address),
... makerFeeAssetData=asset_data_utils.encode_erc20('0x' + '00'*20),
... takerAssetData=asset_data_utils.encode_erc20(weth_address),
... takerFeeAssetData=asset_data_utils.encode_erc20('0x' + '00'*20),
... salt=random.randint(1, 100000000000000000),
... makerFee=0,
... takerFee=0,
... makerAssetAmount=1000000000000000000,
... takerAssetAmount=500000000000000000000,
... expirationTimeSeconds=round(
... (datetime.utcnow() + timedelta(days=1)).timestamp()
... )
... )
>>> tx_hash = exchange.cancel_order.send_transaction(
... order=order, tx_params=TxParams(from_=maker_address)
... )
Once the transaction is mined, we can get the details of the cancellation through the Exchange wrapper:
>>> exchange.get_cancel_event(tx_hash)
(AttributeDict({'args': ...({'makerAddress': ...}), 'event': 'Cancel', ...}),)
>>> pprint(exchange.get_cancel_event(tx_hash)[0].args.__dict__)
{'feeRecipientAddress': '0x0000000000000000000000000000000000000000',
'makerAddress': '0x...',
'makerAssetData': b...,
'orderHash': b...,
'senderAddress': '0x...',
'takerAssetData': b...}
>>> exchange.get_cancel_event(tx_hash)[0].args.feeRecipientAddress
'0x0000000000000000000000000000000000000000'
Batching orders¶
The Exchange contract can also process multiple orders at the same time. Here is an example where the taker fills two orders in one transaction:
>>> order_1 = Order(
... makerAddress=maker_address,
... takerAddress='0x0000000000000000000000000000000000000000',
... senderAddress='0x0000000000000000000000000000000000000000',
... feeRecipientAddress='0x0000000000000000000000000000000000000000',
... makerAssetData=asset_data_utils.encode_erc20(zrx_address),
... makerFeeAssetData=asset_data_utils.encode_erc20('0x' + '00'*20),
... takerAssetData=asset_data_utils.encode_erc20(weth_address),
... takerFeeAssetData=asset_data_utils.encode_erc20('0x' + '00'*20),
... salt=random.randint(1, 100000000000000000),
... makerFee=0,
... takerFee=0,
... makerAssetAmount=100,
... takerAssetAmount=100,
... expirationTimeSeconds=round(
... (datetime.utcnow() + timedelta(days=1)).timestamp()
... )
... )
>>> signature_1 = sign_hash(
... ganache,
... Web3.toChecksumAddress(maker_address),
... generate_order_hash_hex(
... order_1, exchange.contract_address, Web3(ganache).eth.chainId
... ),
... )
>>> order_2 = Order(
... makerAddress=maker_address,
... takerAddress='0x0000000000000000000000000000000000000000',
... senderAddress='0x0000000000000000000000000000000000000000',
... feeRecipientAddress='0x0000000000000000000000000000000000000000',
... makerAssetData=asset_data_utils.encode_erc20(zrx_address),
... makerFeeAssetData=asset_data_utils.encode_erc20('0x' + '00'*20),
... takerAssetData=asset_data_utils.encode_erc20(weth_address),
... takerFeeAssetData=asset_data_utils.encode_erc20('0x' + '00'*20),
... salt=random.randint(1, 100000000000000000),
... makerFee=0,
... takerFee=0,
... makerAssetAmount=200,
... takerAssetAmount=200,
... expirationTimeSeconds=round(
... (datetime.utcnow() + timedelta(days=1)).timestamp()
... )
... )
>>> signature_2 = sign_hash(
... ganache,
... Web3.toChecksumAddress(maker_address),
... generate_order_hash_hex(
... order_2, exchange.contract_address, Web3(ganache).eth.chainId
... ),
... )
Fill order_1 and order_2 together:
>>> exchange.batch_fill_orders.send_transaction(
... orders=[order_1, order_2],
... taker_asset_fill_amounts=[1, 2],
... signatures=[signature_1, signature_2],
... tx_params=TxParams(
... from_=taker_address,
... value=2*web3.eth.generateGasPrice()*150000
... )
... )
HexBytes('0x...')
Estimating gas consumption¶
Before executing a transaction, you may want to get an estimate of how much gas will be consumed.
>>> exchange.cancel_order.estimate_gas(
... order=Order(
... makerAddress=maker_address,
... takerAddress='0x0000000000000000000000000000000000000000',
... exchangeAddress=exchange_address,
... senderAddress='0x0000000000000000000000000000000000000000',
... feeRecipientAddress='0x0000000000000000000000000000000000000000',
... makerAssetData=asset_data_utils.encode_erc20(weth_address),
... makerFeeAssetData=asset_data_utils.encode_erc20('0x' + '00'*20),
... takerAssetData=asset_data_utils.encode_erc20(weth_address),
... takerFeeAssetData=asset_data_utils.encode_erc20('0x' + '00'*20),
... salt=random.randint(1, 100000000000000000),
... makerFee=0,
... takerFee=0,
... makerAssetAmount=1000000000000000000,
... takerAssetAmount=500000000000000000000,
... expirationTimeSeconds=round(
... (datetime.utcnow() + timedelta(days=1)).timestamp()
... )
... ),
... tx_params=TxParams(from_=maker_address),
... )
74...
zero_ex.contract_wrappers.asset_proxy_owner¶
Generated wrapper for AssetProxyOwner Solidity contract.
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
AddOwnerMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the addOwner method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows to add a new owner. Transaction has to be sent by wallet.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
AssetProxyOwner
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for AssetProxyOwner Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[AssetProxyOwnerValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
add_owner
= None¶ Constructor-initialized instance of
AddOwnerMethod
.
-
change_requirement
= None¶ Constructor-initialized instance of
ChangeRequirementMethod
.
-
change_time_lock
= None¶ Constructor-initialized instance of
ChangeTimeLockMethod
.
-
confirm_transaction
= None¶ Constructor-initialized instance of
ConfirmTransactionMethod
.
-
confirmation_times
= None¶ Constructor-initialized instance of
ConfirmationTimesMethod
.
-
confirmations
= None¶ Constructor-initialized instance of
ConfirmationsMethod
.
-
execute_transaction
= None¶ Constructor-initialized instance of
ExecuteTransactionMethod
.
-
function_call_time_locks
= None¶ Constructor-initialized instance of
FunctionCallTimeLocksMethod
.
-
get_confirmation_count
= None¶ Constructor-initialized instance of
GetConfirmationCountMethod
.
-
get_confirmations
= None¶ Constructor-initialized instance of
GetConfirmationsMethod
.
-
get_function_call_time_lock_registration_event
(tx_hash)[source]¶ Get log entry for FunctionCallTimeLockRegistration event.
-
get_owners
= None¶ Constructor-initialized instance of
GetOwnersMethod
.
-
get_transaction_count
= None¶ Constructor-initialized instance of
GetTransactionCountMethod
.
-
get_transaction_ids
= None¶ Constructor-initialized instance of
GetTransactionIdsMethod
.
-
is_confirmed
= None¶ Constructor-initialized instance of
IsConfirmedMethod
.
-
is_owner
= None¶ Constructor-initialized instance of
IsOwnerMethod
.
-
max_owner_count
= None¶ Constructor-initialized instance of
MaxOwnerCountMethod
.
-
owners
= None¶ Constructor-initialized instance of
OwnersMethod
.
-
register_function_call
= None¶ Constructor-initialized instance of
RegisterFunctionCallMethod
.
-
remove_owner
= None¶ Constructor-initialized instance of
RemoveOwnerMethod
.
-
replace_owner
= None¶ Constructor-initialized instance of
ReplaceOwnerMethod
.
-
required
= None¶ Constructor-initialized instance of
RequiredMethod
.
-
revoke_confirmation
= None¶ Constructor-initialized instance of
RevokeConfirmationMethod
.
-
seconds_time_locked
= None¶ Constructor-initialized instance of
SecondsTimeLockedMethod
.
-
submit_transaction
= None¶ Constructor-initialized instance of
SubmitTransactionMethod
.
-
transaction_count
= None¶ Constructor-initialized instance of
TransactionCountMethod
.
-
transactions
= None¶ Constructor-initialized instance of
TransactionsMethod
.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
AssetProxyOwnerValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
ChangeRequirementMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the changeRequirement method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_required, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_required, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows to change the number of required confirmations. Transaction has to be sent by wallet.
-
estimate_gas
(_required, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
ChangeTimeLockMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the changeTimeLock method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_seconds_time_locked, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_seconds_time_locked, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Changes the duration of the time lock for transactions.
- Parameters
_secondsTimeLocked – Duration needed after a transaction is confirmed and before it becomes executable, in seconds.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(_seconds_time_locked, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
ConfirmTransactionMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the confirmTransaction method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(transaction_id, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(transaction_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows an owner to confirm a transaction.
- Parameters
transactionId – Transaction ID.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(transaction_id, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
ConfirmationTimesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the confirmationTimes method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
ConfirmationsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the confirmations method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
ExecuteTransactionMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the executeTransaction method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(transaction_id, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(transaction_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows anyone to execute a confirmed transaction. Transactions must encode the values with the signature “bytes[] data, address[] destinations, uint256[] values” The destination and value fields of the transaction in storage are ignored. All function calls must be successful or the entire call will revert.
- Parameters
transactionId – Transaction ID.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(transaction_id, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(transaction_id, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Allows anyone to execute a confirmed transaction. Transactions must encode the values with the signature “bytes[] data, address[] destinations, uint256[] values” The destination and value fields of the transaction in storage are ignored. All function calls must be successful or the entire call will revert.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
FunctionCallTimeLocksMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the functionCallTimeLocks method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
GetConfirmationCountMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getConfirmationCount method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(transaction_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Returns number of confirmations of a transaction.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
GetConfirmationsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getConfirmations method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(transaction_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Returns array with owner addresses, which confirmed transaction.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
GetOwnersMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getOwners method.
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
GetTransactionCountMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getTransactionCount method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(pending, executed, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Returns total number of transactions after filers are applied.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
GetTransactionIdsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getTransactionIds method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_from, to, pending, executed, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Returns list of transaction IDs in defined range.
- Parameters
- Return type
- Returns
Returns array of transaction IDs.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
IsConfirmedMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isConfirmed method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(transaction_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Returns the confirmation status of a transaction.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
IsOwnerMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isOwner method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
MaxOwnerCountMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the MAX_OWNER_COUNT method.
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
OwnersMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the owners method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
RegisterFunctionCallMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the registerFunctionCall method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(has_custom_time_lock, function_selector, destination, new_seconds_time_locked, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(has_custom_time_lock, function_selector, destination, new_seconds_time_locked, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Registers a custom timelock to a specific function selector / destination combo
- Parameters
destination (
str
) – Address of destination where function will be called.functionSelector – 4 byte selector of registered function.
hasCustomTimeLock – True if timelock is custom.
newSecondsTimeLocked – Duration in seconds needed after a transaction is confirmed to become executable.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(has_custom_time_lock, function_selector, destination, new_seconds_time_locked, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(has_custom_time_lock, function_selector, destination, new_seconds_time_locked, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Registers a custom timelock to a specific function selector / destination combo
- Parameters
destination (
str
) – Address of destination where function will be called.functionSelector – 4 byte selector of registered function.
hasCustomTimeLock – True if timelock is custom.
newSecondsTimeLocked – Duration in seconds needed after a transaction is confirmed to become executable.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
RemoveOwnerMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeOwner method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows to remove an owner. Transaction has to be sent by wallet.
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
ReplaceOwnerMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the replaceOwner method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(owner, new_owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(owner, new_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
-
estimate_gas
(owner, new_owner, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
RequiredMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the required method.
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
RevokeConfirmationMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the revokeConfirmation method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(transaction_id, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(transaction_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows an owner to revoke a confirmation for a transaction.
- Parameters
transactionId – Transaction ID.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(transaction_id, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
SecondsTimeLockedMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the secondsTimeLocked method.
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
SubmitTransactionMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the submitTransaction method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(destination, value, data, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(destination, value, data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows an owner to submit and confirm a transaction.
-
estimate_gas
(destination, value, data, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
TransactionCountMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the transactionCount method.
-
class
zero_ex.contract_wrappers.asset_proxy_owner.
TransactionsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transactions method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
zero_ex.contract_wrappers.coordinator¶
Generated wrapper for Coordinator Solidity contract.
-
class
zero_ex.contract_wrappers.coordinator.
AssertValidCoordinatorApprovalsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the assertValidCoordinatorApprovals method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(transaction, tx_origin, transaction_signature, approval_signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Validates that the 0x transaction has been approved by all of the feeRecipients that correspond to each order in the transaction’s Exchange calldata.
- Parameters
approvalSignatures – Array of signatures that correspond to the feeRecipients of each order in the transaction’s Exchange calldata.
transaction (
LibZeroExTransactionZeroExTransaction
) – 0x transaction containing salt, signerAddress, and data.transactionSignature – Proof that the transaction has been signed by the signer.
txOrigin – Required signer of Ethereum transaction calling this function.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
-
-
class
zero_ex.contract_wrappers.coordinator.
Coordinator
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for Coordinator Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[CoordinatorValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
assert_valid_coordinator_approvals
= None¶ Constructor-initialized instance of
AssertValidCoordinatorApprovalsMethod
.
-
decode_orders_from_fill_data
= None¶ Constructor-initialized instance of
DecodeOrdersFromFillDataMethod
.
-
eip712_coordinator_approval_schema_hash
= None¶ Constructor-initialized instance of
Eip712CoordinatorApprovalSchemaHashMethod
.
-
eip712_coordinator_domain_hash
= None¶ Constructor-initialized instance of
Eip712CoordinatorDomainHashMethod
.
-
eip712_coordinator_domain_name
= None¶ Constructor-initialized instance of
Eip712CoordinatorDomainNameMethod
.
-
eip712_coordinator_domain_version
= None¶ Constructor-initialized instance of
Eip712CoordinatorDomainVersionMethod
.
-
eip712_exchange_domain_hash
= None¶ Constructor-initialized instance of
Eip712ExchangeDomainHashMethod
.
-
execute_transaction
= None¶ Constructor-initialized instance of
ExecuteTransactionMethod
.
-
get_coordinator_approval_hash
= None¶ Constructor-initialized instance of
GetCoordinatorApprovalHashMethod
.
-
get_signer_address
= None¶ Constructor-initialized instance of
GetSignerAddressMethod
.
-
-
class
zero_ex.contract_wrappers.coordinator.
CoordinatorValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.coordinator.
DecodeOrdersFromFillDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeOrdersFromFillData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decodes the orders from Exchange calldata representing any fill method.
-
-
class
zero_ex.contract_wrappers.coordinator.
Eip712CoordinatorApprovalSchemaHashMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the EIP712_COORDINATOR_APPROVAL_SCHEMA_HASH method.
-
class
zero_ex.contract_wrappers.coordinator.
Eip712CoordinatorDomainHashMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the EIP712_COORDINATOR_DOMAIN_HASH method.
-
class
zero_ex.contract_wrappers.coordinator.
Eip712CoordinatorDomainNameMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the EIP712_COORDINATOR_DOMAIN_NAME method.
-
class
zero_ex.contract_wrappers.coordinator.
Eip712CoordinatorDomainVersionMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the EIP712_COORDINATOR_DOMAIN_VERSION method.
-
class
zero_ex.contract_wrappers.coordinator.
Eip712ExchangeDomainHashMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the EIP712_EXCHANGE_DOMAIN_HASH method.
-
class
zero_ex.contract_wrappers.coordinator.
ExecuteTransactionMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the executeTransaction method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(transaction, tx_origin, transaction_signature, approval_signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(transaction, tx_origin, transaction_signature, approval_signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes a 0x transaction that has been signed by the feeRecipients that correspond to each order in the transaction’s Exchange calldata.
- Parameters
approvalSignatures – Array of signatures that correspond to the feeRecipients of each order in the transaction’s Exchange calldata.
transaction (
LibZeroExTransactionZeroExTransaction
) – 0x transaction containing salt, signerAddress, and data.transactionSignature – Proof that the transaction has been signed by the signer.
txOrigin – Required signer of Ethereum transaction calling this function.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(transaction, tx_origin, transaction_signature, approval_signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(transaction, tx_origin, transaction_signature, approval_signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Executes a 0x transaction that has been signed by the feeRecipients that correspond to each order in the transaction’s Exchange calldata.
- Parameters
approvalSignatures – Array of signatures that correspond to the feeRecipients of each order in the transaction’s Exchange calldata.
transaction (
LibZeroExTransactionZeroExTransaction
) – 0x transaction containing salt, signerAddress, and data.transactionSignature – Proof that the transaction has been signed by the signer.
txOrigin – Required signer of Ethereum transaction calling this function.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.coordinator.
GetCoordinatorApprovalHashMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getCoordinatorApprovalHash method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(approval, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Calculates the EIP712 hash of the Coordinator approval mesasage using the domain separator of this contract.
- Parameters
approval (
LibCoordinatorApprovalCoordinatorApproval
) – Coordinator approval message containing the transaction hash, and transaction signature.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
approvalHash EIP712 hash of the Coordinator approval message with the domain separator of this contract.
-
-
class
zero_ex.contract_wrappers.coordinator.
GetSignerAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getSignerAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_hash, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Recovers the address of a signer given a hash and signature.
-
zero_ex.contract_wrappers.coordinator_registry¶
Generated wrapper for CoordinatorRegistry Solidity contract.
-
class
zero_ex.contract_wrappers.coordinator_registry.
CoordinatorRegistry
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for CoordinatorRegistry Solidity contract.
-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[CoordinatorRegistryValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
get_coordinator_endpoint
= None¶ Constructor-initialized instance of
GetCoordinatorEndpointMethod
.
-
get_coordinator_endpoint_set_event
(tx_hash)[source]¶ Get log entry for CoordinatorEndpointSet event.
-
set_coordinator_endpoint
= None¶ Constructor-initialized instance of
SetCoordinatorEndpointMethod
.
-
-
class
zero_ex.contract_wrappers.coordinator_registry.
CoordinatorRegistryValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.coordinator_registry.
GetCoordinatorEndpointMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getCoordinatorEndpoint method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(coordinator_operator, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Gets the endpoint for a Coordinator.
-
-
class
zero_ex.contract_wrappers.coordinator_registry.
SetCoordinatorEndpointMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the setCoordinatorEndpoint method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(coordinator_endpoint, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(coordinator_endpoint, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Called by a Coordinator operator to set the endpoint of their Coordinator.
- Parameters
coordinatorEndpoint – Endpoint of the Coordinator as a string.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(coordinator_endpoint, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.dev_utils¶
Generated wrapper for DevUtils Solidity contract.
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeAssetProxyDispatchErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeAssetProxyDispatchError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded AssetProxyDispatchError.
- Parameters
- Return type
- Returns
errorCode The error code.orderHash Hash of the order being dispatched.assetData Asset data of the order being dispatched.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeAssetProxyExistsErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeAssetProxyExistsError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded AssetProxyExistsError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeAssetProxyIdMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeAssetProxyId method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decode AssetProxy identifier
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeAssetProxyTransferErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeAssetProxyTransferError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded AssetProxyTransferError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeEip1271SignatureErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeEIP1271SignatureError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded SignatureValidatorError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeErc1155AssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeERC1155AssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decode ERC-1155 asset data from the format described in the AssetProxy contract specification.
- Parameters
assetData – AssetProxy-compliant asset data describing an ERC- 1155 set of assets.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
Tuple
[Union
[bytes
,str
],str
,List
[int
],List
[int
],Union
[bytes
,str
]]- Returns
The ERC-1155 AssetProxy identifier, the address of the ERC- 1155 contract hosting the assets, an array of the identifiers of the assets to be traded, an array of asset amounts to be traded, and callback data. Each element of the arrays corresponds to the same-indexed element of the other array. Return values specified as memory are returned as pointers to locations within the memory of the input parameter assetData.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeErc20AssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeERC20AssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decode ERC-20 asset data from the format described in the AssetProxy contract specification.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeErc721AssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeERC721AssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decode ERC-721 asset data from the format described in the AssetProxy contract specification.
- Parameters
assetData – AssetProxy-compliant asset data describing an ERC-721 asset.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
The ERC-721 AssetProxy identifier, the address of the ERC-721 contract hosting this asset, and the identifier of the specific asset to be traded.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeExchangeInvalidContextErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeExchangeInvalidContextError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded OrderStatusError.
- Parameters
- Return type
- Returns
errorCode Error code that corresponds to invalid maker, taker, or sender.orderHash The order hash.contextAddress The maker, taker, or sender address
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeFillErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeFillError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded FillError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeIncompleteFillErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeIncompleteFillError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded IncompleteFillError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeMultiAssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeMultiAssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decode multi-asset data from the format described in the AssetProxy contract specification.
- Parameters
assetData – AssetProxy-compliant data describing a multi-asset basket.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
Tuple
[Union
[bytes
,str
],List
[int
],List
[Union
[bytes
,str
]]]- Returns
The Multi-Asset AssetProxy identifier, an array of the amounts of the assets to be traded, and an array of the AssetProxy- compliant data describing each asset to be traded. Each element of the arrays corresponds to the same-indexed element of the other array.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeNegativeSpreadErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeNegativeSpreadError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded NegativeSpreadError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeOrderEpochErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeOrderEpochError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded OrderEpochError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeOrderStatusErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeOrderStatusError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded OrderStatusError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeSignatureErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeSignatureError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded SignatureError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeSignatureValidatorNotApprovedErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeSignatureValidatorNotApprovedError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded SignatureValidatorNotApprovedError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeSignatureWalletErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeSignatureWalletError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded SignatureWalletError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeStaticCallAssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeStaticCallAssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decode StaticCall asset data from the format described in the AssetProxy contract specification.
- Parameters
assetData – AssetProxy-compliant asset data describing a StaticCall asset
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
Tuple
[Union
[bytes
,str
],str
,Union
[bytes
,str
],Union
[bytes
,str
]]- Returns
The StaticCall AssetProxy identifier, the target address of the StaticCAll, the data to be passed to the target address, and the expected Keccak-256 hash of the static call return data.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeTransactionErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeTransactionError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded TransactionError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeTransactionExecutionErrorMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeTransactionExecutionError method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(encoded, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decompose an ABI-encoded TransactionExecutionError.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DecodeZeroExTransactionDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the decodeZeroExTransactionData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(transaction_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Decodes the call data for an Exchange contract method call.
- Parameters
transactionData – ABI-encoded calldata for an Exchange contract method call.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
Tuple
[str
,List
[LibOrderOrder
],List
[int
],List
[Union
[bytes
,str
]]]- Returns
The name of the function called, and the parameters it was given. For single-order fills and cancels, the arrays will have just one element.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DevUtils
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for DevUtils Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[DevUtilsValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
decode_asset_proxy_dispatch_error
= None¶ Constructor-initialized instance of
DecodeAssetProxyDispatchErrorMethod
.
-
decode_asset_proxy_exists_error
= None¶ Constructor-initialized instance of
DecodeAssetProxyExistsErrorMethod
.
-
decode_asset_proxy_id
= None¶ Constructor-initialized instance of
DecodeAssetProxyIdMethod
.
-
decode_asset_proxy_transfer_error
= None¶ Constructor-initialized instance of
DecodeAssetProxyTransferErrorMethod
.
-
decode_eip1271_signature_error
= None¶ Constructor-initialized instance of
DecodeEip1271SignatureErrorMethod
.
-
decode_erc1155_asset_data
= None¶ Constructor-initialized instance of
DecodeErc1155AssetDataMethod
.
-
decode_erc20_asset_data
= None¶ Constructor-initialized instance of
DecodeErc20AssetDataMethod
.
-
decode_erc721_asset_data
= None¶ Constructor-initialized instance of
DecodeErc721AssetDataMethod
.
-
decode_exchange_invalid_context_error
= None¶ Constructor-initialized instance of
DecodeExchangeInvalidContextErrorMethod
.
-
decode_fill_error
= None¶ Constructor-initialized instance of
DecodeFillErrorMethod
.
-
decode_incomplete_fill_error
= None¶ Constructor-initialized instance of
DecodeIncompleteFillErrorMethod
.
-
decode_multi_asset_data
= None¶ Constructor-initialized instance of
DecodeMultiAssetDataMethod
.
-
decode_negative_spread_error
= None¶ Constructor-initialized instance of
DecodeNegativeSpreadErrorMethod
.
-
decode_order_epoch_error
= None¶ Constructor-initialized instance of
DecodeOrderEpochErrorMethod
.
-
decode_order_status_error
= None¶ Constructor-initialized instance of
DecodeOrderStatusErrorMethod
.
-
decode_signature_error
= None¶ Constructor-initialized instance of
DecodeSignatureErrorMethod
.
-
decode_signature_validator_not_approved_error
= None¶ Constructor-initialized instance of
DecodeSignatureValidatorNotApprovedErrorMethod
.
-
decode_signature_wallet_error
= None¶ Constructor-initialized instance of
DecodeSignatureWalletErrorMethod
.
-
decode_static_call_asset_data
= None¶ Constructor-initialized instance of
DecodeStaticCallAssetDataMethod
.
-
decode_transaction_error
= None¶ Constructor-initialized instance of
DecodeTransactionErrorMethod
.
-
decode_transaction_execution_error
= None¶ Constructor-initialized instance of
DecodeTransactionExecutionErrorMethod
.
-
decode_zero_ex_transaction_data
= None¶ Constructor-initialized instance of
DecodeZeroExTransactionDataMethod
.
-
eip712_exchange_domain_hash
= None¶ Constructor-initialized instance of
Eip712ExchangeDomainHashMethod
.
-
encode_erc1155_asset_data
= None¶ Constructor-initialized instance of
EncodeErc1155AssetDataMethod
.
-
encode_erc20_asset_data
= None¶ Constructor-initialized instance of
EncodeErc20AssetDataMethod
.
-
encode_erc721_asset_data
= None¶ Constructor-initialized instance of
EncodeErc721AssetDataMethod
.
-
encode_multi_asset_data
= None¶ Constructor-initialized instance of
EncodeMultiAssetDataMethod
.
-
encode_static_call_asset_data
= None¶ Constructor-initialized instance of
EncodeStaticCallAssetDataMethod
.
-
get_asset_proxy_allowance
= None¶ Constructor-initialized instance of
GetAssetProxyAllowanceMethod
.
-
get_balance
= None¶ Constructor-initialized instance of
GetBalanceMethod
.
-
get_balance_and_asset_proxy_allowance
= None¶ Constructor-initialized instance of
GetBalanceAndAssetProxyAllowanceMethod
.
-
get_batch_asset_proxy_allowances
= None¶ Constructor-initialized instance of
GetBatchAssetProxyAllowancesMethod
.
-
get_batch_balances
= None¶ Constructor-initialized instance of
GetBatchBalancesMethod
.
-
get_batch_balances_and_asset_proxy_allowances
= None¶ Constructor-initialized instance of
GetBatchBalancesAndAssetProxyAllowancesMethod
.
-
get_eth_balances
= None¶ Constructor-initialized instance of
GetEthBalancesMethod
.
-
get_order_hash
= None¶ Constructor-initialized instance of
GetOrderHashMethod
.
-
get_order_relevant_state
= None¶ Constructor-initialized instance of
GetOrderRelevantStateMethod
.
-
get_order_relevant_states
= None¶ Constructor-initialized instance of
GetOrderRelevantStatesMethod
.
-
get_simulated_order_transfer_results
= None¶ Constructor-initialized instance of
GetSimulatedOrderTransferResultsMethod
.
-
get_simulated_orders_transfer_results
= None¶ Constructor-initialized instance of
GetSimulatedOrdersTransferResultsMethod
.
-
get_transaction_hash
= None¶ Constructor-initialized instance of
GetTransactionHashMethod
.
-
get_transferable_asset_amount
= None¶ Constructor-initialized instance of
GetTransferableAssetAmountMethod
.
-
revert_if_invalid_asset_data
= None¶ Constructor-initialized instance of
RevertIfInvalidAssetDataMethod
.
-
-
class
zero_ex.contract_wrappers.dev_utils.
DevUtilsValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.dev_utils.
Eip712ExchangeDomainHashMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the EIP712_EXCHANGE_DOMAIN_HASH method.
-
class
zero_ex.contract_wrappers.dev_utils.
EncodeErc1155AssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the encodeERC1155AssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(token_address, token_ids, token_values, callback_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Encode ERC-1155 asset data into the format described in the AssetProxy contract specification.
- Parameters
callbackData – Data to be passed to receiving contracts when a transfer is performed.
tokenAddress – The address of the ERC-1155 contract hosting the asset(s) to be traded.
tokenIds – The identifiers of the specific assets to be traded.
tokenValues – The amounts of each asset to be traded.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
AssetProxy-compliant asset data describing the set of assets.
-
-
class
zero_ex.contract_wrappers.dev_utils.
EncodeErc20AssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the encodeERC20AssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(token_address, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Encode ERC-20 asset data into the format described in the AssetProxy contract specification.
-
-
class
zero_ex.contract_wrappers.dev_utils.
EncodeErc721AssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the encodeERC721AssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(token_address, token_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Encode ERC-721 asset data into the format described in the AssetProxy specification.
- Parameters
tokenAddress – The address of the ERC-721 contract hosting the asset to be traded.
tokenId – The identifier of the specific asset to be traded.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
AssetProxy-compliant asset data describing the asset.
-
-
class
zero_ex.contract_wrappers.dev_utils.
EncodeMultiAssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the encodeMultiAssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(amounts, nested_asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Encode data for multiple assets, per the AssetProxy contract specification.
- Parameters
- Return type
- Returns
AssetProxy-compliant data describing the set of assets.
-
-
class
zero_ex.contract_wrappers.dev_utils.
EncodeStaticCallAssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the encodeStaticCallAssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(static_call_target_address, static_call_data, expected_return_data_hash, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Encode StaticCall asset data into the format described in the AssetProxy contract specification.
- Parameters
expectedReturnDataHash – Expected Keccak-256 hash of the StaticCall return data.
staticCallData – Data that will be passed to staticCallTargetAddress in the StaticCall.
staticCallTargetAddress – Target address of StaticCall.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
AssetProxy-compliant asset data describing the set of assets.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetAssetProxyAllowanceMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getAssetProxyAllowance method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(owner_address, asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Returns the number of asset(s) (described by assetData) that the corresponding AssetProxy contract is authorized to spend. When the asset data contains multiple assets (eg for Multi-Asset), the return value indicates how many complete “baskets” of those assets may be spent by all of the corresponding AssetProxy contracts.
- Parameters
assetData – Details of asset, encoded per the AssetProxy contract specification.
ownerAddress – Owner of the assets specified by assetData.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
Number of assets (or asset baskets) that the corresponding AssetProxy is authorized to spend.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetBalanceAndAssetProxyAllowanceMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getBalanceAndAssetProxyAllowance method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(owner_address, asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Calls getBalance() and getAllowance() for assetData.
- Parameters
assetData – Details of asset, encoded per the AssetProxy contract specification.
ownerAddress – Owner of the assets specified by assetData.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
Number of assets (or asset baskets) held by owner, and number of assets (or asset baskets) that the corresponding AssetProxy is authorized to spend.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetBalanceMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getBalance method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(owner_address, asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Returns the owner’s balance of the assets(s) specified in assetData. When the asset data contains multiple assets (eg in ERC1155 or Multi- Asset), the return value indicates how many complete “baskets” of those assets are owned by owner.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetBatchAssetProxyAllowancesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getBatchAssetProxyAllowances method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(owner_address, asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Calls getAssetProxyAllowance() for each element of assetData.
- Parameters
assetData – Array of asset details, each encoded per the AssetProxy contract specification.
ownerAddress – Owner of the assets specified by assetData.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
An array of asset allowances from getAllowance(), with each element corresponding to the same-indexed element in the assetData input.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetBatchBalancesAndAssetProxyAllowancesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getBatchBalancesAndAssetProxyAllowances method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(owner_address, asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Calls getBatchBalances() and getBatchAllowances() for each element of assetData.
- Parameters
assetData – Array of asset details, each encoded per the AssetProxy contract specification.
ownerAddress – Owner of the assets specified by assetData.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
An array of asset balances from getBalance(), and an array of asset allowances from getAllowance(), with each element corresponding to the same-indexed element in the assetData input.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetBatchBalancesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getBatchBalances method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(owner_address, asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Calls getBalance() for each element of assetData.
- Parameters
assetData – Array of asset details, each encoded per the AssetProxy contract specification.
ownerAddress – Owner of the assets specified by assetData.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
Array of asset balances from getBalance(), with each element corresponding to the same-indexed element in the assetData input.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetEthBalancesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getEthBalances method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(addresses, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Batch fetches ETH balances
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetOrderHashMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getOrderHash method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(order, chain_id, exchange, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetOrderRelevantStateMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getOrderRelevantState method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(order, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Fetches all order-relevant information needed to validate if the supplied order is fillable.
- Parameters
- Return type
- Returns
The orderInfo (hash, status, and takerAssetAmount already filled for the given order), fillableTakerAssetAmount (amount of the order’s takerAssetAmount that is fillable given all on-chain state), and isValidSignature (validity of the provided signature). NOTE: If the takerAssetData encodes data for multiple assets, fillableTakerAssetAmount will represent a “scaled” amount, meaning it must be multiplied by all the individual asset amounts within the takerAssetData to get the final amount of each asset that can be filled.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetOrderRelevantStatesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getOrderRelevantStates method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(orders, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Fetches all order-relevant information needed to validate if the supplied orders are fillable.
- Parameters
orders (
List
[LibOrderOrder
]) – Array of order structures.signatures (
List
[Union
[bytes
,str
]]) – Array of signatures provided by makers that prove the authenticity of the orders. 0x01 can always be provided if a signature does not need to be validated.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
The ordersInfo (array of the hash, status, and takerAssetAmount already filled for each order), fillableTakerAssetAmounts (array of amounts for each order’s takerAssetAmount that is fillable given all on-chain state), and isValidSignature (array containing the validity of each provided signature). NOTE: If the takerAssetData encodes data for multiple assets, each element of fillableTakerAssetAmounts will represent a “scaled” amount, meaning it must be multiplied by all the individual asset amounts within the takerAssetData to get the final amount of each asset that can be filled.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetSimulatedOrderTransferResultsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getSimulatedOrderTransferResults method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(order, taker_address, taker_asset_fill_amount, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(order, taker_address, taker_asset_fill_amount, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Simulates all of the transfers within an order and returns the index of the first failed transfer.
- Parameters
order (
LibOrderOrder
) – The order to simulate transfers for.takerAddress – The address of the taker that will fill the order.
takerAssetFillAmount – The amount of takerAsset that the taker wished to fill.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
the return value of the underlying method.
-
estimate_gas
(order, taker_address, taker_asset_fill_amount, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(order, taker_address, taker_asset_fill_amount, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Simulates all of the transfers within an order and returns the index of the first failed transfer.
- Parameters
order (
LibOrderOrder
) – The order to simulate transfers for.takerAddress – The address of the taker that will fill the order.
takerAssetFillAmount – The amount of takerAsset that the taker wished to fill.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetSimulatedOrdersTransferResultsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getSimulatedOrdersTransferResults method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, taker_addresses, taker_asset_fill_amounts, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, taker_addresses, taker_asset_fill_amounts, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Simulates all of the transfers for each given order and returns the indices of each first failed transfer.
- Parameters
orders (
List
[LibOrderOrder
]) – Array of orders to individually simulate transfers for.takerAddresses – Array of addresses of takers that will fill each order.
takerAssetFillAmounts – Array of amounts of takerAsset that will be filled for each order.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
the return value of the underlying method.
-
estimate_gas
(orders, taker_addresses, taker_asset_fill_amounts, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(orders, taker_addresses, taker_asset_fill_amounts, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Simulates all of the transfers for each given order and returns the indices of each first failed transfer.
- Parameters
orders (
List
[LibOrderOrder
]) – Array of orders to individually simulate transfers for.takerAddresses – Array of addresses of takers that will fill each order.
takerAssetFillAmounts – Array of amounts of takerAsset that will be filled for each order.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetTransactionHashMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getTransactionHash method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(transaction, chain_id, exchange, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
-
-
class
zero_ex.contract_wrappers.dev_utils.
GetTransferableAssetAmountMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getTransferableAssetAmount method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(owner_address, asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Gets the amount of an asset transferable by the owner.
- Parameters
assetData – Description of tokens, per the AssetProxy contract specification.
ownerAddress – Address of the owner of the asset.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
The amount of the asset tranferable by the owner. NOTE: If the assetData encodes data for multiple assets, the transferableAssetAmount will represent the amount of times the entire assetData can be transferred. To calculate the total individual transferable amounts, this scaled transferableAmount must be multiplied by the individual asset amounts located within the assetData.
-
-
class
zero_ex.contract_wrappers.dev_utils.
RevertIfInvalidAssetDataMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the revertIfInvalidAssetData method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
None
-
zero_ex.contract_wrappers.dutch_auction¶
Generated wrapper for DutchAuction Solidity contract.
-
class
zero_ex.contract_wrappers.dutch_auction.
DutchAuction
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for DutchAuction Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[DutchAuctionValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
get_auction_details
= None¶ Constructor-initialized instance of
GetAuctionDetailsMethod
.
-
match_orders
= None¶ Constructor-initialized instance of
MatchOrdersMethod
.
-
-
class
zero_ex.contract_wrappers.dutch_auction.
DutchAuctionValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.dutch_auction.
GetAuctionDetailsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getAuctionDetails method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(order, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(order, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Calculates the Auction Details for the given order
- Parameters
order (
Tuple0x260219a2
) – The sell ordertx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
Tuple0xdc58a88c
- Returns
the return value of the underlying method.
-
-
class
zero_ex.contract_wrappers.dutch_auction.
MatchOrdersMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the matchOrders method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(buy_order, sell_order, buy_signature, sell_signature, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(buy_order, sell_order, buy_signature, sell_signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Matches the buy and sell orders at an amount given the following: the current block time, the auction start time and the auction begin amount. The sell order is a an order at the lowest amount at the end of the auction. Excess from the match is transferred to the seller. Over time the price moves from beginAmount to endAmount given the current block.timestamp. sellOrder.expiryTimeSeconds is the end time of the auction. sellOrder.takerAssetAmount is the end amount of the auction (lowest possible amount). sellOrder.makerAssetData is the ABI encoded Asset Proxy data with the following data appended buyOrder.makerAssetData is the buyers bid on the auction, must meet the amount for the current block timestamp (uint256 beginTimeSeconds, uint256 beginAmount). This function reverts in the following scenarios: * Auction has not started (auctionDetails.currentTimeSeconds < auctionDetails.beginTimeSeconds) * Auction has expired (auctionDetails.endTimeSeconds < auctionDetails.currentTimeSeconds) * Amount is invalid: Buy order amount is too low (buyOrder.makerAssetAmount < auctionDetails.currentAmount) * Amount is invalid: Invalid begin amount (auctionDetails.beginAmount > auctionDetails.endAmount) * Any failure in the 0x Match Orders
- Parameters
buyOrder – The Buyer’s order. This order is for the current expected price of the auction.
buySignature – Proof that order was created by the buyer.
sellOrder – The Seller’s order. This order is for the lowest amount (at the end of the auction).
sellSignature – Proof that order was created by the seller.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
Tuple0x054ca44e
- Returns
the return value of the underlying method.
-
estimate_gas
(buy_order, sell_order, buy_signature, sell_signature, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(buy_order, sell_order, buy_signature, sell_signature, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Matches the buy and sell orders at an amount given the following: the current block time, the auction start time and the auction begin amount. The sell order is a an order at the lowest amount at the end of the auction. Excess from the match is transferred to the seller. Over time the price moves from beginAmount to endAmount given the current block.timestamp. sellOrder.expiryTimeSeconds is the end time of the auction. sellOrder.takerAssetAmount is the end amount of the auction (lowest possible amount). sellOrder.makerAssetData is the ABI encoded Asset Proxy data with the following data appended buyOrder.makerAssetData is the buyers bid on the auction, must meet the amount for the current block timestamp (uint256 beginTimeSeconds, uint256 beginAmount). This function reverts in the following scenarios: * Auction has not started (auctionDetails.currentTimeSeconds < auctionDetails.beginTimeSeconds) * Auction has expired (auctionDetails.endTimeSeconds < auctionDetails.currentTimeSeconds) * Amount is invalid: Buy order amount is too low (buyOrder.makerAssetAmount < auctionDetails.currentAmount) * Amount is invalid: Invalid begin amount (auctionDetails.beginAmount > auctionDetails.endAmount) * Any failure in the 0x Match Orders
- Parameters
buyOrder – The Buyer’s order. This order is for the current expected price of the auction.
buySignature – Proof that order was created by the buyer.
sellOrder – The Seller’s order. This order is for the lowest amount (at the end of the auction).
sellSignature – Proof that order was created by the seller.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
zero_ex.contract_wrappers.erc1155_mintable¶
Generated wrapper for ERC1155Mintable Solidity contract.
-
class
zero_ex.contract_wrappers.erc1155_mintable.
BalanceOfBatchMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the balanceOfBatch method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
BalanceOfMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the balanceOf method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
CreateMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the create method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(uri, is_nf, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(uri, is_nf, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
creates a new token
-
estimate_gas
(uri, is_nf, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
CreateWithTypeMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the createWithType method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_type, uri, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_type, uri, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
creates a new token
-
estimate_gas
(_type, uri, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
CreatorsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the creators method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
ERC1155Mintable
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for ERC1155Mintable Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ERC1155MintableValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
balance_of
= None¶ Constructor-initialized instance of
BalanceOfMethod
.
-
balance_of_batch
= None¶ Constructor-initialized instance of
BalanceOfBatchMethod
.
-
create
= None¶ Constructor-initialized instance of
CreateMethod
.
-
create_with_type
= None¶ Constructor-initialized instance of
CreateWithTypeMethod
.
-
creators
= None¶ Constructor-initialized instance of
CreatorsMethod
.
-
erc1155_batch_received
= None¶ Constructor-initialized instance of
Erc1155BatchReceivedMethod
.
-
erc1155_received
= None¶ Constructor-initialized instance of
Erc1155ReceivedMethod
.
-
get_non_fungible_base_type
= None¶ Constructor-initialized instance of
GetNonFungibleBaseTypeMethod
.
-
get_non_fungible_index
= None¶ Constructor-initialized instance of
GetNonFungibleIndexMethod
.
-
is_approved_for_all
= None¶ Constructor-initialized instance of
IsApprovedForAllMethod
.
-
is_fungible
= None¶ Constructor-initialized instance of
IsFungibleMethod
.
-
is_non_fungible
= None¶ Constructor-initialized instance of
IsNonFungibleMethod
.
-
is_non_fungible_base_type
= None¶ Constructor-initialized instance of
IsNonFungibleBaseTypeMethod
.
-
is_non_fungible_item
= None¶ Constructor-initialized instance of
IsNonFungibleItemMethod
.
-
max_index
= None¶ Constructor-initialized instance of
MaxIndexMethod
.
-
mint_fungible
= None¶ Constructor-initialized instance of
MintFungibleMethod
.
-
mint_non_fungible
= None¶ Constructor-initialized instance of
MintNonFungibleMethod
.
-
owner_of
= None¶ Constructor-initialized instance of
OwnerOfMethod
.
-
safe_batch_transfer_from
= None¶ Constructor-initialized instance of
SafeBatchTransferFromMethod
.
-
safe_transfer_from
= None¶ Constructor-initialized instance of
SafeTransferFromMethod
.
-
set_approval_for_all
= None¶ Constructor-initialized instance of
SetApprovalForAllMethod
.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
ERC1155MintableValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.erc1155_mintable.
Erc1155BatchReceivedMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the ERC1155_BATCH_RECEIVED method.
-
class
zero_ex.contract_wrappers.erc1155_mintable.
Erc1155ReceivedMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the ERC1155_RECEIVED method.
-
class
zero_ex.contract_wrappers.erc1155_mintable.
GetNonFungibleBaseTypeMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getNonFungibleBaseType method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
GetNonFungibleIndexMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getNonFungibleIndex method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
IsApprovedForAllMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isApprovedForAll method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
IsFungibleMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isFungible method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
IsNonFungibleBaseTypeMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isNonFungibleBaseType method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
IsNonFungibleItemMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isNonFungibleItem method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
IsNonFungibleMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isNonFungible method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
MaxIndexMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the maxIndex method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
MintFungibleMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the mintFungible method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_id, to, quantities, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_id, to, quantities, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
mints fungible tokens
-
estimate_gas
(_id, to, quantities, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
MintNonFungibleMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the mintNonFungible method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_type, to, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_type, to, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
mints a non-fungible token
-
estimate_gas
(_type, to, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
OwnerOfMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the ownerOf method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
SafeBatchTransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the safeBatchTransferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_from, to, ids, values, data, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_from, to, ids, values, data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
MUST emit TransferBatch event on success. Caller must be approved to manage the _from account’s tokens (see isApprovedForAll). MUST throw if _to is the zero address. MUST throw if length of _ids is not the same as length of _values. MUST throw if any of the balance of sender for token _ids is lower than the respective _values sent. MUST throw on any other error. When transfer is complete, this function MUST check if _to is a smart contract (code size > 0). If so, it MUST call onERC1155BatchReceived on _to and revert if the return value is not bytes4(keccak256(“onERC1155BatchReceived(address,address,uint256[],ui- nt256[],bytes)”)).
- Parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(_from, to, ids, values, data, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(_from, to, ids, values, data, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
MUST emit TransferBatch event on success. Caller must be approved to manage the _from account’s tokens (see isApprovedForAll). MUST throw if _to is the zero address. MUST throw if length of _ids is not the same as length of _values. MUST throw if any of the balance of sender for token _ids is lower than the respective _values sent. MUST throw on any other error. When transfer is complete, this function MUST check if _to is a smart contract (code size > 0). If so, it MUST call onERC1155BatchReceived on _to and revert if the return value is not bytes4(keccak256(“onERC1155BatchReceived(address,address,uint256[],ui- nt256[],bytes)”)).
- Parameters
- Return type
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
SafeTransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the safeTransferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_from, to, _id, value, data, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_from, to, _id, value, data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
MUST emit TransferSingle event on success. Caller must be approved to manage the _from account’s tokens (see isApprovedForAll). MUST throw if _to is the zero address. MUST throw if balance of sender for token _id is lower than the _value sent. MUST throw on any other error. When transfer is complete, this function MUST check if _to is a smart contract (code size > 0). If so, it MUST call onERC1155Received on _to and revert if the return value is not bytes4(keccak256(“onERC11- 55Received(address,address,uint256,uint256,bytes)”)).
- Parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(_from, to, _id, value, data, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(_from, to, _id, value, data, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
MUST emit TransferSingle event on success. Caller must be approved to manage the _from account’s tokens (see isApprovedForAll). MUST throw if _to is the zero address. MUST throw if balance of sender for token _id is lower than the _value sent. MUST throw on any other error. When transfer is complete, this function MUST check if _to is a smart contract (code size > 0). If so, it MUST call onERC1155Received on _to and revert if the return value is not bytes4(keccak256(“onERC11- 55Received(address,address,uint256,uint256,bytes)”)).
-
-
class
zero_ex.contract_wrappers.erc1155_mintable.
SetApprovalForAllMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the setApprovalForAll method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(operator, approved, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(operator, approved, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
MUST emit the ApprovalForAll event on success.
-
estimate_gas
(operator, approved, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.erc1155_proxy¶
Generated wrapper for ERC1155Proxy Solidity contract.
-
class
zero_ex.contract_wrappers.erc1155_proxy.
AddAuthorizedAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the addAuthorizedAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Authorizes an address.
-
-
class
zero_ex.contract_wrappers.erc1155_proxy.
AuthoritiesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the authorities method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_proxy.
AuthorizedMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the authorized method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc1155_proxy.
ERC1155Proxy
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for ERC1155Proxy Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ERC1155ProxyValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
Constructor-initialized instance of
AddAuthorizedAddressMethod
.
Constructor-initialized instance of
AuthoritiesMethod
.
Constructor-initialized instance of
AuthorizedMethod
.
Get log entry for AuthorizedAddressAdded event.
Get log entry for AuthorizedAddressRemoved event.
Constructor-initialized instance of
GetAuthorizedAddressesMethod
.
-
get_proxy_id
= None¶ Constructor-initialized instance of
GetProxyIdMethod
.
-
owner
= None¶ Constructor-initialized instance of
OwnerMethod
.
Constructor-initialized instance of
RemoveAuthorizedAddressMethod
.
Constructor-initialized instance of
RemoveAuthorizedAddressAtIndexMethod
.
-
transfer_from
= None¶ Constructor-initialized instance of
TransferFromMethod
.
-
transfer_ownership
= None¶ Constructor-initialized instance of
TransferOwnershipMethod
.
-
-
class
zero_ex.contract_wrappers.erc1155_proxy.
ERC1155ProxyValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.erc1155_proxy.
GetAuthorizedAddressesMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getAuthorizedAddresses method.
-
class
zero_ex.contract_wrappers.erc1155_proxy.
GetProxyIdMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getProxyId method.
-
class
zero_ex.contract_wrappers.erc1155_proxy.
OwnerMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the owner method.
-
class
zero_ex.contract_wrappers.erc1155_proxy.
RemoveAuthorizedAddressAtIndexMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeAuthorizedAddressAtIndex method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, index, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, index, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Removes authorizion of an address.
-
estimate_gas
(target, index, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc1155_proxy.
RemoveAuthorizedAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeAuthorizedAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Removes authorizion of an address.
-
-
class
zero_ex.contract_wrappers.erc1155_proxy.
TransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(asset_data, _from, to, amount, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(asset_data, _from, to, amount, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Transfers batch of ERC1155 assets. Either succeeds or throws.
- Parameters
amount (
int
) – Amount that will be multiplied with each element of assetData.values to scale the values that will be transferred.assetData – Byte array encoded with ERC1155 token address, array of ids, array of values, and callback data.
from – Address to transfer assets from.
to (
str
) – Address to transfer assets to.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(asset_data, _from, to, amount, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(asset_data, _from, to, amount, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Transfers batch of ERC1155 assets. Either succeeds or throws.
- Parameters
amount (
int
) – Amount that will be multiplied with each element of assetData.values to scale the values that will be transferred.assetData – Byte array encoded with ERC1155 token address, array of ids, array of values, and callback data.
from – Address to transfer assets from.
to (
str
) – Address to transfer assets to.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.erc1155_proxy.
TransferOwnershipMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferOwnership method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(new_owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(new_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(new_owner, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.erc20_proxy¶
Generated wrapper for ERC20Proxy Solidity contract.
-
class
zero_ex.contract_wrappers.erc20_proxy.
AddAuthorizedAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the addAuthorizedAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Authorizes an address.
-
-
class
zero_ex.contract_wrappers.erc20_proxy.
AuthoritiesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the authorities method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc20_proxy.
AuthorizedMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the authorized method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc20_proxy.
ERC20Proxy
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for ERC20Proxy Solidity contract.
-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ERC20ProxyValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
Constructor-initialized instance of
AddAuthorizedAddressMethod
.
Constructor-initialized instance of
AuthoritiesMethod
.
Constructor-initialized instance of
AuthorizedMethod
.
Get log entry for AuthorizedAddressAdded event.
Get log entry for AuthorizedAddressRemoved event.
Constructor-initialized instance of
GetAuthorizedAddressesMethod
.
-
get_proxy_id
= None¶ Constructor-initialized instance of
GetProxyIdMethod
.
-
owner
= None¶ Constructor-initialized instance of
OwnerMethod
.
Constructor-initialized instance of
RemoveAuthorizedAddressMethod
.
Constructor-initialized instance of
RemoveAuthorizedAddressAtIndexMethod
.
-
transfer_ownership
= None¶ Constructor-initialized instance of
TransferOwnershipMethod
.
-
-
class
zero_ex.contract_wrappers.erc20_proxy.
ERC20ProxyValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.erc20_proxy.
GetAuthorizedAddressesMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getAuthorizedAddresses method.
-
class
zero_ex.contract_wrappers.erc20_proxy.
GetProxyIdMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getProxyId method.
-
class
zero_ex.contract_wrappers.erc20_proxy.
OwnerMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the owner method.
-
class
zero_ex.contract_wrappers.erc20_proxy.
RemoveAuthorizedAddressAtIndexMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeAuthorizedAddressAtIndex method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, index, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, index, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Removes authorizion of an address.
-
estimate_gas
(target, index, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc20_proxy.
RemoveAuthorizedAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeAuthorizedAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Removes authorizion of an address.
-
-
class
zero_ex.contract_wrappers.erc20_proxy.
TransferOwnershipMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferOwnership method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(new_owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(new_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(new_owner, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.erc20_token¶
Generated wrapper for ERC20Token Solidity contract.
-
class
zero_ex.contract_wrappers.erc20_token.
AllowanceMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the allowance method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc20_token.
ApproveMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the approve method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_spender, _value, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_spender, _value, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
msg.sender approves _spender to spend _value tokens
-
estimate_gas
(_spender, _value, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc20_token.
BalanceOfMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the balanceOf method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Query the balance of owner
-
-
class
zero_ex.contract_wrappers.erc20_token.
ERC20Token
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for ERC20Token Solidity contract.
-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ERC20TokenValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
allowance
= None¶ Constructor-initialized instance of
AllowanceMethod
.
-
approve
= None¶ Constructor-initialized instance of
ApproveMethod
.
-
balance_of
= None¶ Constructor-initialized instance of
BalanceOfMethod
.
-
total_supply
= None¶ Constructor-initialized instance of
TotalSupplyMethod
.
-
transfer
= None¶ Constructor-initialized instance of
TransferMethod
.
-
transfer_from
= None¶ Constructor-initialized instance of
TransferFromMethod
.
-
-
class
zero_ex.contract_wrappers.erc20_token.
ERC20TokenValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.erc20_token.
TotalSupplyMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the totalSupply method.
-
class
zero_ex.contract_wrappers.erc20_token.
TransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_from, _to, _value, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_from, _to, _value, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
send value token to to from from on the condition it is approved by from
-
estimate_gas
(_from, _to, _value, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc20_token.
TransferMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transfer method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_to, _value, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_to, _value, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
send value token to to from msg.sender
-
estimate_gas
(_to, _value, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.erc721_proxy¶
Generated wrapper for ERC721Proxy Solidity contract.
-
class
zero_ex.contract_wrappers.erc721_proxy.
AddAuthorizedAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the addAuthorizedAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Authorizes an address.
-
-
class
zero_ex.contract_wrappers.erc721_proxy.
AuthoritiesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the authorities method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc721_proxy.
AuthorizedMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the authorized method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc721_proxy.
ERC721Proxy
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for ERC721Proxy Solidity contract.
-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ERC721ProxyValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
Constructor-initialized instance of
AddAuthorizedAddressMethod
.
Constructor-initialized instance of
AuthoritiesMethod
.
Constructor-initialized instance of
AuthorizedMethod
.
Get log entry for AuthorizedAddressAdded event.
Get log entry for AuthorizedAddressRemoved event.
Constructor-initialized instance of
GetAuthorizedAddressesMethod
.
-
get_proxy_id
= None¶ Constructor-initialized instance of
GetProxyIdMethod
.
-
owner
= None¶ Constructor-initialized instance of
OwnerMethod
.
Constructor-initialized instance of
RemoveAuthorizedAddressMethod
.
Constructor-initialized instance of
RemoveAuthorizedAddressAtIndexMethod
.
-
transfer_ownership
= None¶ Constructor-initialized instance of
TransferOwnershipMethod
.
-
-
class
zero_ex.contract_wrappers.erc721_proxy.
ERC721ProxyValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.erc721_proxy.
GetAuthorizedAddressesMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getAuthorizedAddresses method.
-
class
zero_ex.contract_wrappers.erc721_proxy.
GetProxyIdMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getProxyId method.
-
class
zero_ex.contract_wrappers.erc721_proxy.
OwnerMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the owner method.
-
class
zero_ex.contract_wrappers.erc721_proxy.
RemoveAuthorizedAddressAtIndexMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeAuthorizedAddressAtIndex method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, index, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, index, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Removes authorizion of an address.
-
estimate_gas
(target, index, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc721_proxy.
RemoveAuthorizedAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeAuthorizedAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Removes authorizion of an address.
-
-
class
zero_ex.contract_wrappers.erc721_proxy.
TransferOwnershipMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferOwnership method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(new_owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(new_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(new_owner, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.erc721_token¶
Generated wrapper for ERC721Token Solidity contract.
-
class
zero_ex.contract_wrappers.erc721_token.
ApproveMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the approve method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_approved, _token_id, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_approved, _token_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
The zero address indicates there is no approved address. Throws unless msg.sender is the current NFT owner, or an authorized operator of the current owner.
-
estimate_gas
(_approved, _token_id, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc721_token.
BalanceOfMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the balanceOf method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
NFTs assigned to the zero address are considered invalid, and this function throws for queries about the zero address.
-
-
class
zero_ex.contract_wrappers.erc721_token.
ERC721Token
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for ERC721Token Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ERC721TokenValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
approve
= None¶ Constructor-initialized instance of
ApproveMethod
.
-
balance_of
= None¶ Constructor-initialized instance of
BalanceOfMethod
.
-
get_approved
= None¶ Constructor-initialized instance of
GetApprovedMethod
.
-
is_approved_for_all
= None¶ Constructor-initialized instance of
IsApprovedForAllMethod
.
-
owner_of
= None¶ Constructor-initialized instance of
OwnerOfMethod
.
-
safe_transfer_from1
= None¶ Constructor-initialized instance of
SafeTransferFrom1Method
.
-
safe_transfer_from2
= None¶ Constructor-initialized instance of
SafeTransferFrom2Method
.
-
set_approval_for_all
= None¶ Constructor-initialized instance of
SetApprovalForAllMethod
.
-
transfer_from
= None¶ Constructor-initialized instance of
TransferFromMethod
.
-
-
class
zero_ex.contract_wrappers.erc721_token.
ERC721TokenValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.erc721_token.
GetApprovedMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getApproved method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_token_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Throws if _tokenId is not a valid NFT.
-
-
class
zero_ex.contract_wrappers.erc721_token.
IsApprovedForAllMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isApprovedForAll method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.erc721_token.
OwnerOfMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the ownerOf method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_token_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
NFTs assigned to zero address are considered invalid, and queries about them do throw.
-
-
class
zero_ex.contract_wrappers.erc721_token.
SafeTransferFrom1Method
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the safeTransferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_from, _to, _token_id, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_from, _to, _token_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
This works identically to the other function with an extra data parameter, except this function just sets data to “”.
-
estimate_gas
(_from, _to, _token_id, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc721_token.
SafeTransferFrom2Method
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the safeTransferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_from, _to, _token_id, _data, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_from, _to, _token_id, _data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Throws unless msg.sender is the current owner, an authorized operator, or the approved address for this NFT. Throws if _from is not the current owner. Throws if _to is the zero address. Throws if _tokenId is not a valid NFT. When transfer is complete, this function checks if _to is a smart contract (code size > 0). If so, it calls onERC721Received on _to and throws if the return value is not bytes4(keccak256(“onERC721Received(address,address,uint256,bytes)”)).
- Parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(_from, _to, _token_id, _data, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(_from, _to, _token_id, _data, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Throws unless msg.sender is the current owner, an authorized operator, or the approved address for this NFT. Throws if _from is not the current owner. Throws if _to is the zero address. Throws if _tokenId is not a valid NFT. When transfer is complete, this function checks if _to is a smart contract (code size > 0). If so, it calls onERC721Received on _to and throws if the return value is not bytes4(keccak256(“onERC721Received(address,address,uint256,bytes)”)).
-
-
class
zero_ex.contract_wrappers.erc721_token.
SetApprovalForAllMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the setApprovalForAll method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_operator, _approved, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_operator, _approved, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Emits the ApprovalForAll event. The contract MUST allow multiple operators per owner.
-
estimate_gas
(_operator, _approved, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.erc721_token.
TransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_from, _to, _token_id, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_from, _to, _token_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Throws unless msg.sender is the current owner, an authorized operator, or the approved address for this NFT. Throws if _from is not the current owner. Throws if _to is the zero address. Throws if _tokenId is not a valid NFT.
-
estimate_gas
(_from, _to, _token_id, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(_from, _to, _token_id, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Throws unless msg.sender is the current owner, an authorized operator, or the approved address for this NFT. Throws if _from is not the current owner. Throws if _to is the zero address. Throws if _tokenId is not a valid NFT.
-
zero_ex.contract_wrappers.exchange¶
Generated wrapper for Exchange Solidity contract.
-
class
zero_ex.contract_wrappers.exchange.
AllowedValidatorsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the allowedValidators method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.exchange.
BatchCancelOrdersMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the batchCancelOrders method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes multiple calls of cancelOrder.
-
-
class
zero_ex.contract_wrappers.exchange.
BatchExecuteTransactionsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the batchExecuteTransactions method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(transactions, signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(transactions, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes a batch of Exchange method calls in the context of signer(s).
- Parameters
- Return type
- Returns
the return value of the underlying method.
-
estimate_gas
(transactions, signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
BatchFillOrKillOrdersMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the batchFillOrKillOrders method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes multiple calls of fillOrKillOrder.
- Parameters
- Return type
List
[LibFillResultsFillResults
]- Returns
the return value of the underlying method.
-
estimate_gas
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
BatchFillOrdersMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the batchFillOrders method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes multiple calls of fillOrder.
- Parameters
- Return type
List
[LibFillResultsFillResults
]- Returns
the return value of the underlying method.
-
estimate_gas
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
BatchFillOrdersNoThrowMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the batchFillOrdersNoThrow method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes multiple calls of fillOrder. If any fill reverts, the error is caught and ignored.
- Parameters
- Return type
List
[LibFillResultsFillResults
]- Returns
the return value of the underlying method.
-
estimate_gas
(orders, taker_asset_fill_amounts, signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
BatchMatchOrdersMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the batchMatchOrders method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(left_orders, right_orders, left_signatures, right_signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(left_orders, right_orders, left_signatures, right_signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Match complementary orders that have a profitable spread. Each order is filled at their respective price point, and the matcher receives a profit denominated in the left maker asset.
- Parameters
leftOrders – Set of orders with the same maker / taker asset.
leftSignatures – Proof that left orders were created by the left makers.
rightOrders – Set of orders to match against leftOrders
rightSignatures – Proof that right orders were created by the right makers.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
LibFillResultsBatchMatchedFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(left_orders, right_orders, left_signatures, right_signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(left_orders, right_orders, left_signatures, right_signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Match complementary orders that have a profitable spread. Each order is filled at their respective price point, and the matcher receives a profit denominated in the left maker asset.
- Parameters
leftOrders – Set of orders with the same maker / taker asset.
leftSignatures – Proof that left orders were created by the left makers.
rightOrders – Set of orders to match against leftOrders
rightSignatures – Proof that right orders were created by the right makers.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
BatchMatchOrdersWithMaximalFillMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the batchMatchOrdersWithMaximalFill method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(left_orders, right_orders, left_signatures, right_signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(left_orders, right_orders, left_signatures, right_signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Match complementary orders that have a profitable spread. Each order is maximally filled at their respective price point, and the matcher receives a profit denominated in either the left maker asset, right maker asset, or a combination of both.
- Parameters
leftOrders – Set of orders with the same maker / taker asset.
leftSignatures – Proof that left orders were created by the left makers.
rightOrders – Set of orders to match against leftOrders
rightSignatures – Proof that right orders were created by the right makers.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
LibFillResultsBatchMatchedFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(left_orders, right_orders, left_signatures, right_signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(left_orders, right_orders, left_signatures, right_signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Match complementary orders that have a profitable spread. Each order is maximally filled at their respective price point, and the matcher receives a profit denominated in either the left maker asset, right maker asset, or a combination of both.
- Parameters
leftOrders – Set of orders with the same maker / taker asset.
leftSignatures – Proof that left orders were created by the left makers.
rightOrders – Set of orders to match against leftOrders
rightSignatures – Proof that right orders were created by the right makers.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
CancelOrderMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the cancelOrder method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(order, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(order, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
After calling, the order can not be filled anymore.
- Parameters
order (
LibOrderOrder
) – Order struct containing order specifications.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
-
class
zero_ex.contract_wrappers.exchange.
CancelOrdersUpToMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the cancelOrdersUpTo method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target_order_epoch, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target_order_epoch, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).
- Parameters
targetOrderEpoch – Orders created with a salt less or equal to this value will be cancelled.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(target_order_epoch, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(target_order_epoch, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Cancels all orders created by makerAddress with a salt less than or equal to the targetOrderEpoch and senderAddress equal to msg.sender (or null address if msg.sender == makerAddress).
-
-
class
zero_ex.contract_wrappers.exchange.
CancelledMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the cancelled method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.exchange.
CurrentContextAddressMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the currentContextAddress method.
-
class
zero_ex.contract_wrappers.exchange.
Eip1271MagicValueMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the EIP1271_MAGIC_VALUE method.
-
class
zero_ex.contract_wrappers.exchange.
Eip712ExchangeDomainHashMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the EIP712_EXCHANGE_DOMAIN_HASH method.
-
class
zero_ex.contract_wrappers.exchange.
Exchange
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for Exchange Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ExchangeValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
allowed_validators
= None¶ Constructor-initialized instance of
AllowedValidatorsMethod
.
-
batch_cancel_orders
= None¶ Constructor-initialized instance of
BatchCancelOrdersMethod
.
-
batch_execute_transactions
= None¶ Constructor-initialized instance of
BatchExecuteTransactionsMethod
.
-
batch_fill_or_kill_orders
= None¶ Constructor-initialized instance of
BatchFillOrKillOrdersMethod
.
-
batch_fill_orders
= None¶ Constructor-initialized instance of
BatchFillOrdersMethod
.
-
batch_fill_orders_no_throw
= None¶ Constructor-initialized instance of
BatchFillOrdersNoThrowMethod
.
-
batch_match_orders
= None¶ Constructor-initialized instance of
BatchMatchOrdersMethod
.
-
batch_match_orders_with_maximal_fill
= None¶ Constructor-initialized instance of
BatchMatchOrdersWithMaximalFillMethod
.
-
cancel_order
= None¶ Constructor-initialized instance of
CancelOrderMethod
.
-
cancel_orders_up_to
= None¶ Constructor-initialized instance of
CancelOrdersUpToMethod
.
-
cancelled
= None¶ Constructor-initialized instance of
CancelledMethod
.
-
current_context_address
= None¶ Constructor-initialized instance of
CurrentContextAddressMethod
.
-
eip1271_magic_value
= None¶ Constructor-initialized instance of
Eip1271MagicValueMethod
.
-
eip712_exchange_domain_hash
= None¶ Constructor-initialized instance of
Eip712ExchangeDomainHashMethod
.
-
execute_transaction
= None¶ Constructor-initialized instance of
ExecuteTransactionMethod
.
-
fill_or_kill_order
= None¶ Constructor-initialized instance of
FillOrKillOrderMethod
.
-
fill_order
= None¶ Constructor-initialized instance of
FillOrderMethod
.
-
filled
= None¶ Constructor-initialized instance of
FilledMethod
.
-
get_asset_proxy
= None¶ Constructor-initialized instance of
GetAssetProxyMethod
.
-
get_order_info
= None¶ Constructor-initialized instance of
GetOrderInfoMethod
.
-
get_protocol_fee_collector_address_event
(tx_hash)[source]¶ Get log entry for ProtocolFeeCollectorAddress event.
-
get_signature_validator_approval_event
(tx_hash)[source]¶ Get log entry for SignatureValidatorApproval event.
-
is_valid_hash_signature
= None¶ Constructor-initialized instance of
IsValidHashSignatureMethod
.
-
is_valid_order_signature
= None¶ Constructor-initialized instance of
IsValidOrderSignatureMethod
.
-
is_valid_transaction_signature
= None¶ Constructor-initialized instance of
IsValidTransactionSignatureMethod
.
-
market_buy_orders_fill_or_kill
= None¶ Constructor-initialized instance of
MarketBuyOrdersFillOrKillMethod
.
-
market_buy_orders_no_throw
= None¶ Constructor-initialized instance of
MarketBuyOrdersNoThrowMethod
.
-
market_sell_orders_fill_or_kill
= None¶ Constructor-initialized instance of
MarketSellOrdersFillOrKillMethod
.
-
market_sell_orders_no_throw
= None¶ Constructor-initialized instance of
MarketSellOrdersNoThrowMethod
.
-
match_orders
= None¶ Constructor-initialized instance of
MatchOrdersMethod
.
-
match_orders_with_maximal_fill
= None¶ Constructor-initialized instance of
MatchOrdersWithMaximalFillMethod
.
-
order_epoch
= None¶ Constructor-initialized instance of
OrderEpochMethod
.
-
owner
= None¶ Constructor-initialized instance of
OwnerMethod
.
-
pre_sign
= None¶ Constructor-initialized instance of
PreSignMethod
.
-
pre_signed
= None¶ Constructor-initialized instance of
PreSignedMethod
.
-
protocol_fee_collector
= None¶ Constructor-initialized instance of
ProtocolFeeCollectorMethod
.
-
protocol_fee_multiplier
= None¶ Constructor-initialized instance of
ProtocolFeeMultiplierMethod
.
-
register_asset_proxy
= None¶ Constructor-initialized instance of
RegisterAssetProxyMethod
.
-
set_protocol_fee_collector_address
= None¶ Constructor-initialized instance of
SetProtocolFeeCollectorAddressMethod
.
-
set_protocol_fee_multiplier
= None¶ Constructor-initialized instance of
SetProtocolFeeMultiplierMethod
.
-
set_signature_validator_approval
= None¶ Constructor-initialized instance of
SetSignatureValidatorApprovalMethod
.
-
simulate_dispatch_transfer_from_calls
= None¶ Constructor-initialized instance of
SimulateDispatchTransferFromCallsMethod
.
-
transactions_executed
= None¶ Constructor-initialized instance of
TransactionsExecutedMethod
.
-
transfer_ownership
= None¶ Constructor-initialized instance of
TransferOwnershipMethod
.
-
-
class
zero_ex.contract_wrappers.exchange.
ExchangeValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.exchange.
ExecuteTransactionMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the executeTransaction method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(transaction, signature, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(transaction, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes an Exchange method call in the context of signer.
- Parameters
- Return type
- Returns
the return value of the underlying method.
-
estimate_gas
(transaction, signature, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
FillOrKillOrderMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the fillOrKillOrder method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(order, taker_asset_fill_amount, signature, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(order, taker_asset_fill_amount, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Fills the input order. Reverts if exact takerAssetFillAmount not filled.
- Parameters
- Return type
LibFillResultsFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(order, taker_asset_fill_amount, signature, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
FillOrderMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the fillOrder method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(order, taker_asset_fill_amount, signature, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(order, taker_asset_fill_amount, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Fills the input order.
- Parameters
- Return type
LibFillResultsFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(order, taker_asset_fill_amount, signature, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
FilledMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the filled method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.exchange.
GetAssetProxyMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getAssetProxy method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_proxy_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Gets an asset proxy.
-
-
class
zero_ex.contract_wrappers.exchange.
GetOrderInfoMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getOrderInfo method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(order, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Gets information about an order: status, hash, and amount filled.
- Parameters
order (
LibOrderOrder
) – Order to gather information on.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
LibOrderOrderInfo
- Returns
OrderInfo Information about the order and its state. See LibOrder.OrderInfo for a complete description.
-
-
class
zero_ex.contract_wrappers.exchange.
IsValidHashSignatureMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isValidHashSignature method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_hash, signer_address, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Verifies that a hash has been signed by the given signer.
- Parameters
- Return type
- Returns
isValid true if the signature is valid for the given hash and signer.
-
-
class
zero_ex.contract_wrappers.exchange.
IsValidOrderSignatureMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isValidOrderSignature method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(order, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Verifies that a signature for an order is valid.
-
-
class
zero_ex.contract_wrappers.exchange.
IsValidTransactionSignatureMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isValidTransactionSignature method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(transaction, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Verifies that a signature for a transaction is valid.
- Parameters
- Return type
- Returns
isValid true if the signature is valid for the given transaction and signer.
-
-
class
zero_ex.contract_wrappers.exchange.
MarketBuyOrdersFillOrKillMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the marketBuyOrdersFillOrKill method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, maker_asset_fill_amount, signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, maker_asset_fill_amount, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Calls marketBuyOrdersNoThrow then reverts if < makerAssetFillAmount has been bought. NOTE: This function does not enforce that the makerAsset is the same for each order.
- Parameters
- Return type
LibFillResultsFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(orders, maker_asset_fill_amount, signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(orders, maker_asset_fill_amount, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Calls marketBuyOrdersNoThrow then reverts if < makerAssetFillAmount has been bought. NOTE: This function does not enforce that the makerAsset is the same for each order.
- Parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
MarketBuyOrdersNoThrowMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the marketBuyOrdersNoThrow method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, maker_asset_fill_amount, signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, maker_asset_fill_amount, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes multiple calls of fillOrder until total amount of makerAsset is bought by taker. If any fill reverts, the error is caught and ignored. NOTE: This function does not enforce that the makerAsset is the same for each order.
- Parameters
- Return type
LibFillResultsFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(orders, maker_asset_fill_amount, signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(orders, maker_asset_fill_amount, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Executes multiple calls of fillOrder until total amount of makerAsset is bought by taker. If any fill reverts, the error is caught and ignored. NOTE: This function does not enforce that the makerAsset is the same for each order.
- Parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
MarketSellOrdersFillOrKillMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the marketSellOrdersFillOrKill method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, taker_asset_fill_amount, signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, taker_asset_fill_amount, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Calls marketSellOrdersNoThrow then reverts if < takerAssetFillAmount has been sold. NOTE: This function does not enforce that the takerAsset is the same for each order.
- Parameters
- Return type
LibFillResultsFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(orders, taker_asset_fill_amount, signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(orders, taker_asset_fill_amount, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Calls marketSellOrdersNoThrow then reverts if < takerAssetFillAmount has been sold. NOTE: This function does not enforce that the takerAsset is the same for each order.
- Parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
MarketSellOrdersNoThrowMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the marketSellOrdersNoThrow method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, taker_asset_fill_amount, signatures, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, taker_asset_fill_amount, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Executes multiple calls of fillOrder until total amount of takerAsset is sold by taker. If any fill reverts, the error is caught and ignored. NOTE: This function does not enforce that the takerAsset is the same for each order.
- Parameters
- Return type
LibFillResultsFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(orders, taker_asset_fill_amount, signatures, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(orders, taker_asset_fill_amount, signatures, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Executes multiple calls of fillOrder until total amount of takerAsset is sold by taker. If any fill reverts, the error is caught and ignored. NOTE: This function does not enforce that the takerAsset is the same for each order.
- Parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
MatchOrdersMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the matchOrders method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(left_order, right_order, left_signature, right_signature, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(left_order, right_order, left_signature, right_signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Match two complementary orders that have a profitable spread. Each order is filled at their respective price point. However, the calculations are carried out as though the orders are both being filled at the right order’s price point. The profit made by the left order goes to the taker (who matched the two orders).
- Parameters
leftOrder – First order to match.
leftSignature – Proof that order was created by the left maker.
rightOrder – Second order to match.
rightSignature – Proof that order was created by the right maker.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
LibFillResultsMatchedFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(left_order, right_order, left_signature, right_signature, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(left_order, right_order, left_signature, right_signature, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Match two complementary orders that have a profitable spread. Each order is filled at their respective price point. However, the calculations are carried out as though the orders are both being filled at the right order’s price point. The profit made by the left order goes to the taker (who matched the two orders).
- Parameters
leftOrder – First order to match.
leftSignature – Proof that order was created by the left maker.
rightOrder – Second order to match.
rightSignature – Proof that order was created by the right maker.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
MatchOrdersWithMaximalFillMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the matchOrdersWithMaximalFill method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(left_order, right_order, left_signature, right_signature, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(left_order, right_order, left_signature, right_signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Match two complementary orders that have a profitable spread. Each order is maximally filled at their respective price point, and the matcher receives a profit denominated in either the left maker asset, right maker asset, or a combination of both.
- Parameters
leftOrder – First order to match.
leftSignature – Proof that order was created by the left maker.
rightOrder – Second order to match.
rightSignature – Proof that order was created by the right maker.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
LibFillResultsMatchedFillResults
- Returns
the return value of the underlying method.
-
estimate_gas
(left_order, right_order, left_signature, right_signature, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(left_order, right_order, left_signature, right_signature, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Match two complementary orders that have a profitable spread. Each order is maximally filled at their respective price point, and the matcher receives a profit denominated in either the left maker asset, right maker asset, or a combination of both.
- Parameters
leftOrder – First order to match.
leftSignature – Proof that order was created by the left maker.
rightOrder – Second order to match.
rightSignature – Proof that order was created by the right maker.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
OrderEpochMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the orderEpoch method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.exchange.
OwnerMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the owner method.
-
class
zero_ex.contract_wrappers.exchange.
PreSignMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the preSign method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_hash, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_hash, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Approves a hash on-chain. After presigning a hash, the preSign signature type will become valid for that hash and signer.
- Parameters
hash – Any 32-byte hash.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
-
class
zero_ex.contract_wrappers.exchange.
PreSignedMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the preSigned method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.exchange.
ProtocolFeeCollectorMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the protocolFeeCollector method.
-
class
zero_ex.contract_wrappers.exchange.
ProtocolFeeMultiplierMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the protocolFeeMultiplier method.
-
class
zero_ex.contract_wrappers.exchange.
RegisterAssetProxyMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the registerAssetProxy method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(asset_proxy, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(asset_proxy, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Registers an asset proxy to its asset proxy id. Once an asset proxy is registered, it cannot be unregistered.
- Parameters
assetProxy – Address of new asset proxy to register.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(asset_proxy, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
SetProtocolFeeCollectorAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the setProtocolFeeCollectorAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(updated_protocol_fee_collector, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(updated_protocol_fee_collector, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows the owner to update the protocolFeeCollector address.
- Parameters
updatedProtocolFeeCollector – The updated protocolFeeCollector contract address.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(updated_protocol_fee_collector, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
SetProtocolFeeMultiplierMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the setProtocolFeeMultiplier method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(updated_protocol_fee_multiplier, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(updated_protocol_fee_multiplier, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Allows the owner to update the protocol fee multiplier.
- Parameters
updatedProtocolFeeMultiplier – The updated protocol fee multiplier.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(updated_protocol_fee_multiplier, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
SetSignatureValidatorApprovalMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the setSignatureValidatorApproval method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(validator_address, approval, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(validator_address, approval, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Approves/unnapproves a Validator contract to verify signatures on signer’s behalf using the Validator signature type.
-
estimate_gas
(validator_address, approval, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
SimulateDispatchTransferFromCallsMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the simulateDispatchTransferFromCalls method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(asset_data, from_addresses, to_addresses, amounts, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(asset_data, from_addresses, to_addresses, amounts, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
This function may be used to simulate any amount of transfers As they would occur through the Exchange contract. Note that this function will always revert, even if all transfers are successful. However, it may be used with eth_call or with a try/catch pattern in order to simulate the results of the transfers.
- Parameters
amounts (
List
[int
]) – Array containing the amounts that correspond to each transfer.assetData – Array of asset details, each encoded per the AssetProxy contract specification.
fromAddresses – Array containing the from addresses that correspond with each transfer.
toAddresses – Array containing the to addresses that correspond with each transfer.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(asset_data, from_addresses, to_addresses, amounts, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(asset_data, from_addresses, to_addresses, amounts, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
This function may be used to simulate any amount of transfers As they would occur through the Exchange contract. Note that this function will always revert, even if all transfers are successful. However, it may be used with eth_call or with a try/catch pattern in order to simulate the results of the transfers.
- Parameters
amounts (
List
[int
]) – Array containing the amounts that correspond to each transfer.assetData – Array of asset details, each encoded per the AssetProxy contract specification.
fromAddresses – Array containing the from addresses that correspond with each transfer.
toAddresses – Array containing the to addresses that correspond with each transfer.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.exchange.
TransactionsExecutedMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transactionsExecuted method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.exchange.
TransferOwnershipMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferOwnership method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(new_owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(new_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(new_owner, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.forwarder¶
Generated wrapper for Forwarder Solidity contract.
-
class
zero_ex.contract_wrappers.forwarder.
ApproveMakerAssetProxyMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the approveMakerAssetProxy method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(asset_data, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Approves the respective proxy for a given asset to transfer tokens on the Forwarder contract’s behalf. This is necessary because an order fee denominated in the maker asset (i.e. a percentage fee) is sent by the Forwarder contract to the fee recipient. This method needs to be called before forwarding orders of a maker asset that hasn’t previously been approved.
- Parameters
assetData – Byte array encoded for the respective asset proxy.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(asset_data, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(asset_data, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Approves the respective proxy for a given asset to transfer tokens on the Forwarder contract’s behalf. This is necessary because an order fee denominated in the maker asset (i.e. a percentage fee) is sent by the Forwarder contract to the fee recipient. This method needs to be called before forwarding orders of a maker asset that hasn’t previously been approved.
-
-
class
zero_ex.contract_wrappers.forwarder.
Forwarder
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for Forwarder Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ForwarderValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
approve_maker_asset_proxy
= None¶ Constructor-initialized instance of
ApproveMakerAssetProxyMethod
.
-
market_buy_orders_with_eth
= None¶ Constructor-initialized instance of
MarketBuyOrdersWithEthMethod
.
-
market_sell_orders_with_eth
= None¶ Constructor-initialized instance of
MarketSellOrdersWithEthMethod
.
-
owner
= None¶ Constructor-initialized instance of
OwnerMethod
.
-
transfer_ownership
= None¶ Constructor-initialized instance of
TransferOwnershipMethod
.
-
withdraw_asset
= None¶ Constructor-initialized instance of
WithdrawAssetMethod
.
-
-
class
zero_ex.contract_wrappers.forwarder.
ForwarderValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.forwarder.
MarketBuyOrdersWithEthMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the marketBuyOrdersWithEth method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, maker_asset_buy_amount, signatures, fee_percentage, fee_recipient, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, maker_asset_buy_amount, signatures, fee_percentage, fee_recipient, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Attempt to buy makerAssetBuyAmount of makerAsset by selling ETH provided with transaction. The Forwarder may fill more than makerAssetBuyAmount of the makerAsset so that it can pay takerFees where takerFeeAssetData == makerAssetData (i.e. percentage fees). Any ETH not spent will be refunded to sender.
- Parameters
feePercentage – Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.
feeRecipient – Address that will receive ETH when orders are filled.
makerAssetBuyAmount – Desired amount of makerAsset to purchase.
orders (
List
[LibOrderOrder
]) – Array of order specifications used containing desired makerAsset and WETH as takerAsset.signatures (
List
[Union
[bytes
,str
]]) – Proofs that orders have been created by makers.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
the return value of the underlying method.
-
estimate_gas
(orders, maker_asset_buy_amount, signatures, fee_percentage, fee_recipient, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(orders, maker_asset_buy_amount, signatures, fee_percentage, fee_recipient, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Attempt to buy makerAssetBuyAmount of makerAsset by selling ETH provided with transaction. The Forwarder may fill more than makerAssetBuyAmount of the makerAsset so that it can pay takerFees where takerFeeAssetData == makerAssetData (i.e. percentage fees). Any ETH not spent will be refunded to sender.
- Parameters
feePercentage – Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.
feeRecipient – Address that will receive ETH when orders are filled.
makerAssetBuyAmount – Desired amount of makerAsset to purchase.
orders (
List
[LibOrderOrder
]) – Array of order specifications used containing desired makerAsset and WETH as takerAsset.signatures (
List
[Union
[bytes
,str
]]) – Proofs that orders have been created by makers.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.forwarder.
MarketSellOrdersWithEthMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the marketSellOrdersWithEth method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(orders, signatures, fee_percentage, fee_recipient, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(orders, signatures, fee_percentage, fee_recipient, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Purchases as much of orders’ makerAssets as possible by selling as much of the ETH value sent as possible, accounting for order and forwarder fees.
- Parameters
feePercentage – Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.
feeRecipient – Address that will receive ETH when orders are filled.
orders (
List
[LibOrderOrder
]) – Array of order specifications used containing desired makerAsset and WETH as takerAsset.signatures (
List
[Union
[bytes
,str
]]) – Proofs that orders have been created by makers.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
- Returns
the return value of the underlying method.
-
estimate_gas
(orders, signatures, fee_percentage, fee_recipient, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
send_transaction
(orders, signatures, fee_percentage, fee_recipient, tx_params=None)[source]¶ Execute underlying contract method via eth_sendTransaction.
Purchases as much of orders’ makerAssets as possible by selling as much of the ETH value sent as possible, accounting for order and forwarder fees.
- Parameters
feePercentage – Percentage of WETH sold that will payed as fee to forwarding contract feeRecipient.
feeRecipient – Address that will receive ETH when orders are filled.
orders (
List
[LibOrderOrder
]) – Array of order specifications used containing desired makerAsset and WETH as takerAsset.signatures (
List
[Union
[bytes
,str
]]) – Proofs that orders have been created by makers.tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
-
-
class
zero_ex.contract_wrappers.forwarder.
OwnerMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the owner method.
-
class
zero_ex.contract_wrappers.forwarder.
TransferOwnershipMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferOwnership method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(new_owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(new_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(new_owner, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.forwarder.
WithdrawAssetMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the withdrawAsset method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(asset_data, amount, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(asset_data, amount, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Withdraws assets from this contract. It may be used by the owner to withdraw assets that were accidentally sent to this contract.
-
estimate_gas
(asset_data, amount, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.i_asset_proxy¶
Generated wrapper for IAssetProxy Solidity contract.
-
class
zero_ex.contract_wrappers.i_asset_proxy.
GetProxyIdMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getProxyId method.
-
class
zero_ex.contract_wrappers.i_asset_proxy.
IAssetProxy
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for IAssetProxy Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[IAssetProxyValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
get_proxy_id
= None¶ Constructor-initialized instance of
GetProxyIdMethod
.
-
transfer_from
= None¶ Constructor-initialized instance of
TransferFromMethod
.
-
-
class
zero_ex.contract_wrappers.i_asset_proxy.
IAssetProxyValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.i_asset_proxy.
TransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(asset_data, _from, to, amount, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(asset_data, _from, to, amount, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Transfers assets. Either succeeds or throws.
- Parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(asset_data, _from, to, amount, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.i_validator¶
Generated wrapper for IValidator Solidity contract.
-
class
zero_ex.contract_wrappers.i_validator.
IValidator
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for IValidator Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[IValidatorValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
is_valid_signature
= None¶ Constructor-initialized instance of
IsValidSignatureMethod
.
-
-
class
zero_ex.contract_wrappers.i_validator.
IValidatorValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.i_validator.
IsValidSignatureMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isValidSignature method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_hash, signer_address, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Verifies that a signature is valid.
- Parameters
- Return type
- Returns
Magic bytes4 value if the signature is valid. Magic value is bytes4(keccak256(“isValidValidatorSignature(address,bytes32,address,by- tes)”))
-
zero_ex.contract_wrappers.i_wallet¶
Generated wrapper for IWallet Solidity contract.
-
class
zero_ex.contract_wrappers.i_wallet.
IWallet
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for IWallet Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[IWalletValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
is_valid_signature
= None¶ Constructor-initialized instance of
IsValidSignatureMethod
.
-
-
class
zero_ex.contract_wrappers.i_wallet.
IWalletValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.i_wallet.
IsValidSignatureMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the isValidSignature method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(_hash, signature, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Validates a hash with the Wallet signature type.
-
zero_ex.contract_wrappers.multi_asset_proxy¶
Generated wrapper for MultiAssetProxy Solidity contract.
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
AddAuthorizedAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the addAuthorizedAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Authorizes an address.
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
AssetProxiesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the assetProxies method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
AuthoritiesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the authorities method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
AuthorizedMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the authorized method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
GetAssetProxyMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getAssetProxy method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_proxy_id, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Gets an asset proxy.
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
GetAuthorizedAddressesMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getAuthorizedAddresses method.
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
GetProxyIdMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getProxyId method.
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
MultiAssetProxy
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for MultiAssetProxy Solidity contract.
-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[MultiAssetProxyValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
Constructor-initialized instance of
AddAuthorizedAddressMethod
.
-
asset_proxies
= None¶ Constructor-initialized instance of
AssetProxiesMethod
.
Constructor-initialized instance of
AuthoritiesMethod
.
Constructor-initialized instance of
AuthorizedMethod
.
-
get_asset_proxy
= None¶ Constructor-initialized instance of
GetAssetProxyMethod
.
Get log entry for AuthorizedAddressAdded event.
Get log entry for AuthorizedAddressRemoved event.
Constructor-initialized instance of
GetAuthorizedAddressesMethod
.
-
get_proxy_id
= None¶ Constructor-initialized instance of
GetProxyIdMethod
.
-
owner
= None¶ Constructor-initialized instance of
OwnerMethod
.
-
register_asset_proxy
= None¶ Constructor-initialized instance of
RegisterAssetProxyMethod
.
Constructor-initialized instance of
RemoveAuthorizedAddressMethod
.
Constructor-initialized instance of
RemoveAuthorizedAddressAtIndexMethod
.
-
transfer_ownership
= None¶ Constructor-initialized instance of
TransferOwnershipMethod
.
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
MultiAssetProxyValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
OwnerMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the owner method.
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
RegisterAssetProxyMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the registerAssetProxy method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(asset_proxy, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(asset_proxy, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Registers an asset proxy to its asset proxy id. Once an asset proxy is registered, it cannot be unregistered.
- Parameters
assetProxy – Address of new asset proxy to register.
tx_params (
Optional
[TxParams
]) – transaction parameters
- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(asset_proxy, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
RemoveAuthorizedAddressAtIndexMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeAuthorizedAddressAtIndex method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, index, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, index, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Removes authorizion of an address.
-
estimate_gas
(target, index, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
RemoveAuthorizedAddressMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the removeAuthorizedAddress method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(target, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(target, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Removes authorizion of an address.
-
-
class
zero_ex.contract_wrappers.multi_asset_proxy.
TransferOwnershipMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferOwnership method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(new_owner, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(new_owner, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
None
- Returns
the return value of the underlying method.
-
estimate_gas
(new_owner, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
zero_ex.contract_wrappers.order_validator¶
Generated wrapper for OrderValidator Solidity contract.
-
class
zero_ex.contract_wrappers.order_validator.
GetBalanceAndAllowanceMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getBalanceAndAllowance method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.order_validator.
GetBalancesAndAllowancesMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getBalancesAndAllowances method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.order_validator.
GetErc721TokenOwnerMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getERC721TokenOwner method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.order_validator.
GetOrderAndTraderInfoMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getOrderAndTraderInfo method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(order, taker_address, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
Tuple
[Tuple0xb1e4a1ae
,Tuple0x8cfc0927
]
-
-
class
zero_ex.contract_wrappers.order_validator.
GetOrdersAndTradersInfoMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getOrdersAndTradersInfo method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(orders, taker_addresses, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
-
-
class
zero_ex.contract_wrappers.order_validator.
GetTraderInfoMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getTraderInfo method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(order, taker_address, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
Tuple0x8cfc0927
-
-
class
zero_ex.contract_wrappers.order_validator.
GetTradersInfoMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the getTradersInfo method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(orders, taker_addresses, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
-
-
class
zero_ex.contract_wrappers.order_validator.
OrderValidator
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for OrderValidator Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[OrderValidatorValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
get_balance_and_allowance
= None¶ Constructor-initialized instance of
GetBalanceAndAllowanceMethod
.
-
get_balances_and_allowances
= None¶ Constructor-initialized instance of
GetBalancesAndAllowancesMethod
.
-
get_erc721_token_owner
= None¶ Constructor-initialized instance of
GetErc721TokenOwnerMethod
.
-
get_order_and_trader_info
= None¶ Constructor-initialized instance of
GetOrderAndTraderInfoMethod
.
-
get_orders_and_traders_info
= None¶ Constructor-initialized instance of
GetOrdersAndTradersInfoMethod
.
-
get_trader_info
= None¶ Constructor-initialized instance of
GetTraderInfoMethod
.
-
get_traders_info
= None¶ Constructor-initialized instance of
GetTradersInfoMethod
.
-
zero_ex.contract_wrappers.static_call_proxy¶
Generated wrapper for StaticCallProxy Solidity contract.
-
class
zero_ex.contract_wrappers.static_call_proxy.
GetProxyIdMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the getProxyId method.
-
class
zero_ex.contract_wrappers.static_call_proxy.
StaticCallProxy
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for StaticCallProxy Solidity contract.
All method parameters of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
.-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[StaticCallProxyValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
get_proxy_id
= None¶ Constructor-initialized instance of
GetProxyIdMethod
.
-
transfer_from
= None¶ Constructor-initialized instance of
TransferFromMethod
.
-
-
class
zero_ex.contract_wrappers.static_call_proxy.
StaticCallProxyValidator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.static_call_proxy.
TransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
call
(asset_data, _from, to, amount, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
Makes a staticcall to a target address and verifies that the data returned matches the expected return data.
-
zero_ex.contract_wrappers.weth9¶
Generated wrapper for WETH9 Solidity contract.
-
class
zero_ex.contract_wrappers.weth9.
AllowanceMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the allowance method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.weth9.
ApproveMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the approve method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(guy, wad, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
estimate_gas
(guy, wad, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.weth9.
BalanceOfMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the balanceOf method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.weth9.
DecimalsMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the decimals method.
-
class
zero_ex.contract_wrappers.weth9.
DepositMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the deposit method.
-
build_transaction
(tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
-
class
zero_ex.contract_wrappers.weth9.
NameMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the name method.
-
class
zero_ex.contract_wrappers.weth9.
SymbolMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the symbol method.
-
class
zero_ex.contract_wrappers.weth9.
TotalSupplyMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the totalSupply method.
-
class
zero_ex.contract_wrappers.weth9.
TransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(src, dst, wad, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
estimate_gas
(src, dst, wad, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.weth9.
TransferMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transfer method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(dst, wad, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
estimate_gas
(dst, wad, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.weth9.
WETH9
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for WETH9 Solidity contract.
-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[WETH9Validator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
allowance
= None¶ Constructor-initialized instance of
AllowanceMethod
.
-
approve
= None¶ Constructor-initialized instance of
ApproveMethod
.
-
balance_of
= None¶ Constructor-initialized instance of
BalanceOfMethod
.
-
decimals
= None¶ Constructor-initialized instance of
DecimalsMethod
.
-
deposit
= None¶ Constructor-initialized instance of
DepositMethod
.
-
name
= None¶ Constructor-initialized instance of
NameMethod
.
-
symbol
= None¶ Constructor-initialized instance of
SymbolMethod
.
-
total_supply
= None¶ Constructor-initialized instance of
TotalSupplyMethod
.
-
transfer
= None¶ Constructor-initialized instance of
TransferMethod
.
-
transfer_from
= None¶ Constructor-initialized instance of
TransferFromMethod
.
-
withdraw
= None¶ Constructor-initialized instance of
WithdrawMethod
.
-
-
class
zero_ex.contract_wrappers.weth9.
WETH9Validator
(web3_or_provider, contract_address)[source]¶ No-op input validator.
-
class
zero_ex.contract_wrappers.weth9.
WithdrawMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the withdraw method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(wad, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(wad, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
- Parameters
tx_params (
Optional
[TxParams
]) – transaction parameters- Return type
None
- Returns
the return value of the underlying method.
-
zero_ex.contract_wrappers.zrx_token¶
Generated wrapper for ZRXToken Solidity contract.
-
class
zero_ex.contract_wrappers.zrx_token.
AllowanceMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the allowance method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.zrx_token.
ApproveMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the approve method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_spender, _value, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
estimate_gas
(_spender, _value, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.zrx_token.
BalanceOfMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the balanceOf method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
-
class
zero_ex.contract_wrappers.zrx_token.
DecimalsMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the decimals method.
-
class
zero_ex.contract_wrappers.zrx_token.
NameMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the name method.
-
class
zero_ex.contract_wrappers.zrx_token.
SymbolMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the symbol method.
-
class
zero_ex.contract_wrappers.zrx_token.
TotalSupplyMethod
(web3_or_provider, contract_address, contract_function)[source]¶ Various interfaces to the totalSupply method.
-
class
zero_ex.contract_wrappers.zrx_token.
TransferFromMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transferFrom method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_from, _to, _value, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
call
(_from, _to, _value, tx_params=None)[source]¶ Execute underlying contract method via eth_call.
ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited allowance.
-
estimate_gas
(_from, _to, _value, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.zrx_token.
TransferMethod
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Various interfaces to the transfer method.
-
__init__
(web3_or_provider, contract_address, contract_function, validator=None)[source]¶ Persist instance data.
-
build_transaction
(_to, _value, tx_params=None)[source]¶ Construct calldata to be used as input to the method.
- Return type
-
estimate_gas
(_to, _value, tx_params=None)[source]¶ Estimate gas consumption of method call.
- Return type
-
-
class
zero_ex.contract_wrappers.zrx_token.
ZRXToken
(web3_or_provider, contract_address, validator=None)[source]¶ Wrapper class for ZRXToken Solidity contract.
-
__init__
(web3_or_provider, contract_address, validator=None)[source]¶ Get an instance of wrapper for smart contract.
- Parameters
web3_or_provider (
Union
[Web3
,BaseProvider
]) – Either an instance ofweb3.Web3
orweb3.providers.base.BaseProvider
contract_address (
str
) – where the contract has been deployedvalidator (
Optional
[ZRXTokenValidator
]) – for validation of method inputs.
-
__weakref__
¶ list of weak references to the object (if defined)
-
allowance
= None¶ Constructor-initialized instance of
AllowanceMethod
.
-
approve
= None¶ Constructor-initialized instance of
ApproveMethod
.
-
balance_of
= None¶ Constructor-initialized instance of
BalanceOfMethod
.
-
decimals
= None¶ Constructor-initialized instance of
DecimalsMethod
.
-
name
= None¶ Constructor-initialized instance of
NameMethod
.
-
symbol
= None¶ Constructor-initialized instance of
SymbolMethod
.
-
total_supply
= None¶ Constructor-initialized instance of
TotalSupplyMethod
.
-
transfer
= None¶ Constructor-initialized instance of
TransferMethod
.
-
transfer_from
= None¶ Constructor-initialized instance of
TransferFromMethod
.
-
zero_ex.contract_wrappers.TxParams¶
-
class
zero_ex.contract_wrappers.
TxParams
(*, from_=None, value=None, gas=None, gas_price=None, nonce=None)[source]¶ Transaction parameters for use with contract wrappers.
- Parameters
from – default None, string of account address to initiate tx from
value – default None, integer of amount of ETH in Wei for transfer
gas – default None, integer maximum amount of ETH in Wei for gas
grasPrice – default None, integer price of unit of gas
nonce – default None, integer nonce for account
zero_ex.contract_wrappers.exchange.types¶
Conveniences for handling types representing Exchange Solidity structs.
The TypedDict
classes in the .exchange module represent tuples
encountered in the Exchange contract’s ABI. However, they have weird names,
containing hashes of the tuple’s field names, because the name of a Solidity
struct
isn’t conveyed through the ABI. This module provides type
aliases with human-friendly names.
-
class
zero_ex.contract_wrappers.exchange.types.
Order
¶ The
Order
Solidity struct.Also known as
zero_ex.contract_wrappers.exchange.LibOrderOrder
.
-
class
zero_ex.contract_wrappers.exchange.types.
OrderInfo
¶ The
OrderInfo
Solidity struct.Also known as
zero_ex.contract_wrappers.exchange.LibOrderOrderInfo
.
-
class
zero_ex.contract_wrappers.exchange.types.
FillResults
¶ The
FillResults
Solidity struct.Also known as
zero_ex.contract_wrappers.exchange.LibFillResultsFillResults
.
-
class
zero_ex.contract_wrappers.exchange.types.
MatchedFillResults
¶ The
MatchedFillResults
Solidity struct.Also known as
zero_ex.contract_wrappers.exchange.LibFillResultsMatchedFillResults
.
-
class
zero_ex.contract_wrappers.exchange.types.
ZeroExTransaction
¶ The
ZeroExTransaction
Solidity struct.Also known as
zero_ex.contract_wrappers.exchange.LibZeroExTransactionZeroExTransaction
.
zero_ex.contract_wrappers.exchange: Generated Tuples¶
-
class
zero_ex.contract_wrappers.exchange.
LibOrderOrder
¶ Python representation of a tuple or struct.
Solidity compiler output does not include the names of structs that appear in method definitions. A tuple found in an ABI may have been written in Solidity as a literal, anonymous tuple, or it may have been written as a named
struct
, but there is no way to tell from the compiler output. This class represents a tuple that appeared in a method definition. Its name is derived from a hash of that tuple’s field names, and every method whose ABI refers to a tuple with that same list of field names will have a generated wrapper method that refers to this class.Any members of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
This is the generated class representing the Order struct.
-
class
zero_ex.contract_wrappers.exchange.
LibFillResultsFillResults
¶ Python representation of a tuple or struct.
Solidity compiler output does not include the names of structs that appear in method definitions. A tuple found in an ABI may have been written in Solidity as a literal, anonymous tuple, or it may have been written as a named
struct
, but there is no way to tell from the compiler output. This class represents a tuple that appeared in a method definition. Its name is derived from a hash of that tuple’s field names, and every method whose ABI refers to a tuple with that same list of field names will have a generated wrapper method that refers to this class.Any members of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
This is the generated class representing the FillResults struct.
-
class
zero_ex.contract_wrappers.exchange.
LibFillResultsMatchedFillResults
¶ Python representation of a tuple or struct.
Solidity compiler output does not include the names of structs that appear in method definitions. A tuple found in an ABI may have been written in Solidity as a literal, anonymous tuple, or it may have been written as a named
struct
, but there is no way to tell from the compiler output. This class represents a tuple that appeared in a method definition. Its name is derived from a hash of that tuple’s field names, and every method whose ABI refers to a tuple with that same list of field names will have a generated wrapper method that refers to this class.Any members of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
This is the generated class representing the MatchedFillResults struct.
-
class
zero_ex.contract_wrappers.exchange.
LibOrderOrderInfo
¶ Python representation of a tuple or struct.
Solidity compiler output does not include the names of structs that appear in method definitions. A tuple found in an ABI may have been written in Solidity as a literal, anonymous tuple, or it may have been written as a named
struct
, but there is no way to tell from the compiler output. This class represents a tuple that appeared in a method definition. Its name is derived from a hash of that tuple’s field names, and every method whose ABI refers to a tuple with that same list of field names will have a generated wrapper method that refers to this class.Any members of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
This is the generated class representing the OrderInfo struct.
-
class
zero_ex.contract_wrappers.exchange.
LibZeroExTransactionZeroExTransaction
¶ Python representation of a tuple or struct.
Solidity compiler output does not include the names of structs that appear in method definitions. A tuple found in an ABI may have been written in Solidity as a literal, anonymous tuple, or it may have been written as a named
struct
, but there is no way to tell from the compiler output. This class represents a tuple that appeared in a method definition. Its name is derived from a hash of that tuple’s field names, and every method whose ABI refers to a tuple with that same list of field names will have a generated wrapper method that refers to this class.Any members of type
bytes
should be encoded as UTF-8, which can be accomplished viastr.encode("utf_8")
This is the generated class representing the ZeroExTransaction struct.