order status updates working

This commit is contained in:
Tim Olson
2023-11-08 23:18:36 -04:00
parent 077e664a30
commit f1bc632074
14 changed files with 259 additions and 21 deletions

View File

@@ -88,14 +88,27 @@ export async function connectWallet() {
const pendingOrders = []
export function ensureVault() {
const s = useStore()
if( !s.chain ) {
console.log('cannot create vault: no chain selected')
return
}
if( !s.account ) {
console.log('cannot create vault: no account logged in')
return
}
socket.emit('ensureVault', s.chainId, s.account, 0)
}
export async function pendOrder(order) {
console.log('order', JSON.stringify(order))
const s = useStore()
const signer = await s.provider.getSigner()
if (!s.vaults.length) {
pendingOrders.push(order)
const owner = await signer.getAddress();
socket.emit('ensureVault', s.chainId, owner, 0)
ensureVault()
}
else {
const vault = s.vaults[0];