This commit is contained in:
Tim Olson
2024-01-08 21:42:40 -04:00
parent 52a41c6f81
commit a65a1fffae
7 changed files with 122 additions and 144 deletions

View File

@@ -1,12 +1,7 @@
import {queryHelperContract} from "@/blockchain/contract.js";
import {Exchange} from "@/blockchain/orderlib.js";
export async function findRoute(chainId, tokenA, tokenB) {
console.log('getting query helper')
const helper = await queryHelperContract()
if (!helper)
throw Error('no helper')
export async function findRoute(helper, chainId, tokenA, tokenB) {
console.log('getting raw routes', helper, tokenA.address, tokenB.address)
const rawRoutes = await helper.getRoutes(tokenA.address, tokenB.address)
// todo expose all available pools