-
-
-
-
-
-
- {{ item?.title }}
-
-
- {{ item?.badgeContent }}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue b/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue
index bcd636f3..ed64392b 100644
--- a/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue
+++ b/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue
@@ -2,12 +2,11 @@
import { useWasmStore } from '../WasmStore';
import { ref } from 'vue';
import type {
- ContractInfo,
- PaginabledContractStates,
- PaginabledContracts,
+ ContractInfo,
+ PaginabledContractStates,
+ PaginabledContracts,
} from '../types';
import DynamicComponent from '@/components/dynamic/DynamicComponent.vue';
-import type { CustomInputContent } from '@/plugins/vuetify/@core/types';
import { useFormatter, useTxDialog } from '@/stores';
import PaginationBar from '@/components/PaginationBar.vue';
import { PageRequest } from '@/types';
@@ -19,84 +18,82 @@ const response = ref({} as PaginabledContracts);
const wasmStore = useWasmStore();
function loadContract(pageNum: number) {
- const pr = new PageRequest()
- pr.setPage(pageNum)
- wasmStore.wasmClient.getWasmCodeContracts(props.code_id, pr).then((x) => {
- response.value = x;
- });
+ const pr = new PageRequest()
+ pr.setPage(pageNum)
+ wasmStore.wasmClient.getWasmCodeContracts(props.code_id, pr).then((x) => {
+ response.value = x;
+ });
}
loadContract(1)
const dialog = useTxDialog()
const format = useFormatter();
const infoDialog = ref(false);
-const stateDialog = ref(false);
-const queryDialog = ref(false);
const info = ref({} as ContractInfo);
const state = ref({} as PaginabledContractStates);
const selected = ref('');
function showInfo(address: string) {
- wasmStore.wasmClient.getWasmContracts(address).then((x) => {
- info.value = x.contract_info;
- });
+ wasmStore.wasmClient.getWasmContracts(address).then((x) => {
+ info.value = x.contract_info;
+ });
}
function showState(address: string) {
- selected.value = address
- pageload(1)
+ selected.value = address
+ pageload(1)
}
function pageload(p: number) {
- pageRequest.value.setPage(p)
- wasmStore.wasmClient.getWasmContractStates(selected.value, pageRequest.value).then((x) => {
- state.value = x;
- });
+ pageRequest.value.setPage(p)
+ wasmStore.wasmClient.getWasmContractStates(selected.value, pageRequest.value).then((x) => {
+ state.value = x;
+ });
}
function showQuery(address: string) {
- selected.value = address;
- query.value = '';
- result.value = '';
+ selected.value = address;
+ query.value = '';
+ result.value = '';
}
function queryContract() {
- try {
- if (selectedRadio.value === 'raw') {
- wasmStore.wasmClient
- .getWasmContractRawQuery(selected.value, query.value)
- .then((x) => {
- result.value = JSON.stringify(x);
- })
- .catch((err) => {
- result.value = JSON.stringify(err);
- });
- } else {
- wasmStore.wasmClient
- .getWasmContractSmartQuery(selected.value, query.value)
- .then((x) => {
- result.value = JSON.stringify(x);
- })
- .catch((err) => {
- result.value = JSON.stringify(err);
- });
+ try {
+ if (selectedRadio.value === 'raw') {
+ wasmStore.wasmClient
+ .getWasmContractRawQuery(selected.value, query.value)
+ .then((x) => {
+ result.value = JSON.stringify(x);
+ })
+ .catch((err) => {
+ result.value = JSON.stringify(err);
+ });
+ } else {
+ wasmStore.wasmClient
+ .getWasmContractSmartQuery(selected.value, query.value)
+ .then((x) => {
+ result.value = JSON.stringify(x);
+ })
+ .catch((err) => {
+ result.value = JSON.stringify(err);
+ });
+ }
+ } catch (err) {
+ result.value = JSON.stringify(err); // not works for now
}
- } catch (err) {
- result.value = JSON.stringify(err); // not works for now
- }
- // TODO, show error in the result.
+ // TODO, show error in the result.
}
-const radioContent: CustomInputContent[] = [
- {
- title: 'Raw Query',
- desc: 'Return raw result',
- value: 'raw',
- },
- {
- title: 'Smart Query',
- desc: 'Return structure result if possible',
- value: 'smart',
- },
+const radioContent = [
+ {
+ title: 'Raw Query',
+ desc: 'Return raw result',
+ value: 'raw',
+ },
+ {
+ title: 'Smart Query',
+ desc: 'Return structure result if possible',
+ value: 'smart',
+ },
];
const selectedRadio = ref('raw');
@@ -104,125 +101,130 @@ const query = ref('');
const result = ref('');
-
-
-
- Contract List of Code: {{ props.code_id }}
-
-
-
-
-
- Contract List
- Actions
-
-
-
-
- {{ v }}
-
- contract
+
+
+
+ Contract List of Code: {{ props.code_id }}
+
+
+
+
+
+ Contract List
+ Actions
+
+
+
+
+ {{ v }}
+
+ contract
-
- States
-
-
- Query
-
-
- Execute
-
-
-
-
-
-
-
-
Instantiate Contract
-
-
-
-
-
-
-
-
-
-
Contract Detail
-
â
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Contract States
-
â
-
-
-
-
-
- {{ format.hexToString(v.key) }}
-
-
- {{ format.base64ToString(v.value) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
Instantiate
+ Contract
-
-
-
-
-
-
- Query Contract
-
-
-