major refactor of web store into vue setup style declaration; reactivity debugging; order view has known refresh issues

This commit is contained in:
Tim Olson
2023-11-27 00:52:17 -04:00
parent 41457b85f5
commit d2db5dc4f7
24 changed files with 545 additions and 364 deletions

View File

@@ -3,14 +3,13 @@ import {Exchange} from "@/blockchain/orderlib.js";
import {useStore} from "@/store/store.js";
export async function findRoute(tokenA, tokenB) {
export async function findRoute(chainId, tokenA, tokenB) {
const helper = await queryHelperContract()
if (!helper)
throw Error('no helper')
const chainId = useStore().chainId
const rawRoutes = await helper.getRoutes(tokenA.address, tokenB.address)
// todo expose all available pools
// console.log('raw routes', rawRoutes)
console.log('raw routes', rawRoutes)
let result = null // we actually only find a single pool for now
for (let [exchange, fee, pool] of rawRoutes) {
exchange = Number(exchange)