Import
Usage
Parameters
The hook accepts an optional configuration object with the following properties:| Parameter | Type | Description |
|---|---|---|
skipFeeBalanceCheck | boolean | Whether to skip checking token balances (default: false) |
Return Type: UseFeeOptionsReturnType
The hook returns a tuple with the following elements:
Properties
pendingFeeOptionConfirmation
FeeOptionConfirmation | undefined
Object containing the current fee confirmation details if a transaction is pending, or undefined if no transaction is pending confirmation.
skipFeeBalanceCheck is false, the options will be of type FeeOptionExtended, which includes balance information:
confirmPendingFeeOption
(id: string, feeTokenAddress: string) => void
Function to confirm the selected fee option.
| Parameter | Type | Description |
|---|---|---|
id | string | The fee confirmation ID |
feeTokenAddress | string | The address of the token to use for fee payment (use zeroAddress for native token) |
rejectPendingFeeOption
(id: string) => void
Function to reject the current fee option selection.
| Parameter | Type | Description |
|---|---|---|
id | string | The fee confirmation ID to reject |
Notes
This hook provides functionality for handling Sequence V3 fee options for unsponsored transactions. Key features:- Intercept fee options for a transaction in Native Token and ERC20 tokens
- Automatically fetch user wallet balances for each fee option (unless
skipFeeBalanceCheckistrue) - Allow users to select their preferred fee token through a UI component
- Confirm or reject fee selections
- Shared state management across multiple hook instances