Skip to main content
The SupplyForm component provides a user-friendly interface for supplying assets to the Compound III protocol. It handles input validation, balance checking, and transaction submission.

Usage

Props

Example

Features

The SupplyForm component includes the following features:
  • Asset Selection: Users can select which asset they want to supply
  • Amount Input: Users can enter the amount they want to supply
  • Balance Display: Shows the user’s current balance of the selected asset
  • Max Button: Allows users to quickly set the maximum amount they can supply
  • Validation: Validates input to ensure it’s within allowed limits
  • Gas Estimation: Estimates gas costs for the transaction
  • Transaction Submission: Handles submitting the transaction to the network
  • Loading States: Shows loading indicators during transaction processing
  • Error Handling: Displays user-friendly error messages

Loading and Error States

The component handles loading and error states automatically:
  • While the transaction is being processed, a loading indicator is displayed
  • If an error occurs during the transaction, an error message is displayed

Customization

You can customize the appearance of the component using the className prop: