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

@@ -3,6 +3,19 @@ import {useStore} from "@/store/store.js";
import {erc20Abi} from "@/blockchain/abi.js";
import {ethers} from "ethers";
// synchronous version may return null but will trigger a lookup
export function token(addr) {
const s = useStore()
if( !(addr in s.tokens) ) {
getToken(addr)
return null
}
return s.tokens[addr]
}
// async version doesnt return until it has a token value
export async function getToken(addr) {
const s = useStore()
if (!(addr in s.tokens))