PostgreSQL-based state cache for Warp SDK's SmartWeave contracts. Current stable version is 1.1.4. Designed to provide persistent state caching for the Warp Contracts SDK, using PostgreSQL as the backend. Key differentiators: implements the StateSortKeyCache interface, supports efficient state sorting and retrieval, and is intended for production deployments requiring durable state storage. The package is part of the Warp ecosystem and requires warp-contracts >=1.4.19. It ships TypeScript type definitions.
npm install warp-contracts-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connect to Postgres, initialize cache, and integrate with Warp SDK.
Ensure you have proper database migration handling; do not call init() on every app start if tables already exist.
Use import syntax or enable ESM interoperability (e.g., dynamic import).
Ensure DATABASE_URL environment variable is set or provide connection config directly.
Update to use async/await with init() and other methods.
Run 'npm install warp-contracts-postgres' and ensure package.json has 'type':'module' or use .mjs extension.
Start PostgreSQL or correct DATABASE_URL (use localhost:5432 if IPv6 is disabled).
Use a pg.Client instance: const client = new pg.Client(connectionString);