This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Inspector is a static Vue.js web application for interacting with smart contracts on the VeChain blockchain. Users can import contract ABIs, call contract functions (read/write), deploy contracts, and manage custom networks.
Live: https://inspector.vecha.in
# Install dependencies
yarn install
# Development server with hot reload
yarn serve
# Production build
yarn build
# Run linter
yarn lintNode.js 16.20.0+ required (see .nvmrc).
- Vue.js 2.7 with Vue Class Components and TypeScript
- Bulma/Buefy for UI components
- Dexie (IndexedDB wrapper) for local persistence
- @vechain/connex for blockchain interaction
/src
/views - Page components (Contracts, ContractDetail, Deploy)
/components - Reusable UI components
/services - Business logic (ImportService, NetworkService, etc.)
/mixin - Vue mixins (AccountCall for contract execution)
/utils - Utility functions
/contracts - Built-in contract ABIs and configs
/abis - ABI type definitions
database.ts - Dexie schema (contracts, filters, shortCuts, networks)
Router.ts - Vue Router config (hash mode)
- Vue Class Components: Use
@Component,@Prop,@Watchdecorators - Service Layer: Business logic in
/services, not in components - Reactive DB: Dexie-Observable for reactive IndexedDB subscriptions
- Network-aware: Contracts filtered by genesis ID; supports main/test/solo/custom networks
contracts- Imported contract ABIs with address, name, network, categoryfilters- Saved contract list viewsshortCuts- Quick-access contract methods (read/write)networks- Custom blockchain network configurations
/contracts- Main contract list/contract/detail- Contract inspection view/deploy- Contract deployment/view/:id/list- Filtered views/view/mgt- Filter management/view/scs- Shortcuts management
- Single quotes, no semicolons, 2-space indentation
- TypeScript strict mode
- Path alias:
@/*maps tosrc/* - PascalCase for components/classes, camelCase for methods/props
- Connex instance available globally via
this.$connex - Built-in contracts include Authority, VTHO, Executor, Params, Extension
- Prototype contract address:
0x000000000000000000000050726f746f74797065 - Genesis IDs identify networks (main, test, solo)
There are TWO contract detail components:
ContractDetailPanel.vue- Used in split-panel layout on Contracts page (THIS IS THE MAIN ONE)ContractDetail.vue- Standalone view at/contract/detailroute
When adding features to contract details, edit ContractDetailPanel.vue.
Set and Map don't trigger Vue 2 reactivity. Use plain objects with this.$set():
// BAD - won't trigger reactivity
private expandedItems = new Set<string>()
this.expandedItems.add(id) // View won't update
// GOOD
private expandedItems: Record<string, boolean> = {}
this.$set(this.expandedItems, id, !this.expandedItems[id])Don't use both @click on trigger and @update:open - causes double-toggle:
<!-- BAD -->
<b-collapse @update:open="onToggle">
<div slot="trigger" @click="onToggle">...</div>
</b-collapse>
<!-- GOOD -->
<b-collapse :open="expanded">
<div slot="trigger" @click.prevent.stop="$emit('toggle')">...</div>
</b-collapse>Use these for theming: --text-color, --text-color-light, --border-color, --primary-color, --code-bg, --body-background, --hover-bg
Applied via [data-theme="dark"] selector:
.my-component {
color: var(--text-color);
}
[data-theme="dark"] {
.my-component {
background-color: #1e1e1e;
}
}Use ::v-deep in scoped styles:
::v-deep .message .message-body {
background-color: #1a1a1a;
}this.$connex- VeChain Connex instancethis.$buefy- Buefy API (toast, dialog, etc.)this.$explorerAccount- Explorer URL for accountsthis.$explorerTx- Explorer URL for transactions{{ address | addr }}- Filter to truncate addresses
- Compact UI - Space-efficient layouts, single-line formats
- No redundant headers - Remove titles that don't add value
- Simplicity - Prefer removing features over over-engineering
- Dark mode support - All components need dark mode styles
- Minimal changes - Don't add extras beyond what's asked