import type { UseMutationResult } from '@tanstack/react-query'; import type { Config, ResolvedRegister } from '@wagmi/core'; import type { ConfigParameter, ExactPartial, UnionCompute } from '@wagmi/core/internal'; import { Actions } from '@wagmi/core/tempo'; import { type UseMutationParameters, type UseQueryReturnType } from '../../utils/query.js'; import type { QueryParameter } from '../utils.js'; /** * Hook for getting the reserves for a liquidity pool. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data, isLoading } = Hooks.amm.usePool({ * userToken: '0x...', * validatorToken: '0x...', * }) * * if (isLoading) return
Loading...
* return ( *
* User Token Reserve: {data?.reserveUserToken.toString()} * Validator Token Reserve: {data?.reserveValidatorToken.toString()} *
* ) * } * ``` * * @param parameters - Parameters. * @returns Query result with the pool reserves. */ export declare function usePool(parameters?: usePool.Parameters): usePool.ReturnValue; export declare namespace usePool { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for getting the LP token balance for an account in a specific pool. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data: poolId } = Hooks.amm.usePoolId({ * userToken: '0x...', * validatorToken: '0x...', * }) * * const { data, isLoading } = Hooks.amm.useLiquidityBalance({ * poolId, * address: '0x20c...0055', * }) * * if (isLoading) return
Loading...
* return
LP Balance: {data?.toString()}
* } * ``` * * @param parameters - Parameters. * @returns Query result with the LP token balance. */ export declare function useLiquidityBalance(parameters?: useLiquidityBalance.Parameters): useLiquidityBalance.ReturnValue; export declare namespace useLiquidityBalance { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for performing a rebalance swap from validator token to user token. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.amm.useRebalanceSwap() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useRebalanceSwap(parameters?: useRebalanceSwap.Parameters): useRebalanceSwap.ReturnType; export declare namespace useRebalanceSwap { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for performing a rebalance swap from validator token to user token. * * Note: This is a synchronous hook that waits for the transaction * to be included on a block before returning a response. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.amm.useRebalanceSwapSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useRebalanceSwapSync(parameters?: useRebalanceSwapSync.Parameters): useRebalanceSwapSync.ReturnType; export declare namespace useRebalanceSwapSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for adding liquidity to a pool. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.amm.useMint() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useMint(parameters?: useMint.Parameters): useMint.ReturnType; export declare namespace useMint { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for adding liquidity to a pool. * * Note: This is a synchronous hook that waits for the transaction * to be included on a block before returning a response. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.amm.useMintSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useMintSync(parameters?: useMintSync.Parameters): useMintSync.ReturnType; export declare namespace useMintSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for removing liquidity from a pool. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.amm.useBurn() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useBurn(parameters?: useBurn.Parameters): useBurn.ReturnType; export declare namespace useBurn { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for removing liquidity from a pool. * * Note: This is a synchronous hook that waits for the transaction * to be included on a block before returning a response. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.amm.useBurnSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useBurnSync(parameters?: useBurnSync.Parameters): useBurnSync.ReturnType; export declare namespace useBurnSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for watching rebalance swap events. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.amm.useWatchRebalanceSwap({ * onRebalanceSwap(args) { * console.log('Rebalance swap:', args) * }, * }) * * return
Watching for rebalance swaps...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchRebalanceSwap(parameters?: useWatchRebalanceSwap.Parameters): void; export declare namespace useWatchRebalanceSwap { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } /** * Hook for watching liquidity mint events. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.amm.useWatchMint({ * onMint(args) { * console.log('Liquidity added:', args) * }, * }) * * return
Watching for liquidity additions...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchMint(parameters?: useWatchMint.Parameters): void; export declare namespace useWatchMint { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } /** * Hook for watching liquidity burn events. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.amm.useWatchBurn({ * onBurn(args) { * console.log('Liquidity removed:', args) * }, * }) * * return
Watching for liquidity removals...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchBurn(parameters?: useWatchBurn.Parameters): void; export declare namespace useWatchBurn { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } //# sourceMappingURL=amm.d.ts.map