decode contract states
This commit is contained in:
parent
43d4faa396
commit
8fb6a952de
@ -1,6 +1,5 @@
|
|||||||
import { BaseRestClient } from "@/libs/client";
|
import { BaseRestClient } from "@/libs/client";
|
||||||
import { adapter, type AbstractRegistry, type Request } from "@/libs/registry";
|
import { adapter, type AbstractRegistry, type Request } from "@/libs/registry";
|
||||||
import type { PaginabledAccounts } from "@/types";
|
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import type { CodeInfo, ContractInfo, PaginabledCodeInfos, PaginabledContractHistory, PaginabledContracts, PaginabledContractStates, WasmParam } from "./types";
|
import type { CodeInfo, ContractInfo, PaginabledCodeInfos, PaginabledContractHistory, PaginabledContracts, PaginabledContractStates, WasmParam } from "./types";
|
||||||
import { toBase64 } from "@cosmjs/encoding";
|
import { toBase64 } from "@cosmjs/encoding";
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useBlockchain, useFormatter } from '@/stores';
|
import { fromHex } from "@cosmjs/encoding";
|
||||||
import { useWasmStore } from '../WasmStore';
|
import { useWasmStore } from '../WasmStore';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import type { ContractInfo, PaginabledContractStates, PaginabledContracts } from '../types';
|
import type { ContractInfo, PaginabledContractStates, PaginabledContracts } from '../types';
|
||||||
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
|
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
|
||||||
import type CustomRadiosVue from '@/plugins/vuetify/@core/components/CustomRadios.vue';
|
import type CustomRadiosVue from '@/plugins/vuetify/@core/components/CustomRadios.vue';
|
||||||
import type { CustomInputContent } from '@/plugins/vuetify/@core/types';
|
import type { CustomInputContent } from '@/plugins/vuetify/@core/types';
|
||||||
|
import { useFormatter } from "@/stores";
|
||||||
|
|
||||||
const props = defineProps(['code_id', 'chain', ])
|
const props = defineProps(['code_id', 'chain', ])
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ const wasmStore = useWasmStore()
|
|||||||
wasmStore.wasmClient.getWasmCodeContracts(props.code_id).then(x =>{
|
wasmStore.wasmClient.getWasmCodeContracts(props.code_id).then(x =>{
|
||||||
response.value = x
|
response.value = x
|
||||||
})
|
})
|
||||||
|
const format = useFormatter()
|
||||||
const infoDialog = ref(false)
|
const infoDialog = ref(false)
|
||||||
const stateDialog = ref(false)
|
const stateDialog = ref(false)
|
||||||
const queryDialog = ref(false)
|
const queryDialog = ref(false)
|
||||||
@ -80,6 +82,7 @@ const radioContent: CustomInputContent[] = [
|
|||||||
const selectedRadio = ref('raw')
|
const selectedRadio = ref('raw')
|
||||||
const query = ref("")
|
const query = ref("")
|
||||||
const result = ref("")
|
const result = ref("")
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
@ -116,10 +119,10 @@ const result = ref("")
|
|||||||
<VList>
|
<VList>
|
||||||
<VListItem v-for="v in state.models">
|
<VListItem v-for="v in state.models">
|
||||||
<VListItemTitle>
|
<VListItemTitle>
|
||||||
{{ v.value }}
|
{{ format.hexToString(v.key) }}
|
||||||
</VListItemTitle>
|
</VListItemTitle>
|
||||||
<VListItemSubtitle>
|
<VListItemSubtitle :title="format.base64ToString(v.value)">
|
||||||
{{ v.key }}
|
{{ format.base64ToString(v.value) }}
|
||||||
</VListItemSubtitle>
|
</VListItemSubtitle>
|
||||||
</VListItem>
|
</VListItem>
|
||||||
</VList>
|
</VList>
|
||||||
|
Loading…
Reference in New Issue
Block a user