Forms

class polaris.integrations.TransactionForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Base class for collecting transaction information

Developers must define subclasses to collect additional information and apply additional validation.

Defines the forms.DecimalField amount and also has a non-form attribute asset, which will be populated by the asset_code request parameter used in /transactions/deposit/webapp and /transactions/withdraw/webapp endpoints.

The amount field is validated with the clean_amount() function, which ensures the amount is within the bounds for the asset type.