CancelAll button

This commit is contained in:
7400
2023-11-30 11:44:52 -08:00
parent d2db5dc4f7
commit f8d1716507
3 changed files with 18 additions and 0 deletions

View File

@@ -184,6 +184,16 @@ export async function cancelOrder(vault, orderIndex) {
})
}
export async function cancelAll(vault) {
pendTransaction(async (signer)=> {
const contract = contractOrNull(vault, vaultAbi, signer)
if( contract === null ) {
console.error('vault contract was null while canceling order', vault)
return null
}
return await contract.cancelAll()
})
}
export function flushOrders(vault) {
for( const order of pendingOrders )