There is a function named getCallsStatus. https://wagmi.sh/core/api/actions/getCallsStatus#getcallsstatus
And here is an example:
let txStatus = {
status: 'PENDING',
}
while (txStatus?.status === 'PENDING') {
txStatus = await getCallsStatus(defaultWamigConfig, {
id,
})
}