@@ -7,18 +7,13 @@ import {
77} from '@aave/client/actions' ;
88import {
99 type PaginatedVaultsResult ,
10- SupplyRequest ,
1110 type TokenAmount ,
1211 UserVaultsQuery ,
1312 type UserVaultsRequest ,
1413 type Vault ,
15- VaultPreviewDepositQuery ,
1614 type VaultPreviewDepositRequest ,
17- VaultPreviewMintQuery ,
1815 type VaultPreviewMintRequest ,
19- VaultPreviewRedeemQuery ,
2016 type VaultPreviewRedeemRequest ,
21- VaultPreviewWithdrawQuery ,
2217 type VaultPreviewWithdrawRequest ,
2318 VaultQuery ,
2419 type VaultRequest ,
@@ -199,10 +194,7 @@ export function useUserVaults({
199194 * Determines the amount of shares that would be received for a deposit.
200195 *
201196 * ```ts
202- * const [preview, previewing] = useVaultDepositPreview();
203- *
204- * const loading = previewing.loading;
205- * const error = previewing.error;
197+ * const [preview, { loading, error }] = useVaultDepositPreview();
206198 *
207199 * // …
208200 *
@@ -234,15 +226,22 @@ export function useVaultDepositPreview(): UseAsyncTask<
234226/**
235227 * Determines the amount of assets that would be required to mint a specific amount of vault shares.
236228 *
237- * This signature supports React Suspense:
229+ * ```ts
230+ * const [preview, { loading, error }] = useVaultMintPreview();
238231 *
239- * ```tsx
240- * const { data } = useVaultMintPreview({
232+ * // …
233+ *
234+ * const result = await preview({
241235 * vault: evmAddress('0x1234567890abcdef1234567890abcdef12345678'),
242236 * chainId: chainId(1),
243237 * amount: bigDecimal('500'),
244- * suspense: true,
245238 * });
239+ *
240+ * if (result.isErr()) {
241+ * console.error(result.error);
242+ * } else {
243+ * console.log(result.value);
244+ * }
246245 * ```
247246 */
248247export function useVaultMintPreview ( ) : UseAsyncTask <
@@ -261,10 +260,7 @@ export function useVaultMintPreview(): UseAsyncTask<
261260 * Determines the amount of shares that would be burned for a withdrawal.
262261 *
263262 * ```ts
264- * const [preview, previewing] = useVaultWithdrawPreview();
265- *
266- * const loading = previewing.loading;
267- * const error = previewing.error;
263+ * const [preview, { loading, error }] = useVaultWithdrawPreview();
268264 *
269265 * // …
270266 *
@@ -299,10 +295,7 @@ export function useVaultWithdrawPreview(): UseAsyncTask<
299295 * This signature supports React Suspense:
300296 *
301297 * ```ts
302- * const [preview, previewing] = useVaultRedeemPreview();
303- *
304- * const loading = previewing.loading;
305- * const error = previewing.error;
298+ * const [preview, { loading, error }] = useVaultRedeemPreview();
306299 *
307300 * // …
308301 *
0 commit comments