description: Technical details about Datatoken functions
---
# Datatoken Interface Tech Details
`Datatoken contract interface` is like the superhero that kicks off the action-packed adventure of contract calls! It's here to save the day by empowering us to unleash the mighty powers of dispensers, fixed rate exchanges, and initializing orders. For this page, we present the utilitary functions that embark you on the Ocean journey.
Through datatoken, you can deploy a new dispenser schema which is used for creating free assets, because its behaviour is similar with a faucet. ⛲
It is implemented in DatatokenBase, inherited by Datatoken2, so it can be called within both instances.
**Parameters**
*`tx_dict` - is the configuration `dictionary` for that specific transaction. Usually for `development` we include just the `from` wallet, but for remote networks, you can provide gas fees, required confirmations for that block etc. For more info, check [Brownie docs](https://eth-brownie.readthedocs.io/en/stable/).
*`max_tokens` - maximum amount of tokens to dispense in wei. The default is a large number.
*`max_balance` - maximum balance of requester in wei. The default is a large number.
*`with_mint` - boolean, `true` if we want to allow the dispenser to be a minter as default value
**Returns**
`str`
Return value is a hex string which denotes the transaction hash of dispenser deployment.
This function is used to retrieve funds or datatokens for an user who wants to start an order.
It is implemented in DatatokenBase, so it can be called within Datatoken class.
**Parameters**
*`amount` - amount of datatokens to be dispensed in wei (int or string format)
*`tx_dict` - is the configuration `dictionary` for that specific transaction. Usually for `development` we include just the `from` wallet, but for remote networks, you can provide gas fees, required confirmations for that block etc. For more info, check [Brownie docs](https://eth-brownie.readthedocs.io/en/stable/).
**Returns**
`str`
Return value is a hex string which denotes the transaction hash of dispensed datatokens, like a proof.
*`service_index` - service index as int for identifying the service that you want to further call [`start_order`](https://github.com/oceanprotocol/ocean.py/blob/4aa12afd8a933d64bc2ed68d1e5359d0b9ae62f9/ocean_lib/models/datatoken.py#LL169C5-L197C10).
*`transaction_parameters` - is the configuration `dictionary` for that specific transaction. Usually for `development` we include just the `from` wallet, but for remote networks, you can provide gas fees, required confirmations for that block etc. For more info, check [Brownie docs](https://eth-brownie.readthedocs.io/en/stable/).
*`consume_market_fees` - [`TokenInfo` ](https://github.com/oceanprotocol/ocean.py/blob/4aa12afd8a933d64bc2ed68d1e5359d0b9ae62f9/ocean_lib/models/datatoken.py#L31)object which contains the consume market fee amount, address & token address. If it is not explicitly specified, by default it has an empty `TokenInfo` object.
Returns a `DispenserStatus` object returned from `Dispenser.sol::status(dt_addr)` which is composed of:
* bool active
* address owner
* bool isMinter
* uint256 maxTokens
* uint256 maxBalance
* uint256 balance
* address allowedSwapper
These are Solidity return values & types, but `uint256` means int in Python and `address` is a `string` instance.
For tips & tricks, check [this section](https://github.com/oceanprotocol/ocean.py/blob/4aa12afd8a933d64bc2ed68d1e5359d0b9ae62f9/READMEs/main-flow.md#faucet-tips--tricks) from the [README](https://github.com/oceanprotocol/ocean.py/blob/4aa12afd8a933d64bc2ed68d1e5359d0b9ae62f9/READMEs/main-flow.md).
It is implemented in `DatatokenBase`, inherited by `Datatoken2`, so it can be called within both instances.
It is implemented in `DatatokenBase`, inherited by `Datatoken2`, so it can be called within both instances.
For this datatoken, create a single fixed-rate exchange (`OneExchange`).
This wraps the smart contract method `Datatoken.createFixedRate()` with a simpler interface.
**Parameters**
*`rate` - how many base tokens does 1 datatoken cost? In wei or string
*`base_token_addr` - e.g. OCEAN address
*`tx_dict` - is the configuration `dictionary` for that specific transaction. Usually for `development` we include just the `from` wallet, but for remote networks, you can provide gas fees, required confirmations for that block etc. For more info, check [Brownie docs](https://eth-brownie.readthedocs.io/en/stable/).
**Optional parameters**
*`owner_addr` - owner of the datatoken
*`publish_market_fee_collector` - fee going to publish market address
*`publish_market_fee` - in wei or string, e.g. `int(1e15)` or `"0.001 ether"`
*`with_mint` - should the exchange mint datatokens as needed (`True`), or do they need to be supplied/allowed by participants like base token (`False`)?
*`allowed_swapper` - if `ZERO_ADDRESS`, anyone can swap
*`full_info` - return just `OneExchange`, or `(OneExchange, <other info>)`
*`service_index` - service index as int for identifying the service that you want to further call [`start_order`](https://github.com/oceanprotocol/ocean.py/blob/4aa12afd8a933d64bc2ed68d1e5359d0b9ae62f9/ocean_lib/models/datatoken.py#LL169C5-L197C10).
*`transaction_parameters` - is the configuration `dictionary` for that specific transaction. Usually for `development` we include just the `from` wallet, but for remote networks, you can provide gas fees, required confirmations for that block etc. For more info, check [Brownie docs](https://eth-brownie.readthedocs.io/en/stable/).
*`consume_market_fees` - [`TokenInfo` ](https://github.com/oceanprotocol/ocean.py/blob/4aa12afd8a933d64bc2ed68d1e5359d0b9ae62f9/ocean_lib/models/datatoken.py#L31)object which contains the consume market fee amount, address & token address. If it is not explicitly specified, by default it has an empty `TokenInfo` object.
It is implemented in Datatoken class and it is also inherited in Datatoken2 class.
**Parameters**
*`consumer` - address of the consumer wallet that needs funding
*`service_index` - service index as int for identifying the service that you want to apply `start_order`.
*`provider_fees` - dictionary which includes provider fees generated when `initialize` endpoint from `Provider` was called.
*`transaction_parameters` - is the configuration `dictionary` for that specific transaction. Usually for `development` we include just the `from` wallet, but for remote networks, you can provide gas fees, required confirmations for that block etc. For more info, check [Brownie docs](https://eth-brownie.readthedocs.io/en/stable/).
*`consume_market_fees` - [`TokenInfo` ](https://github.com/oceanprotocol/ocean.py/blob/4aa12afd8a933d64bc2ed68d1e5359d0b9ae62f9/ocean_lib/models/datatoken.py#L31)object which contains the consume market fee amount, address & token address. If it is not explicitly specified, by default it has an empty `TokenInfo` object.
It is implemented in Datatoken class and it is also inherited in Datatoken2 class.
**Parameters**
*`order_tx_id` - transaction hash of a previous order, string or bytes format.
*`provider_fees` - dictionary which includes provider fees generated when `initialize` endpoint from `Provider` was called.
*`transaction_parameters` - is the configuration `dictionary` for that specific transaction. Usually for `development` we include just the `from` wallet, but for remote networks, you can provide gas fees, required confirmations for that block etc. For more info, check [Brownie docs](https://eth-brownie.readthedocs.io/en/stable/).
**Returns**
`str`
Return value is a hex string for transaction hash which denotes the proof of reusing order.