,
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 function useWatchFlipOrderPlaced<
config extends Config = ResolvedRegister['config'],
>(parameters: useWatchFlipOrderPlaced.Parameters = {}) {
const { enabled = true, onFlipOrderPlaced, ...rest } = parameters
const config = useConfig({ config: parameters.config })
const configChainId = useChainId({ config })
const chainId = parameters.chainId ?? configChainId
// biome-ignore lint/correctness/useExhaustiveDependencies: rest.x is explicitly listed
useEffect(() => {
if (!enabled) return
if (!onFlipOrderPlaced) return
return Actions.dex.watchFlipOrderPlaced(config, {
...rest,
chainId,
onFlipOrderPlaced,
})
}, [
config,
enabled,
chainId,
onFlipOrderPlaced,
rest.fromBlock,
rest.maker,
rest.onError,
rest.poll,
rest.pollingInterval,
rest.token,
])
}
export declare namespace useWatchFlipOrderPlaced {
type Parameters = UnionCompute<
ExactPartial> &
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 function useWatchOrderCancelled<
config extends Config = ResolvedRegister['config'],
>(parameters: useWatchOrderCancelled.Parameters = {}) {
const { enabled = true, onOrderCancelled, ...rest } = parameters
const config = useConfig({ config: parameters.config })
const configChainId = useChainId({ config })
const chainId = parameters.chainId ?? configChainId
// biome-ignore lint/correctness/useExhaustiveDependencies: rest.x is explicitly listed
useEffect(() => {
if (!enabled) return
if (!onOrderCancelled) return
return Actions.dex.watchOrderCancelled(config, {
...rest,
chainId,
onOrderCancelled,
})
}, [
config,
enabled,
chainId,
onOrderCancelled,
rest.fromBlock,
rest.onError,
rest.orderId,
rest.poll,
rest.pollingInterval,
])
}
export declare namespace useWatchOrderCancelled {
type Parameters = UnionCompute<
ExactPartial> &
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 function useWatchOrderFilled<
config extends Config = ResolvedRegister['config'],
>(parameters: useWatchOrderFilled.Parameters = {}) {
const { enabled = true, onOrderFilled, ...rest } = parameters
const config = useConfig({ config: parameters.config })
const configChainId = useChainId({ config })
const chainId = parameters.chainId ?? configChainId
// biome-ignore lint/correctness/useExhaustiveDependencies: rest.x is explicitly listed
useEffect(() => {
if (!enabled) return
if (!onOrderFilled) return
return Actions.dex.watchOrderFilled(config, {
...rest,
chainId,
onOrderFilled,
})
}, [
config,
enabled,
chainId,
onOrderFilled,
rest.fromBlock,
rest.maker,
rest.onError,
rest.orderId,
rest.poll,
rest.pollingInterval,
rest.taker,
])
}
export declare namespace useWatchOrderFilled {
type Parameters = UnionCompute<
ExactPartial> &
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 function useWatchOrderPlaced<
config extends Config = ResolvedRegister['config'],
>(parameters: useWatchOrderPlaced.Parameters = {}) {
const { enabled = true, onOrderPlaced, ...rest } = parameters
const config = useConfig({ config: parameters.config })
const configChainId = useChainId({ config })
const chainId = parameters.chainId ?? configChainId
// biome-ignore lint/correctness/useExhaustiveDependencies: rest.x is explicitly listed
useEffect(() => {
if (!enabled) return
if (!onOrderPlaced) return
return Actions.dex.watchOrderPlaced(config, {
...rest,
chainId,
onOrderPlaced,
})
}, [
config,
enabled,
chainId,
onOrderPlaced,
rest.fromBlock,
rest.maker,
rest.onError,
rest.poll,
rest.pollingInterval,
rest.token,
])
}
export declare namespace useWatchOrderPlaced {
type Parameters = UnionCompute<
ExactPartial> &
ConfigParameter & { enabled?: boolean | undefined }
>
}