order validity checks
This commit is contained in:
@@ -29,17 +29,18 @@ const Order = {
|
||||
export const orderFuncs = {}
|
||||
|
||||
// the key is order.builder.id and the value is a function() that returns an array of tranches
|
||||
// if null is returned, the builder inputs are not valid and the place order button will be disabled
|
||||
export const builderFuncs = {}
|
||||
|
||||
function newDefaultOrder() {
|
||||
return { id:uuid(), amount:1, amountIsTokenA: true, buy: true, builders:[] }
|
||||
return { id:uuid(), valid: false, amount:null, amountIsTokenA: true, buy: true, builders:[] }
|
||||
}
|
||||
|
||||
export const useChartOrderStore = defineStore('chart_orders', () => {
|
||||
const chartReady = ref(false)
|
||||
|
||||
const orders = ref([newDefaultOrder()]) // order models in UI format
|
||||
const built = ref([{}]) // orders in blockchain format, ready to send
|
||||
const defaultOrder = newDefaultOrder()
|
||||
const orders = ref([defaultOrder]) // order models in UI format
|
||||
const selectedOrder = ref(null)
|
||||
const selectedSymbol = ref(null)
|
||||
const selectedPool = ref(null)
|
||||
|
||||
Reference in New Issue
Block a user