dex.watchOrderCancelled
Watches for order cancelled events on the Stablecoin DEX.
Usage
example.ts
import { Actions } from 'tempo.ts/wagmi'
import { config } from './wagmi.config'
const unwatch = Actions.dex.watchOrderCancelled(config, {
onOrderCancelled: (args, log) => {
console.log('Order cancelled:', args.orderId)
},
})
// Later, stop watching
unwatch()Return Type
type ReturnType = () => voidReturns a function to unsubscribe from the event.
Parameters
onOrderCancelled
- Type:
function
declare function onOrderCancelled(args: Args, log: Log): void
type Args = {
/** ID of the cancelled order */
orderId: bigint
}Callback to invoke when an order is cancelled.
args (optional)
- Type:
object
type Args = {
/** Order ID to filter events */
orderId?: bigint | bigint[] | null
}Filter options for the event.
orderId (optional)
- Type:
bigint
Order ID to filter events.
fromBlock (optional)
- Type:
bigint
Block to start listening from.
onError (optional)
- Type:
function
declare function onError(error: Error): voidThe callback to call when an error occurred when trying to get for a new block.
poll (optional)
- Type:
true
Enable polling mode.
pollingInterval (optional)
- Type:
number
Polling frequency (in ms). Defaults to Client's pollingInterval config.