try decode base64 as obj

This commit is contained in:
Pham Tu 2024-02-05 17:51:18 +07:00
parent 47440f6000
commit f0225657b8
No known key found for this signature in database
GPG Key ID: 7460FD99133ADA1C
3 changed files with 6 additions and 4 deletions

View File

@ -13,7 +13,7 @@ const props = defineProps({
}>,
},
});
console.log(props);
const total = computed(() => props.pool?.bondedTokens);
const format = useFormatter();
const yes = computed(() =>

View File

@ -3,7 +3,7 @@ import ArrayBytesElement from './ArrayBytesElement.vue';
import ArrayObjectElement from './ArrayObjectElement.vue';
import TextElement from './TextElement.vue';
import ArrayCoinElement from './ArrayCoinElement.vue';
import ArrayStringElement from './ArrayStringElement.vue'
import ArrayStringElement from './ArrayStringElement.vue';
const props = defineProps({
value: { type: Array<Object> },
@ -23,6 +23,7 @@ function selectByElement() {
return ArrayObjectElement;
}
}
return TextElement;
}
</script>

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { fromBase64 } from '@cosmjs/encoding';
import { fromBinary } from '@cosmjs/cosmwasm-stargate';
import { computed } from 'vue';
import { select, decodeProto } from './index';
@ -8,8 +8,9 @@ const props = defineProps(['value', 'direct']);
const selectValue = computed(() => {
if (typeof props.value === 'string') {
try {
return fromBase64(props.value);
return fromBinary(props.value);
} catch {}
return props.value;
} else if (props.value?.typeUrl) {
return { typeUrl: props.value.typeUrl, value: decodeProto(props.value) };
}