{"id":46753,"library":"verto-cache-interface","title":"Verto Cache Interface","description":"A TypeScript client library for communicating with the Verto Cache System, providing methods to fetch contract states, user balances, and collection data from the Verto blockchain indexing service. Current version 1.2.6 is stable with no regular release cadence. It is designed specifically for the Verto ecosystem (Arweave-based) and differs from general-purpose blockchain indexers by being tightly coupled to Verto's cache API and data structures. Ships TypeScript definitions.","status":"active","version":"1.2.6","language":"javascript","source_language":"en","source_url":"https://github.com/useverto/cache-interface","tags":["javascript","typescript"],"install":[{"cmd":"npm install verto-cache-interface","lang":"bash","label":"npm"},{"cmd":"yarn add verto-cache-interface","lang":"bash","label":"yarn"},{"cmd":"pnpm add verto-cache-interface","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only package; CommonJS require() works but is not recommended.","wrong":"const fetchContract = require('verto-cache-interface').fetchContract","symbol":"fetchContract","correct":"import { fetchContract } from 'verto-cache-interface'"},{"note":"Named export; no default export available.","wrong":null,"symbol":"fetchBalanceByUserAddress","correct":"import { fetchBalanceByUserAddress } from 'verto-cache-interface'"},{"note":"ESM-only; CommonJS usage leads to runtime error if used incorrectly.","wrong":"const fetchBalancesForAddress = require('verto-cache-interface').fetchBalancesForAddress","symbol":"fetchBalancesForAddress","correct":"import { fetchBalancesForAddress } from 'verto-cache-interface'"}],"quickstart":{"code":"import { fetchContract, fetchBalanceByUserAddress, fetchBalancesForAddress } from 'verto-cache-interface';\n\n// Fetch contract state\nfetchContract('t9T7DIOGxx4VWXoCEeYYarFYeERTpWIC1V3y-BPZgKE').then(result => {\n  console.log('State:', result.state);\n  console.log('Validity:', result.validity);\n});\n\n// Fetch user balance in a specific contract\nfetchBalanceByUserAddress('bQGRi3eO4p7S583mYYXDeVn5EvGPFMiMWd5WBWatteY', 'vxUdiv2fGHMiIoek5E4l3M5qSuKCZtSaOBYjMRc94JU').then(result => {\n  console.log('Balance:', result.balance);\n});\n\n// Fetch all balances for an address\nfetchBalancesForAddress('vxUdiv2fGHMiIoek5E4l3M5qSuKCZtSaOBYjMRc94JU', 'art').then(balances => {\n  balances.forEach(b => console.log(b.contractId, b.balance));\n});","lang":"typescript","description":"Demonstrates how to import and use fetchContract, fetchBalanceByUserAddress, and fetchBalancesForAddress to interact with Verto Cache System."},"warnings":[{"fix":"Wrap calls in try/catch and consider using Promise.race with a timeout.","message":"All API calls rely on an external Verto Cache API. If the API is down or unreachable, functions may hang or reject without clear error messages. Always implement timeout/error handling.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Update to v1.0.0 or later and adjust calls to pass third argument if needed.","message":"In version 1.0.0, the fetchContract signature changed: the 'dontThrow' parameter was added. Prior to v1.0.0, function did not have this parameter and would always throw on missing contract.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Implement your own caching and debouncing.","message":"The package does not include any built-in retry or caching. Frequent calls may hit rate limits or incur high latency.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.2.6':34 'api':69 'arweav':51 'arweave-bas':50 'balanc':22 'base':52 'blockchain':29,59 'cach':2,13,68 'cadenc':41 'client':6 'collect':24 'communic':9 'contract':19 'coupl':64 'current':32 'data':25,71 'definit':75 'design':44 'differ':54 'ecosystem':49 'fetch':18 'general':57 'general-purpos':56 'index':30,60 'interfac':3 'javascript':76 'librari':7 'method':16 'provid':15 'purpos':58 'regular':39 'releas':40 'servic':31 'ship':73 'specif':45 'stabl':36 'state':20 'structur':72 'system':14 'tight':63 'typescript':5,74,77 'user':21 'version':33 'verto':1,12,28,48,66","created_at":"2026-06-07T13:01:27.630386+00:00","updated_at":"2026-06-07T13:01:27.630386+00:00","problems":[{"fix":"Ensure contractId is correct and set dontThrow to false (or leave default) to get a thrown error instead of undefined.","cause":"fetchContract resolved to undefined because contractId was invalid and dontThrow was true or not set?","error":"TypeError: Cannot read properties of undefined (reading 'state')"},{"fix":"Check the contract ID for typos or verify it exists on the Verto network.","cause":"The contract ID does not exist in the Verto Cache.","error":"Error: Contract not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/useverto/cache-interface#readme","github":"https://github.com/useverto/cache-interface","docs":null,"changelog":null,"pypi":null,"npm":"verto-cache-interface","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}