extracted PairChoice component

This commit is contained in:
Tim Olson
2023-11-22 16:35:15 -04:00
parent c69f3c7f54
commit c3f05deff1
5 changed files with 155 additions and 119 deletions

View File

@@ -1,4 +1,5 @@
import {FixedNumber} from "ethers";
import {useStore} from "@/store/store.js";
export class SingletonCoroutine {
constructor(f, delay=10, retry=true) {
@@ -52,3 +53,8 @@ export function tokenNumber(token, balance) {
export function tokenFloat(token, balance) {
return tokenNumber(token,balance).toUnsafeFloat()
}
export function routeInverted(route) {
const s = useStore()
return route && (route.token0 === s.tokenA) === s.inverted
}