vault balances UI
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-combobox :items="s.tokens" :auto-select-first="true"
|
||||
<v-combobox :items="Object.values(s.tokens)" :auto-select-first="true"
|
||||
item-title="symbol"
|
||||
:filter-keys="['raw.name','raw.symbol','raw.address']"
|
||||
:model-value="modelValue"
|
||||
@@ -25,6 +25,7 @@ import {ref} from "vue";
|
||||
import {ethers} from "ethers";
|
||||
// noinspection ES6UnusedImports
|
||||
import {vAutoSelect} from "@/misc.js";
|
||||
import {addExtraToken} from "@/blockchain/token.js";
|
||||
|
||||
const s = useStore2()
|
||||
const props = defineProps(['modelValue', 'label'])
|
||||
@@ -81,22 +82,8 @@ function updateValue(v) {
|
||||
<script>
|
||||
import {ethers} from "ethers";
|
||||
import {useStore} from "@/store/store.js";
|
||||
import {socket} from "@/socket.js";
|
||||
|
||||
const s = useStore()
|
||||
|
||||
async function addExtraToken(addr) {
|
||||
const prom = new Promise((resolve)=>{
|
||||
const chainId = s.chainId
|
||||
socket.emit('lookupToken', chainId, addr, (info) => {
|
||||
if( info === null )
|
||||
return resolve(null)
|
||||
s.addToken(chainId, info)
|
||||
resolve(info)
|
||||
})
|
||||
})
|
||||
return await prom
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user