Skip to content

StoreOptions

Defined in: packages/store-kit/src/Store.ts:71

Properties

conflictStrategy?

optional conflictStrategy: Record<string, ConflictStrategy>

Defined in: packages/store-kit/src/Store.ts:78

Per-path conflict resolution strategy. The key '*' is the fallback used when no exact path match exists. Defaults to { '*': 'manual' }.


contractType?

optional contractType: ContractType

Defined in: packages/store-kit/src/Store.ts:115

Discriminator persisted in the on-chain contract_type global state slot. Either "object" (this store holds user data) or "schema" (this store holds a JSON Schema document referenced by other apps via schemaAppId). Defaults to "object".


name?

optional name: string

Defined in: packages/store-kit/src/Store.ts:108

Human-readable contract name persisted in the on-chain contract_name global state slot. Used by a future registry contract to look up deployments by name; for now it’s purely informational. Defaults to "" (unset).


schema?

optional schema: null | JSONSchema | SchemaConfig

Defined in: packages/store-kit/src/Store.ts:101

Optional JSON-Schema describing the shape of TState. When provided, matching subtrees are ARC4-packed for efficient on-chain storage — mirroring how struct types are packed in Algorand smart contracts.

The schema document is now a pure CLIENT-SIDE concern: nothing about it is persisted on-chain. Change detection happens off-chain by watching the schema document itself; if you need a discoverable pointer to where the schema lives, deploy a sibling Lodash app of type === "schema" and set this store’s schemaAppId to point at it.

Schema-covered paths are routed through the contract’s set_bytes/get_bytes ABI methods as raw ARC4 bytes, so other contracts can decode them natively with arc4.decode. Paths NOT covered by the schema (partial-schema fallback) continue to use the legacy set/get JSON-string path.

See objects/schema/types.ts for the supported subset of JSON Schema and the x-storekit-box: "whole" | "leaves" vendor extension that controls box granularity per subtree.


schemaAppId?

optional schemaAppId: bigint

Defined in: packages/store-kit/src/Store.ts:122

Optional pointer to another Lodash app of type "schema" whose boxes hold the canonical JSON Schema document for this store. 0n / undefined means “no schema app”. Persisted in the on-chain schema_app_id global state slot.


sync?

optional sync: boolean

Defined in: packages/store-kit/src/Store.ts:73

Auto-save on every state mutation when a client is bound.