try decode base64 as obj
This commit is contained in:
parent
47440f6000
commit
f0225657b8
@ -13,7 +13,7 @@ const props = defineProps({
|
||||
}>,
|
||||
},
|
||||
});
|
||||
console.log(props);
|
||||
|
||||
const total = computed(() => props.pool?.bondedTokens);
|
||||
const format = useFormatter();
|
||||
const yes = computed(() =>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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) };
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user