Registry / storage / verto-cache-interface

verto-cache-interface

JSON →
library1.2.6jsnpmunverified

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.

npm install verto-cache-interface
INSTALL
IMPORT
SIG · VERTO-CACHE-INTERF
V
verto-cache-interface
storagejavascriptv1.2.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fetchContract
✓ import { fetchContract } from 'verto-cache-interface'
✗ const fetchContract = require('verto-cache-interface').fetchContract
ESM-only package; CommonJS require() works but is not recommended.
fetchBalanceByUserAddress
✓ import { fetchBalanceByUserAddress } from 'verto-cache-interface'
Named export; no default export available.
fetchBalancesForAddress
✓ import { fetchBalancesForAddress } from 'verto-cache-interface'
✗ const fetchBalancesForAddress = require('verto-cache-interface').fetchBalancesForAddress
ESM-only; CommonJS usage leads to runtime error if used incorrectly.

Demonstrates how to import and use fetchContract, fetchBalanceByUserAddress, and fetchBalancesForAddress to interact with Verto Cache System.

import { fetchContract, fetchBalanceByUserAddress, fetchBalancesForAddress } from 'verto-cache-interface'; // Fetch contract state fetchContract('t9T7DIOGxx4VWXoCEeYYarFYeERTpWIC1V3y-BPZgKE').then(result => { console.log('State:', result.state); console.log('Validity:', result.validity); }); // Fetch user balance in a specific contract fetchBalanceByUserAddress('bQGRi3eO4p7S583mYYXDeVn5EvGPFMiMWd5WBWatteY', 'vxUdiv2fGHMiIoek5E4l3M5qSuKCZtSaOBYjMRc94JU').then(result => { console.log('Balance:', result.balance); }); // Fetch all balances for an address fetchBalancesForAddress('vxUdiv2fGHMiIoek5E4l3M5qSuKCZtSaOBYjMRc94JU', 'art').then(balances => { balances.forEach(b => console.log(b.contractId, b.balance)); });
Debug
Known issues
gotchaAll 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.
fix
Wrap calls in try/catch and consider using Promise.race with a timeout.
affects: >=0.0.0
breakingIn 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.
fix
Update to v1.0.0 or later and adjust calls to pass third argument if needed.
affects: <1.0.0
gotchaThe package does not include any built-in retry or caching. Frequent calls may hit rate limits or incur high latency.
fix
Implement your own caching and debouncing.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'state')
fetchContract resolved to undefined because contractId was invalid and dontThrow was true or not set?
fix
Ensure contractId is correct and set dontThrow to false (or leave default) to get a thrown error instead of undefined.
Error: Contract not found
The contract ID does not exist in the Verto Cache.
fix
Check the contract ID for typos or verify it exists on the Verto network.
Upgrade
Version history
1.2.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
Resources
verto-cache-interface — npm install verto-cache-interface · libregistry