# Vue Kaspa — Full API Reference > Vue 3 plugin and Nuxt 3 module providing reactive composables for the Kaspa blockchain, powered by @vue-kaspa/kaspa-wasm. Package: vue-kaspa Version: 0.1.14 Peer deps: vue >= 3.4.0, @vue-kaspa/kaspa-wasm >= 1.1.0, @nuxt/kit ^3.0.0 (optional) Types: ./dist/index.d.ts Nuxt entry: vue-kaspa/nuxt --- ## Installation ```bash npm install vue-kaspa @vue-kaspa/kaspa-wasm ``` Vite config (required): ```ts import wasm from 'vite-plugin-wasm' import topLevelAwait from 'vite-plugin-top-level-await' plugins: [vue(), wasm(), topLevelAwait()] server.headers: { 'Cross-Origin-Embedder-Policy': 'credentialless', 'Cross-Origin-Opener-Policy': 'same-origin' } optimizeDeps.exclude: ['@vue-kaspa/kaspa-wasm'] ``` --- ## Vue Plugin Setup ```ts import { VueKaspa } from 'vue-kaspa' app.use(VueKaspa, { network: 'mainnet', autoConnect: true }) ``` ## Nuxt Setup ```ts // nuxt.config.ts modules: ['vue-kaspa/nuxt'] kaspa: { network: 'mainnet', autoConnect: true, panicHook: 'browser' } // composables are auto-imported — no explicit imports in .vue files ``` --- ## VueKaspaOptions ```ts interface VueKaspaOptions { network?: KaspaNetwork // default: 'mainnet' url?: string // custom node WS URL resolver?: boolean // default: true (public resolver) encoding?: RpcEncoding // default: 'Borsh' autoConnect?: boolean // default: true devtools?: boolean // default: true in dev panicHook?: 'console' | 'browser' | false // default: 'console' } ``` --- ## useKaspa() — WasmStatus lifecycle ```ts const kaspa = useKaspa() // kaspa.wasmStatus: Readonly> // kaspa.wasmError: Readonly> // kaspa.isReady: ComputedRef // kaspa.init(): Promise — idempotent, shared promise // kaspa.reset(): void — back to 'idle' await kaspa.init() // load WASM; not needed if autoConnect: true ``` States: idle → loading → ready | error (retry with init()) Singleton: all components share the same WasmStatus ref. --- ## useRpc(options?) — RPC connection ```ts const rpc = useRpc() // Reactive state (all readonly refs): rpc.connectionState // 'disconnected'|'connecting'|'connected'|'reconnecting'|'error' rpc.isConnected // ComputedRef rpc.url // Ref rpc.networkId // Ref rpc.serverVersion // Ref rpc.isSynced // Ref rpc.virtualDaaScore // Ref rpc.error // Ref rpc.eventLog // Ref — ring buffer, last 200 // Connection: await rpc.connect(options?) // options: { url?, resolver?, network?, encoding? } await rpc.disconnect() await rpc.reconnect() // Queries (all throw KaspaRpcError on failure): await rpc.getInfo() // → ServerInfo await rpc.getBlock(hash: string) // → BlockInfo await rpc.getBlockCount() // → { blockCount: bigint, headerCount: bigint } await rpc.getBalanceByAddress(addr) // → { address, balance: bigint } await rpc.getBalancesByAddresses(addrs[]) // → BalanceResult[] await rpc.getUtxosByAddresses(addrs[]) // → UtxoEntry[] await rpc.getMempoolEntries(includeOrphans?) // → MempoolEntry[] await rpc.getMempoolEntriesByAddresses(addrs[]) // → MempoolEntry[] await rpc.getFeeEstimate() // → FeeEstimate await rpc.getCoinSupply() // → { circulatingCoinSupply, maxCoinSupply } await rpc.ping() // → void await rpc.submitTransaction(tx) // → txId string await rpc.subscribeUtxosChanged(addrs[]) await rpc.unsubscribeUtxosChanged(addrs[]) // Events: rpc.on('block-added', (event: RpcEvent) => { ... }) rpc.off('block-added', handler) rpc.clearEventLog() // Handlers inside