Skip to content

Interface: SealPolicyProvider<P> ​

Defined in: @meddleware/sealed-storage-client/src/types.ts:79

A Seal access policy, mirrored 1:1 with a sealed_storage Move module. Providers are peers — none is privileged. Adding a policy type is a new provider here + a new Move module; existing code is untouched.

Type Parameters ​

P ​

P = Record<string, unknown>

Properties ​

type ​

readonly type: string

Defined in: @meddleware/sealed-storage-client/src/types.ts:81

Stable machine id, e.g. 'nft-gate' | 'time-lock'.

Methods ​

buildApprove() ​

buildApprove(tx, target, idBytes, params): void

Defined in: @meddleware/sealed-storage-client/src/types.ts:95

Append the seal_approve* move call to tx: the identity first, the shared PolicyConfig second (version gate), then the policy's objects. Called at decrypt time to produce the PTB the key servers dry-run.

Parameters ​

tx ​

Transaction

target ​

SealPolicyTarget

idBytes ​

Uint8Array

params ​

P

Returns ​

void


buildId() ​

buildId(params): Uint8Array

Defined in: @meddleware/sealed-storage-client/src/types.ts:88

Build the Seal identity bytes for a new ciphertext (namespace prefix + a random nonce). Called once at encrypt time; the result is persisted in the manifest and reused verbatim to decrypt.

Parameters ​

params ​

P

Returns ​

Uint8Array


describe() ​

describe(): PolicyDescriptor

Defined in: @meddleware/sealed-storage-client/src/types.ts:98

Form/rendering metadata (drives a generic, registry-driven UI).

Returns ​

PolicyDescriptor


parseParams()? ​

optional parseParams(params): P

Defined in: @meddleware/sealed-storage-client/src/types.ts:114

Optional: validate the params of an untrusted manifest and return them narrowed (own, known keys only). Throw an Error on a malformed value (a string where a boolean belongs, a bad object id). When present, parseSealedManifest(raw, registry) calls it at import, so a bad manifest fails there instead of at build.

Parameters ​

params ​

Record<string, unknown>

Returns ​

P


suggest()? ​

optional suggest(context): Promise<Partial<Record<string, FieldSuggestion[]>>>

Defined in: @meddleware/sealed-storage-client/src/types.ts:122

Optional: suggest values for form fields by querying chain state (e.g. objects owned by the connected wallet). Returns a map of fieldName → suggestions[]. Only fields with non-empty suggestion arrays need be included. The UI renders a picker for those fields and falls back to a plain text input when no suggestions are available or the user opts out.

Parameters ​

context ​

SuggestContext

Returns ​

Promise<Partial<Record<string, FieldSuggestion[]>>>


verifyId() ​

verifyId(idBytes, params): void

Defined in: @meddleware/sealed-storage-client/src/types.ts:107

Verify that idBytes (from the stored manifest or the ciphertext) has this policy's layout and is consistent with params (supplied at decrypt time). Throw an Error on mismatch — a corrupted manifest, or params for a different ciphertext. Required: SealController.decrypt calls it before building the approve PTB, so every policy checks the identity it will be approved against.

Parameters ​

idBytes ​

Uint8Array

params ​

P

Returns ​

void

2026 Meddleware. All jams preserved.