update nameMatcha

This commit is contained in:
liangping
2025-07-08 11:07:03 +08:00
parent 8254924a24
commit abebe228bf
3 changed files with 198 additions and 53 deletions
+5 -2
View File
@@ -3,9 +3,11 @@ import { isBech32Address } from '@/libs/utils';
import { useBlockchain, useFormatter } from '@/stores';
import MdEditor from 'md-editor-v3';
import { computed, onMounted, ref } from 'vue';
import { registry as nameMatcha } from '@leapwallet/name-matcha'
import { fromBase64, toHex } from '@cosmjs/encoding';
import { registry as nameMatcha } from "@leapwallet/name-matcha"
const chainStore = useBlockchain()
const props = defineProps(['value']);
const format = useFormatter();
@@ -40,10 +42,11 @@ const text = computed(() => {
return v
})
const names = ref([] as {name?: string | null, provider?: string}[])
const names = ref([] as {name?: any, provider?: string}[])
onMounted(() => {
if(isAddress()) nameMatcha.lookupAll(props.value).then(re => {
names.value = Object.keys(re).map(key => ({name: re[key], provider: key})).filter( x => x.name)
})
})