chainInfo from server, routes, wallet rework

This commit is contained in:
Tim Olson
2023-10-04 03:40:47 -04:00
parent e7a9600c54
commit 7239987867
26 changed files with 603 additions and 297 deletions

View File

@@ -9,6 +9,7 @@
:label="label"
v-bind="modelValue" @update:modelValue="updateValue"
variant="outlined"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
>
<template v-slot:prepend><slot name="prepend"/></template>
<template v-slot:item="{props,item}">
@@ -76,8 +77,6 @@ function updateValue(v) {
<script>
import {ethers} from "ethers";
import wallet from "@/blockchain/wallet.js";
import {erc20Abi} from "@/blockchain/abi.js";
import {useStore} from "@/store/store.js";
import {socket} from "@/socket.js";
@@ -85,14 +84,14 @@ const s = useStore()
async function addExtraToken(addr) {
const prom = new Promise((resolve)=>{
socket.emit('lookupToken', s.chain.id, addr, (info) => {
socket.emit('lookupToken', s.chainId, addr, (info) => {
if( info === null )
return resolve(null)
s.$patch((state)=>{
let extras = state.extraTokens[state.chain.id]
let extras = state.extraTokens[state.chainId]
if( extras === undefined ) {
extras = {}
state.extraTokens[state.chain.id] = extras
state.extraTokens[state.chainId] = extras
}
extras[info.address] = info
})
@@ -106,5 +105,4 @@ async function addExtraToken(addr) {
<style scoped lang="scss">
@use "src/styles/vars" as *;
</style>