Documentation

Custom Hooks

Encapsulated logic for blockchain interaction and state management

Contract Interaction

useCreateDeposit

Write

Handles the interaction with PrivateLendingIngress.createDeposit(). Automatically handles ERC20 approvals if the deposit token is not native MNT.

useSubmitAction

Write + Encrypt

The most complex hook. It: 1. Takes plaintext inputs (amount, token). 2. Encrypts them using sapphire-js. 3. Submits the ciphertext to the Ingress contract.

Data Fetching

usePonderDeposits

Read

Wraps useQuery (TanStack Query) to fetch the user's deposits from the Ponder GraphQL API. Includes auto-refetching on window focus.

useTokenBalance

Read

Fetches the user's wallet balance for a specific token to ensure they have enough funds to deposit.