diff --git a/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue b/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue index b3439e1c..383fcf6e 100644 --- a/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue +++ b/src/modules/[chain]/cosmwasm/[code_id]/contracts.vue @@ -7,15 +7,16 @@ import type { PaginabledContracts, } from '../types'; import DynamicComponent from '@/components/dynamic/DynamicComponent.vue'; -import { useFormatter, useTxDialog } from '@/stores'; +import { useBankStore, useBlockchain, useFormatter, useTxDialog } from '@/stores'; import PaginationBar from '@/components/PaginationBar.vue'; -import { PageRequest } from '@/types'; +import { PageRequest, type PaginatedBalances } from '@/types'; const props = defineProps(['code_id', 'chain']); const pageRequest = ref(new PageRequest()); const response = ref({} as PaginabledContracts); +const chainStore = useBlockchain() const wasmStore = useWasmStore(); function loadContract(pageNum: number) { const pr = new PageRequest(); @@ -32,12 +33,18 @@ const infoDialog = ref(false); const info = ref({} as ContractInfo); const state = ref({} as PaginabledContractStates); const selected = ref(''); +const balances = ref({} as PaginatedBalances) function showInfo(address: string) { wasmStore.wasmClient.getWasmContracts(address).then((x) => { info.value = x.contract_info; }); } +function showFunds(address: string) { + chainStore.rpc.getBankBalances(address).then(res => { + balances.value = res + }) +} function showState(address: string) { selected.value = address; pageload(1); @@ -128,9 +135,14 @@ const result = ref(''); @click="showInfo(v)" for="modal-contract-detail" class="btn btn-primary btn-xs text-xs mr-2" - >contractContract + Funds - - + Contract Detail @@ -196,6 +208,28 @@ const result = ref(''); + + + + + + Contract Balances + ✕ + + + + {{ format.formatToken(b) }} {{ b.amount }} + + No Escrowed Assets + + + + + @@ -203,7 +237,6 @@ const result = ref(''); Contract States ✕ Query Contract ✕