Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/snap-networks-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Add shared snap state helpers `IStateManager`, `State`, and `InMemoryState` (Tron-style write mutex plus blob/path locking). ([#288](https://github.com/MetaMask/internal-snaps/pull/288))
- Add shared caching utilities for network snaps ([#287](https://github.com/MetaMask/internal-snaps/pull/287))
- `ICache`, `CacheEntry`, and `TimestampMilliseconds` for describing a generic cache
- `InMemoryCache`, a TTL-backed in-memory cache
- `StateCache`, a cache backed by a snap state manager
- `useCache` and `useCacheUntil` for wrapping functions with fixed-TTL and dynamic-expiry caching
- Add shared proof-of-ownership message parsing utilities, batch request/response structs, and batch request/response types. ([#268](https://github.com/MetaMask/internal-snaps/pull/268))
- Add a `UuidStruct` Superstruct for validating UUID v4 strings. ([#243](https://github.com/MetaMask/internal-snaps/pull/243))
- Add helpers `serialize`, `deserialize`, and `Serializable` for round-tripping `BigNumber`, `bigint`, `Uint8Array`, and `undefined` through snap state ([#197](https://github.com/MetaMask/internal-snaps/pull/197))
Expand Down
20 changes: 20 additions & 0 deletions packages/snap-networks-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,26 @@ export {
normalizeError,
} from './utils/errors';
export { InFlightCoalescer } from './utils/dedupe/InFlightCoalescer';
export { InMemoryCache } from './utils/cache/InMemoryCache';
export { StateCache } from './utils/cache/StateCache';
export { useCache } from './utils/cache/useCache';
export { useCacheUntil } from './utils/cache/useCacheUntil';
export type { CacheOptions } from './utils/cache/useCache';
export type {
CacheUntilOptions,
ResultWithExpiry,
} from './utils/cache/useCacheUntil';
export type {
ICache,
CacheEntry,
TimestampMilliseconds,
} from './utils/cache/types';
export type {
CacheStateManager,
CacheStore,
CachePrefix,
StateValue,
} from './utils/cache/StateCache';
export type {
CreateSnapErrorHandlingOptions,
CreateTrackErrorOptions,
Expand Down
Loading