Merge remote-tracking branch 'origin/master' into orderspec
# Conflicts: # src/blockchain/abi.js
This commit is contained in:
@@ -187,6 +187,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 )
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="d-inline-flex">
|
||||
<btn icon="mdi-plus" color="green" @click="show=true">New Order</btn>
|
||||
<btn icon="mdi-delete-alert" color="red" class="mb-6" @click="cancelAll(vaultAddr)">Cancel All Orders</btn>
|
||||
<v-dialog v-model="show" width="auto">
|
||||
<v-card>
|
||||
<v-card-item class="d-flex">
|
||||
@@ -38,6 +39,11 @@ import Btn from "@/components/Btn.vue";
|
||||
const s = useStore()
|
||||
const show = ref(false)
|
||||
|
||||
import {cancelAll} from "@/blockchain/wallet.js";
|
||||
import {computed} from "vue";
|
||||
const props = defineProps(['vault'])
|
||||
const vaultAddr = computed(()=>props.vault?props.vault:s.vault)
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user