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 buying a specific amount of tokens. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.useBuy() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useBuy(parameters?: useBuy.Parameters): useBuy.ReturnType; export declare namespace useBuy { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for buying a specific amount of tokens. * * 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.dex.useBuySync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useBuySync(parameters?: useBuySync.Parameters): useBuySync.ReturnType; export declare namespace useBuySync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for canceling an order from the orderbook. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.useCancel() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useCancel(parameters?: useCancel.Parameters): useCancel.ReturnType; export declare namespace useCancel { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for canceling an order from the orderbook. * * 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.dex.useCancelSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useCancelSync(parameters?: useCancelSync.Parameters): useCancelSync.ReturnType; export declare namespace useCancelSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for cancelling a stale order from the orderbook. * * A stale order is one where the owner's balance or allowance has dropped * below the order amount. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.useCancelStale() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useCancelStale(parameters?: useCancelStale.Parameters): useCancelStale.ReturnType; export declare namespace useCancelStale { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for cancelling a stale order and waiting for confirmation. * * A stale order is one where the owner's balance or allowance has dropped * below the order amount. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.useCancelStaleSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useCancelStaleSync(parameters?: useCancelStaleSync.Parameters): useCancelStaleSync.ReturnType; export declare namespace useCancelStaleSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for creating a new trading pair on the DEX. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.useCreatePair() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useCreatePair(parameters?: useCreatePair.Parameters): useCreatePair.ReturnType; export declare namespace useCreatePair { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for creating a new trading pair on the DEX. * * 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.dex.useCreatePairSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useCreatePairSync(parameters?: useCreatePairSync.Parameters): useCreatePairSync.ReturnType; export declare namespace useCreatePairSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for getting a user's token balance on the DEX. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data, isLoading } = Hooks.dex.useBalance({ * account: '0x...', * token: '0x20c...11', * }) * * if (isLoading) return
Loading...
* return
Balance: {data}
* } * ``` * * @param parameters - Parameters. * @returns Query result with the user's token balance on the DEX. */ export declare function useBalance(parameters: useBalance.Parameters): useBalance.ReturnValue; export declare namespace useBalance { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for getting the quote for buying a specific amount of tokens. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data, isLoading } = Hooks.dex.useBuyQuote({ * amountOut: parseUnits('100', 6), * tokenIn: '0x20c...11', * tokenOut: '0x20c...20', * }) * * if (isLoading) return
Loading...
* return
Required Input: {data}
* } * ``` * * @param parameters - Parameters. * @returns Query result with the amount of tokenIn needed. */ export declare function useBuyQuote(parameters: useBuyQuote.Parameters): useBuyQuote.ReturnValue; export declare namespace useBuyQuote { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for getting an order's details from the orderbook. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data, isLoading } = Hooks.dex.useOrder({ * orderId: 123n, * }) * * if (isLoading) return
Loading...
* return
Order: {JSON.stringify(data)}
* } * ``` * * @param parameters - Parameters. * @returns Query result with the order details. */ export declare function useOrder(parameters: useOrder.Parameters): useOrder.ReturnValue; export declare namespace useOrder { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for getting orderbook information for a trading pair. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data, isLoading } = Hooks.dex.useOrderbook({ * base: '0x20c...11', * quote: '0x20c...20', * }) * * if (isLoading) return
Loading...
* return
Orderbook: {JSON.stringify(data)}
* } * ``` * * @param parameters - Parameters. * @returns Query result with the orderbook information. */ export declare function useOrderbook(parameters: useOrderbook.Parameters): useOrderbook.ReturnValue; export declare namespace useOrderbook { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for getting the tick level information at a specific tick. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * import { Tick } from 'viem/tempo' * * function App() { * const { data, isLoading } = Hooks.dex.useTickLevel({ * base: '0x20c...11', * tick: Tick.fromPrice('1.001'), * isBid: true, * }) * * if (isLoading) return
Loading...
* return
Tick Level: {JSON.stringify(data)}
* } * ``` * * @param parameters - Parameters. * @returns Query result with the tick level information. */ export declare function useTickLevel(parameters: useTickLevel.Parameters): useTickLevel.ReturnValue; export declare namespace useTickLevel { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for getting the quote for selling a specific amount of tokens. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data, isLoading } = Hooks.dex.useSellQuote({ * amountIn: parseUnits('100', 6), * tokenIn: '0x20c...11', * tokenOut: '0x20c...20', * }) * * if (isLoading) return
Loading...
* return
Expected Output: {data}
* } * ``` * * @param parameters - Parameters. * @returns Query result with the amount of tokenOut received. */ export declare function useSellQuote(parameters: useSellQuote.Parameters): useSellQuote.ReturnValue; export declare namespace useSellQuote { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for placing a limit order on the orderbook. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.usePlace() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function usePlace(parameters?: usePlace.Parameters): usePlace.ReturnType; export declare namespace usePlace { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for placing a flip order that automatically flips when filled. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.usePlaceFlip() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function usePlaceFlip(parameters?: usePlaceFlip.Parameters): usePlaceFlip.ReturnType; export declare namespace usePlaceFlip { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for placing a flip order that automatically flips when filled. * * 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.dex.usePlaceFlipSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function usePlaceFlipSync(parameters?: usePlaceFlipSync.Parameters): usePlaceFlipSync.ReturnType; export declare namespace usePlaceFlipSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for placing a limit order on the orderbook. * * 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.dex.usePlaceSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function usePlaceSync(parameters?: usePlaceSync.Parameters): usePlaceSync.ReturnType; export declare namespace usePlaceSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for selling a specific amount of tokens. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.useSell() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useSell(parameters?: useSell.Parameters): useSell.ReturnType; export declare namespace useSell { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for selling a specific amount of tokens. * * 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.dex.useSellSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useSellSync(parameters?: useSellSync.Parameters): useSellSync.ReturnType; export declare namespace useSellSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for withdrawing tokens from the DEX to the caller's wallet. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.dex.useWithdraw() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useWithdraw(parameters?: useWithdraw.Parameters): useWithdraw.ReturnType; export declare namespace useWithdraw { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for withdrawing tokens from the DEX to the caller's wallet. * * 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.dex.useWithdrawSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useWithdrawSync(parameters?: useWithdrawSync.Parameters): useWithdrawSync.ReturnType; export declare namespace useWithdrawSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for watching flip order placement events on the DEX. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.dex.useWatchFlipOrderPlaced({ * onFlipOrderPlaced(args) { * console.log('Flip order placed:', args) * }, * }) * * return
Watching for flip order placements...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchFlipOrderPlaced(parameters?: useWatchFlipOrderPlaced.Parameters): void; export declare namespace useWatchFlipOrderPlaced { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } /** * Hook for watching order cancellation events on the DEX. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.dex.useWatchOrderCancelled({ * onOrderCancelled(args) { * console.log('Order cancelled:', args) * }, * }) * * return
Watching for order cancellations...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchOrderCancelled(parameters?: useWatchOrderCancelled.Parameters): void; export declare namespace useWatchOrderCancelled { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } /** * Hook for watching order filled events on the DEX. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.dex.useWatchOrderFilled({ * onOrderFilled(args) { * console.log('Order filled:', args) * }, * }) * * return
Watching for order fills...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchOrderFilled(parameters?: useWatchOrderFilled.Parameters): void; export declare namespace useWatchOrderFilled { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } /** * Hook for watching order placement events on the DEX. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.dex.useWatchOrderPlaced({ * onOrderPlaced(args) { * console.log('Order placed:', args) * }, * }) * * return
Watching for order placements...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchOrderPlaced(parameters?: useWatchOrderPlaced.Parameters): void; export declare namespace useWatchOrderPlaced { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } //# sourceMappingURL=dex.d.ts.map